@posthog/wizard 2.23.0 → 2.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +61 -2
  2. package/dist/{AiOptInRequiredScreen-BOMyYFep.js → AiOptInRequiredScreen-_33FOcVo.js} +148 -685
  3. package/dist/AiOptInRequiredScreen-_33FOcVo.js.map +1 -0
  4. package/dist/{add-mcp-server-to-clients-BEziI3z9.js → add-mcp-server-to-clients-CfwEQT_z.js} +4 -4
  5. package/dist/{add-mcp-server-to-clients-BEziI3z9.js.map → add-mcp-server-to-clients-CfwEQT_z.js.map} +1 -1
  6. package/dist/{agent-interface-DjMPlXl0.js → agent-interface-D1vtN6Wn.js} +6 -7
  7. package/dist/agent-interface-D1vtN6Wn.js.map +1 -0
  8. package/dist/{agent-runner-Bv-7z-pQ.js → agent-runner-CBbkS0Ro.js} +8 -8
  9. package/dist/{agent-runner-Bv-7z-pQ.js.map → agent-runner-CBbkS0Ro.js.map} +1 -1
  10. package/dist/{analytics-9D4eGgmT.js → analytics-CUr82BDl.js} +11 -2
  11. package/dist/{analytics-9D4eGgmT.js.map → analytics-CUr82BDl.js.map} +1 -1
  12. package/dist/{api-Dwd0B-E9.js → api-CI3Z74NG.js} +3 -3
  13. package/dist/{api-Dwd0B-E9.js.map → api-CI3Z74NG.js.map} +1 -1
  14. package/dist/bin.js +887 -465
  15. package/dist/bin.js.map +1 -1
  16. package/dist/{ci-install-DGXCpvKh.js → ci-install-D_kxNmbJ.js} +5 -5
  17. package/dist/{ci-install-DGXCpvKh.js.map → ci-install-D_kxNmbJ.js.map} +1 -1
  18. package/dist/{debug-CgT5MmVB.js → debug-DxA_f5QT.js} +2 -2
  19. package/dist/{debug-CgT5MmVB.js.map → debug-DxA_f5QT.js.map} +1 -1
  20. package/dist/{debug-DayHBBST.js → debug-zMvpNYb2.js} +1 -1
  21. package/dist/{environment-CI2pTYTG.js → environment-CyS37cmM.js} +3 -3
  22. package/dist/{environment-CI2pTYTG.js.map → environment-CyS37cmM.js.map} +1 -1
  23. package/dist/{interactive-D52p_opJ.js → interactive-CG6FFqSw.js} +3 -3
  24. package/dist/{interactive-D52p_opJ.js.map → interactive-CG6FFqSw.js.map} +1 -1
  25. package/dist/{mcp-prompt-streaming-tdoy9UJ2.js → mcp-prompt-streaming-DQz4FSb1.js} +4 -4
  26. package/dist/{mcp-prompt-streaming-tdoy9UJ2.js.map → mcp-prompt-streaming-DQz4FSb1.js.map} +1 -1
  27. package/dist/{non-interactive-6hadW20x.js → non-interactive-DWtHX3ZR.js} +2 -2
  28. package/dist/{non-interactive-6hadW20x.js.map → non-interactive-DWtHX3ZR.js.map} +1 -1
  29. package/dist/{package-manager-BI0J5E7t.js → package-manager-BWUS4CP0.js} +2 -2
  30. package/dist/{package-manager-BI0J5E7t.js.map → package-manager-BWUS4CP0.js.map} +1 -1
  31. package/dist/{playground-z4A5dHPv.js → playground-D7AhMMF5.js} +9 -20
  32. package/dist/playground-D7AhMMF5.js.map +1 -0
  33. package/dist/{posthog-integration-BWbZU9Xq.js → posthog-integration-DexZ2uHU.js} +18 -18
  34. package/dist/{posthog-integration-BWbZU9Xq.js.map → posthog-integration-DexZ2uHU.js.map} +1 -1
  35. package/dist/{provisioning-B30Be2NA.js → provisioning-9c-AQbsa.js} +3 -3
  36. package/dist/{provisioning-B30Be2NA.js.map → provisioning-9c-AQbsa.js.map} +1 -1
  37. package/dist/{registry-CD_DplSQ.js → registry-CO7JVZyE.js} +4 -4
  38. package/dist/{registry-CD_DplSQ.js.map → registry-CO7JVZyE.js.map} +1 -1
  39. package/dist/{setup-utils-Dwgkk8AQ.js → setup-utils-0U-_Md2G.js} +8 -8
  40. package/dist/{setup-utils-Dwgkk8AQ.js.map → setup-utils-0U-_Md2G.js.map} +1 -1
  41. package/dist/{start-tui-SLeEzlJs.js → start-tui-WNb3ET14.js} +206 -1205
  42. package/dist/start-tui-WNb3ET14.js.map +1 -0
  43. package/dist/{steps-B1gzyRkC.js → steps-BAUXDCC4.js} +6 -6
  44. package/dist/{steps-B1gzyRkC.js.map → steps-BAUXDCC4.js.map} +1 -1
  45. package/dist/{telemetry-5rkeTd2_.js → telemetry-ycqCpNPr.js} +3 -3
  46. package/dist/{telemetry-5rkeTd2_.js.map → telemetry-ycqCpNPr.js.map} +1 -1
  47. package/dist/{urls-Cb4SI9kf.js → urls-C8aJWvgh.js} +2 -2
  48. package/dist/{urls-Cb4SI9kf.js.map → urls-C8aJWvgh.js.map} +1 -1
  49. package/dist/{wizard-abort-DovHQa-j.js → wizard-abort-C6gRLxUE.js} +3 -3
  50. package/dist/{wizard-abort-DovHQa-j.js.map → wizard-abort-C6gRLxUE.js.map} +1 -1
  51. package/dist/{wizard-abort-DW2-ZjiS.js → wizard-abort-DWXyJdws.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/playground-z4A5dHPv.js.map +0 -1
  56. 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-DxA_f5QT.js";
2
+ import { t as analytics } from "./analytics-CUr82BDl.js";
3
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-0U-_Md2G.js";
4
+ import { a as getUiHostFromHost } from "./urls-C8aJWvgh.js";
5
+ import { t as ApiError } from "./api-CI3Z74NG.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-C6gRLxUE.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-D1vtN6Wn.js";
9
+ import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-DexZ2uHU.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-_33FOcVo.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-CfwEQT_z.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-CO7JVZyE.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,1075 +2809,120 @@ 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, {})
2819
2819
  }) : showIcon ? /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2820
