@posthog/wizard 2.12.0 → 2.13.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 (51) hide show
  1. package/dist/{AuditChecksViewer-DsfXIO9e.js → AuditChecksViewer-CjBCZjxG.js} +157 -54
  2. package/dist/AuditChecksViewer-CjBCZjxG.js.map +1 -0
  3. package/dist/{add-mcp-server-to-clients-BKoew3aT.js → add-mcp-server-to-clients-D1IyBa9u.js} +4 -4
  4. package/dist/{add-mcp-server-to-clients-BKoew3aT.js.map → add-mcp-server-to-clients-D1IyBa9u.js.map} +1 -1
  5. package/dist/{agent-interface-D5W9BAB2.js → agent-interface-D9DeIikl.js} +7 -6
  6. package/dist/{agent-interface-D5W9BAB2.js.map → agent-interface-D9DeIikl.js.map} +1 -1
  7. package/dist/{agent-runner-B8Cx6X6x.js → agent-runner-B41-Iig3.js} +9 -8
  8. package/dist/{agent-runner-B8Cx6X6x.js.map → agent-runner-B41-Iig3.js.map} +1 -1
  9. package/dist/{analytics-DmD31Ssc.js → analytics-Cek5hIwm.js} +2 -2
  10. package/dist/{analytics-DmD31Ssc.js.map → analytics-Cek5hIwm.js.map} +1 -1
  11. package/dist/analytics-CpbY05Lf.js +2 -0
  12. package/dist/bin.js +237 -32
  13. package/dist/bin.js.map +1 -1
  14. package/dist/{debug-Bkaqv1ab.js → debug-B2BH87dh.js} +2 -2
  15. package/dist/{debug-Bkaqv1ab.js.map → debug-B2BH87dh.js.map} +1 -1
  16. package/dist/{debug-I5sRZubJ.js → debug-BNWsxaDm.js} +1 -1
  17. package/dist/{detection-C_RfYYDe.js → detection-BFl2AYV6.js} +3 -3
  18. package/dist/{detection-C_RfYYDe.js.map → detection-BFl2AYV6.js.map} +1 -1
  19. package/dist/{package-manager-qxP2PpM_.js → package-manager-BBTvHn9i.js} +2 -2
  20. package/dist/{package-manager-qxP2PpM_.js.map → package-manager-BBTvHn9i.js.map} +1 -1
  21. package/dist/{posthog-integration-DX77Msto.js → posthog-integration-vFBuSN5U.js} +9 -9
  22. package/dist/{posthog-integration-DX77Msto.js.map → posthog-integration-vFBuSN5U.js.map} +1 -1
  23. package/dist/provisioning--RCv39tI.js +2 -0
  24. package/dist/{provisioning-DUj285NO.js → provisioning-DRwH4skH.js} +3 -3
  25. package/dist/{provisioning-DUj285NO.js.map → provisioning-DRwH4skH.js.map} +1 -1
  26. package/dist/{registry-CCtIsqb8.js → registry-CZjMhhsK.js} +4 -4
  27. package/dist/{registry-CCtIsqb8.js.map → registry-CZjMhhsK.js.map} +1 -1
  28. package/dist/{router-BTfmEDDJ.js → router-COhhuIW3.js} +3 -2
  29. package/dist/router-COhhuIW3.js.map +1 -0
  30. package/dist/{setup-utils-Bv8z6HMb.js → setup-utils-DGUR4Djo.js} +6 -6
  31. package/dist/{setup-utils-Bv8z6HMb.js.map → setup-utils-DGUR4Djo.js.map} +1 -1
  32. package/dist/setup-utils-eh1450iu.js +2 -0
  33. package/dist/{start-playground-DYNQ8rOz.js → start-playground-DPYl5WR-.js} +3 -3
  34. package/dist/{start-playground-DYNQ8rOz.js.map → start-playground-DPYl5WR-.js.map} +1 -1
  35. package/dist/{start-tui-DleQG3La.js → start-tui-Cj_4BhK8.js} +1225 -42
  36. package/dist/start-tui-Cj_4BhK8.js.map +1 -0
  37. package/dist/{steps-C-syS8if.js → steps-BFD76-MP.js} +6 -6
  38. package/dist/{steps-C-syS8if.js.map → steps-BFD76-MP.js.map} +1 -1
  39. package/dist/{telemetry-DHZfjgqx.js → telemetry-DCyjsXhw.js} +2 -2
  40. package/dist/{telemetry-DHZfjgqx.js.map → telemetry-DCyjsXhw.js.map} +1 -1
  41. package/dist/{wizard-abort-DfhWuzaw.js → wizard-abort-54DpTnUi.js} +3 -3
  42. package/dist/{wizard-abort-DfhWuzaw.js.map → wizard-abort-54DpTnUi.js.map} +1 -1
  43. package/dist/{wizard-abort-DIhFXJ5N.js → wizard-abort-CZH03nD0.js} +1 -1
  44. package/npm-shrinkwrap.json +2 -2
  45. package/package.json +1 -1
  46. package/dist/AuditChecksViewer-DsfXIO9e.js.map +0 -1
  47. package/dist/analytics-JDitS2JI.js +0 -2
  48. package/dist/provisioning-CHfTOEvg.js +0 -2
  49. package/dist/router-BTfmEDDJ.js.map +0 -1
  50. package/dist/setup-utils-CoX-vLgw.js +0 -2
  51. package/dist/start-tui-DleQG3La.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import { d as SERVICE_LABELS } from "./debug-Bkaqv1ab.js";
