@posthog/wizard 2.54.0 → 2.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/{add-mcp-server-to-clients-B3TcwTT5.js → add-mcp-server-to-clients-CVA6Wbmu.js} +4 -4
  2. package/dist/{add-mcp-server-to-clients-B3TcwTT5.js.map → add-mcp-server-to-clients-CVA6Wbmu.js.map} +1 -1
  3. package/dist/{agent-interface-CLvG6Rk9.js → agent-interface-CaSQlcUF.js} +6 -6
  4. package/dist/{agent-interface-CLvG6Rk9.js.map → agent-interface-CaSQlcUF.js.map} +1 -1
  5. package/dist/{agent-prompt-loader-Baqm1JMD.js → agent-prompt-loader-BON_ZfNn.js} +5 -5
  6. package/dist/{agent-prompt-loader-Baqm1JMD.js.map → agent-prompt-loader-BON_ZfNn.js.map} +1 -1
  7. package/dist/{agent-runner-D6zGTJqn.js → agent-runner-DmqRgcNz.js} +13 -13
  8. package/dist/{agent-runner-D6zGTJqn.js.map → agent-runner-DmqRgcNz.js.map} +1 -1
  9. package/dist/{analytics-D7hsukY7.js → analytics-Bcj98zOG.js} +2 -2
  10. package/dist/{analytics-D7hsukY7.js.map → analytics-Bcj98zOG.js.map} +1 -1
  11. package/dist/analytics-CUMQqMBD.js +2 -0
  12. package/dist/{api-BSq9hLu5.js → api-BT317Fnl.js} +3 -3
  13. package/dist/{api-BSq9hLu5.js.map → api-BT317Fnl.js.map} +1 -1
  14. package/dist/bin.js +218 -77
  15. package/dist/bin.js.map +1 -1
  16. package/dist/{bounded-fs-Cq960M-V.js → bounded-fs-DZEUmLFS.js} +4 -4
  17. package/dist/{bounded-fs-Cq960M-V.js.map → bounded-fs-DZEUmLFS.js.map} +1 -1
  18. package/dist/{ci-install-w-mywB9x.js → ci-install-Jcf6VvMs.js} +4 -4
  19. package/dist/{ci-install-w-mywB9x.js.map → ci-install-Jcf6VvMs.js.map} +1 -1
  20. package/dist/{debug-CbgLkSCY.js → debug-B6VsAfeE.js} +3 -3
  21. package/dist/{debug-CbgLkSCY.js.map → debug-B6VsAfeE.js.map} +1 -1
  22. package/dist/{debug-CX6ZqL9r.js → debug-B_d72khs.js} +1 -1
  23. package/dist/{environment-BWuaOExh.js → environment-Dn-Vd-J3.js} +4 -4
  24. package/dist/{environment-BWuaOExh.js.map → environment-Dn-Vd-J3.js.map} +1 -1
  25. package/dist/{file-watcher-D9tgVBkp.js → file-watcher-ucN_7-SB.js} +2 -2
  26. package/dist/{file-watcher-D9tgVBkp.js.map → file-watcher-ucN_7-SB.js.map} +1 -1
  27. package/dist/{headless-ui-rH97E35y.js → headless-ui-DhtLuoOS.js} +2 -2
  28. package/dist/{headless-ui-rH97E35y.js.map → headless-ui-DhtLuoOS.js.map} +1 -1
  29. package/dist/{interactive-D-MVMdBl.js → interactive-BU4h53in.js} +2 -2
  30. package/dist/{interactive-D-MVMdBl.js.map → interactive-BU4h53in.js.map} +1 -1
  31. package/dist/{mcp-jKHwa45f.js → mcp-BT6xPsZJ.js} +2 -2
  32. package/dist/{mcp-jKHwa45f.js.map → mcp-BT6xPsZJ.js.map} +1 -1
  33. package/dist/{mcp-prompt-streaming-DxDftNHb.js → mcp-prompt-streaming-Ba9zJ2JZ.js} +3 -3
  34. package/dist/{mcp-prompt-streaming-DxDftNHb.js.map → mcp-prompt-streaming-Ba9zJ2JZ.js.map} +1 -1
  35. package/dist/{non-interactive-eXT2_WCR.js → non-interactive-DWiL-3rV.js} +2 -2
  36. package/dist/{non-interactive-eXT2_WCR.js.map → non-interactive-DWiL-3rV.js.map} +1 -1
  37. package/dist/{orchestrator-tools-CsXrPhsd.js → orchestrator-tools-DAoHvBKb.js} +3 -3
  38. package/dist/{orchestrator-tools-CsXrPhsd.js.map → orchestrator-tools-DAoHvBKb.js.map} +1 -1
  39. package/dist/{package-manager-CASp14jY.js → package-manager-CQjuD9E0.js} +2 -2
  40. package/dist/{package-manager-CASp14jY.js.map → package-manager-CQjuD9E0.js.map} +1 -1
  41. package/dist/{pi-CfdqOKDI.js → pi-DdVeXjmn.js} +11 -11
  42. package/dist/{pi-CfdqOKDI.js.map → pi-DdVeXjmn.js.map} +1 -1
  43. package/dist/{playground-DuBvnGkP.js → playground-CkMYkXiw.js} +113 -8
  44. package/dist/{playground-DuBvnGkP.js.map → playground-CkMYkXiw.js.map} +1 -1
  45. package/dist/{posthog-integration-Dy5cNPaa.js → posthog-integration-Cdwv-ohr.js} +16 -15
  46. package/dist/{posthog-integration-Dy5cNPaa.js.map → posthog-integration-Cdwv-ohr.js.map} +1 -1
  47. package/dist/{provisioning-CS6fQriR.js → provisioning-sDvZgL0E.js} +122 -25
  48. package/dist/provisioning-sDvZgL0E.js.map +1 -0
  49. package/dist/{queue-tools-ai7gCWyU.js → queue-tools-DfDkhfpu.js} +3 -3
  50. package/dist/{queue-tools-ai7gCWyU.js.map → queue-tools-DfDkhfpu.js.map} +1 -1
  51. package/dist/{registry-D0hx_-KP.js → registry-Bs7-Q1J9.js} +5 -5
  52. package/dist/{registry-D0hx_-KP.js.map → registry-Bs7-Q1J9.js.map} +1 -1
  53. package/dist/{security-BNqgFjYh.js → security-DPVT9zKY.js} +4 -4
  54. package/dist/{security-BNqgFjYh.js.map → security-DPVT9zKY.js.map} +1 -1
  55. package/dist/{setup-utils-6qyTDNyd.js → setup-utils-Bh_HUFPV.js} +19 -9
  56. package/dist/{setup-utils-6qyTDNyd.js.map → setup-utils-Bh_HUFPV.js.map} +1 -1
  57. package/dist/{start-tui-DNkm-n-4.js → start-tui-DEgpLYEQ.js} +184 -64
  58. package/dist/start-tui-DEgpLYEQ.js.map +1 -0
  59. package/dist/{steps-CqHAVc8R.js → steps-BjLuR8HU.js} +7 -7
  60. package/dist/{steps-CqHAVc8R.js.map → steps-BjLuR8HU.js.map} +1 -1
  61. package/dist/{store-sIaF89XA.js → store-DGt4jqrg.js} +10 -7
  62. package/dist/{store-sIaF89XA.js.map → store-DGt4jqrg.js.map} +1 -1
  63. package/dist/{subagent-CKNbRtfQ.js → subagent-CaXNaC3O.js} +2 -2
  64. package/dist/{subagent-CKNbRtfQ.js.map → subagent-CaXNaC3O.js.map} +1 -1
  65. package/dist/{task-DwzRxORh.js → task-jhwY_uF-.js} +12 -12
  66. package/dist/{task-DwzRxORh.js.map → task-jhwY_uF-.js.map} +1 -1
  67. package/dist/{task-stream-BdJV-usk.js → task-stream-aKusWX0h.js} +3 -3
  68. package/dist/{task-stream-BdJV-usk.js.map → task-stream-aKusWX0h.js.map} +1 -1
  69. package/dist/{tasks-yqJVuTvc.js → tasks-BWdKP9g7.js} +2 -2
  70. package/dist/{tasks-yqJVuTvc.js.map → tasks-BWdKP9g7.js.map} +1 -1
  71. package/dist/{telemetry-UBL5MQtw.js → telemetry-JfMjqBNP.js} +3 -3
  72. package/dist/{telemetry-UBL5MQtw.js.map → telemetry-JfMjqBNP.js.map} +1 -1
  73. package/dist/{terminal-vo5Zl7j1.js → terminal-B6ojVY0g.js} +12 -12
  74. package/dist/{terminal-vo5Zl7j1.js.map → terminal-B6ojVY0g.js.map} +1 -1
  75. package/dist/{tools-Br8lP29r.js → tools-DTBsb5U5.js} +6 -6
  76. package/dist/{tools-Br8lP29r.js.map → tools-DTBsb5U5.js.map} +1 -1
  77. package/dist/{wizard-abort-FIC6lKCs.js → wizard-abort-CDIfvSu2.js} +3 -3
  78. package/dist/{wizard-abort-FIC6lKCs.js.map → wizard-abort-CDIfvSu2.js.map} +1 -1
  79. package/dist/{wizard-abort-BRsd7-aB.js → wizard-abort-CeTBd8IM.js} +1 -1
  80. package/dist/yara-hooks-DAnlPC5v.js +2 -0
  81. package/dist/{yara-hooks-DxpCD72V.js → yara-hooks-DyEPTBZF.js} +4 -4
  82. package/dist/{yara-hooks-DxpCD72V.js.map → yara-hooks-DyEPTBZF.js.map} +1 -1
  83. package/package.json +1 -1
  84. package/dist/analytics-BBJE4hIu.js +0 -2
  85. package/dist/provisioning-CS6fQriR.js.map +0 -1
  86. package/dist/start-tui-DNkm-n-4.js.map +0 -1
  87. package/dist/yara-hooks--QA2Cwjv.js +0 -2