2820
  color,
2821
2821
  children: icon
2822
- }), " "] }) : null, /* @__PURE__ */ jsxs(Text, { children: [
2823
- /* @__PURE__ */ jsx(Text, {
2824
- bold: true,
2825
- children: group.area
2826
- }),
2827
- " ",
2828
- /* @__PURE__ */ jsxs(Text, {
2829
- dimColor: true,
2830
- children: [
2831
- "(",
2832
- complete,
2833
- "/",
2834
- total,
2835
- ")"
2836
- ]
2837
- })
2838
- ] })] });
2839
- };
2840
- const CheckRow = ({ check }) => {
2841
- const { glyph, color } = AUDIT_SEVERITY_STYLE[check.status];
2842
- return /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2843
- color,
2844
- children: glyph
2845
- }), /* @__PURE__ */ jsxs(Text, {
2846
- dimColor: check.status === "pending",
2847
- children: [" ", check.label]
2848
- })] });
2849
- };
2850
- const COLLAPSE_BELOW_ROWS = 24;
2851
- const PendingChecksList = ({ checks }) => {
2852
- const [, termRows] = useStdoutDimensions();
2853
- if (checks.length === 0) return /* @__PURE__ */ jsxs(Box, {
2854
- flexDirection: "column",
2855
- children: [
2856
- /* @__PURE__ */ jsx(Text, {
2857
- bold: true,
2858
- children: "Checks"
2859
- }),
2860
- /* @__PURE__ */ jsx(Text, { children: " " }),
2861
- /* @__PURE__ */ jsx(LoadingBox, { message: "Seeding audit checklist..." })
2862
- ]
2863
- });
2864
- const groups = groupByArea$1(checks);
2865
- const activeIndex = groups.findIndex((g) => g.checks.some((c) => c.status === "pending"));
2866
- return /* @__PURE__ */ jsxs(Box, {
2867
- flexDirection: "column",
2868
- children: [
2869
- /* @__PURE__ */ jsx(Text, {
2870
- bold: true,
2871
- children: "Checks"
2872
- }),
2873
- /* @__PURE__ */ jsx(Text, { children: " " }),
2874
- termRows < COLLAPSE_BELOW_ROWS ? groups.map((group, i) => /* @__PURE__ */ jsx(GroupHeader$1, {
2875
- group,
2876
- showIcon: true,
2877
- isActive: i === activeIndex
2878
- }, group.area)) : groups.map((group, i) => /* @__PURE__ */ jsxs(Box, {
2879
- flexDirection: "column",
2880
- marginTop: i === 0 ? 0 : 1,
2881
- children: [/* @__PURE__ */ jsx(GroupHeader$1, {
2882
- group,
2883
- showIcon: false,
2884
- isActive: i === activeIndex
2885
- }), group.checks.map((c) => /* @__PURE__ */ jsx(CheckRow, { check: c }, c.id))]
2886
- }, group.area))
2887
- ]
2888
- });
2889
- };
2890
- //#endregion
2891
- //#region src/ui/tui/screens/audit/AuditRunScreen.tsx
2892
- const AuditRunScreen = ({ store }) => {
2893
- useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
2894
- useFileWatcher(join$1(store.session.installDir, AUDIT_CHECKS_FILE), (parsed) => store.setFrameworkContext(AUDIT_CHECKS_KEY, coerceAuditChecks(parsed)));
2895
- const statuses = store.statusMessages.length > 0 ? store.statusMessages : void 0;
2896
- const [columns] = useStdoutDimensions();
2897
- const checks = getAuditChecks(store.session);
2898
- const reportPath = `./${getProgramConfig(store.router.activeProgram).reportFile ?? "posthog-audit-report.md"}`;
2899
- const pendingChecksList = /* @__PURE__ */ jsx(PendingChecksList, { checks });
2900
- const areaPane = /* @__PURE__ */ jsx(AuditAreaPane, {
2901
- checks,
2902
- reportPath,
2903
- slides: store.session.skillId === "events-audit" ? EVENTS_AUDIT_AREA_SLIDES : AUDIT_AREA_SLIDES,
2904
- dashboardUrl: store.session.dashboardUrl,
2905
- notebookUrl: store.session.notebookUrl
2906
- });
2907
- return /* @__PURE__ */ jsx(TabContainer, {
2908
- tabs: [
2909
- {
2910
- id: "status",
2911
- label: "Status",
2912
- component: columns < 80 ? /* @__PURE__ */ jsx(Box, {
2913
- flexDirection: "column",
2914
- flexGrow: 1,
2915
- children: pendingChecksList
2916
- }) : /* @__PURE__ */ jsx(SplitView, {
2917
- left: areaPane,
2918
- right: pendingChecksList
2919
- })
2920
- },
2921
- {
2922
- id: "audit-checks",
2923
- label: "Audit plan",
2924
- component: /* @__PURE__ */ jsx(AuditChecksViewer, { checks })
2925
- },
2926
- {
2927
- id: "logs",
2928
- label: "Tail logs",
2929
- component: /* @__PURE__ */ jsx(LogViewer, { filePath: WIZARD_LOG_FILE })
2930
- },
2931
- {
2932
- id: "hn",
2933
- label: "HN",
2934
- component: /* @__PURE__ */ jsx(HNViewer, {})
2935
- }
2936
- ],
2937
- statusMessage: statuses,
2938
- expandableStatus: true,
2939
- store
2940
- });
2941
- };
2942
- //#endregion
2943
- //#region src/ui/tui/screens/audit/AuditChecksOutroSection.tsx
2944
- const MAX_VISIBLE = 6;
2945
- const AuditChecksOutroSection = ({ checks, installDir }) => {
2946
- if (checks.length === 0) return null;
2947
- const errors = checks.filter((c) => c.status === "error");
2948
- const warnings = checks.filter((c) => c.status === "warning");
2949
- const suggestions = checks.filter((c) => c.status === "suggestion");
2950
- const problematic = [
2951
- ...errors,
2952
- ...warnings,
2953
- ...suggestions
2954
- ];
2955
- const visible = problematic.slice(0, MAX_VISIBLE);
2956
- const hidden = problematic.length - visible.length;
2957
- return /* @__PURE__ */ jsxs(Box, {
2958
- flexDirection: "column",
2959
- marginTop: 1,
2960
- children: [
2961
- /* @__PURE__ */ jsx(Text, {
2962
- color: "cyan",
2963
- bold: true,
2964
- children: "Items audited:"
2965
- }),
2966
- /* @__PURE__ */ jsxs(Text, {
2967
- dimColor: true,
2968
- children: [
2969
- checks.length,
2970
- " checks · ",
2971
- errors.length,
2972
- " errors · ",
2973
- warnings.length,
2974
- " ",
2975
- "warnings · ",
2976
- suggestions.length,
2977
- " suggestions"
2978
- ]
2979
- }),
2980
- problematic.length === 0 ? /* @__PURE__ */ jsxs(Text, {
2981
- color: "green",
2982
- children: ["•", " No issues found."]
2983
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [visible.map((item) => {
2984
- const style = AUDIT_SEVERITY_STYLE[item.status];
2985
- return /* @__PURE__ */ jsxs(Box, {
2986
- flexDirection: "column",
2987
- marginTop: 1,
2988
- children: [/* @__PURE__ */ jsxs(Text, { children: [
2989
- /* @__PURE__ */ jsx(Text, {
2990
- color: style.color,
2991
- children: style.glyph
2992
- }),
2993
- " ",
2994
- /* @__PURE__ */ jsx(Text, {
2995
- bold: true,
2996
- children: item.label
2997
- }),
2998
- " ",
2999
- /* @__PURE__ */ jsxs(Text, {
3000
- dimColor: true,
3001
- children: [
3002
- "(",
3003
- item.area,
3004
- ")"
3005
- ]
3006
- })
3007
- ] }), item.file && /* @__PURE__ */ jsxs(Text, {
3008
- dimColor: true,
3009
- children: [" ", relativeToInstallDir(item.file, installDir)]
3010
- })]
3011
- }, item.id);
3012
- }), hidden > 0 && /* @__PURE__ */ jsxs(Text, {
3013
- dimColor: true,
3014
- children: [
3015
- "… and ",
3016
- hidden,
3017
- " more. See the report for details."
3018
- ]
3019
- })] })
3020
- ]
3021
- });
3022
- };
3023
- //#endregion
3024
- //#region src/ui/tui/screens/audit/AuditOutroScreen.tsx
3025
- /**
3026
- * AuditOutroScreen — Audit-specific post-run summary. Renders the standard
3027
- * success / error / cancel views with the audit checks summary inlined into
3028
- * the success body. The report path shown in the success headline comes from
3029
- * the program's `successMessage`, so this screen is program-agnostic.
3030
- */
3031
- const AuditOutroScreen = ({ store }) => {
3032
- useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
3033
- useInput(() => {
3034
- store.setOutroDismissed();
3035
- });
3036
- const outroData = store.session.outroData;
3037
- if (!outroData) return /* @__PURE__ */ jsx(Box, {
3038
- flexDirection: "column",
3039
- flexGrow: 1,
3040
- children: /* @__PURE__ */ jsx(Text, {
3041
- dimColor: true,
3042
- children: "Finishing up..."
3043
- })
3044
- });
3045
- return /* @__PURE__ */ jsxs(Box, {
3046
- flexDirection: "column",
3047
- flexGrow: 1,
3048
- children: [
3049
- outroData.kind === "success" && /* @__PURE__ */ jsxs(Box, {
3050
- flexDirection: "column",
3051
- children: [
3052
- /* @__PURE__ */ jsxs(Text, {
3053
- color: "green",
3054
- bold: true,
3055
- children: ["✔ ", outroData.message || "Audit complete!"]
3056
- }),
3057
- outroData.dashboardUrl && /* @__PURE__ */ jsx(Box, {
3058
- marginTop: 1,
3059
- children: /* @__PURE__ */ jsxs(Text, { children: ["Dashboard: ", /* @__PURE__ */ jsx(Text, {
3060
- color: "cyan",
3061
- children: outroData.dashboardUrl
3062
- })] })
3063
- }),
3064
- outroData.notebookUrl && /* @__PURE__ */ jsx(Box, {
3065
- marginTop: 1,
3066
- children: /* @__PURE__ */ jsxs(Text, { children: ["Notebook: ", /* @__PURE__ */ jsx(Text, {
3067
- color: "cyan",
3068
- children: outroData.notebookUrl
3069
- })] })
3070
- }),
3071
- outroData.reportFile && /* @__PURE__ */ jsxs(Box, {
3072
- flexDirection: "column",
3073
- marginTop: 1,
3074
- children: [
3075
- /* @__PURE__ */ jsx(Text, {
3076
- color: "cyan",
3077
- bold: true,
3078
- children: "Report saved to:"
3079
- }),
3080
- /* @__PURE__ */ jsx(Text, { children: join$1(store.session.installDir, outroData.reportFile) }),
3081
- /* @__PURE__ */ jsx(Text, {
3082
- dimColor: true,
3083
- children: "A markdown file in your project folder. Open it in any editor to read the full audit."
3084
- })
3085
- ]
3086
- }),
3087
- /* @__PURE__ */ jsx(AuditChecksOutroSection, {
3088
- checks: getAuditChecks(store.session),
3089
- installDir: store.session.installDir
3090
- }),
3091
- outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
3092
- marginTop: 1,
3093
- children: /* @__PURE__ */ jsxs(Text, { children: ["Learn more: ", /* @__PURE__ */ jsx(Text, {
3094
- color: "cyan",
3095
- children: outroData.docsUrl
3096
- })] })
3097
- })
3098
- ]
3099
- }),
3100
- outroData.kind === "error" && /* @__PURE__ */ jsxs(Box, {
3101
- flexDirection: "column",
3102
- children: [/* @__PURE__ */ jsxs(Text, {
3103
- color: "red",
3104
- bold: true,
3105
- children: ["✘ ", outroData.message || "An error occurred"]
3106
- }), outroData.body && /* @__PURE__ */ jsx(Box, {
3107
- marginTop: 1,
3108
- children: /* @__PURE__ */ jsx(Text, {
3109
- dimColor: true,
3110
- children: outroData.body
3111
- })
3112
- })]
3113
- }),
3114
- outroData.kind === "cancel" && /* @__PURE__ */ jsxs(Text, {
3115
- color: "yellow",
3116
- children: ["■ ", outroData.message || "Cancelled"]
3117
- }),
3118
- /* @__PURE__ */ jsx(Box, {
3119
- marginTop: 1,
3120
- children: /* @__PURE__ */ jsx(Text, {
3121
- color: Colors.muted,
3122
- children: "Press any key to continue"
3123
- })
3124
- })
3125
- ]
3126
- });
3127
- };
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, {
2822
+ }), " "] }) : null, /* @__PURE__ */ jsxs(Text, { children: [
2823
+ /* @__PURE__ */ jsx(Text, {
2824
+ bold: true,
2825
+ children: group.area
2826
+ }),
2827
+ " ",
2828
+ /* @__PURE__ */ jsxs(Text, {
3766
2829
  dimColor: true,
3767
2830
  children: [
3768
- "Widen the terminal to at least ",
3769
- MIN_TERMINAL_COLUMNS,
3770
- " columns to play Hedgehog Runner."
2831
+ "(",
2832
+ complete,
2833
+ "/",
2834
+ total,
2835
+ ")"
3771
2836
  ]
3772
2837
  })
2838
+ ] })] });
2839
+ };
2840
+ const CheckRow = ({ check }) => {
2841
+ const { glyph, color } = AUDIT_SEVERITY_STYLE[check.status];
2842
+ return /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2843
+ color,
2844
+ children: glyph
2845
+ }), /* @__PURE__ */ jsxs(Text, {
2846
+ dimColor: check.status === "pending",
2847
+ children: [" ", check.label]
2848
+ })] });
2849
+ };
2850
+ const COLLAPSE_BELOW_ROWS = 24;
2851
+ const PendingChecksList = ({ checks }) => {
2852
+ const [, termRows] = useStdoutDimensions();
2853
+ if (checks.length === 0) return /* @__PURE__ */ jsxs(Box, {
2854
+ flexDirection: "column",
2855
+ children: [
2856
+ /* @__PURE__ */ jsx(Text, {
2857
+ bold: true,
2858
+ children: "Checks"
2859
+ }),
2860
+ /* @__PURE__ */ jsx(Text, { children: " " }),
2861
+ /* @__PURE__ */ jsx(LoadingBox, { message: "Seeding audit checklist..." })
2862
+ ]
3773
2863
  });
2864
+ const groups = groupByArea(checks);
2865
+ const activeIndex = groups.findIndex((g) => g.checks.some((c) => c.status === "pending"));
3774
2866
  return /* @__PURE__ */ jsxs(Box, {
3775
2867
  flexDirection: "column",
3776
- paddingX: 1,
3777
2868
  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
2869
  /* @__PURE__ */ jsx(Text, {
3801
- color: Colors.muted,
3802
- children: GROUND_GLYPH.repeat(40)
3803
- })
2870
+ bold: true,
2871
+ children: "Checks"
2872
+ }),
2873
+ /* @__PURE__ */ jsx(Text, { children: " " }),
2874
+ termRows < COLLAPSE_BELOW_ROWS ? groups.map((group, i) => /* @__PURE__ */ jsx(GroupHeader, {
2875
+ group,
2876
+ showIcon: true,
2877
+ isActive: i === activeIndex
2878
+ }, group.area)) : groups.map((group, i) => /* @__PURE__ */ jsxs(Box, {
2879
+ flexDirection: "column",
2880
+ marginTop: i === 0 ? 0 : 1,
2881
+ children: [/* @__PURE__ */ jsx(GroupHeader, {
2882
+ group,
2883
+ showIcon: false,
2884
+ isActive: i === activeIndex
2885
+ }), group.checks.map((c) => /* @__PURE__ */ jsx(CheckRow, { check: c }, c.id))]
2886
+ }, group.area))
3804
2887
  ]