1
+ import { d as SERVICE_LABELS } from "./debug-B2BH87dh.js";
2
2
  import { n as isTaskStatus } from "./wizard-ui-YdGFRyu_.js";
3
- import { n as analytics, r as sessionProperties } from "./analytics-DmD31Ssc.js";
3
+ import { n as analytics, r as sessionProperties } from "./analytics-Cek5hIwm.js";
4
4
  import { r as buildSession } from "./wizard-session-BcNJTl2I.js";
5
- import { g as AUDIT_SEVERITY_STYLE } from "./agent-interface-D5W9BAB2.js";
6
- import { n as getKindMeta } from "./bin.js";
5
+ import { g as AUDIT_SEVERITY_STYLE } from "./agent-interface-D9DeIikl.js";
6
+ import { r as getKindMeta } from "./bin.js";
7
7
  import { n as AVAILABLE_FEATURES, t as ALL_FEATURE_VALUES } from "./defaults-GbLPuHxj.js";
8
- import { i as WORKFLOW_STEPS, t as WizardRouter } from "./router-BTfmEDDJ.js";
8
+ import { i as WORKFLOW_STEPS, t as WizardRouter } from "./router-COhhuIW3.js";
9
9
  import * as fs$1 from "fs";
10
10
  import { Box, Text, measureElement, useInput, useStdout } from "ink";
11
11
  import { Component, Fragment, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
@@ -3480,6 +3480,27 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
3480
3480
  })]
3481
3481
  });
3482
3482
  };
3483
+ //#endregion
3484
+ //#region src/ui/tui/screens/audit/AuditChecksViewer/AreaHeaderRow.tsx
3485
+ /** Sub-header row inside the scrollable body — one per area group. */
3486
+ const AreaHeaderRow = ({ area, resolved, total }) => /* @__PURE__ */ jsxs(Box, {
3487
+ flexShrink: 0,
3488
+ marginTop: 1,
3489
+ children: [/* @__PURE__ */ jsxs(Text, {
3490
+ bold: true,
3491
+ color: "cyan",
3492
+ children: [area, " "]
3493
+ }), /* @__PURE__ */ jsxs(Text, {
3494
+ dimColor: true,
3495
+ children: [
3496
+ "(",
3497
+ resolved,
3498
+ "/",
3499
+ total,
3500
+ ")"
3501
+ ]
3502
+ })]
3503
+ });
3483
3504
  /** ScreenContainer wraps content in paddingX={1} inside a width capped at
3484
3505
  * MAX_WIDTH, so the actual width available to the viewer is
3485
3506
  * min(cols, MAX_WIDTH) - 2. */
