@posthog/wizard 2.23.0 → 2.24.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 (55) hide show
  1. package/README.md +61 -2
  2. package/dist/{AiOptInRequiredScreen-BOMyYFep.js → AiOptInRequiredScreen-DPn1CCeD.js} +11 -576
  3. package/dist/AiOptInRequiredScreen-DPn1CCeD.js.map +1 -0
  4. package/dist/{add-mcp-server-to-clients-BEziI3z9.js → add-mcp-server-to-clients-BU8Owthq.js} +4 -4
  5. package/dist/{add-mcp-server-to-clients-BEziI3z9.js.map → add-mcp-server-to-clients-BU8Owthq.js.map} +1 -1
  6. package/dist/{agent-interface-DjMPlXl0.js → agent-interface-CysYcZl5.js} +6 -7
  7. package/dist/agent-interface-CysYcZl5.js.map +1 -0
  8. package/dist/{agent-runner-Bv-7z-pQ.js → agent-runner-Br0OxBxd.js} +8 -8
  9. package/dist/{agent-runner-Bv-7z-pQ.js.map → agent-runner-Br0OxBxd.js.map} +1 -1
  10. package/dist/{analytics-9D4eGgmT.js → analytics-BOWrR4qd.js} +11 -2
  11. package/dist/{analytics-9D4eGgmT.js.map → analytics-BOWrR4qd.js.map} +1 -1
  12. package/dist/{api-Dwd0B-E9.js → api-RXTR8yZo.js} +3 -3
  13. package/dist/{api-Dwd0B-E9.js.map → api-RXTR8yZo.js.map} +1 -1
  14. package/dist/bin.js +875 -423
  15. package/dist/bin.js.map +1 -1
  16. package/dist/{ci-install-DGXCpvKh.js → ci-install-BscZ60Ec.js} +5 -5
  17. package/dist/{ci-install-DGXCpvKh.js.map → ci-install-BscZ60Ec.js.map} +1 -1
  18. package/dist/{debug-CgT5MmVB.js → debug-BUdVZP84.js} +2 -2
  19. package/dist/{debug-CgT5MmVB.js.map → debug-BUdVZP84.js.map} +1 -1
  20. package/dist/{debug-DayHBBST.js → debug-BgH07S-e.js} +1 -1
  21. package/dist/{environment-CI2pTYTG.js → environment-G0Hv6_JI.js} +3 -3
  22. package/dist/{environment-CI2pTYTG.js.map → environment-G0Hv6_JI.js.map} +1 -1
  23. package/dist/{interactive-D52p_opJ.js → interactive-fh2iyewb.js} +3 -3
  24. package/dist/{interactive-D52p_opJ.js.map → interactive-fh2iyewb.js.map} +1 -1
  25. package/dist/{mcp-prompt-streaming-tdoy9UJ2.js → mcp-prompt-streaming-DUtbxnNy.js} +4 -4
  26. package/dist/{mcp-prompt-streaming-tdoy9UJ2.js.map → mcp-prompt-streaming-DUtbxnNy.js.map} +1 -1
  27. package/dist/{non-interactive-6hadW20x.js → non-interactive-BfqXlY8R.js} +2 -2
  28. package/dist/{non-interactive-6hadW20x.js.map → non-interactive-BfqXlY8R.js.map} +1 -1
  29. package/dist/{package-manager-BI0J5E7t.js → package-manager-Ca1maxU-.js} +2 -2
  30. package/dist/{package-manager-BI0J5E7t.js.map → package-manager-Ca1maxU-.js.map} +1 -1
  31. package/dist/{playground-z4A5dHPv.js → playground-4sqLVVJL.js} +5 -10
  32. package/dist/{playground-z4A5dHPv.js.map → playground-4sqLVVJL.js.map} +1 -1
  33. package/dist/{posthog-integration-BWbZU9Xq.js → posthog-integration-Bz3HWkHn.js} +11 -11
  34. package/dist/{posthog-integration-BWbZU9Xq.js.map → posthog-integration-Bz3HWkHn.js.map} +1 -1
  35. package/dist/{provisioning-B30Be2NA.js → provisioning-CgwvlsIl.js} +3 -3
  36. package/dist/{provisioning-B30Be2NA.js.map → provisioning-CgwvlsIl.js.map} +1 -1
  37. package/dist/{registry-CD_DplSQ.js → registry-CEnQVctL.js} +4 -4
  38. package/dist/{registry-CD_DplSQ.js.map → registry-CEnQVctL.js.map} +1 -1
  39. package/dist/{setup-utils-Dwgkk8AQ.js → setup-utils-Doh69vo4.js} +8 -8
  40. package/dist/{setup-utils-Dwgkk8AQ.js.map → setup-utils-Doh69vo4.js.map} +1 -1
  41. package/dist/{start-tui-SLeEzlJs.js → start-tui-CywbSvZE.js} +34 -1029
  42. package/dist/start-tui-CywbSvZE.js.map +1 -0
  43. package/dist/{steps-B1gzyRkC.js → steps-DJojDYQ-.js} +6 -6
  44. package/dist/{steps-B1gzyRkC.js.map → steps-DJojDYQ-.js.map} +1 -1
  45. package/dist/{telemetry-5rkeTd2_.js → telemetry-8zMpaIuK.js} +3 -3
  46. package/dist/{telemetry-5rkeTd2_.js.map → telemetry-8zMpaIuK.js.map} +1 -1
  47. package/dist/{urls-Cb4SI9kf.js → urls-BUfvQmU4.js} +2 -2
  48. package/dist/{urls-Cb4SI9kf.js.map → urls-BUfvQmU4.js.map} +1 -1
  49. package/dist/{wizard-abort-DovHQa-j.js → wizard-abort-BdGW4Tvi.js} +3 -3
  50. package/dist/{wizard-abort-DovHQa-j.js.map → wizard-abort-BdGW4Tvi.js.map} +1 -1
  51. package/dist/{wizard-abort-DW2-ZjiS.js → wizard-abort-Ni-mKJ58.js} +1 -1
  52. package/package.json +1 -1
  53. package/dist/AiOptInRequiredScreen-BOMyYFep.js.map +0 -1
  54. package/dist/agent-interface-DjMPlXl0.js.map +0 -1
  55. package/dist/start-tui-SLeEzlJs.js.map +0 -1
@@ -1,16 +1,16 @@
1
- import { A as OAUTH_PORTS, J as WIZARD_TOOLS_MENU_FLAG_KEY, L as POSTHOG_ORG_AI_SETTINGS_URL, P as POSTHOG_DOCS_URL, R as POSTHOG_PRIVACY_URL, U as REMOTE_SKILLS_BASE_URL, V as POSTHOG_TERMS_URL, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as OAUTH_TIMEOUT_MS, k as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys } from "./debug-CgT5MmVB.js";
2
- import { t as analytics } from "./analytics-9D4eGgmT.js";
3
- import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-Dwgkk8AQ.js";
4
- import { a as getUiHostFromHost } from "./urls-Cb4SI9kf.js";
5
- import { t as ApiError } from "./api-Dwd0B-E9.js";
1
+ import { A as OAUTH_PORTS, J as WIZARD_TOOLS_MENU_FLAG_KEY, L as POSTHOG_ORG_AI_SETTINGS_URL, P as POSTHOG_DOCS_URL, R as POSTHOG_PRIVACY_URL, U as REMOTE_SKILLS_BASE_URL, V as POSTHOG_TERMS_URL, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as OAUTH_TIMEOUT_MS, k as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys } from "./debug-BUdVZP84.js";
2
+ import { t as analytics } from "./analytics-BOWrR4qd.js";
3
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-Doh69vo4.js";
4
+ import { a as getUiHostFromHost } from "./urls-BUfvQmU4.js";
5
+ import { t as ApiError } from "./api-RXTR8yZo.js";
6
6
  import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-G3VWD6hv.js";