3805
2888
  });
3806
2889
  };
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
2890
  //#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 }) => {
2891
+ //#region src/ui/tui/screens/audit/AuditRunScreen.tsx
2892
+ const AuditRunScreen = ({ store }) => {
3843
2893
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
3844
2894
  useFileWatcher(join$1(store.session.installDir, AUDIT_CHECKS_FILE), (parsed) => store.setFrameworkContext(AUDIT_CHECKS_KEY, coerceAuditChecks(parsed)));
3845
2895
  const statuses = store.statusMessages.length > 0 ? store.statusMessages : void 0;
3846
2896
  const [columns] = useStdoutDimensions();
3847
- const [gameState, setGameState] = useState(() => initialState());
3848
2897
  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 });
2898
+ const reportPath = `./${getProgramConfig(store.router.activeProgram).reportFile ?? "posthog-audit-report.md"}`;
2899
+ const pendingChecksList = /* @__PURE__ */ jsx(PendingChecksList, { checks });
2900
+ const areaPane = /* @__PURE__ */ jsx(AuditAreaPane, {
2901
+ checks,
2902
+ reportPath,
2903
+ slides: store.session.skillId === "audit-events" ? EVENTS_AUDIT_AREA_SLIDES : AUDIT_AREA_SLIDES,
2904
+ dashboardUrl: store.session.dashboardUrl,
2905
+ notebookUrl: store.session.notebookUrl
2906
+ });
3851
2907
  return /* @__PURE__ */ jsx(TabContainer, {
3852
2908
  tabs: [
3853
2909
  {
3854
2910
  id: "status",
3855
- label: "Arcade",
2911
+ label: "Status",
3856
2912
  component: columns < 80 ? /* @__PURE__ */ jsx(Box, {
3857
2913
  flexDirection: "column",
3858
2914
  flexGrow: 1,
3859
- children: checksPanel
2915
+ children: pendingChecksList
3860
2916
  }) : /* @__PURE__ */ jsx(SplitView, {
3861
- left: /* @__PURE__ */ jsx(Audit3000AreaPane, {
3862
- checks,
3863
- reportPath
3864
- }),
3865
- right: checksPanel
2917
+ left: areaPane,
2918
+ right: pendingChecksList
3866
2919
  })
3867
2920
  },
3868
2921
  {
3869
2922
  id: "audit-checks",
3870
- label: "Hi-score table (report)",
2923
+ label: "Audit plan",
3871
2924
  component: /* @__PURE__ */ jsx(AuditChecksViewer, { checks })
3872
2925
  },
3873
- {
3874
- id: "play",
3875
- label: "Play",
3876
- component: /* @__PURE__ */ jsx(HedgehogRunner, {
3877
- state: gameState,
3878
- onChange: setGameState
3879
- })
3880
- },
3881
2926
  {
3882
2927
  id: "logs",
3883
2928
  label: "Tail logs",
@@ -3895,129 +2940,95 @@ const Audit3000RunScreen = ({ store }) => {
3895
2940
  });
3896
2941
  };
3897
2942
  //#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
- ] });
2943
+ //#region src/ui/tui/screens/audit/AuditChecksOutroSection.tsx
2944
+ const MAX_VISIBLE = 6;
2945
+ const AuditChecksOutroSection = ({ checks, installDir }) => {
2946
+ if (checks.length === 0) return null;
2947
+ const errors = checks.filter((c) => c.status === "error");
2948
+ const warnings = checks.filter((c) => c.status === "warning");
2949
+ const suggestions = checks.filter((c) => c.status === "suggestion");
2950
+ const problematic = [
2951
+ ...errors,
2952
+ ...warnings,
2953
+ ...suggestions
2954
+ ];
2955
+ const visible = problematic.slice(0, MAX_VISIBLE);
2956
+ const hidden = problematic.length - visible.length;
3950
2957
  return /* @__PURE__ */ jsxs(Box, {
3951
2958
  flexDirection: "column",
3952
2959
  marginTop: 1,
3953
2960
  children: [
3954
2961
  /* @__PURE__ */ jsx(Text, {
2962
+ color: "cyan",
3955
2963
  bold: true,
3956
- color: NEON_PINK,
3957
- children: top
2964
+ children: "Items audited:"
3958
2965
  }),
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
2966
+ /* @__PURE__ */ jsxs(Text, {
2967
+ dimColor: true,
2968
+ children: [
2969
+ checks.length,
2970
+ " checks · ",
2971
+ errors.length,
2972
+ " errors · ",
2973
+ warnings.length,
2974
+ " ",
2975
+ "warnings · ",
2976
+ suggestions.length,
2977
+ " suggestions"
2978
+ ]
3979
2979
  }),
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
- })
2980
+ problematic.length === 0 ? /* @__PURE__ */ jsxs(Text, {
2981
+ color: "green",
2982
+ children: ["•", " No issues found."]
2983
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [visible.map((item) => {
2984
+ const style = AUDIT_SEVERITY_STYLE[item.status];
2985
+ return /* @__PURE__ */ jsxs(Box, {
2986
+ flexDirection: "column",
2987
+ marginTop: 1,
2988
+ children: [/* @__PURE__ */ jsxs(Text, { children: [
2989
+ /* @__PURE__ */ jsx(Text, {
2990
+ color: style.color,
2991
+ children: style.glyph
2992
+ }),
2993
+ " ",
2994
+ /* @__PURE__ */ jsx(Text, {
2995
+ bold: true,
2996
+ children: item.label
2997
+ }),
2998
+ " ",
2999
+ /* @__PURE__ */ jsxs(Text, {
3000
+ dimColor: true,
3001
+ children: [
3002
+ "(",
3003
+ item.area,
3004
+ ")"
3005
+ ]
3006
+ })
3007
+ ] }), item.file && /* @__PURE__ */ jsxs(Text, {
3008
+ dimColor: true,
3009
+ children: [" ", relativeToInstallDir(item.file, installDir)]
3010
+ })]
3011
+ }, item.id);
3012
+ }), hidden > 0 && /* @__PURE__ */ jsxs(Text, {
3013
+ dimColor: true,
3014
+ children: [
3015
+ "… and ",
3016
+ hidden,
3017
+ " more. See the report for details."
3018
+ ]
3019
+ })] })
4017
3020
  ]
4018
3021
  });
