@posthog/wizard 2.25.0 → 2.27.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 +14 -1
- package/dist/{add-mcp-server-to-clients-t0xe8gn1.js → add-mcp-server-to-clients-D2XNlVgw.js} +4 -4
- package/dist/{add-mcp-server-to-clients-t0xe8gn1.js.map → add-mcp-server-to-clients-D2XNlVgw.js.map} +1 -1
- package/dist/{agent-interface-BsuUUPle.js → agent-interface-DpkR1mbC.js} +39 -12
- package/dist/agent-interface-DpkR1mbC.js.map +1 -0
- package/dist/{agent-runner-L_-kJ3y3.js → agent-runner-D7hIITUf.js} +176 -167
- package/dist/agent-runner-D7hIITUf.js.map +1 -0
- package/dist/{analytics-CDOujOSQ.js → analytics-B7-uRKIJ.js} +2 -2
- package/dist/{analytics-CDOujOSQ.js.map → analytics-B7-uRKIJ.js.map} +1 -1
- package/dist/{api-DNS-L-1U.js → api-2zPZQONC.js} +9 -5
- package/dist/api-2zPZQONC.js.map +1 -0
- package/dist/bin.js +1160 -120
- package/dist/bin.js.map +1 -1
- package/dist/{ci-install-_9A7tL36.js → ci-install-CpGSFNDi.js} +5 -5
- package/dist/{ci-install-_9A7tL36.js.map → ci-install-CpGSFNDi.js.map} +1 -1
- package/dist/{debug-BwC7UkGH.js → debug-Br_xCc9s.js} +3 -2
- package/dist/{debug-BwC7UkGH.js.map → debug-Br_xCc9s.js.map} +1 -1
- package/dist/{debug-CZQcMAJT.js → debug-CDLYQOQh.js} +1 -1
- package/dist/{environment-DQPoj9sU.js → environment-CFXsie0G.js} +3 -3
- package/dist/{environment-DQPoj9sU.js.map → environment-CFXsie0G.js.map} +1 -1
- package/dist/file-utils-CHAj73KM.js +116 -0
- package/dist/file-utils-CHAj73KM.js.map +1 -0
- package/dist/{interactive-DT5dLd7N.js → interactive-lfAs6vF7.js} +3 -3
- package/dist/{interactive-DT5dLd7N.js.map → interactive-lfAs6vF7.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-CBMr458Q.js → mcp-prompt-streaming-BHdAwwob.js} +4 -4
- package/dist/{mcp-prompt-streaming-CBMr458Q.js.map → mcp-prompt-streaming-BHdAwwob.js.map} +1 -1
- package/dist/{non-interactive-csP4yGdA.js → non-interactive--4CK1bkn.js} +2 -2
- package/dist/{non-interactive-csP4yGdA.js.map → non-interactive--4CK1bkn.js.map} +1 -1
- package/dist/{package-manager-CB4c2euf.js → package-manager-BlogZvIK.js} +2 -2
- package/dist/{package-manager-CB4c2euf.js.map → package-manager-BlogZvIK.js.map} +1 -1
- package/dist/{playground-C-lpKoKC.js → playground-De_BxaCh.js} +145 -48
- package/dist/playground-De_BxaCh.js.map +1 -0
- package/dist/{posthog-integration-BL8-vC0V.js → posthog-integration-DWs8JM8J.js} +12 -12
- package/dist/{posthog-integration-BL8-vC0V.js.map → posthog-integration-DWs8JM8J.js.map} +1 -1
- package/dist/{provisioning-DLOiFSM9.js → provisioning-CUwxxByi.js} +10 -6
- package/dist/{provisioning-DLOiFSM9.js.map → provisioning-CUwxxByi.js.map} +1 -1
- package/dist/{registry-BbRzCV5l.js → registry-CIjJsxDE.js} +4 -4
- package/dist/{registry-BbRzCV5l.js.map → registry-CIjJsxDE.js.map} +1 -1
- package/dist/{setup-utils-D87CyNkw.js → setup-utils-CjKjaKcG.js} +81 -16
- package/dist/setup-utils-CjKjaKcG.js.map +1 -0
- package/dist/{start-tui-DnAG57vY.js → start-tui-Cbw0kVr3.js} +471 -54
- package/dist/start-tui-Cbw0kVr3.js.map +1 -0
- package/dist/{steps-JaxH6u0f.js → steps-DUz5lHWu.js} +7 -6
- package/dist/{steps-JaxH6u0f.js.map → steps-DUz5lHWu.js.map} +1 -1
- package/dist/{telemetry-DL28cCwY.js → telemetry-D3CnLknq.js} +3 -3
- package/dist/{telemetry-DL28cCwY.js.map → telemetry-D3CnLknq.js.map} +1 -1
- package/dist/{AiOptInRequiredScreen-C-D9tN6r.js → terminal-DwAdsRPX.js} +1047 -85
- package/dist/terminal-DwAdsRPX.js.map +1 -0
- package/dist/{urls-vkJ5c0ix.js → urls-JN8mo6lU.js} +2 -2
- package/dist/{urls-vkJ5c0ix.js.map → urls-JN8mo6lU.js.map} +1 -1
- package/dist/{wizard-abort-BRXKRL4F.js → wizard-abort-BPr0xo7i.js} +1 -1
- package/dist/{wizard-abort-CLGgMAEe.js → wizard-abort-gHZ7kHYo.js} +3 -3
- package/dist/{wizard-abort-CLGgMAEe.js.map → wizard-abort-gHZ7kHYo.js.map} +1 -1
- package/dist/wizard-session-G3VWD6hv.js.map +1 -1
- package/dist/wizard-ui-WZ48rUgr.js.map +1 -1
- package/package.json +1 -1
- package/dist/AiOptInRequiredScreen-C-D9tN6r.js.map +0 -1
- package/dist/agent-interface-BsuUUPle.js.map +0 -1
- package/dist/agent-runner-L_-kJ3y3.js.map +0 -1
- package/dist/api-DNS-L-1U.js.map +0 -1
- package/dist/file-utils-VAXoyXVA.js +0 -38
- package/dist/file-utils-VAXoyXVA.js.map +0 -1
- package/dist/playground-C-lpKoKC.js.map +0 -1
- package/dist/setup-utils-D87CyNkw.js.map +0 -1
- package/dist/start-tui-DnAG57vY.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { A as OAUTH_PORTS, L as POSTHOG_ORG_AI_SETTINGS_URL, P as POSTHOG_DOCS_URL, R as POSTHOG_PRIVACY_URL, U as REMOTE_SKILLS_BASE_URL, V as POSTHOG_TERMS_URL, Y as WIZARD_TOOLS_MENU_FLAG_KEY, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as OAUTH_TIMEOUT_MS, k as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys } from "./debug-
|
|
2
|
-
import { t as analytics } from "./analytics-
|
|
3
|
-
import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-
|
|
4
|
-
import { a as getUiHostFromHost } from "./urls-
|
|
5
|
-
import { t as ApiError } from "./api-
|
|
1
|
+
import { A as OAUTH_PORTS, L as POSTHOG_ORG_AI_SETTINGS_URL, P as POSTHOG_DOCS_URL, R as POSTHOG_PRIVACY_URL, U as REMOTE_SKILLS_BASE_URL, V as POSTHOG_TERMS_URL, Y as WIZARD_TOOLS_MENU_FLAG_KEY, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as OAUTH_TIMEOUT_MS, k as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys } from "./debug-Br_xCc9s.js";
|
|
2
|
+
import { t as analytics } from "./analytics-B7-uRKIJ.js";
|
|
3
|
+
import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-CjKjaKcG.js";
|
|
4
|
+
import { a as getUiHostFromHost } from "./urls-JN8mo6lU.js";
|
|
5
|
+
import { t as ApiError } from "./api-2zPZQONC.js";
|
|
6
6
|
import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-G3VWD6hv.js";
|
|
7
|
-
import { i as wizardAbort } from "./wizard-abort-
|
|
8
|
-
import { C as AUDIT_SEVERITY_STYLE, T as getAuditChecks, b as AUDIT_CHECKS_FILE, h as fetchSkillMenu, m as downloadSkill, w as coerceAuditChecks, x as AUDIT_CHECKS_KEY } from "./agent-interface-
|
|
9
|
-
import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-
|
|
10
|
-
import { _ as
|
|
11
|
-
import { A as
|
|
7
|
+
import { i as wizardAbort } from "./wizard-abort-gHZ7kHYo.js";
|
|
8
|
+
import { C as AUDIT_SEVERITY_STYLE, T as getAuditChecks, b as AUDIT_CHECKS_FILE, h as fetchSkillMenu, m as downloadSkill, w as coerceAuditChecks, x as AUDIT_CHECKS_KEY } from "./agent-interface-DpkR1mbC.js";
|
|
9
|
+
import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-DWs8JM8J.js";
|
|
10
|
+
import { _ as getContentBlocks, d as getProgramConfig, f as DISPLAY_NAME, g as getDetectedWarehouseSources, h as fetchHealthIssues, n as useKeyBindings, p as SOURCE_MAPS_CONTEXT_KEYS, t as PickerMenu, u as Program, v as POSTHOG_SDKS, y as STRIPE_SDKS } from "./bin.js";
|
|
11
|
+
import { A as ConfirmationInput, C as TabContainer, D as LinkText, E as LogViewer, F as SplitView, L as WizardStore, M as useStdoutDimensions, N as ProgressList, O as extractUrls, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as ServiceHealthList, a as useSkillEntry, b as LearnCard, c as AUDIT_AREA_SLIDES, d as McpSuggestedPromptsScreen, g as SEVERITY_ORDER, h as SEVERITY_LABEL, i as SkillSourceInfo, k as ModalOverlay, l as VisualBox, m as IssueTable, n as releaseTerminal, o as OutroScreen, p as McpScreen, r as AiOptInRequiredScreen, s as SlackConnectScreen, t as enterDarkTerminal, u as AuditChecksViewer, v as VisualizerTab, w as ScreenContainer, y as TipsCard } from "./terminal-DwAdsRPX.js";
|
|
12
12
|
import { t as ALL_FEATURE_VALUES } from "./defaults-BNWIWzjc.js";
|
|
13
|
-
import { a as getSupportedClients, c as removeMCPServer, i as getInstalledClients, o as getSupportedPluginClients, s as installPlugins, u as isPluginCapable } from "./add-mcp-server-to-clients-
|
|
13
|
+
import { a as getSupportedClients, c as removeMCPServer, i as getInstalledClients, o as getSupportedPluginClients, s as installPlugins, u as isPluginCapable } from "./add-mcp-server-to-clients-D2XNlVgw.js";
|
|
14
14
|
import * as fs$1 from "fs";
|
|
15
15
|
import path from "path";
|
|
16
16
|
import { join as join$1 } from "node:path";
|
|
@@ -18,8 +18,8 @@ import { spawn, spawnSync } from "node:child_process";
|
|
|
18
18
|
import { Box, Text, render, useInput } from "ink";
|
|
19
19
|
import { Fragment, createElement, useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
20
20
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { Spinner, TextInput } from "@inkjs/ui";
|
|
22
21
|
import { access, readdir, rm } from "node:fs/promises";
|
|
22
|
+
import { Spinner, TextInput } from "@inkjs/ui";
|
|
23
23
|
//#region src/ui/tui/ink-ui.ts
|
|
24
24
|
const ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
25
25
|
function stripAnsi(s) {
|
|
@@ -158,6 +158,9 @@ var InkUI = class {
|
|
|
158
158
|
setDashboardUrl(url) {
|
|
159
159
|
this.store.setDashboardUrl(url);
|
|
160
160
|
}
|
|
161
|
+
setStage(stage) {
|
|
162
|
+
this.store.setCurrentStage(stage);
|
|
163
|
+
}
|
|
161
164
|
setNotebookUrl(url) {
|
|
162
165
|
this.store.setNotebookUrl(url);
|
|
163
166
|
}
|
|
@@ -864,7 +867,15 @@ const WizardTitle = ({ title }) => /* @__PURE__ */ jsxs(Text, {
|
|
|
864
867
|
title
|
|
865
868
|
]
|
|
866
869
|
});
|
|
867
|
-
|
|
870
|
+
/** Generic subtitle shown when a screen doesn't supply its own. */
|
|
871
|
+
const DEFAULT_SUBTITLE = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
|
|
872
|
+
dimColor: true,
|
|
873
|
+
children: "We'll use AI to analyze your project and complete work."
|
|
874
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
875
|
+
dimColor: true,
|
|
876
|
+
children: ".env* file contents will not leave your machine."
|
|
877
|
+
})] });
|
|
878
|
+
const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubtitle = true, subtitle, body, showDetection = true, detectionRows, children, menuOptions, menuAlign = "center", onSelect, programLabel, skillId, errorView }) => {
|
|
868
879
|
const resolvedMenuOptions = menuOptions === void 0 ? [{
|
|
869
880
|
label: "Continue",
|
|
870
881
|
value: "continue"
|
|
@@ -895,17 +906,11 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
|
|
|
895
906
|
alignItems: "center",
|
|
896
907
|
children: [
|
|
897
908
|
/* @__PURE__ */ jsx(WizardTitle, { title }),
|
|
898
|
-
showSubtitle && /* @__PURE__ */
|
|
909
|
+
showSubtitle && /* @__PURE__ */ jsx(Box, {
|
|
899
910
|
flexDirection: "column",
|
|
900
911
|
alignItems: "center",
|
|
901
912
|
marginTop: 1,
|
|
902
|
-
children:
|
|
903
|
-
dimColor: true,
|
|
904
|
-
children: "We'll use AI to analyze your project and complete work."
|
|
905
|
-
}), /* @__PURE__ */ jsx(Text, {
|
|
906
|
-
dimColor: true,
|
|
907
|
-
children: ".env* file contents will not leave your machine."
|
|
908
|
-
})]
|
|
913
|
+
children: subtitle ?? DEFAULT_SUBTITLE
|
|
909
914
|
}),
|
|
910
915
|
body && /* @__PURE__ */ jsx(Box, {
|
|
911
916
|
flexDirection: "column",
|
|
@@ -1060,7 +1065,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
|
|
|
1060
1065
|
})),
|
|
1061
1066
|
onSelect: (value) => {
|
|
1062
1067
|
const integration = Array.isArray(value) ? value[0] : value;
|
|
1063
|
-
import("./registry-
|
|
1068
|
+
import("./registry-CIjJsxDE.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
|
|
1064
1069
|
const config = FRAMEWORK_REGISTRY[integration];
|
|
1065
1070
|
store.setFrameworkConfig(integration, config);
|
|
1066
1071
|
store.setDetectedFramework(config.metadata.name);
|
|
@@ -1404,7 +1409,7 @@ const RevenueIntroScreen = ({ store }) => {
|
|
|
1404
1409
|
}), /* @__PURE__ */ jsx(Box, {
|
|
1405
1410
|
marginTop: 1,
|
|
1406
1411
|
flexDirection: "column",
|
|
1407
|
-
children: /* @__PURE__ */ jsx(DetectErrorBody$
|
|
1412
|
+
children: /* @__PURE__ */ jsx(DetectErrorBody$3, { error: detectError })
|
|
1408
1413
|
})]
|
|
1409
1414
|
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
1410
1415
|
options: [{
|
|
@@ -1448,7 +1453,7 @@ const RevenueIntroScreen = ({ store }) => {
|
|
|
1448
1453
|
}
|
|
1449
1454
|
});
|
|
1450
1455
|
};
|
|
1451
|
-
const DetectErrorBody$
|
|
1456
|
+
const DetectErrorBody$3 = ({ error }) => {
|
|
1452
1457
|
switch (error.kind) {
|
|
1453
1458
|
case "bad-directory": {
|
|
1454
1459
|
const reasonText = {
|
|
@@ -1572,6 +1577,165 @@ const DetectErrorBody$1 = ({ error }) => {
|
|
|
1572
1577
|
}
|
|
1573
1578
|
};
|
|
1574
1579
|
//#endregion
|
|
1580
|
+
//#region src/ui/tui/screens/WarehouseIntroScreen.tsx
|
|
1581
|
+
/**
|
|
1582
|
+
* WarehouseIntroScreen — Welcome screen for the data warehouse source flow.
|
|
1583
|
+
*
|
|
1584
|
+
* Composes IntroScreenLayout with detection-specific state:
|
|
1585
|
+
* - Detection succeeded: lists detected sources (grouped by creation mode),
|
|
1586
|
+
* continue/cancel.
|
|
1587
|
+
* - Detection failed: shows the error via errorView + exit prompt.
|
|
1588
|
+
*
|
|
1589
|
+
* Reads `frameworkContext.detectError` and `frameworkContext.detectedWarehouseSources`
|
|
1590
|
+
* set by detectWarehousePrerequisites().
|
|
1591
|
+
*/
|
|
1592
|
+
const WarehouseIntroScreen = ({ store }) => {
|
|
1593
|
+
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
1594
|
+
const [showingMoreInfo, setShowingMoreInfo] = useState(false);
|
|
1595
|
+
const { session } = store;
|
|
1596
|
+
const detectError = session.frameworkContext.detectError;
|
|
1597
|
+
const detected = getDetectedWarehouseSources(session);
|
|
1598
|
+
const body = showingMoreInfo ? /* @__PURE__ */ jsxs(Box, {
|
|
1599
|
+
flexDirection: "column",
|
|
1600
|
+
width: 56,
|
|
1601
|
+
flexShrink: 0,
|
|
1602
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
1603
|
+
"The wizard is an agent that executes PostHog tasks. Its code is open source: ",
|
|
1604
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1605
|
+
color: "cyan",
|
|
1606
|
+
children: "https://github.com/PostHog/wizard"
|
|
1607
|
+
}),
|
|
1608
|
+
"."
|
|
1609
|
+
] }), /* @__PURE__ */ jsx(Box, {
|
|
1610
|
+
flexDirection: "column",
|
|
1611
|
+
marginTop: 1,
|
|
1612
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
1613
|
+
"The",
|
|
1614
|
+
" ",
|
|
1615
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1616
|
+
italic: true,
|
|
1617
|
+
color: "cyan",
|
|
1618
|
+
children: session.programLabel
|
|
1619
|
+
}),
|
|
1620
|
+
" ",
|
|
1621
|
+
"program connects your existing data sources to PostHog's data warehouse, so you can query them alongside product data."
|
|
1622
|
+
] })
|
|
1623
|
+
})]
|
|
1624
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Box, {
|
|
1625
|
+
flexDirection: "column",
|
|
1626
|
+
alignItems: "center",
|
|
1627
|
+
children: /* @__PURE__ */ jsx(Text, { children: "Let's connect your data to PostHog's data warehouse." })
|
|
1628
|
+
}), detected.length > 0 && /* @__PURE__ */ jsxs(Box, {
|
|
1629
|
+
flexDirection: "column",
|
|
1630
|
+
marginTop: 1,
|
|
1631
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
1632
|
+
dimColor: true,
|
|
1633
|
+
children: "Detected warehouse sources:"
|
|
1634
|
+
}), detected.map((s) => /* @__PURE__ */ jsxs(Text, {
|
|
1635
|
+
dimColor: true,
|
|
1636
|
+
children: [
|
|
1637
|
+
" •",
|
|
1638
|
+
" ",
|
|
1639
|
+
s.label
|
|
1640
|
+
]
|
|
1641
|
+
}, s.kind))]
|
|
1642
|
+
})] });
|
|
1643
|
+
const errorView = detectError ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
1644
|
+
flexDirection: "column",
|
|
1645
|
+
marginBottom: 1,
|
|
1646
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1647
|
+
color: "red",
|
|
1648
|
+
bold: true,
|
|
1649
|
+
children: [
|
|
1650
|
+
"✘",
|
|
1651
|
+
" ",
|
|
1652
|
+
detectError.kind === "bad-directory" ? "Invalid project directory" : "No data warehouse source detected"
|
|
1653
|
+
]
|
|
1654
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
1655
|
+
marginTop: 1,
|
|
1656
|
+
flexDirection: "column",
|
|
1657
|
+
children: /* @__PURE__ */ jsx(DetectErrorBody$2, { error: detectError })
|
|
1658
|
+
})]
|
|
1659
|
+
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
1660
|
+
options: [{
|
|
1661
|
+
label: "Exit",
|
|
1662
|
+
value: "exit"
|
|
1663
|
+
}],
|
|
1664
|
+
onSelect: () => process.exit(0)
|
|
1665
|
+
})] }) : void 0;
|
|
1666
|
+
const menuOptions = showingMoreInfo ? [{
|
|
1667
|
+
label: "Back",
|
|
1668
|
+
value: "back"
|
|
1669
|
+
}] : [
|
|
1670
|
+
{
|
|
1671
|
+
label: "Continue",
|
|
1672
|
+
value: "continue"
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
label: "More info",
|
|
1676
|
+
value: "more-info"
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
label: "Cancel",
|
|
1680
|
+
value: "cancel"
|
|
1681
|
+
}
|
|
1682
|
+
];
|
|
1683
|
+
return /* @__PURE__ */ jsx(IntroScreenLayout, {
|
|
1684
|
+
installDir: session.installDir,
|
|
1685
|
+
showSubtitle: !showingMoreInfo,
|
|
1686
|
+
body,
|
|
1687
|
+
showDetection: !showingMoreInfo,
|
|
1688
|
+
programLabel: session.programLabel,
|
|
1689
|
+
skillId: session.skillId,
|
|
1690
|
+
menuOptions,
|
|
1691
|
+
errorView,
|
|
1692
|
+
onSelect: (value) => {
|
|
1693
|
+
if (value === "cancel") process.exit(0);
|
|
1694
|
+
else if (value === "more-info") setShowingMoreInfo(true);
|
|
1695
|
+
else if (value === "back") setShowingMoreInfo(false);
|
|
1696
|
+
else store.completeSetup();
|
|
1697
|
+
}
|
|
1698
|
+
});
|
|
1699
|
+
};
|
|
1700
|
+
const DetectErrorBody$2 = ({ error }) => {
|
|
1701
|
+
switch (error.kind) {
|
|
1702
|
+
case "bad-directory": {
|
|
1703
|
+
const reasonText = {
|
|
1704
|
+
missing: "does not exist",
|
|
1705
|
+
"not-dir": "is not a directory",
|
|
1706
|
+
unreadable: "could not be accessed"
|
|
1707
|
+
}[error.reason];
|
|
1708
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
1709
|
+
"This path ",
|
|
1710
|
+
reasonText,
|
|
1711
|
+
":"
|
|
1712
|
+
] }), /* @__PURE__ */ jsxs(Text, {
|
|
1713
|
+
dimColor: true,
|
|
1714
|
+
children: [" ", error.path]
|
|
1715
|
+
})] });
|
|
1716
|
+
}
|
|
1717
|
+
case "no-sources": return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, { children: "No supported data source was detected in this project." }), /* @__PURE__ */ jsxs(Box, {
|
|
1718
|
+
marginTop: 1,
|
|
1719
|
+
flexDirection: "column",
|
|
1720
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
1721
|
+
dimColor: true,
|
|
1722
|
+
children: "The wizard looks for databases (Postgres, MySQL, MongoDB, …) and API-key sources like Stripe in your dependencies and .env keys."
|
|
1723
|
+
}), /* @__PURE__ */ jsxs(Text, {
|
|
1724
|
+
dimColor: true,
|
|
1725
|
+
children: [
|
|
1726
|
+
"Run this command from your project root, or set a source up directly at",
|
|
1727
|
+
" ",
|
|
1728
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1729
|
+
color: "cyan",
|
|
1730
|
+
children: "https://posthog.com/docs/data-warehouse"
|
|
1731
|
+
}),
|
|
1732
|
+
"."
|
|
1733
|
+
]
|
|
1734
|
+
})]
|
|
1735
|
+
})] });
|
|
1736
|
+
}
|
|
1737
|
+
};
|
|
1738
|
+
//#endregion
|
|
1575
1739
|
//#region src/ui/tui/screens/MigrationIntroScreen.tsx
|
|
1576
1740
|
const MigrationIntroScreen = ({ store }) => {
|
|
1577
1741
|
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
@@ -1710,7 +1874,7 @@ const SourceMapsIntroScreen = ({ store }) => {
|
|
|
1710
1874
|
}), /* @__PURE__ */ jsx(Box, {
|
|
1711
1875
|
marginTop: 1,
|
|
1712
1876
|
flexDirection: "column",
|
|
1713
|
-
children: /* @__PURE__ */ jsx(DetectErrorBody, { error: detectError })
|
|
1877
|
+
children: /* @__PURE__ */ jsx(DetectErrorBody$1, { error: detectError })
|
|
1714
1878
|
})]
|
|
1715
1879
|
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
1716
1880
|
options: [{
|
|
@@ -1792,7 +1956,7 @@ const NATIVE_PLATFORM_DOCS = {
|
|
|
1792
1956
|
url: "https://posthog.com/docs/error-tracking/upload-source-maps/flutter"
|
|
1793
1957
|
}
|
|
1794
1958
|
};
|
|
1795
|
-
const DetectErrorBody = ({ error }) => {
|
|
1959
|
+
const DetectErrorBody$1 = ({ error }) => {
|
|
1796
1960
|
switch (error.kind) {
|
|
1797
1961
|
case "bad-directory": {
|
|
1798
1962
|
const reasonText = {
|
|
@@ -2172,6 +2336,168 @@ const AgentSkillIntroScreen = ({ store }) => {
|
|
|
2172
2336
|
});
|
|
2173
2337
|
};
|
|
2174
2338
|
//#endregion
|
|
2339
|
+
//#region src/ui/tui/screens/SelfDrivingIntroScreen.tsx
|
|
2340
|
+
/**
|
|
2341
|
+
* SelfDrivingIntroScreen — Welcome screen for the self-driving flow.
|
|
2342
|
+
*
|
|
2343
|
+
* Composes IntroScreenLayout with prerequisite-detection state:
|
|
2344
|
+
* - Detection succeeded: explains what Self-driving turns on, continue/cancel
|
|
2345
|
+
* - Detection failed: shows the error via errorView + exit prompt
|
|
2346
|
+
*
|
|
2347
|
+
* Reads `frameworkContext.detectError` set by
|
|
2348
|
+
* detectSelfDrivingPrerequisites().
|
|
2349
|
+
*/
|
|
2350
|
+
const SelfDrivingIntroScreen = ({ store }) => {
|
|
2351
|
+
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
2352
|
+
const [showingMoreInfo, setShowingMoreInfo] = useState(false);
|
|
2353
|
+
const { session } = store;
|
|
2354
|
+
const detectError = session.frameworkContext.detectError;
|
|
2355
|
+
const subtitle = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
|
|
2356
|
+
dimColor: true,
|
|
2357
|
+
children: "We'll use AI to analyze your project and set up PostHog Self-driving."
|
|
2358
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
2359
|
+
dimColor: true,
|
|
2360
|
+
children: ".env* file contents will not leave your machine."
|
|
2361
|
+
})] });
|
|
2362
|
+
const body = showingMoreInfo ? /* @__PURE__ */ jsxs(Box, {
|
|
2363
|
+
flexDirection: "column",
|
|
2364
|
+
width: 56,
|
|
2365
|
+
flexShrink: 0,
|
|
2366
|
+
children: [
|
|
2367
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
2368
|
+
"The wizard is an agent that executes PostHog tasks. Its code is open source: ",
|
|
2369
|
+
/* @__PURE__ */ jsx(Text, {
|
|
2370
|
+
color: "cyan",
|
|
2371
|
+
children: "https://github.com/PostHog/wizard"
|
|
2372
|
+
}),
|
|
2373
|
+
"."
|
|
2374
|
+
] }),
|
|
2375
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2376
|
+
flexDirection: "column",
|
|
2377
|
+
marginTop: 1,
|
|
2378
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
2379
|
+
"The",
|
|
2380
|
+
" ",
|
|
2381
|
+
/* @__PURE__ */ jsx(Text, {
|
|
2382
|
+
italic: true,
|
|
2383
|
+
color: "cyan",
|
|
2384
|
+
children: session.programLabel
|
|
2385
|
+
}),
|
|
2386
|
+
" ",
|
|
2387
|
+
"program turns on PostHog Self-driving for this project:"
|
|
2388
|
+
] })
|
|
2389
|
+
}),
|
|
2390
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
2391
|
+
flexDirection: "column",
|
|
2392
|
+
marginTop: 1,
|
|
2393
|
+
paddingLeft: 4,
|
|
2394
|
+
children: [
|
|
2395
|
+
/* @__PURE__ */ jsxs(Text, { children: ["•", " Watches errors, replays, and connected tools"] }),
|
|
2396
|
+
/* @__PURE__ */ jsxs(Text, { children: ["•", " Runs scouts — scheduled checks that scan for issues"] }),
|
|
2397
|
+
/* @__PURE__ */ jsxs(Text, { children: ["•", " Researches findings in your code via GitHub"] }),
|
|
2398
|
+
/* @__PURE__ */ jsxs(Text, { children: ["•", " Surfaces everything in your Self-driving inbox"] })
|
|
2399
|
+
]
|
|
2400
|
+
})
|
|
2401
|
+
]
|
|
2402
|
+
}) : /* @__PURE__ */ jsxs(Box, {
|
|
2403
|
+
flexDirection: "column",
|
|
2404
|
+
alignItems: "center",
|
|
2405
|
+
children: [
|
|
2406
|
+
/* @__PURE__ */ jsx(Text, { children: "Let's set up PostHog Self-driving." }),
|
|
2407
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2408
|
+
flexDirection: "column",
|
|
2409
|
+
marginTop: 1,
|
|
2410
|
+
children: /* @__PURE__ */ jsx(Text, { children: "PostHog finds — and can fix — issues in your product." })
|
|
2411
|
+
}),
|
|
2412
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
2413
|
+
flexDirection: "column",
|
|
2414
|
+
marginTop: 1,
|
|
2415
|
+
alignItems: "center",
|
|
2416
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
2417
|
+
dimColor: true,
|
|
2418
|
+
children: "It turns on signal sources (errors, replays, connected tools)"
|
|
2419
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
2420
|
+
dimColor: true,
|
|
2421
|
+
children: "and scouts — scheduled checks that flag issues to your inbox."
|
|
2422
|
+
})]
|
|
2423
|
+
})
|
|
2424
|
+
]
|
|
2425
|
+
});
|
|
2426
|
+
const errorView = detectError ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
2427
|
+
flexDirection: "column",
|
|
2428
|
+
marginBottom: 1,
|
|
2429
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
2430
|
+
color: "red",
|
|
2431
|
+
bold: true,
|
|
2432
|
+
children: ["✘", " Cannot set up PostHog Self-driving"]
|
|
2433
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
2434
|
+
marginTop: 1,
|
|
2435
|
+
flexDirection: "column",
|
|
2436
|
+
children: /* @__PURE__ */ jsx(DetectErrorBody, { error: detectError })
|
|
2437
|
+
})]
|
|
2438
|
+
}), /* @__PURE__ */ jsx(PickerMenu, {
|
|
2439
|
+
options: [{
|
|
2440
|
+
label: "Exit",
|
|
2441
|
+
value: "exit"
|
|
2442
|
+
}],
|
|
2443
|
+
onSelect: () => process.exit(1)
|
|
2444
|
+
})] }) : void 0;
|
|
2445
|
+
const menuOptions = showingMoreInfo ? [{
|
|
2446
|
+
label: "Back",
|
|
2447
|
+
value: "back"
|
|
2448
|
+
}] : [
|
|
2449
|
+
{
|
|
2450
|
+
label: "Continue",
|
|
2451
|
+
value: "continue"
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
label: "More info",
|
|
2455
|
+
value: "more-info"
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
label: "Cancel",
|
|
2459
|
+
value: "cancel"
|
|
2460
|
+
}
|
|
2461
|
+
];
|
|
2462
|
+
return /* @__PURE__ */ jsx(IntroScreenLayout, {
|
|
2463
|
+
installDir: session.installDir,
|
|
2464
|
+
showSubtitle: !showingMoreInfo,
|
|
2465
|
+
subtitle,
|
|
2466
|
+
body,
|
|
2467
|
+
showDetection: !showingMoreInfo,
|
|
2468
|
+
errorView,
|
|
2469
|
+
programLabel: session.programLabel,
|
|
2470
|
+
skillId: session.skillId,
|
|
2471
|
+
menuOptions,
|
|
2472
|
+
onSelect: (value) => {
|
|
2473
|
+
if (value === "cancel") process.exit(0);
|
|
2474
|
+
else if (value === "more-info") setShowingMoreInfo(true);
|
|
2475
|
+
else if (value === "back") setShowingMoreInfo(false);
|
|
2476
|
+
else store.completeSetup();
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
};
|
|
2480
|
+
const DetectErrorBody = ({ error }) => {
|
|
2481
|
+
switch (error.kind) {
|
|
2482
|
+
case "bad-directory": {
|
|
2483
|
+
const reasonText = {
|
|
2484
|
+
missing: "does not exist",
|
|
2485
|
+
"not-dir": "is not a directory",
|
|
2486
|
+
unreadable: "could not be accessed"
|
|
2487
|
+
}[error.reason];
|
|
2488
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
2489
|
+
"This path ",
|
|
2490
|
+
reasonText,
|
|
2491
|
+
":"
|
|
2492
|
+
] }), /* @__PURE__ */ jsxs(Text, {
|
|
2493
|
+
dimColor: true,
|
|
2494
|
+
children: [" ", error.path]
|
|
2495
|
+
})] });
|
|
2496
|
+
}
|
|
2497
|
+
default: return /* @__PURE__ */ jsx(Text, { children: "Self-driving could not start in this directory. Try again, or reach out to wizard@posthog.com." });
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
//#endregion
|
|
2175
2501
|
//#region src/ui/tui/screens/audit/AuditIntroScreen.tsx
|
|
2176
2502
|
const AuditIntroScreen = ({ store }) => {
|
|
2177
2503
|
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
@@ -3379,7 +3705,11 @@ const RunScreen = ({ store }) => {
|
|
|
3379
3705
|
const learnBlocks = useMemo(() => {
|
|
3380
3706
|
return (getProgramConfig(activeProgram).getContentBlocks ?? getContentBlocks)(store);
|
|
3381
3707
|
}, [store, activeProgram]);
|
|
3382
|
-
const
|
|
3708
|
+
const programTips = getProgramConfig(activeProgram).getTips?.(store);
|
|
3709
|
+
const leftPane = store.learnCardComplete ? /* @__PURE__ */ jsx(TipsCard, {
|
|
3710
|
+
store,
|
|
3711
|
+
tips: programTips
|
|
3712
|
+
}) : /* @__PURE__ */ jsx(LearnCard, {
|
|
3383
3713
|
store,
|
|
3384
3714
|
blocks: learnBlocks,
|
|
3385
3715
|
onComplete: () => store.setLearnCardComplete()
|
|
@@ -3412,6 +3742,11 @@ const RunScreen = ({ store }) => {
|
|
|
3412
3742
|
label: "Tail logs",
|
|
3413
3743
|
component: /* @__PURE__ */ jsx(LogViewer, { filePath: WIZARD_LOG_FILE })
|
|
3414
3744
|
},
|
|
3745
|
+
{
|
|
3746
|
+
id: "visualizer",
|
|
3747
|
+
label: "Visualizer",
|
|
3748
|
+
component: /* @__PURE__ */ jsx(VisualizerTab, { store })
|
|
3749
|
+
},
|
|
3415
3750
|
{
|
|
3416
3751
|
id: "hn",
|
|
3417
3752
|
label: "HN",
|
|
@@ -3767,6 +4102,62 @@ const SessionTimeoutScreen = ({ store }) => {
|
|
|
3767
4102
|
});
|
|
3768
4103
|
};
|
|
3769
4104
|
//#endregion
|
|
4105
|
+
//#region src/utils/clipboard.ts
|
|
4106
|
+
/**
|
|
4107
|
+
* Best-effort clipboard write — no third-party dependency.
|
|
4108
|
+
*
|
|
4109
|
+
* Used as a fallback so users can paste a URL their terminal can't linkify
|
|
4110
|
+
* (e.g. macOS Terminal.app, which lacks OSC 8 hyperlink support). Shells out to
|
|
4111
|
+
* the platform clipboard binary over stdin; never throws — returns false when no
|
|
4112
|
+
* clipboard command is reachable (CI, headless, or the binary isn't installed).
|
|
4113
|
+
*
|
|
4114
|
+
* Text is passed via stdin (never as an argv) so there's no shell-injection
|
|
4115
|
+
* surface, and `spawn` runs without a shell.
|
|
4116
|
+
*/
|
|
4117
|
+
/** Platform clipboard commands, in preference order. */
|
|
4118
|
+
function clipboardCommands() {
|
|
4119
|
+
if (process.platform === "darwin") return [{
|
|
4120
|
+
cmd: "pbcopy",
|
|
4121
|
+
args: []
|
|
4122
|
+
}];
|
|
4123
|
+
if (process.platform === "win32") return [{
|
|
4124
|
+
cmd: "clip",
|
|
4125
|
+
args: []
|
|
4126
|
+
}];
|
|
4127
|
+
return [
|
|
4128
|
+
{
|
|
4129
|
+
cmd: "wl-copy",
|
|
4130
|
+
args: []
|
|
4131
|
+
},
|
|
4132
|
+
{
|
|
4133
|
+
cmd: "xclip",
|
|
4134
|
+
args: ["-selection", "clipboard"]
|
|
4135
|
+
},
|
|
4136
|
+
{
|
|
4137
|
+
cmd: "xsel",
|
|
4138
|
+
args: ["--clipboard", "--input"]
|
|
4139
|
+
}
|
|
4140
|
+
];
|
|
4141
|
+
}
|
|
4142
|
+
function writeWith({ cmd, args }, text) {
|
|
4143
|
+
return new Promise((resolve) => {
|
|
4144
|
+
try {
|
|
4145
|
+
const child = spawn(cmd, args);
|
|
4146
|
+
child.on("error", () => resolve(false));
|
|
4147
|
+
child.stdin.on("error", () => resolve(false));
|
|
4148
|
+
child.on("close", (code) => resolve(code === 0));
|
|
4149
|
+
child.stdin.end(text);
|
|
4150
|
+
} catch {
|
|
4151
|
+
resolve(false);
|
|
4152
|
+
}
|
|
4153
|
+
});
|
|
4154
|
+
}
|
|
4155
|
+
async function copyToClipboard(text) {
|
|
4156
|
+
for (const command of clipboardCommands()) if (await writeWith(command, text)) return true;
|
|
4157
|
+
logToFile("[clipboard] no working clipboard command found");
|
|
4158
|
+
return false;
|
|
4159
|
+
}
|
|
4160
|
+
//#endregion
|
|
3770
4161
|
//#region src/ui/tui/screens/WizardAskScreen.tsx
|
|
3771
4162
|
/**
|
|
3772
4163
|
* WizardAskScreen — Overlay for the `wizard_ask` MCP tool.
|
|
@@ -3781,6 +4172,22 @@ const WizardAskScreen = ({ store }) => {
|
|
|
3781
4172
|
const [index, setIndex] = useState(0);
|
|
3782
4173
|
const [answers, setAnswers] = useState({});
|
|
3783
4174
|
const [lastPendingId, setLastPendingId] = useState(null);
|
|
4175
|
+
const [copied, setCopied] = useState(false);
|
|
4176
|
+
const richLinks = pending?.richLinks ?? false;
|
|
4177
|
+
const currentPrompt = pending?.questions[index]?.prompt ?? "";
|
|
4178
|
+
const promptUrls = richLinks ? extractUrls(currentPrompt) : [];
|
|
4179
|
+
const soleUrl = promptUrls.length === 1 ? promptUrls[0] : null;
|
|
4180
|
+
useEffect(() => {
|
|
4181
|
+
setCopied(false);
|
|
4182
|
+
if (!soleUrl) return;
|
|
4183
|
+
let active = true;
|
|
4184
|
+
copyToClipboard(soleUrl).then((ok) => {
|
|
4185
|
+
if (active && ok) setCopied(true);
|
|
4186
|
+
});
|
|
4187
|
+
return () => {
|
|
4188
|
+
active = false;
|
|
4189
|
+
};
|
|
4190
|
+
}, [soleUrl]);
|
|
3784
4191
|
if (!pending) return null;
|
|
3785
4192
|
if (pending.id !== lastPendingId) {
|
|
3786
4193
|
setLastPendingId(pending.id);
|
|
@@ -3819,7 +4226,14 @@ const WizardAskScreen = ({ store }) => {
|
|
|
3819
4226
|
}),
|
|
3820
4227
|
/* @__PURE__ */ jsx(Box, {
|
|
3821
4228
|
flexDirection: "column",
|
|
3822
|
-
children: /* @__PURE__ */ jsx(Text, { children: question.prompt })
|
|
4229
|
+
children: pending.richLinks ? /* @__PURE__ */ jsx(LinkText, { text: question.prompt }) : /* @__PURE__ */ jsx(Text, { children: question.prompt })
|
|
4230
|
+
}),
|
|
4231
|
+
pending.richLinks && copied && /* @__PURE__ */ jsx(Box, {
|
|
4232
|
+
marginTop: 1,
|
|
4233
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
4234
|
+
dimColor: true,
|
|
4235
|
+
children: "Link copied to clipboard — paste it in your browser if it isn't clickable."
|
|
4236
|
+
})
|
|
3823
4237
|
}),
|
|
3824
4238
|
/* @__PURE__ */ jsx(Box, {
|
|
3825
4239
|
marginTop: 1,
|
|
@@ -3842,16 +4256,21 @@ const QuestionInput = ({ question, onSubmit }) => {
|
|
|
3842
4256
|
onSubmit(Array.isArray(value) ? value[0] : value);
|
|
3843
4257
|
}
|
|
3844
4258
|
});
|
|
3845
|
-
case "multi":
|
|
3846
|
-
|
|
3847
|
-
options: (question.options ?? []).map((o) => ({
|
|
4259
|
+
case "multi": {
|
|
4260
|
+
const multiOptions = (question.options ?? []).map((o) => ({
|
|
3848
4261
|
label: o.label,
|
|
3849
|
-
value: o.value
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
4262
|
+
value: o.value,
|
|
4263
|
+
description: o.description
|
|
4264
|
+
}));
|
|
4265
|
+
return /* @__PURE__ */ jsx(PickerMenu, {
|
|
4266
|
+
mode: "multi",
|
|
4267
|
+
optionMarginBottom: multiOptions.some((o) => o.description) ? 1 : 0,
|
|
4268
|
+
options: multiOptions,
|
|
4269
|
+
onSelect: (value) => {
|
|
4270
|
+
onSubmit(Array.isArray(value) ? value : [value]);
|
|
4271
|
+
}
|
|
4272
|
+
});
|
|
4273
|
+
}
|
|
3855
4274
|
case "text": return /* @__PURE__ */ jsxs(Box, {
|
|
3856
4275
|
flexDirection: "column",
|
|
3857
4276
|
width: "100%",
|
|
@@ -3974,7 +4393,7 @@ function createMcpSuggestedPromptsServices(_store) {
|
|
|
3974
4393
|
};
|
|
3975
4394
|
}
|
|
3976
4395
|
async function* runProductionPromptStreaming(args) {
|
|
3977
|
-
const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-
|
|
4396
|
+
const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-BHdAwwob.js");
|
|
3978
4397
|
yield* runMcpPromptViaSdk(args);
|
|
3979
4398
|
}
|
|
3980
4399
|
//#endregion
|
|
@@ -3996,10 +4415,12 @@ function createScreens(store, services) {
|
|
|
3996
4415
|
["wizard-ask"]: /* @__PURE__ */ jsx(WizardAskScreen, { store }),
|
|
3997
4416
|
["intro"]: /* @__PURE__ */ jsx(PostHogIntegrationIntroScreen, { store }),
|
|
3998
4417
|
["revenue-intro"]: /* @__PURE__ */ jsx(RevenueIntroScreen, { store }),
|
|
4418
|
+
["warehouse-intro"]: /* @__PURE__ */ jsx(WarehouseIntroScreen, { store }),
|
|
3999
4419
|
["source-maps-intro"]: /* @__PURE__ */ jsx(SourceMapsIntroScreen, { store }),
|
|
4000
4420
|
["source-maps-outro"]: /* @__PURE__ */ jsx(SourceMapsOutroScreen, { store }),
|
|
4001
4421
|
["migration-intro"]: /* @__PURE__ */ jsx(MigrationIntroScreen, { store }),
|
|
4002
4422
|
["agent-skill-intro"]: /* @__PURE__ */ jsx(AgentSkillIntroScreen, { store }),
|
|
4423
|
+
["self-driving-intro"]: /* @__PURE__ */ jsx(SelfDrivingIntroScreen, { store }),
|
|
4003
4424
|
["audit-intro"]: /* @__PURE__ */ jsx(AuditIntroScreen, { store }),
|
|
4004
4425
|
["audit-run"]: /* @__PURE__ */ jsx(AuditRunScreen, { store }),
|
|
4005
4426
|
["audit-outro"]: /* @__PURE__ */ jsx(AuditOutroScreen, { store }),
|
|
@@ -4044,7 +4465,7 @@ const App = ({ store }) => {
|
|
|
4044
4465
|
};
|
|
4045
4466
|
//#endregion
|
|
4046
4467
|
//#region src/ui/tui/exit-line.ts
|
|
4047
|
-
const RESET_ATTRS
|
|
4468
|
+
const RESET_ATTRS = "\x1B[0m";
|
|
4048
4469
|
const GREEN = "\x1B[32m";
|
|
4049
4470
|
const BOLD = "\x1B[1m";
|
|
4050
4471
|
const DIM = "\x1B[2m";
|
|
@@ -4053,11 +4474,16 @@ function getExitLine(store) {
|
|
|
4053
4474
|
const label = store.session.programLabel ?? "Wizard";
|
|
4054
4475
|
if (outro?.kind === "success") {
|
|
4055
4476
|
const message = outro.message ?? `${label} completed successfully.`;
|
|
4056
|
-
const
|
|
4057
|
-
if (outro.
|
|
4058
|
-
|
|
4477
|
+
const parts = [`${GREEN}${BOLD}✔${RESET_ATTRS} ${message}${outro.reportFile && !message.includes(outro.reportFile) ? ` Check ./${outro.reportFile} for details.` : ""}`];
|
|
4478
|
+
if (outro.primaryLink) parts.push(`${DIM}${outro.primaryLink.label}:${RESET_ATTRS}\n${outro.primaryLink.url}`);
|
|
4479
|
+
if (outro.nextSteps) {
|
|
4480
|
+
const bullets = outro.nextSteps.items.map((item) => `${DIM} • ${item}${RESET_ATTRS}`).join("\n");
|
|
4481
|
+
parts.push(`${DIM}${outro.nextSteps.heading}${RESET_ATTRS}\n${bullets}`);
|
|
4482
|
+
}
|
|
4483
|
+
if (outro.handoffPrompt) parts.push(`${DIM}Hand this to your coding agent to finish up (triple-click to select):${RESET_ATTRS}\n` + outro.handoffPrompt);
|
|
4484
|
+
return parts.join("\n\n");
|
|
4059
4485
|
}
|
|
4060
|
-
return `${DIM}${label} exited.${RESET_ATTRS
|
|
4486
|
+
return `${DIM}${label} exited.${RESET_ATTRS}`;
|
|
4061
4487
|
}
|
|
4062
4488
|
//#endregion
|
|
4063
4489
|
//#region src/ui/tui/start-tui.ts
|
|
@@ -4068,17 +4494,8 @@ function getExitLine(store) {
|
|
|
4068
4494
|
* doesn't pollute scrollback history. On exit, the previous terminal
|
|
4069
4495
|
* content is restored and a single exit summary line is printed.
|
|
4070
4496
|
*/
|
|
4071
|
-
const RESET_ATTRS = "\x1B[0m";
|
|
4072
|
-
const CLEAR_SCREEN = "\x1B[2J";
|
|
4073
|
-
const CURSOR_HOME = "\x1B[H";
|
|
4074
|
-
const BG_BLACK = "\x1B[48;2;0;0;0m";
|
|
4075
|
-
const ENTER_ALT_SCREEN = "\x1B[?1049h";
|
|
4076
|
-
const LEAVE_ALT_SCREEN = "\x1B[?1049l";
|
|
4077
|
-
function releaseTerminal() {
|
|
4078
|
-
process.stdout.write(RESET_ATTRS + LEAVE_ALT_SCREEN);
|
|
4079
|
-
}
|
|
4080
4497
|
function startTUI(version, program = Program.PostHogIntegration) {
|
|
4081
|
-
|
|
4498
|
+
enterDarkTerminal();
|
|
4082
4499
|
const store = new WizardStore(program);
|
|
4083
4500
|
store.version = version;
|
|
4084
4501
|
setUI(new InkUI(store));
|
|
@@ -4111,4 +4528,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
|
|
|
4111
4528
|
//#endregion
|
|
4112
4529
|
export { startTUI };
|
|
4113
4530
|
|
|
4114
|
-
//# sourceMappingURL=start-tui-
|
|
4531
|
+
//# sourceMappingURL=start-tui-Cbw0kVr3.js.map
|