@posthog/wizard 2.71.0 → 2.73.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 (105) hide show
  1. package/README.md +10 -2
  2. package/dist/{add-mcp-server-to-clients-B6-ZL--P.js → add-mcp-server-to-clients-B8t2xAPf.js} +4 -4
  3. package/dist/{add-mcp-server-to-clients-B6-ZL--P.js.map → add-mcp-server-to-clients-B8t2xAPf.js.map} +1 -1
  4. package/dist/{agent-interface-DFm4jB4d.js → agent-interface-tcCEmyPQ.js} +467 -382
  5. package/dist/agent-interface-tcCEmyPQ.js.map +1 -0
  6. package/dist/{agent-prompt-loader-Bi3IzSBW.js → agent-prompt-loader-V2smIztP.js} +5 -5
  7. package/dist/{agent-prompt-loader-Bi3IzSBW.js.map → agent-prompt-loader-V2smIztP.js.map} +1 -1
  8. package/dist/{agent-runner-Cp6iLqDk.js → agent-runner-DUyO1Ehj.js} +3178 -18
  9. package/dist/agent-runner-DUyO1Ehj.js.map +1 -0
  10. package/dist/analytics-DEL7clQK.js +2 -0
  11. package/dist/{analytics-D54mLptm.js → analytics-DsMH06jo.js} +3 -3
  12. package/dist/{analytics-D54mLptm.js.map → analytics-DsMH06jo.js.map} +1 -1
  13. package/dist/{api-BNBVOguz.js → api-R6bXIwII.js} +3 -3
  14. package/dist/{api-BNBVOguz.js.map → api-R6bXIwII.js.map} +1 -1
  15. package/dist/bin.js +56 -52
  16. package/dist/bin.js.map +1 -1
  17. package/dist/{bounded-fs-DHIaH3Sc.js → bounded-fs-BV-KhOtU.js} +3 -3
  18. package/dist/{bounded-fs-DHIaH3Sc.js.map → bounded-fs-BV-KhOtU.js.map} +1 -1
  19. package/dist/{ci-install-Can8LRdJ.js → ci-install-mR8CeIt2.js} +4 -4
  20. package/dist/{ci-install-Can8LRdJ.js.map → ci-install-mR8CeIt2.js.map} +1 -1
  21. package/dist/{debug-C4RPcEIX.js → debug-PfLVvLhT.js} +1 -1
  22. package/dist/{debug-YQdeZulR.js → debug-aXxgvtal.js} +50 -16
  23. package/dist/debug-aXxgvtal.js.map +1 -0
  24. package/dist/{env-api-key-9yogO8OI.js → env-api-key-_lBt9tHl.js} +2 -2
  25. package/dist/{env-api-key-9yogO8OI.js.map → env-api-key-_lBt9tHl.js.map} +1 -1
  26. package/dist/{environment-6ZuAWRpQ.js → environment-DRhZbhxU.js} +4 -4
  27. package/dist/{environment-6ZuAWRpQ.js.map → environment-DRhZbhxU.js.map} +1 -1
  28. package/dist/{file-watcher-CeWdvMVT.js → file-watcher-BZw1_Y84.js} +2 -2
  29. package/dist/{file-watcher-CeWdvMVT.js.map → file-watcher-BZw1_Y84.js.map} +1 -1
  30. package/dist/{headless-ui-BxSVgNoT.js → headless-ui-Cdqfufhk.js} +2 -2
  31. package/dist/{headless-ui-BxSVgNoT.js.map → headless-ui-Cdqfufhk.js.map} +1 -1
  32. package/dist/{interactive-CRR9zPl4.js → interactive-BCI9b-dp.js} +2 -2
  33. package/dist/{interactive-CRR9zPl4.js.map → interactive-BCI9b-dp.js.map} +1 -1
  34. package/dist/{mcp-D_rRzruj.js → mcp-CzB3lWsm.js} +2 -2
  35. package/dist/{mcp-D_rRzruj.js.map → mcp-CzB3lWsm.js.map} +1 -1
  36. package/dist/{mcp-prompt-streaming-DRAK8CMP.js → mcp-prompt-streaming-RZGAH4YO.js} +4 -4
  37. package/dist/{mcp-prompt-streaming-DRAK8CMP.js.map → mcp-prompt-streaming-RZGAH4YO.js.map} +1 -1
  38. package/dist/{non-interactive-1EJRlN6u.js → non-interactive-CgjTZZ9J.js} +2 -2
  39. package/dist/{non-interactive-1EJRlN6u.js.map → non-interactive-CgjTZZ9J.js.map} +1 -1
  40. package/dist/{orchestrator-tools-DjZWqWmd.js → orchestrator-tools-OWgPinUt.js} +21 -13
  41. package/dist/orchestrator-tools-OWgPinUt.js.map +1 -0
  42. package/dist/{package-manager-DMbzbdkL.js → package-manager-B-Z3IVYu.js} +2 -2
  43. package/dist/{package-manager-DMbzbdkL.js.map → package-manager-B-Z3IVYu.js.map} +1 -1
  44. package/dist/{pi-D4JQMC-7.js → pi-CLLkGrND.js} +11 -11
  45. package/dist/{pi-D4JQMC-7.js.map → pi-CLLkGrND.js.map} +1 -1
  46. package/dist/{playground-Y1nSGXpn.js → playground-D1TgX0EU.js} +9 -9
  47. package/dist/playground-D1TgX0EU.js.map +1 -0
  48. package/dist/{posthog-D9VwcWvJ.js → posthog-CMef8KLR.js} +2 -2
  49. package/dist/{posthog-D9VwcWvJ.js.map → posthog-CMef8KLR.js.map} +1 -1
  50. package/dist/posthog-integration-wiunwp8X.js +1475 -0
  51. package/dist/posthog-integration-wiunwp8X.js.map +1 -0
  52. package/dist/{provisioning-f7lA29tW.js → provisioning-94OneD64.js} +3 -3
  53. package/dist/{provisioning-f7lA29tW.js.map → provisioning-94OneD64.js.map} +1 -1
  54. package/dist/{queue-tools-DGaHf3n-.js → queue-tools--k2v8QYY.js} +108 -44
  55. package/dist/queue-tools--k2v8QYY.js.map +1 -0
  56. package/dist/{registry-D1By1SgH.js → registry-C60oJv02.js} +5 -5
  57. package/dist/{registry-D1By1SgH.js.map → registry-C60oJv02.js.map} +1 -1
  58. package/dist/{security-C2c3_Ycy.js → security-DnOP36w-.js} +5 -5
  59. package/dist/{security-C2c3_Ycy.js.map → security-DnOP36w-.js.map} +1 -1
  60. package/dist/{setup-utils-BRrCeajl.js → setup-utils-BwX6QmL_.js} +9 -9
  61. package/dist/{setup-utils-BRrCeajl.js.map → setup-utils-BwX6QmL_.js.map} +1 -1
  62. package/dist/{start-tui-r4Spgptv.js → start-tui-C3PdKFtP.js} +53 -32
  63. package/dist/start-tui-C3PdKFtP.js.map +1 -0
  64. package/dist/{steps-BZd65XfI.js → steps-BpCRk8Ef.js} +7 -7
  65. package/dist/{steps-BZd65XfI.js.map → steps-BpCRk8Ef.js.map} +1 -1
  66. package/dist/{store-DGVXu7xt.js → store-EzqWyb60.js} +7 -8
  67. package/dist/store-EzqWyb60.js.map +1 -0
  68. package/dist/{subagent-BaMxO7OT.js → subagent-DwdrVprk.js} +2 -2
  69. package/dist/{subagent-BaMxO7OT.js.map → subagent-DwdrVprk.js.map} +1 -1
  70. package/dist/{task-DpKoEZ5I.js → task-CrXgNEUB.js} +12 -12
  71. package/dist/{task-DpKoEZ5I.js.map → task-CrXgNEUB.js.map} +1 -1
  72. package/dist/{task-stream-CdrBraqP.js → task-stream-ZBbfHo7l.js} +5 -5
  73. package/dist/{task-stream-CdrBraqP.js.map → task-stream-ZBbfHo7l.js.map} +1 -1
  74. package/dist/{tasks-KsP66Cis.js → tasks-CbMEKWZ9.js} +2 -2
  75. package/dist/{tasks-KsP66Cis.js.map → tasks-CbMEKWZ9.js.map} +1 -1
  76. package/dist/{telemetry-DedDTtSa.js → telemetry-B2dz2-PT.js} +3 -3
  77. package/dist/{telemetry-DedDTtSa.js.map → telemetry-B2dz2-PT.js.map} +1 -1
  78. package/dist/{terminal-BH8yLclG.js → terminal-DTe59M4j.js} +12 -12
  79. package/dist/{terminal-BH8yLclG.js.map → terminal-DTe59M4j.js.map} +1 -1
  80. package/dist/{tools-CJw5vnZd.js → tools-DZ9lZgJI.js} +6 -6
  81. package/dist/{tools-CJw5vnZd.js.map → tools-DZ9lZgJI.js.map} +1 -1
  82. package/dist/{wizard-abort-D54j2gmb.js → wizard-abort-CUT8MXXt.js} +4 -4
  83. package/dist/{wizard-abort-D54j2gmb.js.map → wizard-abort-CUT8MXXt.js.map} +1 -1
  84. package/dist/{wizard-abort-Q1NiYELE.js → wizard-abort-CfKnrSlX.js} +1 -1
  85. package/dist/{wizard-session-Dwc1Rh_7.js → wizard-session-BWAQoi9q.js} +1 -1
  86. package/dist/{wizard-session-CwQPZN4y.js → wizard-session-GdDN_aMS.js} +2 -1
  87. package/dist/wizard-session-GdDN_aMS.js.map +1 -0
  88. package/dist/yara-hooks-CLeMu2EY.js +2 -0
  89. package/dist/{yara-hooks-CL2LVEgO.js → yara-hooks-VvwkZn5s.js} +7 -6
  90. package/dist/yara-hooks-VvwkZn5s.js.map +1 -0
  91. package/package.json +2 -1
  92. package/dist/agent-interface-DFm4jB4d.js.map +0 -1
  93. package/dist/agent-runner-Cp6iLqDk.js.map +0 -1
  94. package/dist/analytics-Ge1LsCNg.js +0 -2
  95. package/dist/debug-YQdeZulR.js.map +0 -1
  96. package/dist/orchestrator-tools-DjZWqWmd.js.map +0 -1
  97. package/dist/playground-Y1nSGXpn.js.map +0 -1
  98. package/dist/posthog-integration-B8f4xRBd.js +0 -4618
  99. package/dist/posthog-integration-B8f4xRBd.js.map +0 -1
  100. package/dist/queue-tools-DGaHf3n-.js.map +0 -1
  101. package/dist/start-tui-r4Spgptv.js.map +0 -1
  102. package/dist/store-DGVXu7xt.js.map +0 -1
  103. package/dist/wizard-session-CwQPZN4y.js.map +0 -1
  104. package/dist/yara-hooks-BI6WY0Sl.js +0 -2
  105. package/dist/yara-hooks-CL2LVEgO.js.map +0 -1
@@ -1,21 +1,23 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B_-DWIq7.js";
2
2
  import { a as AgentSignals, i as AGENT_ERROR_CODE, l as ErrorCodes, n as skillErrorCode } from "./errors-u8z27V-x.js";
3
- import { A as GPT5_6_LUNA_MODEL, D as DEFAULT_AGENT_MODEL, F as Harness, M as GPT5_6_TERRA_MODEL, _ as evaluateWizardReadiness, a as getLogFilePath, c as WIZARD_BENCHMARK_FILE, ct as WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY, et as SONNET_5_MODEL, f as getUI, ft as WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY, g as SIGNUP_WIZARD_READINESS_CONFIG, gt as VERSION, h as SERVICE_LABELS, i as enableDebugLogs, j as GPT5_6_SOL_MODEL, l as WIZARD_LOG_FILE, lt as WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY, mt as getSkillsBaseUrl, o as initLogFile, rt as WIZARD_CONTACT_EMAIL, s as logToFile, st as WIZARD_ORCHESTRATOR_FLAG_KEY, t as configureLogFile, tt as Sequence, v as getBlockingServiceKeys, vt as RUN_SURFACE, xt as runtimeEnv } from "./debug-YQdeZulR.js";
4
- import "./wizard-session-CwQPZN4y.js";
5
- import { a as ciExcludedTaskTypes, n as analytics, r as groupsFromUser } from "./analytics-D54mLptm.js";
6
- import { c as OAuthError, s as refreshAccessToken, t as getOrAskForProjectData, u as mcpUrlFor } from "./setup-utils-BRrCeajl.js";
7
- import { i as wizardAbort, n as registerCleanup, t as WizardError } from "./wizard-abort-D54j2gmb.js";
8
- import { n as isNonInteractiveEnvironment } from "./environment-6ZuAWRpQ.js";
9
- import { A as fetchSkillMenu, G as createTriageLLMProvider, J as gatewayAuth, Y as markGrantRevoked, c as checkAllSettingsConflicts, d as restoreClaudeSettings, i as runAgent$1, j as installSkillById, l as classifySettingsConflicts, n as buildRunTags, r as initializeAgent, s as backupAndFixClaudeSettings, z as createWizardAskBridge } from "./agent-interface-DFm4jB4d.js";
10
- import { c as uncoveredBySink, d as SkipReason, f as TaskStatus, g as isValidModel, l as QUEUE_DIR_NAME, s as dependencyClosure, u as QueueStore, v as requireKnownModel } from "./queue-tools-DGaHf3n-.js";
11
- import { a as flushScanReport, m as writeScanReport, o as formatScanReport, s as formatYaraAbortMessage } from "./yara-hooks-CL2LVEgO.js";
12
- import { a as piBackend, s as createAioCapture } from "./pi-D4JQMC-7.js";
13
- import { a as detectNodePackageManagers } from "./package-manager-DMbzbdkL.js";
14
- import { t as FRAMEWORK_REGISTRY } from "./registry-D1By1SgH.js";
15
- import { a as assembleTaskPrompt, d as taskModelSpec, i as assembleSeedPrompt, n as agentRunTools, o as loadAgentRegistry, s as promptModelFor, t as ASK_TOOL, u as resolveTask } from "./agent-prompt-loader-Bi3IzSBW.js";
16
- import fs, { cpSync, existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "fs";
3
+ import { F as HAIKU_MODEL, L as Harness, M as GPT5_6_LUNA_MODEL, N as GPT5_6_SOL_MODEL, O as DEFAULT_AGENT_MODEL, P as GPT5_6_TERRA_MODEL, St as runtimeEnv, _ as evaluateWizardReadiness, _t as VERSION, a as getLogFilePath, c as WIZARD_BENCHMARK_FILE, ct as WIZARD_ORCHESTRATOR_FLAG_KEY, f as getUI, g as SIGNUP_WIZARD_READINESS_CONFIG, h as SERVICE_LABELS, ht as getSkillsBaseUrl, i as enableDebugLogs, it as WIZARD_CONTACT_EMAIL, k as DETECTION_TIMEOUT_MS, l as WIZARD_LOG_FILE, lt as WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY, nt as Sequence, o as initLogFile, pt as WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY, s as logToFile, t as configureLogFile, tt as SONNET_5_MODEL, ut as WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY, v as getBlockingServiceKeys, yt as RUN_SURFACE, z as Integration } from "./debug-aXxgvtal.js";
4
+ import { o as mayReportScanResults } from "./wizard-session-GdDN_aMS.js";
5
+ import { a as ciExcludedTaskTypes, n as analytics, r as groupsFromUser } from "./analytics-DsMH06jo.js";
6
+ import { a as safeReadFile, i as readProjectFile, o as walkProjectFiles } from "./bounded-fs-BV-KhOtU.js";
7
+ import { c as OAuthError, s as refreshAccessToken, t as getOrAskForProjectData, u as mcpUrlFor } from "./setup-utils-BwX6QmL_.js";
8
+ import { i as wizardAbort, n as registerCleanup, t as WizardError } from "./wizard-abort-CUT8MXXt.js";
9
+ import { n as isNonInteractiveEnvironment } from "./environment-DRhZbhxU.js";
10
+ import { G as MAX_ENV_KEY_SET, H as createWizardAskBridge, J as toPromptSafeRelativePath, K as isEnvFileName, N as fetchSkillMenu, P as installSkillById, W as gatewayAuth, Y as markGrantRevoked, c as checkAllSettingsConflicts, d as restoreClaudeSettings, h as createTriageLLMProvider, i as runAgent$1, l as classifySettingsConflicts, n as buildRunTags, q as parseEnvKeyNames, r as initializeAgent, s as backupAndFixClaudeSettings } from "./agent-interface-tcCEmyPQ.js";
11
+ import { a as detectNodePackageManagers } from "./package-manager-B-Z3IVYu.js";
12
+ import { t as FRAMEWORK_REGISTRY } from "./registry-C60oJv02.js";
13
+ import { a as flushScanReport, m as writeScanReport, o as formatScanReport, s as formatYaraAbortMessage } from "./yara-hooks-VvwkZn5s.js";
14
+ import { _ as isValidModel, f as QUEUE_DIR_NAME, h as TaskStatus, l as dependencyClosure, m as SkipReason, p as QueueStore, u as uncoveredBySink, y as requireKnownModel } from "./queue-tools--k2v8QYY.js";
15
+ import { a as piBackend, s as createAioCapture } from "./pi-CLLkGrND.js";
16
+ import { a as assembleTaskPrompt, d as taskModelSpec, i as assembleSeedPrompt, n as agentRunTools, o as loadAgentRegistry, s as promptModelFor, t as ASK_TOOL, u as resolveTask } from "./agent-prompt-loader-V2smIztP.js";
17
+ import * as semver from "semver";
18
+ import fs, { cpSync, existsSync, mkdirSync, readdirSync, rmSync, statSync, writeFileSync } from "fs";
17
19
  import * as path$1 from "path";
18
- import path from "path";
20
+ import path, { isAbsolute, join, resolve, sep } from "path";
19
21
  import { z } from "zod";
20
22
  import { randomUUID } from "crypto";
21
23
  //#region src/lib/agent/runner/shared/authenticate.ts
@@ -82,6 +84,3162 @@ async function refreshAccessTokenIfNeeded(session) {
82
84
  }
83
85
  }