4019
3022
  };
4020
- const Audit3000OutroScreen = ({ store }) => {
3023
+ //#endregion
3024
+ //#region src/ui/tui/screens/audit/AuditOutroScreen.tsx
3025
+ /**
3026
+ * AuditOutroScreen — Audit-specific post-run summary. Renders the standard
3027
+ * success / error / cancel views with the audit checks summary inlined into
3028
+ * the success body. The report path shown in the success headline comes from
3029
+ * the program's `successMessage`, so this screen is program-agnostic.
3030
+ */
3031
+ const AuditOutroScreen = ({ store }) => {
4021
3032
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
4022
3033
  useInput(() => {
4023
3034
  store.setOutroDismissed();
@@ -4028,10 +3039,9 @@ const Audit3000OutroScreen = ({ store }) => {
4028
3039
  flexGrow: 1,
4029
3040
  children: /* @__PURE__ */ jsx(Text, {
4030
3041
  dimColor: true,
4031
- children: "Counting your tokens…"
3042
+ children: "Finishing up..."
4032
3043
  })
4033
3044
  });
4034
- const checks = getAuditChecks(store.session);
4035
3045
  return /* @__PURE__ */ jsxs(Box, {
4036
3046
  flexDirection: "column",
4037
3047
  flexGrow: 1,
@@ -4039,37 +3049,43 @@ const Audit3000OutroScreen = ({ store }) => {
4039
3049
  outroData.kind === "success" && /* @__PURE__ */ jsxs(Box, {
4040
3050
  flexDirection: "column",
4041
3051
  children: [
4042
- /* @__PURE__ */ jsx(FinalScorePanel, { checks }),
4043
- /* @__PURE__ */ jsx(Box, {
3052
+ /* @__PURE__ */ jsxs(Text, {
3053
+ color: "green",
3054
+ bold: true,
3055
+ children: ["✔ ", outroData.message || "Audit complete!"]
3056
+ }),
3057
+ outroData.dashboardUrl && /* @__PURE__ */ jsx(Box, {
4044
3058
  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
- })
3059
+ children: /* @__PURE__ */ jsxs(Text, { children: ["Dashboard: ", /* @__PURE__ */ jsx(Text, {
3060
+ color: "cyan",
3061
+ children: outroData.dashboardUrl
3062
+ })] })
3063
+ }),
3064
+ outroData.notebookUrl && /* @__PURE__ */ jsx(Box, {
3065
+ marginTop: 1,
3066
+ children: /* @__PURE__ */ jsxs(Text, { children: ["Notebook: ", /* @__PURE__ */ jsx(Text, {
3067
+ color: "cyan",
3068
+ children: outroData.notebookUrl
3069
+ })] })
4054
3070
  }),
4055
3071
  outroData.reportFile && /* @__PURE__ */ jsxs(Box, {
4056
3072
  flexDirection: "column",
4057
3073
  marginTop: 1,
4058
3074
  children: [
4059
3075
  /* @__PURE__ */ jsx(Text, {
4060
- bold: true,
4061
3076
  color: "cyan",
4062
- children: "High-score reel saved to:"
3077
+ bold: true,
3078
+ children: "Report saved to:"
4063
3079
  }),
4064
3080
  /* @__PURE__ */ jsx(Text, { children: join$1(store.session.installDir, outroData.reportFile) }),
4065
3081
  /* @__PURE__ */ jsx(Text, {
4066
3082
  dimColor: true,
4067
- children: "A markdown file in your project folder open it in any editor to read the full audit."
3083
+ children: "A markdown file in your project folder. Open it in any editor to read the full audit."
4068
3084
  })
4069
3085
  ]
4070
3086
  }),
4071
3087
  /* @__PURE__ */ jsx(AuditChecksOutroSection, {
4072
- checks,
3088
+ checks: getAuditChecks(store.session),
4073
3089
  installDir: store.session.installDir
4074
3090
  }),
4075
3091
  outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
@@ -4086,11 +3102,7 @@ const Audit3000OutroScreen = ({ store }) => {
4086
3102
  children: [/* @__PURE__ */ jsxs(Text, {
4087
3103
  color: "red",
4088
3104
  bold: true,
4089
- children: [
4090
- "✘",
4091
- " ",
4092
- outroData.message || "An error occurred"
4093
- ]
3105
+ children: ["✘ ", outroData.message || "An error occurred"]
4094
3106
  }), outroData.body && /* @__PURE__ */ jsx(Box, {
4095
3107
  marginTop: 1,
4096
3108
  children: /* @__PURE__ */ jsx(Text, {
@@ -4101,11 +3113,7 @@ const Audit3000OutroScreen = ({ store }) => {
4101
3113
  }),
4102
3114
  outroData.kind === "cancel" && /* @__PURE__ */ jsxs(Text, {
4103
3115
  color: "yellow",
4104
- children: [
4105
- "■",
4106
- " ",
4107
- outroData.message || "Cancelled"
4108
- ]
3116
+ children: ["■ ", outroData.message || "Cancelled"]
4109
3117
  }),
4110
3118
  /* @__PURE__ */ jsx(Box, {
4111
3119
  marginTop: 1,
@@ -4347,9 +3355,9 @@ const RunScreen = ({ store }) => {
4347
3355
  useFileWatcher(join$1(store.session.installDir, EVENT_PLAN_FILE), (parsed) => {
4348
3356
  if (!Array.isArray(parsed)) return;
4349
3357
  store.setEventPlan(parsed.map((e) => ({
4350
- name: e.name ?? e.event ?? "",
4351
- description: e.description ?? ""
4352
- })));
3358
+ name: e.event_name ?? e.name ?? e.event ?? "",
3359
+ description: e.event_description ?? e.description ?? ""
3360
+ })).filter((e) => e.name));
4353
3361
  });
4354
3362
  const [columns] = useStdoutDimensions();
4355
3363
  const progressItems = store.tasks.map((t) => ({
@@ -4962,15 +3970,11 @@ function createMcpSuggestedPromptsServices(_store) {
4962
3970
  user: result.user
4963
3971
  };
4964
3972
  },
4965
- checkSlackConnected: async (credentials, signal) => {
4966
- const { fetchSlackConnected } = await import("./api-Dwd0B-E9.js").then((n) => n.n);
4967
- return fetchSlackConnected(credentials.accessToken, credentials.projectId, credentials.host, signal);
4968
- },
4969
3973
  runPromptStreaming: (args) => runProductionPromptStreaming(args)
4970
3974
  };
4971
3975
  }
4972
3976
  async function* runProductionPromptStreaming(args) {
4973
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-tdoy9UJ2.js");
3977
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DQz4FSb1.js");
4974
3978
  yield* runMcpPromptViaSdk(args);
4975
3979
  }
4976
3980
  //#endregion
@@ -4999,9 +4003,6 @@ function createScreens(store, services) {
4999
4003
  ["audit-intro"]: /* @__PURE__ */ jsx(AuditIntroScreen, { store }),
5000
4004
  ["audit-run"]: /* @__PURE__ */ jsx(AuditRunScreen, { store }),
5001
4005
  ["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
4006
  ["health-check"]: /* @__PURE__ */ jsx(HealthCheckScreen, { store }),
5006
4007
  ["doctor-intro"]: /* @__PURE__ */ jsx(DoctorIntroScreen, { store }),
5007
4008
  ["doctor-report"]: /* @__PURE__ */ jsx(DoctorReportScreen, { store }),
@@ -5110,4 +4111,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5110
4111
  //#endregion
5111
4112
  export { startTUI };
5112
4113
 
5113
- //# sourceMappingURL=start-tui-SLeEzlJs.js.map
4114
+ //# sourceMappingURL=start-tui-WNb3ET14.js.map