@@ -1,21 +1,22 @@
1
- import { $ as REMOTE_SKILLS_BASE_URL, K as POSTHOG_ORG_AI_SETTINGS_URL, L as Integration, R as OAUTH_PORTS, U as POSTHOG_DOCS_URL, Z as POSTHOG_TERMS_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, p as setUI, q as POSTHOG_PRIVACY_URL, s as logToFile, v as getBlockingServiceKeys, z as OAUTH_TIMEOUT_MS } from "./debug-CbgLkSCY.js";
2
- import { n as analytics } from "./analytics-D7hsukY7.js";
3
- import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-6qyTDNyd.js";
4
- import { t as ApiError } from "./api-BSq9hLu5.js";
1
+ import { $ as REMOTE_SKILLS_BASE_URL, K as POSTHOG_ORG_AI_SETTINGS_URL, L as Integration, R as OAUTH_PORTS, U as POSTHOG_DOCS_URL, Z as POSTHOG_TERMS_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, p as setUI, q as POSTHOG_PRIVACY_URL, s as logToFile, v as getBlockingServiceKeys, z as OAUTH_TIMEOUT_MS } from "./debug-B6VsAfeE.js";
2
+ import { n as analytics } from "./analytics-Bcj98zOG.js";
3
+ import { i as readProjectFile, t as IGNORED_DIRS } from "./bounded-fs-DZEUmLFS.js";
4
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-Bh_HUFPV.js";
5
+ import { t as ApiError } from "./api-BT317Fnl.js";
5
6
  import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-CwgR5y3-.js";
