@posthog/wizard 2.28.0 → 2.29.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.
- package/dist/{add-mcp-server-to-clients-BzCc6be4.js → add-mcp-server-to-clients-B6Pj4IKt.js} +4 -4
- package/dist/{add-mcp-server-to-clients-BzCc6be4.js.map → add-mcp-server-to-clients-B6Pj4IKt.js.map} +1 -1
- package/dist/{agent-interface-DRsyO_6R.js → agent-interface-CVW8H9eF.js} +8 -7
- package/dist/{agent-interface-DRsyO_6R.js.map → agent-interface-CVW8H9eF.js.map} +1 -1
- package/dist/{agent-runner-MPlvLP8K.js → agent-runner-VzTpPaVT.js} +18 -9
- package/dist/agent-runner-VzTpPaVT.js.map +1 -0
- package/dist/{analytics-Ds4CvvcU.js → analytics-DvDjbNmK.js} +2 -2
- package/dist/{analytics-Ds4CvvcU.js.map → analytics-DvDjbNmK.js.map} +1 -1
- package/dist/{api-Dye-Pi5r.js → api-DfpSG5xU.js} +3 -3
- package/dist/{api-Dye-Pi5r.js.map → api-DfpSG5xU.js.map} +1 -1
- package/dist/bin.js +410 -234
- package/dist/bin.js.map +1 -1
- package/dist/{ci-install-6P61txQ4.js → ci-install-Bzfo3nON.js} +4 -4
- package/dist/{ci-install-6P61txQ4.js.map → ci-install-Bzfo3nON.js.map} +1 -1
- package/dist/{debug-BDwqX9QZ.js → debug-CMZ7kqW1.js} +17 -3
- package/dist/debug-CMZ7kqW1.js.map +1 -0
- package/dist/{debug-D2iIa763.js → debug-HQ0NrBA2.js} +1 -1
- package/dist/{environment-BaqpBPme.js → environment-cVP7bGnh.js} +3 -3
- package/dist/{environment-BaqpBPme.js.map → environment-cVP7bGnh.js.map} +1 -1
- package/dist/{file-utils-YnB1jGgs.js → file-utils-D1632P4x.js} +2 -2
- package/dist/{file-utils-YnB1jGgs.js.map → file-utils-D1632P4x.js.map} +1 -1
- package/dist/{interactive-DU3K6B8R.js → interactive-DCIL3NcQ.js} +2 -2
- package/dist/{interactive-DU3K6B8R.js.map → interactive-DCIL3NcQ.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-BQeDKkGA.js → mcp-prompt-streaming-BRoVSf3N.js} +5 -5
- package/dist/mcp-prompt-streaming-BRoVSf3N.js.map +1 -0
- package/dist/{non-interactive-BJctvoie.js → non-interactive-u4VG76Vi.js} +2 -2
- package/dist/{non-interactive-BJctvoie.js.map → non-interactive-u4VG76Vi.js.map} +1 -1
- package/dist/{package-manager-BErboBJc.js → package-manager-0M_uIOP0.js} +2 -2
- package/dist/{package-manager-BErboBJc.js.map → package-manager-0M_uIOP0.js.map} +1 -1
- package/dist/{playground-X-wOeuhv.js → playground-B6wgUvH-.js} +5 -5
- package/dist/{playground-X-wOeuhv.js.map → playground-B6wgUvH-.js.map} +1 -1
- package/dist/{posthog-integration-Bh31wBAT.js → posthog-integration-C_9G_kTS.js} +201 -12
- package/dist/posthog-integration-C_9G_kTS.js.map +1 -0
- package/dist/{provisioning-DpdPWuzQ.js → provisioning-CgCxuoe6.js} +3 -3
- package/dist/{provisioning-DpdPWuzQ.js.map → provisioning-CgCxuoe6.js.map} +1 -1
- package/dist/{registry-CSy1ilMT.js → registry-BgsYtCkS.js} +4 -4
- package/dist/{registry-CSy1ilMT.js.map → registry-BgsYtCkS.js.map} +1 -1
- package/dist/{setup-utils-STqW1cwa.js → setup-utils-DF6EKEeA.js} +9 -9
- package/dist/{setup-utils-STqW1cwa.js.map → setup-utils-DF6EKEeA.js.map} +1 -1
- package/dist/{start-tui-BQJQ9_KJ.js → start-tui-Deaj99It.js} +306 -223
- package/dist/start-tui-Deaj99It.js.map +1 -0
- package/dist/{steps-BxSRheOs.js → steps-AF3ulYYe.js} +7 -7
- package/dist/{steps-BxSRheOs.js.map → steps-AF3ulYYe.js.map} +1 -1
- package/dist/{telemetry-De90OWXL.js → telemetry-DPVvKu5X.js} +3 -3
- package/dist/{telemetry-De90OWXL.js.map → telemetry-DPVvKu5X.js.map} +1 -1
- package/dist/{terminal-D430k0Z1.js → terminal-BVKeWPb3.js} +13 -10
- package/dist/terminal-BVKeWPb3.js.map +1 -0
- package/dist/{urls-DDUXt-oY.js → urls-Bur7Zb7A.js} +2 -2
- package/dist/{urls-DDUXt-oY.js.map → urls-Bur7Zb7A.js.map} +1 -1
- package/dist/{wizard-abort-B_Ri4Ant.js → wizard-abort-D0UMhCP5.js} +3 -3
- package/dist/{wizard-abort-B_Ri4Ant.js.map → wizard-abort-D0UMhCP5.js.map} +1 -1
- package/dist/{wizard-abort-Cht_9Mo0.js → wizard-abort-D3vY7K9a.js} +1 -1
- package/dist/wizard-ui-WZ48rUgr.js.map +1 -1
- package/package.json +1 -1
- package/dist/agent-runner-MPlvLP8K.js.map +0 -1
- package/dist/debug-BDwqX9QZ.js.map +0 -1
- package/dist/mcp-prompt-streaming-BQeDKkGA.js.map +0 -1
- package/dist/posthog-integration-Bh31wBAT.js.map +0 -1
- package/dist/start-tui-BQJQ9_KJ.js.map +0 -1
- package/dist/terminal-D430k0Z1.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as analytics } from "./analytics-
|
|
3
|
-
import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-
|
|
4
|
-
import { a as getUiHostFromHost } from "./urls-
|
|
5
|
-
import { t as ApiError } from "./api-
|
|
1
|
+
import { B as POSTHOG_PRIVACY_URL, G as REMOTE_SKILLS_BASE_URL, I as POSTHOG_DOCS_URL, M as OAUTH_PORTS, N as OAUTH_TIMEOUT_MS, U as POSTHOG_TERMS_URL, Z as WIZARD_TOOLS_MENU_FLAG_KEY, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys, z as POSTHOG_ORG_AI_SETTINGS_URL } from "./debug-CMZ7kqW1.js";
|
|
2
|
+
import { t as analytics } from "./analytics-DvDjbNmK.js";
|
|
3
|
+
import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-DF6EKEeA.js";
|
|
4
|
+
import { a as getUiHostFromHost } from "./urls-Bur7Zb7A.js";
|
|
5
|
+
import { t as ApiError } from "./api-DfpSG5xU.js";
|
|
6
6
|
import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-G3VWD6hv.js";
|
|
7
|
-
import { i as wizardAbort } from "./wizard-abort-
|
|
8
|
-
import { C as AUDIT_SEVERITY_STYLE, T as getAuditChecks, b as AUDIT_CHECKS_FILE, h as fetchSkillMenu, m as downloadSkill, w as coerceAuditChecks, x as AUDIT_CHECKS_KEY } from "./agent-interface-
|
|
9
|
-
import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-
|
|
10
|
-
import { _ as
|
|
11
|
-
import { A as ConfirmationInput, C as TabContainer, D as LinkText, E as LogViewer, F as SplitView, L as WizardStore, M as useStdoutDimensions, N as ProgressList, O as extractUrls, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as ServiceHealthList, a as useSkillEntry, b as LearnCard, c as AUDIT_AREA_SLIDES, d as McpSuggestedPromptsScreen, g as SEVERITY_ORDER, h as SEVERITY_LABEL, i as SkillSourceInfo, k as ModalOverlay, l as VisualBox, m as IssueTable, n as releaseTerminal, o as OutroScreen, p as McpScreen, r as AiOptInRequiredScreen, s as SlackConnectScreen, t as enterDarkTerminal, u as AuditChecksViewer, v as VisualizerTab, w as ScreenContainer, y as TipsCard } from "./terminal-
|
|
7
|
+
import { i as wizardAbort } from "./wizard-abort-D0UMhCP5.js";
|
|
8
|
+
import { C as AUDIT_SEVERITY_STYLE, T as getAuditChecks, b as AUDIT_CHECKS_FILE, h as fetchSkillMenu, m as downloadSkill, w as coerceAuditChecks, x as AUDIT_CHECKS_KEY } from "./agent-interface-CVW8H9eF.js";
|
|
9
|
+
import { f as Colors, h as detectProjectsWithAgent, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-C_9G_kTS.js";
|
|
10
|
+
import { _ as getDetectedWarehouseSources, b as STRIPE_SDKS, d as getProgramConfig, f as AUTOMATABLE_VARIANTS, g as fetchHealthIssues, m as SOURCE_MAPS_CONTEXT_KEYS, n as useKeyBindings, p as DISPLAY_NAME, t as PickerMenu, u as Program, v as getContentBlocks, y as POSTHOG_SDKS } from "./bin.js";
|
|
11
|
+
import { A as ConfirmationInput, C as TabContainer, D as LinkText, E as LogViewer, F as SplitView, L as WizardStore, M as useStdoutDimensions, N as ProgressList, O as extractUrls, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as ServiceHealthList, a as useSkillEntry, b as LearnCard, c as AUDIT_AREA_SLIDES, d as McpSuggestedPromptsScreen, g as SEVERITY_ORDER, h as SEVERITY_LABEL, i as SkillSourceInfo, k as ModalOverlay, l as VisualBox, m as IssueTable, n as releaseTerminal, o as OutroScreen, p as McpScreen, r as AiOptInRequiredScreen, s as SlackConnectScreen, t as enterDarkTerminal, u as AuditChecksViewer, v as VisualizerTab, w as ScreenContainer, y as TipsCard } from "./terminal-BVKeWPb3.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-
|
|
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-B6Pj4IKt.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";
|
|
17
17
|
import { spawn, spawnSync } from "node:child_process";
|
|
18
18
|
import { Box, Text, render, useInput } from "ink";
|
|
19
|
-
import { Fragment, createElement, useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
19
|
+
import { Fragment, createElement, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
20
20
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { access, readdir, rm } from "node:fs/promises";
|
|
22
22
|
import { Spinner, TextInput } from "@inkjs/ui";
|
|
@@ -70,6 +70,12 @@ var InkUI = class {
|
|
|
70
70
|
waitForAiOptIn() {
|
|
71
71
|
return this.store.getGate("ai-opt-in");
|
|
72
72
|
}
|
|
73
|
+
waitForGate(stepId) {
|
|
74
|
+
return this.store.getGate(stepId);
|
|
75
|
+
}
|
|
76
|
+
getFrameworkContext(key) {
|
|
77
|
+
return this.store.session.frameworkContext[key];
|
|
78
|
+
}
|
|
73
79
|
setDetectedFramework(label) {
|
|
74
80
|
this.store.setDetectedFramework(label);
|
|
75
81
|
}
|
|
@@ -1065,7 +1071,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
|
|
|
1065
1071
|
})),
|
|
1066
1072
|
onSelect: (value) => {
|
|
1067
1073
|
const integration = Array.isArray(value) ? value[0] : value;
|
|
1068
|
-
import("./registry-
|
|
1074
|
+
import("./registry-BgsYtCkS.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
|
|
1069
1075
|
const config = FRAMEWORK_REGISTRY[integration];
|
|
1070
1076
|
store.setFrameworkConfig(integration, config);
|
|
1071
1077
|
store.setDetectedFramework(config.metadata.name);
|
|
@@ -1409,7 +1415,7 @@ const RevenueIntroScreen = ({ store }) => {
|
|
|
1409
1415
|
}), /* @__PURE__ */ jsx(Box, {
|
|
1410
1416
|
marginTop: 1,
|
|
1411
1417
|
flexDirection: "column",
|
|
1412
|
-
children: /* @__PURE__ */ jsx(DetectErrorBody$
|
|
1418
|
+
children: /* @__PURE__ */ jsx(DetectErrorBody$2, { error: detectError })
|
|
1413
1419
|
})]
|
|
1414
1420
|
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
1415
1421
|
options: [{
|
|
@@ -1453,7 +1459,7 @@ const RevenueIntroScreen = ({ store }) => {
|
|
|
1453
1459
|
}
|
|
1454
1460
|
});
|
|
1455
1461
|
};
|
|
1456
|
-
const DetectErrorBody$
|
|
1462
|
+
const DetectErrorBody$2 = ({ error }) => {
|
|
1457
1463
|
switch (error.kind) {
|
|
1458
1464
|
case "bad-directory": {
|
|
1459
1465
|
const reasonText = {
|
|
@@ -1654,7 +1660,7 @@ const WarehouseIntroScreen = ({ store }) => {
|
|
|
1654
1660
|
}), /* @__PURE__ */ jsx(Box, {
|
|
1655
1661
|
marginTop: 1,
|
|
1656
1662
|
flexDirection: "column",
|
|
1657
|
-
children: /* @__PURE__ */ jsx(DetectErrorBody$
|
|
1663
|
+
children: /* @__PURE__ */ jsx(DetectErrorBody$1, { error: detectError })
|
|
1658
1664
|
})]
|
|
1659
1665
|
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
1660
1666
|
options: [{
|
|
@@ -1697,7 +1703,7 @@ const WarehouseIntroScreen = ({ store }) => {
|
|
|
1697
1703
|
}
|
|
1698
1704
|
});
|
|
1699
1705
|
};
|
|
1700
|
-
const DetectErrorBody$
|
|
1706
|
+
const DetectErrorBody$1 = ({ error }) => {
|
|
1701
1707
|
switch (error.kind) {
|
|
1702
1708
|
case "bad-directory": {
|
|
1703
1709
|
const reasonText = {
|
|
@@ -1768,27 +1774,14 @@ const MigrationIntroScreen = ({ store }) => {
|
|
|
1768
1774
|
/**
|
|
1769
1775
|
* SourceMapsIntroScreen — Welcome screen for the source-maps upload flow.
|
|
1770
1776
|
*
|
|
1771
|
-
*
|
|
1772
|
-
*
|
|
1773
|
-
*
|
|
1777
|
+
* Static intro: detection now runs after login (on the source-maps-detect
|
|
1778
|
+
* screen), so this screen no longer shows a detected platform. Continue takes
|
|
1779
|
+
* the user straight to authentication.
|
|
1774
1780
|
*/
|
|
1775
1781
|
const SourceMapsIntroScreen = ({ store }) => {
|
|
1776
1782
|
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
1777
1783
|
const [view, setView] = useState("default");
|
|
1778
1784
|
const { session } = store;
|
|
1779
|
-
const detectError = session.frameworkContext[SOURCE_MAPS_CONTEXT_KEYS.detectError];
|
|
1780
|
-
const variant = session.frameworkContext[SOURCE_MAPS_CONTEXT_KEYS.skillVariant];
|
|
1781
|
-
const displayName = session.frameworkContext[SOURCE_MAPS_CONTEXT_KEYS.displayName];
|
|
1782
|
-
const packagePaths = session.frameworkContext[SOURCE_MAPS_CONTEXT_KEYS.packagePaths] ?? [];
|
|
1783
|
-
const detectionRows = [];
|
|
1784
|
-
if (displayName) detectionRows.push({
|
|
1785
|
-
label: "Platform",
|
|
1786
|
-
value: displayName
|
|
1787
|
-
});
|
|
1788
|
-
if (variant) detectionRows.push({
|
|
1789
|
-
label: "Skill",
|
|
1790
|
-
value: `error-tracking-upload-source-maps-${variant}`
|
|
1791
|
-
});
|
|
1792
1785
|
const body = view === "more-info" ? /* @__PURE__ */ jsxs(Box, {
|
|
1793
1786
|
flexDirection: "column",
|
|
1794
1787
|
width: 56,
|
|
@@ -1822,9 +1815,9 @@ const SourceMapsIntroScreen = ({ store }) => {
|
|
|
1822
1815
|
marginTop: 1,
|
|
1823
1816
|
paddingLeft: 4,
|
|
1824
1817
|
children: [
|
|
1825
|
-
/* @__PURE__ */ jsxs(Text, { children: ["•", "
|
|
1818
|
+
/* @__PURE__ */ jsxs(Text, { children: ["•", " Detect the framework(s) in your repo"] }),
|
|
1819
|
+
/* @__PURE__ */ jsxs(Text, { children: ["•", " Download the relevant docs for your stack"] }),
|
|
1826
1820
|
/* @__PURE__ */ jsxs(Text, { children: ["•", " Wire map generation + upload into your build"] }),
|
|
1827
|
-
/* @__PURE__ */ jsxs(Text, { children: ["•", " Write the upload credentials to your .env"] }),
|
|
1828
1821
|
/* @__PURE__ */ jsxs(Text, { children: ["•", " Wire CI for deploys and offer a local test run"] })
|
|
1829
1822
|
]
|
|
1830
1823
|
}),
|
|
@@ -1836,53 +1829,14 @@ const SourceMapsIntroScreen = ({ store }) => {
|
|
|
1836
1829
|
})
|
|
1837
1830
|
})
|
|
1838
1831
|
]
|
|
1839
|
-
}) : view === "privacy" ? /* @__PURE__ */ jsx(PrivacyPanel, {}) : /* @__PURE__ */ jsxs(
|
|
1832
|
+
}) : view === "privacy" ? /* @__PURE__ */ jsx(PrivacyPanel, {}) : /* @__PURE__ */ jsxs(Box, {
|
|
1840
1833
|
flexDirection: "column",
|
|
1841
|
-
|
|
1842
|
-
children: [/* @__PURE__ */ jsx(Text, { children: "
|
|
1843
|
-
flexDirection: "column",
|
|
1834
|
+
width: 60,
|
|
1835
|
+
children: [/* @__PURE__ */ jsx(Text, { children: "The Wizard will run an agent to detect your project's framework(s), download the relevant docs, and implement source-map uploads for you." }), /* @__PURE__ */ jsx(Box, {
|
|
1844
1836
|
marginTop: 1,
|
|
1845
|
-
children: /* @__PURE__ */ jsx(Text, { children: "
|
|
1837
|
+
children: /* @__PURE__ */ jsx(Text, { children: "Ready?" })
|
|
1846
1838
|
})]
|
|
1847
|
-
})
|
|
1848
|
-
flexDirection: "column",
|
|
1849
|
-
marginTop: 1,
|
|
1850
|
-
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1851
|
-
dimColor: true,
|
|
1852
|
-
children: [
|
|
1853
|
-
"Found ",
|
|
1854
|
-
packagePaths.length,
|
|
1855
|
-
" package.json files:"
|
|
1856
|
-
]
|
|
1857
|
-
}), packagePaths.map((p) => /* @__PURE__ */ jsxs(Text, {
|
|
1858
|
-
dimColor: true,
|
|
1859
|
-
children: [
|
|
1860
|
-
" ",
|
|
1861
|
-
"•",
|
|
1862
|
-
" ",
|
|
1863
|
-
p
|
|
1864
|
-
]
|
|
1865
|
-
}, p))]
|
|
1866
|
-
})] });
|
|
1867
|
-
const errorView = detectError ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
1868
|
-
flexDirection: "column",
|
|
1869
|
-
marginBottom: 1,
|
|
1870
|
-
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1871
|
-
color: "red",
|
|
1872
|
-
bold: true,
|
|
1873
|
-
children: ["✘", " Cannot set up source map upload"]
|
|
1874
|
-
}), /* @__PURE__ */ jsx(Box, {
|
|
1875
|
-
marginTop: 1,
|
|
1876
|
-
flexDirection: "column",
|
|
1877
|
-
children: /* @__PURE__ */ jsx(DetectErrorBody$1, { error: detectError })
|
|
1878
|
-
})]
|
|
1879
|
-
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
1880
|
-
options: [{
|
|
1881
|
-
label: "Exit",
|
|
1882
|
-
value: "exit"
|
|
1883
|
-
}],
|
|
1884
|
-
onSelect: () => process.exit(1)
|
|
1885
|
-
})] }) : void 0;
|
|
1839
|
+
});
|
|
1886
1840
|
const menuOptions = view === "more-info" ? [{
|
|
1887
1841
|
label: "Back",
|
|
1888
1842
|
value: "back"
|
|
@@ -1913,8 +1867,6 @@ const SourceMapsIntroScreen = ({ store }) => {
|
|
|
1913
1867
|
showSubtitle: view === "default",
|
|
1914
1868
|
body,
|
|
1915
1869
|
showDetection: view === "default",
|
|
1916
|
-
detectionRows,
|
|
1917
|
-
errorView,
|
|
1918
1870
|
programLabel: session.programLabel,
|
|
1919
1871
|
skillId: session.skillId,
|
|
1920
1872
|
menuOptions,
|
|
@@ -1927,165 +1879,294 @@ const SourceMapsIntroScreen = ({ store }) => {
|
|
|
1927
1879
|
}
|
|
1928
1880
|
});
|
|
1929
1881
|
};
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
const WIZARD_ISSUES_URL = "https://github.com/PostHog/wizard/issues";
|
|
1882
|
+
//#endregion
|
|
1883
|
+
//#region src/lib/programs/error-tracking-upload-source-maps/detect-agentic.ts
|
|
1933
1884
|
/**
|
|
1934
|
-
*
|
|
1935
|
-
*
|
|
1936
|
-
*
|
|
1937
|
-
*
|
|
1938
|
-
*
|
|
1939
|
-
*
|
|
1885
|
+
* Source-maps adapter over the generic agentic detector
|
|
1886
|
+
* (`@lib/detection/agentic`). The detector itself is product-knowledge-free;
|
|
1887
|
+
* this file supplies the source-maps targets (the automatable skill variants),
|
|
1888
|
+
* maps the result back to variants, and classifies each project as
|
|
1889
|
+
* instrumentable or not. The screen renders the result and the run step
|
|
1890
|
+
* instruments the chosen project.
|
|
1940
1891
|
*/
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
"
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1892
|
+
/**
|
|
1893
|
+
* Variant precedence for the agentic picker (most specific first). The detector
|
|
1894
|
+
* keeps the EARLIEST matching target, so this ordering is what makes a React app
|
|
1895
|
+
* built with Vite resolve to `vite` (bundler-plugin upload) instead of the
|
|
1896
|
+
* generic `react` posthog-cli path. Mirrors `pickJsVariant` in detect.ts:
|
|
1897
|
+
* opinionated frameworks → bundlers → bare React → Node → generic web.
|
|
1898
|
+
*/
|
|
1899
|
+
const VARIANT_PRECEDENCE = [
|
|
1900
|
+
"nextjs",
|
|
1901
|
+
"nuxt",
|
|
1902
|
+
"angular",
|
|
1903
|
+
"vite",
|
|
1904
|
+
"webpack",
|
|
1905
|
+
"rollup",
|
|
1906
|
+
"react",
|
|
1907
|
+
"node",
|
|
1908
|
+
"web"
|
|
1909
|
+
];
|
|
1910
|
+
const precedenceRank = (v) => {
|
|
1911
|
+
const i = VARIANT_PRECEDENCE.indexOf(v);
|
|
1912
|
+
return i === -1 ? Number.MAX_SAFE_INTEGER : i;
|
|
1958
1913
|
};
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1914
|
+
/**
|
|
1915
|
+
* Source-maps targets: the variants the wizard can automate, by id → name,
|
|
1916
|
+
* ordered by VARIANT_PRECEDENCE so the detector's "earliest match wins"
|
|
1917
|
+
* tie-break selects the most specific variant. Derived from AUTOMATABLE_VARIANTS
|
|
1918
|
+
* so a newly-automatable variant is never silently dropped (unranked ones sort
|
|
1919
|
+
* last). Exported for testing.
|
|
1920
|
+
*/
|
|
1921
|
+
const SOURCE_MAPS_TARGETS = [...AUTOMATABLE_VARIANTS].sort((a, b) => precedenceRank(a) - precedenceRank(b)).map((v) => ({
|
|
1922
|
+
id: v,
|
|
1923
|
+
name: DISPLAY_NAME[v]
|
|
1924
|
+
}));
|
|
1925
|
+
function classify(variant, hasPostHog) {
|
|
1926
|
+
if (variant == null) return {
|
|
1927
|
+
instrumentable: false,
|
|
1928
|
+
reason: "Source-map upload isn't supported for this stack yet"
|
|
1929
|
+
};
|
|
1930
|
+
if (!hasPostHog) return {
|
|
1931
|
+
instrumentable: false,
|
|
1932
|
+
reason: "No PostHog SDK installed yet — run `npx @posthog/wizard` first"
|
|
1933
|
+
};
|
|
1934
|
+
return { instrumentable: true };
|
|
1935
|
+
}
|
|
1936
|
+
/** Map a generic detection report into source-maps projects. */
|
|
1937
|
+
function toSourceMapsReport(report) {
|
|
1938
|
+
return {
|
|
1939
|
+
repoType: report.repoType,
|
|
1940
|
+
projects: report.projects.map((p) => {
|
|
1941
|
+
const variant = p.targetId ?? null;
|
|
1942
|
+
return {
|
|
1943
|
+
path: p.path,
|
|
1944
|
+
framework: p.framework,
|
|
1945
|
+
variant,
|
|
1946
|
+
hasPostHog: p.hasPostHog,
|
|
1947
|
+
...classify(variant, p.hasPostHog)
|
|
1948
|
+
};
|
|
1949
|
+
})
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
/** Run the Haiku detector over the repo and classify projects for source maps. */
|
|
1953
|
+
async function detectSourceMapsProjects(session, onEvent) {
|
|
1954
|
+
return toSourceMapsReport(await detectProjectsWithAgent(session, {
|
|
1955
|
+
targets: SOURCE_MAPS_TARGETS,
|
|
1956
|
+
purpose: "set up PostHog Error Tracking source-map upload",
|
|
1957
|
+
onEvent
|
|
1958
|
+
}));
|
|
1959
|
+
}
|
|
1960
|
+
//#endregion
|
|
1961
|
+
//#region src/ui/tui/screens/SourceMapsDetectScreen.tsx
|
|
1962
|
+
/**
|
|
1963
|
+
* SourceMapsDetectScreen — runs the Haiku detection agent over the repo, shows
|
|
1964
|
+
* streaming progress, then renders a structured map of which projects can have
|
|
1965
|
+
* source-map upload wired up and which cannot. The user picks one project; the
|
|
1966
|
+
* choice is written to frameworkContext and the run step instruments it.
|
|
1967
|
+
*
|
|
1968
|
+
* Runs after auth — the detection agent needs credentials.
|
|
1969
|
+
*/
|
|
1970
|
+
const EXIT = "__exit";
|
|
1971
|
+
const MAX_ACTIVITY_LINES = 8;
|
|
1972
|
+
function projectLabel(p) {
|
|
1973
|
+
const name = p.variant ? DISPLAY_NAME[p.variant] : p.framework;
|
|
1974
|
+
const where = p.path === "." ? "repo root" : p.path;
|
|
1975
|
+
return `${name} ${Icons.bullet} ${where}`;
|
|
1976
|
+
}
|
|
1977
|
+
const SourceMapsDetectScreen = ({ store }) => {
|
|
1978
|
+
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
1979
|
+
const { credentials } = store.session;
|
|
1980
|
+
const accessToken = credentials?.accessToken;
|
|
1981
|
+
const [state, setState] = useState({ kind: "loading" });
|
|
1982
|
+
const [activity, setActivity] = useState([]);
|
|
1983
|
+
const started = useRef(false);
|
|
1984
|
+
useEffect(() => {
|
|
1985
|
+
if (!accessToken || started.current) return;
|
|
1986
|
+
started.current = true;
|
|
1987
|
+
let cancelled = false;
|
|
1988
|
+
(async () => {
|
|
1989
|
+
try {
|
|
1990
|
+
const report = await detectSourceMapsProjects(store.session, (line) => {
|
|
1991
|
+
if (!cancelled) setActivity((prev) => [...prev, line].slice(-MAX_ACTIVITY_LINES));
|
|
1992
|
+
});
|
|
1993
|
+
if (!cancelled) setState({
|
|
1994
|
+
kind: "ready",
|
|
1995
|
+
report
|
|
1996
|
+
});
|
|
1997
|
+
} catch (err) {
|
|
1998
|
+
if (!cancelled) setState({
|
|
1999
|
+
kind: "error",
|
|
2000
|
+
message: err instanceof Error ? err.message : String(err)
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
})();
|
|
2004
|
+
return () => {
|
|
2005
|
+
cancelled = true;
|
|
2006
|
+
};
|
|
2007
|
+
}, [accessToken, store]);
|
|
2008
|
+
if (!credentials) return /* @__PURE__ */ jsx(LoadingBox, { message: "Waiting for authentication..." });
|
|
2009
|
+
if (state.kind === "loading") return /* @__PURE__ */ jsxs(Box, {
|
|
2010
|
+
flexDirection: "column",
|
|
2011
|
+
children: [
|
|
1978
2012
|
/* @__PURE__ */ jsx(Text, {
|
|
1979
|
-
|
|
1980
|
-
|
|
2013
|
+
bold: true,
|
|
2014
|
+
color: Colors.accent,
|
|
2015
|
+
children: "Detecting your project..."
|
|
1981
2016
|
}),
|
|
1982
|
-
/* @__PURE__ */ jsx(
|
|
1983
|
-
|
|
1984
|
-
children: "
|
|
2017
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2018
|
+
marginY: 1,
|
|
2019
|
+
children: /* @__PURE__ */ jsx(LoadingBox, { message: "Scanning the repo for frameworks and PostHog SDKs..." })
|
|
1985
2020
|
}),
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
marginTop: 1,
|
|
2021
|
+
/* @__PURE__ */ jsx(Box, {
|
|
1988
2022
|
flexDirection: "column",
|
|
1989
|
-
children:
|
|
2023
|
+
children: activity.length === 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
1990
2024
|
dimColor: true,
|
|
1991
|
-
children: "
|
|
1992
|
-
}), /* @__PURE__ */ jsxs(Text, {
|
|
1993
|
-
dimColor:
|
|
1994
|
-
|
|
1995
|
-
|
|
2025
|
+
children: [" ", "Starting up the detection agent…"]
|
|
2026
|
+
}) : activity.map((line, i) => /* @__PURE__ */ jsxs(Text, {
|
|
2027
|
+
dimColor: i < activity.length - 1,
|
|
2028
|
+
color: i === activity.length - 1 ? Colors.primary : void 0,
|
|
2029
|
+
children: [
|
|
2030
|
+
" ",
|
|
2031
|
+
Icons.triangleSmallRight,
|
|
2032
|
+
" ",
|
|
2033
|
+
line
|
|
2034
|
+
]
|
|
2035
|
+
}, `${i}-${line}`))
|
|
1996
2036
|
})
|
|
1997
|
-
]
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2037
|
+
]
|
|
2038
|
+
});
|
|
2039
|
+
if (state.kind === "error") return /* @__PURE__ */ jsxs(Box, {
|
|
2040
|
+
flexDirection: "column",
|
|
2041
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
2042
|
+
flexDirection: "column",
|
|
2043
|
+
marginY: 1,
|
|
2044
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
2045
|
+
color: Colors.error,
|
|
2046
|
+
bold: true,
|
|
2047
|
+
children: [Icons.squareFilled, " Detection failed"]
|
|
2048
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
2049
|
+
dimColor: true,
|
|
2050
|
+
children: state.message
|
|
2051
|
+
})]
|
|
2052
|
+
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
2053
|
+
options: [{
|
|
2054
|
+
label: "Exit",
|
|
2055
|
+
value: EXIT
|
|
2056
|
+
}],
|
|
2057
|
+
onSelect: () => process.exit(1)
|
|
2058
|
+
})]
|
|
2059
|
+
});
|
|
2060
|
+
const { report } = state;
|
|
2061
|
+
const instrumentable = report.projects.filter((p) => p.instrumentable);
|
|
2062
|
+
const blocked = report.projects.filter((p) => !p.instrumentable);
|
|
2063
|
+
if (instrumentable.length === 0) return /* @__PURE__ */ jsxs(Box, {
|
|
2064
|
+
flexDirection: "column",
|
|
2065
|
+
children: [
|
|
2066
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
2006
2067
|
flexDirection: "column",
|
|
2068
|
+
marginBottom: 1,
|
|
2007
2069
|
children: [/* @__PURE__ */ jsxs(Text, {
|
|
2070
|
+
color: Colors.error,
|
|
2071
|
+
bold: true,
|
|
2072
|
+
children: [Icons.squareFilled, " Nothing to instrument yet"]
|
|
2073
|
+
}), /* @__PURE__ */ jsxs(Text, {
|
|
2008
2074
|
dimColor: true,
|
|
2009
2075
|
children: [
|
|
2010
|
-
"
|
|
2011
|
-
|
|
2012
|
-
"
|
|
2076
|
+
"None of the ",
|
|
2077
|
+
report.projects.length,
|
|
2078
|
+
" projects found can have source-map upload set up."
|
|
2013
2079
|
]
|
|
2014
|
-
}), /* @__PURE__ */ jsx(Box, {
|
|
2015
|
-
marginTop: 1,
|
|
2016
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
2017
|
-
dimColor: true,
|
|
2018
|
-
children: native.url
|
|
2019
|
-
})
|
|
2020
2080
|
})]
|
|
2021
|
-
})
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
flexDirection: "column",
|
|
2025
|
-
children: [
|
|
2026
|
-
/* @__PURE__ */ jsx(Text, {
|
|
2027
|
-
dimColor: true,
|
|
2028
|
-
children: "Check which platforms PostHog Error Tracking supports:"
|
|
2029
|
-
}),
|
|
2030
|
-
/* @__PURE__ */ jsx(Box, {
|
|
2031
|
-
marginTop: 1,
|
|
2032
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
2033
|
-
dimColor: true,
|
|
2034
|
-
children: ERROR_TRACKING_INSTALL_DOCS
|
|
2035
|
-
})
|
|
2036
|
-
}),
|
|
2037
|
-
/* @__PURE__ */ jsx(Box, {
|
|
2038
|
-
marginTop: 1,
|
|
2039
|
-
children: /* @__PURE__ */ jsxs(Text, {
|
|
2040
|
-
dimColor: true,
|
|
2041
|
-
children: [
|
|
2042
|
-
"If yours isn't listed and you'd like it added, open an issue at",
|
|
2043
|
-
" ",
|
|
2044
|
-
WIZARD_ISSUES_URL,
|
|
2045
|
-
" with details about your build setup."
|
|
2046
|
-
]
|
|
2047
|
-
})
|
|
2048
|
-
})
|
|
2049
|
-
]
|
|
2050
|
-
})] });
|
|
2051
|
-
}
|
|
2052
|
-
case "no-posthog-sdk": {
|
|
2053
|
-
const platformLabel = DISPLAY_NAME[error.platform] ?? error.platform;
|
|
2054
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
2055
|
-
"Detected ",
|
|
2056
|
-
platformLabel,
|
|
2057
|
-
" but no PostHog SDK is installed."
|
|
2058
|
-
] }), /* @__PURE__ */ jsxs(Box, {
|
|
2081
|
+
}),
|
|
2082
|
+
/* @__PURE__ */ jsx(BlockedSummary, { blocked }),
|
|
2083
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2059
2084
|
marginTop: 1,
|
|
2085
|
+
children: /* @__PURE__ */ jsx(PickerMenu, {
|
|
2086
|
+
options: [{
|
|
2087
|
+
label: "Exit",
|
|
2088
|
+
value: EXIT
|
|
2089
|
+
}],
|
|
2090
|
+
onSelect: () => process.exit(0)
|
|
2091
|
+
})
|
|
2092
|
+
})
|
|
2093
|
+
]
|
|
2094
|
+
});
|
|
2095
|
+
const options = [...instrumentable.map((p) => ({
|
|
2096
|
+
label: projectLabel(p),
|
|
2097
|
+
value: p.path
|
|
2098
|
+
})), {
|
|
2099
|
+
label: "Cancel",
|
|
2100
|
+
value: EXIT
|
|
2101
|
+
}];
|
|
2102
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
2103
|
+
flexDirection: "column",
|
|
2104
|
+
children: [
|
|
2105
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2060
2106
|
flexDirection: "column",
|
|
2061
|
-
|
|
2062
|
-
|
|
2107
|
+
marginBottom: 1,
|
|
2108
|
+
children: /* @__PURE__ */ jsxs(Text, {
|
|
2109
|
+
bold: true,
|
|
2110
|
+
color: Colors.accent,
|
|
2063
2111
|
children: [
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
}),
|
|
2069
|
-
" first to install the SDK, then run this command again."
|
|
2112
|
+
Icons.check,
|
|
2113
|
+
" Found",
|
|
2114
|
+
" ",
|
|
2115
|
+
report.repoType === "monorepo" ? "a monorepo" : "your project"
|
|
2070
2116
|
]
|
|
2071
|
-
})
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
}
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2117
|
+
})
|
|
2118
|
+
}),
|
|
2119
|
+
/* @__PURE__ */ jsx(PickerMenu, {
|
|
2120
|
+
message: "Which project would you like to set up source map uploads for?",
|
|
2121
|
+
options,
|
|
2122
|
+
onSelect: (value) => {
|
|
2123
|
+
const path = Array.isArray(value) ? value[0] : value;
|
|
2124
|
+
if (path === EXIT) {
|
|
2125
|
+
process.exit(0);
|
|
2126
|
+
return;
|
|
2127
|
+
}
|
|
2128
|
+
const chosen = instrumentable.find((p) => p.path === path);
|
|
2129
|
+
if (!chosen || !chosen.variant) return;
|
|
2130
|
+
store.setFrameworkContext(SOURCE_MAPS_CONTEXT_KEYS.selectedVariant, chosen.variant);
|
|
2131
|
+
store.setFrameworkContext(SOURCE_MAPS_CONTEXT_KEYS.selectedDisplayName, DISPLAY_NAME[chosen.variant]);
|
|
2132
|
+
store.setFrameworkContext(SOURCE_MAPS_CONTEXT_KEYS.selectedPath, chosen.path);
|
|
2133
|
+
}
|
|
2134
|
+
}),
|
|
2135
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2136
|
+
marginTop: 1,
|
|
2137
|
+
children: /* @__PURE__ */ jsx(BlockedSummary, { blocked })
|
|
2138
|
+
})
|
|
2139
|
+
]
|
|
2140
|
+
});
|
|
2141
|
+
};
|
|
2142
|
+
/**
|
|
2143
|
+
* Collapses the non-instrumentable projects into a short count line (or two)
|
|
2144
|
+
* instead of listing every one — a monorepo can have dozens.
|
|
2145
|
+
*/
|
|
2146
|
+
const BlockedSummary = ({ blocked }) => {
|
|
2147
|
+
const unsupported = blocked.filter((p) => p.variant == null).length;
|
|
2148
|
+
const missingSdk = blocked.length - unsupported;
|
|
2149
|
+
if (blocked.length === 0) return null;
|
|
2150
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
2151
|
+
flexDirection: "column",
|
|
2152
|
+
children: [unsupported > 0 && /* @__PURE__ */ jsxs(Text, {
|
|
2153
|
+
dimColor: true,
|
|
2154
|
+
children: [
|
|
2155
|
+
"(… ",
|
|
2156
|
+
unsupported,
|
|
2157
|
+
" other project",
|
|
2158
|
+
unsupported === 1 ? "" : "s",
|
|
2159
|
+
" not supported)"
|
|
2160
|
+
]
|
|
2161
|
+
}), missingSdk > 0 && /* @__PURE__ */ jsxs(Text, {
|
|
2162
|
+
dimColor: true,
|
|
2163
|
+
children: [
|
|
2164
|
+
"(… ",
|
|
2165
|
+
missingSdk,
|
|
2166
|
+
" supported but missing the PostHog SDK — install it first with `npx @posthog/wizard`)"
|
|
2167
|
+
]
|
|
2168
|
+
})]
|
|
2169
|
+
});
|
|
2089
2170
|
};
|
|
2090
2171
|
//#endregion
|
|
2091
2172
|
//#region src/ui/tui/screens/SourceMapsOutroScreen.tsx
|
|
@@ -4393,7 +4474,7 @@ function createMcpSuggestedPromptsServices(_store) {
|
|
|
4393
4474
|
};
|
|
4394
4475
|
}
|
|
4395
4476
|
async function* runProductionPromptStreaming(args) {
|
|
4396
|
-
const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-
|
|
4477
|
+
const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-BRoVSf3N.js");
|
|
4397
4478
|
yield* runMcpPromptViaSdk(args);
|
|
4398
4479
|
}
|
|
4399
4480
|
//#endregion
|
|
@@ -4417,6 +4498,7 @@ function createScreens(store, services) {
|
|
|
4417
4498
|
["revenue-intro"]: /* @__PURE__ */ jsx(RevenueIntroScreen, { store }),
|
|
4418
4499
|
["warehouse-intro"]: /* @__PURE__ */ jsx(WarehouseIntroScreen, { store }),
|
|
4419
4500
|
["source-maps-intro"]: /* @__PURE__ */ jsx(SourceMapsIntroScreen, { store }),
|
|
4501
|
+
["source-maps-detect"]: /* @__PURE__ */ jsx(SourceMapsDetectScreen, { store }),
|
|
4420
4502
|
["source-maps-outro"]: /* @__PURE__ */ jsx(SourceMapsOutroScreen, { store }),
|
|
4421
4503
|
["migration-intro"]: /* @__PURE__ */ jsx(MigrationIntroScreen, { store }),
|
|
4422
4504
|
["agent-skill-intro"]: /* @__PURE__ */ jsx(AgentSkillIntroScreen, { store }),
|
|
@@ -4500,6 +4582,7 @@ function startTUI(version, program = Program.PostHogIntegration) {
|
|
|
4500
4582
|
store.version = version;
|
|
4501
4583
|
setUI(new InkUI(store));
|
|
4502
4584
|
const { unmount: inkUnmount, waitUntilExit } = render(createElement(App, { store }));
|
|
4585
|
+
analytics.setTag("program_id", program);
|
|
4503
4586
|
analytics.wizardCapture("started", { program_id: program });
|
|
4504
4587
|
store.runInitHooks();
|
|
4505
4588
|
process.stdin.on("error", (err) => {
|
|
@@ -4528,4 +4611,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
|
|
|
4528
4611
|
//#endregion
|
|
4529
4612
|
export { startTUI };
|
|
4530
4613
|
|
|
4531
|
-
//# sourceMappingURL=start-tui-
|
|
4614
|
+
//# sourceMappingURL=start-tui-Deaj99It.js.map
|