@posthog/wizard 2.62.0 → 2.63.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 +48 -6
- package/dist/{add-mcp-server-to-clients-Bzl7_wB3.js → add-mcp-server-to-clients-Bsyb6MUB.js} +4 -4
- package/dist/{add-mcp-server-to-clients-Bzl7_wB3.js.map → add-mcp-server-to-clients-Bsyb6MUB.js.map} +1 -1
- package/dist/{agent-interface-C90hyvs1.js → agent-interface-C4CV7p0L.js} +24 -16
- package/dist/agent-interface-C4CV7p0L.js.map +1 -0
- package/dist/{agent-prompt-loader-CBj2DWAJ.js → agent-prompt-loader-DiM8xfSZ.js} +13 -6
- package/dist/agent-prompt-loader-DiM8xfSZ.js.map +1 -0
- package/dist/{agent-runner-DA5YfjOD.js → agent-runner-X3JWS2WK.js} +200 -33
- package/dist/agent-runner-X3JWS2WK.js.map +1 -0
- package/dist/analytics-F6z7o3N2.js +2 -0
- package/dist/{analytics-BdKBzz4M.js → analytics-YLZKudpE.js} +2 -2
- package/dist/{analytics-BdKBzz4M.js.map → analytics-YLZKudpE.js.map} +1 -1
- package/dist/{api-aTkzJ9vG.js → api-DlRJAFI2.js} +3 -3
- package/dist/{api-aTkzJ9vG.js.map → api-DlRJAFI2.js.map} +1 -1
- package/dist/bin.js +101 -42
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-BU2L5mjO.js → bounded-fs-CYxETRCt.js} +3 -3
- package/dist/{bounded-fs-BU2L5mjO.js.map → bounded-fs-CYxETRCt.js.map} +1 -1
- package/dist/{ci-install-BnTAUOz8.js → ci-install-Cyqj_i3I.js} +4 -4
- package/dist/{ci-install-BnTAUOz8.js.map → ci-install-Cyqj_i3I.js.map} +1 -1
- package/dist/{debug-D2L-fM_I.js → debug-2W78IhFE.js} +1 -1
- package/dist/{debug-BTPYy9p7.js → debug-BYIoy1Oz.js} +15 -8
- package/dist/debug-BYIoy1Oz.js.map +1 -0
- package/dist/{env-api-key-cjD4yfGT.js → env-api-key-B7kiHT3h.js} +4 -7
- package/dist/env-api-key-B7kiHT3h.js.map +1 -0
- package/dist/{environment-lV2X1gS-.js → environment-Br-oy8cq.js} +4 -4
- package/dist/{environment-lV2X1gS-.js.map → environment-Br-oy8cq.js.map} +1 -1
- package/dist/{file-watcher-qqQBl5Em.js → file-watcher-HaK4IrJ5.js} +2 -2
- package/dist/{file-watcher-qqQBl5Em.js.map → file-watcher-HaK4IrJ5.js.map} +1 -1
- package/dist/{headless-ui-TSoOsa3j.js → headless-ui-Dd7Ty4Ul.js} +2 -2
- package/dist/{headless-ui-TSoOsa3j.js.map → headless-ui-Dd7Ty4Ul.js.map} +1 -1
- package/dist/{interactive-DMoXEiKo.js → interactive-CYv97Lgg.js} +2 -2
- package/dist/{interactive-DMoXEiKo.js.map → interactive-CYv97Lgg.js.map} +1 -1
- package/dist/{mcp-Dqu0_QzN.js → mcp-D6cJWFPn.js} +2 -2
- package/dist/{mcp-Dqu0_QzN.js.map → mcp-D6cJWFPn.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-B4cYVDVP.js → mcp-prompt-streaming-DYX7vQ3q.js} +3 -3
- package/dist/{mcp-prompt-streaming-B4cYVDVP.js.map → mcp-prompt-streaming-DYX7vQ3q.js.map} +1 -1
- package/dist/{non-interactive-EG_lII4R.js → non-interactive-BR4kmPE5.js} +2 -2
- package/dist/{non-interactive-EG_lII4R.js.map → non-interactive-BR4kmPE5.js.map} +1 -1
- package/dist/{orchestrator-tools-DrhpNOKK.js → orchestrator-tools-CTP6l34W.js} +13 -10
- package/dist/orchestrator-tools-CTP6l34W.js.map +1 -0
- package/dist/{package-manager-z33XHEWO.js → package-manager-FyJmIsqr.js} +2 -2
- package/dist/{package-manager-z33XHEWO.js.map → package-manager-FyJmIsqr.js.map} +1 -1
- package/dist/{pi-CVJB0Ban.js → pi-DeF8mWlb.js} +11 -11
- package/dist/{pi-CVJB0Ban.js.map → pi-DeF8mWlb.js.map} +1 -1
- package/dist/{playground-BjWqoWhf.js → playground-BSMgOp3k.js} +6 -6
- package/dist/{playground-BjWqoWhf.js.map → playground-BSMgOp3k.js.map} +1 -1
- package/dist/{posthog-3ijs_66W.js → posthog-ZWC-083a.js} +2 -2
- package/dist/{posthog-3ijs_66W.js.map → posthog-ZWC-083a.js.map} +1 -1
- package/dist/{posthog-integration-C3wuB5B1.js → posthog-integration-CoAID6XW.js} +53 -23
- package/dist/{posthog-integration-C3wuB5B1.js.map → posthog-integration-CoAID6XW.js.map} +1 -1
- package/dist/{provisioning-IKacrvWB.js → provisioning-xirriYQJ.js} +3 -3
- package/dist/{provisioning-IKacrvWB.js.map → provisioning-xirriYQJ.js.map} +1 -1
- package/dist/{queue-tools-zM8_mxx6.js → queue-tools-BtJ7_fEW.js} +117 -19
- package/dist/queue-tools-BtJ7_fEW.js.map +1 -0
- package/dist/{registry-DF_aKyS0.js → registry-B-whj8SQ.js} +5 -5
- package/dist/{registry-DF_aKyS0.js.map → registry-B-whj8SQ.js.map} +1 -1
- package/dist/{security-CVFKNYBn.js → security-CPtn_dUW.js} +5 -5
- package/dist/{security-CVFKNYBn.js.map → security-CPtn_dUW.js.map} +1 -1
- package/dist/{setup-utils-iINkc0xu.js → setup-utils-e78zkZoW.js} +71 -18
- package/dist/setup-utils-e78zkZoW.js.map +1 -0
- package/dist/{start-tui-CjtL-ls7.js → start-tui-B08PfE0V.js} +21 -18
- package/dist/start-tui-B08PfE0V.js.map +1 -0
- package/dist/{steps-DzUGHdfY.js → steps-Dpd8UTJX.js} +7 -7
- package/dist/{steps-DzUGHdfY.js.map → steps-Dpd8UTJX.js.map} +1 -1
- package/dist/{store-DtckpbSC.js → store-B-ctPH7O.js} +5 -4
- package/dist/store-B-ctPH7O.js.map +1 -0
- package/dist/{subagent-cD_bF490.js → subagent-B18BesIW.js} +2 -2
- package/dist/{subagent-cD_bF490.js.map → subagent-B18BesIW.js.map} +1 -1
- package/dist/{task-eIt2iATF.js → task-D1RaGg3b.js} +12 -12
- package/dist/{task-eIt2iATF.js.map → task-D1RaGg3b.js.map} +1 -1
- package/dist/{task-stream-DGBUveUD.js → task-stream-DvTf1NOr.js} +4 -4
- package/dist/{task-stream-DGBUveUD.js.map → task-stream-DvTf1NOr.js.map} +1 -1
- package/dist/{tasks-wQ3V6Ft6.js → tasks-CvHNNFB1.js} +2 -2
- package/dist/{tasks-wQ3V6Ft6.js.map → tasks-CvHNNFB1.js.map} +1 -1
- package/dist/{telemetry-BWYDFAwf.js → telemetry-C72C8V6q.js} +3 -3
- package/dist/{telemetry-BWYDFAwf.js.map → telemetry-C72C8V6q.js.map} +1 -1
- package/dist/{terminal-yKJZx1UC.js → terminal-BJms6G77.js} +16 -13
- package/dist/terminal-BJms6G77.js.map +1 -0
- package/dist/{tools-CDlaJb_e.js → tools-BcXOgEvh.js} +6 -6
- package/dist/{tools-CDlaJb_e.js.map → tools-BcXOgEvh.js.map} +1 -1
- package/dist/{wizard-abort-Cjk5z73h.js → wizard-abort-BUpx4qnK.js} +1 -1
- package/dist/{wizard-abort-CztG5WTv.js → wizard-abort-DRscjUOg.js} +3 -3
- package/dist/{wizard-abort-CztG5WTv.js.map → wizard-abort-DRscjUOg.js.map} +1 -1
- package/dist/wizard-session-BUhlJ1b8.js.map +1 -1
- package/dist/{yara-hooks-DeLjTIiJ.js → yara-hooks-DKRsn0lN.js} +4 -4
- package/dist/{yara-hooks-DeLjTIiJ.js.map → yara-hooks-DKRsn0lN.js.map} +1 -1
- package/dist/yara-hooks-fHntXaFu.js +2 -0
- package/package.json +1 -1
- package/dist/agent-interface-C90hyvs1.js.map +0 -1
- package/dist/agent-prompt-loader-CBj2DWAJ.js.map +0 -1
- package/dist/agent-runner-DA5YfjOD.js.map +0 -1
- package/dist/analytics-CijpxQFN.js +0 -2
- package/dist/debug-BTPYy9p7.js.map +0 -1
- package/dist/env-api-key-cjD4yfGT.js.map +0 -1
- package/dist/orchestrator-tools-DrhpNOKK.js.map +0 -1
- package/dist/queue-tools-zM8_mxx6.js.map +0 -1
- package/dist/setup-utils-iINkc0xu.js.map +0 -1
- package/dist/start-tui-CjtL-ls7.js.map +0 -1
- package/dist/store-DtckpbSC.js.map +0 -1
- package/dist/terminal-yKJZx1UC.js.map +0 -1
- package/dist/yara-hooks-DVGKhwaz.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as logToFile } from "./debug-
|
|
1
|
+
import { s as logToFile } from "./debug-BYIoy1Oz.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-ZWC-083a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog-
|
|
1
|
+
{"version":3,"file":"posthog-ZWC-083a.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,16 +1,16 @@
|
|
|
1
|
-
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-
|
|
2
|
-
import { n as analytics } from "./analytics-
|
|
3
|
-
import { i as withUtm, n as openTrackedLink } from "./telemetry-
|
|
4
|
-
import { a as safeReadFile, i as readProjectFile, o as walkProjectFiles } from "./bounded-fs-
|
|
5
|
-
import { i as tryGetPackageJson, n as isUsingTypeScript } from "./setup-utils-
|
|
6
|
-
import { i as requestDeepLink } from "./provisioning-
|
|
1
|
+
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-BYIoy1Oz.js";
|
|
2
|
+
import { n as analytics } from "./analytics-YLZKudpE.js";
|
|
3
|
+
import { i as withUtm, n as openTrackedLink } from "./telemetry-C72C8V6q.js";
|
|
4
|
+
import { a as safeReadFile, i as readProjectFile, o as walkProjectFiles } from "./bounded-fs-CYxETRCt.js";
|
|
5
|
+
import { i as tryGetPackageJson, n as isUsingTypeScript } from "./setup-utils-e78zkZoW.js";
|
|
6
|
+
import { i as requestDeepLink } from "./provisioning-xirriYQJ.js";
|
|
7
7
|
import "./wizard-session-BUhlJ1b8.js";
|
|
8
|
-
import { i as wizardAbort } from "./wizard-abort-
|
|
9
|
-
import { n as runAgent, r as shouldDisableAsk, s as authenticate } from "./agent-runner-
|
|
10
|
-
import { S as WIZARD_TOOL_NAMES, i as runAgent$1, p as AgentSignals, r as initializeAgent } from "./agent-interface-
|
|
11
|
-
import { h as EVENT_PLAN_FILE } from "./yara-hooks-
|
|
12
|
-
import { r as detectNodePackageManagers } from "./package-manager-
|
|
13
|
-
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-
|
|
8
|
+
import { i as wizardAbort } from "./wizard-abort-DRscjUOg.js";
|
|
9
|
+
import { n as runAgent, r as shouldDisableAsk, s as authenticate } from "./agent-runner-X3JWS2WK.js";
|
|
10
|
+
import { S as WIZARD_TOOL_NAMES, i as runAgent$1, p as AgentSignals, r as initializeAgent } from "./agent-interface-C4CV7p0L.js";
|
|
11
|
+
import { h as EVENT_PLAN_FILE } from "./yara-hooks-DKRsn0lN.js";
|
|
12
|
+
import { r as detectNodePackageManagers } from "./package-manager-FyJmIsqr.js";
|
|
13
|
+
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-B-whj8SQ.js";
|
|
14
14
|
import * as semver from "semver";
|
|
15
15
|
import { existsSync, statSync } from "fs";
|
|
16
16
|
import { isAbsolute, join, resolve, sep } from "path";
|
|
@@ -3643,24 +3643,48 @@ function resolveContinueUrl(sess, host, deepLink) {
|
|
|
3643
3643
|
if (typeof deepLink === "string" && deepLink) return deepLink;
|
|
3644
3644
|
return withUtm(`${host.appHost}/products?source=wizard`, "outro-continue");
|
|
3645
3645
|
}
|
|
3646
|
+
/** Sources listed with their own link before the outro falls back to a summary line. */
|
|
3647
|
+
const WAREHOUSE_LINK_LIMIT = 3;
|
|
3648
|
+
/**
|
|
3649
|
+
* The app's new-source page, pre-selected to one source kind.
|
|
3650
|
+
*
|
|
3651
|
+
* `kind` is matched case-insensitively against the connector list, and a kind
|
|
3652
|
+
* the app cannot resolve lands on the source catalog rather than erroring. So a
|
|
3653
|
+
* source we detect but the app has not shipped a connector for still takes the
|
|
3654
|
+
* user somewhere useful.
|
|
3655
|
+
*/
|
|
3656
|
+
function warehouseSourceUrl(host, projectId, kind) {
|
|
3657
|
+
return withUtm(`${host.appHost}/project/${projectId}/data-warehouse/new-source?kind=${encodeURIComponent(kind)}`, "outro-warehouse");
|
|
3658
|
+
}
|
|
3646
3659
|
/**
|
|
3647
3660
|
* Outro suggestion for data sources found in the project but not connected.
|
|
3648
3661
|
*
|
|
3649
|
-
* A pointer at
|
|
3650
|
-
*
|
|
3651
|
-
*
|
|
3652
|
-
*
|
|
3653
|
-
*
|
|
3662
|
+
* A pointer at the app, not an inline flow. Connecting a source needs
|
|
3663
|
+
* interactive credential collection, and chaining that as a second agent run
|
|
3664
|
+
* before the outro would let any of its terminal failure paths `process.exit()`
|
|
3665
|
+
* — costing the user the success outro and the post-outro MCP / Slack steps on
|
|
3666
|
+
* a run where PostHog installed fine.
|
|
3667
|
+
*
|
|
3668
|
+
* Each source gets its own pre-filled link, because the alternative we shipped
|
|
3669
|
+
* first — naming the `wizard warehouse` command — asks the user to start a
|
|
3670
|
+
* second CLI run before they can connect anything. A link opens the form for
|
|
3671
|
+
* that one source. The command line stays for anyone who wants every source in
|
|
3672
|
+
* one pass, and it is the only route offered once the list is too long to read.
|
|
3654
3673
|
*
|
|
3655
3674
|
* Returns undefined when nothing was detected, so the outro is unchanged for
|
|
3656
3675
|
* projects with no connectable source.
|
|
3657
3676
|
*/
|
|
3658
|
-
function buildWarehouseNextSteps(sess) {
|
|
3677
|
+
function buildWarehouseNextSteps(sess, host, projectId) {
|
|
3659
3678
|
const sources = getDetectedWarehouseSources(sess);
|
|
3660
3679
|
if (sources.length === 0) return void 0;
|
|
3680
|
+
const listed = sources.slice(0, WAREHOUSE_LINK_LIMIT);
|
|
3681
|
+
const items = listed.map((s) => `Connect ${s.label}: ${warehouseSourceUrl(host, projectId, s.kind)}`);
|
|
3682
|
+
const remaining = sources.length - listed.length;
|
|
3683
|
+
if (remaining > 0) items.push(`And ${remaining} more we found in this project.`);
|
|
3684
|
+
items.push("Connect them all at once with: npx @posthog/wizard warehouse");
|
|
3661
3685
|
return {
|
|
3662
3686
|
heading: "Query your other data in PostHog:",
|
|
3663
|
-
items
|
|
3687
|
+
items
|
|
3664
3688
|
};
|
|
3665
3689
|
}
|
|
3666
3690
|
/**
|
|
@@ -3685,6 +3709,11 @@ function warehouseReportInstruction(sess) {
|
|
|
3685
3709
|
* the run is a fact about the project the wizard already scanned, so a model
|
|
3686
3710
|
* can neither invent it nor forget it.
|
|
3687
3711
|
*
|
|
3712
|
+
* It runs at the end of the queue, not the start. Where exactly is the agent
|
|
3713
|
+
* prompt's business (`dependsOn` in the warehouse agent's frontmatter, resolved
|
|
3714
|
+
* by `seeded-deps.ts` once the planner has run) — this file only decides whether
|
|
3715
|
+
* the task belongs in the run at all.
|
|
3716
|
+
*
|
|
3688
3717
|
* Empty when nothing was detected, and in CI, signup, and any other run where
|
|
3689
3718
|
* `wizard_ask` is disabled — a credential prompt nobody can answer would burn
|
|
3690
3719
|
* the task's whole timeout and then fail the run.
|
|
@@ -3707,7 +3736,7 @@ const warehouseSeedTasks = (sess) => {
|
|
|
3707
3736
|
})) },
|
|
3708
3737
|
notice: {
|
|
3709
3738
|
title: "Connect your data sources",
|
|
3710
|
-
body: ["We detected some warehouse sources we can connect to enrich your PostHog data.
|
|
3739
|
+
body: ["We detected some warehouse sources we can connect to enrich your PostHog data. This runs at the end, once your code changes are done — we’ll prompt you then for the credentials, so you can leave the setup to run until it asks.", "You can select [Skip] if you'd like to do this later in PostHog."],
|
|
3711
3740
|
items: sources.map((s) => s.label),
|
|
3712
3741
|
docsLabel: "Learn more about warehouse sources",
|
|
3713
3742
|
docsUrl: WAREHOUSE_SOURCES_DOCS_URL,
|
|
@@ -3786,6 +3815,7 @@ const posthogIntegrationConfig = {
|
|
|
3786
3815
|
docsUrl: config.metadata.docsUrl,
|
|
3787
3816
|
errorMessage: "Integration failed",
|
|
3788
3817
|
additionalFeatureQueue: session.additionalFeatureQueue,
|
|
3818
|
+
richLinks: true,
|
|
3789
3819
|
customPrompt: (ctx) => {
|
|
3790
3820
|
const additionalLines = config.prompts.getAdditionalContextLines ? config.prompts.getAdditionalContextLines(frameworkContext) : [];
|
|
3791
3821
|
const additionalContext = additionalLines.length > 0 ? "\n" + additionalLines.map((line) => `- ${line}`).join("\n") : "";
|
|
@@ -3829,7 +3859,7 @@ ${warehouseReportInstruction(session)}
|
|
|
3829
3859
|
postRun: async (sess, credentials) => {
|
|
3830
3860
|
const envVars = config.environment.getEnvVars(credentials.projectApiKey, credentials.host.apiHost);
|
|
3831
3861
|
if (config.environment.uploadToHosting) {
|
|
3832
|
-
const { uploadEnvironmentVariablesStep } = await import("./steps-
|
|
3862
|
+
const { uploadEnvironmentVariablesStep } = await import("./steps-Dpd8UTJX.js");
|
|
3833
3863
|
const uploadedEnvVars = await uploadEnvironmentVariablesStep(envVars, {
|
|
3834
3864
|
integration: config.metadata.integration,
|
|
3835
3865
|
session: sess
|
|
@@ -3860,7 +3890,7 @@ ${warehouseReportInstruction(session)}
|
|
|
3860
3890
|
changes: [...config.ui.getOutroChanges(frameworkContext), Object.keys(envVars).length > 0 ? "Added environment variables to .env file" : ""].filter(Boolean),
|
|
3861
3891
|
docsUrl: config.metadata.docsUrl,
|
|
3862
3892
|
continueUrl,
|
|
3863
|
-
nextSteps: buildWarehouseNextSteps(sess),
|
|
3893
|
+
nextSteps: buildWarehouseNextSteps(sess, credentials.host, credentials.projectId),
|
|
3864
3894
|
notebookUrl: sess.notebookUrl ?? void 0,
|
|
3865
3895
|
handoffPrompt: sess.notebookUrl ? buildCodingAgentPrompt(sess.notebookUrl) : void 0
|
|
3866
3896
|
};
|
|
@@ -3885,4 +3915,4 @@ const integrationRunStep = {
|
|
|
3885
3915
|
//#endregion
|
|
3886
3916
|
export { resolveProjectDir as C, detectProjectsWithAgent as S, WAREHOUSE_ABORT_CASES as _, LINE_CHART_BLOCK as a, detectWarehouseSources as b, TextBlock as c, isClearBlock as d, isLinesBlock as f, HEALTH_CHECK_STEP 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, detectWarehousePrerequisites as v, gatherFrameworkContext as w, detectIntegrationProjects as x, getDetectedWarehouseSources as y };
|
|
3887
3917
|
|
|
3888
|
-
//# sourceMappingURL=posthog-integration-
|
|
3918
|
+
//# sourceMappingURL=posthog-integration-CoAID6XW.js.map
|