6
- import { i as wizardAbort } from "./wizard-abort-FIC6lKCs.js";
7
- import { a as formatTokenCount, i as formatCostUsd } from "./agent-runner-D6zGTJqn.js";
8
- import { x as fetchSkillMenu, y as downloadSkill } from "./agent-interface-CLvG6Rk9.js";
9
- import { _ as AUDIT_CHECKS_KEY, b as coerceAuditChecks, g as AUDIT_CHECKS_FILE, x as getAuditChecks, y as AUDIT_SEVERITY_STYLE } from "./yara-hooks-DxpCD72V.js";
10
- import { t as FRAMEWORK_REGISTRY } from "./registry-D0hx_-KP.js";
11
- import { h as Icons, m as Colors, t as SETUP_REPORT_FILE, x as detectProjectsWithAgent, y as getDetectedWarehouseSources } from "./posthog-integration-Dy5cNPaa.js";
12
- import { C as STRIPE_SDKS, S as POSTHOG_SDKS, _ as DISPLAY_NAME, a as useStdoutDimensions, b as fetchHealthIssues, f as Program, g as AUTOMATABLE_VARIANTS, h as SELF_DRIVING_INTEGRATE_PATH_KEY, m as detectSelfDrivingIntegrationProjects, n as useKeyBindings, p as getProgramConfig, t as PickerMenu, v as SOURCE_MAPS_CONTEXT_KEYS, x as getContentBlocks } from "./bin.js";
13
- import { r as totalTokenCount, t as WizardStore } from "./store-sIaF89XA.js";
14
- import { A as LogViewer, C as TipsCard, D as TabContainer, E as HNViewer, I as ProgressList, L as LoadingBox, M as extractUrls, N as ModalOverlay, O as ScreenContainer, P as ConfirmationInput, R as SplitView, S as ServiceHealthList, a as useSkillEntry, b as SEVERITY_LABEL, c as SlackConnectScreen, d as AuditChecksViewer, f as seedDemoEvents, g as probeProjectData, i as SkillSourceInfo, j as LinkText, k as EventPlanViewer, l as AUDIT_AREA_SLIDES, m as McpSuggestedPromptsScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as McpScreen, w as LearnCard, x as SEVERITY_ORDER, y as IssueTable } from "./terminal-vo5Zl7j1.js";
7
+ import { i as wizardAbort } from "./wizard-abort-CDIfvSu2.js";
8
+ import { a as formatTokenCount, i as formatCostUsd } from "./agent-runner-DmqRgcNz.js";
9
+ import { x as fetchSkillMenu, y as downloadSkill } from "./agent-interface-CaSQlcUF.js";
10
+ import { _ as AUDIT_CHECKS_KEY, b as coerceAuditChecks, g as AUDIT_CHECKS_FILE, x as getAuditChecks, y as AUDIT_SEVERITY_STYLE } from "./yara-hooks-DyEPTBZF.js";
11
+ import { t as FRAMEWORK_REGISTRY } from "./registry-Bs7-Q1J9.js";
12
+ import { S as detectProjectsWithAgent, h as Icons, m as Colors, t as SETUP_REPORT_FILE, y as getDetectedWarehouseSources } from "./posthog-integration-Cdwv-ohr.js";
13
+ import { D as STRIPE_SDKS, E as POSTHOG_SDKS, S as SOURCE_MAPS_CONTEXT_KEYS, T as getContentBlocks, _ as DISPLAY_NAME, a as useStdoutDimensions, b as MANUAL_SDK_VARIANTS, f as Program, g as AUTOMATABLE_VARIANTS, h as SELF_DRIVING_INTEGRATE_PATH_KEY, m as detectSelfDrivingIntegrationProjects, n as useKeyBindings, p as getProgramConfig, t as PickerMenu, w as fetchHealthIssues, y as MANUAL_SDK_INSTALL } from "./bin.js";
14
+ import { r as totalTokenCount, t as WizardStore } from "./store-DGt4jqrg.js";
15
+ import { A as LogViewer, C as TipsCard, D as TabContainer, E as HNViewer, I as ProgressList, L as LoadingBox, M as extractUrls, N as ModalOverlay, O as ScreenContainer, P as ConfirmationInput, R as SplitView, S as ServiceHealthList, a as useSkillEntry, b as SEVERITY_LABEL, c as SlackConnectScreen, d as AuditChecksViewer, f as seedDemoEvents, g as probeProjectData, i as SkillSourceInfo, j as LinkText, k as EventPlanViewer, l as AUDIT_AREA_SLIDES, m as McpSuggestedPromptsScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as McpScreen, w as LearnCard, x as SEVERITY_ORDER, y as IssueTable } from "./terminal-B6ojVY0g.js";
15
16
  import { t as ALL_FEATURE_VALUES } from "./defaults-BWLIffh5.js";
