@posthog/wizard 2.70.1 → 2.71.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/dist/{add-mcp-server-to-clients-BCnjUqnW.js → add-mcp-server-to-clients-B6-ZL--P.js} +4 -4
- package/dist/{add-mcp-server-to-clients-BCnjUqnW.js.map → add-mcp-server-to-clients-B6-ZL--P.js.map} +1 -1
- package/dist/{agent-interface-Lu7tnLr0.js → agent-interface-DFm4jB4d.js} +108 -15
- package/dist/agent-interface-DFm4jB4d.js.map +1 -0
- package/dist/{agent-prompt-loader-y5GxgEkc.js → agent-prompt-loader-Bi3IzSBW.js} +5 -5
- package/dist/{agent-prompt-loader-y5GxgEkc.js.map → agent-prompt-loader-Bi3IzSBW.js.map} +1 -1
- package/dist/{agent-runner-vKtpgqVI.js → agent-runner-Cp6iLqDk.js} +49 -16
- package/dist/agent-runner-Cp6iLqDk.js.map +1 -0
- package/dist/{analytics-DTyJClPr.js → analytics-D54mLptm.js} +3 -3
- package/dist/{analytics-DTyJClPr.js.map → analytics-D54mLptm.js.map} +1 -1
- package/dist/analytics-Ge1LsCNg.js +2 -0
- package/dist/{api-j-OfJ8Dz.js → api-BNBVOguz.js} +23 -4
- package/dist/{api-j-OfJ8Dz.js.map → api-BNBVOguz.js.map} +1 -1
- package/dist/bin.js +79 -73
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-BWX25ixc.js → bounded-fs-DHIaH3Sc.js} +3 -3
- package/dist/{bounded-fs-BWX25ixc.js.map → bounded-fs-DHIaH3Sc.js.map} +1 -1
- package/dist/{ci-install-zNWgp1TL.js → ci-install-Can8LRdJ.js} +5 -5
- package/dist/{ci-install-zNWgp1TL.js.map → ci-install-Can8LRdJ.js.map} +1 -1
- package/dist/{debug-xr2Pq5VA.js → debug-C4RPcEIX.js} +1 -1
- package/dist/{debug-BM0fZaGl.js → debug-YQdeZulR.js} +4 -3
- package/dist/debug-YQdeZulR.js.map +1 -0
- package/dist/{env-api-key-DlxCZWU0.js → env-api-key-9yogO8OI.js} +2 -2
- package/dist/{env-api-key-DlxCZWU0.js.map → env-api-key-9yogO8OI.js.map} +1 -1
- package/dist/{environment-o-bTOuzK.js → environment-6ZuAWRpQ.js} +4 -4
- package/dist/{environment-o-bTOuzK.js.map → environment-6ZuAWRpQ.js.map} +1 -1
- package/dist/{errors-BSdz2lsl.js → errors-u8z27V-x.js} +4 -2
- package/dist/errors-u8z27V-x.js.map +1 -0
- package/dist/{file-watcher-D7G4f5sP.js → file-watcher-CeWdvMVT.js} +2 -2
- package/dist/{file-watcher-D7G4f5sP.js.map → file-watcher-CeWdvMVT.js.map} +1 -1
- package/dist/{headless-ui-C46DctKG.js → headless-ui-BxSVgNoT.js} +2 -2
- package/dist/{headless-ui-C46DctKG.js.map → headless-ui-BxSVgNoT.js.map} +1 -1
- package/dist/{interactive-B5zy3Gxk.js → interactive-CRR9zPl4.js} +2 -2
- package/dist/{interactive-B5zy3Gxk.js.map → interactive-CRR9zPl4.js.map} +1 -1
- package/dist/{mcp-lJRwE-YW.js → mcp-D_rRzruj.js} +2 -2
- package/dist/{mcp-lJRwE-YW.js.map → mcp-D_rRzruj.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-Dsos09hT.js → mcp-prompt-streaming-DRAK8CMP.js} +5 -4
- package/dist/mcp-prompt-streaming-DRAK8CMP.js.map +1 -0
- package/dist/{non-interactive-qcCCtiYQ.js → non-interactive-1EJRlN6u.js} +3 -3
- package/dist/{non-interactive-qcCCtiYQ.js.map → non-interactive-1EJRlN6u.js.map} +1 -1
- package/dist/{orchestrator-tools-ezFTbAIp.js → orchestrator-tools-DjZWqWmd.js} +3 -3
- package/dist/{orchestrator-tools-ezFTbAIp.js.map → orchestrator-tools-DjZWqWmd.js.map} +1 -1
- package/dist/{package-manager-CGfN9UhH.js → package-manager-DMbzbdkL.js} +2 -2
- package/dist/{package-manager-CGfN9UhH.js.map → package-manager-DMbzbdkL.js.map} +1 -1
- package/dist/{pi-DzQLHIcQ.js → pi-D4JQMC-7.js} +18 -15
- package/dist/pi-D4JQMC-7.js.map +1 -0
- package/dist/{playground-DLN31BPV.js → playground-Y1nSGXpn.js} +43 -8
- package/dist/playground-Y1nSGXpn.js.map +1 -0
- package/dist/{posthog-Dxr8XK4x.js → posthog-D9VwcWvJ.js} +2 -2
- package/dist/{posthog-Dxr8XK4x.js.map → posthog-D9VwcWvJ.js.map} +1 -1
- package/dist/{posthog-integration-MDfRO911.js → posthog-integration-B8f4xRBd.js} +18 -18
- package/dist/posthog-integration-B8f4xRBd.js.map +1 -0
- package/dist/{provisioning-Di5GNV9k.js → provisioning-f7lA29tW.js} +14 -5
- package/dist/provisioning-f7lA29tW.js.map +1 -0
- package/dist/{queue-tools-KosDptd6.js → queue-tools-DGaHf3n-.js} +3 -3
- package/dist/{queue-tools-KosDptd6.js.map → queue-tools-DGaHf3n-.js.map} +1 -1
- package/dist/{registry-BBdaIFWq.js → registry-D1By1SgH.js} +5 -5
- package/dist/{registry-BBdaIFWq.js.map → registry-D1By1SgH.js.map} +1 -1
- package/dist/{security-BwOvjMaq.js → security-C2c3_Ycy.js} +5 -5
- package/dist/{security-BwOvjMaq.js.map → security-C2c3_Ycy.js.map} +1 -1
- package/dist/{setup-utils-Bo3WZt3a.js → setup-utils-BRrCeajl.js} +42 -11
- package/dist/setup-utils-BRrCeajl.js.map +1 -0
- package/dist/{start-tui-B1LrB7k1.js → start-tui-r4Spgptv.js} +257 -23
- package/dist/start-tui-r4Spgptv.js.map +1 -0
- package/dist/{steps-BMrQJpQh.js → steps-BZd65XfI.js} +7 -7
- package/dist/{steps-BMrQJpQh.js.map → steps-BZd65XfI.js.map} +1 -1
- package/dist/{store-DhNTBWQR.js → store-DGVXu7xt.js} +25 -6
- package/dist/store-DGVXu7xt.js.map +1 -0
- package/dist/{subagent-q6M-mBHo.js → subagent-BaMxO7OT.js} +2 -2
- package/dist/{subagent-q6M-mBHo.js.map → subagent-BaMxO7OT.js.map} +1 -1
- package/dist/{task-CgAOxod7.js → task-DpKoEZ5I.js} +13 -13
- package/dist/{task-CgAOxod7.js.map → task-DpKoEZ5I.js.map} +1 -1
- package/dist/{task-stream-rxR1IsdJ.js → task-stream-CdrBraqP.js} +6 -6
- package/dist/{task-stream-rxR1IsdJ.js.map → task-stream-CdrBraqP.js.map} +1 -1
- package/dist/{tasks-lzvWF__k.js → tasks-KsP66Cis.js} +2 -2
- package/dist/{tasks-lzvWF__k.js.map → tasks-KsP66Cis.js.map} +1 -1
- package/dist/{telemetry-CickTk_7.js → telemetry-DedDTtSa.js} +3 -3
- package/dist/{telemetry-CickTk_7.js.map → telemetry-DedDTtSa.js.map} +1 -1
- package/dist/{terminal-BjUFxn_x.js → terminal-BH8yLclG.js} +107 -61
- package/dist/terminal-BH8yLclG.js.map +1 -0
- package/dist/{tools-MKXGXFSk.js → tools-CJw5vnZd.js} +6 -6
- package/dist/{tools-MKXGXFSk.js.map → tools-CJw5vnZd.js.map} +1 -1
- package/dist/{wizard-abort-CooWEh9N.js → wizard-abort-D54j2gmb.js} +5 -5
- package/dist/{wizard-abort-CooWEh9N.js.map → wizard-abort-D54j2gmb.js.map} +1 -1
- package/dist/{wizard-abort-CW_C2EXr.js → wizard-abort-Q1NiYELE.js} +1 -1
- package/dist/{wizard-session-Bki7dQhv.js → wizard-session-CwQPZN4y.js} +3 -1
- package/dist/wizard-session-CwQPZN4y.js.map +1 -0
- package/dist/{wizard-session-gbYCXdBf.js → wizard-session-Dwc1Rh_7.js} +1 -1
- package/dist/yara-hooks-BI6WY0Sl.js +2 -0
- package/dist/{yara-hooks-BpngckdZ.js → yara-hooks-CL2LVEgO.js} +4 -4
- package/dist/{yara-hooks-BpngckdZ.js.map → yara-hooks-CL2LVEgO.js.map} +1 -1
- package/package.json +1 -1
- package/dist/agent-interface-Lu7tnLr0.js.map +0 -1
- package/dist/agent-runner-vKtpgqVI.js.map +0 -1
- package/dist/analytics-D-bMEYjD.js +0 -2
- package/dist/debug-BM0fZaGl.js.map +0 -1
- package/dist/errors-BSdz2lsl.js.map +0 -1
- package/dist/mcp-prompt-streaming-Dsos09hT.js.map +0 -1
- package/dist/pi-DzQLHIcQ.js.map +0 -1
- package/dist/playground-DLN31BPV.js.map +0 -1
- package/dist/posthog-integration-MDfRO911.js.map +0 -1
- package/dist/provisioning-Di5GNV9k.js.map +0 -1
- package/dist/setup-utils-Bo3WZt3a.js.map +0 -1
- package/dist/start-tui-B1LrB7k1.js.map +0 -1
- package/dist/store-DhNTBWQR.js.map +0 -1
- package/dist/terminal-BjUFxn_x.js.map +0 -1
- package/dist/wizard-session-Bki7dQhv.js.map +0 -1
- package/dist/yara-hooks-C-qG6EJt.js +0 -2
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { l as ErrorCodes } from "./errors-
|
|
2
|
-
import { $ as REMOTE_SKILLS_BASE_URL, K as POSTHOG_ORG_AI_SETTINGS_URL, L as Integration, R as OAUTH_PORTS, U as POSTHOG_DOCS_URL, Z as POSTHOG_TERMS_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, p as setUI, q as POSTHOG_PRIVACY_URL, s as logToFile, v as getBlockingServiceKeys, z as OAUTH_TIMEOUT_MS } from "./debug-
|
|
3
|
-
import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-
|
|
4
|
-
import { n as analytics } from "./analytics-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { A as
|
|
1
|
+
import { l as ErrorCodes } from "./errors-u8z27V-x.js";
|
|
2
|
+
import { $ as REMOTE_SKILLS_BASE_URL, K as POSTHOG_ORG_AI_SETTINGS_URL, L as Integration, R as OAUTH_PORTS, U as POSTHOG_DOCS_URL, Z as POSTHOG_TERMS_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, p as setUI, q as POSTHOG_PRIVACY_URL, s as logToFile, v as getBlockingServiceKeys, z as OAUTH_TIMEOUT_MS } from "./debug-YQdeZulR.js";
|
|
3
|
+
import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-CwQPZN4y.js";
|
|
4
|
+
import { n as analytics } from "./analytics-D54mLptm.js";
|
|
5
|
+
import { n as openTrackedLink } from "./telemetry-DedDTtSa.js";
|
|
6
|
+
import { i as readProjectFile, t as IGNORED_DIRS } from "./bounded-fs-DHIaH3Sc.js";
|
|
7
|
+
import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-BRrCeajl.js";
|
|
8
|
+
import { c as getIntegrationAuthorizeUrl } from "./provisioning-f7lA29tW.js";
|
|
9
|
+
import { r as fetchGithubConnected, t as ApiError } from "./api-BNBVOguz.js";
|
|
10
|
+
import { i as wizardAbort } from "./wizard-abort-D54j2gmb.js";
|
|
11
|
+
import { A as fetchSkillMenu, k as downloadSkill } from "./agent-interface-DFm4jB4d.js";
|
|
12
|
+
import { a as formatCostUsd, o as formatTokenCount } from "./agent-runner-Cp6iLqDk.js";
|
|
13
|
+
import { _ as AUDIT_CHECKS_KEY, b as coerceAuditChecks, g as AUDIT_CHECKS_FILE, x as getAuditChecks, y as AUDIT_SEVERITY_STYLE } from "./yara-hooks-CL2LVEgO.js";
|
|
14
|
+
import { t as FRAMEWORK_REGISTRY } from "./registry-D1By1SgH.js";
|
|
15
|
+
import { T as detectProjectsWithAgent, h as Icons, m as Colors, t as SETUP_REPORT_FILE, x as getDetectedWarehouseSources } from "./posthog-integration-B8f4xRBd.js";
|
|
16
|
+
import { A as getContentBlocks, D as SOURCE_MAPS_CONTEXT_KEYS, M as STRIPE_SDKS, S as DISPLAY_NAME, T as MANUAL_SDK_VARIANTS, _ as detectSelfDrivingIntegrationProjects, a as useStdoutDimensions, b as SELF_DRIVING_INTEGRATE_PATH_KEY, f as Program, g as PRICING_SHORT, h as PRICING_LONG, j as POSTHOG_SDKS, k as fetchHealthIssues, m as NO_DEFAULT_LIMIT, n as useKeyBindings, p as getProgramConfig, t as PickerMenu, v as GITHUB_REQUIRED_BODY, w as MANUAL_SDK_INSTALL, x as AUTOMATABLE_VARIANTS, y as GITHUB_REQUIRED_MESSAGE } from "./bin.js";
|
|
17
|
+
import { r as totalTokenCount, t as WizardStore } from "./store-DGVXu7xt.js";
|
|
18
|
+
import { B as SplitView, C as VisualizerTab, D as HNViewer, F as ModalOverlay, I as ConfirmationInput, M as LogViewer, N as LinkText, O as TabContainer, P as extractUrls, R as ProgressList, S as ServiceHealthList, T as LearnCard, a as useSkillEntry, b as SEVERITY_LABEL, c as SlackConnectScreen, d as AuditChecksViewer, f as seedDemoEvents, g as probeProjectData, i as SkillSourceInfo, j as EventPlanViewer, k as ScreenContainer, l as AUDIT_AREA_SLIDES, m as McpSuggestedPromptsScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as McpScreen, w as TipsCard, x as SEVERITY_ORDER, y as IssueTable, z as LoadingBox } from "./terminal-BH8yLclG.js";
|
|
17
19
|
import { c as namesWithStatus, d as toClientResult, l as redactSecrets, t as ALL_FEATURE_VALUES } from "./defaults-DI642M3n.js";
|
|
18
|
-
import { t as startFileWatcher } from "./file-watcher-
|
|
19
|
-
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-
|
|
20
|
+
import { t as startFileWatcher } from "./file-watcher-CeWdvMVT.js";
|
|
21
|
+
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-B6-ZL--P.js";
|
|
20
22
|
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
21
23
|
import path, { join } from "path";
|
|
22
24
|
import { join as join$1 } from "node:path";
|
|
@@ -67,6 +69,9 @@ var InkUI = class {
|
|
|
67
69
|
setCredentials(credentials) {
|
|
68
70
|
this.store.setCredentials(credentials);
|
|
69
71
|
}
|
|
72
|
+
setAccessToken(credentials) {
|
|
73
|
+
this.store.setAccessToken(credentials);
|
|
74
|
+
}
|
|
70
75
|
setRoleAtOrganization(role) {
|
|
71
76
|
this.store.setRoleAtOrganization(role);
|
|
72
77
|
}
|
|
@@ -1288,7 +1293,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
|
|
|
1288
1293
|
})),
|
|
1289
1294
|
onSelect: (value) => {
|
|
1290
1295
|
const integration = Array.isArray(value) ? value[0] : value;
|
|
1291
|
-
import("./registry-
|
|
1296
|
+
import("./registry-D1By1SgH.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
|
|
1292
1297
|
const config = FRAMEWORK_REGISTRY[integration];
|
|
1293
1298
|
store.setFrameworkConfig(integration, config);
|
|
1294
1299
|
store.setDetectedFramework(config.metadata.name);
|
|
@@ -3695,6 +3700,201 @@ const SelfDrivingHandoffScreen = ({ store }) => {
|
|
|
3695
3700
|
});
|
|
3696
3701
|
};
|
|
3697
3702
|
//#endregion
|
|
3703
|
+
//#region src/ui/tui/hooks/useGithubConnection.ts
|
|
3704
|
+
/**
|
|
3705
|
+
* Polls `/integrations/` until the PostHog GitHub App shows up, writing the
|
|
3706
|
+
* result to the session so the Self-driving GitHub gate can advance.
|
|
3707
|
+
*
|
|
3708
|
+
* Installing the App is a manual browser step, so polling is what flips the
|
|
3709
|
+
* gate once the user comes back. The first tick also resolves the session's
|
|
3710
|
+
* unknown (`null`) state.
|
|
3711
|
+
*/
|
|
3712
|
+
const POLL_INTERVAL_MS = 3e3;
|
|
3713
|
+
function useGithubConnection(store) {
|
|
3714
|
+
const credentials = store.session.credentials;
|
|
3715
|
+
const connected = store.session.githubConnected === true;
|
|
3716
|
+
useEffect(() => {
|
|
3717
|
+
if (!credentials || connected) return;
|
|
3718
|
+
const controller = new AbortController();
|
|
3719
|
+
let stopped = false;
|
|
3720
|
+
let timer;
|
|
3721
|
+
let errorReported = false;
|
|
3722
|
+
/** A check that came back "not connected" — including a failed one. */
|
|
3723
|
+
const settleUnknown = () => {
|
|
3724
|
+
if (store.session.githubConnected === null) store.setGithubConnected(false);
|
|
3725
|
+
};
|
|
3726
|
+
const wait = () => new Promise((resolve) => {
|
|
3727
|
+
timer = setTimeout(resolve, POLL_INTERVAL_MS);
|
|
3728
|
+
});
|
|
3729
|
+
(async () => {
|
|
3730
|
+
while (!stopped) {
|
|
3731
|
+
try {
|
|
3732
|
+
const isConnected = await fetchGithubConnected(credentials.accessToken, credentials.projectId, credentials.host.apiHost, controller.signal);
|
|
3733
|
+
if (stopped) return;
|
|
3734
|
+
if (isConnected) {
|
|
3735
|
+
if (store.session.githubConnected === false) analytics.wizardCapture("github connect completed");
|
|
3736
|
+
store.setGithubConnected(true);
|
|
3737
|
+
return;
|
|
3738
|
+
}
|
|
3739
|
+
settleUnknown();
|
|
3740
|
+
} catch (err) {
|
|
3741
|
+
if (stopped) return;
|
|
3742
|
+
if (!errorReported) {
|
|
3743
|
+
errorReported = true;
|
|
3744
|
+
analytics.captureException(err instanceof Error ? err : new Error(String(err)), { step: "github_connected_check" });
|
|
3745
|
+
}
|
|
3746
|
+
settleUnknown();
|
|
3747
|
+
}
|
|
3748
|
+
await wait();
|
|
3749
|
+
}
|
|
3750
|
+
})();
|
|
3751
|
+
return () => {
|
|
3752
|
+
stopped = true;
|
|
3753
|
+
if (timer) clearTimeout(timer);
|
|
3754
|
+
controller.abort();
|
|
3755
|
+
};
|
|
3756
|
+
}, [
|
|
3757
|
+
credentials,
|
|
3758
|
+
connected,
|
|
3759
|
+
store
|
|
3760
|
+
]);
|
|
3761
|
+
}
|
|
3762
|
+
//#endregion
|
|
3763
|
+
//#region src/ui/tui/screens/SelfDrivingGitHubScreen.tsx
|
|
3764
|
+
/**
|
|
3765
|
+
* SelfDrivingGitHubScreen — the "Connect GitHub" gate, shown after the handoff
|
|
3766
|
+
* and before the Self-driving run.
|
|
3767
|
+
*
|
|
3768
|
+
* Self-driving cannot research findings or open fixes without code access, so
|
|
3769
|
+
* the GitHub App is a hard requirement. The agent used to ask for it mid-run
|
|
3770
|
+
* via `wizard_ask` and abort when the answer came back declined — but a
|
|
3771
|
+
* `wizard_ask` timeout resolves to the same cancelled value as a real decline,
|
|
3772
|
+
* so a user who stepped away had their run killed as if they had refused.
|
|
3773
|
+
* Gating here instead makes the requirement cheap (no agent has started),
|
|
3774
|
+
* unambiguous (declining is an explicit pick), and un-timeoutable (the screen
|
|
3775
|
+
* waits as long as the browser install takes).
|
|
3776
|
+
*
|
|
3777
|
+
* Unlike SlackConnectScreen this is not skippable: declining ends the run on
|
|
3778
|
+
* the outro rather than continuing without it. The connection poll lives in
|
|
3779
|
+
* {@link useGithubConnection}.
|
|
3780
|
+
*/
|
|
3781
|
+
const SelfDrivingGitHubScreen = ({ store }) => {
|
|
3782
|
+
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
3783
|
+
const credentials = store.session.credentials;
|
|
3784
|
+
const connectedState = store.session.githubConnected;
|
|
3785
|
+
const connected = connectedState === true;
|
|
3786
|
+
const authorizeUrl = credentials ? getIntegrationAuthorizeUrl(credentials.host.appHost, credentials.projectId, "github") : null;
|
|
3787
|
+
useGithubConnection(store);
|
|
3788
|
+
const [installOpened, setInstallOpened] = useState(false);
|
|
3789
|
+
const impressionFired = useRef(false);
|
|
3790
|
+
useEffect(() => {
|
|
3791
|
+
if (connectedState === null || impressionFired.current) return;
|
|
3792
|
+
impressionFired.current = true;
|
|
3793
|
+
analytics.wizardCapture("github connect shown", { already_connected: connected });
|
|
3794
|
+
}, [connectedState, connected]);
|
|
3795
|
+
const openInstall = () => {
|
|
3796
|
+
if (!authorizeUrl) return;
|
|
3797
|
+
analytics.wizardCapture("github connect opened");
|
|
3798
|
+
openTrackedLink(authorizeUrl, "self-driving-github-connect");
|
|
3799
|
+
setInstallOpened(true);
|
|
3800
|
+
};
|
|
3801
|
+
const decline = () => {
|
|
3802
|
+
analytics.wizardCapture("github connect declined", { install_opened: installOpened });
|
|
3803
|
+
store.declineGithub({
|
|
3804
|
+
kind: "cancel",
|
|
3805
|
+
message: GITHUB_REQUIRED_MESSAGE,
|
|
3806
|
+
body: GITHUB_REQUIRED_BODY
|
|
3807
|
+
});
|
|
3808
|
+
};
|
|
3809
|
+
const handleSelect = (value) => {
|
|
3810
|
+
if ((Array.isArray(value) ? value[0] : value) === "open") openInstall();
|
|
3811
|
+
else decline();
|
|
3812
|
+
};
|
|
3813
|
+
useKeyBindings("self-driving-github", [{
|
|
3814
|
+
match: "escape",
|
|
3815
|
+
label: "esc",
|
|
3816
|
+
action: connected ? "continue" : "end setup",
|
|
3817
|
+
handler: () => {
|
|
3818
|
+
if (!connected) decline();
|
|
3819
|
+
}
|
|
3820
|
+
}]);
|
|
3821
|
+
if (credentials && connectedState === null) return /* @__PURE__ */ jsx(Box, {
|
|
3822
|
+
flexDirection: "column",
|
|
3823
|
+
flexGrow: 1,
|
|
3824
|
+
marginTop: 1,
|
|
3825
|
+
children: /* @__PURE__ */ jsx(LoadingBox, { message: "Checking for an existing GitHub connection..." })
|
|
3826
|
+
});
|
|
3827
|
+
if (connected) return /* @__PURE__ */ jsxs(Box, {
|
|
3828
|
+
flexDirection: "column",
|
|
3829
|
+
flexGrow: 1,
|
|
3830
|
+
marginTop: 1,
|
|
3831
|
+
children: [
|
|
3832
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
3833
|
+
bold: true,
|
|
3834
|
+
color: Colors.success,
|
|
3835
|
+
children: [Icons.check, " GitHub connected"]
|
|
3836
|
+
}),
|
|
3837
|
+
/* @__PURE__ */ jsx(Box, {
|
|
3838
|
+
marginTop: 1,
|
|
3839
|
+
children: /* @__PURE__ */ jsx(Text, { children: "Self-driving can research findings in your code and open fixes." })
|
|
3840
|
+
}),
|
|
3841
|
+
/* @__PURE__ */ jsx(Box, {
|
|
3842
|
+
marginTop: 1,
|
|
3843
|
+
children: /* @__PURE__ */ jsx(LoadingBox, { message: "Starting Self-driving setup..." })
|
|
3844
|
+
})
|
|
3845
|
+
]
|
|
3846
|
+
});
|
|
3847
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
3848
|
+
flexDirection: "column",
|
|
3849
|
+
flexGrow: 1,
|
|
3850
|
+
children: /* @__PURE__ */ jsxs(Box, {
|
|
3851
|
+
marginTop: 1,
|
|
3852
|
+
flexDirection: "column",
|
|
3853
|
+
children: [
|
|
3854
|
+
/* @__PURE__ */ jsx(Text, {
|
|
3855
|
+
bold: true,
|
|
3856
|
+
color: Colors.accent,
|
|
3857
|
+
children: installOpened ? "Finish connecting GitHub" : "Connect GitHub"
|
|
3858
|
+
}),
|
|
3859
|
+
/* @__PURE__ */ jsx(Box, {
|
|
3860
|
+
marginTop: 1,
|
|
3861
|
+
children: /* @__PURE__ */ jsx(Text, { children: installOpened ? "We've opened the PostHog GitHub App install in your browser. Approve access there — we'll detect it automatically and continue." : "Self-driving needs GitHub access to research findings in your code and open fixes, so setup cannot finish without it." })
|
|
3862
|
+
}),
|
|
3863
|
+
!installOpened && /* @__PURE__ */ jsx(Box, {
|
|
3864
|
+
marginTop: 1,
|
|
3865
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
3866
|
+
color: "cyan",
|
|
3867
|
+
children: [Icons.diamond, " "]
|
|
3868
|
+
}), "Grant it the repos you want Self-driving to work with — include this project's repo so it can also watch its issues."] })
|
|
3869
|
+
}),
|
|
3870
|
+
authorizeUrl && /* @__PURE__ */ jsx(Box, {
|
|
3871
|
+
marginTop: 1,
|
|
3872
|
+
children: /* @__PURE__ */ jsxs(Text, {
|
|
3873
|
+
dimColor: true,
|
|
3874
|
+
children: [installOpened ? "Install page: " : "Install it: ", /* @__PURE__ */ jsx(Text, {
|
|
3875
|
+
color: "cyan",
|
|
3876
|
+
children: authorizeUrl
|
|
3877
|
+
})]
|
|
3878
|
+
})
|
|
3879
|
+
}),
|
|
3880
|
+
/* @__PURE__ */ jsx(Box, {
|
|
3881
|
+
marginTop: 1,
|
|
3882
|
+
children: /* @__PURE__ */ jsx(PickerMenu, {
|
|
3883
|
+
options: [{
|
|
3884
|
+
label: installOpened ? "Re-open GitHub App install" : "Open GitHub App install",
|
|
3885
|
+
value: "open"
|
|
3886
|
+
}, {
|
|
3887
|
+
label: "I can't connect right now",
|
|
3888
|
+
value: "decline"
|
|
3889
|
+
}],
|
|
3890
|
+
onSelect: handleSelect
|
|
3891
|
+
})
|
|
3892
|
+
})
|
|
3893
|
+
]
|
|
3894
|
+
})
|
|
3895
|
+
});
|
|
3896
|
+
};
|
|
3897
|
+
//#endregion
|
|
3698
3898
|
//#region src/ui/tui/screens/audit/AuditIntroScreen.tsx
|
|
3699
3899
|
const AuditIntroScreen = ({ store }) => {
|
|
3700
3900
|
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
@@ -5227,7 +5427,10 @@ const ExitScreen = () => {
|
|
|
5227
5427
|
/**
|
|
5228
5428
|
* AuthErrorScreen — Shown when the PostHog LLM Gateway returns a 401.
|
|
5229
5429
|
*
|
|
5230
|
-
*
|
|
5430
|
+
* Distinct causes, most specific first:
|
|
5431
|
+
* 0. The OAuth grant is gone — a pre-run refresh already got `invalid_grant`
|
|
5432
|
+
* from the token endpoint. The only branch backed by a server verdict
|
|
5433
|
+
* rather than inference, so it wins; re-running is the whole fix.
|
|
5231
5434
|
* 1. Claude Code settings.json / managed-settings overrides ANTHROPIC_*
|
|
5232
5435
|
* env vars — auth conflict. Tell the user to log out of Claude Code.
|
|
5233
5436
|
* 2. The PostHog API key itself was rejected — bad prefix, missing scope,
|
|
@@ -5241,6 +5444,7 @@ const AuthErrorScreen = ({ store }) => {
|
|
|
5241
5444
|
const conflicts = detail?.conflicts ?? [];
|
|
5242
5445
|
const usingManagedLogin = detail?.usingManagedLogin ?? false;
|
|
5243
5446
|
const credentialPlaces = detail?.credentialPlaces ?? [];
|
|
5447
|
+
const sessionExpired = detail?.sessionExpired ?? false;
|
|
5244
5448
|
const logFilePath = detail?.logFilePath;
|
|
5245
5449
|
return /* @__PURE__ */ jsxs(Box, {
|
|
5246
5450
|
flexDirection: "column",
|
|
@@ -5251,7 +5455,36 @@ const AuthErrorScreen = ({ store }) => {
|
|
|
5251
5455
|
bold: true,
|
|
5252
5456
|
children: ["✘", " Authentication error"]
|
|
5253
5457
|
}),
|
|
5254
|
-
|
|
5458
|
+
sessionExpired ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5459
|
+
/* @__PURE__ */ jsx(Box, {
|
|
5460
|
+
flexDirection: "column",
|
|
5461
|
+
marginTop: 1,
|
|
5462
|
+
children: /* @__PURE__ */ jsx(Text, { children: "Your PostHog login expired while the wizard was running, so the LLM Gateway rejected it (401). Nothing on this machine is misconfigured — the session simply ran out." })
|
|
5463
|
+
}),
|
|
5464
|
+
/* @__PURE__ */ jsx(Box, {
|
|
5465
|
+
marginTop: 1,
|
|
5466
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
5467
|
+
dimColor: true,
|
|
5468
|
+
children: "Re-run the wizard and log in again:"
|
|
5469
|
+
})
|
|
5470
|
+
}),
|
|
5471
|
+
/* @__PURE__ */ jsx(Box, {
|
|
5472
|
+
flexDirection: "column",
|
|
5473
|
+
marginTop: 1,
|
|
5474
|
+
paddingLeft: 2,
|
|
5475
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
5476
|
+
color: "cyan",
|
|
5477
|
+
children: "npx @posthog/wizard"
|
|
5478
|
+
})
|
|
5479
|
+
}),
|
|
5480
|
+
/* @__PURE__ */ jsx(Box, {
|
|
5481
|
+
marginTop: 1,
|
|
5482
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
5483
|
+
dimColor: true,
|
|
5484
|
+
children: "Any files the agent already wrote are still in your project."
|
|
5485
|
+
})
|
|
5486
|
+
})
|
|
5487
|
+
] }) : usingManagedLogin ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5255
5488
|
/* @__PURE__ */ jsx(Box, {
|
|
5256
5489
|
flexDirection: "column",
|
|
5257
5490
|
marginTop: 1,
|
|
@@ -5794,7 +6027,7 @@ function createMcpSuggestedPromptsServices(store) {
|
|
|
5794
6027
|
};
|
|
5795
6028
|
}
|
|
5796
6029
|
async function* runProductionPromptStreaming(args) {
|
|
5797
|
-
const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-
|
|
6030
|
+
const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DRAK8CMP.js");
|
|
5798
6031
|
yield* runMcpPromptViaSdk(args);
|
|
5799
6032
|
}
|
|
5800
6033
|
//#endregion
|
|
@@ -5829,6 +6062,7 @@ function createScreens(store, services) {
|
|
|
5829
6062
|
["self-driving-integration-check"]: /* @__PURE__ */ jsx(SelfDrivingIntegrationCheckScreen, { store }),
|
|
5830
6063
|
["self-driving-integration-detect"]: /* @__PURE__ */ jsx(SelfDrivingIntegrationDetectScreen, { store }),
|
|
5831
6064
|
["self-driving-handoff"]: /* @__PURE__ */ jsx(SelfDrivingHandoffScreen, { store }),
|
|
6065
|
+
["self-driving-github"]: /* @__PURE__ */ jsx(SelfDrivingGitHubScreen, { store }),
|
|
5832
6066
|
["audit-intro"]: /* @__PURE__ */ jsx(AuditIntroScreen, { store }),
|
|
5833
6067
|
["audit-run"]: /* @__PURE__ */ jsx(AuditRunScreen, { store }),
|
|
5834
6068
|
["audit-outro"]: /* @__PURE__ */ jsx(AuditOutroScreen, { store }),
|
|
@@ -5987,4 +6221,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
|
|
|
5987
6221
|
//#endregion
|
|
5988
6222
|
export { startTUI };
|
|
5989
6223
|
|
|
5990
|
-
//# sourceMappingURL=start-tui-
|
|
6224
|
+
//# sourceMappingURL=start-tui-r4Spgptv.js.map
|