@posthog/wizard 2.64.1 → 2.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/{add-mcp-server-to-clients-BUqb93_I.js → add-mcp-server-to-clients-ArtlMX9-.js} +5 -5
- package/dist/{add-mcp-server-to-clients-BUqb93_I.js.map → add-mcp-server-to-clients-ArtlMX9-.js.map} +1 -1
- package/dist/{agent-interface-NurnwA01.js → agent-interface-ORzGEFNM.js} +76 -11
- package/dist/agent-interface-ORzGEFNM.js.map +1 -0
- package/dist/{agent-prompt-loader-CbowPuWI.js → agent-prompt-loader-D3w6sc34.js} +10 -5
- package/dist/agent-prompt-loader-D3w6sc34.js.map +1 -0
- package/dist/{agent-runner-DisJWxJa.js → agent-runner-Ca-e2TOQ.js} +25 -18
- package/dist/{agent-runner-DisJWxJa.js.map → agent-runner-Ca-e2TOQ.js.map} +1 -1
- package/dist/analytics-C4j6grao.js +2 -0
- package/dist/{analytics-D3vKvr3l.js → analytics-zBrIVjMV.js} +2 -2
- package/dist/{analytics-D3vKvr3l.js.map → analytics-zBrIVjMV.js.map} +1 -1
- package/dist/{api-Bhe8jpUR.js → api-Wgb7AhrP.js} +3 -3
- package/dist/{api-Bhe8jpUR.js.map → api-Wgb7AhrP.js.map} +1 -1
- package/dist/bin.js +200 -76
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-BeWc675I.js → bounded-fs-DqsVmh4r.js} +3 -3
- package/dist/{bounded-fs-BeWc675I.js.map → bounded-fs-DqsVmh4r.js.map} +1 -1
- package/dist/{ci-install-BpNzfghY.js → ci-install-D1QqmJIc.js} +4 -4
- package/dist/{ci-install-BpNzfghY.js.map → ci-install-D1QqmJIc.js.map} +1 -1
- package/dist/{debug-hy6aWAyk.js → debug-Cm1hvkVy.js} +14 -9
- package/dist/debug-Cm1hvkVy.js.map +1 -0
- package/dist/{debug-DGfRPr2A.js → debug-CtQ13sCW.js} +1 -1
- package/dist/{defaults-mrAre0xM.js → defaults-BHhXrX9F.js} +1 -1
- package/dist/{defaults-mrAre0xM.js.map → defaults-BHhXrX9F.js.map} +1 -1
- package/dist/{env-api-key-CMPe-WJp.js → env-api-key-CdI2XZIz.js} +2 -2
- package/dist/{env-api-key-CMPe-WJp.js.map → env-api-key-CdI2XZIz.js.map} +1 -1
- package/dist/{environment-Ktu0Ktjl.js → environment-BhFvfkQg.js} +4 -4
- package/dist/{environment-Ktu0Ktjl.js.map → environment-BhFvfkQg.js.map} +1 -1
- package/dist/{file-watcher-CqJ1dgjq.js → file-watcher-Dciz09Rr.js} +2 -2
- package/dist/{file-watcher-CqJ1dgjq.js.map → file-watcher-Dciz09Rr.js.map} +1 -1
- package/dist/{headless-ui-zZLgs4QL.js → headless-ui-B4FnKm11.js} +2 -2
- package/dist/{headless-ui-zZLgs4QL.js.map → headless-ui-B4FnKm11.js.map} +1 -1
- package/dist/{interactive-BUw1SEOz.js → interactive-DxHFVYr2.js} +2 -2
- package/dist/{interactive-BUw1SEOz.js.map → interactive-DxHFVYr2.js.map} +1 -1
- package/dist/local-dev-BN6NKQ0B.js +135 -0
- package/dist/local-dev-BN6NKQ0B.js.map +1 -0
- package/dist/{mcp-prompt-streaming-CKyqqB10.js → mcp-prompt-streaming-ro98iUDc.js} +20 -4
- package/dist/mcp-prompt-streaming-ro98iUDc.js.map +1 -0
- package/dist/{mcp-C7NMhhWa.js → mcp-t0UxAPur.js} +2 -2
- package/dist/{mcp-C7NMhhWa.js.map → mcp-t0UxAPur.js.map} +1 -1
- package/dist/{non-interactive-73xGtug6.js → non-interactive-BA2L_jDT.js} +2 -2
- package/dist/{non-interactive-73xGtug6.js.map → non-interactive-BA2L_jDT.js.map} +1 -1
- package/dist/{orchestrator-tools-DcMJzfDH.js → orchestrator-tools-vZmNsHy9.js} +3 -3
- package/dist/{orchestrator-tools-DcMJzfDH.js.map → orchestrator-tools-vZmNsHy9.js.map} +1 -1
- package/dist/{package-json-CDs1ZVKu.js → package-json-D0DCWpe5.js} +1 -1
- package/dist/{package-json-CDs1ZVKu.js.map → package-json-D0DCWpe5.js.map} +1 -1
- package/dist/{package-manager-KweKX3u_.js → package-manager-DgqJdAQk.js} +58 -3
- package/dist/package-manager-DgqJdAQk.js.map +1 -0
- package/dist/{pi-B4p4gpr0.js → pi-nwrCARRp.js} +11 -11
- package/dist/{pi-B4p4gpr0.js.map → pi-nwrCARRp.js.map} +1 -1
- package/dist/{playground-AEkWcB1E.js → playground-xkEke_h0.js} +7 -7
- package/dist/{playground-AEkWcB1E.js.map → playground-xkEke_h0.js.map} +1 -1
- package/dist/{posthog-4PljLcIz.js → posthog-9To56cSd.js} +2 -2
- package/dist/{posthog-4PljLcIz.js.map → posthog-9To56cSd.js.map} +1 -1
- package/dist/{posthog-integration-DKlEg8-Q.js → posthog-integration-CoPvN6YZ.js} +34 -29
- package/dist/posthog-integration-CoPvN6YZ.js.map +1 -0
- package/dist/{provisioning-QsG7HDCm.js → provisioning-BYFSHSHY.js} +3 -3
- package/dist/{provisioning-QsG7HDCm.js.map → provisioning-BYFSHSHY.js.map} +1 -1
- package/dist/{queue-tools-Jlz9dV_B.js → queue-tools-BREbgGSC.js} +3 -3
- package/dist/{queue-tools-Jlz9dV_B.js.map → queue-tools-BREbgGSC.js.map} +1 -1
- package/dist/{registry-PG_nV5Bf.js → registry-DGJQ_8QI.js} +309 -6
- package/dist/registry-DGJQ_8QI.js.map +1 -0
- package/dist/{security-BKUJk-Gg.js → security-wc-naGq5.js} +5 -5
- package/dist/{security-BKUJk-Gg.js.map → security-wc-naGq5.js.map} +1 -1
- package/dist/{setup-utils-DNpldqge.js → setup-utils-Cz0wPLsQ.js} +18 -13
- package/dist/setup-utils-Cz0wPLsQ.js.map +1 -0
- package/dist/smoke-test-ci.sh +12 -1
- package/dist/{start-tui-D4B0-2nr.js → start-tui-DDW9uVnD.js} +114 -25
- package/dist/start-tui-DDW9uVnD.js.map +1 -0
- package/dist/{steps-Dy0AXdGo.js → steps-CZI0B24_.js} +7 -7
- package/dist/{steps-Dy0AXdGo.js.map → steps-CZI0B24_.js.map} +1 -1
- package/dist/{store-DouLLelV.js → store-xMkU8xAa.js} +20 -6
- package/dist/store-xMkU8xAa.js.map +1 -0
- package/dist/{subagent-B4yVs5A2.js → subagent-BztacyoV.js} +2 -2
- package/dist/{subagent-B4yVs5A2.js.map → subagent-BztacyoV.js.map} +1 -1
- package/dist/{task-DRKYEbKM.js → task-CJ7x3McC.js} +29 -18
- package/dist/task-CJ7x3McC.js.map +1 -0
- package/dist/{task-stream-BGUP7yA-.js → task-stream-BK7JQ27G.js} +5 -5
- package/dist/{task-stream-BGUP7yA-.js.map → task-stream-BK7JQ27G.js.map} +1 -1
- package/dist/{tasks-B2GzXsZ0.js → tasks-FGzp_zBd.js} +2 -2
- package/dist/{tasks-B2GzXsZ0.js.map → tasks-FGzp_zBd.js.map} +1 -1
- package/dist/{telemetry-6zaFfCcy.js → telemetry-By56gAtF.js} +3 -3
- package/dist/{telemetry-6zaFfCcy.js.map → telemetry-By56gAtF.js.map} +1 -1
- package/dist/{terminal-Bu3eHFn0.js → terminal-C_rmkaku.js} +39 -31
- package/dist/terminal-C_rmkaku.js.map +1 -0
- package/dist/{tools-DQO5tKJg.js → tools-BpCJgMez.js} +7 -7
- package/dist/tools-BpCJgMez.js.map +1 -0
- package/dist/{wizard-abort-PgTdRS1l.js → wizard-abort-BlDla_Jd.js} +1 -1
- package/dist/{wizard-abort-D6jJh8u5.js → wizard-abort-CzwID162.js} +4 -4
- package/dist/{wizard-abort-D6jJh8u5.js.map → wizard-abort-CzwID162.js.map} +1 -1
- package/dist/{wizard-session-BUhlJ1b8.js → wizard-session-Bn6dO1gE.js} +16 -3
- package/dist/wizard-session-Bn6dO1gE.js.map +1 -0
- package/dist/{wizard-session-DZUDtS5d.js → wizard-session-UxA_A0cA.js} +1 -1
- package/dist/{yara-hooks-DjReXmTQ.js → yara-hooks-BrisBebM.js} +4 -4
- package/dist/{yara-hooks-DjReXmTQ.js.map → yara-hooks-BrisBebM.js.map} +1 -1
- package/dist/yara-hooks-D2B7Fd9G.js +2 -0
- package/package.json +1 -1
- package/dist/agent-interface-NurnwA01.js.map +0 -1
- package/dist/agent-prompt-loader-CbowPuWI.js.map +0 -1
- package/dist/analytics-hNca7GLq.js +0 -2
- package/dist/debug-hy6aWAyk.js.map +0 -1
- package/dist/mcp-prompt-streaming-CKyqqB10.js.map +0 -1
- package/dist/package-manager-KweKX3u_.js.map +0 -1
- package/dist/posthog-integration-DKlEg8-Q.js.map +0 -1
- package/dist/registry-PG_nV5Bf.js.map +0 -1
- package/dist/setup-utils-DNpldqge.js.map +0 -1
- package/dist/start-tui-D4B0-2nr.js.map +0 -1
- package/dist/store-DouLLelV.js.map +0 -1
- package/dist/task-DRKYEbKM.js.map +0 -1
- package/dist/terminal-Bu3eHFn0.js.map +0 -1
- package/dist/tools-DQO5tKJg.js.map +0 -1
- package/dist/wizard-session-BUhlJ1b8.js.map +0 -1
- package/dist/yara-hooks-CN_uFGCu.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B_-DWIq7.js";
|
|
2
|
-
import { f as getUI } from "./debug-
|
|
3
|
-
import { i as readProjectFile, n as boundedGlob } from "./bounded-fs-
|
|
4
|
-
import { a as createVersionBucket,
|
|
5
|
-
import { n as getInstalledPackageVersion, r as hasDeclaredDependency, t as getDeclaredVersion } from "./package-json-
|
|
6
|
-
import { a as
|
|
2
|
+
import { f as getUI } from "./debug-Cm1hvkVy.js";
|
|
3
|
+
import { i as readProjectFile, n as boundedGlob } from "./bounded-fs-DqsVmh4r.js";
|
|
4
|
+
import { a as createVersionBucket, i as tryGetPackageJson, l as detectAllPackageManagers } from "./setup-utils-Cz0wPLsQ.js";
|
|
5
|
+
import { n as getInstalledPackageVersion, r as hasDeclaredDependency, t as getDeclaredVersion } from "./package-json-D0DCWpe5.js";
|
|
6
|
+
import { a as detectNodePackageManagers, c as gradlePackageManager, d as swiftPackageManager, f as detectPackageManager$1, h as getPythonVersionBucket, i as detectJavaPackageManagers, l as mixPackageManager, m as getPythonVersion, n as cargoPackageManager, o as detectPythonPackageManagers, p as getPackageManagerName$1, r as composerPackageManager, s as goModulesPackageManager, t as bundlerPackageManager, u as pubPackageManager } from "./package-manager-DgqJdAQk.js";
|
|
7
7
|
import * as semver from "semver";
|
|
8
8
|
import { major, minVersion } from "semver";
|
|
9
9
|
import path from "path";
|
|
@@ -2382,6 +2382,305 @@ const RAILS_AGENT_CONFIG = {
|
|
|
2382
2382
|
}
|
|
2383
2383
|
};
|
|
2384
2384
|
//#endregion
|
|
2385
|
+
//#region src/frameworks/elixir/elixir-wizard-agent.ts
|
|
2386
|
+
function readMixExs(installDir) {
|
|
2387
|
+
const mixExsPath = path$1.join(installDir, "mix.exs");
|
|
2388
|
+
if (!fs$1.existsSync(mixExsPath)) return;
|
|
2389
|
+
return fs$1.readFileSync(mixExsPath, "utf-8");
|
|
2390
|
+
}
|
|
2391
|
+
/** Phoenix apps get the Plug integration; plain Elixir apps don't. */
|
|
2392
|
+
function isPhoenixProject(installDir) {
|
|
2393
|
+
const mixExs = readMixExs(installDir);
|
|
2394
|
+
return !!mixExs && /\{\s*:phoenix\s*,/.test(mixExs);
|
|
2395
|
+
}
|
|
2396
|
+
const ELIXIR_AGENT_CONFIG = {
|
|
2397
|
+
metadata: {
|
|
2398
|
+
name: "Elixir",
|
|
2399
|
+
integration: "elixir",
|
|
2400
|
+
docsUrl: "https://posthog.com/docs/libraries/elixir",
|
|
2401
|
+
gatherContext: (options) => {
|
|
2402
|
+
const phoenix = isPhoenixProject(options.installDir);
|
|
2403
|
+
return Promise.resolve({ phoenix });
|
|
2404
|
+
}
|
|
2405
|
+
},
|
|
2406
|
+
detection: {
|
|
2407
|
+
packageName: "posthog",
|
|
2408
|
+
packageDisplayName: "Elixir",
|
|
2409
|
+
usesPackageJson: false,
|
|
2410
|
+
getVersion: () => void 0,
|
|
2411
|
+
detect: (options) => {
|
|
2412
|
+
const mixExs = readMixExs(options.installDir);
|
|
2413
|
+
return Promise.resolve(!!mixExs && /def\s+project\b/.test(mixExs));
|
|
2414
|
+
},
|
|
2415
|
+
detectPackageManager: mixPackageManager
|
|
2416
|
+
},
|
|
2417
|
+
environment: {
|
|
2418
|
+
uploadToHosting: false,
|
|
2419
|
+
getEnvVars: (apiKey, host) => ({
|
|
2420
|
+
POSTHOG_API_KEY: apiKey,
|
|
2421
|
+
POSTHOG_HOST: host
|
|
2422
|
+
})
|
|
2423
|
+
},
|
|
2424
|
+
analytics: { getTags: (context) => ({ projectType: context.phoenix ? "phoenix" : "elixir" }) },
|
|
2425
|
+
prompts: {
|
|
2426
|
+
projectTypeDetection: "This is an Elixir project. Look for mix.exs, mix.lock, config/, lib/, and application.ex to confirm; Phoenix apps also have endpoint and router modules.",
|
|
2427
|
+
packageInstallation: "Mix has no single add command. Add `{:posthog, \"~> 2.0\"}` to the deps list in mix.exs, then run `mix deps.get` to fetch it.",
|
|
2428
|
+
getAdditionalContextLines: (context) => {
|
|
2429
|
+
const lines = [`Framework docs ID: elixir (use posthog://docs/frameworks/elixir for documentation)`, "Configure PostHog in application config (api_key, api_host, in_app_otp_apps) reading from environment variables; set test_mode: true in the test environment."];
|
|
2430
|
+
if (context.phoenix) lines.push("This is a Phoenix app — add PostHog.Integrations.Plug before the router so request context is attached to captured events.");
|
|
2431
|
+
return lines;
|
|
2432
|
+
}
|
|
2433
|
+
},
|
|
2434
|
+
ui: {
|
|
2435
|
+
successMessage: "PostHog integration complete",
|
|
2436
|
+
estimatedDurationMinutes: 5,
|
|
2437
|
+
getOutroChanges: (context) => [
|
|
2438
|
+
`Analyzed your ${context.phoenix ? "Phoenix" : "Elixir"} project structure`,
|
|
2439
|
+
"Added the posthog Hex package to mix.exs and fetched it with mix deps.get",
|
|
2440
|
+
"Configured PostHog in application config from environment variables",
|
|
2441
|
+
"Instrumented meaningful events with PostHog.capture"
|
|
2442
|
+
],
|
|
2443
|
+
getOutroNextSteps: (context) => [
|
|
2444
|
+
context.phoenix ? "Start your Phoenix server with `mix phx.server` and trigger the instrumented code paths" : "Run your Elixir application and trigger the instrumented code paths",
|
|
2445
|
+
"Visit your PostHog dashboard to see incoming events",
|
|
2446
|
+
"Use PostHog.capture/2 to track custom events",
|
|
2447
|
+
"Use PostHog.set_context/1 to set a distinct_id once per request or job process"
|
|
2448
|
+
]
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
//#endregion
|
|
2452
|
+
//#region src/frameworks/go/go-wizard-agent.ts
|
|
2453
|
+
function readGoMod(installDir) {
|
|
2454
|
+
const goModPath = path$1.join(installDir, "go.mod");
|
|
2455
|
+
if (!fs$1.existsSync(goModPath)) return;
|
|
2456
|
+
return fs$1.readFileSync(goModPath, "utf-8");
|
|
2457
|
+
}
|
|
2458
|
+
/** The `go 1.x` directive from go.mod (the toolchain floor, not a patch version). */
|
|
2459
|
+
function getGoVersion(installDir) {
|
|
2460
|
+
return readGoMod(installDir)?.match(/^go\s+([\d.]+)/m)?.[1];
|
|
2461
|
+
}
|
|
2462
|
+
const GO_AGENT_CONFIG = {
|
|
2463
|
+
metadata: {
|
|
2464
|
+
name: "Go",
|
|
2465
|
+
integration: "go",
|
|
2466
|
+
docsUrl: "https://posthog.com/docs/libraries/go",
|
|
2467
|
+
gatherContext: (options) => {
|
|
2468
|
+
const goVersion = getGoVersion(options.installDir);
|
|
2469
|
+
return Promise.resolve({ goVersion });
|
|
2470
|
+
}
|
|
2471
|
+
},
|
|
2472
|
+
detection: {
|
|
2473
|
+
packageName: "posthog-go",
|
|
2474
|
+
packageDisplayName: "Go",
|
|
2475
|
+
usesPackageJson: false,
|
|
2476
|
+
getVersion: () => void 0,
|
|
2477
|
+
detect: (options) => {
|
|
2478
|
+
const goMod = readGoMod(options.installDir);
|
|
2479
|
+
return Promise.resolve(!!goMod && /^module\s+\S+/m.test(goMod));
|
|
2480
|
+
},
|
|
2481
|
+
detectPackageManager: goModulesPackageManager
|
|
2482
|
+
},
|
|
2483
|
+
environment: {
|
|
2484
|
+
uploadToHosting: false,
|
|
2485
|
+
getEnvVars: (apiKey, host) => ({
|
|
2486
|
+
POSTHOG_API_KEY: apiKey,
|
|
2487
|
+
POSTHOG_HOST: host
|
|
2488
|
+
})
|
|
2489
|
+
},
|
|
2490
|
+
analytics: { getTags: (context) => ({ goVersion: context.goVersion || "unknown" }) },
|
|
2491
|
+
prompts: {
|
|
2492
|
+
projectTypeDetection: "This is a Go project. Look for go.mod, go.sum, cmd/, internal/, and main packages to confirm.",
|
|
2493
|
+
packageInstallation: "Install the PostHog Go SDK with `go get github.com/posthog/posthog-go`. Do not manually edit go.mod or go.sum; the go tool updates them automatically. Run `go mod tidy` afterwards if imports change.",
|
|
2494
|
+
getAdditionalContextLines: (context) => {
|
|
2495
|
+
const lines = [`Framework docs ID: go (use posthog://docs/frameworks/go for documentation)`];
|
|
2496
|
+
if (context.goVersion) lines.push(`Go version (go.mod directive): ${context.goVersion}`);
|
|
2497
|
+
lines.push("Create one PostHog client per process and close it during graceful shutdown (`defer client.Close()`) so queued events flush.");
|
|
2498
|
+
return lines;
|
|
2499
|
+
}
|
|
2500
|
+
},
|
|
2501
|
+
ui: {
|
|
2502
|
+
successMessage: "PostHog integration complete",
|
|
2503
|
+
estimatedDurationMinutes: 5,
|
|
2504
|
+
getOutroChanges: () => [
|
|
2505
|
+
"Analyzed your Go project structure",
|
|
2506
|
+
"Installed the posthog-go SDK via go get",
|
|
2507
|
+
"Initialized a shared PostHog client configured from environment variables",
|
|
2508
|
+
"Instrumented meaningful server events with client.Enqueue(posthog.Capture{...})"
|
|
2509
|
+
],
|
|
2510
|
+
getOutroNextSteps: () => [
|
|
2511
|
+
"Run your Go service and trigger the instrumented code paths",
|
|
2512
|
+
"Visit your PostHog dashboard to see incoming events",
|
|
2513
|
+
"Use client.Enqueue(posthog.Capture{...}) to track custom events",
|
|
2514
|
+
"Keep client.Close() in your graceful shutdown path so queued events flush"
|
|
2515
|
+
]
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
//#endregion
|
|
2519
|
+
//#region src/frameworks/java/java-wizard-agent.ts
|
|
2520
|
+
const GRADLE_FILES = [
|
|
2521
|
+
"build.gradle",
|
|
2522
|
+
"build.gradle.kts",
|
|
2523
|
+
"settings.gradle",
|
|
2524
|
+
"settings.gradle.kts"
|
|
2525
|
+
];
|
|
2526
|
+
const ANDROID_GRADLE_MARKERS = [
|
|
2527
|
+
"com.android.application",
|
|
2528
|
+
"com.android.library",
|
|
2529
|
+
"com.android.tools.build:gradle"
|
|
2530
|
+
];
|
|
2531
|
+
const KMP_GRADLE_MARKERS = [
|
|
2532
|
+
"kotlin(\"multiplatform\")",
|
|
2533
|
+
"org.jetbrains.kotlin.multiplatform",
|
|
2534
|
+
"kotlin-multiplatform"
|
|
2535
|
+
];
|
|
2536
|
+
function readRootGradleFiles(installDir) {
|
|
2537
|
+
return GRADLE_FILES.map((name) => path$1.join(installDir, name)).filter((p) => fs$1.existsSync(p)).map((p) => fs$1.readFileSync(p, "utf-8"));
|
|
2538
|
+
}
|
|
2539
|
+
function getBuildTool(installDir) {
|
|
2540
|
+
if (fs$1.existsSync(path$1.join(installDir, "pom.xml"))) return "maven";
|
|
2541
|
+
if (readRootGradleFiles(installDir).length > 0) return "gradle";
|
|
2542
|
+
}
|
|
2543
|
+
const JAVA_AGENT_CONFIG = {
|
|
2544
|
+
metadata: {
|
|
2545
|
+
name: "Java",
|
|
2546
|
+
integration: "java",
|
|
2547
|
+
docsUrl: "https://posthog.com/docs/libraries/java",
|
|
2548
|
+
gatherContext: (options) => {
|
|
2549
|
+
const buildTool = getBuildTool(options.installDir);
|
|
2550
|
+
return Promise.resolve({ buildTool });
|
|
2551
|
+
}
|
|
2552
|
+
},
|
|
2553
|
+
detection: {
|
|
2554
|
+
packageName: "posthog-server",
|
|
2555
|
+
packageDisplayName: "Java",
|
|
2556
|
+
usesPackageJson: false,
|
|
2557
|
+
getVersion: () => void 0,
|
|
2558
|
+
detect: async (options) => {
|
|
2559
|
+
const { installDir } = options;
|
|
2560
|
+
if (fs$1.existsSync(path$1.join(installDir, "pubspec.yaml"))) return false;
|
|
2561
|
+
if (fs$1.existsSync(path$1.join(installDir, "pom.xml"))) return true;
|
|
2562
|
+
const gradleContents = readRootGradleFiles(installDir);
|
|
2563
|
+
if (gradleContents.length === 0) return false;
|
|
2564
|
+
const combined = gradleContents.join("\n");
|
|
2565
|
+
if ([...ANDROID_GRADLE_MARKERS, ...KMP_GRADLE_MARKERS].some((marker) => combined.includes(marker))) return false;
|
|
2566
|
+
return (await fg("**/AndroidManifest.xml", {
|
|
2567
|
+
cwd: installDir,
|
|
2568
|
+
ignore: [
|
|
2569
|
+
"**/build/**",
|
|
2570
|
+
"**/node_modules/**",
|
|
2571
|
+
"**/.gradle/**"
|
|
2572
|
+
]
|
|
2573
|
+
})).length === 0;
|
|
2574
|
+
},
|
|
2575
|
+
detectPackageManager: detectJavaPackageManagers
|
|
2576
|
+
},
|
|
2577
|
+
environment: {
|
|
2578
|
+
uploadToHosting: false,
|
|
2579
|
+
getEnvVars: (apiKey, host) => ({
|
|
2580
|
+
POSTHOG_API_KEY: apiKey,
|
|
2581
|
+
POSTHOG_HOST: host
|
|
2582
|
+
})
|
|
2583
|
+
},
|
|
2584
|
+
analytics: { getTags: (context) => ({ buildTool: context.buildTool || "unknown" }) },
|
|
2585
|
+
prompts: {
|
|
2586
|
+
projectTypeDetection: "This is a Java server project. Look for pom.xml (Maven) or build.gradle/build.gradle.kts (Gradle), src/main/java/, and the framework in use (Spring Boot, Quarkus, Micronaut, plain servlets) to confirm.",
|
|
2587
|
+
packageInstallation: "Neither Maven nor Gradle has a single add command. Add the com.posthog:posthog-server dependency (pinned to the latest release on Maven Central) to pom.xml or build.gradle(.kts), matching the existing dependency format, then run `mvn install` or `gradle build` to resolve it.",
|
|
2588
|
+
getAdditionalContextLines: (context) => {
|
|
2589
|
+
const lines = [
|
|
2590
|
+
`Framework docs ID: java (use posthog://docs/frameworks/java for documentation)`,
|
|
2591
|
+
"Use the posthog-server SDK (com.posthog:posthog-server) — posthog-android is a different library and must not be used on the server.",
|
|
2592
|
+
"Create one PostHog client per process with PostHogConfig.builder(...) and PostHog.with(config); call close() during graceful shutdown, and flush() before returning in serverless handlers."
|
|
2593
|
+
];
|
|
2594
|
+
if (context.buildTool) lines.push(`Build tool: ${context.buildTool}`);
|
|
2595
|
+
return lines;
|
|
2596
|
+
}
|
|
2597
|
+
},
|
|
2598
|
+
ui: {
|
|
2599
|
+
successMessage: "PostHog integration complete",
|
|
2600
|
+
estimatedDurationMinutes: 5,
|
|
2601
|
+
getOutroChanges: (context) => [
|
|
2602
|
+
"Analyzed your Java project structure",
|
|
2603
|
+
`Added the posthog-server dependency to your ${context.buildTool === "maven" ? "pom.xml" : "Gradle build"}`,
|
|
2604
|
+
"Initialized a shared PostHog client configured from environment variables",
|
|
2605
|
+
"Instrumented meaningful server events with posthog.capture"
|
|
2606
|
+
],
|
|
2607
|
+
getOutroNextSteps: () => [
|
|
2608
|
+
"Run your Java service and trigger the instrumented code paths",
|
|
2609
|
+
"Visit your PostHog dashboard to see incoming events",
|
|
2610
|
+
"Use posthog.capture(distinctId, eventName, options) to track custom events",
|
|
2611
|
+
"Keep posthog.close() in your graceful shutdown path so queued events flush"
|
|
2612
|
+
]
|
|
2613
|
+
}
|
|
2614
|
+
};
|
|
2615
|
+
//#endregion
|
|
2616
|
+
//#region src/frameworks/rust/rust-wizard-agent.ts
|
|
2617
|
+
function readCargoToml(installDir) {
|
|
2618
|
+
const cargoTomlPath = path$1.join(installDir, "Cargo.toml");
|
|
2619
|
+
if (!fs$1.existsSync(cargoTomlPath)) return;
|
|
2620
|
+
return fs$1.readFileSync(cargoTomlPath, "utf-8");
|
|
2621
|
+
}
|
|
2622
|
+
/** posthog-rs defaults to its async client; projects without an async runtime need the blocking one. */
|
|
2623
|
+
function hasAsyncRuntime(installDir) {
|
|
2624
|
+
const cargoToml = readCargoToml(installDir);
|
|
2625
|
+
return !!cargoToml && /^\s*(tokio|async-std|smol)\s*[=.]/m.test(cargoToml);
|
|
2626
|
+
}
|
|
2627
|
+
const RUST_AGENT_CONFIG = {
|
|
2628
|
+
metadata: {
|
|
2629
|
+
name: "Rust",
|
|
2630
|
+
integration: "rust",
|
|
2631
|
+
docsUrl: "https://posthog.com/docs/libraries/rust",
|
|
2632
|
+
gatherContext: (options) => {
|
|
2633
|
+
const asyncRuntime = hasAsyncRuntime(options.installDir);
|
|
2634
|
+
return Promise.resolve({ asyncRuntime });
|
|
2635
|
+
}
|
|
2636
|
+
},
|
|
2637
|
+
detection: {
|
|
2638
|
+
packageName: "posthog-rs",
|
|
2639
|
+
packageDisplayName: "Rust",
|
|
2640
|
+
usesPackageJson: false,
|
|
2641
|
+
getVersion: () => void 0,
|
|
2642
|
+
detect: (options) => {
|
|
2643
|
+
const cargoToml = readCargoToml(options.installDir);
|
|
2644
|
+
return Promise.resolve(!!cargoToml && /^\s*\[package\]/m.test(cargoToml));
|
|
2645
|
+
},
|
|
2646
|
+
detectPackageManager: cargoPackageManager
|
|
2647
|
+
},
|
|
2648
|
+
environment: {
|
|
2649
|
+
uploadToHosting: false,
|
|
2650
|
+
getEnvVars: (apiKey, host) => ({
|
|
2651
|
+
POSTHOG_API_KEY: apiKey,
|
|
2652
|
+
POSTHOG_HOST: host
|
|
2653
|
+
})
|
|
2654
|
+
},
|
|
2655
|
+
analytics: { getTags: (context) => ({ asyncRuntime: context.asyncRuntime ? "true" : "false" }) },
|
|
2656
|
+
prompts: {
|
|
2657
|
+
projectTypeDetection: "This is a Rust project. Look for Cargo.toml with a [package] section, src/main.rs or src/lib.rs, and Cargo.lock to confirm.",
|
|
2658
|
+
packageInstallation: "Install the PostHog Rust SDK with `cargo add posthog-rs`. Do not manually edit Cargo.toml; cargo updates it automatically.",
|
|
2659
|
+
getAdditionalContextLines: (context) => {
|
|
2660
|
+
const lines = [`Framework docs ID: rust (use posthog://docs/frameworks/rust for documentation)`, "capture() hands events to a background worker — the client must flush() or shutdown() before the process exits or buffered events are lost."];
|
|
2661
|
+
if (context.asyncRuntime) lines.push("An async runtime is present — use the default async posthog-rs client.");
|
|
2662
|
+
else lines.push("No async runtime detected — install with `cargo add posthog-rs --no-default-features` and use the blocking client.");
|
|
2663
|
+
return lines;
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
ui: {
|
|
2667
|
+
successMessage: "PostHog integration complete",
|
|
2668
|
+
estimatedDurationMinutes: 5,
|
|
2669
|
+
getOutroChanges: () => [
|
|
2670
|
+
"Analyzed your Rust project structure",
|
|
2671
|
+
"Installed the posthog-rs crate via cargo add",
|
|
2672
|
+
"Initialized a shared PostHog client configured from environment variables",
|
|
2673
|
+
"Instrumented meaningful events with client.capture"
|
|
2674
|
+
],
|
|
2675
|
+
getOutroNextSteps: () => [
|
|
2676
|
+
"Run your Rust application and trigger the instrumented code paths",
|
|
2677
|
+
"Visit your PostHog dashboard to see incoming events",
|
|
2678
|
+
"Use Event::new(event_name, distinct_id) and client.capture to track custom events",
|
|
2679
|
+
"Keep flush()/shutdown() in your exit path so queued events are sent"
|
|
2680
|
+
]
|
|
2681
|
+
}
|
|
2682
|
+
};
|
|
2683
|
+
//#endregion
|
|
2385
2684
|
//#region src/frameworks/python/python-wizard-agent.ts
|
|
2386
2685
|
const PYTHON_AGENT_CONFIG = {
|
|
2387
2686
|
metadata: {
|
|
@@ -2893,6 +3192,10 @@ const FRAMEWORK_REGISTRY = {
|
|
|
2893
3192
|
["swift"]: SWIFT_AGENT_CONFIG,
|
|
2894
3193
|
["android"]: ANDROID_AGENT_CONFIG,
|
|
2895
3194
|
["rails"]: RAILS_AGENT_CONFIG,
|
|
3195
|
+
["elixir"]: ELIXIR_AGENT_CONFIG,
|
|
3196
|
+
["go"]: GO_AGENT_CONFIG,
|
|
3197
|
+
["rust"]: RUST_AGENT_CONFIG,
|
|
3198
|
+
["java"]: JAVA_AGENT_CONFIG,
|
|
2896
3199
|
["python"]: PYTHON_AGENT_CONFIG,
|
|
2897
3200
|
["ruby"]: RUBY_AGENT_CONFIG,
|
|
2898
3201
|
["javascript_node"]: JAVASCRIPT_NODE_AGENT_CONFIG,
|
|
@@ -2901,4 +3204,4 @@ const FRAMEWORK_REGISTRY = {
|
|
|
2901
3204
|
//#endregion
|
|
2902
3205
|
export { SPINNER_MESSAGE as i, registry_exports as n, DEFAULT_PACKAGE_INSTALLATION as r, FRAMEWORK_REGISTRY as t };
|
|
2903
3206
|
|
|
2904
|
-
//# sourceMappingURL=registry-
|
|
3207
|
+
//# sourceMappingURL=registry-DGJQ_8QI.js.map
|