7
- import { i as wizardAbort } from "./wizard-abort-DovHQa-j.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-DjMPlXl0.js";
9
- import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-BWbZU9Xq.js";
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 useKeyBindings, C as EventPlanViewer, E as ConfirmationInput, F as WizardStore, M as LoadingBox, N as SplitView, O as useStdoutDimensions, S as ScreenContainer, T as ModalOverlay, _ as TipsCard, a as SlackConnectScreen, b as HNViewer, c as VisualBox, f as McpScreen, g as ServiceHealthList, h as SEVERITY_ORDER, i as OutroScreen, j as ProgressList, k as PickerMenu, l as AuditChecksViewer, m as SEVERITY_LABEL, n as SkillSourceInfo, o as AUDIT_3000_AREA_SLIDES, p as IssueTable, r as useSkillEntry, s as AUDIT_AREA_SLIDES, t as AiOptInRequiredScreen, u as McpSuggestedPromptsScreen, v as LearnCard, w as LogViewer, x as TabContainer } from "./AiOptInRequiredScreen-BOMyYFep.js";
7
+ import { i as wizardAbort } from "./wizard-abort-BdGW4Tvi.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-CysYcZl5.js";
9
+ import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-Bz3HWkHn.js";
10
+ import { _ as POSTHOG_SDKS, d as DISPLAY_NAME, f as SOURCE_MAPS_CONTEXT_KEYS, g as getContentBlocks, h as fetchHealthIssues, l as Program, n as useKeyBindings, t as PickerMenu, u as getProgramConfig, v as STRIPE_SDKS } from "./bin.js";
11
+ import { A as SplitView, C as LogViewer, D as useStdoutDimensions, M as WizardStore, O as ProgressList, S as EventPlanViewer, T as ConfirmationInput, _ as LearnCard, a as SlackConnectScreen, b as TabContainer, c as AuditChecksViewer, d as McpScreen, f as IssueTable, g as TipsCard, h as ServiceHealthList, i as OutroScreen, k as LoadingBox, l as McpSuggestedPromptsScreen, m as SEVERITY_ORDER, n as SkillSourceInfo, o as AUDIT_AREA_SLIDES, p as SEVERITY_LABEL, r as useSkillEntry, s as VisualBox, t as AiOptInRequiredScreen, w as ModalOverlay, x as ScreenContainer, y as HNViewer } from "./AiOptInRequiredScreen-DPn1CCeD.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-BEziI3z9.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-BU8Owthq.js";
14
14
  import * as fs$1 from "fs";
15
15
  import path from "path";
16
16
  import { join as join$1 } from "node:path";
@@ -1060,7 +1060,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1060
1060
  })),
