@posthog/wizard 2.69.0 → 2.70.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-mcp-server-to-clients-Cl2HBuxp.js → add-mcp-server-to-clients-BCnjUqnW.js} +4 -4
- package/dist/{add-mcp-server-to-clients-Cl2HBuxp.js.map → add-mcp-server-to-clients-BCnjUqnW.js.map} +1 -1
- package/dist/{agent-interface-CI89BrWE.js → agent-interface-Lu7tnLr0.js} +8 -8
- package/dist/{agent-interface-CI89BrWE.js.map → agent-interface-Lu7tnLr0.js.map} +1 -1
- package/dist/{agent-prompt-loader-Dc1g5Oub.js → agent-prompt-loader-y5GxgEkc.js} +5 -5
- package/dist/{agent-prompt-loader-Dc1g5Oub.js.map → agent-prompt-loader-y5GxgEkc.js.map} +1 -1
- package/dist/{agent-runner-D5dhuE4z.js → agent-runner-vKtpgqVI.js} +21 -16
- package/dist/agent-runner-vKtpgqVI.js.map +1 -0
- package/dist/analytics-D-bMEYjD.js +2 -0
- package/dist/{analytics-D90QbLf5.js → analytics-DTyJClPr.js} +13 -3
- package/dist/analytics-DTyJClPr.js.map +1 -0
- package/dist/{api-BHhrT6wb.js → api-j-OfJ8Dz.js} +3 -3
- package/dist/{api-BHhrT6wb.js.map → api-j-OfJ8Dz.js.map} +1 -1
- package/dist/bin.js +61 -56
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-BhlVkP1r.js → bounded-fs-BWX25ixc.js} +3 -3
- package/dist/{bounded-fs-BhlVkP1r.js.map → bounded-fs-BWX25ixc.js.map} +1 -1
- package/dist/{ci-install-94wC3a4K.js → ci-install-zNWgp1TL.js} +4 -4
- package/dist/{ci-install-94wC3a4K.js.map → ci-install-zNWgp1TL.js.map} +1 -1
- package/dist/{debug-CifTS9lQ.js → debug-BM0fZaGl.js} +3 -3
- package/dist/{debug-CifTS9lQ.js.map → debug-BM0fZaGl.js.map} +1 -1
- package/dist/{debug-DtixqVEY.js → debug-xr2Pq5VA.js} +1 -1
- package/dist/{env-api-key-CwhtZrik.js → env-api-key-DlxCZWU0.js} +2 -2
- package/dist/{env-api-key-CwhtZrik.js.map → env-api-key-DlxCZWU0.js.map} +1 -1
- package/dist/{environment-DhacWZf7.js → environment-o-bTOuzK.js} +4 -4
- package/dist/{environment-DhacWZf7.js.map → environment-o-bTOuzK.js.map} +1 -1
- package/dist/{file-watcher-L28OpUV2.js → file-watcher-D7G4f5sP.js} +2 -2
- package/dist/{file-watcher-L28OpUV2.js.map → file-watcher-D7G4f5sP.js.map} +1 -1
- package/dist/{headless-ui-DNcOVJxU.js → headless-ui-C46DctKG.js} +2 -2
- package/dist/{headless-ui-DNcOVJxU.js.map → headless-ui-C46DctKG.js.map} +1 -1
- package/dist/{interactive-DlNrV77o.js → interactive-B5zy3Gxk.js} +2 -2
- package/dist/{interactive-DlNrV77o.js.map → interactive-B5zy3Gxk.js.map} +1 -1
- package/dist/{mcp-CJEem9qs.js → mcp-lJRwE-YW.js} +2 -2
- package/dist/{mcp-CJEem9qs.js.map → mcp-lJRwE-YW.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-DER7MG3q.js → mcp-prompt-streaming-Dsos09hT.js} +4 -4
- package/dist/{mcp-prompt-streaming-DER7MG3q.js.map → mcp-prompt-streaming-Dsos09hT.js.map} +1 -1
- package/dist/{non-interactive-CbvniKHm.js → non-interactive-qcCCtiYQ.js} +2 -2
- package/dist/{non-interactive-CbvniKHm.js.map → non-interactive-qcCCtiYQ.js.map} +1 -1
- package/dist/{orchestrator-tools-Czf3Wo_y.js → orchestrator-tools-ezFTbAIp.js} +3 -3
- package/dist/{orchestrator-tools-Czf3Wo_y.js.map → orchestrator-tools-ezFTbAIp.js.map} +1 -1
- package/dist/{package-json-GEU2VZlS.js → package-json-xt3eeyBI.js} +1 -1
- package/dist/{package-json-GEU2VZlS.js.map → package-json-xt3eeyBI.js.map} +1 -1
- package/dist/{package-manager-CNNlFA2q.js → package-manager-CGfN9UhH.js} +2 -2
- package/dist/{package-manager-CNNlFA2q.js.map → package-manager-CGfN9UhH.js.map} +1 -1
- package/dist/{pi-kpN-bO9z.js → pi-DzQLHIcQ.js} +11 -11
- package/dist/{pi-kpN-bO9z.js.map → pi-DzQLHIcQ.js.map} +1 -1
- package/dist/{playground-ZYaQmfBa.js → playground-DLN31BPV.js} +7 -7
- package/dist/{playground-ZYaQmfBa.js.map → playground-DLN31BPV.js.map} +1 -1
- package/dist/{posthog-D1zHPgYJ.js → posthog-Dxr8XK4x.js} +2 -2
- package/dist/{posthog-D1zHPgYJ.js.map → posthog-Dxr8XK4x.js.map} +1 -1
- package/dist/{posthog-integration-DdeIUkYw.js → posthog-integration-MDfRO911.js} +93 -29
- package/dist/posthog-integration-MDfRO911.js.map +1 -0
- package/dist/{provisioning-e3roaLgp.js → provisioning-Di5GNV9k.js} +3 -3
- package/dist/{provisioning-e3roaLgp.js.map → provisioning-Di5GNV9k.js.map} +1 -1
- package/dist/{queue-tools-zrqCiy6q.js → queue-tools-KosDptd6.js} +3 -3
- package/dist/{queue-tools-zrqCiy6q.js.map → queue-tools-KosDptd6.js.map} +1 -1
- package/dist/{registry-C1t8v5tE.js → registry-BBdaIFWq.js} +6 -6
- package/dist/{registry-C1t8v5tE.js.map → registry-BBdaIFWq.js.map} +1 -1
- package/dist/{security-CIfhIscL.js → security-BwOvjMaq.js} +5 -5
- package/dist/{security-CIfhIscL.js.map → security-BwOvjMaq.js.map} +1 -1
- package/dist/{setup-utils-B_06xag2.js → setup-utils-Bo3WZt3a.js} +9 -9
- package/dist/{setup-utils-B_06xag2.js.map → setup-utils-Bo3WZt3a.js.map} +1 -1
- package/dist/{start-tui-BafJXVNT.js → start-tui-B1LrB7k1.js} +288 -133
- package/dist/start-tui-B1LrB7k1.js.map +1 -0
- package/dist/{steps-DR-Yo_IT.js → steps-BMrQJpQh.js} +7 -7
- package/dist/{steps-DR-Yo_IT.js.map → steps-BMrQJpQh.js.map} +1 -1
- package/dist/{store-DSUCWMRO.js → store-DhNTBWQR.js} +40 -6
- package/dist/store-DhNTBWQR.js.map +1 -0
- package/dist/{subagent-DjZM3G7y.js → subagent-q6M-mBHo.js} +2 -2
- package/dist/{subagent-DjZM3G7y.js.map → subagent-q6M-mBHo.js.map} +1 -1
- package/dist/{task-Czzz3tzt.js → task-CgAOxod7.js} +12 -12
- package/dist/{task-Czzz3tzt.js.map → task-CgAOxod7.js.map} +1 -1
- package/dist/{task-stream-uxG6wJfj.js → task-stream-rxR1IsdJ.js} +5 -5
- package/dist/{task-stream-uxG6wJfj.js.map → task-stream-rxR1IsdJ.js.map} +1 -1
- package/dist/{tasks-CVmG8qFw.js → tasks-lzvWF__k.js} +2 -2
- package/dist/{tasks-CVmG8qFw.js.map → tasks-lzvWF__k.js.map} +1 -1
- package/dist/{telemetry-B1VEXHpL.js → telemetry-CickTk_7.js} +3 -3
- package/dist/{telemetry-B1VEXHpL.js.map → telemetry-CickTk_7.js.map} +1 -1
- package/dist/{terminal-Czuo0x8i.js → terminal-BjUFxn_x.js} +12 -12
- package/dist/{terminal-Czuo0x8i.js.map → terminal-BjUFxn_x.js.map} +1 -1
- package/dist/{tools-DOZg9n3A.js → tools-MKXGXFSk.js} +6 -6
- package/dist/{tools-DOZg9n3A.js.map → tools-MKXGXFSk.js.map} +1 -1
- package/dist/{wizard-abort-BZOeapsf.js → wizard-abort-CW_C2EXr.js} +1 -1
- package/dist/{wizard-abort-CFMdj6sZ.js → wizard-abort-CooWEh9N.js} +4 -4
- package/dist/{wizard-abort-CFMdj6sZ.js.map → wizard-abort-CooWEh9N.js.map} +1 -1
- package/dist/{wizard-session-C_7r3-rO.js → wizard-session-Bki7dQhv.js} +12 -2
- package/dist/wizard-session-Bki7dQhv.js.map +1 -0
- package/dist/{wizard-session-D1KQqUml.js → wizard-session-gbYCXdBf.js} +1 -1
- package/dist/{yara-hooks-CmQT-oBy.js → yara-hooks-BpngckdZ.js} +4 -4
- package/dist/{yara-hooks-CmQT-oBy.js.map → yara-hooks-BpngckdZ.js.map} +1 -1
- package/dist/yara-hooks-C-qG6EJt.js +2 -0
- package/package.json +1 -1
- package/dist/agent-runner-D5dhuE4z.js.map +0 -1
- package/dist/analytics-D90QbLf5.js.map +0 -1
- package/dist/analytics-Dmf_Jm3K.js +0 -2
- package/dist/posthog-integration-DdeIUkYw.js.map +0 -1
- package/dist/start-tui-BafJXVNT.js.map +0 -1
- package/dist/store-DSUCWMRO.js.map +0 -1
- package/dist/wizard-session-C_7r3-rO.js.map +0 -1
- package/dist/yara-hooks-BhNAWw7W.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as logToFile } from "./debug-
|
|
1
|
+
import { s as logToFile } from "./debug-BM0fZaGl.js";
|
|
2
2
|
//#region src/lib/task-stream/destinations/posthog.ts
|
|
3
3
|
const MAX_ATTEMPTS = 3;
|
|
4
4
|
const BASE_BACKOFF_MS = 500;
|
|
@@ -121,4 +121,4 @@ var PostHogDestination = class {
|
|
|
121
121
|
//#endregion
|
|
122
122
|
export { PostHogDestination };
|
|
123
123
|
|
|
124
|
-
//# sourceMappingURL=posthog-
|
|
124
|
+
//# sourceMappingURL=posthog-Dxr8XK4x.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog-
|
|
1
|
+
{"version":3,"file":"posthog-Dxr8XK4x.js","names":[],"sources":["../src/lib/task-stream/destinations/posthog.ts"],"sourcesContent":["/**\n * PostHog destination — pushes wizard run state to the PostHog backend\n * via `POST /api/projects/{project_id}/wizard/sessions/`.\n *\n * The endpoint is an upsert keyed by `(team, session_id)`: 201 means\n * the row was created, 200 means it was updated. Both are success.\n *\n * Failure handling is fail-silent: never throws to the caller, never\n * writes to stdout/stderr, never blocks the agent. Errors flow through\n * the optional `onError` callback for the wizard's debug log.\n *\n * Retry policy:\n * 5xx / network → exponential backoff base 500ms cap 8s, max 3 attempts\n * 429 → honour `Retry-After` (seconds), single retry\n * 401 / 403 → disable for the rest of the run, no further pushes\n * 400 → give up for this push, do not disable\n * other 4xx → give up for this push, do not disable\n */\n\nimport type {\n TaskStreamDestination,\n TaskStreamUpdate,\n StreamEvent,\n} from '@lib/task-stream/types';\nimport type { Credentials } from '@lib/wizard-session';\nimport { logToFile } from '@utils/debug';\n\nexport interface PostHogDestinationOptions {\n /**\n * Lazy credential resolver — called on every send. Returns null\n * before authentication has completed; in that case the send is a\n * no-op (no HTTP request).\n */\n getCredentials: () => Credentials | null;\n /** Receives every error for the wizard's internal logfile. */\n onError?: (err: Error) => void;\n /** Override for tests. Defaults to global fetch. */\n fetchImpl?: typeof fetch;\n /** Override for tests. Defaults to setTimeout. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst MAX_ATTEMPTS = 3;\nconst BASE_BACKOFF_MS = 500;\nconst MAX_BACKOFF_MS = 8000;\nconst DEFAULT_RETRY_AFTER_MS = 1000;\n// setTimeout silently clamps anything above 2^31-1 ms to fire\n// immediately, so any Retry-After-derived sleep must be capped.\nconst MAX_RETRY_AFTER_MS = 60_000;\n\nfunction defaultSleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction parseRetryAfter(value: string | null): number {\n if (!value) return DEFAULT_RETRY_AFTER_MS;\n const seconds = Number(value);\n if (Number.isFinite(seconds) && seconds >= 0) {\n return Math.min(Math.ceil(seconds * 1000), MAX_RETRY_AFTER_MS);\n }\n // HTTP-date form — best-effort.\n const date = Date.parse(value);\n if (Number.isFinite(date)) {\n return Math.min(Math.max(0, date - Date.now()), MAX_RETRY_AFTER_MS);\n }\n return DEFAULT_RETRY_AFTER_MS;\n}\n\n/**\n * Strip the internal-only `timestamp` field before sending. The\n * backend schema in the RFC does not define it.\n */\nfunction toWirePayload(\n payload: TaskStreamUpdate,\n): Omit<TaskStreamUpdate, 'timestamp'> {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { timestamp: _unused, ...rest } = payload;\n return rest;\n}\n\nexport class PostHogDestination implements TaskStreamDestination {\n readonly name = 'posthog';\n\n private readonly getCredentials: () => Credentials | null;\n private readonly onError: (err: Error) => void;\n private readonly fetchImpl: typeof fetch;\n private readonly sleep: (ms: number) => Promise<void>;\n\n private disabled = false;\n\n constructor(opts: PostHogDestinationOptions) {\n this.getCredentials = opts.getCredentials;\n this.onError = opts.onError ?? (() => undefined);\n this.fetchImpl = opts.fetchImpl ?? ((...args) => fetch(...args));\n this.sleep = opts.sleep ?? defaultSleep;\n }\n\n async send(_event: StreamEvent, payload: TaskStreamUpdate): Promise<void> {\n if (this.disabled) return;\n const creds = this.getCredentials();\n if (!creds) return;\n\n await this.postWithRetry(creds, toWirePayload(payload));\n }\n\n private buildRequest(\n creds: Credentials,\n body: object,\n ): { url: string; init: Parameters<typeof fetch>[1] } {\n const url = `${creds.host.apiHost.replace(/\\/$/, '')}/api/projects/${\n creds.projectId\n }/wizard/sessions/`;\n return {\n url,\n init: {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${creds.accessToken}`,\n },\n body: JSON.stringify(body),\n },\n };\n }\n\n private async postWithRetry(creds: Credentials, body: object): Promise<void> {\n const { url, init } = this.buildRequest(creds, body);\n let attempt = 0;\n let backoff = BASE_BACKOFF_MS;\n let retriedAfter429 = false;\n\n while (attempt < MAX_ATTEMPTS) {\n attempt += 1;\n let response: Response;\n try {\n response = await this.fetchImpl(url, init);\n } catch (err) {\n if (attempt >= MAX_ATTEMPTS) {\n this.onError(err instanceof Error ? err : new Error(String(err)));\n return;\n }\n await this.sleep(backoff);\n backoff = Math.min(backoff * 2, MAX_BACKOFF_MS);\n continue;\n }\n\n if (response.ok) {\n logToFile(`[task-stream] wizard/sessions push ok: ${response.status}`);\n return;\n }\n\n const status = response.status;\n\n if (status === 401 || status === 403) {\n this.disabled = true;\n this.onError(new Error(`wizard/sessions auth failed: ${status}`));\n return;\n }\n\n if (status === 429) {\n if (retriedAfter429) {\n this.onError(new Error('wizard/sessions rate limited'));\n return;\n }\n retriedAfter429 = true;\n const wait = parseRetryAfter(response.headers.get('Retry-After'));\n await this.sleep(wait);\n // Don't count this against the 5xx attempt budget.\n attempt -= 1;\n continue;\n }\n\n if (status >= 500) {\n if (attempt >= MAX_ATTEMPTS) {\n this.onError(new Error(`wizard/sessions server error: ${status}`));\n return;\n }\n await this.sleep(backoff);\n backoff = Math.min(backoff * 2, MAX_BACKOFF_MS);\n continue;\n }\n\n if (status === 400) {\n let detail = '';\n try {\n detail = await response.text();\n } catch {\n // ignore\n }\n this.onError(new Error(`wizard/sessions bad request (400): ${detail}`));\n return;\n }\n\n this.onError(new Error(`wizard/sessions unexpected status: ${status}`));\n return;\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { a as AgentSignals, l as ErrorCodes } from "./errors-BSdz2lsl.js";
|
|
2
|
-
import { L as Integration, N as HAIKU_MODEL, O as DETECTION_TIMEOUT_MS, _ as evaluateWizardReadiness, at as WIZARD_INTERACTION_EVENT_NAME, f as getUI, g as SIGNUP_WIZARD_READINESS_CONFIG, mt as getSkillsBaseUrl, s as logToFile, v as getBlockingServiceKeys, x as AGENTIC_DETECTION_TIMEOUT_MS } from "./debug-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import { i as
|
|
8
|
-
import "./
|
|
9
|
-
import { i as wizardAbort } from "./wizard-abort-
|
|
10
|
-
import { n as runAgent, r as shouldDisableAsk, s as authenticate } from "./agent-runner-
|
|
11
|
-
import { B as MAX_ENV_KEY_SET, H as parseEnvKeyNames, T as WIZARD_TOOL_NAMES, U as toPromptSafeRelativePath, V as isEnvFileName, i as runAgent$1, n as buildRunTags, r as initializeAgent } from "./agent-interface-
|
|
12
|
-
import { h as EVENT_PLAN_FILE } from "./yara-hooks-
|
|
13
|
-
import { a as detectNodePackageManagers } from "./package-manager-
|
|
14
|
-
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-
|
|
2
|
+
import { L as Integration, N as HAIKU_MODEL, O as DETECTION_TIMEOUT_MS, _ as evaluateWizardReadiness, at as WIZARD_INTERACTION_EVENT_NAME, f as getUI, g as SIGNUP_WIZARD_READINESS_CONFIG, mt as getSkillsBaseUrl, s as logToFile, v as getBlockingServiceKeys, x as AGENTIC_DETECTION_TIMEOUT_MS } from "./debug-BM0fZaGl.js";
|
|
3
|
+
import { o as mayReportScanResults } from "./wizard-session-Bki7dQhv.js";
|
|
4
|
+
import { n as analytics } from "./analytics-DTyJClPr.js";
|
|
5
|
+
import { i as withUtm, n as openTrackedLink } from "./telemetry-CickTk_7.js";
|
|
6
|
+
import { a as safeReadFile, i as readProjectFile, o as walkProjectFiles } from "./bounded-fs-BWX25ixc.js";
|
|
7
|
+
import { i as tryGetPackageJson, n as isUsingTypeScript } from "./setup-utils-Bo3WZt3a.js";
|
|
8
|
+
import { i as requestDeepLink } from "./provisioning-Di5GNV9k.js";
|
|
9
|
+
import { i as wizardAbort } from "./wizard-abort-CooWEh9N.js";
|
|
10
|
+
import { n as runAgent, r as shouldDisableAsk, s as authenticate } from "./agent-runner-vKtpgqVI.js";
|
|
11
|
+
import { B as MAX_ENV_KEY_SET, H as parseEnvKeyNames, T as WIZARD_TOOL_NAMES, U as toPromptSafeRelativePath, V as isEnvFileName, i as runAgent$1, n as buildRunTags, r as initializeAgent } from "./agent-interface-Lu7tnLr0.js";
|
|
12
|
+
import { h as EVENT_PLAN_FILE } from "./yara-hooks-BpngckdZ.js";
|
|
13
|
+
import { a as detectNodePackageManagers } from "./package-manager-CGfN9UhH.js";
|
|
14
|
+
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-BBdaIFWq.js";
|
|
15
15
|
import * as semver from "semver";
|
|
16
16
|
import { existsSync, statSync } from "fs";
|
|
17
17
|
import { isAbsolute, join, resolve, sep } from "path";
|
|
@@ -567,7 +567,7 @@ async function scopeInstallDirToProject(session) {
|
|
|
567
567
|
}
|
|
568
568
|
//#endregion
|
|
569
569
|
//#region src/lib/warehouse-sources/registry.ts
|
|
570
|
-
const
|
|
570
|
+
const CORE_SOURCE_DETECTORS = [
|
|
571
571
|
{
|
|
572
572
|
kind: "Postgres",
|
|
573
573
|
label: "PostgreSQL",
|
|
@@ -693,7 +693,7 @@ const SOURCE_DETECTORS = [
|
|
|
693
693
|
{
|
|
694
694
|
kind: "Firebase",
|
|
695
695
|
label: "Firebase",
|
|
696
|
-
mode: "
|
|
696
|
+
mode: "deep-link",
|
|
697
697
|
signals: {
|
|
698
698
|
npm: ["firebase-admin", "firebase"],
|
|
699
699
|
python: ["firebase-admin"],
|
|
@@ -1248,7 +1248,9 @@ const SOURCE_DETECTORS = [
|
|
|
1248
1248
|
python: ["pygithub"],
|
|
1249
1249
|
ruby: ["octokit"]
|
|
1250
1250
|
}
|
|
1251
|
-
}
|
|
1251
|
+
}
|
|
1252
|
+
];
|
|
1253
|
+
const LLM_SOURCE_DETECTORS = [
|
|
1252
1254
|
{
|
|
1253
1255
|
kind: "OpenAI",
|
|
1254
1256
|
label: "OpenAI",
|
|
@@ -1484,7 +1486,9 @@ const SOURCE_DETECTORS = [
|
|
|
1484
1486
|
python: ["zep-cloud"],
|
|
1485
1487
|
envKeys: [/^ZEP_API_KEY$/]
|
|
1486
1488
|
}
|
|
1487
|
-
}
|
|
1489
|
+
}
|
|
1490
|
+
];
|
|
1491
|
+
const OTHER_SOURCE_DETECTORS = [
|
|
1488
1492
|
{
|
|
1489
1493
|
kind: "Paystack",
|
|
1490
1494
|
label: "Paystack",
|
|
@@ -2927,6 +2931,13 @@ const SOURCE_DETECTORS = [
|
|
|
2927
2931
|
}
|
|
2928
2932
|
}
|
|
2929
2933
|
];
|
|
2934
|
+
const SOURCE_DETECTORS = [
|
|
2935
|
+
...CORE_SOURCE_DETECTORS,
|
|
2936
|
+
...LLM_SOURCE_DETECTORS,
|
|
2937
|
+
...OTHER_SOURCE_DETECTORS
|
|
2938
|
+
];
|
|
2939
|
+
/** Kinds from the LLM / AI section above — the only ones that may set `wizard_ai_sdk_detected`. */
|
|
2940
|
+
const AI_SOURCE_KINDS = new Set(LLM_SOURCE_DETECTORS.map((detector) => detector.kind));
|
|
2930
2941
|
//#endregion
|
|
2931
2942
|
//#region src/lib/warehouse-sources/detect.ts
|
|
2932
2943
|
/**
|
|
@@ -3176,8 +3187,24 @@ async function detectPostHogIntegration(ctx) {
|
|
|
3176
3187
|
ctx.setDetectionComplete();
|
|
3177
3188
|
}
|
|
3178
3189
|
/**
|
|
3190
|
+
* How the scan went, for the reporter to read later. Three states, and the
|
|
3191
|
+
* absent one carries the most weight:
|
|
3192
|
+
*
|
|
3193
|
+
* absent this program never scanned. Only `posthog-integration` runs the
|
|
3194
|
+
* scan below, but every program's intro screen resolves consent
|
|
3195
|
+
* through the same store method, so the reporter is reached on runs
|
|
3196
|
+
* where no scan ever happened.
|
|
3197
|
+
* 'failed' the scan threw. A zero-count row would read as "scanned, found
|
|
3198
|
+
* nothing", which is a different fact.
|
|
3199
|
+
* 'ok' the scan ran. Zero sources is a real result and gets reported.
|
|
3200
|
+
*/
|
|
3201
|
+
const WAREHOUSE_SCAN_STATE_KEY = "warehouseScanState";
|
|
3202
|
+
/**
|
|
3179
3203
|
* Scan for data warehouse source signals (Postgres, Stripe, Hubspot, …) and,
|
|
3180
3204
|
* when found, stash them for a `wizard warehouse` suggestion on the outro.
|
|
3205
|
+
* Runs unconditionally during `detect`, before the intro screen has asked
|
|
3206
|
+
* about sharing. Reporting what this finds is a separate, later concern.
|
|
3207
|
+
* See `reportWarehouseSourcesDetected` below.
|
|
3181
3208
|
*
|
|
3182
3209
|
* Deliberately a suggestion, not an inline agent run: a second credential-
|
|
3183
3210
|
* collecting agent run before the outro could `process.exit()` on any of its
|
|
@@ -3189,23 +3216,60 @@ async function detectPostHogIntegration(ctx) {
|
|
|
3189
3216
|
* it finds nothing — that's right for `wizard warehouse` but here would show a
|
|
3190
3217
|
* spurious error and trip the CI prerequisites abort. No sources is a no-op.
|
|
3191
3218
|
*
|
|
3192
|
-
* Best-effort: never let a scan failure break the
|
|
3219
|
+
* Best-effort: never let a scan failure break the wizard flow.
|
|
3193
3220
|
*/
|
|
3194
3221
|
function detectWarehouseSourcesForSuggestion(ctx, installDir) {
|
|
3195
3222
|
try {
|
|
3196
3223
|
const sources = detectWarehouseSources(installDir);
|
|
3224
|
+
ctx.setFrameworkContext(WAREHOUSE_SCAN_STATE_KEY, "ok");
|
|
3225
|
+
if (sources.length === 0) return;
|
|
3226
|
+
ctx.setFrameworkContext(DETECTED_WAREHOUSE_SOURCES_KEY, sources);
|
|
3227
|
+
} catch (error) {
|
|
3228
|
+
ctx.setFrameworkContext(WAREHOUSE_SCAN_STATE_KEY, "failed");
|
|
3229
|
+
analytics.captureException(error instanceof Error ? error : new Error(String(error)), { step: "detectWarehouseSourcesForSuggestion" });
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
function hasAiSdkEvidence(session, sources) {
|
|
3233
|
+
return sources.some((s) => AI_SOURCE_KINDS.has(s.kind)) || session.discoveredFeatures.includes("llm");
|
|
3234
|
+
}
|
|
3235
|
+
/**
|
|
3236
|
+
* Boolean only, on the org, never the list of kinds or any non-AI tool: a
|
|
3237
|
+
* decline must not leak even the shape of what local detection saw.
|
|
3238
|
+
*/
|
|
3239
|
+
function stampAiSdkDetected(session, sources) {
|
|
3240
|
+
const organizationId = session.apiUser?.organization?.id;
|
|
3241
|
+
if (!organizationId) return;
|
|
3242
|
+
if (!hasAiSdkEvidence(session, sources)) return;
|
|
3243
|
+
analytics.groupIdentify("organization", organizationId, { wizard_ai_sdk_detected: true });
|
|
3244
|
+
}
|
|
3245
|
+
/**
|
|
3246
|
+
* The single place scan results become telemetry. Called from
|
|
3247
|
+
* `WizardStore.completeSetup()`, the point consent becomes final — the privacy
|
|
3248
|
+
* panel's choice is reversible until then, so nothing may report earlier.
|
|
3249
|
+
*
|
|
3250
|
+
* Returns true when consent has resolved and the caller should latch
|
|
3251
|
+
* `warehouseSourcesReported`, which is not the same as "this sent something":
|
|
3252
|
+
* a decline, a failed scan, and a program that never scanned all resolve
|
|
3253
|
+
* without sending.
|
|
3254
|
+
*/
|
|
3255
|
+
function reportWarehouseSourcesDetected(session) {
|
|
3256
|
+
if (session.warehouseSourcesReported) return false;
|
|
3257
|
+
if (session.scanConsent === "undecided") return false;
|
|
3258
|
+
if (mayReportScanResults(session)) {
|
|
3259
|
+
const sources = getDetectedWarehouseSources(session);
|
|
3260
|
+
stampAiSdkDetected(session, sources);
|
|
3261
|
+
if (session.frameworkContext[WAREHOUSE_SCAN_STATE_KEY] !== "ok") return true;
|
|
3197
3262
|
analytics.wizardCapture("warehouse sources detected", {
|
|
3198
3263
|
warehouse_source_count: sources.length,
|
|
3199
3264
|
warehouse_source_kinds: sources.map((s) => s.kind),
|
|
3200
3265
|
warehouse_source_modes: sources.map((s) => s.mode)
|
|
3201
3266
|
});
|
|
3202
|
-
if (sources.length
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
} catch (error) {
|
|
3207
|
-
analytics.captureException(error instanceof Error ? error : new Error(String(error)), { step: "detectWarehouseSourcesForSuggestion" });
|
|
3267
|
+
if (sources.length > 0) {
|
|
3268
|
+
analytics.setTag("warehouse_source_kinds", sources.map((s) => s.kind).join(","));
|
|
3269
|
+
analytics.setTag("warehouse_source_count", sources.length);
|
|
3270
|
+
}
|
|
3208
3271
|
}
|
|
3272
|
+
return true;
|
|
3209
3273
|
}
|
|
3210
3274
|
//#endregion
|
|
3211
3275
|
//#region src/lib/programs/posthog-integration/steps.ts
|
|
@@ -4357,7 +4421,7 @@ const warehouseSeedTasks = (sess) => {
|
|
|
4357
4421
|
if (shouldDisableAsk(sess)) return [];
|
|
4358
4422
|
const sources = getDetectedWarehouseSources(sess);
|
|
4359
4423
|
if (sources.length === 0) return [];
|
|
4360
|
-
analytics.wizardCapture("orchestrator warehouse task queued", {
|
|
4424
|
+
if (mayReportScanResults(sess)) analytics.wizardCapture("orchestrator warehouse task queued", {
|
|
4361
4425
|
warehouse_source_count: sources.length,
|
|
4362
4426
|
warehouse_source_kinds: sources.map((s) => s.kind)
|
|
4363
4427
|
});
|
|
@@ -4426,7 +4490,7 @@ const posthogIntegrationConfig = {
|
|
|
4426
4490
|
if (usesPackageJson) {
|
|
4427
4491
|
const packageJson = await tryGetPackageJson({ installDir: session.installDir });
|
|
4428
4492
|
if (packageJson) {
|
|
4429
|
-
const { hasDeclaredDependency } = await import("./package-json-
|
|
4493
|
+
const { hasDeclaredDependency } = await import("./package-json-xt3eeyBI.js").then((n) => n.i);
|
|
4430
4494
|
if (!hasDeclaredDependency(config.detection.packageName, packageJson)) getUI().log.warn(`${config.detection.packageDisplayName} does not seem to be installed. Continuing anyway — the agent will handle it.`);
|
|
4431
4495
|
frameworkVersion = config.detection.getVersion(packageJson);
|
|
4432
4496
|
} else getUI().log.warn("Could not find package.json. Continuing anyway — the agent will handle it.");
|
|
@@ -4495,7 +4559,7 @@ ${warehouseReportInstruction(session)}
|
|
|
4495
4559
|
postRun: async (sess, credentials) => {
|
|
4496
4560
|
const envVars = config.environment.getEnvVars(credentials.projectApiKey, credentials.host.apiHost);
|
|
4497
4561
|
if (config.environment.uploadToHosting) {
|
|
4498
|
-
const { uploadEnvironmentVariablesStep } = await import("./steps-
|
|
4562
|
+
const { uploadEnvironmentVariablesStep } = await import("./steps-BMrQJpQh.js");
|
|
4499
4563
|
const uploadedEnvVars = await uploadEnvironmentVariablesStep(envVars, {
|
|
4500
4564
|
integration: config.metadata.integration,
|
|
4501
4565
|
session: sess
|
|
@@ -4549,6 +4613,6 @@ const integrationRunStep = {
|
|
|
4549
4613
|
isComplete: (session) => session.runPhase === "completed" || session.runPhase === "error"
|
|
4550
4614
|
};
|
|
4551
4615
|
//#endregion
|
|
4552
|
-
export {
|
|
4616
|
+
export { detectIntegrationProjects as C, gatherFrameworkContext as D, resolveProjectDir as E, detectFramework as O, detectWarehouseSources as S, detectProjectsWithAgent as T, reportWarehouseSourcesDetected as _, LINE_CHART_BLOCK as a, detectWarehousePrerequisites as b, TextBlock as c, isClearBlock as d, isLinesBlock as f, detectPostHogIntegration as g, Icons as h, FUNNEL_BLOCK as i, computeVisibleRange as l, Colors as m, integrationRunStep as n, PRODUCT_SUITE_BLOCK as o, isObjectBlock as p, posthogIntegrationConfig as r, StatusPeekTrigger as s, SETUP_REPORT_FILE as t, wordWrap as u, HEALTH_CHECK_STEP as v, scopeInstallDirToProject as w, getDetectedWarehouseSources as x, WAREHOUSE_ABORT_CASES as y };
|
|
4553
4617
|
|
|
4554
|
-
//# sourceMappingURL=posthog-integration-
|
|
4618
|
+
//# sourceMappingURL=posthog-integration-MDfRO911.js.map
|