16
- import { t as startFileWatcher } from "./file-watcher-D9tgVBkp.js";
17
- 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-B3TcwTT5.js";
18
- import { existsSync } from "fs";
17
+ import { t as startFileWatcher } from "./file-watcher-ucN_7-SB.js";
18
+ 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-CVA6Wbmu.js";
19
+ import { existsSync, readFileSync, readdirSync } from "fs";
19
20
  import path, { join } from "path";
20
21
  import { join as join$1 } from "node:path";
21
22
  import { spawn } from "node:child_process";
@@ -1072,7 +1073,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1072
1073
  })),
1073
1074
  onSelect: (value) => {
1074
1075
  const integration = Array.isArray(value) ? value[0] : value;
1075
- import("./registry-D0hx_-KP.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1076
+ import("./registry-Bs7-Q1J9.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1076
1077
  const config = FRAMEWORK_REGISTRY[integration];
1077
1078
  store.setFrameworkConfig(integration, config);
1078
1079
  store.setDetectedFramework(config.metadata.name);
@@ -1864,15 +1865,14 @@ const SourceMapsIntroScreen = ({ store }) => {
1864
1865
  */
1865
1866
  /**
1866
1867
  * Variant precedence for the agentic picker (most specific first). The detector
1867
- * keeps the EARLIEST matching target. Unsupported native targets are included
1868
- * as guards before Android and iOS so React Native projects with nested Gradle
1869
- * or Xcode manifests are not misclassified as instrumentable native apps. JS
1870
- * ordering mirrors `pickJsVariant` in detect.ts: opinionated frameworks →
1871
- * bundlers → bare React → Node → generic web.
1868
+ * keeps the EARLIEST matching target. React Native and Flutter both outrank
1869
+ * Android and iOS: their repos carry `android/` and `ios/` folders with real
1870
+ * Gradle and Xcode manifests inside them, and must not be misclassified as
1871
+ * plain native apps. JS ordering mirrors `pickJsVariant` in detect.ts:
1872
+ * opinionated frameworks → bundlers → bare React → Node → generic web.
1872
1873
  */
1873
- const NON_AUTOMATABLE_NATIVE_VARIANTS = ["react-native"];
1874
1874
  const VARIANT_PRECEDENCE = [
1875
- ...NON_AUTOMATABLE_NATIVE_VARIANTS,
1875
+ "react-native",
1876
1876
  "flutter",
1877
1877
  "android",
1878
1878
  "ios",
@@ -1884,62 +1884,165 @@ const VARIANT_PRECEDENCE = [
1884
1884
  "rollup",
1885
1885
  "react",
1886
1886
  "node",
1887
+ "go",
1888
+ "rust",
1887
1889
  "web"
1888
1890
  ];
1889
1891
  const precedenceRank = (v) => {
1890
1892
  const i = VARIANT_PRECEDENCE.indexOf(v);
1891
1893
  return i === -1 ? Number.MAX_SAFE_INTEGER : i;
1892
1894
  };
1893
- /**
1894
- * Source-map detection targets, ordered by VARIANT_PRECEDENCE. Unsupported
1895
- * native variants remain in the target list so the detector can identify and
1896
- * block them instead of falling through to iOS or a JS target.
1897
- */
1898
- const SOURCE_MAPS_TARGETS = [...NON_AUTOMATABLE_NATIVE_VARIANTS, ...AUTOMATABLE_VARIANTS].sort((a, b) => precedenceRank(a) - precedenceRank(b)).map((v) => ({
1895
+ /** Source-map detection targets, ordered by VARIANT_PRECEDENCE. */
1896
+ const SOURCE_MAPS_TARGETS = [...AUTOMATABLE_VARIANTS].sort((a, b) => precedenceRank(a) - precedenceRank(b)).map((v) => ({
1899
1897
  id: v,
1900
1898
  name: DISPLAY_NAME[v]
1901
1899
  }));
1900
+ /** Comment-stripped substring check for the Rust SDK in one manifest. */
1901
+ function manifestMentionsSdk(manifestPath) {
1902
+ const content = readProjectFile(manifestPath);
1903
+ return content != null && content.split("\n").some((line) => {
1904
+ return line.split("#", 1)[0].includes("posthog-rs");
1905
+ });
1906
+ }
1907
+ /**
1908
+ * A workspace root is often a virtual manifest (`[workspace]` only, no
1909
+ * `[dependencies]`) — the SDK then lives in a member crate's manifest, so a
1910
+ * miss on the root must fall through to a bounded walk over nested
1911
+ * manifests. Depth 3 covers the common `crates/<name>/` layouts.
1912
+ */
1913
+ function anyNestedManifestMentionsSdk(dir, depth) {
1914
+ if (depth > 3) return false;
1915
+ let entries;
1916
+ try {
1917
+ entries = readdirSync(dir, { withFileTypes: true });
1918
+ } catch {
1919
+ return false;
1920
+ }
1921
+ for (const entry of entries) {
1922
+ if (!entry.isDirectory()) continue;
1923
+ if (entry.name.startsWith(".")) continue;
1924
+ if (IGNORED_DIRS.has(entry.name) || entry.name === "target") continue;
1925
+ const child = join(dir, entry.name);
1926
+ if (manifestMentionsSdk(join(child, "Cargo.toml"))) return true;
1927
+ if (anyNestedManifestMentionsSdk(child, depth + 1)) return true;
1928
+ }
1929
+ return false;
1930
+ }
1931
+ /**
1932
+ * Checks a project's Cargo manifests for the Rust SDK. The agentic detector
1933
+ * reports a single `hasPostHog` boolean for ANY PostHog dependency in the
1934
+ * project — for `rust` that could be satisfied by an unrelated JS SDK in the
1935
+ * same directory, so the deterministic manifest read is authoritative.
1936
+ * Comment-stripped substring matching, not TOML parsing: it still catches
1937
+ * renamed (`package = "posthog-rs"`) and workspace-inherited deps, while a
1938
+ * commented-out dependency no longer counts. Known miss: selecting a
1939
+ * workspace MEMBER whose dep is aliased at the workspace root
1940
+ * (`posthog.workspace = true` with the `package = "posthog-rs"` mapping only
1941
+ * in the root manifest, which sits above the member) — accepted; resolving
1942
+ * that needs full workspace metadata. Exported for testing.
1943
+ */
1944
+ function rustSdkVerifier(installDir) {
1945
+ return (projectPath) => {
1946
+ const dir = projectPath === "." ? installDir : join(installDir, projectPath);
1947
+ return manifestMentionsSdk(join(dir, "Cargo.toml")) || anyNestedManifestMentionsSdk(dir, 0);
1948
+ };
1949
+ }
1950
+ /**
1951
+ * True when go.mod actively `require`s the SDK — single-line requires and
1952
+ * `require ( … )` blocks only, so a `module` declaration, `replace`, or
1953
+ * `exclude` mention of the path never counts.
1954
+ */
1955
+ function goModRequiresSdk(content) {
1956
+ let inBlock = null;
1957
+ for (const raw of content.split("\n")) {
1958
+ const code = raw.split("//", 1)[0].trim();
1959
+ if (code === "") continue;
1960
+ if (inBlock != null) {
1961
+ if (code === ")") inBlock = null;
1962
+ else if (inBlock === "require" && code.includes("github.com/posthog/posthog-go")) return true;
1963
+ continue;
1964
+ }
1965
+ if (code.endsWith("(")) {
1966
+ inBlock = code.startsWith("require") ? "require" : "other";
1967
+ continue;
1968
+ }
1969
+ if (code.startsWith("require ") && code.includes("github.com/posthog/posthog-go")) return true;
1970
+ }
1971
+ return false;
1972
+ }
1973
+ /**
1974
+ * Checks a project's go.mod for the Go SDK — the same authoritative override
1975
+ * as `rustSdkVerifier`, for the same reason. Only `require` directives count;
1976
+ * no multi-module walk — unlike Cargo workspaces, a Go module's requirements
1977
+ * always live in the selected module's own go.mod. Exported for testing.
1978
+ */
1979
+ function goSdkVerifier(installDir) {
1980
+ return (projectPath) => {
1981
+ const content = readProjectFile(join(projectPath === "." ? installDir : join(installDir, projectPath), "go.mod"));
1982
+ return content != null && goModRequiresSdk(content);
1983
+ };
1984
+ }
1902
1985
  function isAutomatableVariant(value) {
1903
1986
  return value !== null && AUTOMATABLE_VARIANTS.includes(value);
1904
1987
  }
1905
1988
  const FLUTTER_NO_BUILD_TARGET_REASON = "Flutter project has no web, android or ios target — nothing to upload symbols for";
1989
+ const BARE_REACT_NATIVE_REASON = "Bare React Native (without Expo) is not supported — source-map upload needs the Expo build pipeline";
1906
1990
  /**
1907
1991
  * True when the Flutter project at `projectPath` has at least one platform
1908
- * target the wizard can wire uploads into: web (dart2js source maps), android
1909
- * (R8 mapping files) or ios (dSYMs). `flutter create` scaffolds a directory per
1910
- * enabled platform, so their absence means this is a pure Dart package or
1911
- * plugin — it produces no app build, and there is nothing to upload.
1992
+ * target. `flutter create` scaffolds a directory per enabled platform, so their
1993
+ * absence means this is a pure Dart package or plugin — it produces no app
1994
+ * build, and there is nothing to upload.
1912
1995
  */
1913
1996
  function projectHasBuildTarget(installDir, projectPath) {
1914
1997
  const root = join(installDir, projectPath);
1915
1998
  return existsSync(join(root, "web", "index.html")) || existsSync(join(root, "android")) || existsSync(join(root, "ios"));
1916
1999
  }
2000
+ /** True when the project at `projectPath` has the `expo` package installed. */
2001
+ function projectHasExpo(installDir, projectPath) {
2002
+ try {
2003
+ const pkg = JSON.parse(readFileSync(join(installDir, projectPath, "package.json"), "utf-8"));
2004
+ return pkg.dependencies?.["expo"] != null || pkg.devDependencies?.["expo"] != null;
2005
+ } catch {
2006
+ return false;
2007
+ }
2008
+ }
1917
2009
  /** Classify one agent-detected project for source-map upload. */
1918
- function classifyProject(p, hasBuildTarget) {
2010
+ function classifyProject(p, probes) {
2011
+ const sdkVerifier = p.targetId === "rust" ? probes.verifyRustSdk : p.targetId === "go" ? probes.verifyGoSdk : void 0;
2012
+ const hasPostHog = sdkVerifier ? sdkVerifier(p.path) : p.hasPostHog;
1919
2013
  const base = {
1920
2014
  path: p.path,
1921
2015
  framework: p.framework,
1922
- hasPostHog: p.hasPostHog
2016
+ hasPostHog
1923
2017
  };
1924
- const namesForeignNativePlatform = /\b(?:react[\s-]*native|expo)\b/i.test(p.framework) || /\bflutter\b/i.test(p.framework) && p.targetId !== "flutter";
2018
+ const namesForeignNativePlatform = /\b(?:react[\s-]*native|expo)\b/i.test(p.framework) && p.targetId !== "react-native" || /\bflutter\b/i.test(p.framework) && p.targetId !== "flutter";
1925
2019
  if (!isAutomatableVariant(p.targetId) || namesForeignNativePlatform) return {
1926
2020
  ...base,
1927
2021
  variant: null,
1928
2022
  instrumentable: false,
1929
2023
  reason: "Source-map upload isn't supported for this stack yet"
1930
2024
  };
1931
- if (p.targetId === "flutter" && !hasBuildTarget(p.path)) return {
2025
+ if (p.targetId === "flutter" && !probes.hasBuildTarget(p.path)) return {
1932
2026
  ...base,
1933
2027
  variant: null,
1934
2028
  instrumentable: false,
1935
2029
  reason: FLUTTER_NO_BUILD_TARGET_REASON
1936
2030
  };
1937
- if (!p.hasPostHog) return {
2031
+ if (p.targetId === "react-native" && !probes.isExpoProject(p.path)) return {
1938
2032
  ...base,
1939
- variant: p.targetId,
2033
+ variant: null,
1940
2034
  instrumentable: false,
1941
- reason: "No PostHog SDK installed yet — run `npx @posthog/wizard` first"
2035
+ reason: BARE_REACT_NATIVE_REASON
1942
2036
  };
2037
+ if (!hasPostHog) {
2038
+ const install = MANUAL_SDK_INSTALL[p.targetId] ?? "run `npx @posthog/wizard` first";
2039
+ return {
2040
+ ...base,
2041
+ variant: p.targetId,
2042
+ instrumentable: false,
2043
+ reason: `No PostHog SDK installed yet — ${install}`
2044
+ };
2045
+ }
1943
2046
  return {
1944
2047
  ...base,
1945
2048
  variant: p.targetId,
@@ -1947,10 +2050,10 @@ function classifyProject(p, hasBuildTarget) {
1947
2050
  };
1948
2051
  }
1949
2052
  /** Map a generic detection report into source-maps projects. */
1950
- function toSourceMapsReport(report, hasBuildTarget) {
2053
+ function toSourceMapsReport(report, probes) {
1951
2054
  return {
1952
2055
  repoType: report.repoType,
1953
- projects: report.projects.map((p) => classifyProject(p, hasBuildTarget))
2056
+ projects: report.projects.map((p) => classifyProject(p, probes))
1954
2057
  };
1955
2058
  }
1956
2059
  /** Run the Haiku detector over the repo and classify projects for source maps. */
@@ -1959,7 +2062,12 @@ async function detectSourceMapsProjects(session, onEvent) {
1959
2062
  targets: SOURCE_MAPS_TARGETS,
1960
2063
  purpose: "set up PostHog Error Tracking source-map upload",
1961
2064
  onEvent
1962
- }), (path) => projectHasBuildTarget(session.installDir, path));
2065
+ }), {
2066
+ hasBuildTarget: (path) => projectHasBuildTarget(session.installDir, path),
2067
+ isExpoProject: (path) => projectHasExpo(session.installDir, path),
2068
+ verifyRustSdk: rustSdkVerifier(session.installDir),
2069
+ verifyGoSdk: goSdkVerifier(session.installDir)
2070
+ });
1963
2071
  }
1964
2072
  //#endregion
1965
2073
  //#region src/ui/tui/screens/SourceMapsDetectScreen.tsx
@@ -2149,27 +2257,39 @@ const SourceMapsDetectScreen = ({ store }) => {
2149
2257
  */
2150
2258
  const BlockedSummary = ({ blocked }) => {
2151
2259
  const unsupported = blocked.filter((p) => p.variant == null).length;
2152
- const missingSdk = blocked.length - unsupported;
2260
+ const manualSdk = blocked.filter((p) => p.variant != null && MANUAL_SDK_VARIANTS.includes(p.variant)).length;
2261
+ const missingSdk = blocked.length - unsupported - manualSdk;
2153
2262
  if (blocked.length === 0) return null;
2154
2263
  return /* @__PURE__ */ jsxs(Box, {
2155
2264
  flexDirection: "column",
2156
- children: [unsupported > 0 && /* @__PURE__ */ jsxs(Text, {
2157
- dimColor: true,
2158
- children: [
2159
- "(… ",
2160
- unsupported,
2161
- " other project",
2162
- unsupported === 1 ? "" : "s",
2163
- " not supported)"
2164
- ]
2165
- }), missingSdk > 0 && /* @__PURE__ */ jsxs(Text, {
2166
- dimColor: true,
2167
- children: [
2168
- "(… ",
2169
- missingSdk,
2170
- " supported but missing the PostHog SDK — install it first with `npx @posthog/wizard`)"
2171
- ]
2172
- })]
2265
+ children: [
2266
+ unsupported > 0 && /* @__PURE__ */ jsxs(Text, {
2267
+ dimColor: true,
2268
+ children: [
2269
+ "(… ",
2270
+ unsupported,
2271
+ " other project",
2272
+ unsupported === 1 ? "" : "s",
2273
+ " not supported)"
2274
+ ]
2275
+ }),
2276
+ missingSdk > 0 && /* @__PURE__ */ jsxs(Text, {
2277
+ dimColor: true,
2278
+ children: [
2279
+ "(… ",
2280
+ missingSdk,
2281
+ " supported but missing the PostHog SDK — install it first with `npx @posthog/wizard`)"
2282
+ ]
2283
+ }),
2284
+ manualSdk > 0 && /* @__PURE__ */ jsxs(Text, {
2285
+ dimColor: true,
2286
+ children: [
2287
+ "(… ",
2288
+ manualSdk,
2289
+ " supported but missing the PostHog SDK — add it to the project first (posthog-go / posthog-rs), then re-run)"
2290
+ ]
2291
+ })
2292
+ ]
2173
2293
  });
2174
2294
  };
2175
2295
  //#endregion
@@ -5294,7 +5414,7 @@ function createMcpSuggestedPromptsServices(store) {
5294
5414
  };
5295
5415
  }
5296
5416
  async function* runProductionPromptStreaming(args) {
5297
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DxDftNHb.js");
5417
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-Ba9zJ2JZ.js");
5298
5418
  yield* runMcpPromptViaSdk(args);
5299
5419
  }
5300
5420
  //#endregion
@@ -5471,4 +5591,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5471
5591
  //#endregion
5472
5592
  export { startTUI };
5473
5593
 
5474
- //# sourceMappingURL=start-tui-DNkm-n-4.js.map
5594
+ //# sourceMappingURL=start-tui-DEgpLYEQ.js.map