1061
1061
  onSelect: (value) => {
1062
1062
  const integration = Array.isArray(value) ? value[0] : value;
1063
- import("./registry-CD_DplSQ.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1063
+ import("./registry-CEnQVctL.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1064
1064
  const config = FRAMEWORK_REGISTRY[integration];
1065
1065
  store.setFrameworkConfig(integration, config);
1066
1066
  store.setDetectedFramework(config.metadata.name);
@@ -2328,18 +2328,18 @@ function useFileWatcher(path, onUpdate, options = {}) {
2328
2328
  *
2329
2329
  * Pressing `O` opens the active slide's docs URL.
2330
2330
  */
2331
- const FINDING_STATUSES$1 = [
2331
+ const FINDING_STATUSES = [
2332
2332
  "error",
2333
2333
  "warning",
2334
2334
  "suggestion"
2335
2335
  ];
2336
- const isFinding$1 = (c) => FINDING_STATUSES$1.includes(c.status);
2337
- const fallbackSlide$1 = (area) => ({
2336
+ const isFinding = (c) => FINDING_STATUSES.includes(c.status);
2337
+ const fallbackSlide = (area) => ({
2338
2338
  area,
2339
2339
  intro: [`Verifying ${area.toLowerCase()}…`],
2340
2340
  docsUrl: ""
2341
2341
  });
2342
- const openLink$1 = (url) => {
2342
+ const openLink = (url) => {
2343
2343
  spawn(process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open", process.platform === "win32" ? [
2344
2344
  "/c",
2345
2345
  "start",
@@ -2352,9 +2352,9 @@ const openLink$1 = (url) => {
2352
2352
  };
2353
2353
  const AuditAreaPane = ({ checks, reportPath, slides = AUDIT_AREA_SLIDES, dashboardUrl, notebookUrl }) => {
2354
2354
  const activeArea = checks.filter((c) => c.status === "pending")[0]?.area;
2355
- const slide = activeArea ? slides.find((s) => s.area === activeArea) ?? fallbackSlide$1(activeArea) : null;
2355
+ const slide = activeArea ? slides.find((s) => s.area === activeArea) ?? fallbackSlide(activeArea) : null;
2356
2356
  useInput((input) => {
2357
- if (input.toLowerCase() === "o" && slide?.docsUrl) openLink$1(slide.docsUrl);
2357
+ if (input.toLowerCase() === "o" && slide?.docsUrl) openLink(slide.docsUrl);
2358
2358
  });
2359
2359
  const urlsFooter = dashboardUrl || notebookUrl ? /* @__PURE__ */ jsx(UrlsFooter, {
2360
2360
  dashboardUrl,
@@ -2362,18 +2362,18 @@ const AuditAreaPane = ({ checks, reportPath, slides = AUDIT_AREA_SLIDES, dashboa
2362
2362
  }) : null;
2363
2363
  if (slide) return /* @__PURE__ */ jsxs(Box, {
2364
2364
  flexDirection: "column",
2365
- children: [/* @__PURE__ */ jsx(ActiveSlide$1, {
2365
+ children: [/* @__PURE__ */ jsx(ActiveSlide, {
2366
2366
  slide,
2367
- hasFindings: checks.some(isFinding$1)
2367
+ hasFindings: checks.some(isFinding)
2368
2368
  }), urlsFooter]
2369
2369
  });
2370
2370
  if (checks.length === 0) return null;
2371
2371
  return /* @__PURE__ */ jsxs(Box, {
2372
2372
  flexDirection: "column",
2373
- children: [/* @__PURE__ */ jsx(WritingReport$1, { reportPath }), urlsFooter]
2373
+ children: [/* @__PURE__ */ jsx(WritingReport, { reportPath }), urlsFooter]
2374
2374
  });
2375
2375
  };
2376
- const ActiveSlide$1 = ({ slide, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
2376
+ const ActiveSlide = ({ slide, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
2377
2377
  flexDirection: "column",
2378
2378
  paddingX: 1,
2379
2379
  children: [
@@ -2428,7 +2428,7 @@ const UrlsFooter = ({ dashboardUrl, notebookUrl }) => /* @__PURE__ */ jsxs(Box,
2428
2428
  })] })
2429
2429
  ]
2430
2430
  });
2431
- const WritingReport$1 = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
2431
+ const WritingReport = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
2432
2432
  flexDirection: "column",
2433
2433
  paddingX: 1,
2434
2434
  children: [
@@ -2778,7 +2778,7 @@ const EVENTS_AUDIT_AREA_SLIDES = [
2778
2778
  ];
2779
2779
  //#endregion
2780
2780
  //#region src/ui/tui/screens/audit/PendingChecksList.tsx
2781
- function groupByArea$1(checks) {
2781
+ function groupByArea(checks) {
2782
2782
  const order = [];
2783
2783
  const map = /* @__PURE__ */ new Map();
2784
2784
  for (const c of checks) {
@@ -2793,7 +2793,7 @@ function groupByArea$1(checks) {
2793
2793
  checks: map.get(area)
2794
2794
  }));
2795
2795
  }
2796
- function groupIcon$1(group) {
2796
+ function groupIcon(group) {
2797
2797
  const total = group.checks.length;
2798
2798
  const complete = group.checks.filter((c) => c.status !== "pending").length;
2799
2799
  if (complete === 0) return {
@@ -2809,10 +2809,10 @@ function groupIcon$1(group) {
2809
2809
  color: Colors.primary
2810
2810
  };
2811
2811
  }
2812
- const GroupHeader$1 = ({ group, showIcon, isActive }) => {
2812
+ const GroupHeader = ({ group, showIcon, isActive }) => {
2813
2813
  const complete = group.checks.filter((c) => c.status !== "pending").length;
2814
2814
  const total = group.checks.length;
2815
- const { icon, color } = groupIcon$1(group);
2815
+ const { icon, color } = groupIcon(group);
2816
2816
  return /* @__PURE__ */ jsxs(Box, { children: [isActive ? /* @__PURE__ */ jsx(Box, {
2817
2817
  marginRight: 1,
2818
2818
  children: /* @__PURE__ */ jsx(Spinner, {})
@@ -2861,7 +2861,7 @@ const PendingChecksList = ({ checks }) => {
2861
2861
  /* @__PURE__ */ jsx(LoadingBox, { message: "Seeding audit checklist..." })
2862
2862
  ]
2863
2863
  });
2864
- const groups = groupByArea$1(checks);
2864
+ const groups = groupByArea(checks);
2865
2865
  const activeIndex = groups.findIndex((g) => g.checks.some((c) => c.status === "pending"));
2866
2866
  return /* @__PURE__ */ jsxs(Box, {
2867
2867
  flexDirection: "column",
@@ -2871,14 +2871,14 @@ const PendingChecksList = ({ checks }) => {
2871
2871
  children: "Checks"
2872
2872
  }),
2873
2873
  /* @__PURE__ */ jsx(Text, { children: " " }),
2874
- termRows < COLLAPSE_BELOW_ROWS ? groups.map((group, i) => /* @__PURE__ */ jsx(GroupHeader$1, {
2874
+ termRows < COLLAPSE_BELOW_ROWS ? groups.map((group, i) => /* @__PURE__ */ jsx(GroupHeader, {
2875
2875
  group,
2876
2876
  showIcon: true,
2877
2877
  isActive: i === activeIndex
2878
2878
  }, group.area)) : groups.map((group, i) => /* @__PURE__ */ jsxs(Box, {
2879
2879
  flexDirection: "column",
2880
2880
  marginTop: i === 0 ? 0 : 1,
2881
- children: [/* @__PURE__ */ jsx(GroupHeader$1, {
2881
+ children: [/* @__PURE__ */ jsx(GroupHeader, {
2882
2882
  group,
2883
2883
  showIcon: false,
2884
2884
  isActive: i === activeIndex
@@ -2900,7 +2900,7 @@ const AuditRunScreen = ({ store }) => {
2900
2900
  const areaPane = /* @__PURE__ */ jsx(AuditAreaPane, {
2901
2901
  checks,
2902
2902
  reportPath,
2903
- slides: store.session.skillId === "events-audit" ? EVENTS_AUDIT_AREA_SLIDES : AUDIT_AREA_SLIDES,
2903
+ slides: store.session.skillId === "audit-events" ? EVENTS_AUDIT_AREA_SLIDES : AUDIT_AREA_SLIDES,
2904
2904
  dashboardUrl: store.session.dashboardUrl,
2905
2905
  notebookUrl: store.session.notebookUrl
2906
2906
  });
@@ -3126,998 +3126,6 @@ const AuditOutroScreen = ({ store }) => {
3126
3126
  });
3127
3127
  };
3128
3128
  //#endregion
3129
- //#region src/ui/tui/screens/audit-3000/arcade-colors.ts
3130
- const NEON_PINK$2 = "#F54E00";
3131
- const NEON_BLUE$2 = "#1D4AFF";
3132
- const NEON_GOLD$2 = "#F9BD2B";
3133
- //#endregion
3134
- //#region src/ui/tui/screens/audit-3000/Audit3000IntroScreen.tsx
3135
- const AUDIT3000_SKILL_ID = "audit-3000";
3136
- const ArcadeBanner = () => {
3137
- const [blinkOn, setBlinkOn] = useState(true);
3138
- useEffect(() => {
3139
- const id = setInterval(() => setBlinkOn((v) => !v), 600);
3140
- return () => clearInterval(id);
3141
- }, []);
3142
- const top = "┏" + "━".repeat(32) + "┓";
3143
- const bottom = "┗" + "━".repeat(32) + "┛";
3144
- return /* @__PURE__ */ jsxs(Box, {
3145
- flexDirection: "column",
3146
- alignItems: "center",
3147
- children: [
3148
- /* @__PURE__ */ jsx(Text, {
3149
- bold: true,
3150
- color: NEON_PINK$2,
3151
- children: top
3152
- }),
3153
- /* @__PURE__ */ jsxs(Text, { children: [
3154
- /* @__PURE__ */ jsx(Text, {
3155
- bold: true,
3156
- color: NEON_PINK$2,
3157
- children: "┃"
3158
- }),
3159
- /* @__PURE__ */ jsx(Text, {
3160
- bold: true,
3161
- color: NEON_GOLD$2,
3162
- children: " A U D I T "
3163
- }),
3164
- /* @__PURE__ */ jsx(Text, {
3165
- bold: true,
3166
- color: NEON_BLUE$2,
3167
- children: "-"
3168
- }),
3169
- /* @__PURE__ */ jsx(Text, {
3170
- bold: true,
3171
- color: NEON_GOLD$2,
3172
- children: " 3 0 0 0 "
3173
- }),
3174
- /* @__PURE__ */ jsx(Text, {
3175
- bold: true,
3176
- color: NEON_PINK$2,
3177
- children: "┃"
3178
- })
3179
- ] }),
3180
- /* @__PURE__ */ jsxs(Text, { children: [
3181
- /* @__PURE__ */ jsx(Text, {
3182
- bold: true,
3183
- color: NEON_PINK$2,
3184
- children: "┃"
3185
- }),
3186
- /* @__PURE__ */ jsx(Text, {
3187
- dimColor: !blinkOn,
3188
- color: NEON_BLUE$2,
3189
- children: " ▶ INSERT COIN TO PLAY ◀ "
3190
- }),
3191
- /* @__PURE__ */ jsx(Text, {
3192
- bold: true,
3193
- color: NEON_PINK$2,
3194
- children: "┃"
3195
- })
3196
- ] }),
3197
- /* @__PURE__ */ jsx(Text, {
3198
- bold: true,
3199
- color: NEON_PINK$2,
3200
- children: bottom
3201
- })
3202
- ]
3203
- });
3204
- };
3205
- const Audit3000IntroScreen = ({ store }) => {
3206
- useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
3207
- const [showingMoreInfo, setShowingMoreInfo] = useState(false);
3208
- const { session } = store;
3209
- const { skillEntry, fetchFailed } = useSkillEntry(AUDIT3000_SKILL_ID, session.localMcp);
3210
- const body = showingMoreInfo ? /* @__PURE__ */ jsxs(Box, {
3211
- flexDirection: "column",
3212
- width: 56,
3213
- children: [
3214
- /* @__PURE__ */ jsx(Box, {
3215
- marginBottom: 1,
3216
- children: /* @__PURE__ */ jsxs(Text, { children: ["The wizard is an agent that executes PostHog tasks. Its code is open source: ", /* @__PURE__ */ jsx(Text, {
3217
- color: "cyan",
3218
- children: "https://github.com/PostHog/wizard"
3219
- })] })
3220
- }),
3221
- /* @__PURE__ */ jsxs(Text, { children: [
3222
- "The",
3223
- " ",
3224
- /* @__PURE__ */ jsx(Text, {
3225
- color: "cyan",
3226
- italic: true,
3227
- children: AUDIT3000_SKILL_ID
3228
- }),
3229
- " ",
3230
- "program reviews your PostHog integration across 34 checks — SDK install, identification, event capture, event quality, stale feature flag hygiene, session replay (fix + optimize), and use-case expansion across 8 PostHog products. When enrichment is available it also produces a company profile and use-case match. Nothing in your project is modified."
3231
- ] }),
3232
- /* @__PURE__ */ jsx(Box, {
3233
- marginTop: 1,
3234
- children: /* @__PURE__ */ jsxs(Text, { children: [
3235
- "Results stream live to the",
3236
- " ",
3237
- /* @__PURE__ */ jsx(Text, {
3238
- color: "cyan",
3239
- bold: true,
3240
- children: "Hi-score Table"
3241
- }),
3242
- " ",
3243
- "tab during the run — that's your live report. When the audit finishes, the same report is also exported to",
3244
- " ",
3245
- /* @__PURE__ */ jsx(Text, {
3246
- color: "cyan",
3247
- children: "./posthog-audit-3000-report.md"
3248
- }),
3249
- " in your project folder."
3250
- ] })
3251
- }),
3252
- /* @__PURE__ */ jsx(Box, {
3253
- marginTop: 1,
3254
- children: /* @__PURE__ */ jsx(SkillSourceInfo, {
3255
- skillId: AUDIT3000_SKILL_ID,
3256
- skillEntry,
3257
- fetchFailed
3258
- })
3259
- })
3260
- ]
3261
- }) : /* @__PURE__ */ jsxs(Box, {
3262
- flexDirection: "column",
3263
- alignItems: "center",
3264
- children: [/* @__PURE__ */ jsx(ArcadeBanner, {}), /* @__PURE__ */ jsxs(Box, {
3265
- marginTop: 1,
3266
- flexDirection: "column",
3267
- alignItems: "center",
3268
- children: [
3269
- /* @__PURE__ */ jsx(Text, {
3270
- bold: true,
3271
- children: "34 checks. 9 levels. 1 final report."
3272
- }),
3273
- /* @__PURE__ */ jsx(Text, {
3274
- dimColor: true,
3275
- children: "High-score your PostHog integration before the boss fight."
3276
- }),
3277
- /* @__PURE__ */ jsx(Box, {
3278
- marginTop: 1,
3279
- children: /* @__PURE__ */ jsxs(Text, {
3280
- dimColor: true,
3281
- children: [
3282
- "Live report: ",
3283
- /* @__PURE__ */ jsx(Text, {
3284
- color: NEON_GOLD$2,
3285
- children: "Hi-score Table"
3286
- }),
3287
- " tab · Export: ./posthog-audit-3000-report.md"
3288
- ]
3289
- })
3290
- })
3291
- ]
3292
- })]
3293
- });
3294
- const menuOptions = showingMoreInfo ? [{
3295
- label: "Back",
3296
- value: "back"
3297
- }] : [
3298
- {
3299
- label: "PRESS START",
3300
- value: "continue"
3301
- },
3302
- {
3303
- label: "More info",
3304
- value: "more-info"
3305
- },
3306
- {
3307
- label: "Cancel",
3308
- value: "cancel"
3309
- }
3310
- ];
3311
- const handleSelect = (value) => {
3312
- if (value === "cancel") process.exit(0);
3313
- else if (value === "more-info") setShowingMoreInfo(true);
3314
- else if (value === "back") setShowingMoreInfo(false);
3315
- else store.completeSetup();
3316
- };
3317
- return /* @__PURE__ */ jsx(IntroScreenLayout, {
3318
- installDir: session.installDir,
3319
- body,
3320
- showDetection: !showingMoreInfo,
3321
- programLabel: session.programLabel,
3322
- skillId: session.skillId,
3323
- menuOptions,
3324
- onSelect: handleSelect
3325
- });
3326
- };
3327
- //#endregion
3328
- //#region src/ui/tui/screens/audit-3000/Audit3000AreaPane.tsx
3329
- /**
3330
- * Audit-3000 right pane — arcade-flavoured fork of `AuditAreaPane`.
3331
- *
3332
- * Mirrors the audit pane's three-state logic (active slide → empty →
3333
- * wrap-up) but routes through the audit-3000 slide registry and uses
3334
- * "LEVEL N: <area>" framing instead of "Verifying ...".
3335
- */
3336
- const FINDING_STATUSES = [
3337
- "error",
3338
- "warning",
3339
- "suggestion"
3340
- ];
3341
- const isFinding = (c) => FINDING_STATUSES.includes(c.status);
3342
- const fallbackSlide = (area) => ({
3343
- area,
3344
- intro: [`Now playing: ${area.toLowerCase()}\u2026`],
3345
- docsUrl: ""
3346
- });
3347
- const openLink = (url) => {
3348
- spawn(process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open", process.platform === "win32" ? [
3349
- "/c",
3350
- "start",
3351
- "",
3352
- url
3353
- ] : [url], {
3354
- detached: true,
3355
- stdio: "ignore"
3356
- }).unref();
3357
- };
3358
- const Audit3000AreaPane = ({ checks, reportPath }) => {
3359
- const activeArea = checks.filter((c) => c.status === "pending")[0]?.area;
3360
- const slide = activeArea ? AUDIT_3000_AREA_SLIDES.find((s) => s.area === activeArea) ?? fallbackSlide(activeArea) : null;
3361
- const levelIndex = activeArea ? AUDIT_3000_AREA_SLIDES.findIndex((s) => s.area === activeArea) : -1;
3362
- const level = levelIndex >= 0 ? levelIndex + 1 : null;
3363
- useInput((input) => {
3364
- if (input.toLowerCase() === "o" && slide?.docsUrl) openLink(slide.docsUrl);
3365
- });
3366
- if (slide) return /* @__PURE__ */ jsx(ActiveSlide, {
3367
- slide,
3368
- level,
3369
- hasFindings: checks.some(isFinding)
3370
- });
3371
- if (checks.length === 0) return null;
3372
- return /* @__PURE__ */ jsx(WritingReport, { reportPath });
3373
- };
3374
- const ActiveSlide = ({ slide, level, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
3375
- flexDirection: "column",
3376
- paddingX: 1,
3377
- children: [
3378
- /* @__PURE__ */ jsxs(Text, {
3379
- bold: true,
3380
- color: Colors.accent,
3381
- children: [level ? `LEVEL ${level}: ` : "", slide.area.toUpperCase()]
3382
- }),
3383
- /* @__PURE__ */ jsx(Box, { height: 1 }),
3384
- slide.visual,
3385
- slide.intro.map((paragraph, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i > 0 && /* @__PURE__ */ jsx(Box, { height: 1 }), /* @__PURE__ */ jsx(Text, { children: paragraph })] }, i)),
3386
- /* @__PURE__ */ jsx(Box, {
3387
- marginTop: 1,
3388
- children: /* @__PURE__ */ jsxs(Text, {
3389
- dimColor: true,
3390
- children: [slide.docsUrl && /* @__PURE__ */ jsxs(Fragment$1, { children: [
3391
- "[",
3392
- /* @__PURE__ */ jsx(Text, {
3393
- color: Colors.accent,
3394
- children: "O"
3395
- }),
3396
- "] Learn more"
3397
- ] }), hasFindings && /* @__PURE__ */ jsxs(Fragment$1, { children: [
3398
- slide.docsUrl && " ",
3399
- "[",
3400
- /* @__PURE__ */ jsx(Text, {
3401
- color: Colors.accent,
3402
- children: "→"
3403
- }),
3404
- "] View issues"
3405
- ] })]
3406
- })
3407
- })
3408
- ]
3409
- });
3410
- const WritingReport = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
3411
- flexDirection: "column",
3412
- paddingX: 1,
3413
- children: [
3414
- /* @__PURE__ */ jsx(Text, {
3415
- bold: true,
3416
- color: Colors.accent,
3417
- children: "STAGE CLEAR."
3418
- }),
3419
- /* @__PURE__ */ jsx(Box, { height: 1 }),
3420
- /* @__PURE__ */ jsxs(Text, { children: [
3421
- "All checks resolved. Compiling your high-score reel at",
3422
- " ",
3423
- /* @__PURE__ */ jsx(Text, {
3424
- color: "cyan",
3425
- children: reportPath
3426
- }),
3427
- "."
3428
- ] }),
3429
- /* @__PURE__ */ jsx(Box, { height: 1 }),
3430
- /* @__PURE__ */ jsx(Text, { children: "The report covers everything we checked, what we found, and what to do next." }),
3431
- /* @__PURE__ */ jsx(Box, { height: 1 }),
3432
- /* @__PURE__ */ jsx(Text, {
3433
- dimColor: true,
3434
- children: "Stand by…"
3435
- })
3436
- ]
3437
- });
3438
- //#endregion
3439
- //#region src/ui/tui/screens/audit-3000/Audit3000ChecksPanel.tsx
3440
- /**
3441
- * Audit-3000 left pane on the Run screen. Arcade-flavoured fork of the
3442
- * audit program's `PendingChecksList`: a running score banner sits on
3443
- * top, then the area-level "level" headers underneath.
3444
- *
3445
- * Per-check rows are deliberately omitted here — the Hi-score Table tab
3446
- * has the full check-by-check breakdown. This pane is the at-a-glance
3447
- * stage overview.
3448
- */
3449
- const NEON_PINK$1 = "#F54E00";
3450
- const NEON_GOLD$1 = "#F9BD2B";
3451
- const NEON_BLUE$1 = "#1D4AFF";
3452
- function groupByArea(checks) {
3453
- const order = [];
3454
- const map = /* @__PURE__ */ new Map();
3455
- for (const c of checks) {
3456
- if (!map.has(c.area)) {
3457
- map.set(c.area, []);
3458
- order.push(c.area);
3459
- }
3460
- map.get(c.area).push(c);
3461
- }
3462
- return order.map((area) => ({
3463
- area,
3464
- checks: map.get(area)
3465
- }));
3466
- }
3467
- function countByStatus$1(checks) {
3468
- const counts = {
3469
- pending: 0,
3470
- pass: 0,
3471
- error: 0,
3472
- warning: 0,
3473
- suggestion: 0
3474
- };
3475
- for (const c of checks) counts[c.status] += 1;
3476
- return counts;
3477
- }
3478
- const ScoreBanner = ({ checks }) => {
3479
- const counts = countByStatus$1(checks);
3480
- const resolved = checks.length - counts.pending;
3481
- const issues = counts.error + counts.warning + counts.suggestion;
3482
- return /* @__PURE__ */ jsxs(Box, {
3483
- flexDirection: "column",
3484
- marginBottom: 1,
3485
- children: [/* @__PURE__ */ jsxs(Text, { children: [
3486
- /* @__PURE__ */ jsx(Text, {
3487
- bold: true,
3488
- color: NEON_PINK$1,
3489
- children: "SCORE "
3490
- }),
3491
- /* @__PURE__ */ jsx(Text, {
3492
- bold: true,
3493
- color: NEON_GOLD$1,
3494
- children: resolved.toString().padStart(2, "0")
3495
- }),
3496
- /* @__PURE__ */ jsx(Text, {
3497
- dimColor: true,
3498
- children: " / "
3499
- }),
3500
- /* @__PURE__ */ jsx(Text, {
3501
- bold: true,
3502
- children: checks.length.toString().padStart(2, "0")
3503
- })
3504
- ] }), /* @__PURE__ */ jsxs(Text, { children: [
3505
- /* @__PURE__ */ jsx(Text, {
3506
- color: "green",
3507
- children: `PASS \u25B2 ${counts.pass}`
3508
- }),
3509
- /* @__PURE__ */ jsx(Text, { children: " " }),
3510
- /* @__PURE__ */ jsx(Text, {
3511
- color: NEON_PINK$1,
3512
- children: `MISS \u25BC ${issues}`
3513
- }),
3514
- /* @__PURE__ */ jsx(Text, { children: " " }),
3515
- /* @__PURE__ */ jsx(Text, {
3516
- dimColor: true,
3517
- children: `QUEUE \u25CB ${counts.pending}`
3518
- })
3519
- ] })]
3520
- });
3521
- };
3522
- function groupIcon(group) {
3523
- const total = group.checks.length;
3524
- const complete = group.checks.filter((c) => c.status !== "pending").length;
3525
- if (complete === 0) return {
3526
- icon: Icons.squareOpen,
3527
- color: Colors.muted
3528
- };
3529
- if (complete === total) return {
3530
- icon: Icons.squareFilled,
3531
- color: Colors.success
3532
- };
3533
- return {
3534
- icon: Icons.triangleRight,
3535
- color: Colors.primary
3536
- };
3537
- }
3538
- const GroupHeader = ({ group, level, showIcon, isActive }) => {
3539
- const complete = group.checks.filter((c) => c.status !== "pending").length;
3540
- const total = group.checks.length;
3541
- const { icon, color } = groupIcon(group);
3542
- return /* @__PURE__ */ jsxs(Box, { children: [isActive ? /* @__PURE__ */ jsx(Box, {
3543
- marginRight: 1,
3544
- children: /* @__PURE__ */ jsx(Spinner, {})
3545
- }) : showIcon ? /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
3546
- color,
3547
- children: icon
3548
- }), " "] }) : null, /* @__PURE__ */ jsxs(Text, { children: [
3549
- /* @__PURE__ */ jsx(Text, {
3550
- color: NEON_BLUE$1,
3551
- bold: true,
3552
- children: `L${level} `
3553
- }),
3554
- /* @__PURE__ */ jsx(Text, {
3555
- bold: true,
3556
- children: group.area
3557
- }),
3558
- " ",
3559
- /* @__PURE__ */ jsxs(Text, {
3560
- dimColor: true,
3561
- children: [
3562
- "(",
3563
- complete,
3564
- "/",
3565
- total,
3566
- ")"
3567
- ]
3568
- })
3569
- ] })] });
3570
- };
3571
- const Audit3000ChecksPanel = ({ checks }) => {
3572
- if (checks.length === 0) return /* @__PURE__ */ jsxs(Box, {
3573
- flexDirection: "column",
3574
- children: [
3575
- /* @__PURE__ */ jsx(Text, {
3576
- bold: true,
3577
- children: "AUDIT-3000"
3578
- }),
3579
- /* @__PURE__ */ jsx(Text, { children: " " }),
3580
- /* @__PURE__ */ jsx(LoadingBox, { message: "Booting up arcade cabinet..." })
3581
- ]
3582
- });
3583
- const groups = groupByArea(checks);
3584
- const activeIndex = groups.findIndex((g) => g.checks.some((c) => c.status === "pending"));
3585
- return /* @__PURE__ */ jsxs(Box, {
3586
- flexDirection: "column",
3587
- children: [
3588
- /* @__PURE__ */ jsx(Text, {
3589
- bold: true,
3590
- color: NEON_PINK$1,
3591
- children: "AUDIT-3000"
3592
- }),
3593
- /* @__PURE__ */ jsx(Text, { children: " " }),
3594
- /* @__PURE__ */ jsx(ScoreBanner, { checks }),
3595
- groups.map((group, i) => /* @__PURE__ */ jsx(GroupHeader, {
3596
- group,
3597
- level: i + 1,
3598
- showIcon: true,
3599
- isActive: i === activeIndex
3600
- }, group.area)),
3601
- /* @__PURE__ */ jsx(Box, {
3602
- marginTop: 1,
3603
- children: /* @__PURE__ */ jsxs(Text, {
3604
- dimColor: true,
3605
- children: [
3606
- "Full breakdown: ",
3607
- /* @__PURE__ */ jsx(Text, {
3608
- color: NEON_GOLD$1,
3609
- children: "Hi-score table (report)"
3610
- }),
3611
- " ",
3612
- "tab"
3613
- ]
3614
- })
3615
- })
3616
- ]
3617
- });
3618
- };
3619
- function nextRandom(seed) {
3620
- let t = seed + 1831565813 >>> 0;
3621
- t = Math.imul(t ^ t >>> 15, t | 1);
3622
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
3623
- return {
3624
- value: ((t ^ t >>> 14) >>> 0) / 4294967296,
3625
- nextSeed: t >>> 0
3626
- };
3627
- }
3628
- function randomInt(seed, min, max) {
3629
- const { value, nextSeed } = nextRandom(seed);
3630
- return {
3631
- value: min + Math.floor(value * (max - min + 1)),
3632
- nextSeed
3633
- };
3634
- }
3635
- function initialState(hiScore = 0, rngSeed = 1) {
3636
- return {
3637
- hedgehogState: "grounded",
3638
- hedgehogRow: 2,
3639
- jumpFramesRemaining: 0,
3640
- obstacles: [],
3641
- score: 0,
3642
- hiScore,
3643
- isGameOver: false,
3644
- tick: 0,
3645
- ticksUntilNextSpawn: 6,
3646
- rngSeed
3647
- };
3648
- }
3649
- function jump(state) {
3650
- if (state.isGameOver) return state;
3651
- if (state.hedgehogState !== "grounded") return state;
3652
- return {
3653
- ...state,
3654
- hedgehogState: "jumping",
3655
- hedgehogRow: 1,
3656
- jumpFramesRemaining: 8
3657
- };
3658
- }
3659
- function restart(state) {
3660
- return initialState(state.hiScore, state.rngSeed);
3661
- }
3662
- function tick(state) {
3663
- if (state.isGameOver) return state;
3664
- let { hedgehogState, hedgehogRow, jumpFramesRemaining } = state;
3665
- if (hedgehogState === "jumping") {
3666
- jumpFramesRemaining -= 1;
3667
- if (jumpFramesRemaining <= 0) {
3668
- hedgehogState = "grounded";
3669
- hedgehogRow = 2;
3670
- jumpFramesRemaining = 0;
3671
- }
3672
- }
3673
- const movedObstacles = [];
3674
- let scoreDelta = 1;
3675
- let hit = false;
3676
- for (const obs of state.obstacles) {
3677
- const next = {
3678
- ...obs,
3679
- x: obs.x - 1
3680
- };
3681
- if (next.x < 0) continue;
3682
- if (next.x === 4 && next.row === hedgehogRow) {
3683
- if (next.kind === "spike") {
3684
- hit = true;
3685
- movedObstacles.push(next);
3686
- continue;
3687
- }
3688
- scoreDelta += 5;
3689
- continue;
3690
- }
3691
- movedObstacles.push(next);
3692
- }
3693
- let rngSeed = state.rngSeed;
3694
- let ticksUntilNextSpawn = state.ticksUntilNextSpawn - 1;
3695
- if (ticksUntilNextSpawn <= 0) {
3696
- const kindRoll = nextRandom(rngSeed);
3697
- rngSeed = kindRoll.nextSeed;
3698
- const kind = kindRoll.value < .65 ? "spike" : "ring";
3699
- const row = kind === "spike" ? 2 : 1;
3700
- movedObstacles.push({
3701
- kind,
3702
- x: 39,
3703
- row
3704
- });
3705
- const cooldown = randomInt(rngSeed, 6, 14);
3706
- rngSeed = cooldown.nextSeed;
3707
- ticksUntilNextSpawn = cooldown.value;
3708
- }
3709
- const score = state.score + scoreDelta;
3710
- const isGameOver = hit;
3711
- const hiScore = isGameOver ? Math.max(state.hiScore, score) : state.hiScore;
3712
- return {
3713
- hedgehogState,
3714
- hedgehogRow,
3715
- jumpFramesRemaining,
3716
- obstacles: movedObstacles,
3717
- score,
3718
- hiScore,
3719
- isGameOver,
3720
- tick: state.tick + 1,
3721
- ticksUntilNextSpawn,
3722
- rngSeed
3723
- };
3724
- }
3725
- //#endregion
3726
- //#region src/ui/tui/screens/audit-3000/HedgehogRunner.tsx
3727
- /**
3728
- * HedgehogRunner — playable arcade game shown while the audit runs.
3729
- *
3730
- * Game state lives in the parent (Audit3000RunScreen) so it survives tab
3731
- * switches. This component owns the render loop (setInterval) and key
3732
- * bindings; when the user switches tabs the component unmounts, the
3733
- * interval clears, and state freezes in the parent — free pause behaviour.
3734
- */
3735
- const TICK_MS = 150;
3736
- const PLAYFIELD_ROWS = 3;
3737
- const MIN_TERMINAL_COLUMNS = 50;
3738
- const HEDGEHOG_GLYPH = "O";
3739
- const SPIKE_GLYPH = "^";
3740
- const RING_GLYPH = "o";
3741
- const GROUND_GLYPH = "=";
3742
- const pad4 = (n) => String(n).padStart(4, "0");
3743
- const HedgehogRunner = ({ state, onChange }) => {
3744
- const [columns] = useStdoutDimensions();
3745
- useEffect(() => {
3746
- const id = setInterval(() => {
3747
- onChange((prev) => tick(prev));
3748
- }, TICK_MS);
3749
- return () => clearInterval(id);
3750
- }, [onChange]);
3751
- useKeyBindings("hedgehog-runner", [{
3752
- match: "space",
3753
- label: "space",
3754
- action: "jump",
3755
- handler: () => onChange((prev) => jump(prev))
3756
- }, {
3757
- match: "r",
3758
- label: "r",
3759
- action: "restart",
3760
- handler: () => onChange((prev) => prev.isGameOver ? restart(prev) : prev)
3761
- }]);
3762
- if (columns < MIN_TERMINAL_COLUMNS) return /* @__PURE__ */ jsx(Box, {
3763
- flexDirection: "column",
3764
- paddingX: 1,
3765
- children: /* @__PURE__ */ jsxs(Text, {
3766
- dimColor: true,
3767
- children: [
3768
- "Widen the terminal to at least ",
3769
- MIN_TERMINAL_COLUMNS,
3770
- " columns to play Hedgehog Runner."
3771
- ]
3772
- })
3773
- });
3774
- return /* @__PURE__ */ jsxs(Box, {
3775
- flexDirection: "column",
3776
- paddingX: 1,
3777
- children: [
3778
- /* @__PURE__ */ jsxs(Box, { children: [
3779
- /* @__PURE__ */ jsxs(Text, {
3780
- bold: true,
3781
- color: NEON_BLUE$2,
3782
- children: ["SCORE ", pad4(state.score)]
3783
- }),
3784
- /* @__PURE__ */ jsx(Text, { children: " " }),
3785
- /* @__PURE__ */ jsxs(Text, {
3786
- bold: true,
3787
- color: NEON_GOLD$2,
3788
- children: ["HI ", pad4(state.hiScore)]
3789
- }),
3790
- state.isGameOver && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, { children: " " }), /* @__PURE__ */ jsx(Text, {
3791
- bold: true,
3792
- color: "red",
3793
- children: "✱ GAME OVER ✱"
3794
- })] })
3795
- ] }),
3796
- Array.from({ length: PLAYFIELD_ROWS }, (_, row) => /* @__PURE__ */ jsx(PlayfieldRow, {
3797
- row,
3798
- state
3799
- }, row)),
3800
- /* @__PURE__ */ jsx(Text, {
3801
- color: Colors.muted,
3802
- children: GROUND_GLYPH.repeat(40)
3803
- })
3804
- ]
3805
- });
3806
- };
3807
- const PlayfieldRow = ({ row, state }) => {
3808
- const cells = [];
3809
- for (let x = 0; x < 40; x++) {
3810
- if (x === 4 && row === state.hedgehogRow) {
3811
- cells.push({
3812
- ch: HEDGEHOG_GLYPH,
3813
- color: NEON_PINK$2,
3814
- bold: true
3815
- });
3816
- continue;
3817
- }
3818
- const obstacle = state.obstacles.find((o) => o.x === x && o.row === row);
3819
- if (obstacle) {
3820
- cells.push(obstacle.kind === "spike" ? {
3821
- ch: SPIKE_GLYPH,
3822
- color: "red",
3823
- bold: true
3824
- } : {
3825
- ch: RING_GLYPH,
3826
- color: NEON_GOLD$2,
3827
- bold: true
3828
- });
3829
- continue;
3830
- }
3831
- cells.push({ ch: " " });
3832
- }
3833
- return /* @__PURE__ */ jsx(Text, { children: cells.map((c, i) => /* @__PURE__ */ jsx(Fragment, { children: c.color ? /* @__PURE__ */ jsx(Text, {
3834
- color: c.color,
3835
- bold: c.bold,
3836
- children: c.ch
3837
- }) : c.ch }, i)) });
3838
- };
3839
- //#endregion
3840
- //#region src/ui/tui/screens/audit-3000/Audit3000RunScreen.tsx
3841
- const AUDIT_3000_REPORT_FILE_FALLBACK = "posthog-audit-3000-report.md";
3842
- const Audit3000RunScreen = ({ store }) => {
3843
- useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
3844
- useFileWatcher(join$1(store.session.installDir, AUDIT_CHECKS_FILE), (parsed) => store.setFrameworkContext(AUDIT_CHECKS_KEY, coerceAuditChecks(parsed)));
3845
- const statuses = store.statusMessages.length > 0 ? store.statusMessages : void 0;
3846
- const [columns] = useStdoutDimensions();
3847
- const [gameState, setGameState] = useState(() => initialState());
3848
- const checks = getAuditChecks(store.session);
3849
- const reportPath = `./${getProgramConfig(store.router.activeProgram).reportFile ?? AUDIT_3000_REPORT_FILE_FALLBACK}`;
3850
- const checksPanel = /* @__PURE__ */ jsx(Audit3000ChecksPanel, { checks });
3851
- return /* @__PURE__ */ jsx(TabContainer, {
3852
- tabs: [
3853
- {
3854
- id: "status",
3855
- label: "Arcade",
3856
- component: columns < 80 ? /* @__PURE__ */ jsx(Box, {
3857
- flexDirection: "column",
3858
- flexGrow: 1,
3859
- children: checksPanel
3860
- }) : /* @__PURE__ */ jsx(SplitView, {
3861
- left: /* @__PURE__ */ jsx(Audit3000AreaPane, {
3862
- checks,
3863
- reportPath
3864
- }),
3865
- right: checksPanel
3866
- })
3867
- },
3868
- {
3869
- id: "audit-checks",
3870
- label: "Hi-score table (report)",
3871
- component: /* @__PURE__ */ jsx(AuditChecksViewer, { checks })
3872
- },
3873
- {
3874
- id: "play",
3875
- label: "Play",
3876
- component: /* @__PURE__ */ jsx(HedgehogRunner, {
3877
- state: gameState,
3878
- onChange: setGameState
3879
- })
3880
- },
3881
- {
3882
- id: "logs",
3883
- label: "Tail logs",
3884
- component: /* @__PURE__ */ jsx(LogViewer, { filePath: WIZARD_LOG_FILE })
3885
- },
3886
- {
3887
- id: "hn",
3888
- label: "HN",
3889
- component: /* @__PURE__ */ jsx(HNViewer, {})
3890
- }
3891
- ],
3892
- statusMessage: statuses,
3893
- expandableStatus: true,
3894
- store
3895
- });
3896
- };
3897
- //#endregion
3898
- //#region src/ui/tui/screens/audit-3000/Audit3000OutroScreen.tsx
3899
- /**
3900
- * Audit3000OutroScreen — high-score-style summary after a v3000 audit run.
3901
- *
3902
- * On success: arcade FINAL SCORE banner with pass / miss tallies, the
3903
- * absolute report path, and the standard problematic-items list.
3904
- *
3905
- * Error and cancel branches mirror `AuditOutroScreen` so failure modes
3906
- * stay legible without arcade dressing.
3907
- */
3908
- const NEON_PINK = "#F54E00";
3909
- const NEON_GOLD = "#F9BD2B";
3910
- const NEON_BLUE = "#1D4AFF";
3911
- const PANEL_WIDTH = 48;
3912
- const padCenter = (s, width) => {
3913
- if (s.length >= width) return s;
3914
- const total = width - s.length;
3915
- const left = Math.floor(total / 2);
3916
- const right = total - left;
3917
- return " ".repeat(left) + s + " ".repeat(right);
3918
- };
3919
- function countByStatus(checks) {
3920
- const counts = {
3921
- pending: 0,
3922
- pass: 0,
3923
- error: 0,
3924
- warning: 0,
3925
- suggestion: 0
3926
- };
3927
- for (const c of checks) counts[c.status] += 1;
3928
- return counts;
3929
- }
3930
- const FinalScorePanel = ({ checks }) => {
3931
- const counts = countByStatus(checks);
3932
- const resolved = checks.length - counts.pending;
3933
- const issues = counts.error + counts.warning + counts.suggestion;
3934
- const top = "┏" + "━".repeat(PANEL_WIDTH) + "┓";
3935
- const bottom = "┗" + "━".repeat(PANEL_WIDTH) + "┛";
3936
- const sep = "┠" + "─".repeat(PANEL_WIDTH) + "┨";
3937
- const row = (content) => /* @__PURE__ */ jsxs(Text, { children: [
3938
- /* @__PURE__ */ jsx(Text, {
3939
- bold: true,
3940
- color: NEON_PINK,
3941
- children: "┃"
3942
- }),
3943
- /* @__PURE__ */ jsx(Text, { children: content }),
3944
- /* @__PURE__ */ jsx(Text, {
3945
- bold: true,
3946
- color: NEON_PINK,
3947
- children: "┃"
3948
- })
3949
- ] });
3950
- return /* @__PURE__ */ jsxs(Box, {
3951
- flexDirection: "column",
3952
- marginTop: 1,
3953
- children: [
3954
- /* @__PURE__ */ jsx(Text, {
3955
- bold: true,
3956
- color: NEON_PINK,
3957
- children: top
3958
- }),
3959
- row(padCenter("GAME OVER", PANEL_WIDTH)),
3960
- /* @__PURE__ */ jsxs(Text, { children: [
3961
- /* @__PURE__ */ jsx(Text, {
3962
- bold: true,
3963
- color: NEON_PINK,
3964
- children: "┃"
3965
- }),
3966
- /* @__PURE__ */ jsx(Text, {
3967
- color: NEON_GOLD,
3968
- children: padCenter(`FINAL SCORE ${resolved} / ${checks.length}`, PANEL_WIDTH)
3969
- }),
3970
- /* @__PURE__ */ jsx(Text, {
3971
- bold: true,
3972
- color: NEON_PINK,
3973
- children: "┃"
3974
- })
3975
- ] }),
3976
- /* @__PURE__ */ jsx(Text, {
3977
- color: NEON_PINK,
3978
- children: sep
3979
- }),
3980
- /* @__PURE__ */ jsxs(Text, { children: [
3981
- /* @__PURE__ */ jsx(Text, {
3982
- bold: true,
3983
- color: NEON_PINK,
3984
- children: "┃"
3985
- }),
3986
- /* @__PURE__ */ jsx(Text, {
3987
- color: "green",
3988
- children: padCenter(`PASS \u25B2 ${counts.pass}`, PANEL_WIDTH)
3989
- }),
3990
- /* @__PURE__ */ jsx(Text, {
3991
- bold: true,
3992
- color: NEON_PINK,
3993
- children: "┃"
3994
- })
3995
- ] }),
3996
- /* @__PURE__ */ jsxs(Text, { children: [
3997
- /* @__PURE__ */ jsx(Text, {
3998
- bold: true,
3999
- color: NEON_PINK,
4000
- children: "┃"
4001
- }),
4002
- /* @__PURE__ */ jsx(Text, {
4003
- color: NEON_BLUE,
4004
- children: padCenter(`MISS \u25BC ${issues}`, PANEL_WIDTH)
4005
- }),
4006
- /* @__PURE__ */ jsx(Text, {
4007
- bold: true,
4008
- color: NEON_PINK,
4009
- children: "┃"
4010
- })
4011
- ] }),
4012
- /* @__PURE__ */ jsx(Text, {
4013
- bold: true,
4014
- color: NEON_PINK,
4015
- children: bottom
4016
- })
4017
- ]
4018
- });
4019
- };
4020
- const Audit3000OutroScreen = ({ store }) => {
4021
- useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
4022
- useInput(() => {
4023
- store.setOutroDismissed();
4024
- });
4025
- const outroData = store.session.outroData;
4026
- if (!outroData) return /* @__PURE__ */ jsx(Box, {
4027
- flexDirection: "column",
4028
- flexGrow: 1,
4029
- children: /* @__PURE__ */ jsx(Text, {
4030
- dimColor: true,
4031
- children: "Counting your tokens…"
4032
- })
4033
- });
4034
- const checks = getAuditChecks(store.session);
4035
- return /* @__PURE__ */ jsxs(Box, {
4036
- flexDirection: "column",
4037
- flexGrow: 1,
4038
- children: [
4039
- outroData.kind === "success" && /* @__PURE__ */ jsxs(Box, {
4040
- flexDirection: "column",
4041
- children: [
4042
- /* @__PURE__ */ jsx(FinalScorePanel, { checks }),
4043
- /* @__PURE__ */ jsx(Box, {
4044
- marginTop: 1,
4045
- children: /* @__PURE__ */ jsxs(Text, {
4046
- bold: true,
4047
- color: "green",
4048
- children: [
4049
- "✔",
4050
- " ",
4051
- outroData.message || "AUDIT-3000 complete!"
4052
- ]
4053
- })
4054
- }),
4055
- outroData.reportFile && /* @__PURE__ */ jsxs(Box, {
4056
- flexDirection: "column",
4057
- marginTop: 1,
4058
- children: [
4059
- /* @__PURE__ */ jsx(Text, {
4060
- bold: true,
4061
- color: "cyan",
4062
- children: "High-score reel saved to:"
4063
- }),
4064
- /* @__PURE__ */ jsx(Text, { children: join$1(store.session.installDir, outroData.reportFile) }),
4065
- /* @__PURE__ */ jsx(Text, {
4066
- dimColor: true,
4067
- children: "A markdown file in your project folder — open it in any editor to read the full audit."
4068
- })
4069
- ]
4070
- }),
4071
- /* @__PURE__ */ jsx(AuditChecksOutroSection, {
4072
- checks,
4073
- installDir: store.session.installDir
4074
- }),
4075
- outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
4076
- marginTop: 1,
4077
- children: /* @__PURE__ */ jsxs(Text, { children: ["Learn more: ", /* @__PURE__ */ jsx(Text, {
4078
- color: "cyan",
4079
- children: outroData.docsUrl
4080
- })] })
4081
- })
4082
- ]
4083
- }),
4084
- outroData.kind === "error" && /* @__PURE__ */ jsxs(Box, {
4085
- flexDirection: "column",
4086
- children: [/* @__PURE__ */ jsxs(Text, {
4087
- color: "red",
4088
- bold: true,
4089
- children: [
4090
- "✘",
4091
- " ",
4092
- outroData.message || "An error occurred"
4093
- ]
4094
- }), outroData.body && /* @__PURE__ */ jsx(Box, {
4095
- marginTop: 1,
4096
- children: /* @__PURE__ */ jsx(Text, {
4097
- dimColor: true,
4098
- children: outroData.body
4099
- })
4100
- })]
4101
- }),
4102
- outroData.kind === "cancel" && /* @__PURE__ */ jsxs(Text, {
4103
- color: "yellow",
4104
- children: [
4105
- "■",
4106
- " ",
4107
- outroData.message || "Cancelled"
4108
- ]
4109
- }),
4110
- /* @__PURE__ */ jsx(Box, {
4111
- marginTop: 1,
4112
- children: /* @__PURE__ */ jsx(Text, {
4113
- color: Colors.muted,
4114
- children: "Press any key to continue"
4115
- })
4116
- })
4117
- ]
4118
- });
4119
- };
4120
- //#endregion
4121
3129
  //#region src/ui/tui/screens/SetupScreen.tsx
4122
3130
  /**
4123
3131
  * SetupScreen — Generic framework disambiguation.
@@ -4963,14 +3971,14 @@ function createMcpSuggestedPromptsServices(_store) {
4963
3971
  };
4964
3972
  },
4965
3973
  checkSlackConnected: async (credentials, signal) => {
4966
- const { fetchSlackConnected } = await import("./api-Dwd0B-E9.js").then((n) => n.n);
3974
+ const { fetchSlackConnected } = await import("./api-RXTR8yZo.js").then((n) => n.n);
4967
3975
  return fetchSlackConnected(credentials.accessToken, credentials.projectId, credentials.host, signal);
4968
3976
  },
4969
3977
  runPromptStreaming: (args) => runProductionPromptStreaming(args)
4970
3978
  };
4971
3979
  }
4972
3980
  async function* runProductionPromptStreaming(args) {
4973
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-tdoy9UJ2.js");
3981
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DUtbxnNy.js");
4974
3982
  yield* runMcpPromptViaSdk(args);
4975
3983
  }
4976
3984
  //#endregion
@@ -4999,9 +4007,6 @@ function createScreens(store, services) {
4999
4007
  ["audit-intro"]: /* @__PURE__ */ jsx(AuditIntroScreen, { store }),
5000
4008
  ["audit-run"]: /* @__PURE__ */ jsx(AuditRunScreen, { store }),
5001
4009
  ["audit-outro"]: /* @__PURE__ */ jsx(AuditOutroScreen, { store }),
5002
- ["audit-3000-intro"]: /* @__PURE__ */ jsx(Audit3000IntroScreen, { store }),
5003
- ["audit-3000-run"]: /* @__PURE__ */ jsx(Audit3000RunScreen, { store }),
5004
- ["audit-3000-outro"]: /* @__PURE__ */ jsx(Audit3000OutroScreen, { store }),
5005
4010
  ["health-check"]: /* @__PURE__ */ jsx(HealthCheckScreen, { store }),
5006
4011
  ["doctor-intro"]: /* @__PURE__ */ jsx(DoctorIntroScreen, { store }),
5007
4012
  ["doctor-report"]: /* @__PURE__ */ jsx(DoctorReportScreen, { store }),
@@ -5110,4 +4115,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5110
4115
  //#endregion
5111
4116
  export { startTUI };
5112
4117
 
5113
- //# sourceMappingURL=start-tui-SLeEzlJs.js.map
4118
+ //# sourceMappingURL=start-tui-CywbSvZE.js.map