@@ -3493,7 +3514,7 @@ function computeLayout(rawCols, termRows) {
3493
3514
  const fixedExceptLabel = padding + statusWidth + 2 + 18 + 2 + 2;
3494
3515
  const labelWidth = Math.max(28, cols - fixedExceptLabel);
3495
3516
  const detailIndent = statusWidth + 2 + 18 + 2;
3496
- const viewerChrome = 9;
3517
+ const viewerChrome = 10;
3497
3518
  return {
3498
3519
  cols,
3499
3520
  visibleHeight: Math.max(5, termRows - 10 - viewerChrome),
@@ -3547,24 +3568,60 @@ const CheckRow = ({ item, layout }) => {
3547
3568
  };
3548
3569
  //#endregion
3549
3570
  //#region src/ui/tui/screens/audit/AuditChecksViewer/DetailRow.tsx
3571
+ /** Format a `details` string. If it parses as a JSON object, render it as
3572
+ * indented key: value lines (skipping huge nested arrays/objects which we
3573
+ * truncate). Otherwise return the original text. v3000 emits structured
3574
+ * JSON for several event-quality checks — a raw dump is unreadable. */
3575
+ function formatDetails(raw) {
3576
+ const trimmed = raw.trim();
3577
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return [raw];
3578
+ let parsed;
3579
+ try {
3580
+ parsed = JSON.parse(trimmed);
3581
+ } catch {
3582
+ return [raw];
3583
+ }
3584
+ if (parsed === null || typeof parsed !== "object") return [raw];
3585
+ const lines = [];
3586
+ const renderValue = (v) => {
3587
+ if (v === null) return "null";
3588
+ if (typeof v === "string") return v;
3589
+ if (typeof v === "number" || typeof v === "boolean") return String(v);
3590
+ if (Array.isArray(v)) {
3591
+ if (v.length === 0) return "[]";
3592
+ if (v.every((e) => e === null || typeof e !== "object")) return v.map(renderValue).join(", ");
3593
+ return `[${v.length} item${v.length === 1 ? "" : "s"}]`;
3594
+ }
3595
+ if (typeof v === "object") {
3596
+ const keys = Object.keys(v);
3597
+ return `{${keys.length} field${keys.length === 1 ? "" : "s"}}`;
3598
+ }
3599
+ return String(v);
3600
+ };
3601
+ for (const [key, value] of Object.entries(parsed)) lines.push(`${key}: ${renderValue(value)}`);
3602
+ return lines.length > 0 ? lines : [raw];
3603
+ }
3550
3604
  /** Indented under the CHECK column; wrap continuation aligns with the prefix. */
3551
- const DetailRow = ({ item, layout }) => /* @__PURE__ */ jsxs(Box, {
3552
- flexShrink: 0,
3553
- children: [/* @__PURE__ */ jsx(Box, { width: layout.detailIndent }), /* @__PURE__ */ jsxs(Box, {
3554
- flexDirection: "column",
3555
- width: layout.detailWidth,
3556
- children: [item.file && /* @__PURE__ */ jsx(Text, {
3557
- dimColor: true,
3558
- wrap: "wrap",
3559
- children: `↳ File: ${item.file}`
3560
- }), item.details && /* @__PURE__ */ jsx(Text, {
3561
- dimColor: true,
3562
- italic: true,
3563
- wrap: "wrap",
3564
- children: `${item.file ? " " : "↳ "}Details: ${item.details}`
3605
+ const DetailRow = ({ item, layout }) => {
3606
+ const detailLines = item.details ? formatDetails(item.details) : [];
3607
+ return /* @__PURE__ */ jsxs(Box, {
3608
+ flexShrink: 0,
3609
+ children: [/* @__PURE__ */ jsx(Box, { width: layout.detailIndent }), /* @__PURE__ */ jsxs(Box, {
3610
+ flexDirection: "column",
3611
+ width: layout.detailWidth,
3612
+ children: [item.file && /* @__PURE__ */ jsx(Text, {
3613
+ dimColor: true,
3614
+ wrap: "wrap",
3615
+ children: `↳ File: ${item.file}`
3616
+ }), detailLines.map((line, i) => /* @__PURE__ */ jsx(Text, {
3617
+ dimColor: true,
3618
+ italic: true,
3619
+ wrap: "wrap",
3620
+ children: i === 0 ? `${item.file ? " " : "↳ "}${line}` : ` ${line}`
3621
+ }, i))]
3565
3622
  })]
3566
- })]
3567
- });
3623
+ });
3624
+ };
3568
3625
  //#endregion
3569
3626
  //#region src/ui/tui/screens/audit/AuditChecksViewer/Legend.tsx
3570
3627
  const Legend = () => /* @__PURE__ */ jsxs(Text, { children: [
@@ -3670,22 +3727,61 @@ const STATUS_ORDER = {
3670
3727
  pass: 3,
3671
3728
  pending: 4
3672
3729
  };
3673
- /** Issues at the top (error warning suggestion), then passes, then pending todos. */
3674
- function sortChecks(checks) {
3675
- return [...checks].sort((a, b) => {
3676
- const da = STATUS_ORDER[a.status] - STATUS_ORDER[b.status];
3677
- if (da !== 0) return da;
3730
+ /** Audit areas in the order they should be displayed. Areas not listed
3731
+ * here fall through to alphabetical order at the end. Mirrors the
3732
+ * Full audit section grouping in the generated report. */
3733
+ const AREA_ORDER = [
3734
+ "Installation",
3735
+ "Identification",
3736
+ "Event Capture",
3737
+ "Event Quality",
3738
+ "Feature Flags",
3739
+ "Session Replay",
3740
+ "Session Replay — Optimize",
3741
+ "Use Case: Expansion",
3742
+ "Additional Sections"
3743
+ ];
3744
+ function areaRank(area) {
3745
+ const idx = AREA_ORDER.indexOf(area);
3746
+ return idx === -1 ? AREA_ORDER.length : idx;
3747
+ }
3748
+ /** Group checks by area, in AREA_ORDER. Within each area, sort by status. */
3749
+ function groupChecksByArea(checks) {
3750
+ const byArea = /* @__PURE__ */ new Map();
3751
+ for (const c of checks) {
3752
+ const list = byArea.get(c.area);
3753
+ if (list) list.push(c);
3754
+ else byArea.set(c.area, [c]);
3755
+ }
3756
+ const groups = [];
3757
+ for (const [area, areaChecks] of byArea) {
3758
+ const sorted = [...areaChecks].sort((a, b) => STATUS_ORDER[a.status] - STATUS_ORDER[b.status]);
3759
+ const resolved = sorted.filter((c) => c.status !== "pending").length;
3760
+ groups.push({
3761
+ area,
3762
+ checks: sorted,
3763
+ counts: {
3764
+ total: sorted.length,
3765
+ resolved
3766
+ }
3767
+ });
3768
+ }
3769
+ groups.sort((a, b) => {
3770
+ const dr = areaRank(a.area) - areaRank(b.area);
3771
+ if (dr !== 0) return dr;
3678
3772
  return a.area.localeCompare(b.area);
3679
3773
  });
3774
+ return groups;
3680
3775
  }
3681
3776
  //#endregion
3682
3777
  //#region src/ui/tui/screens/audit/AuditChecksViewer/AuditChecksViewer.tsx
3683
3778
  /**
3684
3779
  * AuditChecksViewer — "Audit plan" tab.
3685
3780
  *
3686
- * Renders the full audit ledger as a scrollable table grouped by status:
3687
- * resolved checks (issues + passes, sorted by severity) on top, pending
3688
- * checks at the bottom, separated by a blank row.
3781
+ * Renders the full audit ledger as a scrollable, area-grouped list that
3782
+ * mirrors the structure of the final report. Each area gets a sub-header
3783
+ * with a resolved/total count; checks within an area are sorted by
3784
+ * severity (error → warning → suggestion → pass → pending).
3689
3785
  *
3690
3786
  * Two interactions, both registered via `useKeyBindings`:
3691
3787
  * - `e` — toggle detail rows (file:line + agent's `details` text)
@@ -3699,30 +3795,32 @@ const AuditChecksViewer = ({ checks }) => {
3699
3795
  const [rawCols, termRows] = useStdoutDimensions();
3700
3796
  const layout = computeLayout(rawCols, termRows);
3701
3797
  const totalHeight = layout.visibleHeight + layout.viewerChrome;
3702
- const sorted = useMemo(() => sortChecks(checks), [checks]);
3703
- const resolved = sorted.filter((c) => c.status !== "pending");
3704
- const pending = sorted.filter((c) => c.status === "pending");
3705
- const hasExpandable = sorted.some((c) => Boolean(c.details || c.file));
3706
- const [expanded, setExpanded] = useState(sorted.some((c) => c.status === "error" || c.status === "warning" || c.status === "suggestion") && hasExpandable);
3798
+ const groups = useMemo(() => groupChecksByArea(checks), [checks]);
3799
+ const counts = useMemo(() => statusCounts(checks), [checks]);
3800
+ const hasExpandable = checks.some((c) => Boolean(c.details || c.file));
3801
+ const [expanded, setExpanded] = useState(checks.some((c) => c.status === "error" || c.status === "warning" || c.status === "suggestion") && hasExpandable);
3707
3802
  const allRows = useMemo(() => {
3708
3803
  const rows = [];
3709
- const buildRow = (item) => {
3710
- rows.push(/* @__PURE__ */ jsx(CheckRow, {
3711
- item,
3712
- layout
3713
- }, item.id));
3714
- if (expanded && (item.details || item.file)) rows.push(/* @__PURE__ */ jsx(DetailRow, {
3715
- item,
3716
- layout
3717
- }, `${item.id}-detail`));
3718
- };
3719
- resolved.forEach(buildRow);
3720
- if (resolved.length > 0 && pending.length > 0) rows.push(/* @__PURE__ */ jsx(Box, { height: 1 }, "separator"));
3721
- pending.forEach(buildRow);
3804
+ for (const group of groups) {
3805
+ rows.push(/* @__PURE__ */ jsx(AreaHeaderRow, {
3806
+ area: group.area,
3807
+ resolved: group.counts.resolved,
3808
+ total: group.counts.total
3809
+ }, `header-${group.area}`));
3810
+ for (const item of group.checks) {
3811
+ rows.push(/* @__PURE__ */ jsx(CheckRow, {
3812
+ item,
3813
+ layout
3814
+ }, item.id));
3815
+ if (expanded && (item.details || item.file)) rows.push(/* @__PURE__ */ jsx(DetailRow, {
3816
+ item,
3817
+ layout
3818
+ }, `${item.id}-detail`));
3819
+ }
3820
+ }
3722
3821
  return rows;
3723
3822
  }, [
3724
- resolved,
3725
- pending,
3823
+ groups,
3726
3824
  expanded,
3727
3825
  layout
3728
3826
  ]);
@@ -3749,6 +3847,7 @@ const AuditChecksViewer = ({ checks }) => {
3749
3847
  });
3750
3848
  useKeyBindings("audit-checks-viewer", bindings);
3751
3849
  const visibleRows = allRows.slice(clampedOffset, clampedOffset + layout.visibleHeight);
3850
+ const subtitle = groups.length === 0 ? "No checks yet." : `Review across ${groups.length} ${groups.length === 1 ? "area" : "areas"} — mirrors the final report.`;
3752
3851
  return /* @__PURE__ */ jsxs(Box, {
3753
3852
  flexDirection: "column",
3754
3853
  paddingX: 1,
@@ -3760,7 +3859,11 @@ const AuditChecksViewer = ({ checks }) => {
3760
3859
  }),
3761
3860
  /* @__PURE__ */ jsx(Text, {
3762
3861
  dimColor: true,
3763
- children: "Read-only review of installation, identification, and event capture"
3862
+ children: subtitle
3863
+ }),
3864
+ /* @__PURE__ */ jsx(Summary, {
3865
+ total: checks.length,
3866
+ counts
3764
3867
  }),
3765
3868
  /* @__PURE__ */ jsx(Box, { height: 1 }),
3766
3869
  /* @__PURE__ */ jsx(Header, { layout }),
@@ -3784,12 +3887,12 @@ const AuditChecksViewer = ({ checks }) => {
3784
3887
  }),
3785
3888
  /* @__PURE__ */ jsx(Footer, {
3786
3889
  total: checks.length,
3787
- counts: statusCounts(checks)
3890
+ counts
3788
3891
  })
3789
3892
  ]
3790
3893
  });
3791
3894
  };
3792
3895
  //#endregion
3793
- export { Colors as C, CardLayout as S, WizardStore as T, useStdoutDimensions as _, SEVERITY_ORDER as a, LoadingBox as b, LearnCard as c, ScreenContainer as d, EventPlanViewer as f, GroupedPickerMenu as g, ConfirmationInput as h, SEVERITY_LABEL as i, HNViewer as l, ModalOverlay as m, McpScreen as n, ServiceHealthList as o, LogViewer as p, IssueTable as r, TipsCard as s, AuditChecksViewer as t, TabContainer as u, PickerMenu as v, Icons as w, SplitView as x, ProgressList as y };
3896
+ export { CardLayout as C, WizardStore as E, SplitView as S, Icons as T, useStdoutDimensions as _, SEVERITY_ORDER as a, ProgressList as b, LearnCard as c, ScreenContainer as d, EventPlanViewer as f, GroupedPickerMenu as g, ConfirmationInput as h, SEVERITY_LABEL as i, HNViewer as l, ModalOverlay as m, McpScreen as n, ServiceHealthList as o, LogViewer as p, IssueTable as r, TipsCard as s, AuditChecksViewer as t, TabContainer as u, PickerMenu as v, Colors as w, LoadingBox as x, useKeyBindings as y };
3794
3897
 
3795
- //# sourceMappingURL=AuditChecksViewer-DsfXIO9e.js.map
3898
+ //# sourceMappingURL=AuditChecksViewer-CjBCZjxG.js.map