@posthog/wizard 2.38.1 → 2.39.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 +70 -13
- package/dist/{add-mcp-server-to-clients-BB1_aH5M.js → add-mcp-server-to-clients-Ci0I1vbS.js} +6 -6
- package/dist/{add-mcp-server-to-clients-BB1_aH5M.js.map → add-mcp-server-to-clients-Ci0I1vbS.js.map} +1 -1
- package/dist/{agent-interface-kOuzXg84.js → agent-interface-BR3zAUpM.js} +30 -623
- package/dist/agent-interface-BR3zAUpM.js.map +1 -0
- package/dist/{agent-runner-DZhaiwD5.js → agent-runner-B1fzwFzc.js} +33 -18
- package/dist/agent-runner-B1fzwFzc.js.map +1 -0
- package/dist/{analytics-Z_2kCTpB.js → analytics-C7Oc3yWZ.js} +3 -2
- package/dist/analytics-C7Oc3yWZ.js.map +1 -0
- package/dist/analytics-tVERo8XR.js +2 -0
- package/dist/{api-CwhOyprf.js → api-DSG-l8Ql.js} +3 -3
- package/dist/{api-CwhOyprf.js.map → api-DSG-l8Ql.js.map} +1 -1
- package/dist/bin.js +513 -137
- package/dist/bin.js.map +1 -1
- package/dist/{ci-install-CWDY86uB.js → ci-install-DeAd2HYP.js} +4 -4
- package/dist/{ci-install-CWDY86uB.js.map → ci-install-DeAd2HYP.js.map} +1 -1
- package/dist/{debug-CaRHQrDY.js → debug-BZnZ7Gvh.js} +39 -16
- package/dist/debug-BZnZ7Gvh.js.map +1 -0
- package/dist/{debug-BmdpjMub.js → debug-DtgfvuKF.js} +1 -1
- package/dist/{defaults-a0e6IRjP.js → defaults-BxiMLkQY.js} +1 -1
- package/dist/{defaults-a0e6IRjP.js.map → defaults-BxiMLkQY.js.map} +1 -1
- package/dist/{env-api-key-DEl3LJBv.js → env-api-key-DDVkPQmo.js} +1 -1
- package/dist/{env-api-key-DEl3LJBv.js.map → env-api-key-DDVkPQmo.js.map} +1 -1
- package/dist/{environment-knibpXF2.js → environment-QNoUem74.js} +3 -3
- package/dist/{environment-knibpXF2.js.map → environment-QNoUem74.js.map} +1 -1
- package/dist/{file-utils-DWYX_G1o.js → file-utils-UqdMTR9x.js} +2 -2
- package/dist/{file-utils-DWYX_G1o.js.map → file-utils-UqdMTR9x.js.map} +1 -1
- package/dist/{headless-ui-C4JCi9Zz.js → headless-ui-DtFktXIa.js} +2 -2
- package/dist/{headless-ui-C4JCi9Zz.js.map → headless-ui-DtFktXIa.js.map} +1 -1
- package/dist/{host-resolution-C18FwVrM.js → host-resolution-DjQvur4X.js} +3 -3
- package/dist/{host-resolution-C18FwVrM.js.map → host-resolution-DjQvur4X.js.map} +1 -1
- package/dist/{interactive-46qgS-UA.js → interactive-_8v2Ymw2.js} +2 -2
- package/dist/{interactive-46qgS-UA.js.map → interactive-_8v2Ymw2.js.map} +1 -1
- package/dist/{mcp-QWL5Obf3.js → mcp-BX34188X.js} +2 -2
- package/dist/{mcp-QWL5Obf3.js.map → mcp-BX34188X.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-BpNkFksF.js → mcp-prompt-streaming-l1zsmQQc.js} +4 -4
- package/dist/{mcp-prompt-streaming-BpNkFksF.js.map → mcp-prompt-streaming-l1zsmQQc.js.map} +1 -1
- package/dist/{non-interactive-3_T1d0cj.js → non-interactive-BBCGIDP5.js} +2 -2
- package/dist/{non-interactive-3_T1d0cj.js.map → non-interactive-BBCGIDP5.js.map} +1 -1
- package/dist/{package-manager-C5VVQHQ-.js → package-manager-FY9qPU4z.js} +2 -2
- package/dist/{package-manager-C5VVQHQ-.js.map → package-manager-FY9qPU4z.js.map} +1 -1
- package/dist/{playground-CbzUpMuN.js → playground-B9Gesj-w.js} +5 -5
- package/dist/{playground-CbzUpMuN.js.map → playground-B9Gesj-w.js.map} +1 -1
- package/dist/{posthog-BESrI6-T.js → posthog-BHbtnNQE.js} +1 -1
- package/dist/{posthog-BESrI6-T.js.map → posthog-BHbtnNQE.js.map} +1 -1
- package/dist/{posthog-integration-6vdi4wRB.js → posthog-integration-CMNtIV97.js} +39 -20
- package/dist/posthog-integration-CMNtIV97.js.map +1 -0
- package/dist/{provisioning-DK0tS98H.js → provisioning-BInfIJy5.js} +4 -4
- package/dist/{provisioning-DK0tS98H.js.map → provisioning-BInfIJy5.js.map} +1 -1
- package/dist/{registry-DfXVjxsP.js → registry-BsPnELr-.js} +11 -8
- package/dist/{registry-DfXVjxsP.js.map → registry-BsPnELr-.js.map} +1 -1
- package/dist/security-CSlaLY6P.js +204 -0
- package/dist/security-CSlaLY6P.js.map +1 -0
- package/dist/{setup-utils-v9I6PQyP.js → setup-utils-DfRLklZ3.js} +9 -9
- package/dist/{setup-utils-v9I6PQyP.js.map → setup-utils-DfRLklZ3.js.map} +1 -1
- package/dist/{start-tui-CylEL6i_.js → start-tui-H_BSAFdp.js} +143 -81
- package/dist/start-tui-H_BSAFdp.js.map +1 -0
- package/dist/{steps-DQdpexNM.js → steps-z89LzfJG.js} +7 -7
- package/dist/{steps-DQdpexNM.js.map → steps-z89LzfJG.js.map} +1 -1
- package/dist/{store-Db0X2V5D.js → store-B3B76DgD.js} +7 -5
- package/dist/{store-Db0X2V5D.js.map → store-B3B76DgD.js.map} +1 -1
- package/dist/{subagent-Pk9jRXRf.js → subagent-CV59ljO1.js} +2 -2
- package/dist/{subagent-Pk9jRXRf.js.map → subagent-CV59ljO1.js.map} +1 -1
- package/dist/{task-stream-rC4IEUHC.js → task-stream-d-R9J0g4.js} +2 -2
- package/dist/{task-stream-rC4IEUHC.js.map → task-stream-d-R9J0g4.js.map} +1 -1
- package/dist/{tasks-B46phMJu.js → tasks-DkX454Mg.js} +2 -2
- package/dist/{tasks-B46phMJu.js.map → tasks-DkX454Mg.js.map} +1 -1
- package/dist/{telemetry-BJAHymMq.js → telemetry-BCIe6Kli.js} +3 -3
- package/dist/{telemetry-BJAHymMq.js.map → telemetry-BCIe6Kli.js.map} +1 -1
- package/dist/{terminal-BTQSAkC-.js → terminal-CPXW44sU.js} +13 -12
- package/dist/{terminal-BTQSAkC-.js.map → terminal-CPXW44sU.js.map} +1 -1
- package/dist/{tools-C_m5knXt.js → tools-C4BqVrt6.js} +4 -4
- package/dist/{tools-C_m5knXt.js.map → tools-C4BqVrt6.js.map} +1 -1
- package/dist/types-evL_rPob.js +46 -0
- package/dist/types-evL_rPob.js.map +1 -0
- package/dist/{urls-BCmeQMIb.js → urls-D1AehCBN.js} +2 -2
- package/dist/{urls-BCmeQMIb.js.map → urls-D1AehCBN.js.map} +1 -1
- package/dist/warlock-smoke-test.ts +165 -0
- package/dist/{wizard-abort-DkngXmxN.js → wizard-abort-5fOIcY8w.js} +3 -3
- package/dist/{wizard-abort-DkngXmxN.js.map → wizard-abort-5fOIcY8w.js.map} +1 -1
- package/dist/{wizard-abort-CMzW4LVM.js → wizard-abort-Ce2RceZ1.js} +1 -1
- package/dist/{wizard-tools-C8nVWLeI.js → wizard-tools-xvIrJeNN.js} +44 -102
- package/dist/wizard-tools-xvIrJeNN.js.map +1 -0
- package/dist/yara-hooks-7MEXlgqm.js +2 -0
- package/dist/yara-hooks-DNn1Jqih.js +635 -0
- package/dist/yara-hooks-DNn1Jqih.js.map +1 -0
- package/package.json +5 -3
- package/dist/agent-interface-kOuzXg84.js.map +0 -1
- package/dist/agent-runner-DZhaiwD5.js.map +0 -1
- package/dist/analytics-B1SC2jaf.js +0 -2
- package/dist/analytics-Z_2kCTpB.js.map +0 -1
- package/dist/debug-CaRHQrDY.js.map +0 -1
- package/dist/posthog-integration-6vdi4wRB.js.map +0 -1
- package/dist/security-BMVH_bjk.js +0 -431
- package/dist/security-BMVH_bjk.js.map +0 -1
- package/dist/start-tui-CylEL6i_.js.map +0 -1
- package/dist/wizard-tools-C8nVWLeI.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { n as analytics } from "./analytics-
|
|
4
|
-
import { r as setEntryCommand } from "./telemetry-
|
|
5
|
-
import { n as isUsingTypeScript } from "./setup-utils-
|
|
6
|
-
import { o as getUiHostFromHost } from "./urls-
|
|
7
|
-
import { t as HostResolution } from "./host-resolution-
|
|
8
|
-
import { o as handleApiError } from "./api-
|
|
2
|
+
import { B as POSTHOG_DOCS_URL, P as Integration, a as getLogFilePath, f as getUI, ht as isHeadless, lt as getSkillsBaseUrl, m as LoggingUI, mt as HEADLESS_FLAG, p as setUI, r as debug, s as logToFile, st as WIZARD_USER_AGENT, ut as VERSION } from "./debug-BZnZ7Gvh.js";
|
|
3
|
+
import { n as analytics } from "./analytics-C7Oc3yWZ.js";
|
|
4
|
+
import { r as setEntryCommand } from "./telemetry-BCIe6Kli.js";
|
|
5
|
+
import { n as isUsingTypeScript } from "./setup-utils-DfRLklZ3.js";
|
|
6
|
+
import { o as getUiHostFromHost } from "./urls-D1AehCBN.js";
|
|
7
|
+
import { t as HostResolution } from "./host-resolution-DjQvur4X.js";
|
|
8
|
+
import { o as handleApiError } from "./api-DSG-l8Ql.js";
|
|
9
9
|
import "./wizard-session-BoXAZEOf.js";
|
|
10
|
-
import { r as runCleanups } from "./wizard-abort-
|
|
11
|
-
import { n as isNonInteractiveEnvironment } from "./environment-
|
|
12
|
-
import { n as runAgent, o as authenticate } from "./agent-runner-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { n as
|
|
10
|
+
import { r as runCleanups } from "./wizard-abort-5fOIcY8w.js";
|
|
11
|
+
import { n as isNonInteractiveEnvironment } from "./environment-QNoUem74.js";
|
|
12
|
+
import { n as runAgent, o as authenticate } from "./agent-runner-B1fzwFzc.js";
|
|
13
|
+
import { l as recoverOrphanedSettingsBackups, p as AgentSignals } from "./agent-interface-BR3zAUpM.js";
|
|
14
|
+
import { i as fetchSkillMenu, t as WIZARD_TOOL_NAMES } from "./wizard-tools-xvIrJeNN.js";
|
|
15
|
+
import { n as AUDIT_CHECKS_KEY, r as AUDIT_REPORT_FILE, t as AUDIT_CHECKS_FILE } from "./types-evL_rPob.js";
|
|
16
|
+
import { h as SETUP_REPORT_FILE } from "./yara-hooks-DNn1Jqih.js";
|
|
17
|
+
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-BsPnELr-.js";
|
|
18
|
+
import { _ as gatherFrameworkContext, a as LINE_CHART_BLOCK, b as parseRequirementsTxt, g as detectProjectsWithAgent, h as HEALTH_CHECK_STEP, i as FUNNEL_BLOCK, m as Icons, n as integrationRunStep, o as PRODUCT_SUITE_BLOCK, p as Colors, r as posthogIntegrationConfig, s as StatusPeekTrigger, u as isClearBlock, v as parsePipfile, y as parsePyprojectToml } from "./posthog-integration-CMNtIV97.js";
|
|
19
|
+
import { n as safeReadFile, r as walkProjectFiles, t as IGNORED_DIRS } from "./file-utils-UqdMTR9x.js";
|
|
20
|
+
import { n as readApiKeyFromEnv } from "./env-api-key-DDVkPQmo.js";
|
|
19
21
|
import { satisfies } from "semver";
|
|
20
22
|
import yargs from "yargs";
|
|
21
23
|
import { hideBin } from "yargs/helpers";
|
|
22
24
|
import fs, { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
23
|
-
import path, { join, relative, resolve } from "path";
|
|
25
|
+
import path, { join, relative, resolve, sep } from "path";
|
|
24
26
|
import * as os from "node:os";
|
|
25
27
|
import * as path$1 from "node:path";
|
|
26
28
|
import { spawnSync } from "node:child_process";
|
|
@@ -32,37 +34,6 @@ import { createContext, createElement, useCallback, useContext, useEffect, useRe
|
|
|
32
34
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
35
|
import { access, rm } from "node:fs/promises";
|
|
34
36
|
import * as readline from "node:readline/promises";
|
|
35
|
-
//#region src/lib/headless-mode.ts
|
|
36
|
-
/**
|
|
37
|
-
* Headless mode — the published-build, non-interactive run path.
|
|
38
|
-
*
|
|
39
|
-
* The headless flag and `--ci` both drive a non-interactive install
|
|
40
|
-
* (session.ci === true), but through dedicated entry points so they can
|
|
41
|
-
* diverge: runHeadlessInstall → runWizardHeadless for headless,
|
|
42
|
-
* runCIInstall → runWizardCI for `--ci`. Both delegate to one shared pipeline
|
|
43
|
-
* (runNonInteractive) today; the only forks are the api-key prefixes accepted
|
|
44
|
-
* (ci-install) and the analytics build tag (the mode passed to the runner).
|
|
45
|
-
*
|
|
46
|
-
* The flag is deliberately named `--headless-DONOTUSE-EXPERIMENTAL` and hidden
|
|
47
|
-
* from `--help`: the contract is still unstable and subject to breaking
|
|
48
|
-
* changes, so it must not be advertised or relied on by external callers. This
|
|
49
|
-
* module is the single source of truth for the flag's name and detection — keep
|
|
50
|
-
* the scary name out of every other file so a future rename is one edit here.
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* The on-CLI flag name. Intentionally ugly + undocumented; do not surface it in
|
|
54
|
-
* `--help`, the README, or user-facing error messages.
|
|
55
|
-
*/
|
|
56
|
-
const HEADLESS_FLAG = "headless-DONOTUSE-EXPERIMENTAL";
|
|
57
|
-
/**
|
|
58
|
-
* Read the headless signal off a parsed argv / options bag. yargs always sets
|
|
59
|
-
* the value under the declared key (`HEADLESS_FLAG`), so reading that key is
|
|
60
|
-
* reliable regardless of camel-case expansion.
|
|
61
|
-
*/
|
|
62
|
-
function isHeadless(options) {
|
|
63
|
-
return options[HEADLESS_FLAG] === true;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
37
|
//#region src/commands/command.ts
|
|
67
38
|
/** Extract the bare command word(s) from a yargs name spec, dropping positionals and aliases' arg syntax. */
|
|
68
39
|
function commandKeys(name) {
|
|
@@ -243,7 +214,7 @@ function runProvision(argv) {
|
|
|
243
214
|
}
|
|
244
215
|
async function provision({ email, region, name, baseUrl, jsonMode }) {
|
|
245
216
|
try {
|
|
246
|
-
const { provisionNewAccount } = await import("./provisioning-
|
|
217
|
+
const { provisionNewAccount } = await import("./provisioning-BInfIJy5.js").then((n) => n.n);
|
|
247
218
|
if (!jsonMode) getUI().log.info(`Provisioning account for ${email} in ${region}...`);
|
|
248
219
|
emitResult(await provisionNewAccount(email, name, region, { baseUrl }), jsonMode);
|
|
249
220
|
process.exit(0);
|
|
@@ -308,22 +279,22 @@ const basicIntegrationCommand = {
|
|
|
308
279
|
setEntryCommand("integrate");
|
|
309
280
|
(async () => {
|
|
310
281
|
if (isHeadless(argv)) {
|
|
311
|
-
const { runHeadlessInstall } = await import("./ci-install-
|
|
282
|
+
const { runHeadlessInstall } = await import("./ci-install-DeAd2HYP.js");
|
|
312
283
|
return runHeadlessInstall(argv);
|
|
313
284
|
}
|
|
314
285
|
if (argv.ci) {
|
|
315
|
-
const { runCIInstall } = await import("./ci-install-
|
|
286
|
+
const { runCIInstall } = await import("./ci-install-DeAd2HYP.js");
|
|
316
287
|
return runCIInstall(argv);
|
|
317
288
|
}
|
|
318
289
|
if (isNonInteractiveEnvironment()) {
|
|
319
|
-
const { failNonInteractive } = await import("./non-interactive-
|
|
290
|
+
const { failNonInteractive } = await import("./non-interactive-BBCGIDP5.js");
|
|
320
291
|
return failNonInteractive();
|
|
321
292
|
}
|
|
322
293
|
if (argv.playground) {
|
|
323
|
-
const { runPlayground } = await import("./playground-
|
|
294
|
+
const { runPlayground } = await import("./playground-B9Gesj-w.js");
|
|
324
295
|
return runPlayground();
|
|
325
296
|
}
|
|
326
|
-
const { runInteractive } = await import("./interactive-
|
|
297
|
+
const { runInteractive } = await import("./interactive-_8v2Ymw2.js");
|
|
327
298
|
runInteractive(argv);
|
|
328
299
|
})();
|
|
329
300
|
}
|
|
@@ -516,7 +487,7 @@ const REVENUE_ANALYTICS_PROGRAM = [
|
|
|
516
487
|
* skill-based program (audit, revenue-analytics, agent-skill, etc.)
|
|
517
488
|
* runs. Skill programs don't need the full PostHog onboarding narrative.
|
|
518
489
|
*/
|
|
519
|
-
const getContentBlocks$
|
|
490
|
+
const getContentBlocks$3 = (store) => {
|
|
520
491
|
return [
|
|
521
492
|
{
|
|
522
493
|
content: "Welcome.",
|
|
@@ -549,7 +520,7 @@ const revenueAnalyticsConfig = {
|
|
|
549
520
|
id: "revenue-analytics-setup",
|
|
550
521
|
skillId: "revenue-analytics-setup",
|
|
551
522
|
steps: REVENUE_ANALYTICS_PROGRAM,
|
|
552
|
-
getContentBlocks: getContentBlocks$
|
|
523
|
+
getContentBlocks: getContentBlocks$3,
|
|
553
524
|
allowedTools: ["Agent"],
|
|
554
525
|
disallowedTools: [WIZARD_TOOL_NAMES.wizardAsk],
|
|
555
526
|
run: {
|
|
@@ -1426,7 +1397,7 @@ const warehouseSourceConfig = {
|
|
|
1426
1397
|
id: "warehouse-source",
|
|
1427
1398
|
skillId: "data-warehouse-source-setup",
|
|
1428
1399
|
steps: WAREHOUSE_SOURCE_PROGRAM,
|
|
1429
|
-
getContentBlocks: getContentBlocks$
|
|
1400
|
+
getContentBlocks: getContentBlocks$3,
|
|
1430
1401
|
reportFile: "posthog-warehouse-report.md",
|
|
1431
1402
|
allowedTools: ["Agent"],
|
|
1432
1403
|
run: (session) => Promise.resolve({
|
|
@@ -1486,7 +1457,7 @@ function createSkillProgram(opts) {
|
|
|
1486
1457
|
skillId: opts.skillId,
|
|
1487
1458
|
steps: AGENT_SKILL_STEPS,
|
|
1488
1459
|
reportFile: opts.reportFile,
|
|
1489
|
-
getContentBlocks: getContentBlocks$
|
|
1460
|
+
getContentBlocks: getContentBlocks$3,
|
|
1490
1461
|
run: {
|
|
1491
1462
|
skillId: opts.skillId,
|
|
1492
1463
|
integrationLabel: opts.integrationLabel,
|
|
@@ -2354,7 +2325,7 @@ const PRICING_STRUCTURE_BLOCK = {
|
|
|
2354
2325
|
* - posthog.com/docs/feature-flags/common-questions
|
|
2355
2326
|
* - posthog.com/docs/experiments/best-practices
|
|
2356
2327
|
*/
|
|
2357
|
-
const getContentBlocks$
|
|
2328
|
+
const getContentBlocks$2 = (store) => [
|
|
2358
2329
|
{
|
|
2359
2330
|
content: "Hello.",
|
|
2360
2331
|
pause: 3e3,
|
|
@@ -2600,7 +2571,7 @@ const migrationConfig = {
|
|
|
2600
2571
|
skillId: DEFAULT_MIGRATE_SKILL_ID,
|
|
2601
2572
|
steps: MIGRATION_PROGRAM,
|
|
2602
2573
|
reportFile: MIGRATION_REPORT_FILE,
|
|
2603
|
-
getContentBlocks: getContentBlocks$
|
|
2574
|
+
getContentBlocks: getContentBlocks$2,
|
|
2604
2575
|
allowedTools: ["Agent"],
|
|
2605
2576
|
disallowedTools: [WIZARD_TOOL_NAMES.wizardAsk],
|
|
2606
2577
|
run: {
|
|
@@ -3054,7 +3025,7 @@ const GROUPING = {
|
|
|
3054
3025
|
})
|
|
3055
3026
|
]
|
|
3056
3027
|
};
|
|
3057
|
-
const getContentBlocks = (store) => pace([
|
|
3028
|
+
const getContentBlocks$1 = (store) => pace([
|
|
3058
3029
|
{
|
|
3059
3030
|
content: "Welcome.",
|
|
3060
3031
|
pause: 3e3,
|
|
@@ -3212,7 +3183,7 @@ const errorTrackingUploadSourceMapsConfig = {
|
|
|
3212
3183
|
requiresAi: true,
|
|
3213
3184
|
steps: ERROR_TRACKING_UPLOAD_SOURCE_MAPS_PROGRAM,
|
|
3214
3185
|
reportFile: REPORT_FILE$1,
|
|
3215
|
-
getContentBlocks,
|
|
3186
|
+
getContentBlocks: getContentBlocks$1,
|
|
3216
3187
|
requires: ["posthog-integration"],
|
|
3217
3188
|
run: (_session) => {
|
|
3218
3189
|
const readSelection = () => {
|
|
@@ -3295,7 +3266,102 @@ const POSTHOG_PRESENT_KEY = "postHogPresent";
|
|
|
3295
3266
|
* into the chosen sub-app, not the root.
|
|
3296
3267
|
*/
|
|
3297
3268
|
const SELF_DRIVING_INTEGRATE_PATH_KEY = "selfDrivingIntegratePath";
|
|
3298
|
-
const POSTHOG_PACKAGE_RE = /(^|["'\s
|
|
3269
|
+
const POSTHOG_PACKAGE_RE = /(^|["'\s/=:.@])posthog/im;
|
|
3270
|
+
const POSTHOG_MANIFESTS = [
|
|
3271
|
+
"package.json",
|
|
3272
|
+
"requirements.txt",
|
|
3273
|
+
"pyproject.toml",
|
|
3274
|
+
"Pipfile",
|
|
3275
|
+
"setup.py",
|
|
3276
|
+
"Gemfile",
|
|
3277
|
+
"go.mod",
|
|
3278
|
+
"composer.json",
|
|
3279
|
+
"pubspec.yaml",
|
|
3280
|
+
"Package.swift",
|
|
3281
|
+
"Podfile",
|
|
3282
|
+
"Podfile.lock",
|
|
3283
|
+
"project.yml",
|
|
3284
|
+
"build.gradle",
|
|
3285
|
+
"build.gradle.kts",
|
|
3286
|
+
"gradle/libs.versions.toml",
|
|
3287
|
+
"pom.xml",
|
|
3288
|
+
"mix.exs",
|
|
3289
|
+
"Cargo.toml"
|
|
3290
|
+
];
|
|
3291
|
+
const POSTHOG_DIRS = [
|
|
3292
|
+
".",
|
|
3293
|
+
"app",
|
|
3294
|
+
"frontend",
|
|
3295
|
+
"backend",
|
|
3296
|
+
"ios",
|
|
3297
|
+
"android",
|
|
3298
|
+
"android/app"
|
|
3299
|
+
];
|
|
3300
|
+
const WALK_SKIP_DIRS = new Set([
|
|
3301
|
+
"node_modules",
|
|
3302
|
+
"Pods",
|
|
3303
|
+
"Carthage",
|
|
3304
|
+
"DerivedData",
|
|
3305
|
+
".build",
|
|
3306
|
+
"build",
|
|
3307
|
+
"dist",
|
|
3308
|
+
"out",
|
|
3309
|
+
".next",
|
|
3310
|
+
"coverage",
|
|
3311
|
+
"vendor",
|
|
3312
|
+
".venv",
|
|
3313
|
+
"site-packages",
|
|
3314
|
+
"target",
|
|
3315
|
+
".git"
|
|
3316
|
+
]);
|
|
3317
|
+
const WALK_MAX_DEPTH = 2;
|
|
3318
|
+
/**
|
|
3319
|
+
* The install dir plus every directory within WALK_MAX_DEPTH levels (skipping
|
|
3320
|
+
* heavy/vendored trees and dotdirs), unioned with the explicit POSTHOG_DIRS. A
|
|
3321
|
+
* full shallow walk on top of the named dirs, so a monorepo's nested apps
|
|
3322
|
+
* (e.g. `apps/mobile`) are seen without hardcoding the path.
|
|
3323
|
+
*/
|
|
3324
|
+
function scanDirs(installDir) {
|
|
3325
|
+
const rels = new Set(POSTHOG_DIRS);
|
|
3326
|
+
const walk = (rel, depth) => {
|
|
3327
|
+
rels.add(rel);
|
|
3328
|
+
if (depth >= WALK_MAX_DEPTH) return;
|
|
3329
|
+
let entries;
|
|
3330
|
+
try {
|
|
3331
|
+
entries = readdirSync(join(installDir, rel), { withFileTypes: true });
|
|
3332
|
+
} catch {
|
|
3333
|
+
return;
|
|
3334
|
+
}
|
|
3335
|
+
for (const e of entries) {
|
|
3336
|
+
if (!e.isDirectory()) continue;
|
|
3337
|
+
if (e.name.startsWith(".") || WALK_SKIP_DIRS.has(e.name)) continue;
|
|
3338
|
+
if (e.name.endsWith(".xcodeproj") || e.name.endsWith(".xcworkspace")) continue;
|
|
3339
|
+
walk(rel === "." ? e.name : `${rel}/${e.name}`, depth + 1);
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
walk(".", 0);
|
|
3343
|
+
return [...rels];
|
|
3344
|
+
}
|
|
3345
|
+
/**
|
|
3346
|
+
* True if a `*.xcodeproj/project.pbxproj` or `*.csproj`/`*.fsproj` in
|
|
3347
|
+
* `dirPath` references PostHog.
|
|
3348
|
+
*/
|
|
3349
|
+
function projectFileHasPostHog(dirPath) {
|
|
3350
|
+
let entries;
|
|
3351
|
+
try {
|
|
3352
|
+
entries = readdirSync(dirPath);
|
|
3353
|
+
} catch {
|
|
3354
|
+
return false;
|
|
3355
|
+
}
|
|
3356
|
+
for (const entry of entries) {
|
|
3357
|
+
const target = entry.endsWith(".xcodeproj") ? join(dirPath, entry, "project.pbxproj") : entry.endsWith(".csproj") || entry.endsWith(".fsproj") ? join(dirPath, entry) : null;
|
|
3358
|
+
if (!target || !existsSync(target)) continue;
|
|
3359
|
+
try {
|
|
3360
|
+
if (POSTHOG_PACKAGE_RE.test(readFileSync(target, "utf8"))) return true;
|
|
3361
|
+
} catch {}
|
|
3362
|
+
}
|
|
3363
|
+
return false;
|
|
3364
|
+
}
|
|
3299
3365
|
/**
|
|
3300
3366
|
* Deterministic, offline check: does the project already have a PostHog SDK?
|
|
3301
3367
|
* Scans the common dependency manifests at the install dir for a `posthog`
|
|
@@ -3304,27 +3370,16 @@ const POSTHOG_PACKAGE_RE = /(^|["'\s/=])posthog/im;
|
|
|
3304
3370
|
* first ("not found") or proceeds straight to setup ("found").
|
|
3305
3371
|
*/
|
|
3306
3372
|
function detectPostHogPresent(installDir) {
|
|
3307
|
-
const
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
for (const dir of [
|
|
3318
|
-
".",
|
|
3319
|
-
"app",
|
|
3320
|
-
"frontend",
|
|
3321
|
-
"backend"
|
|
3322
|
-
]) for (const name of manifests) {
|
|
3323
|
-
const path = join(installDir, dir, name);
|
|
3324
|
-
if (!existsSync(path)) continue;
|
|
3325
|
-
try {
|
|
3326
|
-
if (POSTHOG_PACKAGE_RE.test(readFileSync(path, "utf8"))) return true;
|
|
3327
|
-
} catch {}
|
|
3373
|
+
for (const dir of scanDirs(installDir)) {
|
|
3374
|
+
const dirPath = join(installDir, dir);
|
|
3375
|
+
for (const name of POSTHOG_MANIFESTS) {
|
|
3376
|
+
const path = join(dirPath, name);
|
|
3377
|
+
if (!existsSync(path)) continue;
|
|
3378
|
+
try {
|
|
3379
|
+
if (POSTHOG_PACKAGE_RE.test(readFileSync(path, "utf8"))) return true;
|
|
3380
|
+
} catch {}
|
|
3381
|
+
}
|
|
3382
|
+
if (projectFileHasPostHog(dirPath)) return true;
|
|
3328
3383
|
}
|
|
3329
3384
|
return false;
|
|
3330
3385
|
}
|
|
@@ -3421,7 +3476,7 @@ function classify(integration, hasPostHog) {
|
|
|
3421
3476
|
};
|
|
3422
3477
|
return { instrumentable: true };
|
|
3423
3478
|
}
|
|
3424
|
-
/** Map a
|
|
3479
|
+
/** Map a detection report into classified projects (exported for tests). */
|
|
3425
3480
|
function toIntegrationReport(report) {
|
|
3426
3481
|
return {
|
|
3427
3482
|
repoType: report.repoType,
|
|
@@ -3432,6 +3487,7 @@ function toIntegrationReport(report) {
|
|
|
3432
3487
|
framework: p.framework,
|
|
3433
3488
|
integration,
|
|
3434
3489
|
hasPostHog: p.hasPostHog,
|
|
3490
|
+
continuable: p.hasPostHog,
|
|
3435
3491
|
...classify(integration, p.hasPostHog)
|
|
3436
3492
|
};
|
|
3437
3493
|
})
|
|
@@ -3487,10 +3543,18 @@ async function prepSelfDrivingIntegration(session) {
|
|
|
3487
3543
|
*/
|
|
3488
3544
|
/** True once detection found PostHog already present in the project. */
|
|
3489
3545
|
const postHogPresent = (session) => session.frameworkContext[POSTHOG_PRESENT_KEY] === true;
|
|
3490
|
-
/**
|
|
3546
|
+
/**
|
|
3547
|
+
* Absolute dir to integrate into: the picked sub-app, else the repo root.
|
|
3548
|
+
* The picked path originates from LLM output; if it resolves outside the
|
|
3549
|
+
* repo (defense-in-depth on top of the coerce-layer clamp), fall back to
|
|
3550
|
+
* the root rather than run the agent elsewhere.
|
|
3551
|
+
*/
|
|
3491
3552
|
const integrationDir = (session) => {
|
|
3492
3553
|
const rel = session.frameworkContext[SELF_DRIVING_INTEGRATE_PATH_KEY];
|
|
3493
|
-
|
|
3554
|
+
if (typeof rel !== "string" || rel === ".") return session.installDir;
|
|
3555
|
+
const root = resolve(session.installDir);
|
|
3556
|
+
const dir = resolve(root, rel);
|
|
3557
|
+
return dir === root || dir.startsWith(root + sep) ? dir : root;
|
|
3494
3558
|
};
|
|
3495
3559
|
const SELF_DRIVING_PROGRAM = [
|
|
3496
3560
|
{
|
|
@@ -3524,7 +3588,7 @@ const SELF_DRIVING_PROGRAM = [
|
|
|
3524
3588
|
label: "Detecting",
|
|
3525
3589
|
screenId: "self-driving-integration-detect",
|
|
3526
3590
|
show: (session) => session.integrate === true && session.integration == null,
|
|
3527
|
-
isComplete: (session) => session.integration != null
|
|
3591
|
+
isComplete: (session) => session.integration != null || session.integrate === false
|
|
3528
3592
|
},
|
|
3529
3593
|
{
|
|
3530
3594
|
...integrationRunStep,
|
|
@@ -3712,28 +3776,344 @@ STEP 7 — Write the report and hand off. (skill: "Report")
|
|
|
3712
3776
|
//#region src/lib/programs/self-driving/content/tips.ts
|
|
3713
3777
|
const SELF_DRIVING_TIPS = [
|
|
3714
3778
|
{
|
|
3715
|
-
id: "
|
|
3716
|
-
title: "
|
|
3717
|
-
description: "A
|
|
3779
|
+
id: "signal-source",
|
|
3780
|
+
title: "Signal source",
|
|
3781
|
+
description: "A stream PostHog watches: errors, replays, support, GitHub or Linear issues."
|
|
3782
|
+
},
|
|
3783
|
+
{
|
|
3784
|
+
id: "scout",
|
|
3785
|
+
title: "Scout",
|
|
3786
|
+
description: "An agent on a schedule, watching your sources for anomalies and patterns."
|
|
3718
3787
|
},
|
|
3719
3788
|
{
|
|
3720
|
-
id: "
|
|
3721
|
-
title: "
|
|
3722
|
-
description: "
|
|
3789
|
+
id: "signal-report",
|
|
3790
|
+
title: "Signal → report",
|
|
3791
|
+
description: "One finding with evidence and a suggested action. Signals group into prioritized reports in your inbox."
|
|
3723
3792
|
},
|
|
3724
3793
|
{
|
|
3725
|
-
id: "
|
|
3726
|
-
title: "
|
|
3727
|
-
description: "
|
|
3794
|
+
id: "the-loop",
|
|
3795
|
+
title: "The loop",
|
|
3796
|
+
description: "After a fix ships, PostHog measures the result. If the pattern persists, a new signal reopens the work."
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
id: "work-anywhere",
|
|
3800
|
+
title: "Work anywhere",
|
|
3801
|
+
description: "Your inbox is in the PostHog app, Slack (tag @PostHog), and MCP. You can work from anywhere."
|
|
3728
3802
|
}
|
|
3729
3803
|
];
|
|
3730
3804
|
const getTips = () => SELF_DRIVING_TIPS;
|
|
3731
3805
|
//#endregion
|
|
3806
|
+
//#region src/lib/programs/self-driving/content/pipeline-diagram.tsx
|
|
3807
|
+
/**
|
|
3808
|
+
* PIPELINE_BLOCK — ASCII diagram of the Self-driving loop: sources feed
|
|
3809
|
+
* scouts, scouts raise signals, signals group into reports, reports land
|
|
3810
|
+
* in the inbox, shipped fixes get measured, and misses loop back as new
|
|
3811
|
+
* signals. Kept under ~38 chars wide so it fits the LearnCard pane at an
|
|
3812
|
+
* 80-column terminal.
|
|
3813
|
+
*/
|
|
3814
|
+
const PIPELINE_BLOCK = {
|
|
3815
|
+
type: "lines",
|
|
3816
|
+
interval: 300,
|
|
3817
|
+
pause: 8e3,
|
|
3818
|
+
lines: [
|
|
3819
|
+
/* @__PURE__ */ jsxs(Text, { children: [" ", /* @__PURE__ */ jsx(Text, {
|
|
3820
|
+
bold: true,
|
|
3821
|
+
color: "cyan",
|
|
3822
|
+
children: "signal sources"
|
|
3823
|
+
})] }),
|
|
3824
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3825
|
+
dimColor: true,
|
|
3826
|
+
children: " errors · replays · support"
|
|
3827
|
+
}),
|
|
3828
|
+
/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
3829
|
+
color: "gray",
|
|
3830
|
+
children: " ↓ "
|
|
3831
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
3832
|
+
bold: true,
|
|
3833
|
+
color: Colors.accent,
|
|
3834
|
+
children: "scouts"
|
|
3835
|
+
})] }),
|
|
3836
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3837
|
+
dimColor: true,
|
|
3838
|
+
children: " watching on a schedule"
|
|
3839
|
+
}),
|
|
3840
|
+
/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
3841
|
+
color: "gray",
|
|
3842
|
+
children: " ↓ "
|
|
3843
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
3844
|
+
bold: true,
|
|
3845
|
+
color: Colors.accent,
|
|
3846
|
+
children: "signals"
|
|
3847
|
+
})] }),
|
|
3848
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3849
|
+
dimColor: true,
|
|
3850
|
+
children: " finding + evidence + action"
|
|
3851
|
+
}),
|
|
3852
|
+
/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
3853
|
+
color: "gray",
|
|
3854
|
+
children: " ↓ "
|
|
3855
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
3856
|
+
bold: true,
|
|
3857
|
+
color: Colors.accent,
|
|
3858
|
+
children: "reports"
|
|
3859
|
+
})] }),
|
|
3860
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3861
|
+
dimColor: true,
|
|
3862
|
+
children: " grouped and prioritized"
|
|
3863
|
+
}),
|
|
3864
|
+
/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
3865
|
+
color: "gray",
|
|
3866
|
+
children: " ↓ "
|
|
3867
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
3868
|
+
bold: true,
|
|
3869
|
+
color: "green",
|
|
3870
|
+
children: "your inbox"
|
|
3871
|
+
})] }),
|
|
3872
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3873
|
+
dimColor: true,
|
|
3874
|
+
children: " investigate · tag · ship a PR"
|
|
3875
|
+
}),
|
|
3876
|
+
/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
3877
|
+
color: "gray",
|
|
3878
|
+
children: " ↓ "
|
|
3879
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
3880
|
+
bold: true,
|
|
3881
|
+
color: Colors.accent,
|
|
3882
|
+
children: "measured"
|
|
3883
|
+
})] }),
|
|
3884
|
+
/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
3885
|
+
color: "cyan",
|
|
3886
|
+
children: " ↺ "
|
|
3887
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
3888
|
+
dimColor: true,
|
|
3889
|
+
children: "didn't fix it? a new signal"
|
|
3890
|
+
})] })
|
|
3891
|
+
]
|
|
3892
|
+
};
|
|
3893
|
+
//#endregion
|
|
3894
|
+
//#region src/lib/programs/self-driving/content/index.tsx
|
|
3895
|
+
/**
|
|
3896
|
+
* Self-driving learn-deck — the narrative script played while the agent
|
|
3897
|
+
* sets up Self-driving. Teaches the vocabulary ladder (signal source →
|
|
3898
|
+
* scout → signal → report → action → measured loop) before the agent's
|
|
3899
|
+
* questions use those nouns, and explains why GitHub is required before
|
|
3900
|
+
* the connect ask lands.
|
|
3901
|
+
*
|
|
3902
|
+
* One deck for every self-driving run. On the integrate path it plays
|
|
3903
|
+
* during the install run (the pane belongs to whichever run screen shows
|
|
3904
|
+
* first), so it doubles as the wait-time read.
|
|
3905
|
+
*/
|
|
3906
|
+
const CLEAR = {
|
|
3907
|
+
type: "clear",
|
|
3908
|
+
pause: 2e3
|
|
3909
|
+
};
|
|
3910
|
+
const getContentBlocks = (store) => {
|
|
3911
|
+
return [
|
|
3912
|
+
{
|
|
3913
|
+
content: "Welcome.",
|
|
3914
|
+
pause: 3e3,
|
|
3915
|
+
mode: 0,
|
|
3916
|
+
animationInterval: 160
|
|
3917
|
+
},
|
|
3918
|
+
{
|
|
3919
|
+
content: "The Wizard is an agent.",
|
|
3920
|
+
pause: 4e3
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
content: "It's setting up PostHog Self-driving for this project.",
|
|
3924
|
+
pause: 5e3
|
|
3925
|
+
},
|
|
3926
|
+
{
|
|
3927
|
+
content: "We'll occasionally need your input. Stick around.",
|
|
3928
|
+
pause: 6e3
|
|
3929
|
+
},
|
|
3930
|
+
CLEAR,
|
|
3931
|
+
{
|
|
3932
|
+
pause: 5e3,
|
|
3933
|
+
persist: true,
|
|
3934
|
+
content: /* @__PURE__ */ jsx(StatusPeekTrigger, { store })
|
|
3935
|
+
},
|
|
3936
|
+
{
|
|
3937
|
+
pause: 6e3,
|
|
3938
|
+
content: /* @__PURE__ */ jsxs(Text, { children: [
|
|
3939
|
+
"Press",
|
|
3940
|
+
" ",
|
|
3941
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3942
|
+
color: Colors.accent,
|
|
3943
|
+
bold: true,
|
|
3944
|
+
children: "S"
|
|
3945
|
+
}),
|
|
3946
|
+
" ",
|
|
3947
|
+
"to expand or collapse the status."
|
|
3948
|
+
] })
|
|
3949
|
+
},
|
|
3950
|
+
CLEAR,
|
|
3951
|
+
{
|
|
3952
|
+
content: "Your PostHog tools all share one data layer.",
|
|
3953
|
+
pause: 4e3
|
|
3954
|
+
},
|
|
3955
|
+
{
|
|
3956
|
+
content: "Analytics, replays, errors, flags: they all share the same users, mapped across every tool.",
|
|
3957
|
+
pause: 6e3
|
|
3958
|
+
},
|
|
3959
|
+
{
|
|
3960
|
+
content: "Together, they show how people really use your product.",
|
|
3961
|
+
pause: 5e3
|
|
3962
|
+
},
|
|
3963
|
+
{
|
|
3964
|
+
content: "Piecing that together used to be manual work. That's what Self-driving automates.",
|
|
3965
|
+
pause: 6e3
|
|
3966
|
+
},
|
|
3967
|
+
CLEAR,
|
|
3968
|
+
{
|
|
3969
|
+
content: "A coding agent sees your code, but not how your product is used.",
|
|
3970
|
+
pause: 5e3
|
|
3971
|
+
},
|
|
3972
|
+
{
|
|
3973
|
+
content: "PostHog knows what your users actually do.",
|
|
3974
|
+
pause: 4e3
|
|
3975
|
+
},
|
|
3976
|
+
{
|
|
3977
|
+
content: "Self-driving puts an agent in the loop.",
|
|
3978
|
+
pause: 5e3
|
|
3979
|
+
},
|
|
3980
|
+
{
|
|
3981
|
+
content: "That's why setup will ask to connect GitHub: so Self-driving can access your code and your context, together.",
|
|
3982
|
+
pause: 6e3
|
|
3983
|
+
},
|
|
3984
|
+
CLEAR,
|
|
3985
|
+
{
|
|
3986
|
+
content: "Each PostHog tool you enable is a signal source.",
|
|
3987
|
+
pause: 4e3
|
|
3988
|
+
},
|
|
3989
|
+
{
|
|
3990
|
+
content: "Errors, replays, support tickets, GitHub or Linear issues: they're all streams of product usage.",
|
|
3991
|
+
pause: 6e3
|
|
3992
|
+
},
|
|
3993
|
+
CLEAR,
|
|
3994
|
+
{
|
|
3995
|
+
content: "Scouts are agents that watch those sources on a schedule.",
|
|
3996
|
+
pause: 5e3
|
|
3997
|
+
},
|
|
3998
|
+
{
|
|
3999
|
+
content: "They look for anomalies and patterns: a spike in errors or a funnel quietly dropping.",
|
|
4000
|
+
pause: 6e3
|
|
4001
|
+
},
|
|
4002
|
+
{
|
|
4003
|
+
content: "Setup tunes your scouts to fit your product.",
|
|
4004
|
+
pause: 4e3
|
|
4005
|
+
},
|
|
4006
|
+
CLEAR,
|
|
4007
|
+
{
|
|
4008
|
+
content: "When a scout finds something worth your attention, that's a signal.",
|
|
4009
|
+
pause: 5e3
|
|
4010
|
+
},
|
|
4011
|
+
{
|
|
4012
|
+
content: "Each signal carries the finding, the evidence, and a suggested action.",
|
|
4013
|
+
pause: 5e3
|
|
4014
|
+
},
|
|
4015
|
+
{
|
|
4016
|
+
content: "Related signals group into reports, sorted by priority.",
|
|
4017
|
+
pause: 4e3
|
|
4018
|
+
},
|
|
4019
|
+
CLEAR,
|
|
4020
|
+
{
|
|
4021
|
+
content: "Here's the whole loop.",
|
|
4022
|
+
pause: 1e3
|
|
4023
|
+
},
|
|
4024
|
+
PIPELINE_BLOCK,
|
|
4025
|
+
CLEAR,
|
|
4026
|
+
{
|
|
4027
|
+
content: "Reports land in your Self-driving inbox.",
|
|
4028
|
+
pause: 4e3
|
|
4029
|
+
},
|
|
4030
|
+
{
|
|
4031
|
+
content: "Investigate with the agent, tag teammates, or kick off a PR.",
|
|
4032
|
+
pause: 6e3
|
|
4033
|
+
},
|
|
4034
|
+
CLEAR,
|
|
4035
|
+
{
|
|
4036
|
+
content: "And after the PR ships, PostHog measures the result.",
|
|
4037
|
+
pause: 5e3
|
|
4038
|
+
},
|
|
4039
|
+
{
|
|
4040
|
+
content: "Did the fix actually address the pattern?",
|
|
4041
|
+
pause: 4e3
|
|
4042
|
+
},
|
|
4043
|
+
{
|
|
4044
|
+
content: "If not, a new signal surfaces, and the loop keeps working.",
|
|
4045
|
+
pause: 6e3
|
|
4046
|
+
},
|
|
4047
|
+
CLEAR,
|
|
4048
|
+
{
|
|
4049
|
+
content: "Work with Self-driving wherever you already are:",
|
|
4050
|
+
pause: 2e3
|
|
4051
|
+
},
|
|
4052
|
+
{
|
|
4053
|
+
type: "lines",
|
|
4054
|
+
interval: 800,
|
|
4055
|
+
pause: 6e3,
|
|
4056
|
+
lines: [
|
|
4057
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
4058
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4059
|
+
color: "cyan",
|
|
4060
|
+
children: " ◆ "
|
|
4061
|
+
}),
|
|
4062
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4063
|
+
bold: true,
|
|
4064
|
+
children: "Inbox"
|
|
4065
|
+
}),
|
|
4066
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4067
|
+
dimColor: true,
|
|
4068
|
+
children: " the PostHog web app"
|
|
4069
|
+
})
|
|
4070
|
+
] }),
|
|
4071
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
4072
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4073
|
+
color: "cyan",
|
|
4074
|
+
children: " ◆ "
|
|
4075
|
+
}),
|
|
4076
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4077
|
+
bold: true,
|
|
4078
|
+
children: "Slack"
|
|
4079
|
+
}),
|
|
4080
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4081
|
+
dimColor: true,
|
|
4082
|
+
children: " tag @PostHog"
|
|
4083
|
+
})
|
|
4084
|
+
] }),
|
|
4085
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
4086
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4087
|
+
color: "cyan",
|
|
4088
|
+
children: " ◆ "
|
|
4089
|
+
}),
|
|
4090
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4091
|
+
bold: true,
|
|
4092
|
+
children: "MCP"
|
|
4093
|
+
}),
|
|
4094
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4095
|
+
dimColor: true,
|
|
4096
|
+
children: " your agents and editors"
|
|
4097
|
+
})
|
|
4098
|
+
] })
|
|
4099
|
+
]
|
|
4100
|
+
},
|
|
4101
|
+
{
|
|
4102
|
+
content: "Product usage data becomes real, shippable change.",
|
|
4103
|
+
pause: 5e3
|
|
4104
|
+
},
|
|
4105
|
+
{
|
|
4106
|
+
content: "Your product drives itself.",
|
|
4107
|
+
pause: 1e4
|
|
4108
|
+
}
|
|
4109
|
+
];
|
|
4110
|
+
};
|
|
4111
|
+
//#endregion
|
|
3732
4112
|
//#region src/lib/programs/self-driving/index.ts
|
|
3733
4113
|
const SELF_DRIVING_SKILL_ID = "self-driving-setup";
|
|
3734
4114
|
const REPORT_FILE = "posthog-self-driving-report.md";
|
|
3735
4115
|
const DOCS_URL = "https://posthog.com/docs";
|
|
3736
|
-
const SUCCESS_MESSAGE = "Self-driving is on
|
|
4116
|
+
const SUCCESS_MESSAGE = "Self-driving is on. PostHog is scanning your project; first findings hit your inbox within ~30 minutes.";
|
|
3737
4117
|
const WIZARD_MARKER = ".posthog-wizard";
|
|
3738
4118
|
/**
|
|
3739
4119
|
* Remove the installed setup skill. It is transient orchestration
|
|
@@ -3774,7 +4154,7 @@ const run = {
|
|
|
3774
4154
|
buildOutroData: (_session, credentials) => {
|
|
3775
4155
|
return {
|
|
3776
4156
|
kind: "success",
|
|
3777
|
-
message:
|
|
4157
|
+
message: SUCCESS_MESSAGE,
|
|
3778
4158
|
primaryLink: {
|
|
3779
4159
|
label: "Your Self-driving inbox",
|
|
3780
4160
|
url: `${getUiHostFromHost(credentials.host).replace(/\/$/, "")}/project/${credentials.projectId}/inbox`
|
|
@@ -3782,9 +4162,10 @@ const run = {
|
|
|
3782
4162
|
nextSteps: {
|
|
3783
4163
|
heading: "In your inbox you can:",
|
|
3784
4164
|
items: [
|
|
3785
|
-
"
|
|
3786
|
-
"
|
|
3787
|
-
"Kick off
|
|
4165
|
+
"Investigate reports with the agent",
|
|
4166
|
+
"Tag teammates to loop them in",
|
|
4167
|
+
"Kick off a PR when you like the proposed fix",
|
|
4168
|
+
"Or work from Slack (tag @PostHog) and MCP"
|
|
3788
4169
|
]
|
|
3789
4170
|
},
|
|
3790
4171
|
reportFile: REPORT_FILE
|
|
@@ -3809,13 +4190,7 @@ const selfDrivingConfig = {
|
|
|
3809
4190
|
steps: SELF_DRIVING_PROGRAM,
|
|
3810
4191
|
run,
|
|
3811
4192
|
getTips,
|
|
3812
|
-
getContentBlocks
|
|
3813
|
-
const blocks = getContentBlocks$2(store);
|
|
3814
|
-
return blocks.map((b, i) => i === blocks.length - 1 && typeof b === "object" ? {
|
|
3815
|
-
...b,
|
|
3816
|
-
pause: 5e3
|
|
3817
|
-
} : b);
|
|
3818
|
-
}
|
|
4193
|
+
getContentBlocks
|
|
3819
4194
|
};
|
|
3820
4195
|
//#endregion
|
|
3821
4196
|
//#region src/lib/programs/mcp/index.ts
|
|
@@ -3954,7 +4329,7 @@ const agentSkillConfig = {
|
|
|
3954
4329
|
id: "agent-skill",
|
|
3955
4330
|
description: "Run an arbitrary context-mill skill",
|
|
3956
4331
|
steps: AGENT_SKILL_STEPS,
|
|
3957
|
-
getContentBlocks: getContentBlocks$
|
|
4332
|
+
getContentBlocks: getContentBlocks$3,
|
|
3958
4333
|
allowedTools: ["Agent"],
|
|
3959
4334
|
run: (session) => {
|
|
3960
4335
|
const skillId = session.skillId ?? "agent-skill";
|
|
@@ -4043,12 +4418,12 @@ const mcpAddCommand = {
|
|
|
4043
4418
|
function runMcpAdd(argv) {
|
|
4044
4419
|
const features = parseFeatures(argv.features);
|
|
4045
4420
|
(async () => {
|
|
4046
|
-
const { readApiKeyFromEnv } = await import("./env-api-key-
|
|
4421
|
+
const { readApiKeyFromEnv } = await import("./env-api-key-DDVkPQmo.js").then((n) => n.t);
|
|
4047
4422
|
const apiKey = argv.apiKey || readApiKeyFromEnv();
|
|
4048
4423
|
const debug = argv.debug;
|
|
4049
4424
|
const localMcp = argv.local;
|
|
4050
4425
|
try {
|
|
4051
|
-
const { startTUI } = await import("./start-tui-
|
|
4426
|
+
const { startTUI } = await import("./start-tui-H_BSAFdp.js");
|
|
4052
4427
|
const { buildSession } = await import("./wizard-session-C8W_6X0j.js");
|
|
4053
4428
|
const tui = startTUI(VERSION, Program.McpAdd);
|
|
4054
4429
|
tui.store.session = buildSession({
|
|
@@ -4061,7 +4436,7 @@ function runMcpAdd(argv) {
|
|
|
4061
4436
|
} catch (error) {
|
|
4062
4437
|
if (!isTUIUnavailable(error)) throw error;
|
|
4063
4438
|
setUI(new LoggingUI());
|
|
4064
|
-
const { addMCPServerToClientsStep } = await import("./add-mcp-server-to-clients-
|
|
4439
|
+
const { addMCPServerToClientsStep } = await import("./add-mcp-server-to-clients-Ci0I1vbS.js").then((n) => n.r);
|
|
4065
4440
|
await addMCPServerToClientsStep({
|
|
4066
4441
|
local: localMcp,
|
|
4067
4442
|
features,
|
|
@@ -4100,7 +4475,7 @@ function runMcpRemove(argv) {
|
|
|
4100
4475
|
const debug = argv.debug;
|
|
4101
4476
|
const localMcp = argv.local;
|
|
4102
4477
|
try {
|
|
4103
|
-
const { startTUI } = await import("./start-tui-
|
|
4478
|
+
const { startTUI } = await import("./start-tui-H_BSAFdp.js");
|
|
4104
4479
|
const { buildSession } = await import("./wizard-session-C8W_6X0j.js");
|
|
4105
4480
|
const tui = startTUI(VERSION, Program.McpRemove);
|
|
4106
4481
|
tui.store.session = buildSession({
|
|
@@ -4110,7 +4485,7 @@ function runMcpRemove(argv) {
|
|
|
4110
4485
|
});
|
|
4111
4486
|
} catch {
|
|
4112
4487
|
setUI(new LoggingUI());
|
|
4113
|
-
const { removeMCPServerFromClientsStep } = await import("./add-mcp-server-to-clients-
|
|
4488
|
+
const { removeMCPServerFromClientsStep } = await import("./add-mcp-server-to-clients-Ci0I1vbS.js").then((n) => n.r);
|
|
4114
4489
|
await removeMCPServerFromClientsStep({ local: localMcp });
|
|
4115
4490
|
}
|
|
4116
4491
|
})();
|
|
@@ -4132,7 +4507,7 @@ function runMcpTutorial(argv) {
|
|
|
4132
4507
|
const debug = argv.debug;
|
|
4133
4508
|
const localMcp = argv.local;
|
|
4134
4509
|
try {
|
|
4135
|
-
const { startTUI } = await import("./start-tui-
|
|
4510
|
+
const { startTUI } = await import("./start-tui-H_BSAFdp.js");
|
|
4136
4511
|
const { buildSession } = await import("./wizard-session-C8W_6X0j.js");
|
|
4137
4512
|
const tui = startTUI(VERSION, Program.McpTutorial);
|
|
4138
4513
|
tui.store.session = buildSession({
|
|
@@ -4213,10 +4588,10 @@ function runWizard(config, options) {
|
|
|
4213
4588
|
(async () => {
|
|
4214
4589
|
try {
|
|
4215
4590
|
const installDir = options.installDir || process.cwd();
|
|
4216
|
-
const { startTUI } = await import("./start-tui-
|
|
4591
|
+
const { startTUI } = await import("./start-tui-H_BSAFdp.js");
|
|
4217
4592
|
const { buildSession, RunPhase } = await import("./wizard-session-C8W_6X0j.js");
|
|
4218
|
-
const { TaskStreamPush } = await import("./task-stream-
|
|
4219
|
-
const { PostHogDestination } = await import("./posthog-
|
|
4593
|
+
const { TaskStreamPush } = await import("./task-stream-d-R9J0g4.js");
|
|
4594
|
+
const { PostHogDestination } = await import("./posthog-BHbtnNQE.js");
|
|
4220
4595
|
tui = startTUI(WIZARD_VERSION, config.id);
|
|
4221
4596
|
const activeTui = tui;
|
|
4222
4597
|
const session = buildSession({
|
|
@@ -4280,7 +4655,7 @@ function runWizard(config, options) {
|
|
|
4280
4655
|
if (shown(step)) await advanceStep(step, activeTui.store, config);
|
|
4281
4656
|
}
|
|
4282
4657
|
else if (skipAgent) {
|
|
4283
|
-
const { getOrAskForProjectData } = await import("./setup-utils-
|
|
4658
|
+
const { getOrAskForProjectData } = await import("./setup-utils-DfRLklZ3.js").then((n) => n.r);
|
|
4284
4659
|
const { projectApiKey, host, accessToken, projectId } = await getOrAskForProjectData({
|
|
4285
4660
|
signup: session.signup,
|
|
4286
4661
|
ci: session.ci,
|
|
@@ -4383,10 +4758,10 @@ function runNonInteractive(config, options, mode) {
|
|
|
4383
4758
|
(async () => {
|
|
4384
4759
|
const path = await import("path");
|
|
4385
4760
|
const { buildSession, RunPhase, OutroKind } = await import("./wizard-session-C8W_6X0j.js");
|
|
4386
|
-
const { readEnvironment } = await import("./environment-
|
|
4387
|
-
const { readApiKeyFromEnv } = await import("./env-api-key-
|
|
4388
|
-
const { configureLogFileFromEnvironment, logToFile } = await import("./debug-
|
|
4389
|
-
const { wizardAbort, WizardError } = await import("./wizard-abort-
|
|
4761
|
+
const { readEnvironment } = await import("./environment-QNoUem74.js").then((n) => n.t);
|
|
4762
|
+
const { readApiKeyFromEnv } = await import("./env-api-key-DDVkPQmo.js").then((n) => n.t);
|
|
4763
|
+
const { configureLogFileFromEnvironment, logToFile } = await import("./debug-DtgfvuKF.js");
|
|
4764
|
+
const { wizardAbort, WizardError } = await import("./wizard-abort-Ce2RceZ1.js");
|
|
4390
4765
|
configureLogFileFromEnvironment();
|
|
4391
4766
|
const env = readEnvironment();
|
|
4392
4767
|
const apiKey = options.apiKey ?? readApiKeyFromEnv() ?? void 0;
|
|
@@ -4417,9 +4792,9 @@ function runNonInteractive(config, options, mode) {
|
|
|
4417
4792
|
let store = null;
|
|
4418
4793
|
let taskStream = null;
|
|
4419
4794
|
if (mode === "headless") {
|
|
4420
|
-
const { WizardStore } = await import("./store-
|
|
4421
|
-
const { HeadlessUI } = await import("./headless-ui-
|
|
4422
|
-
const { TaskStreamPush, PostHogDestination } = await import("./task-stream-
|
|
4795
|
+
const { WizardStore } = await import("./store-B3B76DgD.js").then((n) => n.n);
|
|
4796
|
+
const { HeadlessUI } = await import("./headless-ui-DtFktXIa.js");
|
|
4797
|
+
const { TaskStreamPush, PostHogDestination } = await import("./task-stream-d-R9J0g4.js");
|
|
4423
4798
|
store = new WizardStore(config.id);
|
|
4424
4799
|
store.session = session;
|
|
4425
4800
|
setUI(new HeadlessUI(store));
|
|
@@ -4474,7 +4849,7 @@ function runNonInteractive(config, options, mode) {
|
|
|
4474
4849
|
});
|
|
4475
4850
|
}
|
|
4476
4851
|
}
|
|
4477
|
-
const { runAgent } = await import("./agent-runner-
|
|
4852
|
+
const { runAgent } = await import("./agent-runner-B1fzwFzc.js").then((n) => n.t);
|
|
4478
4853
|
await runAgent(config, session);
|
|
4479
4854
|
await settleStream(RunPhase.Completed);
|
|
4480
4855
|
} catch (error) {
|
|
@@ -5026,7 +5401,8 @@ const SinglePickerMenu = ({ message, options, centered = false, columns = 1, opt
|
|
|
5026
5401
|
children: colOpts.map((opt, rowIdx) => {
|
|
5027
5402
|
const flatIdx = colIdx * rows + rowIdx;
|
|
5028
5403
|
const isFocused = flatIdx === focused;
|
|
5029
|
-
const
|
|
5404
|
+
const base = opt.hint ? `${opt.label} (${opt.hint})` : opt.label;
|
|
5405
|
+
const label = opt.indent ? ` ${base}` : base;
|
|
5030
5406
|
return /* @__PURE__ */ jsxs(Box, {
|
|
5031
5407
|
gap: 1,
|
|
5032
5408
|
marginBottom: optionMarginBottom,
|
|
@@ -5034,16 +5410,16 @@ const SinglePickerMenu = ({ message, options, centered = false, columns = 1, opt
|
|
|
5034
5410
|
/* @__PURE__ */ jsx(Text, {
|
|
5035
5411
|
color: isFocused ? Colors.accent : void 0,
|
|
5036
5412
|
dimColor: !isFocused,
|
|
5037
|
-
children: isFocused ? Icons.triangleSmallRight : " "
|
|
5413
|
+
children: isFocused && !opt.header ? Icons.triangleSmallRight : " "
|
|
5038
5414
|
}),
|
|
5039
5415
|
opt.icon && /* @__PURE__ */ jsx(Text, {
|
|
5040
5416
|
color: opt.icon.color,
|
|
5041
5417
|
children: opt.icon.glyph
|
|
5042
5418
|
}),
|
|
5043
5419
|
/* @__PURE__ */ jsx(Text, {
|
|
5044
|
-
color: opt.disabled ? Colors.muted : isFocused ? Colors.accent : void 0,
|
|
5045
|
-
bold: isFocused && !opt.disabled,
|
|
5046
|
-
dimColor: !isFocused || opt.disabled,
|
|
5420
|
+
color: opt.header ? void 0 : opt.disabled ? Colors.muted : isFocused ? Colors.accent : void 0,
|
|
5421
|
+
bold: opt.header || isFocused && !opt.disabled,
|
|
5422
|
+
dimColor: !opt.header && (!isFocused || opt.disabled),
|
|
5047
5423
|
children: label
|
|
5048
5424
|
})
|
|
5049
5425
|
]
|
|
@@ -5401,7 +5777,7 @@ async function runDoctorCI(options) {
|
|
|
5401
5777
|
getUI().intro("Welcome to the PostHog setup wizard");
|
|
5402
5778
|
getUI().log.info("Running posthog-doctor in CI mode");
|
|
5403
5779
|
try {
|
|
5404
|
-
const { getOrAskForProjectData } = await import("./setup-utils-
|
|
5780
|
+
const { getOrAskForProjectData } = await import("./setup-utils-DfRLklZ3.js").then((n) => n.r);
|
|
5405
5781
|
const { host, accessToken, projectId } = await getOrAskForProjectData({
|
|
5406
5782
|
signup: false,
|
|
5407
5783
|
ci: true,
|
|
@@ -5419,7 +5795,7 @@ async function runDoctorCI(options) {
|
|
|
5419
5795
|
for (const issue of sorted) getUI().log.info(` • [${issue.severity}] ${getKindMeta(issue.kind).title}`);
|
|
5420
5796
|
process.exit(1);
|
|
5421
5797
|
} catch (error) {
|
|
5422
|
-
const { ApiError } = await import("./api-
|
|
5798
|
+
const { ApiError } = await import("./api-DSG-l8Ql.js").then((n) => n.n);
|
|
5423
5799
|
const message = error instanceof ApiError && error.statusCode === 401 ? "Your PostHog API key is invalid or expired." : error instanceof Error ? error.message : String(error);
|
|
5424
5800
|
getUI().log.error(`Doctor failed: ${message}`);
|
|
5425
5801
|
process.exit(1);
|
|
@@ -5501,7 +5877,7 @@ function runSlackConnect(argv) {
|
|
|
5501
5877
|
(async () => {
|
|
5502
5878
|
const debug = argv.debug;
|
|
5503
5879
|
try {
|
|
5504
|
-
const { startTUI } = await import("./start-tui-
|
|
5880
|
+
const { startTUI } = await import("./start-tui-H_BSAFdp.js");
|
|
5505
5881
|
const { buildSession } = await import("./wizard-session-C8W_6X0j.js");
|
|
5506
5882
|
const tui = startTUI(VERSION, Program.SlackConnect);
|
|
5507
5883
|
tui.store.session = buildSession({
|
|
@@ -5883,6 +6259,6 @@ function resolveInstallDir() {
|
|
|
5883
6259
|
}
|
|
5884
6260
|
Wizard.use(basicIntegrationCommand).use(mcpCommand).use(mcpAnalyticsCommand).use(cliCommand).use(auditCommand).use(doctorCommand).use(migrateCommand).use(revenueCommand).use(warehouseCommand).use(selfDrivingCommand).use(slackCommand).use(uploadSourcemapsCommand).use(skillCommand).init();
|
|
5885
6261
|
//#endregion
|
|
5886
|
-
export { STRIPE_SDKS as C, POSTHOG_SDKS as S, SOURCE_MAPS_CONTEXT_KEYS as _, ConfirmButton as a, getDetectedWarehouseSources as b, runWizardCI as c, Program as d, getProgramConfig as f, DISPLAY_NAME as g, AUTOMATABLE_VARIANTS as h, useKeyboardHintsContext as i, runWizard as l, SELF_DRIVING_INTEGRATE_PATH_KEY as m, useKeyBindings as n, PromptLabel as o, detectSelfDrivingIntegrationProjects as p, KeyboardHintsProvider as r, runWizardHeadless as s, PickerMenu as t, PROGRAM_REGISTRY as u, getKindMeta as v, getContentBlocks$
|
|
6262
|
+
export { STRIPE_SDKS as C, POSTHOG_SDKS as S, SOURCE_MAPS_CONTEXT_KEYS as _, ConfirmButton as a, getDetectedWarehouseSources as b, runWizardCI as c, Program as d, getProgramConfig as f, DISPLAY_NAME as g, AUTOMATABLE_VARIANTS as h, useKeyboardHintsContext as i, runWizard as l, SELF_DRIVING_INTEGRATE_PATH_KEY as m, useKeyBindings as n, PromptLabel as o, detectSelfDrivingIntegrationProjects as p, KeyboardHintsProvider as r, runWizardHeadless as s, PickerMenu as t, PROGRAM_REGISTRY as u, getKindMeta as v, getContentBlocks$3 as x, fetchHealthIssues as y };
|
|
5887
6263
|
|
|
5888
6264
|
//# sourceMappingURL=bin.js.map
|