84
86
  //#endregion
87
+ //#region src/lib/detection/framework.ts
88
+ /**
89
+ * Framework detection — identify which PostHog-supported framework
90
+ * is present in the project directory.
91
+ *
92
+ * Pure function: takes an install dir, returns the detected integration
93
+ * (or undefined). No store mutations, no UI calls.
94
+ */
95
+ /**
96
+ * Loop through all registered frameworks and return the first one
97
+ * whose `detect()` predicate matches the given directory.
98
+ * Returns undefined if no framework is detected or detection times out.
99
+ */
100
+ async function detectFramework(installDir) {
101
+ for (const integration of Object.values(Integration)) {
102
+ const config = FRAMEWORK_REGISTRY[integration];
103
+ try {
104
+ if (await Promise.race([config.detection.detect({ installDir }), new Promise((resolve) => setTimeout(() => resolve(false), 1e4))])) return integration;
105
+ } catch {}
106
+ }
107
+ }
108
+ //#endregion
109
+ //#region src/lib/detection/features.ts
110
+ /**
111
+ * Feature discovery — scan project dependencies for known SDK patterns
112
+ * that indicate additional PostHog programs are relevant.
113
+ *
114
+ * Pure function: takes an install dir, returns a set of discovered features.
115
+ * No store mutations, no UI calls.
116
+ */
117
+ const STRIPE_PACKAGES = new Set(["stripe", "@stripe/stripe-js"]);
118
+ const LLM_PACKAGES = new Set([
119
+ "openai",
120
+ "@anthropic-ai/sdk",
121
+ "ai",
122
+ "@ai-sdk/openai",
123
+ "langchain",
124
+ "@langchain/openai",
125
+ "@langchain/langgraph",
126
+ "@google/generative-ai",
127
+ "@google/genai",
128
+ "@instructor-ai/instructor",
129
+ "@mastra/core",
130
+ "portkey-ai"
131
+ ]);
132
+ const PYTHON_LLM_PACKAGES = new Set([
133
+ "openai",
134
+ "anthropic",
135
+ "langchain",
136
+ "langchain-openai",
137
+ "langchain-anthropic",
138
+ "langchain-google-genai",
139
+ "langgraph",
140
+ "litellm",
141
+ "llama-index",
142
+ "pydantic-ai",
143
+ "crewai",
144
+ "instructor",
145
+ "dspy-ai",
146
+ "mistralai",
147
+ "cohere",
148
+ "google-generativeai",
149
+ "google-genai",
150
+ "portkey-ai"
151
+ ]);
152
+ function discoverFeatures(installDir) {
153
+ const features = [];
154
+ discoverNodeFeatures(installDir, features);
155
+ discoverPythonFeatures(installDir, features);
156
+ return features;
157
+ }
158
+ function discoverNodeFeatures(installDir, features) {
159
+ const packageJsonText = safeRead(installDir, "package.json");
160
+ if (!packageJsonText) return;
161
+ let packageJson;
162
+ try {
163
+ packageJson = JSON.parse(packageJsonText);
164
+ } catch {
165
+ return;
166
+ }
167
+ const depNames = Object.keys({
168
+ ...packageJson.dependencies,
169
+ ...packageJson.devDependencies
170
+ });
171
+ if (depNames.some((depName) => STRIPE_PACKAGES.has(depName))) features.push("stripe");
172
+ if (depNames.some((depName) => LLM_PACKAGES.has(depName))) features.push("llm");
173
+ }
174
+ function discoverPythonFeatures(installDir, features) {
175
+ if (features.includes("llm")) return;
176
+ const depNames = [];
177
+ const requirementsTxt = safeRead(installDir, "requirements.txt");
178
+ if (requirementsTxt) depNames.push(...parseRequirementsTxt(requirementsTxt));
179
+ const pyprojectToml = safeRead(installDir, "pyproject.toml");
180
+ if (pyprojectToml) depNames.push(...parsePyprojectToml(pyprojectToml));
181
+ const pipfile = safeRead(installDir, "Pipfile");
182
+ if (pipfile) depNames.push(...parsePipfile(pipfile));
183
+ if (depNames.some((depName) => PYTHON_LLM_PACKAGES.has(depName))) features.push("llm");
184
+ }
185
+ function safeRead(installDir, file) {
186
+ return readProjectFile(join(installDir, file));
187
+ }
188
+ function normalizePyName(name) {
189
+ return name.toLowerCase().replace(/_/g, "-");
190
+ }
191
+ function parseRequirementsTxt(content) {
192
+ return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#") && !line.startsWith("-")).map((line) => line.replace(/\[[^\]]*\]/, "")).map((line) => line.split(/[<>=!~;\s]/)[0]).filter(Boolean).map(normalizePyName);
193
+ }
194
+ function parsePyprojectToml(content) {
195
+ const depNames = [];
196
+ for (const arrayMatch of content.matchAll(/dependencies\s*=\s*\[([^\]]*)\]/g)) {
197
+ const arrayBody = arrayMatch[1];
198
+ for (const quotedMatch of arrayBody.matchAll(/["']([^"']+)["']/g)) {
199
+ const name = quotedMatch[1].replace(/\[[^\]]*\]/, "").split(/[<>=!~;\s]/)[0];
200
+ if (name) depNames.push(normalizePyName(name));
201
+ }
202
+ }
203
+ for (const sectionMatch of content.matchAll(/\[tool\.poetry\.(?:dev-dependencies|dependencies|group\.[^.\]]+\.dependencies)\]([\s\S]*?)(?=\n\[|$)/g)) {
204
+ const sectionBody = sectionMatch[1];
205
+ depNames.push(...extractTomlSectionKeys(sectionBody, { skip: ["python"] }));
206
+ }
207
+ return depNames;
208
+ }
209
+ function parsePipfile(content) {
210
+ const depNames = [];
211
+ for (const sectionMatch of content.matchAll(/\[(packages|dev-packages)\]([\s\S]*?)(?=\n\[|$)/g)) {
212
+ const sectionBody = sectionMatch[2];
213
+ depNames.push(...extractTomlSectionKeys(sectionBody));
214
+ }
215
+ return depNames;
216
+ }
217
+ function extractTomlSectionKeys(sectionBody, opts = {}) {
218
+ const skipNames = new Set(opts.skip ?? []);
219
+ const depNames = [];
220
+ for (const line of sectionBody.split("\n")) {
221
+ const trimmed = line.trim();
222
+ if (!trimmed || trimmed.startsWith("#")) continue;
223
+ const equalsIndex = trimmed.indexOf("=");
224
+ if (equalsIndex <= 0) continue;
225
+ const name = trimmed.slice(0, equalsIndex).trim();
226
+ if (!/^[a-zA-Z0-9._-]+$/.test(name)) continue;
227
+ if (skipNames.has(name.toLowerCase())) continue;
228
+ depNames.push(normalizePyName(name));
229
+ }
230
+ return depNames;
231
+ }
232
+ //#endregion
233
+ //#region src/lib/detection/context.ts
234
+ /**
235
+ * Framework context gathering — run gatherContext and version checks
236
+ * for a detected framework.
237
+ *
238
+ * Pure functions: take a framework config and options, return results.
239
+ * No store mutations, no UI calls.
240
+ */
241
+ /**
242
+ * Run a framework's `gatherContext()` to collect variant-specific
243
+ * metadata (e.g., router type for Next.js, Expo vs bare for React Native).
244
+ *
245
+ * Returns the gathered context, or an empty object on failure/timeout.
246
+ */
247
+ async function gatherFrameworkContext(config, options) {
248
+ if (!config.metadata.gatherContext) return {};
249
+ try {
250
+ return await Promise.race([config.metadata.gatherContext(options), new Promise((resolve) => setTimeout(() => resolve({}), DETECTION_TIMEOUT_MS))]);
251
+ } catch {
252
+ return {};
253
+ }
254
+ }
255
+ /**
256
+ * Check whether the installed framework version meets the minimum requirement.
257
+ *
258
+ * Returns `{ supported: true }` if the version is fine (or no check is needed).
259
+ * Returns the version details if unsupported.
260
+ */
261
+ async function checkFrameworkVersion(config, options) {
262
+ if (!config.detection.minimumVersion || !config.detection.getInstalledVersion) return { supported: true };
263
+ const version = await config.detection.getInstalledVersion(options);
264
+ if (!version) return { supported: true };
265
+ const coerced = semver.coerce(version);
266
+ if (coerced && semver.lt(coerced, config.detection.minimumVersion)) return { supported: {
267
+ current: version,
268
+ minimum: config.detection.minimumVersion,
269
+ docsUrl: config.metadata.unsupportedVersionDocsUrl ?? config.metadata.docsUrl
270
+ } };
271
+ return { supported: true };
272
+ }
273
+ //#endregion
274
+ //#region src/lib/detection/agentic.ts
275
+ /**
276
+ * Agentic project detection.
277
+ *
278
+ * A reusable detection tool that drives a Haiku agent over the repo: it finds
279
+ * project roots, resolves monorepo/workspace markers, reads package manifests,
280
+ * classifies each project against a caller-supplied set of targets, and reports
281
+ * which projects already have a PostHog SDK installed.
282
+ *
283
+ * Product-knowledge-free by design — the caller passes the targets to classify
284
+ * into (e.g. source-map skill variants) and maps the result back. Sits next to
285
+ * the other detection tools (framework, features, package-manager) so it's
286
+ * discoverable. Runs AFTER auth: it uses the same agent loop every program
287
+ * uses, which needs credentials.
288
+ */
289
+ /**
290
+ * Every project-manifest / workspace-marker filename the wizard's frameworks
291
+ * are identified by. One brace-expansion Glob over all of these locates every
292
+ * project root in the repo in a single call, regardless of language.
293
+ *
294
+ * Counterpart: POSTHOG_MANIFESTS in @lib/programs/self-driving/detect (SDK
295
+ * grep); keep the two in sync.
296
+ */
297
+ const PROJECT_MANIFESTS = [
298
+ "package.json",
299
+ "pnpm-workspace.yaml",
300
+ "turbo.json",
301
+ "nx.json",
302
+ "lerna.json",
303
+ "requirements.txt",
304
+ "pyproject.toml",
305
+ "setup.py",
306
+ "Pipfile",
307
+ "manage.py",
308
+ "Gemfile",
309
+ "composer.json",
310
+ "pom.xml",
311
+ "Cargo.toml",
312
+ "mix.exs",
313
+ "go.mod",
314
+ "*.csproj",
315
+ "Package.swift",
316
+ "Podfile",
317
+ "project.yml",
318
+ "project.pbxproj",
319
+ "pubspec.yaml",
320
+ "build.gradle",
321
+ "build.gradle.kts",
322
+ "settings.gradle",
323
+ "settings.gradle.kts",
324
+ "gradle/libs.versions.toml"
325
+ ];
326
+ /** The single brace-expansion glob covering every supported manifest. */
327
+ function manifestGlob() {
328
+ return `**/{${PROJECT_MANIFESTS.join(",")}}`;
329
+ }
330
+ function buildPrompt(cwd, targets, purpose, recommend) {
331
+ const targetList = targets.map((t) => `- ${t.id} → ${t.name}`).join("\n");
332
+ const projectShape = `{"path":string,"framework":string,"matchingTargets":string[],"targetId":string|null,"hasPostHog":boolean,"evidence":string${recommend ? ",\"recommended\":boolean" : ""}}`;
333
+ return [
334
+ `You are scanning a code repository to ${purpose}. Be fast and mechanical — do not over-explore. Keep any reasoning to one short sentence, then run the tool calls and output the JSON.`,
335
+ "",
336
+ `Working directory: ${cwd}`,
337
+ "",
338
+ "A \"project\" is a directory containing one or more of the manifest files below. Find projects by their manifests, NOT by walking directories — never report a directory that has no manifest.",
339
+ "",
340
+ "Do exactly this:",
341
+ `1. Run Glob ONCE with this pattern to find every project manifest in the repo in a single call: "${manifestGlob()}". Discard any result whose path contains node_modules/, dist/, build/, .next/, out/, coverage/, vendor/, .venv/, site-packages/, target/, Pods/, Carthage/, or DerivedData/. Group the remaining results by directory — each directory is one project. Three exceptions to "directory = project": a project.pbxproj lives inside a "<Name>.xcodeproj/" wrapper, so the project root is the PARENT of that .xcodeproj directory; a project.yml at a directory root is an XcodeGen-generated Xcode app rooted at that directory; a gradle/libs.versions.toml is a version catalog belonging to the gradle project rooted at the PARENT of that gradle/ directory (read it alongside the build.gradle when deciding hasPostHog), never its own project.`,
342
+ "2. Decide repoType: \"monorepo\" if the root package.json has a \"workspaces\" field OR a pnpm-workspace.yaml / turbo.json / nx.json / lerna.json was found at the root, else \"single\".",
343
+ `3. For EACH project directory, ONE AT A TIME: Read its manifest(s) ONCE, decide the fields below, then IMMEDIATELY — before reading any other project — write that project's verdict as one JSON line of shape ${projectShape}. Never write a verdict from memory of an earlier Read; the manifest you just read is the only source. Decide from its dependency lists:`,
344
+ " - the human-readable framework name (e.g. \"Next.js\", \"Django\", \"Rails\"),",
345
+ " - matchingTargets: EVERY target id from the list below whose technology appears in THIS manifest, in the priority order of the list. An id belongs here only if you can point at the dependency or setting in the manifest you just read — never carry one over from another project,",
346
+ " - targetId: the FIRST entry of matchingTargets (the list is ordered by priority, most specific first). null when matchingTargets is empty,",
347
+ ` - hasPostHog: true if any dependency is a PostHog SDK. This includes: a name containing "posthog" in any ecosystem (e.g. posthog-js, posthog-node, @posthog/*, posthog for pip/gem/hex, a com.posthog:* gradle/maven coordinate, a PostHog NuGet PackageReference); an SPM package named "PostHog" or a repositoryURL of github.com/PostHog/posthog-ios (in Package.swift or a .pbxproj); or a "pod 'PostHog'" line in a Podfile. Else false.`,
348
+ " - evidence: the manifest fact that decided targetId, with the file it came from (e.g. \"rollup in devDependencies of backend/package.json\"). When targetId is null, name the closest fact you saw. One short clause, quoted from the manifest you just read.",
349
+ " Do NOT read any file other than these manifests.",
350
+ ...recommend ? ["4. Pick exactly ONE project as recommended — the main user-facing client application. Prefer a frontend web app or a mobile app over backend servers/APIs, libraries, CLIs, tooling, and example/demo/docs apps. If several client apps exist, pick the primary production app; if no client app exists, pick the primary application project."] : [],
351
+ "",
352
+ "Target ids (id → name), in priority order — most specific first; if several match a project, keep the one listed earliest:",
353
+ targetList,
354
+ "",
355
+ "Output requirements:",
356
+ "- After the last verdict line, respond with ONLY a single JSON object assembling the verdict lines you wrote, copied VERBATIM — same path, framework, targetId and evidence per project. No prose, no markdown code fences.",
357
+ `- Shape: {"repoType":"monorepo"|"single","projects":[${projectShape}]}`,
358
+ "- \"path\" is the project directory relative to the working directory; use \".\" for the repo root.",
359
+ "- \"targetId\" MUST be exactly one of the target ids above when it matches; if several match, use the one listed earliest; otherwise null.",
360
+ "- Include projects whose stack matches no target too (targetId: null).",
361
+ ...recommend ? ["- Exactly one project has \"recommended\": true; every other project has \"recommended\": false."] : [],
362
+ `- If there are no manifests at all, respond with exactly: ${AgentSignals.ABORT} detection failed`
363
+ ].join("\n");
364
+ }
365
+ /**
366
+ * Build the detection report from the agent's output, or null when it holds
367
+ * no verdicts. Exported for testing.
368
+ *
369
+ * The verdict lines are far more reliable than the model's final assembly
370
+ * (prose, pretty-printing, per-object fences), so every parseable line
371
+ * contributes: objects with a `path` merge by path (last wins), and a
372
+ * one-line assembly's `projects` merge the same way. `repoType` is
373
+ * approximated from the count — it only feeds telemetry and display.
374
+ */
375
+ function deriveReportJson(text) {
376
+ const byPath = /* @__PURE__ */ new Map();
377
+ for (const line of text.split("\n")) {
378
+ const start = line.indexOf("{");
379
+ const end = line.lastIndexOf("}");
380
+ if (start === -1 || end <= start) continue;
381
+ let parsed;
382
+ try {
383
+ parsed = JSON.parse(line.slice(start, end + 1));
384
+ } catch {
385
+ continue;
386
+ }
387
+ const obj = parsed ?? {};
388
+ const candidates = Array.isArray(obj.projects) ? obj.projects : [obj];
389
+ for (const candidate of candidates) {
390
+ const p = candidate ?? {};
391
+ if (typeof p.path === "string") byPath.set(p.path, p);
392
+ }
393
+ }
394
+ if (byPath.size === 0) return null;
395
+ const projects = [...byPath.values()];
396
+ return {
397
+ repoType: projects.length > 1 ? "monorepo" : "single",
398
+ projects
399
+ };
400
+ }
401
+ /**
402
+ * Clamp an agent-reported project path to a safe repo-relative dir. The path
403
+ * is LLM output: absolute paths or `..` segments could steer later phases
404
+ * (e.g. integrate-run's targetDir) outside the repo, so they clamp to '.'.
405
+ */
406
+ function coercePath(raw) {
407
+ if (typeof raw !== "string" || raw.length === 0) return ".";
408
+ if (isAbsolute(raw) || raw.split(/[\\/]/).includes("..")) return ".";
409
+ return raw;
410
+ }
411
+ /** Resolve an agent-reported path to an absolute dir clamped to the root — the caller-side counterpart of coercePath. */
412
+ function resolveProjectDir(installDir, rel) {
413
+ if (typeof rel !== "string" || rel === ".") return installDir;
414
+ const root = resolve(installDir);
415
+ const dir = resolve(root, rel);
416
+ return dir === root || dir.startsWith(root + sep) ? dir : root;
417
+ }
418
+ /**
419
+ * Validate the agent's raw JSON into a report, clamping each targetId to the
420
+ * supplied set and each path to a repo-relative dir. Exported for testing.
421
+ * `recommended` is stripped unless requested; at most one (the first) survives.
422
+ */
423
+ function coerceAgenticReport(parsed, validTargetIds, options) {
424
+ const recommend = options?.recommend === true;
425
+ const rerankIds = options?.rerankIds ?? [];
426
+ const obj = parsed ?? {};
427
+ const repoType = obj.repoType === "monorepo" ? "monorepo" : "single";
428
+ const rawProjects = Array.isArray(obj.projects) ? obj.projects : [];
429
+ let recommendedSeen = false;
430
+ return {
431
+ repoType,
432
+ projects: rawProjects.map((raw) => {
433
+ const p = raw ?? {};
434
+ const pick = typeof p.targetId === "string" && validTargetIds.includes(p.targetId) ? p.targetId : null;
435
+ const enumerated = Array.isArray(p.matchingTargets) ? validTargetIds.find((id) => p.matchingTargets.includes(id)) ?? null : null;
436
+ const targetId = pick === null ? enumerated : enumerated !== null && rerankIds.includes(enumerated) && rerankIds.includes(pick) ? enumerated : pick;
437
+ const recommended = recommend && !recommendedSeen && p.recommended === true;
438
+ recommendedSeen ||= recommended;
439
+ return {
440
+ path: coercePath(p.path),
441
+ framework: typeof p.framework === "string" ? p.framework : "Unknown",
442
+ targetId,
443
+ hasPostHog: p.hasPostHog === true,
444
+ ...recommend ? { recommended } : {}
445
+ };
446
+ })
447
+ };
448
+ }
449
+ function formatToolUse(block) {
450
+ const name = typeof block?.name === "string" ? block.name : "tool";
451
+ const input = block?.input ?? {};
452
+ const detail = input.file_path || input.pattern || input.path || "";
453
+ return detail ? `${name} ${detail}` : name;
454
+ }
455
+ function sessionToWizardOptions(session) {
456
+ return {
457
+ installDir: session.installDir,
458
+ ci: session.ci,
459
+ debug: session.debug,
460
+ benchmark: session.benchmark,
461
+ yaraReport: session.yaraReport,
462
+ signup: session.signup,
463
+ apiKey: session.apiKey,
464
+ projectId: session.projectId
465
+ };
466
+ }
467
+ const NOOP_SPINNER = {
468
+ start: () => void 0,
469
+ stop: () => void 0,
470
+ message: () => void 0
471
+ };
472
+ /**
473
+ * Drive the wizard's agent loop on HAIKU_MODEL to scan the repo and return a
474
+ * structured detection report. Reuses the same setup every program uses, so
475
+ * MCP, tools, and credentials are wired identically.
476
+ */
477
+ async function detectProjectsWithAgent(session, options) {
478
+ if (!session.credentials) throw new Error("Detection requires authenticated credentials.");
479
+ const { targets, programId, purpose = "set up a PostHog integration", recommend = false, rerankIds, onEvent } = options;
480
+ const { accessToken, host } = session.credentials;
481
+ const cwd = session.installDir;
482
+ const runOptions = sessionToWizardOptions(session);
483
+ const wizardMetadata = {
484
+ ...buildRunTags({
485
+ programId,
486
+ integration: "agentic-detect",
487
+ runId: analytics.runId,
488
+ build: analytics.build
489
+ }),
490
+ call_type: "detection"
491
+ };
492
+ const agent = await initializeAgent({
493
+ workingDirectory: cwd,
494
+ posthogMcpUrl: host.mcpUrl,
495
+ posthogApiKey: accessToken,
496
+ host,
497
+ detectPackageManager: detectNodePackageManagers,
498
+ skillsBaseUrl: getSkillsBaseUrl(),
499
+ programId,
500
+ integrationLabel: "agentic-detect",
501
+ wizardMetadata,
502
+ allowedTools: [
503
+ "Read",
504
+ "Grep",
505
+ "Glob"
506
+ ],
507
+ modelOverride: HAIKU_MODEL
508
+ }, runOptions);
509
+ const MAX_TRANSCRIPT_CHARS = 256 * 1024;
510
+ const collected = [];
511
+ let collectedChars = 0;
512
+ const collect = (text) => {
513
+ collected.push(text);
514
+ collectedChars += text.length;
515
+ while (collectedChars > MAX_TRANSCRIPT_CHARS && collected.length > 1) collectedChars -= collected.shift().length;
516
+ };
517
+ let resultText = "";
518
+ const result = await runAgent$1(agent, buildPrompt(cwd, targets, purpose, recommend), runOptions, NOOP_SPINNER, {
519
+ spinnerMessage: "Scanning the repo...",
520
+ successMessage: "Detection complete",
521
+ errorMessage: "Detection failed",
522
+ requestRemark: false
523
+ }, {
524
+ onMessage: (message) => {
525
+ if (message?.type === "assistant") {
526
+ for (const block of message.message?.content ?? []) if (block?.type === "text" && typeof block.text === "string") {
527
+ collect(block.text);
528
+ const line = block.text.trim();
529
+ if (line && onEvent) onEvent(line.length > 100 ? `${line.slice(0, 100)}…` : line);
530
+ } else if (block?.type === "tool_use") onEvent?.(formatToolUse(block));
531
+ } else if (message?.type === "result" && typeof message.result === "string") resultText = message.result;
532
+ },
533
+ finalize: (_resultMessage, _durationMs) => void 0
534
+ });
535
+ if (result.error) throw new Error(result.message || `Agent error: ${result.error}`);
536
+ const output = `${collected.join("\n")}\n${resultText}`;
537
+ const derived = deriveReportJson(output);
538
+ if (derived === null) {
539
+ if (output.includes(AgentSignals.ABORT)) return {
540
+ repoType: "single",
541
+ projects: []
542
+ };
543
+ throw new Error("Agent did not return a JSON object");
544
+ }
545
+ return coerceAgenticReport(derived, targets.map((t) => t.id), {
546
+ recommend,
547
+ rerankIds
548
+ });
549
+ }
550
+ //#endregion
551
+ //#region src/lib/warehouse-sources/registry.ts
552
+ const CORE_SOURCE_DETECTORS = [
553
+ {
554
+ kind: "Postgres",
555
+ label: "PostgreSQL",
556
+ mode: "in-cli",
557
+ signals: {
558
+ npm: [
559
+ "pg",
560
+ "postgres",
561
+ "postgres.js",
562
+ "knex",
563
+ "sequelize"
564
+ ],
565
+ python: [
566
+ "psycopg",
567
+ "psycopg2",
568
+ "psycopg2-binary",
569
+ "asyncpg"
570
+ ],
571
+ ruby: ["pg"],
572
+ envKeys: [
573
+ /^DATABASE_URL$/,
574
+ /^POSTGRES_/,
575
+ /^PG(HOST|DATABASE|USER|PORT)$/
576
+ ]
577
+ }
578
+ },
579
+ {
580
+ kind: "MySQL",
581
+ label: "MySQL",
582
+ mode: "in-cli",
583
+ signals: {
584
+ npm: ["mysql", "mysql2"],
585
+ python: [
586
+ "pymysql",
587
+ "mysqlclient",
588
+ "mysql-connector-python"
589
+ ],
590
+ ruby: ["mysql2"],
591
+ envKeys: [/^MYSQL_/]
592
+ }
593
+ },
594
+ {
595
+ kind: "MongoDB",
596
+ label: "MongoDB",
597
+ mode: "in-cli",
598
+ signals: {
599
+ npm: ["mongodb", "mongoose"],
600
+ python: ["pymongo", "motor"],
601
+ ruby: ["mongo", "mongoid"],
602
+ envKeys: [/^MONGO(DB)?_/]
603
+ }
604
+ },
605
+ {
606
+ kind: "Snowflake",
607
+ label: "Snowflake",
608
+ mode: "in-cli",
609
+ signals: {
610
+ npm: ["snowflake-sdk"],
611
+ python: ["snowflake-connector-python", "snowflake-sqlalchemy"],
612
+ envKeys: [/^SNOWFLAKE_/]
613
+ }
614
+ },
615
+ {
616
+ kind: "BigQuery",
617
+ label: "BigQuery",
618
+ mode: "in-cli",
619
+ signals: {
620
+ npm: ["@google-cloud/bigquery"],
621
+ python: ["google-cloud-bigquery"],
622
+ envKeys: [/^BIGQUERY_/]
623
+ }
624
+ },
625
+ {
626
+ kind: "Redshift",
627
+ label: "Redshift",
628
+ mode: "in-cli",
629
+ signals: {
630
+ npm: ["node-redshift"],
631
+ python: ["redshift-connector"],
632
+ envKeys: [/^REDSHIFT_/]
633
+ }
634
+ },
635
+ {
636
+ kind: "MSSQL",
637
+ label: "SQL Server",
638
+ mode: "in-cli",
639
+ signals: {
640
+ npm: ["mssql", "tedious"],
641
+ python: ["pyodbc", "pymssql"],
642
+ envKeys: [/^MSSQL_/]
643
+ }
644
+ },
645
+ {
646
+ kind: "Supabase",
647
+ label: "Supabase",
648
+ mode: "in-cli",
649
+ signals: {
650
+ npm: ["@supabase/supabase-js"],
651
+ python: ["supabase"],
652
+ envKeys: [/^SUPABASE_/]
653
+ }
654
+ },
655
+ {
656
+ kind: "ClickHouse",
657
+ label: "ClickHouse",
658
+ mode: "in-cli",
659
+ signals: {
660
+ npm: ["@clickhouse/client"],
661
+ python: ["clickhouse-connect", "clickhouse-driver"],
662
+ envKeys: [/^CLICKHOUSE_/]
663
+ }
664
+ },
665
+ {
666
+ kind: "Convex",
667
+ label: "Convex",
668
+ mode: "in-cli",
669
+ signals: {
670
+ npm: ["convex"],
671
+ python: ["convex"],
672
+ envKeys: [/^CONVEX_/, /^NEXT_PUBLIC_CONVEX_URL$/]
673
+ }
674
+ },
675
+ {
676
+ kind: "Firebase",
677
+ label: "Firebase",
678
+ mode: "deep-link",
679
+ signals: {
680
+ npm: ["firebase-admin", "firebase"],
681
+ python: ["firebase-admin"],
682
+ envKeys: [/^FIREBASE_/, /^NEXT_PUBLIC_FIREBASE_/]
683
+ }
684
+ },
685
+ {
686
+ kind: "Neon",
687
+ label: "Neon",
688
+ mode: "in-cli",
689
+ signals: {
690
+ npm: ["@neondatabase/serverless"],
691
+ envKeys: [/^NEON_/]
692
+ }
693
+ },
694
+ {
695
+ kind: "PlanetScaleMySQL",
696
+ label: "PlanetScale MySQL",
697
+ mode: "in-cli",
698
+ signals: {
699
+ npm: ["@planetscale/database"],
700
+ envKeys: [/^PLANETSCALE_/]
701
+ }
702
+ },
703
+ {
704
+ kind: "DynamoDB",
705
+ label: "DynamoDB",
706
+ mode: "in-cli",
707
+ signals: {
708
+ npm: ["@aws-sdk/client-dynamodb", "@aws-sdk/lib-dynamodb"],
709
+ python: ["pynamodb"]
710
+ }
711
+ },
712
+ {
713
+ kind: "Motherduck",
714
+ label: "MotherDuck",
715
+ mode: "in-cli",
716
+ signals: {
717
+ npm: ["@motherduck/wasm-client"],
718
+ envKeys: [/^MOTHERDUCK_/]
719
+ }
720
+ },
721
+ {
722
+ kind: "Databricks",
723
+ label: "Databricks",
724
+ mode: "in-cli",
725
+ signals: {
726
+ npm: ["@databricks/sql"],
727
+ python: ["databricks-sql-connector", "databricks-sdk"],
728
+ envKeys: [/^DATABRICKS_/]
729
+ }
730
+ },
731
+ {
732
+ kind: "Singlestore",
733
+ label: "SingleStore",
734
+ mode: "in-cli",
735
+ signals: {
736
+ python: ["singlestoredb"],
737
+ envKeys: [/^SINGLESTORE_/]
738
+ }
739
+ },
740
+ {
741
+ kind: "Stripe",
742
+ label: "Stripe",
743
+ mode: "in-cli",
744
+ signals: {
745
+ npm: [
746
+ "stripe",
747
+ "@stripe/stripe-js",
748
+ "@stripe/react-stripe-js"
749
+ ],
750
+ python: ["stripe"],
751
+ ruby: ["stripe"],
752
+ envKeys: [/^STRIPE_(SECRET|API)_KEY$/]
753
+ }
754
+ },
755
+ {
756
+ kind: "Clerk",
757
+ label: "Clerk",
758
+ mode: "in-cli",
759
+ signals: {
760
+ npm: [
761
+ "@clerk/nextjs",
762
+ "@clerk/clerk-react",
763
+ "@clerk/backend",
764
+ "@clerk/express",
765
+ "@clerk/fastify",
766
+ "@clerk/remix"
767
+ ],
768
+ envKeys: [/^CLERK_SECRET_KEY$/, /^NEXT_PUBLIC_CLERK_/]
769
+ }
770
+ },
771
+ {
772
+ kind: "Resend",
773
+ label: "Resend",
774
+ mode: "in-cli",
775
+ signals: {
776
+ npm: ["resend"],
777
+ python: ["resend"],
778
+ envKeys: [/^RESEND_API_KEY$/]
779
+ }
780
+ },
781
+ {
782
+ kind: "Shopify",
783
+ label: "Shopify",
784
+ mode: "in-cli",
785
+ signals: {
786
+ npm: ["@shopify/shopify-api", "shopify-api-node"],
787
+ python: ["shopifyapi"],
788
+ envKeys: [/^SHOPIFY_/]
789
+ }
790
+ },
791
+ {
792
+ kind: "Klaviyo",
793
+ label: "Klaviyo",
794
+ mode: "in-cli",
795
+ signals: {
796
+ npm: ["klaviyo-api"],
797
+ python: ["klaviyo-api"],
798
+ envKeys: [/^KLAVIYO_/]
799
+ }
800
+ },
801
+ {
802
+ kind: "Chargebee",
803
+ label: "Chargebee",
804
+ mode: "in-cli",
805
+ signals: {
806
+ npm: ["chargebee"],
807
+ python: ["chargebee"],
808
+ envKeys: [/^CHARGEBEE_/]
809
+ }
810
+ },
811
+ {
812
+ kind: "Paddle",
813
+ label: "Paddle",
814
+ mode: "in-cli",
815
+ signals: {
816
+ npm: ["@paddle/paddle-node-sdk", "@paddle/paddle-js"],
817
+ envKeys: [/^PADDLE_/]
818
+ }
819
+ },
820
+ {
821
+ kind: "Polar",
822
+ label: "Polar",
823
+ mode: "in-cli",
824
+ signals: {
825
+ npm: ["@polar-sh/sdk", "@polar-sh/nextjs"],
826
+ envKeys: [/^POLAR_/]
827
+ }
828
+ },
829
+ {
830
+ kind: "Mailchimp",
831
+ label: "Mailchimp",
832
+ mode: "in-cli",
833
+ signals: {
834
+ npm: ["@mailchimp/mailchimp_marketing"],
835
+ python: ["mailchimp-marketing"],
836
+ envKeys: [/^MAILCHIMP_/]
837
+ }
838
+ },
839
+ {
840
+ kind: "CustomerIO",
841
+ label: "Customer.io",
842
+ mode: "in-cli",
843
+ signals: {
844
+ npm: ["customerio-node"],
845
+ python: ["customerio"],
846
+ envKeys: [/^CUSTOMER_?IO_/]
847
+ }
848
+ },
849
+ {
850
+ kind: "Typeform",
851
+ label: "Typeform",
852
+ mode: "in-cli",
853
+ signals: {
854
+ npm: ["@typeform/api-client"],
855
+ envKeys: [/^TYPEFORM_/]
856
+ }
857
+ },
858
+ {
859
+ kind: "Sentry",
860
+ label: "Sentry",
861
+ mode: "in-cli",
862
+ signals: {
863
+ npm: [
864
+ "@sentry/node",
865
+ "@sentry/browser",
866
+ "@sentry/react",
867
+ "@sentry/nextjs"
868
+ ],
869
+ python: ["sentry-sdk"],
870
+ ruby: ["sentry-ruby"]
871
+ }
872
+ },
873
+ {
874
+ kind: "Plaid",
875
+ label: "Plaid",
876
+ mode: "in-cli",
877
+ signals: {
878
+ npm: ["plaid"],
879
+ python: ["plaid-python", "plaid"],
880
+ ruby: ["plaid"],
881
+ envKeys: [/^PLAID_/]
882
+ }
883
+ },
884
+ {
885
+ kind: "Braintree",
886
+ label: "Braintree",
887
+ mode: "in-cli",
888
+ signals: {
889
+ npm: ["braintree"],
890
+ python: ["braintree"],
891
+ ruby: ["braintree"],
892
+ envKeys: [/^BRAINTREE_/]
893
+ }
894
+ },
895
+ {
896
+ kind: "Square",
897
+ label: "Square",
898
+ mode: "in-cli",
899
+ signals: {
900
+ npm: ["square"],
901
+ python: ["squareup"],
902
+ ruby: ["square"],
903
+ envKeys: [/^SQUARE_/]
904
+ }
905
+ },
906
+ {
907
+ kind: "GoCardless",
908
+ label: "GoCardless",
909
+ mode: "in-cli",
910
+ signals: {
911
+ npm: ["gocardless-nodejs"],
912
+ python: ["gocardless-pro"],
913
+ ruby: ["gocardless_pro"],
914
+ envKeys: [/^GOCARDLESS_/]
915
+ }
916
+ },
917
+ {
918
+ kind: "Mollie",
919
+ label: "Mollie",
920
+ mode: "in-cli",
921
+ signals: {
922
+ npm: ["@mollie/api-client"],
923
+ python: ["mollie-api-python"],
924
+ envKeys: [/^MOLLIE_/]
925
+ }
926
+ },
927
+ {
928
+ kind: "CheckoutCom",
929
+ label: "Checkout.com",
930
+ mode: "in-cli",
931
+ signals: {
932
+ npm: ["checkout-sdk-node"],
933
+ python: ["checkout-sdk"],
934
+ envKeys: [/^CKO_/, /^CHECKOUT_COM_/]
935
+ }
936
+ },
937
+ {
938
+ kind: "Recurly",
939
+ label: "Recurly",
940
+ mode: "in-cli",
941
+ signals: {
942
+ npm: ["recurly"],
943
+ python: ["recurly"],
944
+ ruby: ["recurly"],
945
+ envKeys: [/^RECURLY_/]
946
+ }
947
+ },
948
+ {
949
+ kind: "RevenueCat",
950
+ label: "RevenueCat",
951
+ mode: "in-cli",
952
+ signals: {
953
+ npm: [
954
+ "@revenuecat/purchases-js",
955
+ "react-native-purchases",
956
+ "@revenuecat/purchases-capacitor"
957
+ ],
958
+ envKeys: [/^REVENUE_?CAT_/]
959
+ }
960
+ },
961
+ {
962
+ kind: "Twilio",
963
+ label: "Twilio",
964
+ mode: "in-cli",
965
+ signals: {
966
+ npm: ["twilio"],
967
+ python: ["twilio"],
968
+ ruby: ["twilio-ruby"],
969
+ envKeys: [/^TWILIO_/]
970
+ }
971
+ },
972
+ {
973
+ kind: "SendGrid",
974
+ label: "SendGrid",
975
+ mode: "in-cli",
976
+ signals: {
977
+ npm: ["@sendgrid/mail", "@sendgrid/client"],
978
+ python: ["sendgrid"],
979
+ ruby: ["sendgrid-ruby"],
980
+ envKeys: [/^SENDGRID_/]
981
+ }
982
+ },
983
+ {
984
+ kind: "Mailgun",
985
+ label: "Mailgun",
986
+ mode: "in-cli",
987
+ signals: {
988
+ npm: ["mailgun.js", "mailgun-js"],
989
+ python: ["mailgun"],
990
+ ruby: ["mailgun-ruby"],
991
+ envKeys: [/^MAILGUN_/]
992
+ }
993
+ },
994
+ {
995
+ kind: "Postmark",
996
+ label: "Postmark",
997
+ mode: "in-cli",
998
+ signals: {
999
+ npm: ["postmark"],
1000
+ python: ["postmarker"],
1001
+ ruby: ["postmark"],
1002
+ envKeys: [/^POSTMARK_/]
1003
+ }
1004
+ },
1005
+ {
1006
+ kind: "Brevo",
1007
+ label: "Brevo",
1008
+ mode: "in-cli",
1009
+ signals: {
1010
+ npm: ["@getbrevo/brevo", "sib-api-v3-sdk"],
1011
+ python: ["sib-api-v3-sdk"],
1012
+ envKeys: [/^BREVO_/]
1013
+ }
1014
+ },
1015
+ {
1016
+ kind: "MailerLite",
1017
+ label: "MailerLite",
1018
+ mode: "in-cli",
1019
+ signals: {
1020
+ npm: ["@mailerlite/mailerlite-nodejs"],
1021
+ python: ["mailerlite"],
1022
+ envKeys: [/^MAILERLITE_/]
1023
+ }
1024
+ },
1025
+ {
1026
+ kind: "Mailjet",
1027
+ label: "Mailjet",
1028
+ mode: "in-cli",
1029
+ signals: {
1030
+ npm: ["node-mailjet"],
1031
+ python: ["mailjet-rest"],
1032
+ envKeys: [/^MAILJET_/, /^MJ_APIKEY_/]
1033
+ }
1034
+ },
1035
+ {
1036
+ kind: "LaunchDarkly",
1037
+ label: "LaunchDarkly",
1038
+ mode: "in-cli",
1039
+ signals: {
1040
+ npm: [
1041
+ "launchdarkly-node-server-sdk",
1042
+ "@launchdarkly/node-server-sdk",
1043
+ "launchdarkly-js-client-sdk",
1044
+ "launchdarkly-react-client-sdk"
1045
+ ],
1046
+ python: ["launchdarkly-server-sdk"],
1047
+ ruby: ["launchdarkly-server-sdk"],
1048
+ envKeys: [/^LAUNCHDARKLY_/, /^LD_SDK_KEY$/]
1049
+ }
1050
+ },
1051
+ {
1052
+ kind: "Optimizely",
1053
+ label: "Optimizely",
1054
+ mode: "in-cli",
1055
+ signals: {
1056
+ npm: ["@optimizely/optimizely-sdk"],
1057
+ python: ["optimizely-sdk"],
1058
+ envKeys: [/^OPTIMIZELY_/]
1059
+ }
1060
+ },
1061
+ {
1062
+ kind: "Braze",
1063
+ label: "Braze",
1064
+ mode: "in-cli",
1065
+ signals: {
1066
+ npm: ["@braze/web-sdk", "@braze/react-native-sdk"],
1067
+ python: ["braze-client"],
1068
+ envKeys: [/^BRAZE_/]
1069
+ }
1070
+ },
1071
+ {
1072
+ kind: "Rollbar",
1073
+ label: "Rollbar",
1074
+ mode: "in-cli",
1075
+ signals: {
1076
+ npm: ["rollbar"],
1077
+ python: ["rollbar", "pyrollbar"],
1078
+ ruby: ["rollbar"],
1079
+ envKeys: [/^ROLLBAR_/]
1080
+ }
1081
+ },
1082
+ {
1083
+ kind: "Okta",
1084
+ label: "Okta",
1085
+ mode: "in-cli",
1086
+ signals: {
1087
+ npm: [
1088
+ "@okta/okta-sdk-nodejs",
1089
+ "@okta/okta-auth-js",
1090
+ "@okta/okta-react"
1091
+ ],
1092
+ python: ["okta"],
1093
+ envKeys: [/^OKTA_/]
1094
+ }
1095
+ },
1096
+ {
1097
+ kind: "WorkOS",
1098
+ label: "WorkOS",
1099
+ mode: "in-cli",
1100
+ signals: {
1101
+ npm: ["@workos-inc/node"],
1102
+ python: ["workos"],
1103
+ envKeys: [/^WORKOS_/]
1104
+ }
1105
+ },
1106
+ {
1107
+ kind: "Notion",
1108
+ label: "Notion",
1109
+ mode: "in-cli",
1110
+ signals: {
1111
+ npm: ["@notionhq/client"],
1112
+ python: ["notion-client"],
1113
+ envKeys: [/^NOTION_/]
1114
+ }
1115
+ },
1116
+ {
1117
+ kind: "FullStory",
1118
+ label: "FullStory",
1119
+ mode: "in-cli",
1120
+ signals: {
1121
+ npm: ["@fullstory/browser", "@fullstory/react-native"],
1122
+ envKeys: [/^FULLSTORY_/]
1123
+ }
1124
+ },
1125
+ {
1126
+ kind: "Amplitude",
1127
+ label: "Amplitude",
1128
+ mode: "in-cli",
1129
+ signals: {
1130
+ npm: [
1131
+ "@amplitude/analytics-browser",
1132
+ "@amplitude/analytics-node",
1133
+ "@amplitude/analytics-react-native",
1134
+ "amplitude-js"
1135
+ ],
1136
+ python: ["amplitude-analytics"],
1137
+ envKeys: [/^AMPLITUDE_/]
1138
+ }
1139
+ },
1140
+ {
1141
+ kind: "Mixpanel",
1142
+ label: "Mixpanel",
1143
+ mode: "in-cli",
1144
+ signals: {
1145
+ npm: ["mixpanel", "mixpanel-browser"],
1146
+ python: ["mixpanel"],
1147
+ ruby: ["mixpanel-ruby"],
1148
+ envKeys: [/^MIXPANEL_/]
1149
+ }
1150
+ },
1151
+ {
1152
+ kind: "Pendo",
1153
+ label: "Pendo",
1154
+ mode: "in-cli",
1155
+ signals: {
1156
+ npm: ["@pendo/agent"],
1157
+ envKeys: [/^PENDO_/]
1158
+ }
1159
+ },
1160
+ {
1161
+ kind: "Salesforce",
1162
+ label: "Salesforce",
1163
+ mode: "deep-link",
1164
+ signals: {
1165
+ npm: ["jsforce"],
1166
+ python: ["simple-salesforce"],
1167
+ envKeys: [/^SALESFORCE_/]
1168
+ }
1169
+ },
1170
+ {
1171
+ kind: "Hubspot",
1172
+ label: "HubSpot",
1173
+ mode: "deep-link",
1174
+ signals: {
1175
+ npm: ["@hubspot/api-client"],
1176
+ python: ["hubspot-api-client"],
1177
+ envKeys: [/^HUBSPOT_/]
1178
+ }
1179
+ },
1180
+ {
1181
+ kind: "Zendesk",
1182
+ label: "Zendesk",
1183
+ mode: "deep-link",
1184
+ signals: {
1185
+ npm: ["node-zendesk"],
1186
+ python: ["zenpy"],
1187
+ envKeys: [/^ZENDESK_/]
1188
+ }
1189
+ },
1190
+ {
1191
+ kind: "Intercom",
1192
+ label: "Intercom",
1193
+ mode: "deep-link",
1194
+ signals: {
1195
+ npm: ["intercom-client", "@intercom/messenger-js-sdk"],
1196
+ python: ["python-intercom"],
1197
+ envKeys: [/^INTERCOM_/]
1198
+ }
1199
+ },
1200
+ {
1201
+ kind: "Linear",
1202
+ label: "Linear",
1203
+ mode: "deep-link",
1204
+ signals: {
1205
+ npm: ["@linear/sdk"],
1206
+ envKeys: [/^LINEAR_API_KEY$/]
1207
+ }
1208
+ },
1209
+ {
1210
+ kind: "Slack",
1211
+ label: "Slack",
1212
+ mode: "deep-link",
1213
+ signals: {
1214
+ npm: ["@slack/web-api", "@slack/bolt"],
1215
+ python: ["slack-sdk", "slack-bolt"],
1216
+ envKeys: [/^SLACK_(BOT|APP|SIGNING|CLIENT)_/]
1217
+ }
1218
+ },
1219
+ {
1220
+ kind: "Github",
1221
+ label: "GitHub",
1222
+ mode: "deep-link",
1223
+ signals: {
1224
+ npm: [
1225
+ "@octokit/rest",
1226
+ "@octokit/core",
1227
+ "@octokit/graphql",
1228
+ "octokit"
1229
+ ],
1230
+ python: ["pygithub"],
1231
+ ruby: ["octokit"]
1232
+ }
1233
+ }
1234
+ ];
1235
+ const LLM_SOURCE_DETECTORS = [
1236
+ {
1237
+ kind: "OpenAI",
1238
+ label: "OpenAI",
1239
+ mode: "in-cli",
1240
+ signals: {
1241
+ npm: ["openai"],
1242
+ python: ["openai"],
1243
+ envKeys: [/^OPENAI_/]
1244
+ }
1245
+ },
1246
+ {
1247
+ kind: "Anthropic",
1248
+ label: "Anthropic",
1249
+ mode: "in-cli",
1250
+ signals: {
1251
+ npm: ["@anthropic-ai/sdk"],
1252
+ python: ["anthropic"],
1253
+ envKeys: [/^ANTHROPIC_/]
1254
+ }
1255
+ },
1256
+ {
1257
+ kind: "Cohere",
1258
+ label: "Cohere",
1259
+ mode: "in-cli",
1260
+ signals: {
1261
+ npm: ["cohere-ai"],
1262
+ python: ["cohere"],
1263
+ envKeys: [/^COHERE_/]
1264
+ }
1265
+ },
1266
+ {
1267
+ kind: "MistralAI",
1268
+ label: "Mistral AI",
1269
+ mode: "in-cli",
1270
+ signals: {
1271
+ npm: ["@mistralai/mistralai"],
1272
+ python: ["mistralai"],
1273
+ envKeys: [/^MISTRAL_/]
1274
+ }
1275
+ },
1276
+ {
1277
+ kind: "Groq",
1278
+ label: "Groq",
1279
+ mode: "in-cli",
1280
+ signals: {
1281
+ npm: ["groq-sdk"],
1282
+ python: ["groq"],
1283
+ envKeys: [/^GROQ_/]
1284
+ }
1285
+ },
1286
+ {
1287
+ kind: "TogetherAI",
1288
+ label: "Together AI",
1289
+ mode: "in-cli",
1290
+ signals: {
1291
+ npm: ["together-ai"],
1292
+ python: ["together"],
1293
+ envKeys: [/^TOGETHER_/]
1294
+ }
1295
+ },
1296
+ {
1297
+ kind: "FireworksAI",
1298
+ label: "Fireworks AI",
1299
+ mode: "in-cli",
1300
+ signals: {
1301
+ python: ["fireworks-ai"],
1302
+ envKeys: [/^FIREWORKS_/]
1303
+ }
1304
+ },
1305
+ {
1306
+ kind: "Replicate",
1307
+ label: "Replicate",
1308
+ mode: "in-cli",
1309
+ signals: {
1310
+ npm: ["replicate"],
1311
+ python: ["replicate"],
1312
+ envKeys: [/^REPLICATE_/]
1313
+ }
1314
+ },
1315
+ {
1316
+ kind: "HuggingFace",
1317
+ label: "Hugging Face",
1318
+ mode: "in-cli",
1319
+ signals: {
1320
+ npm: ["@huggingface/inference"],
1321
+ python: ["huggingface-hub"],
1322
+ envKeys: [/^HUGGINGFACE_/, /^HF_TOKEN$/]
1323
+ }
1324
+ },
1325
+ {
1326
+ kind: "ElevenLabs",
1327
+ label: "ElevenLabs",
1328
+ mode: "in-cli",
1329
+ signals: {
1330
+ npm: ["@elevenlabs/elevenlabs-js", "elevenlabs"],
1331
+ python: ["elevenlabs"],
1332
+ envKeys: [/^ELEVENLABS_/, /^ELEVEN_LABS_/]
1333
+ }
1334
+ },
1335
+ {
1336
+ kind: "Deepgram",
1337
+ label: "Deepgram",
1338
+ mode: "in-cli",
1339
+ signals: {
1340
+ npm: ["@deepgram/sdk"],
1341
+ python: ["deepgram-sdk"],
1342
+ envKeys: [/^DEEPGRAM_/]
1343
+ }
1344
+ },
1345
+ {
1346
+ kind: "AssemblyAI",
1347
+ label: "AssemblyAI",
1348
+ mode: "in-cli",
1349
+ signals: {
1350
+ npm: ["assemblyai"],
1351
+ python: ["assemblyai"],
1352
+ envKeys: [/^ASSEMBLYAI_/]
1353
+ }
1354
+ },
1355
+ {
1356
+ kind: "Langfuse",
1357
+ label: "Langfuse",
1358
+ mode: "in-cli",
1359
+ signals: {
1360
+ npm: ["langfuse"],
1361
+ python: ["langfuse"],
1362
+ envKeys: [/^LANGFUSE_/]
1363
+ }
1364
+ },
1365
+ {
1366
+ kind: "LangSmith",
1367
+ label: "LangSmith",
1368
+ mode: "in-cli",
1369
+ signals: {
1370
+ npm: ["langsmith"],
1371
+ python: ["langsmith"],
1372
+ envKeys: [/^LANGSMITH_/, /^LANGCHAIN_API_KEY$/]
1373
+ }
1374
+ },
1375
+ {
1376
+ kind: "Firecrawl",
1377
+ label: "Firecrawl",
1378
+ mode: "in-cli",
1379
+ signals: {
1380
+ npm: ["@mendable/firecrawl-js"],
1381
+ python: ["firecrawl-py"],
1382
+ envKeys: [/^FIRECRAWL_/]
1383
+ }
1384
+ },
1385
+ {
1386
+ kind: "Mem0",
1387
+ label: "Mem0",
1388
+ mode: "in-cli",
1389
+ signals: {
1390
+ npm: ["mem0ai"],
1391
+ python: ["mem0ai"],
1392
+ envKeys: [/^MEM0_/]
1393
+ }
1394
+ },
1395
+ {
1396
+ kind: "Vellum",
1397
+ label: "Vellum",
1398
+ mode: "in-cli",
1399
+ signals: {
1400
+ npm: ["vellum-ai"],
1401
+ python: ["vellum-ai"],
1402
+ envKeys: [/^VELLUM_/]
1403
+ }
1404
+ },
1405
+ {
1406
+ kind: "Helicone",
1407
+ label: "Helicone",
1408
+ mode: "in-cli",
1409
+ signals: {
1410
+ npm: ["@helicone/helpers"],
1411
+ envKeys: [/^HELICONE_/]
1412
+ }
1413
+ },
1414
+ {
1415
+ kind: "OpenRouter",
1416
+ label: "OpenRouter",
1417
+ mode: "in-cli",
1418
+ signals: {
1419
+ npm: ["@openrouter/ai-sdk-provider"],
1420
+ envKeys: [/^OPENROUTER_/]
1421
+ }
1422
+ },
1423
+ {
1424
+ kind: "Browserbase",
1425
+ label: "Browserbase",
1426
+ mode: "in-cli",
1427
+ signals: {
1428
+ npm: ["@browserbasehq/sdk", "@browserbasehq/stagehand"],
1429
+ python: ["browserbase"],
1430
+ envKeys: [/^BROWSERBASE_/]
1431
+ }
1432
+ },
1433
+ {
1434
+ kind: "E2B",
1435
+ label: "E2B",
1436
+ mode: "in-cli",
1437
+ signals: {
1438
+ npm: ["e2b", "@e2b/code-interpreter"],
1439
+ python: ["e2b", "e2b-code-interpreter"],
1440
+ envKeys: [/^E2B_/]
1441
+ }
1442
+ },
1443
+ {
1444
+ kind: "WeightsAndBiases",
1445
+ label: "Weights & Biases",
1446
+ mode: "in-cli",
1447
+ signals: {
1448
+ python: ["wandb"],
1449
+ envKeys: [/^WANDB_/]
1450
+ }
1451
+ },
1452
+ {
1453
+ kind: "LlamaCloud",
1454
+ label: "LlamaCloud",
1455
+ mode: "in-cli",
1456
+ signals: {
1457
+ npm: ["llama-cloud-services"],
1458
+ python: ["llama-cloud-services"],
1459
+ envKeys: [/^LLAMA_CLOUD_/]
1460
+ }
1461
+ },
1462
+ {
1463
+ kind: "Zep",
1464
+ label: "Zep",
1465
+ mode: "in-cli",
1466
+ signals: {
1467
+ npm: ["@getzep/zep-cloud"],
1468
+ python: ["zep-cloud"],
1469
+ envKeys: [/^ZEP_API_KEY$/]
1470
+ }
1471
+ }
1472
+ ];
1473
+ const OTHER_SOURCE_DETECTORS = [
1474
+ {
1475
+ kind: "Paystack",
1476
+ label: "Paystack",
1477
+ mode: "in-cli",
1478
+ signals: {
1479
+ python: ["paystackapi"],
1480
+ envKeys: [/^PAYSTACK_/]
1481
+ }
1482
+ },
1483
+ {
1484
+ kind: "Orb",
1485
+ label: "Orb",
1486
+ mode: "in-cli",
1487
+ signals: {
1488
+ npm: ["orb-billing"],
1489
+ python: ["orb-billing"],
1490
+ envKeys: [/^ORB_/]
1491
+ }
1492
+ },
1493
+ {
1494
+ kind: "Lago",
1495
+ label: "Lago",
1496
+ mode: "in-cli",
1497
+ signals: {
1498
+ npm: ["lago-javascript-client"],
1499
+ python: ["lago-python-client"],
1500
+ envKeys: [/^LAGO_/]
1501
+ }
1502
+ },
1503
+ {
1504
+ kind: "Zuora",
1505
+ label: "Zuora",
1506
+ mode: "in-cli",
1507
+ signals: { envKeys: [/^ZUORA_/] }
1508
+ },
1509
+ {
1510
+ kind: "Stigg",
1511
+ label: "Stigg",
1512
+ mode: "in-cli",
1513
+ signals: {
1514
+ npm: ["@stigg/node-server-sdk"],
1515
+ envKeys: [/^STIGG_/]
1516
+ }
1517
+ },
1518
+ {
1519
+ kind: "Ramp",
1520
+ label: "Ramp",
1521
+ mode: "in-cli",
1522
+ signals: { envKeys: [/^RAMP_/] }
1523
+ },
1524
+ {
1525
+ kind: "Brex",
1526
+ label: "Brex",
1527
+ mode: "in-cli",
1528
+ signals: { envKeys: [/^BREX_/] }
1529
+ },
1530
+ {
1531
+ kind: "Tremendous",
1532
+ label: "Tremendous",
1533
+ mode: "in-cli",
1534
+ signals: { envKeys: [/^TREMENDOUS_/] }
1535
+ },
1536
+ {
1537
+ kind: "Maxio",
1538
+ label: "Maxio",
1539
+ mode: "in-cli",
1540
+ signals: { envKeys: [/^MAXIO_/] }
1541
+ },
1542
+ {
1543
+ kind: "Chargify",
1544
+ label: "Chargify",
1545
+ mode: "in-cli",
1546
+ signals: { envKeys: [/^CHARGIFY_/] }
1547
+ },
1548
+ {
1549
+ kind: "Invoiced",
1550
+ label: "Invoiced",
1551
+ mode: "in-cli",
1552
+ signals: {
1553
+ npm: ["invoiced"],
1554
+ python: ["invoiced"],
1555
+ envKeys: [/^INVOICED_/]
1556
+ }
1557
+ },
1558
+ {
1559
+ kind: "LemonSqueezy",
1560
+ label: "Lemon Squeezy",
1561
+ mode: "in-cli",
1562
+ signals: {
1563
+ npm: ["@lemonsqueezy/lemonsqueezy.js"],
1564
+ envKeys: [/^LEMONSQUEEZY_/, /^LEMON_SQUEEZY_/]
1565
+ }
1566
+ },
1567
+ {
1568
+ kind: "Razorpay",
1569
+ label: "Razorpay",
1570
+ mode: "in-cli",
1571
+ signals: {
1572
+ npm: ["razorpay"],
1573
+ python: ["razorpay"],
1574
+ ruby: ["razorpay"],
1575
+ envKeys: [/^RAZORPAY_/]
1576
+ }
1577
+ },
1578
+ {
1579
+ kind: "Adyen",
1580
+ label: "Adyen",
1581
+ mode: "in-cli",
1582
+ signals: {
1583
+ npm: ["@adyen/api-library"],
1584
+ python: ["adyen"],
1585
+ envKeys: [/^ADYEN_/]
1586
+ }
1587
+ },
1588
+ {
1589
+ kind: "ChartMogul",
1590
+ label: "ChartMogul",
1591
+ mode: "in-cli",
1592
+ signals: {
1593
+ npm: ["chartmogul-node"],
1594
+ python: ["chartmogul"],
1595
+ envKeys: [/^CHARTMOGUL_/]
1596
+ }
1597
+ },
1598
+ {
1599
+ kind: "Airwallex",
1600
+ label: "Airwallex",
1601
+ mode: "in-cli",
1602
+ signals: {
1603
+ npm: ["airwallex-payment-elements"],
1604
+ envKeys: [/^AIRWALLEX_/]
1605
+ }
1606
+ },
1607
+ {
1608
+ kind: "Flutterwave",
1609
+ label: "Flutterwave",
1610
+ mode: "in-cli",
1611
+ signals: {
1612
+ npm: ["flutterwave-node-v3"],
1613
+ python: ["flutterwave"],
1614
+ envKeys: [/^FLUTTERWAVE_/, /^FLW_(PUBLIC|SECRET)_KEY$/]
1615
+ }
1616
+ },
1617
+ {
1618
+ kind: "DodoPayments",
1619
+ label: "Dodo Payments",
1620
+ mode: "in-cli",
1621
+ signals: {
1622
+ npm: ["dodopayments"],
1623
+ python: ["dodopayments"],
1624
+ envKeys: [/^DODO_PAYMENTS_/]
1625
+ }
1626
+ },
1627
+ {
1628
+ kind: "Whop",
1629
+ label: "Whop",
1630
+ mode: "in-cli",
1631
+ signals: {
1632
+ npm: ["@whop/api", "@whop-apps/sdk"],
1633
+ envKeys: [/^WHOP_/]
1634
+ }
1635
+ },
1636
+ {
1637
+ kind: "SparkPost",
1638
+ label: "SparkPost",
1639
+ mode: "in-cli",
1640
+ signals: {
1641
+ npm: ["sparkpost"],
1642
+ python: ["sparkpost"],
1643
+ envKeys: [/^SPARKPOST_/]
1644
+ }
1645
+ },
1646
+ {
1647
+ kind: "MailerSend",
1648
+ label: "MailerSend",
1649
+ mode: "in-cli",
1650
+ signals: {
1651
+ npm: ["mailersend"],
1652
+ python: ["mailersend"],
1653
+ envKeys: [/^MAILERSEND_/]
1654
+ }
1655
+ },
1656
+ {
1657
+ kind: "Iterable",
1658
+ label: "Iterable",
1659
+ mode: "in-cli",
1660
+ signals: { envKeys: [/^ITERABLE_/] }
1661
+ },
1662
+ {
1663
+ kind: "ConvertKit",
1664
+ label: "ConvertKit",
1665
+ mode: "in-cli",
1666
+ signals: { envKeys: [/^CONVERTKIT_/] }
1667
+ },
1668
+ {
1669
+ kind: "Drip",
1670
+ label: "Drip",
1671
+ mode: "in-cli",
1672
+ signals: {
1673
+ npm: ["drip-nodejs"],
1674
+ envKeys: [/^DRIP_/]
1675
+ }
1676
+ },
1677
+ {
1678
+ kind: "Omnisend",
1679
+ label: "Omnisend",
1680
+ mode: "in-cli",
1681
+ signals: { envKeys: [/^OMNISEND_/] }
1682
+ },
1683
+ {
1684
+ kind: "EmailOctopus",
1685
+ label: "EmailOctopus",
1686
+ mode: "in-cli",
1687
+ signals: { envKeys: [/^EMAILOCTOPUS_/, /^EMAIL_OCTOPUS_/] }
1688
+ },
1689
+ {
1690
+ kind: "Elasticemail",
1691
+ label: "Elastic Email",
1692
+ mode: "in-cli",
1693
+ signals: { envKeys: [/^ELASTICEMAIL_/, /^ELASTIC_EMAIL_/] }
1694
+ },
1695
+ {
1696
+ kind: "CampaignMonitor",
1697
+ label: "Campaign Monitor",
1698
+ mode: "in-cli",
1699
+ signals: {
1700
+ npm: ["createsend-node"],
1701
+ envKeys: [/^CAMPAIGN_MONITOR_/, /^CREATESEND_/]
1702
+ }
1703
+ },
1704
+ {
1705
+ kind: "Lemlist",
1706
+ label: "Lemlist",
1707
+ mode: "in-cli",
1708
+ signals: { envKeys: [/^LEMLIST_/] }
1709
+ },
1710
+ {
1711
+ kind: "Loops",
1712
+ label: "Loops",
1713
+ mode: "in-cli",
1714
+ signals: {
1715
+ npm: ["loops"],
1716
+ envKeys: [/^LOOPS_/]
1717
+ }
1718
+ },
1719
+ {
1720
+ kind: "Knock",
1721
+ label: "Knock",
1722
+ mode: "in-cli",
1723
+ signals: {
1724
+ npm: ["@knocklabs/node", "@knocklabs/client"],
1725
+ python: ["knockapi"],
1726
+ envKeys: [/^KNOCK_/]
1727
+ }
1728
+ },
1729
+ {
1730
+ kind: "AwsSes",
1731
+ label: "Amazon SES",
1732
+ mode: "in-cli",
1733
+ signals: {
1734
+ npm: ["@aws-sdk/client-ses", "@aws-sdk/client-sesv2"],
1735
+ envKeys: [/^AWS_SES_/]
1736
+ }
1737
+ },
1738
+ {
1739
+ kind: "Beehiiv",
1740
+ label: "beehiiv",
1741
+ mode: "in-cli",
1742
+ signals: { envKeys: [/^BEEHIIV_/] }
1743
+ },
1744
+ {
1745
+ kind: "Mailtrap",
1746
+ label: "Mailtrap",
1747
+ mode: "in-cli",
1748
+ signals: {
1749
+ npm: ["mailtrap"],
1750
+ python: ["mailtrap"],
1751
+ envKeys: [/^MAILTRAP_/]
1752
+ }
1753
+ },
1754
+ {
1755
+ kind: "Plunk",
1756
+ label: "Plunk",
1757
+ mode: "in-cli",
1758
+ signals: {
1759
+ npm: ["@plunk/node"],
1760
+ envKeys: [/^PLUNK_/]
1761
+ }
1762
+ },
1763
+ {
1764
+ kind: "Ortto",
1765
+ label: "Ortto",
1766
+ mode: "in-cli",
1767
+ signals: { envKeys: [/^ORTTO_/] }
1768
+ },
1769
+ {
1770
+ kind: "Postscript",
1771
+ label: "Postscript",
1772
+ mode: "in-cli",
1773
+ signals: { envKeys: [/^POSTSCRIPT_/] }
1774
+ },
1775
+ {
1776
+ kind: "Marketo",
1777
+ label: "Marketo",
1778
+ mode: "in-cli",
1779
+ signals: {
1780
+ python: ["marketorestpython"],
1781
+ envKeys: [/^MARKETO_/]
1782
+ }
1783
+ },
1784
+ {
1785
+ kind: "Lob",
1786
+ label: "Lob",
1787
+ mode: "in-cli",
1788
+ signals: {
1789
+ npm: ["lob"],
1790
+ python: ["lob"],
1791
+ envKeys: [/^LOB_API_KEY$/]
1792
+ }
1793
+ },
1794
+ {
1795
+ kind: "Segment",
1796
+ label: "Segment",
1797
+ mode: "in-cli",
1798
+ signals: {
1799
+ npm: ["@segment/analytics-node", "analytics-node"],
1800
+ python: ["segment-analytics-python", "analytics-python"],
1801
+ envKeys: [/^SEGMENT_/]
1802
+ }
1803
+ },
1804
+ {
1805
+ kind: "Snowplow",
1806
+ label: "Snowplow Analytics",
1807
+ mode: "in-cli",
1808
+ signals: {
1809
+ npm: ["@snowplow/node-tracker"],
1810
+ python: ["snowplow-tracker"],
1811
+ envKeys: [/^SNOWPLOW_/]
1812
+ }
1813
+ },
1814
+ {
1815
+ kind: "Matomo",
1816
+ label: "Matomo",
1817
+ mode: "in-cli",
1818
+ signals: {
1819
+ npm: ["matomo-tracker"],
1820
+ envKeys: [/^MATOMO_/]
1821
+ }
1822
+ },
1823
+ {
1824
+ kind: "Plausible",
1825
+ label: "Plausible",
1826
+ mode: "in-cli",
1827
+ signals: {
1828
+ npm: ["plausible-tracker"],
1829
+ envKeys: [/^PLAUSIBLE_/]
1830
+ }
1831
+ },
1832
+ {
1833
+ kind: "ConfigCat",
1834
+ label: "ConfigCat",
1835
+ mode: "in-cli",
1836
+ signals: {
1837
+ npm: ["configcat-node", "configcat-js"],
1838
+ python: ["configcat-client"],
1839
+ envKeys: [/^CONFIGCAT_/]
1840
+ }
1841
+ },
1842
+ {
1843
+ kind: "Flagsmith",
1844
+ label: "Flagsmith",
1845
+ mode: "in-cli",
1846
+ signals: {
1847
+ npm: ["flagsmith-nodejs", "flagsmith"],
1848
+ python: ["flagsmith"],
1849
+ envKeys: [/^FLAGSMITH_/]
1850
+ }
1851
+ },
1852
+ {
1853
+ kind: "Unleash",
1854
+ label: "Unleash",
1855
+ mode: "in-cli",
1856
+ signals: {
1857
+ npm: ["unleash-client"],
1858
+ python: ["unleashclient"],
1859
+ envKeys: [/^UNLEASH_/]
1860
+ }
1861
+ },
1862
+ {
1863
+ kind: "SplitIo",
1864
+ label: "Split.io",
1865
+ mode: "in-cli",
1866
+ signals: {
1867
+ npm: ["@splitsoftware/splitio"],
1868
+ python: ["splitio-client"],
1869
+ envKeys: [/^SPLITIO_/, /^SPLIT_IO_/]
1870
+ }
1871
+ },
1872
+ {
1873
+ kind: "Stytch",
1874
+ label: "Stytch",
1875
+ mode: "in-cli",
1876
+ signals: {
1877
+ npm: ["stytch"],
1878
+ python: ["stytch"],
1879
+ envKeys: [/^STYTCH_/]
1880
+ }
1881
+ },
1882
+ {
1883
+ kind: "Doppler",
1884
+ label: "Doppler",
1885
+ mode: "in-cli",
1886
+ signals: {
1887
+ npm: ["@dopplerhq/node-sdk"],
1888
+ envKeys: [/^DOPPLER_/]
1889
+ }
1890
+ },
1891
+ {
1892
+ kind: "Infisical",
1893
+ label: "Infisical",
1894
+ mode: "in-cli",
1895
+ signals: {
1896
+ npm: ["@infisical/sdk"],
1897
+ python: ["infisicalsdk"],
1898
+ envKeys: [/^INFISICAL_/]
1899
+ }
1900
+ },
1901
+ {
1902
+ kind: "OnePassword",
1903
+ label: "1Password",
1904
+ mode: "in-cli",
1905
+ signals: {
1906
+ npm: ["@1password/sdk"],
1907
+ python: ["onepassword-sdk"],
1908
+ envKeys: [/^ONEPASSWORD_/, /^OP_SERVICE_ACCOUNT_TOKEN$/]
1909
+ }
1910
+ },
1911
+ {
1912
+ kind: "Persona",
1913
+ label: "Persona",
1914
+ mode: "in-cli",
1915
+ signals: { envKeys: [/^PERSONA_/] }
1916
+ },
1917
+ {
1918
+ kind: "Svix",
1919
+ label: "Svix",
1920
+ mode: "in-cli",
1921
+ signals: {
1922
+ npm: ["svix"],
1923
+ python: ["svix"],
1924
+ envKeys: [/^SVIX_/]
1925
+ }
1926
+ },
1927
+ {
1928
+ kind: "Mux",
1929
+ label: "Mux",
1930
+ mode: "in-cli",
1931
+ signals: {
1932
+ npm: ["@mux/mux-node"],
1933
+ python: ["mux-python"],
1934
+ envKeys: [/^MUX_/]
1935
+ }
1936
+ },
1937
+ {
1938
+ kind: "Vapi",
1939
+ label: "Vapi",
1940
+ mode: "in-cli",
1941
+ signals: {
1942
+ npm: ["@vapi-ai/server-sdk"],
1943
+ python: ["vapi-server-sdk"],
1944
+ envKeys: [/^VAPI_/]
1945
+ }
1946
+ },
1947
+ {
1948
+ kind: "Aircall",
1949
+ label: "Aircall",
1950
+ mode: "in-cli",
1951
+ signals: { envKeys: [/^AIRCALL_/] }
1952
+ },
1953
+ {
1954
+ kind: "JustCall",
1955
+ label: "JustCall",
1956
+ mode: "in-cli",
1957
+ signals: { envKeys: [/^JUSTCALL_/] }
1958
+ },
1959
+ {
1960
+ kind: "Telnyx",
1961
+ label: "Telnyx",
1962
+ mode: "in-cli",
1963
+ signals: {
1964
+ npm: ["telnyx"],
1965
+ python: ["telnyx"],
1966
+ envKeys: [/^TELNYX_/]
1967
+ }
1968
+ },
1969
+ {
1970
+ kind: "Plivo",
1971
+ label: "Plivo",
1972
+ mode: "in-cli",
1973
+ signals: {
1974
+ npm: ["plivo"],
1975
+ python: ["plivo"],
1976
+ envKeys: [/^PLIVO_/]
1977
+ }
1978
+ },
1979
+ {
1980
+ kind: "Courier",
1981
+ label: "Courier",
1982
+ mode: "in-cli",
1983
+ signals: {
1984
+ npm: ["@trycourier/courier"],
1985
+ python: ["trycourier"],
1986
+ envKeys: [/^COURIER_AUTH_TOKEN$/]
1987
+ }
1988
+ },
1989
+ {
1990
+ kind: "WooCommerce",
1991
+ label: "WooCommerce",
1992
+ mode: "in-cli",
1993
+ signals: {
1994
+ npm: ["@woocommerce/woocommerce-rest-api"],
1995
+ python: ["woocommerce"],
1996
+ envKeys: [/^WOOCOMMERCE_/]
1997
+ }
1998
+ },
1999
+ {
2000
+ kind: "Recharge",
2001
+ label: "Recharge",
2002
+ mode: "in-cli",
2003
+ signals: { envKeys: [/^RECHARGE_/] }
2004
+ },
2005
+ {
2006
+ kind: "Commercetools",
2007
+ label: "commercetools",
2008
+ mode: "in-cli",
2009
+ signals: {
2010
+ npm: ["@commercetools/platform-sdk"],
2011
+ python: ["commercetools"],
2012
+ envKeys: [/^CTP_/, /^COMMERCETOOLS_/]
2013
+ }
2014
+ },
2015
+ {
2016
+ kind: "Webflow",
2017
+ label: "Webflow",
2018
+ mode: "in-cli",
2019
+ signals: {
2020
+ npm: ["webflow-api"],
2021
+ envKeys: [/^WEBFLOW_/]
2022
+ }
2023
+ },
2024
+ {
2025
+ kind: "Easypost",
2026
+ label: "EasyPost",
2027
+ mode: "in-cli",
2028
+ signals: {
2029
+ npm: ["@easypost/api"],
2030
+ python: ["easypost"],
2031
+ envKeys: [/^EASYPOST_/]
2032
+ }
2033
+ },
2034
+ {
2035
+ kind: "Shippo",
2036
+ label: "Shippo",
2037
+ mode: "in-cli",
2038
+ signals: {
2039
+ npm: ["shippo"],
2040
+ python: ["shippo"],
2041
+ envKeys: [/^SHIPPO_/]
2042
+ }
2043
+ },
2044
+ {
2045
+ kind: "ShipStation",
2046
+ label: "ShipStation",
2047
+ mode: "in-cli",
2048
+ signals: { envKeys: [/^SHIPSTATION_/] }
2049
+ },
2050
+ {
2051
+ kind: "Squarespace",
2052
+ label: "Squarespace",
2053
+ mode: "in-cli",
2054
+ signals: { envKeys: [/^SQUARESPACE_/] }
2055
+ },
2056
+ {
2057
+ kind: "Printify",
2058
+ label: "Printify",
2059
+ mode: "in-cli",
2060
+ signals: { envKeys: [/^PRINTIFY_/] }
2061
+ },
2062
+ {
2063
+ kind: "BigCommerce",
2064
+ label: "BigCommerce",
2065
+ mode: "in-cli",
2066
+ signals: {
2067
+ npm: ["node-bigcommerce"],
2068
+ envKeys: [/^BIGCOMMERCE_/]
2069
+ }
2070
+ },
2071
+ {
2072
+ kind: "Freshdesk",
2073
+ label: "Freshdesk",
2074
+ mode: "in-cli",
2075
+ signals: {
2076
+ python: ["python-freshdesk"],
2077
+ envKeys: [/^FRESHDESK_/]
2078
+ }
2079
+ },
2080
+ {
2081
+ kind: "Front",
2082
+ label: "Front",
2083
+ mode: "in-cli",
2084
+ signals: { envKeys: [/^FRONTAPP_/, /^FRONT_API_/] }
2085
+ },
2086
+ {
2087
+ kind: "Gorgias",
2088
+ label: "Gorgias",
2089
+ mode: "in-cli",
2090
+ signals: { envKeys: [/^GORGIAS_/] }
2091
+ },
2092
+ {
2093
+ kind: "Chatwoot",
2094
+ label: "Chatwoot",
2095
+ mode: "in-cli",
2096
+ signals: { envKeys: [/^CHATWOOT_/] }
2097
+ },
2098
+ {
2099
+ kind: "Kustomer",
2100
+ label: "Kustomer",
2101
+ mode: "in-cli",
2102
+ signals: { envKeys: [/^KUSTOMER_/] }
2103
+ },
2104
+ {
2105
+ kind: "Plain",
2106
+ label: "Plain",
2107
+ mode: "in-cli",
2108
+ signals: {
2109
+ npm: ["@team-plain/typescript-sdk"],
2110
+ envKeys: [/^PLAIN_/]
2111
+ }
2112
+ },
2113
+ {
2114
+ kind: "Canny",
2115
+ label: "Canny",
2116
+ mode: "in-cli",
2117
+ signals: { envKeys: [/^CANNY_/] }
2118
+ },
2119
+ {
2120
+ kind: "Pylon",
2121
+ label: "Pylon",
2122
+ mode: "in-cli",
2123
+ signals: { envKeys: [/^PYLON_/] }
2124
+ },
2125
+ {
2126
+ kind: "GitLab",
2127
+ label: "GitLab",
2128
+ mode: "in-cli",
2129
+ signals: {
2130
+ npm: ["@gitbeaker/rest"],
2131
+ python: ["python-gitlab"],
2132
+ ruby: ["gitlab"],
2133
+ envKeys: [/^GITLAB_/]
2134
+ }
2135
+ },
2136
+ {
2137
+ kind: "Bitbucket",
2138
+ label: "Atlassian Bitbucket Cloud",
2139
+ mode: "in-cli",
2140
+ signals: {
2141
+ npm: ["bitbucket"],
2142
+ envKeys: [/^BITBUCKET_/]
2143
+ }
2144
+ },
2145
+ {
2146
+ kind: "Gitea",
2147
+ label: "Gitea",
2148
+ mode: "in-cli",
2149
+ signals: {
2150
+ npm: ["gitea-js"],
2151
+ envKeys: [/^GITEA_/]
2152
+ }
2153
+ },
2154
+ {
2155
+ kind: "Datadog",
2156
+ label: "Datadog",
2157
+ mode: "in-cli",
2158
+ signals: {
2159
+ npm: ["@datadog/datadog-api-client", "dd-trace"],
2160
+ python: ["datadog", "datadog-api-client"],
2161
+ ruby: ["dogapi"],
2162
+ envKeys: [
2163
+ /^DATADOG_/,
2164
+ /^DD_API_KEY$/,
2165
+ /^DD_APP_KEY$/
2166
+ ]
2167
+ }
2168
+ },
2169
+ {
2170
+ kind: "NewRelic",
2171
+ label: "New Relic",
2172
+ mode: "in-cli",
2173
+ signals: {
2174
+ npm: ["newrelic"],
2175
+ python: ["newrelic"],
2176
+ ruby: ["newrelic_rpm"],
2177
+ envKeys: [/^NEW_RELIC_/, /^NEWRELIC_/]
2178
+ }
2179
+ },
2180
+ {
2181
+ kind: "Cloudflare",
2182
+ label: "Cloudflare",
2183
+ mode: "in-cli",
2184
+ signals: {
2185
+ npm: ["cloudflare"],
2186
+ python: ["cloudflare"],
2187
+ envKeys: [/^CLOUDFLARE_/, /^CF_API_TOKEN$/]
2188
+ }
2189
+ },
2190
+ {
2191
+ kind: "Elasticsearch",
2192
+ label: "Elasticsearch",
2193
+ mode: "in-cli",
2194
+ signals: {
2195
+ npm: ["@elastic/elasticsearch"],
2196
+ python: ["elasticsearch"],
2197
+ ruby: ["elasticsearch"],
2198
+ envKeys: [/^ELASTICSEARCH_/]
2199
+ }
2200
+ },
2201
+ {
2202
+ kind: "Snyk",
2203
+ label: "Snyk",
2204
+ mode: "in-cli",
2205
+ signals: {
2206
+ npm: ["snyk"],
2207
+ python: ["pysnyk"],
2208
+ envKeys: [/^SNYK_/]
2209
+ }
2210
+ },
2211
+ {
2212
+ kind: "PagerDuty",
2213
+ label: "PagerDuty",
2214
+ mode: "in-cli",
2215
+ signals: {
2216
+ npm: ["@pagerduty/pdjs"],
2217
+ python: ["pdpyras"],
2218
+ envKeys: [/^PAGERDUTY_/, /^PD_API_KEY$/]
2219
+ }
2220
+ },
2221
+ {
2222
+ kind: "Opsgenie",
2223
+ label: "Opsgenie",
2224
+ mode: "in-cli",
2225
+ signals: { envKeys: [/^OPSGENIE_/] }
2226
+ },
2227
+ {
2228
+ kind: "IncidentIo",
2229
+ label: "incident.io",
2230
+ mode: "in-cli",
2231
+ signals: { envKeys: [/^INCIDENT_IO_/, /^INCIDENTIO_/] }
2232
+ },
2233
+ {
2234
+ kind: "Bugsnag",
2235
+ label: "Bugsnag",
2236
+ mode: "in-cli",
2237
+ signals: {
2238
+ npm: ["@bugsnag/js"],
2239
+ python: ["bugsnag"],
2240
+ ruby: ["bugsnag"],
2241
+ envKeys: [/^BUGSNAG_/]
2242
+ }
2243
+ },
2244
+ {
2245
+ kind: "Honeybadger",
2246
+ label: "Honeybadger",
2247
+ mode: "in-cli",
2248
+ signals: {
2249
+ npm: ["@honeybadger-io/js"],
2250
+ python: ["honeybadger"],
2251
+ ruby: ["honeybadger"],
2252
+ envKeys: [/^HONEYBADGER_/]
2253
+ }
2254
+ },
2255
+ {
2256
+ kind: "Raygun",
2257
+ label: "Raygun",
2258
+ mode: "in-cli",
2259
+ signals: {
2260
+ npm: ["raygun"],
2261
+ python: ["raygun4py"],
2262
+ ruby: ["raygun4ruby"],
2263
+ envKeys: [/^RAYGUN_/]
2264
+ }
2265
+ },
2266
+ {
2267
+ kind: "CircleCI",
2268
+ label: "CircleCI",
2269
+ mode: "in-cli",
2270
+ signals: { envKeys: [/^CIRCLECI_/, /^CIRCLE_TOKEN$/] }
2271
+ },
2272
+ {
2273
+ kind: "Upstash",
2274
+ label: "Upstash",
2275
+ mode: "in-cli",
2276
+ signals: {
2277
+ npm: ["@upstash/redis"],
2278
+ python: ["upstash-redis"],
2279
+ envKeys: [/^UPSTASH_/]
2280
+ }
2281
+ },
2282
+ {
2283
+ kind: "Vercel",
2284
+ label: "Vercel",
2285
+ mode: "in-cli",
2286
+ signals: {
2287
+ npm: ["@vercel/sdk"],
2288
+ envKeys: [/^VERCEL_API_TOKEN$/]
2289
+ }
2290
+ },
2291
+ {
2292
+ kind: "Algolia",
2293
+ label: "Algolia",
2294
+ mode: "in-cli",
2295
+ signals: {
2296
+ npm: ["algoliasearch"],
2297
+ python: ["algoliasearch"],
2298
+ ruby: ["algolia"],
2299
+ envKeys: [/^ALGOLIA_/]
2300
+ }
2301
+ },
2302
+ {
2303
+ kind: "Inngest",
2304
+ label: "Inngest",
2305
+ mode: "in-cli",
2306
+ signals: {
2307
+ npm: ["inngest"],
2308
+ python: ["inngest"],
2309
+ envKeys: [/^INNGEST_/]
2310
+ }
2311
+ },
2312
+ {
2313
+ kind: "TriggerDev",
2314
+ label: "Trigger.dev",
2315
+ mode: "in-cli",
2316
+ signals: {
2317
+ npm: ["@trigger.dev/sdk"],
2318
+ envKeys: [/^TRIGGER_(SECRET_KEY|API_KEY|PROJECT_ID)$/]
2319
+ }
2320
+ },
2321
+ {
2322
+ kind: "Ably",
2323
+ label: "Ably",
2324
+ mode: "in-cli",
2325
+ signals: {
2326
+ npm: ["ably"],
2327
+ python: ["ably"],
2328
+ envKeys: [/^ABLY_/]
2329
+ }
2330
+ },
2331
+ {
2332
+ kind: "Netlify",
2333
+ label: "Netlify",
2334
+ mode: "in-cli",
2335
+ signals: {
2336
+ npm: ["@netlify/functions"],
2337
+ envKeys: [/^NETLIFY_/]
2338
+ }
2339
+ },
2340
+ {
2341
+ kind: "Railway",
2342
+ label: "Railway",
2343
+ mode: "in-cli",
2344
+ signals: { envKeys: [/^RAILWAY_/] }
2345
+ },
2346
+ {
2347
+ kind: "Render",
2348
+ label: "Render",
2349
+ mode: "in-cli",
2350
+ signals: { envKeys: [/^RENDER_API_KEY$/] }
2351
+ },
2352
+ {
2353
+ kind: "FlyIo",
2354
+ label: "Fly.io",
2355
+ mode: "in-cli",
2356
+ signals: { envKeys: [/^FLY_API_TOKEN$/, /^FLY_APP_NAME$/] }
2357
+ },
2358
+ {
2359
+ kind: "Heroku",
2360
+ label: "Heroku",
2361
+ mode: "in-cli",
2362
+ signals: { envKeys: [/^HEROKU_/] }
2363
+ },
2364
+ {
2365
+ kind: "DigitalOcean",
2366
+ label: "DigitalOcean",
2367
+ mode: "in-cli",
2368
+ signals: { envKeys: [/^DIGITALOCEAN_/] }
2369
+ },
2370
+ {
2371
+ kind: "Grafana",
2372
+ label: "Grafana",
2373
+ mode: "in-cli",
2374
+ signals: {
2375
+ python: ["grafana-client"],
2376
+ envKeys: [/^GRAFANA_/]
2377
+ }
2378
+ },
2379
+ {
2380
+ kind: "BetterStack",
2381
+ label: "Better Stack",
2382
+ mode: "in-cli",
2383
+ signals: {
2384
+ npm: ["@logtail/node", "@logtail/js"],
2385
+ envKeys: [
2386
+ /^BETTERSTACK_/,
2387
+ /^BETTER_STACK_/,
2388
+ /^LOGTAIL_/
2389
+ ]
2390
+ }
2391
+ },
2392
+ {
2393
+ kind: "Honeycomb",
2394
+ label: "Honeycomb",
2395
+ mode: "in-cli",
2396
+ signals: {
2397
+ npm: ["@honeycombio/opentelemetry-node", "honeycomb-beeline"],
2398
+ python: ["honeycomb-beeline", "libhoney"],
2399
+ envKeys: [/^HONEYCOMB_/]
2400
+ }
2401
+ },
2402
+ {
2403
+ kind: "Descope",
2404
+ label: "Descope",
2405
+ mode: "in-cli",
2406
+ signals: {
2407
+ npm: [
2408
+ "@descope/node-sdk",
2409
+ "@descope/nextjs-sdk",
2410
+ "@descope/react-sdk"
2411
+ ],
2412
+ python: ["descope"],
2413
+ envKeys: [/^DESCOPE_/]
2414
+ }
2415
+ },
2416
+ {
2417
+ kind: "FusionAuth",
2418
+ label: "FusionAuth",
2419
+ mode: "in-cli",
2420
+ signals: {
2421
+ npm: ["@fusionauth/typescript-client"],
2422
+ python: ["fusionauth-client"],
2423
+ envKeys: [/^FUSIONAUTH_/, /^FUSION_AUTH_/]
2424
+ }
2425
+ },
2426
+ {
2427
+ kind: "Hookdeck",
2428
+ label: "Hookdeck",
2429
+ mode: "in-cli",
2430
+ signals: {
2431
+ npm: ["@hookdeck/sdk"],
2432
+ envKeys: [/^HOOKDECK_/]
2433
+ }
2434
+ },
2435
+ {
2436
+ kind: "N8n",
2437
+ label: "n8n",
2438
+ mode: "in-cli",
2439
+ signals: {
2440
+ npm: ["n8n"],
2441
+ envKeys: [/^N8N_/]
2442
+ }
2443
+ },
2444
+ {
2445
+ kind: "Dbt",
2446
+ label: "dbt",
2447
+ mode: "in-cli",
2448
+ signals: {
2449
+ python: [
2450
+ "dbt-core",
2451
+ "dbt-snowflake",
2452
+ "dbt-postgres",
2453
+ "dbt-bigquery",
2454
+ "dbt-redshift",
2455
+ "dbt-databricks"
2456
+ ],
2457
+ envKeys: [/^DBT_/]
2458
+ }
2459
+ },
2460
+ {
2461
+ kind: "Fastly",
2462
+ label: "Fastly",
2463
+ mode: "in-cli",
2464
+ signals: {
2465
+ npm: ["fastly"],
2466
+ python: ["fastly"],
2467
+ envKeys: [/^FASTLY_/]
2468
+ }
2469
+ },
2470
+ {
2471
+ kind: "Bunny",
2472
+ label: "Bunny.net",
2473
+ mode: "in-cli",
2474
+ signals: { envKeys: [/^BUNNY_/] }
2475
+ },
2476
+ {
2477
+ kind: "Codecov",
2478
+ label: "Codecov",
2479
+ mode: "in-cli",
2480
+ signals: {
2481
+ npm: ["codecov"],
2482
+ envKeys: [/^CODECOV_/]
2483
+ }
2484
+ },
2485
+ {
2486
+ kind: "Sourcegraph",
2487
+ label: "Sourcegraph",
2488
+ mode: "in-cli",
2489
+ signals: { envKeys: [/^SOURCEGRAPH_/, /^SRC_ACCESS_TOKEN$/] }
2490
+ },
2491
+ {
2492
+ kind: "TemporalIO",
2493
+ label: "Temporal.io",
2494
+ mode: "in-cli",
2495
+ signals: {
2496
+ npm: ["@temporalio/client", "@temporalio/worker"],
2497
+ python: ["temporalio"],
2498
+ envKeys: [/^TEMPORAL_/]
2499
+ }
2500
+ },
2501
+ {
2502
+ kind: "Hatchet",
2503
+ label: "Hatchet",
2504
+ mode: "in-cli",
2505
+ signals: {
2506
+ npm: ["@hatchet-dev/typescript-sdk"],
2507
+ python: ["hatchet-sdk"],
2508
+ envKeys: [/^HATCHET_/]
2509
+ }
2510
+ },
2511
+ {
2512
+ kind: "Pipedrive",
2513
+ label: "Pipedrive",
2514
+ mode: "in-cli",
2515
+ signals: {
2516
+ npm: ["pipedrive"],
2517
+ envKeys: [/^PIPEDRIVE_/]
2518
+ }
2519
+ },
2520
+ {
2521
+ kind: "Close",
2522
+ label: "Close",
2523
+ mode: "in-cli",
2524
+ signals: {
2525
+ python: ["closeio"],
2526
+ envKeys: [/^CLOSE_API_KEY$/]
2527
+ }
2528
+ },
2529
+ {
2530
+ kind: "Copper",
2531
+ label: "Copper",
2532
+ mode: "in-cli",
2533
+ signals: { envKeys: [/^COPPER_/] }
2534
+ },
2535
+ {
2536
+ kind: "Insightly",
2537
+ label: "Insightly",
2538
+ mode: "in-cli",
2539
+ signals: { envKeys: [/^INSIGHTLY_/] }
2540
+ },
2541
+ {
2542
+ kind: "Salesflare",
2543
+ label: "Salesflare",
2544
+ mode: "in-cli",
2545
+ signals: { envKeys: [/^SALESFLARE_/] }
2546
+ },
2547
+ {
2548
+ kind: "SalesLoft",
2549
+ label: "Salesloft",
2550
+ mode: "in-cli",
2551
+ signals: { envKeys: [/^SALESLOFT_/] }
2552
+ },
2553
+ {
2554
+ kind: "Attio",
2555
+ label: "Attio",
2556
+ mode: "in-cli",
2557
+ signals: {
2558
+ npm: ["attio"],
2559
+ envKeys: [/^ATTIO_/]
2560
+ }
2561
+ },
2562
+ {
2563
+ kind: "ActiveCampaign",
2564
+ label: "ActiveCampaign",
2565
+ mode: "in-cli",
2566
+ signals: { envKeys: [/^ACTIVECAMPAIGN_/, /^ACTIVE_CAMPAIGN_/] }
2567
+ },
2568
+ {
2569
+ kind: "Vitally",
2570
+ label: "Vitally",
2571
+ mode: "in-cli",
2572
+ signals: { envKeys: [/^VITALLY_/] }
2573
+ },
2574
+ {
2575
+ kind: "Docusign",
2576
+ label: "DocuSign",
2577
+ mode: "in-cli",
2578
+ signals: {
2579
+ npm: ["docusign-esign"],
2580
+ python: ["docusign-esign"],
2581
+ envKeys: [/^DOCUSIGN_/]
2582
+ }
2583
+ },
2584
+ {
2585
+ kind: "PandaDoc",
2586
+ label: "PandaDoc",
2587
+ mode: "in-cli",
2588
+ signals: { envKeys: [/^PANDADOC_/] }
2589
+ },
2590
+ {
2591
+ kind: "Gong",
2592
+ label: "Gong",
2593
+ mode: "in-cli",
2594
+ signals: { envKeys: [/^GONG_/] }
2595
+ },
2596
+ {
2597
+ kind: "Asana",
2598
+ label: "Asana",
2599
+ mode: "in-cli",
2600
+ signals: {
2601
+ npm: ["asana"],
2602
+ python: ["asana"],
2603
+ envKeys: [/^ASANA_/]
2604
+ }
2605
+ },
2606
+ {
2607
+ kind: "Trello",
2608
+ label: "Trello",
2609
+ mode: "in-cli",
2610
+ signals: {
2611
+ npm: ["trello"],
2612
+ envKeys: [/^TRELLO_/]
2613
+ }
2614
+ },
2615
+ {
2616
+ kind: "Todoist",
2617
+ label: "Todoist",
2618
+ mode: "in-cli",
2619
+ signals: {
2620
+ npm: ["@doist/todoist-api-typescript"],
2621
+ python: ["todoist-api-python"],
2622
+ envKeys: [/^TODOIST_/]
2623
+ }
2624
+ },
2625
+ {
2626
+ kind: "Monday",
2627
+ label: "monday.com",
2628
+ mode: "in-cli",
2629
+ signals: {
2630
+ npm: ["@mondaydotcomorg/api"],
2631
+ envKeys: [/^MONDAY_/]
2632
+ }
2633
+ },
2634
+ {
2635
+ kind: "ClickUp",
2636
+ label: "ClickUp",
2637
+ mode: "in-cli",
2638
+ signals: { envKeys: [/^CLICKUP_/] }
2639
+ },
2640
+ {
2641
+ kind: "Height",
2642
+ label: "Height",
2643
+ mode: "in-cli",
2644
+ signals: { envKeys: [/^HEIGHT_API_KEY$/] }
2645
+ },
2646
+ {
2647
+ kind: "Shortcut",
2648
+ label: "Shortcut",
2649
+ mode: "in-cli",
2650
+ signals: {
2651
+ npm: ["@shortcut/client"],
2652
+ envKeys: [/^SHORTCUT_/]
2653
+ }
2654
+ },
2655
+ {
2656
+ kind: "Jira",
2657
+ label: "Jira",
2658
+ mode: "in-cli",
2659
+ signals: {
2660
+ npm: ["jira-client"],
2661
+ python: ["jira", "atlassian-python-api"],
2662
+ envKeys: [/^JIRA_/]
2663
+ }
2664
+ },
2665
+ {
2666
+ kind: "Confluence",
2667
+ label: "Confluence",
2668
+ mode: "in-cli",
2669
+ signals: { envKeys: [/^CONFLUENCE_/] }
2670
+ },
2671
+ {
2672
+ kind: "Airtable",
2673
+ label: "Airtable",
2674
+ mode: "in-cli",
2675
+ signals: {
2676
+ npm: ["airtable"],
2677
+ python: ["pyairtable"],
2678
+ envKeys: [/^AIRTABLE_/]
2679
+ }
2680
+ },
2681
+ {
2682
+ kind: "Smartsheet",
2683
+ label: "Smartsheet",
2684
+ mode: "in-cli",
2685
+ signals: {
2686
+ npm: ["smartsheet"],
2687
+ python: ["smartsheet-python-sdk"],
2688
+ envKeys: [/^SMARTSHEET_/]
2689
+ }
2690
+ },
2691
+ {
2692
+ kind: "Coda",
2693
+ label: "Coda",
2694
+ mode: "in-cli",
2695
+ signals: { envKeys: [/^CODA_API_/] }
2696
+ },
2697
+ {
2698
+ kind: "Productboard",
2699
+ label: "Productboard",
2700
+ mode: "in-cli",
2701
+ signals: { envKeys: [/^PRODUCTBOARD_/] }
2702
+ },
2703
+ {
2704
+ kind: "GoogleSheets",
2705
+ label: "Google Sheets",
2706
+ mode: "in-cli",
2707
+ signals: {
2708
+ npm: ["google-spreadsheet"],
2709
+ python: ["gspread"],
2710
+ envKeys: [/^GOOGLE_SHEETS_/]
2711
+ }
2712
+ },
2713
+ {
2714
+ kind: "Formbricks",
2715
+ label: "Formbricks",
2716
+ mode: "in-cli",
2717
+ signals: {
2718
+ npm: ["@formbricks/js"],
2719
+ envKeys: [/^FORMBRICKS_/]
2720
+ }
2721
+ },
2722
+ {
2723
+ kind: "Tally",
2724
+ label: "Tally",
2725
+ mode: "in-cli",
2726
+ signals: { envKeys: [/^TALLY_API_KEY$/] }
2727
+ },
2728
+ {
2729
+ kind: "Jotform",
2730
+ label: "Jotform",
2731
+ mode: "in-cli",
2732
+ signals: {
2733
+ python: ["jotform"],
2734
+ envKeys: [/^JOTFORM_/]
2735
+ }
2736
+ },
2737
+ {
2738
+ kind: "GitBook",
2739
+ label: "GitBook",
2740
+ mode: "in-cli",
2741
+ signals: {
2742
+ npm: ["@gitbook/api"],
2743
+ envKeys: [/^GITBOOK_/]
2744
+ }
2745
+ },
2746
+ {
2747
+ kind: "Wordpress",
2748
+ label: "WordPress",
2749
+ mode: "in-cli",
2750
+ signals: {
2751
+ npm: ["wpapi"],
2752
+ envKeys: [/^WORDPRESS_/]
2753
+ }
2754
+ },
2755
+ {
2756
+ kind: "Clockify",
2757
+ label: "Clockify",
2758
+ mode: "in-cli",
2759
+ signals: { envKeys: [/^CLOCKIFY_/] }
2760
+ },
2761
+ {
2762
+ kind: "Calendly",
2763
+ label: "Calendly",
2764
+ mode: "in-cli",
2765
+ signals: { envKeys: [/^CALENDLY_/] }
2766
+ },
2767
+ {
2768
+ kind: "CalCom",
2769
+ label: "Cal.com",
2770
+ mode: "in-cli",
2771
+ signals: { envKeys: [/^CALCOM_/, /^CAL_API_KEY$/] }
2772
+ },
2773
+ {
2774
+ kind: "Eventbrite",
2775
+ label: "Eventbrite",
2776
+ mode: "in-cli",
2777
+ signals: {
2778
+ python: ["eventbrite"],
2779
+ envKeys: [/^EVENTBRITE_/]
2780
+ }
2781
+ },
2782
+ {
2783
+ kind: "BambooHR",
2784
+ label: "BambooHR",
2785
+ mode: "in-cli",
2786
+ signals: {
2787
+ python: ["pybamboohr"],
2788
+ envKeys: [/^BAMBOOHR_/, /^BAMBOO_HR_/]
2789
+ }
2790
+ },
2791
+ {
2792
+ kind: "Personio",
2793
+ label: "Personio",
2794
+ mode: "in-cli",
2795
+ signals: { envKeys: [/^PERSONIO_/] }
2796
+ },
2797
+ {
2798
+ kind: "Rippling",
2799
+ label: "Rippling",
2800
+ mode: "in-cli",
2801
+ signals: { envKeys: [/^RIPPLING_/] }
2802
+ },
2803
+ {
2804
+ kind: "Greenhouse",
2805
+ label: "Greenhouse",
2806
+ mode: "in-cli",
2807
+ signals: { envKeys: [/^GREENHOUSE_/] }
2808
+ },
2809
+ {
2810
+ kind: "Ashby",
2811
+ label: "Ashby",
2812
+ mode: "in-cli",
2813
+ signals: { envKeys: [/^ASHBY_/] }
2814
+ },
2815
+ {
2816
+ kind: "Workable",
2817
+ label: "Workable",
2818
+ mode: "in-cli",
2819
+ signals: { envKeys: [/^WORKABLE_/] }
2820
+ },
2821
+ {
2822
+ kind: "GoogleAds",
2823
+ label: "Google Ads",
2824
+ mode: "deep-link",
2825
+ signals: {
2826
+ npm: ["google-ads-api"],
2827
+ python: ["google-ads"],
2828
+ envKeys: [/^GOOGLE_ADS_/]
2829
+ }
2830
+ },
2831
+ {
2832
+ kind: "MetaAds",
2833
+ label: "Meta Ads",
2834
+ mode: "deep-link",
2835
+ signals: {
2836
+ npm: ["facebook-nodejs-business-sdk"],
2837
+ python: ["facebook-business"],
2838
+ envKeys: [/^META_ADS_/, /^FACEBOOK_ADS_/]
2839
+ }
2840
+ },
2841
+ {
2842
+ kind: "LinkedinAds",
2843
+ label: "LinkedIn Ads",
2844
+ mode: "deep-link",
2845
+ signals: { envKeys: [/^LINKEDIN_ADS_/] }
2846
+ },
2847
+ {
2848
+ kind: "TikTokAds",
2849
+ label: "TikTok Ads",
2850
+ mode: "deep-link",
2851
+ signals: { envKeys: [/^TIKTOK_ADS_/] }
2852
+ },
2853
+ {
2854
+ kind: "RedditAds",
2855
+ label: "Reddit Ads",
2856
+ mode: "deep-link",
2857
+ signals: { envKeys: [/^REDDIT_ADS_/] }
2858
+ },
2859
+ {
2860
+ kind: "PinterestAds",
2861
+ label: "Pinterest Ads",
2862
+ mode: "deep-link",
2863
+ signals: { envKeys: [/^PINTEREST_ADS_/] }
2864
+ },
2865
+ {
2866
+ kind: "BingAds",
2867
+ label: "Bing Ads",
2868
+ mode: "deep-link",
2869
+ signals: {
2870
+ python: ["bingads"],
2871
+ envKeys: [/^BING_ADS_/, /^MICROSOFT_ADS_/]
2872
+ }
2873
+ },
2874
+ {
2875
+ kind: "AmazonAds",
2876
+ label: "Amazon Ads",
2877
+ mode: "deep-link",
2878
+ signals: { envKeys: [/^AMAZON_ADS_/] }
2879
+ },
2880
+ {
2881
+ kind: "GoogleAnalytics",
2882
+ label: "Google Analytics",
2883
+ mode: "deep-link",
2884
+ signals: {
2885
+ npm: ["react-ga4"],
2886
+ python: ["google-analytics-data"],
2887
+ envKeys: [/^GOOGLE_ANALYTICS_/, /^GA4_/]
2888
+ }
2889
+ },
2890
+ {
2891
+ kind: "GoogleSearchConsole",
2892
+ label: "Google Search Console",
2893
+ mode: "deep-link",
2894
+ signals: { envKeys: [/^SEARCH_CONSOLE_/, /^GSC_/] }
2895
+ },
2896
+ {
2897
+ kind: "AppsFlyer",
2898
+ label: "AppsFlyer",
2899
+ mode: "in-cli",
2900
+ signals: {
2901
+ npm: ["react-native-appsflyer"],
2902
+ envKeys: [/^APPSFLYER_/]
2903
+ }
2904
+ },
2905
+ {
2906
+ kind: "Dub",
2907
+ label: "Dub",
2908
+ mode: "in-cli",
2909
+ signals: {
2910
+ npm: ["dub"],
2911
+ python: ["dub"],
2912
+ envKeys: [/^DUB_API_KEY$/]
2913
+ }
2914
+ }
2915
+ ];
2916
+ const SOURCE_DETECTORS = [
2917
+ ...CORE_SOURCE_DETECTORS,
2918
+ ...LLM_SOURCE_DETECTORS,
2919
+ ...OTHER_SOURCE_DETECTORS
2920
+ ];
2921
+ /** Kinds from the LLM / AI section above — the only ones that may set `wizard_ai_sdk_detected`. */
2922
+ const AI_SOURCE_KINDS = new Set(LLM_SOURCE_DETECTORS.map((detector) => detector.kind));
2923
+ //#endregion
2924
+ //#region src/lib/warehouse-sources/detect.ts
2925
+ /**
2926
+ * Data warehouse source detection.
2927
+ *
2928
+ * Scans a project for codebase signals (npm/python/ruby deps, `.env` key
2929
+ * names) and matches them against the `SOURCE_DETECTORS` registry. Pure
2930
+ * function: no store mutations, no UI calls. Reads files locally — only the
2931
+ * wizard process does this; the agent never sees secret values.
2932
+ *
2933
+ * Note we only read `.env` KEY NAMES, never values.
2934
+ */
2935
+ const MAX_DEPTH = 3;
2936
+ const MAX_SIGNAL_SET = MAX_ENV_KEY_SET;
2937
+ function addCapped(set, value) {
2938
+ if (set.size < MAX_SIGNAL_SET) set.add(value);
2939
+ }
2940
+ /**
2941
+ * Detect which warehouse sources the project at `installDir` appears to use.
2942
+ * Returns one `DetectedSource` per matched registry entry (kinds are unique,
2943
+ * so the result is naturally deduped).
2944
+ */
2945
+ function detectWarehouseSources(installDir) {
2946
+ const signals = collectSignals(installDir);
2947
+ const detected = [];
2948
+ for (const detector of SOURCE_DETECTORS) {
2949
+ const match = matchDetector(detector, signals);
2950
+ if (match) detected.push({
2951
+ kind: detector.kind,
2952
+ label: detector.label,
2953
+ mode: detector.mode,
2954
+ matchedSignal: match
2955
+ });
2956
+ }
2957
+ return detected;
2958
+ }
2959
+ /** Returns a human-readable description of the first matching signal, or null. */
2960
+ function matchDetector(detector, signals) {
2961
+ const { npm, python, ruby, envKeys } = detector.signals;
2962
+ const npmHit = npm?.find((dep) => signals.npm.has(dep));
2963
+ if (npmHit) return `found \`${npmHit}\` in package.json`;
2964
+ const pyHit = python?.find((dep) => signals.python.has(dep));
2965
+ if (pyHit) return `found \`${pyHit}\` in Python dependencies`;
2966
+ const rubyHit = ruby?.find((gem) => signals.ruby.has(gem));
2967
+ if (rubyHit) return `found \`${rubyHit}\` in Gemfile`;
2968
+ if (envKeys) {
2969
+ for (const [key, file] of signals.envKeys) if (envKeys.some((re) => re.test(key))) return `found \`${key}\` in \`${file}\``;
2970
+ }
2971
+ return null;
2972
+ }
2973
+ function collectSignals(installDir) {
2974
+ const signals = {
2975
+ npm: /* @__PURE__ */ new Set(),
2976
+ python: /* @__PURE__ */ new Set(),
2977
+ ruby: /* @__PURE__ */ new Set(),
2978
+ envKeys: /* @__PURE__ */ new Map()
2979
+ };
2980
+ walkProjectFiles(installDir, (name, fullPath) => ingestFile(installDir, name, fullPath, signals), MAX_DEPTH);
2981
+ return signals;
2982
+ }
2983
+ /**
2984
+ * Route a file to the right parser BY NAME, reading its contents only when the
2985
+ * name matches one of the ~6 manifests we care about. Checking the name first
2986
+ * avoids slurping every file in the tree (lockfiles, binaries, assets) into
2987
+ * memory just to discard it.
2988
+ */
2989
+ function ingestFile(installDir, name, fullPath, signals) {
2990
+ const ingest = ingestorFor(name);
2991
+ if (!ingest) return;
2992
+ const content = safeReadFile(fullPath);
2993
+ if (content === null) return;
2994
+ ingest(content, signals, toPromptSafeRelativePath(installDir, fullPath));
2995
+ }
2996
+ /** Pick the parser for a manifest filename, or null if it's not one we read. */
2997
+ function ingestorFor(name) {
2998
+ if (name === "package.json") return addNpmDeps;
2999
+ if (name === "requirements.txt") return (c, s) => parseRequirementsTxt(c).forEach((d) => addCapped(s.python, d));
3000
+ if (name === "pyproject.toml") return (c, s) => parsePyprojectToml(c).forEach((d) => addCapped(s.python, d));
3001
+ if (name === "Pipfile") return (c, s) => parsePipfile(c).forEach((d) => addCapped(s.python, d));
3002
+ if (name === "Gemfile") return (c, s) => parseGemfile(c).forEach((g) => addCapped(s.ruby, g));
3003
+ if (isEnvFileName(name)) return (c, s, relativePath) => addEnvKeys(c, s, relativePath);
3004
+ return null;
3005
+ }
3006
+ /**
3007
+ * Record each key NAME against the file that defined it. The first file wins,
3008
+ * so the reported signal stays stable when several `.env*` files repeat a key.
3009
+ * Values are never read.
3010
+ */
3011
+ function addEnvKeys(content, signals, relativePath) {
3012
+ for (const key of parseEnvKeyNames(content)) {
3013
+ if (signals.envKeys.has(key)) continue;
3014
+ if (signals.envKeys.size >= MAX_SIGNAL_SET) return;
3015
+ signals.envKeys.set(key, relativePath);
3016
+ }
3017
+ }
3018
+ function addNpmDeps(content, signals) {
3019
+ try {
3020
+ const pkg = JSON.parse(content);
3021
+ for (const dep of Object.keys({
3022
+ ...pkg.dependencies,
3023
+ ...pkg.devDependencies
3024
+ })) addCapped(signals.npm, dep);
3025
+ } catch (error) {
3026
+ analytics.captureException(error instanceof Error ? error : new Error(String(error)), { step: "detectWarehouseSources.parsePackageJson" });
3027
+ }
3028
+ }
3029
+ /** Extract gem names from `gem 'name'` declarations. */
3030
+ function parseGemfile(content) {
3031
+ const gems = [];
3032
+ for (const match of content.matchAll(/^\s*gem\s+['"]([^'"]+)['"]/gm)) gems.push(match[1]);
3033
+ return gems;
3034
+ }
3035
+ //#endregion
3036
+ //#region src/lib/programs/warehouse-source/detect.ts
3037
+ /**
3038
+ * Warehouse-source program detection step.
3039
+ *
3040
+ * Thin adapter over `detectWarehouseSources` that writes results into
3041
+ * frameworkContext for the intro screen, plus the `[ABORT]` cases the
3042
+ * data-warehouse-source-setup skill can emit.
3043
+ */
3044
+ /** frameworkContext key holding the detected sources (set on success). */
3045
+ const DETECTED_WAREHOUSE_SOURCES_KEY = "detectedWarehouseSources";
3046
+ /**
3047
+ * Read the detected sources out of frameworkContext. Single accessor shared by
3048
+ * the intro screen and the prompt builder so the key + cast live in one place.
3049
+ */
3050
+ function getDetectedWarehouseSources(session) {
3051
+ return session.frameworkContext["detectedWarehouseSources"] ?? [];
3052
+ }
3053
+ /** `[ABORT] <reason>` cases the skill can emit. */
3054
+ const WAREHOUSE_ABORT_CASES = [{
3055
+ match: /^no data sources? detected\.?$/i,
3056
+ message: "No data source detected",
3057
+ body: "The agent could not confirm a data warehouse source to connect. Run this command from a project that uses a supported source (a database, Stripe, etc.).",
3058
+ docsUrl: "https://posthog.com/docs/data-warehouse"
3059
+ }, {
3060
+ match: /^source creation failed\.?$/i,
3061
+ message: "Source creation failed",
3062
+ body: "PostHog could not create the data warehouse source with the credentials provided. Double-check the connection details and try again, or set the source up directly in the PostHog app.",
3063
+ docsUrl: "https://posthog.com/docs/data-warehouse"
3064
+ }];
3065
+ /**
3066
+ * Scan `session.installDir` for warehouse-source signals. Writes the detected
3067
+ * sources (or a `detectError`) into frameworkContext for the intro screen.
3068
+ */
3069
+ function detectWarehousePrerequisites(session, setFrameworkContext) {
3070
+ const fail = (error) => setFrameworkContext("detectError", error);
3071
+ const installDir = session.installDir;
3072
+ if (!existsSync(installDir)) {
3073
+ fail({
3074
+ kind: "bad-directory",
3075
+ path: installDir,
3076
+ reason: "missing"
3077
+ });
3078
+ return;
3079
+ }
3080
+ try {
3081
+ if (!statSync(installDir).isDirectory()) {
3082
+ fail({
3083
+ kind: "bad-directory",
3084
+ path: installDir,
3085
+ reason: "not-dir"
3086
+ });
3087
+ return;
3088
+ }
3089
+ } catch (error) {
3090
+ analytics.captureException(error instanceof Error ? error : new Error(String(error)), {
3091
+ step: "detectWarehousePrerequisites.stat",
3092
+ path: installDir
3093
+ });
3094
+ fail({
3095
+ kind: "bad-directory",
3096
+ path: installDir,
3097
+ reason: "unreadable"
3098
+ });
3099
+ return;
3100
+ }
3101
+ const sources = detectWarehouseSources(installDir);
3102
+ if (sources.length === 0) {
3103
+ fail({ kind: "no-sources" });
3104
+ return;
3105
+ }
3106
+ analytics.setTag("warehouse_source_kinds", sources.map((s) => s.kind).join(","));
3107
+ analytics.setTag("warehouse_source_modes", sources.map((s) => `${s.kind}:${s.mode}`).join(","));
3108
+ analytics.setTag("warehouse_source_count", sources.length);
3109
+ setFrameworkContext(DETECTED_WAREHOUSE_SOURCES_KEY, sources);
3110
+ }
3111
+ //#endregion
3112
+ //#region src/lib/programs/posthog-integration/detect.ts
3113
+ async function detectPostHogIntegration(ctx) {
3114
+ const session = ctx.session;
3115
+ const installDir = session.installDir;
3116
+ const detectedIntegration = await detectFramework(installDir);
3117
+ if (detectedIntegration) {
3118
+ const config = FRAMEWORK_REGISTRY[detectedIntegration];
3119
+ const sessionOptions = {
3120
+ installDir,
3121
+ debug: session.debug,
3122
+ signup: session.signup,
3123
+ ci: session.ci,
3124
+ benchmark: session.benchmark,
3125
+ yaraReport: session.yaraReport
3126
+ };
3127
+ const context = await gatherFrameworkContext(config, sessionOptions);
3128
+ for (const [key, value] of Object.entries(context)) if (!(key in session.frameworkContext)) ctx.setFrameworkContext(key, value);
3129
+ ctx.setFrameworkConfig(detectedIntegration, config);
3130
+ ctx.setSkillId(detectedIntegration);
3131
+ if (!session.detectedFrameworkLabel) ctx.setDetectedFramework(config.metadata.name);
3132
+ const versionResult = await checkFrameworkVersion(config, sessionOptions);
3133
+ if (versionResult.supported !== true) ctx.setUnsupportedVersion(versionResult.supported);
3134
+ }
3135
+ for (const feature of discoverFeatures(installDir)) ctx.addDiscoveredFeature(feature);
3136
+ detectWarehouseSourcesForSuggestion(ctx, installDir);
3137
+ ctx.setDetectionComplete();
3138
+ }
3139
+ /**
3140
+ * How the scan went, for the reporter to read later. Three states, and the
3141
+ * absent one carries the most weight:
3142
+ *
3143
+ * absent this program never scanned. Only `posthog-integration` runs the
3144
+ * scan below, but every program's intro screen resolves consent
3145
+ * through the same store method, so the reporter is reached on runs
3146
+ * where no scan ever happened.
3147
+ * 'failed' the scan threw. A zero-count row would read as "scanned, found
3148
+ * nothing", which is a different fact.
3149
+ * 'ok' the scan ran. Zero sources is a real result and gets reported.
3150
+ */
3151
+ const WAREHOUSE_SCAN_STATE_KEY = "warehouseScanState";
3152
+ /**
3153
+ * Scan for data warehouse source signals (Postgres, Stripe, Hubspot, …) and,
3154
+ * when found, stash them for a `wizard warehouse` suggestion on the outro.
3155
+ * Runs unconditionally during `detect`, before the intro screen has asked
3156
+ * about sharing. Reporting what this finds is a separate, later concern.
3157
+ * See `reportWarehouseSourcesDetected` below.
3158
+ *
3159
+ * Deliberately a suggestion, not an inline agent run: a second credential-
3160
+ * collecting agent run before the outro could `process.exit()` on any of its
3161
+ * failure paths and cost the user the success outro on a run where PostHog
3162
+ * installed fine.
3163
+ *
3164
+ * Calls `detectWarehouseSources` (a pure scan) rather than the warehouse
3165
+ * program's `detectWarehousePrerequisites`, which writes a `detectError` when
3166
+ * it finds nothing — that's right for `wizard warehouse` but here would show a
3167
+ * spurious error and trip the CI prerequisites abort. No sources is a no-op.
3168
+ *
3169
+ * Best-effort: never let a scan failure break the wizard flow.
3170
+ */
3171
+ function detectWarehouseSourcesForSuggestion(ctx, installDir) {
3172
+ try {
3173
+ const sources = detectWarehouseSources(installDir);
3174
+ ctx.setFrameworkContext(WAREHOUSE_SCAN_STATE_KEY, "ok");
3175
+ if (sources.length === 0) return;
3176
+ ctx.setFrameworkContext(DETECTED_WAREHOUSE_SOURCES_KEY, sources);
3177
+ } catch (error) {
3178
+ ctx.setFrameworkContext(WAREHOUSE_SCAN_STATE_KEY, "failed");
3179
+ analytics.captureException(error instanceof Error ? error : new Error(String(error)), { step: "detectWarehouseSourcesForSuggestion" });
3180
+ }
3181
+ }
3182
+ function hasAiSdkEvidence(session, sources) {
3183
+ return sources.some((s) => AI_SOURCE_KINDS.has(s.kind)) || session.discoveredFeatures.includes("llm");
3184
+ }
3185
+ /**
3186
+ * Boolean only, on the org, never the list of kinds or any non-AI tool: a
3187
+ * decline must not leak even the shape of what local detection saw.
3188
+ */
3189
+ function stampAiSdkDetected(session, sources) {
3190
+ const organizationId = session.apiUser?.organization?.id;
3191
+ if (!organizationId) return;
3192
+ if (!hasAiSdkEvidence(session, sources)) return;
3193
+ analytics.groupIdentify("organization", organizationId, { wizard_ai_sdk_detected: true });
3194
+ }
3195
+ /**
3196
+ * Fires the org stamp once per session, right after `authenticate()` succeeds
3197
+ * — never from the consent path, since consent on the intro screen resolves
3198
+ * before login and `session.apiUser` is unset there. Called right after
3199
+ * `authenticate()` from run-wizard.ts's auth step and from bootstrap.ts,
3200
+ * whichever completes it first for a given program; a no-op on every call
3201
+ * after that. In the `--ci` path, project-scope.ts authenticates first as a
3202
+ * prerequisite (no evidence gathered yet, so nothing would stamp there
3203
+ * anyway) and this only ever runs from the later, idempotent bootstrap.ts
3204
+ * call — still correctly finding no evidence, since CI skips the detect step.
3205
+ */
3206
+ function maybeStampAiSdkDetected(session) {
3207
+ if (session.aiSdkStampReported) return;
3208
+ session.aiSdkStampReported = true;
3209
+ if (!mayReportScanResults(session)) return;
3210
+ stampAiSdkDetected(session, getDetectedWarehouseSources(session));
3211
+ }
3212
+ /**
3213
+ * The single place scan results become telemetry. Called from
3214
+ * `WizardStore.completeSetup()`, the point consent becomes final — the privacy
3215
+ * panel's choice is reversible until then, so nothing may report earlier.
3216
+ * The org stamp is a separate concern: see `maybeStampAiSdkDetected`, which
3217
+ * runs post-auth rather than at consent resolution.
3218
+ *
3219
+ * Returns true when consent has resolved and the caller should latch
3220
+ * `warehouseSourcesReported`, which is not the same as "this sent something":
3221
+ * a decline, a failed scan, and a program that never scanned all resolve
3222
+ * without sending.
3223
+ */
3224
+ function reportWarehouseSourcesDetected(session) {
3225
+ if (session.warehouseSourcesReported) return false;
3226
+ if (session.scanConsent === "undecided") return false;
3227
+ if (mayReportScanResults(session)) {
3228
+ const sources = getDetectedWarehouseSources(session);
3229
+ if (session.frameworkContext[WAREHOUSE_SCAN_STATE_KEY] !== "ok") return true;
3230
+ analytics.wizardCapture("warehouse sources detected", {
3231
+ warehouse_source_count: sources.length,
3232
+ warehouse_source_kinds: sources.map((s) => s.kind),
3233
+ warehouse_source_modes: sources.map((s) => s.mode)
3234
+ });
3235
+ if (sources.length > 0) {
3236
+ analytics.setTag("warehouse_source_kinds", sources.map((s) => s.kind).join(","));
3237
+ analytics.setTag("warehouse_source_count", sources.length);
3238
+ }
3239
+ }
3240
+ return true;
3241
+ }
3242
+ //#endregion
85
3243
  //#region src/lib/agent/runner/harness/anthropic/index.ts
86
3244
  /**
87
3245
  * The `anthropic` runner — the control. Wraps the claude-agent-sdk path
@@ -2082,7 +5240,8 @@ async function runOrchestrator(session, config, programConfig, boot) {
2082
5240
  analytics.wizardCapture("orchestrator task skipped", {
2083
5241
  ...base,
2084
5242
  duration_ms: durationMs(task),
2085
- reason: task.skipReason
5243
+ reason: task.skipReason,
5244
+ not_needed_reason: task.notNeededReason
2086
5245
  });
2087
5246
  break;
2088
5247
  case "fail":
@@ -2692,6 +5851,7 @@ async function bootstrapProgram(session, config, programConfig) {
2692
5851
  skill_id: config.skillId ?? null
2693
5852
  });
2694
5853
  await authenticate(session, programConfig.id);
5854
+ maybeStampAiSdkDetected(session);
2695
5855
  const project = session.apiProject;
2696
5856
  logToFile("[agent-runner] checking AI opt-in gate");
2697
5857
  await getUI().waitForAiOptIn();
@@ -2839,6 +5999,6 @@ function tagBinding(boot, binding) {
2839
5999
  //#region src/lib/agent/agent-runner.ts
2840
6000
  var agent_runner_exports = /* @__PURE__ */ __exportAll({ runAgent: () => runAgent });
2841
6001
  //#endregion
2842
- export { formatCostUsd as a, computeTokenCostUsd as i, runAgent as n, formatTokenCount as o, shouldDisableAsk as r, authenticate as s, agent_runner_exports as t };
6002
+ export { detectFramework as _, formatCostUsd as a, maybeStampAiSdkDetected as c, detectWarehousePrerequisites as d, getDetectedWarehouseSources as f, gatherFrameworkContext as g, resolveProjectDir as h, computeTokenCostUsd as i, reportWarehouseSourcesDetected as l, detectProjectsWithAgent as m, runAgent as n, formatTokenCount as o, detectWarehouseSources as p, shouldDisableAsk as r, detectPostHogIntegration as s, agent_runner_exports as t, WAREHOUSE_ABORT_CASES as u, authenticate as v };
2843
6003
 
2844
- //# sourceMappingURL=agent-runner-Cp6iLqDk.js.map
6004
+ //# sourceMappingURL=agent-runner-DUyO1Ehj.js.map