@posthog/wizard 2.52.1 → 2.54.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-C7P4_dhF.js → add-mcp-server-to-clients-B3TcwTT5.js} +5 -5
- package/dist/{add-mcp-server-to-clients-C7P4_dhF.js.map → add-mcp-server-to-clients-B3TcwTT5.js.map} +1 -1
- package/dist/{agent-interface-oqI_K3-4.js → agent-interface-CLvG6Rk9.js} +338 -28
- package/dist/agent-interface-CLvG6Rk9.js.map +1 -0
- package/dist/{agent-prompt-loader-DwFFfuZ4.js → agent-prompt-loader-Baqm1JMD.js} +5 -5
- package/dist/{agent-prompt-loader-DwFFfuZ4.js.map → agent-prompt-loader-Baqm1JMD.js.map} +1 -1
- package/dist/{agent-runner-CunYPDzL.js → agent-runner-D6zGTJqn.js} +179 -145
- package/dist/agent-runner-D6zGTJqn.js.map +1 -0
- package/dist/analytics-BBJE4hIu.js +2 -0
- package/dist/{analytics-DsXLkDwE.js → analytics-D7hsukY7.js} +5 -2
- package/dist/analytics-D7hsukY7.js.map +1 -0
- package/dist/{api-Dpnv0jVL.js → api-BSq9hLu5.js} +3 -3
- package/dist/{api-Dpnv0jVL.js.map → api-BSq9hLu5.js.map} +1 -1
- package/dist/bin.js +329 -190
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-bvlHO1PM.js → bounded-fs-Cq960M-V.js} +3 -3
- package/dist/{bounded-fs-bvlHO1PM.js.map → bounded-fs-Cq960M-V.js.map} +1 -1
- package/dist/{ci-install-BLSCzEZs.js → ci-install-w-mywB9x.js} +5 -5
- package/dist/{ci-install-BLSCzEZs.js.map → ci-install-w-mywB9x.js.map} +1 -1
- package/dist/{debug-D-lnRFLU.js → debug-CX6ZqL9r.js} +1 -1
- package/dist/{debug-BH67OSPW.js → debug-CbgLkSCY.js} +19 -10
- package/dist/debug-CbgLkSCY.js.map +1 -0
- package/dist/{defaults-DAE9_QMn.js → defaults-BWLIffh5.js} +1 -1
- package/dist/{defaults-DAE9_QMn.js.map → defaults-BWLIffh5.js.map} +1 -1
- package/dist/{env-api-key-DDVkPQmo.js → env-api-key-cjD4yfGT.js} +1 -1
- package/dist/{env-api-key-DDVkPQmo.js.map → env-api-key-cjD4yfGT.js.map} +1 -1
- package/dist/{environment-CPPBK-08.js → environment-BWuaOExh.js} +4 -4
- package/dist/{environment-CPPBK-08.js.map → environment-BWuaOExh.js.map} +1 -1
- package/dist/{file-watcher-Dgbe0xK9.js → file-watcher-D9tgVBkp.js} +2 -2
- package/dist/{file-watcher-Dgbe0xK9.js.map → file-watcher-D9tgVBkp.js.map} +1 -1
- package/dist/{headless-ui-BJbByiLj.js → headless-ui-rH97E35y.js} +2 -2
- package/dist/{headless-ui-BJbByiLj.js.map → headless-ui-rH97E35y.js.map} +1 -1
- package/dist/{interactive-ClJi6jV4.js → interactive-D-MVMdBl.js} +3 -3
- package/dist/{interactive-ClJi6jV4.js.map → interactive-D-MVMdBl.js.map} +1 -1
- package/dist/{mcp-C5pjmTsm.js → mcp-jKHwa45f.js} +2 -2
- package/dist/{mcp-C5pjmTsm.js.map → mcp-jKHwa45f.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-BFDtuwJN.js → mcp-prompt-streaming-DxDftNHb.js} +5 -4
- package/dist/{mcp-prompt-streaming-BFDtuwJN.js.map → mcp-prompt-streaming-DxDftNHb.js.map} +1 -1
- package/dist/{non-interactive-C3DW7sGO.js → non-interactive-eXT2_WCR.js} +2 -2
- package/dist/{non-interactive-C3DW7sGO.js.map → non-interactive-eXT2_WCR.js.map} +1 -1
- package/dist/{orchestrator-tools-S88ycFO0.js → orchestrator-tools-CsXrPhsd.js} +3 -3
- package/dist/{orchestrator-tools-S88ycFO0.js.map → orchestrator-tools-CsXrPhsd.js.map} +1 -1
- package/dist/{package-manager-De6lmm9s.js → package-manager-CASp14jY.js} +2 -2
- package/dist/{package-manager-De6lmm9s.js.map → package-manager-CASp14jY.js.map} +1 -1
- package/dist/pi-CfdqOKDI.js +611 -0
- package/dist/pi-CfdqOKDI.js.map +1 -0
- package/dist/{playground-B4yTvjn4.js → playground-DuBvnGkP.js} +354 -19
- package/dist/playground-DuBvnGkP.js.map +1 -0
- package/dist/{posthog-mgz-FQlS.js → posthog-DDLIrku0.js} +1 -1
- package/dist/{posthog-mgz-FQlS.js.map → posthog-DDLIrku0.js.map} +1 -1
- package/dist/{posthog-integration-BA2aFHGz.js → posthog-integration-Dy5cNPaa.js} +16 -16
- package/dist/{posthog-integration-BA2aFHGz.js.map → posthog-integration-Dy5cNPaa.js.map} +1 -1
- package/dist/{provisioning-CtC0Ekeq.js → provisioning-CS6fQriR.js} +3 -3
- package/dist/{provisioning-CtC0Ekeq.js.map → provisioning-CS6fQriR.js.map} +1 -1
- package/dist/{queue-tools-DXg_5old.js → queue-tools-ai7gCWyU.js} +45 -32
- package/dist/queue-tools-ai7gCWyU.js.map +1 -0
- package/dist/{registry-B6ubVKTJ.js → registry-D0hx_-KP.js} +5 -5
- package/dist/{registry-B6ubVKTJ.js.map → registry-D0hx_-KP.js.map} +1 -1
- package/dist/{security-np5qnEMM.js → security-BNqgFjYh.js} +5 -5
- package/dist/security-BNqgFjYh.js.map +1 -0
- package/dist/{setup-utils-QwrY_J01.js → setup-utils-6qyTDNyd.js} +8 -8
- package/dist/{setup-utils-QwrY_J01.js.map → setup-utils-6qyTDNyd.js.map} +1 -1
- package/dist/{start-tui-DHEtMtnm.js → start-tui-DNkm-n-4.js} +36 -22
- package/dist/start-tui-DNkm-n-4.js.map +1 -0
- package/dist/{steps-ehGnaz9V.js → steps-CqHAVc8R.js} +7 -7
- package/dist/{steps-ehGnaz9V.js.map → steps-CqHAVc8R.js.map} +1 -1
- package/dist/{store-Cp_jvnNp.js → store-sIaF89XA.js} +6 -6
- package/dist/{store-Cp_jvnNp.js.map → store-sIaF89XA.js.map} +1 -1
- package/dist/{subagent-B9GiHZVj.js → subagent-CKNbRtfQ.js} +2 -2
- package/dist/{subagent-B9GiHZVj.js.map → subagent-CKNbRtfQ.js.map} +1 -1
- package/dist/{task-CmWToh2Q.js → task-DwzRxORh.js} +33 -23
- package/dist/task-DwzRxORh.js.map +1 -0
- package/dist/{task-stream-4I08S7A6.js → task-stream-BdJV-usk.js} +27 -6
- package/dist/task-stream-BdJV-usk.js.map +1 -0
- package/dist/{tasks-C6CfAC-D.js → tasks-yqJVuTvc.js} +2 -2
- package/dist/{tasks-C6CfAC-D.js.map → tasks-yqJVuTvc.js.map} +1 -1
- package/dist/{telemetry-3fcP3zSF.js → telemetry-UBL5MQtw.js} +3 -3
- package/dist/{telemetry-3fcP3zSF.js.map → telemetry-UBL5MQtw.js.map} +1 -1
- package/dist/{terminal-D4A6Hmkf.js → terminal-vo5Zl7j1.js} +807 -63
- package/dist/terminal-vo5Zl7j1.js.map +1 -0
- package/dist/{tools-pH2CNwNX.js → tools-Br8lP29r.js} +8 -10
- package/dist/tools-Br8lP29r.js.map +1 -0
- package/dist/warlock-smoke-test.ts +177 -1
- package/dist/{wizard-abort-BEBAXmPp.js → wizard-abort-BRsd7-aB.js} +1 -1
- package/dist/{wizard-abort-BbsBpCCV.js → wizard-abort-FIC6lKCs.js} +4 -4
- package/dist/{wizard-abort-BbsBpCCV.js.map → wizard-abort-FIC6lKCs.js.map} +1 -1
- package/dist/{wizard-session-BAZql11N.js → wizard-session-CwgR5y3-.js} +2 -1
- package/dist/wizard-session-CwgR5y3-.js.map +1 -0
- package/dist/{wizard-session-C5lZPPEc.js → wizard-session-DsK16SGs.js} +1 -1
- package/dist/yara-hooks--QA2Cwjv.js +2 -0
- package/dist/{yara-hooks-BGBQ4IcA.js → yara-hooks-DxpCD72V.js} +39 -83
- package/dist/yara-hooks-DxpCD72V.js.map +1 -0
- package/package.json +2 -1
- package/dist/agent-interface-oqI_K3-4.js.map +0 -1
- package/dist/agent-runner-CunYPDzL.js.map +0 -1
- package/dist/analytics-DsXLkDwE.js.map +0 -1
- package/dist/analytics-agQIoFg6.js +0 -2
- package/dist/commandments-BagyrYRW.js +0 -2
- package/dist/commandments-DiMtIz1o.js +0 -42
- package/dist/commandments-DiMtIz1o.js.map +0 -1
- package/dist/debug-BH67OSPW.js.map +0 -1
- package/dist/pi-BOCjsfgo.js +0 -575
- package/dist/pi-BOCjsfgo.js.map +0 -1
- package/dist/playground-B4yTvjn4.js.map +0 -1
- package/dist/queue-tools-DXg_5old.js.map +0 -1
- package/dist/security-np5qnEMM.js.map +0 -1
- package/dist/start-tui-DHEtMtnm.js.map +0 -1
- package/dist/task-CmWToh2Q.js.map +0 -1
- package/dist/task-stream-4I08S7A6.js.map +0 -1
- package/dist/terminal-D4A6Hmkf.js.map +0 -1
- package/dist/tools-pH2CNwNX.js.map +0 -1
- package/dist/wizard-session-BAZql11N.js.map +0 -1
- package/dist/yara-hooks-BGBQ4IcA.js.map +0 -1
- package/dist/yara-hooks-BfhKhlIT.js +0 -2
package/dist/bin.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { n as analytics } from "./analytics-
|
|
4
|
-
import { r as setEntryCommand } from "./telemetry-
|
|
5
|
-
import { a as walkProjectFiles, i as safeReadFile } from "./bounded-fs-
|
|
6
|
-
import { n as isUsingTypeScript } from "./setup-utils-
|
|
7
|
-
import { o as handleApiError } from "./api-
|
|
8
|
-
import "./wizard-session-
|
|
9
|
-
import { r as runCleanups } from "./wizard-abort-
|
|
10
|
-
import { n as isNonInteractiveEnvironment } from "./environment-
|
|
11
|
-
import { n as runAgent, o as authenticate } from "./agent-runner-
|
|
12
|
-
import {
|
|
13
|
-
import { S as SETUP_REPORT_FILE, _ as AUDIT_CHECKS_KEY, g as AUDIT_CHECKS_FILE, v as AUDIT_REPORT_FILE } from "./yara-hooks-
|
|
14
|
-
import { i as SPINNER_MESSAGE } from "./registry-
|
|
15
|
-
import {
|
|
16
|
-
import { n as readApiKeyFromEnv } from "./env-api-key-
|
|
2
|
+
import { Ct as regionOption, L as Integration, St as isHeadless, U as POSTHOG_DOCS_URL, a as getLogFilePath, f as getUI, ft as WIZARD_USER_AGENT, ht as VERSION, m as LoggingUI, p as setUI, pt as getSkillsBaseUrl, r as debug, s as logToFile, xt as headlessOption } from "./debug-CbgLkSCY.js";
|
|
3
|
+
import { n as analytics } from "./analytics-D7hsukY7.js";
|
|
4
|
+
import { r as setEntryCommand } from "./telemetry-UBL5MQtw.js";
|
|
5
|
+
import { a as walkProjectFiles, i as safeReadFile } from "./bounded-fs-Cq960M-V.js";
|
|
6
|
+
import { n as isUsingTypeScript } from "./setup-utils-6qyTDNyd.js";
|
|
7
|
+
import { o as handleApiError } from "./api-BSq9hLu5.js";
|
|
8
|
+
import "./wizard-session-CwgR5y3-.js";
|
|
9
|
+
import { r as runCleanups } from "./wizard-abort-FIC6lKCs.js";
|
|
10
|
+
import { n as isNonInteractiveEnvironment } from "./environment-BWuaOExh.js";
|
|
11
|
+
import { n as runAgent, o as authenticate } from "./agent-runner-D6zGTJqn.js";
|
|
12
|
+
import { l as recoverOrphanedSettingsBackups, p as AgentSignals, v as WIZARD_TOOL_NAMES, x as fetchSkillMenu } from "./agent-interface-CLvG6Rk9.js";
|
|
13
|
+
import { S as SETUP_REPORT_FILE, _ as AUDIT_CHECKS_KEY, g as AUDIT_CHECKS_FILE, v as AUDIT_REPORT_FILE } from "./yara-hooks-DxpCD72V.js";
|
|
14
|
+
import { i as SPINNER_MESSAGE } from "./registry-D0hx_-KP.js";
|
|
15
|
+
import { C as gatherFrameworkContext, S as resolveProjectDir, _ as WAREHOUSE_ABORT_CASES, a as LINE_CHART_BLOCK, b as detectIntegrationProjects, d as isClearBlock, g as HEALTH_CHECK_STEP, h as Icons, i as FUNNEL_BLOCK, m as Colors, n as integrationRunStep, o as PRODUCT_SUITE_BLOCK, r as posthogIntegrationConfig, s as StatusPeekTrigger, u as wordWrap, v as detectWarehousePrerequisites, y as getDetectedWarehouseSources } from "./posthog-integration-Dy5cNPaa.js";
|
|
16
|
+
import { n as readApiKeyFromEnv } from "./env-api-key-cjD4yfGT.js";
|
|
17
17
|
import { satisfies } from "semver";
|
|
18
18
|
import yargs from "yargs";
|
|
19
19
|
import { hideBin } from "yargs/helpers";
|
|
@@ -26,7 +26,7 @@ import { spawnSync } from "node:child_process";
|
|
|
26
26
|
import * as fs$1 from "node:fs";
|
|
27
27
|
import axios from "axios";
|
|
28
28
|
import { z } from "zod";
|
|
29
|
-
import { Box, Text, render, useInput } from "ink";
|
|
29
|
+
import { Box, Text, render, useInput, useStdout } from "ink";
|
|
30
30
|
import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
31
31
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
32
|
import { access, rm } from "node:fs/promises";
|
|
@@ -148,10 +148,10 @@ var Wizard = class Wizard {
|
|
|
148
148
|
process.stderr.write(`\n\x1b[1;91m✖ CI mode is not currently supported in published builds.\x1b[0m\n\n`);
|
|
149
149
|
process.exit(1);
|
|
150
150
|
}
|
|
151
|
-
const argvHasOverride = args.some((a) => a === "--harness" || a.startsWith("--harness=") || a === "--sequence" || a.startsWith("--sequence=") || a === "--model" || a.startsWith("--model="));
|
|
152
|
-
const envHasOverride = process.env.POSTHOG_WIZARD_HARNESS != null && process.env.POSTHOG_WIZARD_HARNESS !== "" || process.env.POSTHOG_WIZARD_SEQUENCE != null && process.env.POSTHOG_WIZARD_SEQUENCE !== "" || process.env.POSTHOG_WIZARD_MODEL != null && process.env.POSTHOG_WIZARD_MODEL !== "";
|
|
151
|
+
const argvHasOverride = args.some((a) => a === "--harness" || a.startsWith("--harness=") || a === "--sequence" || a.startsWith("--sequence=") || a === "--model" || a.startsWith("--model=") || a === "--capture-aio" || a === "--no-capture-aio" || a.startsWith("--capture-aio="));
|
|
152
|
+
const envHasOverride = process.env.POSTHOG_WIZARD_HARNESS != null && process.env.POSTHOG_WIZARD_HARNESS !== "" || process.env.POSTHOG_WIZARD_SEQUENCE != null && process.env.POSTHOG_WIZARD_SEQUENCE !== "" || process.env.POSTHOG_WIZARD_MODEL != null && process.env.POSTHOG_WIZARD_MODEL !== "" || process.env.POSTHOG_WIZARD_CAPTURE_AIO != null && process.env.POSTHOG_WIZARD_CAPTURE_AIO !== "";
|
|
153
153
|
if (argvHasOverride || envHasOverride) {
|
|
154
|
-
process.stderr.write(`\n\x1b[1;91m✖ The --harness, --sequence, and --
|
|
154
|
+
process.stderr.write(`\n\x1b[1;91m✖ The --harness, --sequence, --model, and --capture-aio overrides are not available in published builds.\x1b[0m\n\n`);
|
|
155
155
|
process.exit(1);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -200,7 +200,7 @@ function runProvision(argv) {
|
|
|
200
200
|
}
|
|
201
201
|
async function provision({ email, region, name, baseUrl, jsonMode }) {
|
|
202
202
|
try {
|
|
203
|
-
const { provisionNewAccount } = await import("./provisioning-
|
|
203
|
+
const { provisionNewAccount } = await import("./provisioning-CS6fQriR.js").then((n) => n.n);
|
|
204
204
|
if (!jsonMode) getUI().log.info(`Provisioning account for ${email} in ${region}...`);
|
|
205
205
|
emitResult(await provisionNewAccount(email, name, region, { baseUrl }), jsonMode);
|
|
206
206
|
process.exit(0);
|
|
@@ -267,22 +267,22 @@ const basicIntegrationCommand = {
|
|
|
267
267
|
setEntryCommand("integrate");
|
|
268
268
|
(async () => {
|
|
269
269
|
if (isHeadless(argv)) {
|
|
270
|
-
const { runHeadlessInstall } = await import("./ci-install-
|
|
270
|
+
const { runHeadlessInstall } = await import("./ci-install-w-mywB9x.js");
|
|
271
271
|
return runHeadlessInstall(argv);
|
|
272
272
|
}
|
|
273
273
|
if (argv.ci) {
|
|
274
|
-
const { runCIInstall } = await import("./ci-install-
|
|
274
|
+
const { runCIInstall } = await import("./ci-install-w-mywB9x.js");
|
|
275
275
|
return runCIInstall(argv);
|
|
276
276
|
}
|
|
277
277
|
if (isNonInteractiveEnvironment()) {
|
|
278
|
-
const { failNonInteractive } = await import("./non-interactive-
|
|
278
|
+
const { failNonInteractive } = await import("./non-interactive-eXT2_WCR.js");
|
|
279
279
|
return failNonInteractive();
|
|
280
280
|
}
|
|
281
281
|
if (argv.playground) {
|
|
282
|
-
const { runPlayground } = await import("./playground-
|
|
282
|
+
const { runPlayground } = await import("./playground-DuBvnGkP.js");
|
|
283
283
|
return runPlayground();
|
|
284
284
|
}
|
|
285
|
-
const { runInteractive } = await import("./interactive-
|
|
285
|
+
const { runInteractive } = await import("./interactive-D-MVMdBl.js");
|
|
286
286
|
runInteractive(argv);
|
|
287
287
|
})();
|
|
288
288
|
}
|
|
@@ -3793,13 +3793,13 @@ const mcpAddCommand = {
|
|
|
3793
3793
|
function runMcpAdd(argv) {
|
|
3794
3794
|
const features = parseFeatures(argv.features);
|
|
3795
3795
|
(async () => {
|
|
3796
|
-
const { readApiKeyFromEnv } = await import("./env-api-key-
|
|
3796
|
+
const { readApiKeyFromEnv } = await import("./env-api-key-cjD4yfGT.js").then((n) => n.t);
|
|
3797
3797
|
const apiKey = argv.apiKey || readApiKeyFromEnv();
|
|
3798
3798
|
const debug = argv.debug;
|
|
3799
3799
|
const localMcp = argv.local;
|
|
3800
3800
|
try {
|
|
3801
|
-
const { startTUI } = await import("./start-tui-
|
|
3802
|
-
const { buildSession } = await import("./wizard-session-
|
|
3801
|
+
const { startTUI } = await import("./start-tui-DNkm-n-4.js");
|
|
3802
|
+
const { buildSession } = await import("./wizard-session-DsK16SGs.js");
|
|
3803
3803
|
const tui = startTUI(VERSION, Program.McpAdd);
|
|
3804
3804
|
tui.store.session = buildSession({
|
|
3805
3805
|
debug,
|
|
@@ -3811,7 +3811,7 @@ function runMcpAdd(argv) {
|
|
|
3811
3811
|
} catch (error) {
|
|
3812
3812
|
if (!isTUIUnavailable(error)) throw error;
|
|
3813
3813
|
setUI(new LoggingUI());
|
|
3814
|
-
const { addMCPServerToClientsStep } = await import("./add-mcp-server-to-clients-
|
|
3814
|
+
const { addMCPServerToClientsStep } = await import("./add-mcp-server-to-clients-B3TcwTT5.js").then((n) => n.r);
|
|
3815
3815
|
await addMCPServerToClientsStep({
|
|
3816
3816
|
local: localMcp,
|
|
3817
3817
|
features,
|
|
@@ -3850,8 +3850,8 @@ function runMcpRemove(argv) {
|
|
|
3850
3850
|
const debug = argv.debug;
|
|
3851
3851
|
const localMcp = argv.local;
|
|
3852
3852
|
try {
|
|
3853
|
-
const { startTUI } = await import("./start-tui-
|
|
3854
|
-
const { buildSession } = await import("./wizard-session-
|
|
3853
|
+
const { startTUI } = await import("./start-tui-DNkm-n-4.js");
|
|
3854
|
+
const { buildSession } = await import("./wizard-session-DsK16SGs.js");
|
|
3855
3855
|
const tui = startTUI(VERSION, Program.McpRemove);
|
|
3856
3856
|
tui.store.session = buildSession({
|
|
3857
3857
|
debug,
|
|
@@ -3860,7 +3860,7 @@ function runMcpRemove(argv) {
|
|
|
3860
3860
|
});
|
|
3861
3861
|
} catch {
|
|
3862
3862
|
setUI(new LoggingUI());
|
|
3863
|
-
const { removeMCPServerFromClientsStep } = await import("./add-mcp-server-to-clients-
|
|
3863
|
+
const { removeMCPServerFromClientsStep } = await import("./add-mcp-server-to-clients-B3TcwTT5.js").then((n) => n.r);
|
|
3864
3864
|
await removeMCPServerFromClientsStep({ local: localMcp });
|
|
3865
3865
|
}
|
|
3866
3866
|
})();
|
|
@@ -3882,8 +3882,8 @@ function runMcpTutorial(argv) {
|
|
|
3882
3882
|
const debug = argv.debug;
|
|
3883
3883
|
const localMcp = argv.local;
|
|
3884
3884
|
try {
|
|
3885
|
-
const { startTUI } = await import("./start-tui-
|
|
3886
|
-
const { buildSession } = await import("./wizard-session-
|
|
3885
|
+
const { startTUI } = await import("./start-tui-DNkm-n-4.js");
|
|
3886
|
+
const { buildSession } = await import("./wizard-session-DsK16SGs.js");
|
|
3887
3887
|
const tui = startTUI(VERSION, Program.McpTutorial);
|
|
3888
3888
|
tui.store.session = buildSession({
|
|
3889
3889
|
debug,
|
|
@@ -3963,10 +3963,10 @@ function runWizard(config, options) {
|
|
|
3963
3963
|
(async () => {
|
|
3964
3964
|
try {
|
|
3965
3965
|
const installDir = options.installDir || process.cwd();
|
|
3966
|
-
const { startTUI } = await import("./start-tui-
|
|
3967
|
-
const { buildSession, RunPhase } = await import("./wizard-session-
|
|
3968
|
-
const { TaskStreamPush } = await import("./task-stream-
|
|
3969
|
-
const { PostHogDestination } = await import("./posthog-
|
|
3966
|
+
const { startTUI } = await import("./start-tui-DNkm-n-4.js");
|
|
3967
|
+
const { buildSession, RunPhase } = await import("./wizard-session-DsK16SGs.js");
|
|
3968
|
+
const { TaskStreamPush } = await import("./task-stream-BdJV-usk.js");
|
|
3969
|
+
const { PostHogDestination } = await import("./posthog-DDLIrku0.js");
|
|
3970
3970
|
tui = startTUI(WIZARD_VERSION, config.id);
|
|
3971
3971
|
const activeTui = tui;
|
|
3972
3972
|
const session = buildSession({
|
|
@@ -3985,7 +3985,8 @@ function runWizard(config, options) {
|
|
|
3985
3985
|
harness: options.harness,
|
|
3986
3986
|
sequence: options.sequence,
|
|
3987
3987
|
model: options.model,
|
|
3988
|
-
integrate: options.integrate
|
|
3988
|
+
integrate: options.integrate,
|
|
3989
|
+
captureAio: options.captureAio
|
|
3989
3990
|
});
|
|
3990
3991
|
session.programLabel = config.id;
|
|
3991
3992
|
if (options.skillId) session.skillId = options.skillId;
|
|
@@ -4031,7 +4032,7 @@ function runWizard(config, options) {
|
|
|
4031
4032
|
if (shown(step)) await advanceStep(step, activeTui.store, config);
|
|
4032
4033
|
}
|
|
4033
4034
|
else if (skipAgent) {
|
|
4034
|
-
const { getOrAskForProjectData } = await import("./setup-utils-
|
|
4035
|
+
const { getOrAskForProjectData } = await import("./setup-utils-6qyTDNyd.js").then((n) => n.r);
|
|
4035
4036
|
const { projectApiKey, host, accessToken, projectId } = await getOrAskForProjectData({
|
|
4036
4037
|
signup: session.signup,
|
|
4037
4038
|
ci: session.ci,
|
|
@@ -4132,11 +4133,11 @@ function runNonInteractive(config, options, mode) {
|
|
|
4132
4133
|
analytics.setTag("build", mode);
|
|
4133
4134
|
(async () => {
|
|
4134
4135
|
const path = await import("path");
|
|
4135
|
-
const { buildSession, RunPhase, OutroKind } = await import("./wizard-session-
|
|
4136
|
-
const { readEnvironment } = await import("./environment-
|
|
4137
|
-
const { readApiKeyFromEnv } = await import("./env-api-key-
|
|
4138
|
-
const { configureLogFileFromEnvironment, logToFile } = await import("./debug-
|
|
4139
|
-
const { wizardAbort, WizardError } = await import("./wizard-abort-
|
|
4136
|
+
const { buildSession, RunPhase, OutroKind } = await import("./wizard-session-DsK16SGs.js");
|
|
4137
|
+
const { readEnvironment } = await import("./environment-BWuaOExh.js").then((n) => n.t);
|
|
4138
|
+
const { readApiKeyFromEnv } = await import("./env-api-key-cjD4yfGT.js").then((n) => n.t);
|
|
4139
|
+
const { configureLogFileFromEnvironment, logToFile } = await import("./debug-CX6ZqL9r.js");
|
|
4140
|
+
const { wizardAbort, WizardError } = await import("./wizard-abort-BRsd7-aB.js");
|
|
4140
4141
|
configureLogFileFromEnvironment();
|
|
4141
4142
|
const env = readEnvironment();
|
|
4142
4143
|
const apiKey = options.apiKey ?? readApiKeyFromEnv() ?? void 0;
|
|
@@ -4157,6 +4158,7 @@ function runNonInteractive(config, options, mode) {
|
|
|
4157
4158
|
harness: options.harness,
|
|
4158
4159
|
sequence: options.sequence,
|
|
4159
4160
|
model: options.model,
|
|
4161
|
+
captureAio: options.captureAio,
|
|
4160
4162
|
...env,
|
|
4161
4163
|
region: options.region ?? env.region
|
|
4162
4164
|
});
|
|
@@ -4168,9 +4170,9 @@ function runNonInteractive(config, options, mode) {
|
|
|
4168
4170
|
let store = null;
|
|
4169
4171
|
let taskStream = null;
|
|
4170
4172
|
if (mode === "headless") {
|
|
4171
|
-
const { WizardStore } = await import("./store-
|
|
4172
|
-
const { HeadlessUI } = await import("./headless-ui-
|
|
4173
|
-
const { TaskStreamPush, PostHogDestination } = await import("./task-stream-
|
|
4173
|
+
const { WizardStore } = await import("./store-sIaF89XA.js").then((n) => n.n);
|
|
4174
|
+
const { HeadlessUI } = await import("./headless-ui-rH97E35y.js");
|
|
4175
|
+
const { TaskStreamPush, PostHogDestination } = await import("./task-stream-BdJV-usk.js");
|
|
4174
4176
|
store = new WizardStore(config.id);
|
|
4175
4177
|
store.session = session;
|
|
4176
4178
|
setUI(new HeadlessUI(store));
|
|
@@ -4226,7 +4228,7 @@ function runNonInteractive(config, options, mode) {
|
|
|
4226
4228
|
});
|
|
4227
4229
|
}
|
|
4228
4230
|
}
|
|
4229
|
-
const { runAgent } = await import("./agent-runner-
|
|
4231
|
+
const { runAgent } = await import("./agent-runner-D6zGTJqn.js").then((n) => n.t);
|
|
4230
4232
|
await runAgent(config, session);
|
|
4231
4233
|
await settleStream(RunPhase.Completed);
|
|
4232
4234
|
} catch (error) {
|
|
@@ -4512,6 +4514,7 @@ function pickerChildrenToShow(children) {
|
|
|
4512
4514
|
* where [!] is black text on accent background.
|
|
4513
4515
|
*/
|
|
4514
4516
|
const PromptLabel = ({ message }) => {
|
|
4517
|
+
if (!message) return null;
|
|
4515
4518
|
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
|
|
4516
4519
|
bold: true,
|
|
4517
4520
|
color: Colors.accent,
|
|
@@ -4547,6 +4550,35 @@ const ConfirmButton = ({ label = "Confirm", focused, count }) => {
|
|
|
4547
4550
|
});
|
|
4548
4551
|
};
|
|
4549
4552
|
//#endregion
|
|
4553
|
+
//#region src/ui/tui/hooks/useStdoutDimensions.ts
|
|
4554
|
+
/**
|
|
4555
|
+
* useStdoutDimensions — Returns [columns, rows] and re-renders on terminal resize.
|
|
4556
|
+
*
|
|
4557
|
+
* Ink's useStdout() does not subscribe to resize events, so layout only updates
|
|
4558
|
+
* when something else causes a re-render. This hook listens to the stream's
|
|
4559
|
+
* 'resize' event (Node TTY) and updates state so the component re-renders
|
|
4560
|
+
* with the new dimensions.
|
|
4561
|
+
*/
|
|
4562
|
+
function useStdoutDimensions() {
|
|
4563
|
+
const { stdout } = useStdout();
|
|
4564
|
+
const [size, setSize] = useState(() => [stdout.columns || 80, stdout.rows || 24]);
|
|
4565
|
+
useEffect(() => {
|
|
4566
|
+
setSize([stdout.columns || 80, stdout.rows || 24]);
|
|
4567
|
+
const stream = stdout;
|
|
4568
|
+
if (typeof stream.on !== "function") return;
|
|
4569
|
+
const onResize = () => {
|
|
4570
|
+
const c = stdout.columns || 80;
|
|
4571
|
+
const r = stdout.rows || 24;
|
|
4572
|
+
if (c > 0 && r > 0) setSize([c, r]);
|
|
4573
|
+
};
|
|
4574
|
+
stream.on("resize", onResize);
|
|
4575
|
+
return () => {
|
|
4576
|
+
stream.off?.("resize", onResize);
|
|
4577
|
+
};
|
|
4578
|
+
}, [stdout]);
|
|
4579
|
+
return size;
|
|
4580
|
+
}
|
|
4581
|
+
//#endregion
|
|
4550
4582
|
//#region src/ui/tui/hooks/keyboard-hints-utils.ts
|
|
4551
4583
|
/** Default priorities by key type. */
|
|
4552
4584
|
const DEFAULT_PRIORITY = {
|
|
@@ -4706,16 +4738,61 @@ function stepEnabled(options, rows, from, dir) {
|
|
|
4706
4738
|
}
|
|
4707
4739
|
return from;
|
|
4708
4740
|
}
|
|
4709
|
-
/**
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4741
|
+
/** First enabled option in [start, end), for initial focus and for entering
|
|
4742
|
+
* a page from the Confirm button. */
|
|
4743
|
+
function firstEnabled(options, start = 0, end = options.length) {
|
|
4744
|
+
for (let i = start; i < end; i++) if (!options[i]?.disabled) return i;
|
|
4745
|
+
return start;
|
|
4746
|
+
}
|
|
4747
|
+
/** Last enabled option in [start, end), for wrapping from the button onto
|
|
4748
|
+
* the bottom of the page. */
|
|
4749
|
+
function lastEnabled(options, start = 0, end = options.length) {
|
|
4750
|
+
for (let i = end - 1; i >= start; i--) if (!options[i]?.disabled) return i;
|
|
4751
|
+
return end - 1;
|
|
4713
4752
|
}
|
|
4714
|
-
/**
|
|
4715
|
-
*
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4753
|
+
/**
|
|
4754
|
+
* Rows the surrounding screen or overlay consumes above and below a picker —
|
|
4755
|
+
* border + padding, title, prompt text, and the keyboard-hints bar. A
|
|
4756
|
+
* deliberately generous estimate: overshooting just shows a few fewer rows,
|
|
4757
|
+
* whereas undershooting lets a long list overflow the viewport (the bug this
|
|
4758
|
+
* windowing guards against). Mirrors GroupedPickerMenu's budgeting.
|
|
4759
|
+
*/
|
|
4760
|
+
const CHROME_OVERHEAD = 13;
|
|
4761
|
+
/**
|
|
4762
|
+
* Max visual rows a picker renders regardless of terminal height. Without a
|
|
4763
|
+
* ceiling a tall terminal lets a long list fill the whole viewport, which
|
|
4764
|
+
* reads as a wall of options; ~12 rows keeps the menu scannable and leaves
|
|
4765
|
+
* known breathing room above and below.
|
|
4766
|
+
*/
|
|
4767
|
+
const MAX_LIST_ROWS = 12;
|
|
4768
|
+
/** Extra rows a multi-select adds below its options: marginTop + Confirm button. */
|
|
4769
|
+
const CONFIRM_CHROME = 3;
|
|
4770
|
+
/** Width the multi-select wraps option descriptions to (matches the render). */
|
|
4771
|
+
const DESCRIPTION_WIDTH = 56;
|
|
4772
|
+
/**
|
|
4773
|
+
* Pages a single-column option list to the terminal height. The visible page
|
|
4774
|
+
* is derived from the focused index — no scroll state — so ↑/↓ flip pages as
|
|
4775
|
+
* focus crosses a page edge and n/p jump a whole page. Pages hold a fixed
|
|
4776
|
+
* option count sized to the tallest row (`rowCost`), trading a sparser page
|
|
4777
|
+
* on mixed-height lists for arithmetic-only paging. Engages only for
|
|
4778
|
+
* single-column pickers — multi-column grids already compress vertically.
|
|
4779
|
+
*/
|
|
4780
|
+
function usePickerViewport(count, rowCost, chromeBelow, enabled, focused) {
|
|
4781
|
+
const [, termRows] = useStdoutDimensions();
|
|
4782
|
+
const budget = Math.max(5, Math.min(termRows - CHROME_OVERHEAD - chromeBelow, MAX_LIST_ROWS));
|
|
4783
|
+
const needsScroll = enabled && count * rowCost > budget;
|
|
4784
|
+
const perPage = needsScroll ? Math.max(1, Math.floor((budget - 2) / rowCost)) : count;
|
|
4785
|
+
const pageCount = Math.max(1, Math.ceil(count / perPage));
|
|
4786
|
+
const start = Math.floor(focused / perPage) * perPage;
|
|
4787
|
+
const end = Math.min(start + perPage, count);
|
|
4788
|
+
return {
|
|
4789
|
+
needsScroll,
|
|
4790
|
+
start,
|
|
4791
|
+
end,
|
|
4792
|
+
hiddenAbove: start,
|
|
4793
|
+
hiddenBelow: count - end,
|
|
4794
|
+
pageStep: (f, dir) => (Math.floor(f / perPage) + dir + pageCount) % pageCount * perPage
|
|
4795
|
+
};
|
|
4719
4796
|
}
|
|
4720
4797
|
const PickerMenu = ({ message, options, mode = "single", centered = false, columns = 1, optionMarginBottom = 0, onSelect }) => {
|
|
4721
4798
|
if (mode === "multi") return /* @__PURE__ */ jsx(MultiPickerMenu, {
|
|
@@ -4739,26 +4816,50 @@ const PickerMenu = ({ message, options, mode = "single", centered = false, colum
|
|
|
4739
4816
|
const SinglePickerMenu = ({ message, options, centered = false, columns = 1, optionMarginBottom = 0, onSelect }) => {
|
|
4740
4817
|
const [focused, setFocused] = useState(() => firstEnabled(options));
|
|
4741
4818
|
const rows = Math.ceil(options.length / columns);
|
|
4819
|
+
const viewport = usePickerViewport(options.length, 1 + optionMarginBottom, 0, columns === 1, focused);
|
|
4742
4820
|
useEffect(() => {
|
|
4743
4821
|
if (focused >= options.length || options[focused]?.disabled) setFocused(firstEnabled(options));
|
|
4744
4822
|
}, [options, focused]);
|
|
4745
|
-
const bindings = [
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4823
|
+
const bindings = [
|
|
4824
|
+
{
|
|
4825
|
+
match: ["upArrow", "downArrow"],
|
|
4826
|
+
label: "↑↓",
|
|
4827
|
+
action: "navigate",
|
|
4828
|
+
handler: (_input, key) => {
|
|
4829
|
+
const dir = key.upArrow ? -1 : 1;
|
|
4830
|
+
if (columns === 1) {
|
|
4831
|
+
const { start, end } = viewport;
|
|
4832
|
+
const span = end - start;
|
|
4833
|
+
let r = focused;
|
|
4834
|
+
for (let i = 0; i < span; i++) {
|
|
4835
|
+
r = start + (r - start + dir + span) % span;
|
|
4836
|
+
if (!options[r]?.disabled) break;
|
|
4837
|
+
}
|
|
4838
|
+
setFocused(r);
|
|
4839
|
+
return;
|
|
4840
|
+
}
|
|
4841
|
+
setFocused(stepEnabled(options, rows, focused, dir));
|
|
4842
|
+
}
|
|
4843
|
+
},
|
|
4844
|
+
...viewport.needsScroll ? [{
|
|
4845
|
+
match: ["n", "p"],
|
|
4846
|
+
label: "n/p",
|
|
4847
|
+
action: "page",
|
|
4848
|
+
handler: (input) => {
|
|
4849
|
+
const target = viewport.pageStep(focused, input === "n" ? 1 : -1);
|
|
4850
|
+
setFocused(options[target]?.disabled ? stepEnabled(options, rows, target, 1) : target);
|
|
4851
|
+
}
|
|
4852
|
+
}] : [],
|
|
4853
|
+
{
|
|
4854
|
+
match: "return",
|
|
4855
|
+
label: "enter",
|
|
4856
|
+
action: "select",
|
|
4857
|
+
handler: () => {
|
|
4858
|
+
const selected = options[focused];
|
|
4859
|
+
if (selected && !selected.disabled) onSelect(selected.value);
|
|
4860
|
+
}
|
|
4760
4861
|
}
|
|
4761
|
-
|
|
4862
|
+
];
|
|
4762
4863
|
if (columns > 1) bindings.splice(1, 0, {
|
|
4763
4864
|
match: ["leftArrow", "rightArrow"],
|
|
4764
4865
|
label: "←→",
|
|
@@ -4782,41 +4883,55 @@ const SinglePickerMenu = ({ message, options, centered = false, columns = 1, opt
|
|
|
4782
4883
|
useKeyBindings("single-picker", bindings);
|
|
4783
4884
|
const columnArrays = [];
|
|
4784
4885
|
for (let c = 0; c < columns; c++) columnArrays.push(options.slice(c * rows, c * rows + rows));
|
|
4886
|
+
const align = centered ? "center" : void 0;
|
|
4887
|
+
const renderOption = (opt, flatIdx) => {
|
|
4888
|
+
const isFocused = flatIdx === focused;
|
|
4889
|
+
const base = opt.hint ? `${opt.label} (${opt.hint})` : opt.label;
|
|
4890
|
+
const label = opt.indent ? ` ${base}` : base;
|
|
4891
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
4892
|
+
gap: 1,
|
|
4893
|
+
marginBottom: optionMarginBottom,
|
|
4894
|
+
children: [
|
|
4895
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4896
|
+
color: isFocused ? Colors.accent : void 0,
|
|
4897
|
+
dimColor: !isFocused,
|
|
4898
|
+
children: isFocused && !opt.header ? Icons.triangleSmallRight : " "
|
|
4899
|
+
}),
|
|
4900
|
+
opt.icon && /* @__PURE__ */ jsx(Text, {
|
|
4901
|
+
color: opt.icon.color,
|
|
4902
|
+
children: opt.icon.glyph
|
|
4903
|
+
}),
|
|
4904
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4905
|
+
color: opt.header ? void 0 : opt.disabled ? Colors.muted : isFocused ? Colors.accent : void 0,
|
|
4906
|
+
bold: opt.header || isFocused && !opt.disabled,
|
|
4907
|
+
dimColor: !opt.header && (!isFocused || opt.disabled),
|
|
4908
|
+
children: label
|
|
4909
|
+
})
|
|
4910
|
+
]
|
|
4911
|
+
}, flatIdx);
|
|
4912
|
+
};
|
|
4785
4913
|
return /* @__PURE__ */ jsxs(Box, {
|
|
4786
4914
|
flexDirection: "column",
|
|
4787
|
-
alignItems:
|
|
4788
|
-
children: [/* @__PURE__ */ jsx(PromptLabel, { message }), /* @__PURE__ */
|
|
4915
|
+
alignItems: align,
|
|
4916
|
+
children: [/* @__PURE__ */ jsx(PromptLabel, { message }), viewport.needsScroll ? /* @__PURE__ */ jsxs(Box, {
|
|
4917
|
+
flexDirection: "column",
|
|
4918
|
+
children: [
|
|
4919
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4920
|
+
dimColor: true,
|
|
4921
|
+
children: viewport.hiddenAbove > 0 ? `↑ ${viewport.hiddenAbove} more [P] for previous page` : " "
|
|
4922
|
+
}),
|
|
4923
|
+
options.slice(viewport.start, viewport.end).map((opt, relIdx) => renderOption(opt, viewport.start + relIdx)),
|
|
4924
|
+
/* @__PURE__ */ jsx(Text, {
|
|
4925
|
+
dimColor: true,
|
|
4926
|
+
children: viewport.hiddenBelow > 0 ? `↓ ${viewport.hiddenBelow} more [N] for next page` : " "
|
|
4927
|
+
})
|
|
4928
|
+
]
|
|
4929
|
+
}) : /* @__PURE__ */ jsx(Box, {
|
|
4789
4930
|
flexDirection: "row",
|
|
4790
4931
|
gap: 4,
|
|
4791
4932
|
children: columnArrays.map((colOpts, colIdx) => /* @__PURE__ */ jsx(Box, {
|
|
4792
4933
|
flexDirection: "column",
|
|
4793
|
-
children: colOpts.map((opt, rowIdx) =>
|
|
4794
|
-
const flatIdx = colIdx * rows + rowIdx;
|
|
4795
|
-
const isFocused = flatIdx === focused;
|
|
4796
|
-
const base = opt.hint ? `${opt.label} (${opt.hint})` : opt.label;
|
|
4797
|
-
const label = opt.indent ? ` ${base}` : base;
|
|
4798
|
-
return /* @__PURE__ */ jsxs(Box, {
|
|
4799
|
-
gap: 1,
|
|
4800
|
-
marginBottom: optionMarginBottom,
|
|
4801
|
-
children: [
|
|
4802
|
-
/* @__PURE__ */ jsx(Text, {
|
|
4803
|
-
color: isFocused ? Colors.accent : void 0,
|
|
4804
|
-
dimColor: !isFocused,
|
|
4805
|
-
children: isFocused && !opt.header ? Icons.triangleSmallRight : " "
|
|
4806
|
-
}),
|
|
4807
|
-
opt.icon && /* @__PURE__ */ jsx(Text, {
|
|
4808
|
-
color: opt.icon.color,
|
|
4809
|
-
children: opt.icon.glyph
|
|
4810
|
-
}),
|
|
4811
|
-
/* @__PURE__ */ jsx(Text, {
|
|
4812
|
-
color: opt.header ? void 0 : opt.disabled ? Colors.muted : isFocused ? Colors.accent : void 0,
|
|
4813
|
-
bold: opt.header || isFocused && !opt.disabled,
|
|
4814
|
-
dimColor: !opt.header && (!isFocused || opt.disabled),
|
|
4815
|
-
children: label
|
|
4816
|
-
})
|
|
4817
|
-
]
|
|
4818
|
-
}, flatIdx);
|
|
4819
|
-
})
|
|
4934
|
+
children: colOpts.map((opt, rowIdx) => renderOption(opt, colIdx * rows + rowIdx))
|
|
4820
4935
|
}, colIdx))
|
|
4821
4936
|
})]
|
|
4822
4937
|
});
|
|
@@ -4838,67 +4953,76 @@ const MultiPickerMenu = ({ message, options, centered = false, columns = 1, opti
|
|
|
4838
4953
|
const [onButton, setOnButton] = useState(false);
|
|
4839
4954
|
const [selected, setSelected] = useState(/* @__PURE__ */ new Set());
|
|
4840
4955
|
const rows = Math.ceil(options.length / columns);
|
|
4956
|
+
const rowCost = options.reduce((max, opt) => Math.max(max, 1 + optionMarginBottom + (opt.description ? wordWrap(opt.description, DESCRIPTION_WIDTH).length : 0)), 1);
|
|
4957
|
+
const viewport = usePickerViewport(options.length, rowCost, CONFIRM_CHROME, columns === 1, focused);
|
|
4841
4958
|
useEffect(() => {
|
|
4842
4959
|
if (focused >= options.length || options[focused]?.disabled) setFocused(firstEnabled(options));
|
|
4843
4960
|
}, [options, focused]);
|
|
4844
4961
|
const confirm = () => {
|
|
4845
4962
|
onSelect([...selected].sort((a, b) => a - b).map((i) => options[i].value));
|
|
4846
4963
|
};
|
|
4847
|
-
const bindings = [
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4964
|
+
const bindings = [
|
|
4965
|
+
{
|
|
4966
|
+
match: ["upArrow", "downArrow"],
|
|
4967
|
+
label: "↑↓",
|
|
4968
|
+
action: "navigate",
|
|
4969
|
+
handler: (_input, key) => {
|
|
4970
|
+
const dir = key.upArrow ? -1 : 1;
|
|
4853
4971
|
if (onButton) {
|
|
4854
4972
|
setOnButton(false);
|
|
4855
|
-
setFocused(lastEnabled(options));
|
|
4973
|
+
setFocused(dir === -1 ? lastEnabled(options, viewport.start, viewport.end) : firstEnabled(options, viewport.start, viewport.end));
|
|
4856
4974
|
return;
|
|
4857
4975
|
}
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
}
|
|
4864
|
-
if (key.downArrow) {
|
|
4865
|
-
if (onButton) {
|
|
4866
|
-
setOnButton(false);
|
|
4867
|
-
setFocused(firstEnabled(options));
|
|
4976
|
+
if (columns === 1) {
|
|
4977
|
+
let r = focused + dir;
|
|
4978
|
+
while (r >= viewport.start && r < viewport.end && options[r]?.disabled) r += dir;
|
|
4979
|
+
if (r >= viewport.start && r < viewport.end) setFocused(r);
|
|
4980
|
+
else setOnButton(true);
|
|
4868
4981
|
return;
|
|
4869
4982
|
}
|
|
4870
4983
|
const col = Math.floor(focused / rows);
|
|
4871
4984
|
const row = focused % rows;
|
|
4872
4985
|
const colLen = Math.min(rows, options.length - col * rows);
|
|
4873
|
-
let r = row +
|
|
4874
|
-
while (r < colLen && options[col * rows + r]?.disabled) r
|
|
4875
|
-
if (r < colLen) setFocused(col * rows + r);
|
|
4986
|
+
let r = row + dir;
|
|
4987
|
+
while (r >= 0 && r < colLen && options[col * rows + r]?.disabled) r += dir;
|
|
4988
|
+
if (r >= 0 && r < colLen) setFocused(col * rows + r);
|
|
4876
4989
|
else setOnButton(true);
|
|
4877
4990
|
}
|
|
4878
|
-
}
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4991
|
+
},
|
|
4992
|
+
...viewport.needsScroll ? [{
|
|
4993
|
+
match: ["n", "p"],
|
|
4994
|
+
label: "n/p",
|
|
4995
|
+
action: "page",
|
|
4996
|
+
handler: (input) => {
|
|
4997
|
+
const target = viewport.pageStep(focused, input === "n" ? 1 : -1);
|
|
4998
|
+
setOnButton(false);
|
|
4999
|
+
setFocused(options[target]?.disabled ? stepEnabled(options, rows, target, 1) : target);
|
|
4887
5000
|
}
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
5001
|
+
}] : [],
|
|
5002
|
+
{
|
|
5003
|
+
match: ["space", "return"],
|
|
5004
|
+
label: "enter",
|
|
5005
|
+
action: "select",
|
|
5006
|
+
handler: () => {
|
|
5007
|
+
if (onButton) {
|
|
5008
|
+
confirm();
|
|
5009
|
+
return;
|
|
4894
5010
|
}
|
|
4895
|
-
if (options[focused]?.
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
5011
|
+
if (options[focused]?.disabled) return;
|
|
5012
|
+
setSelected((prev) => {
|
|
5013
|
+
const next = new Set(prev);
|
|
5014
|
+
if (next.has(focused)) {
|
|
5015
|
+
next.delete(focused);
|
|
5016
|
+
return next;
|
|
5017
|
+
}
|
|
5018
|
+
if (options[focused]?.exclusive) return new Set([focused]);
|
|
5019
|
+
for (const i of next) if (options[i]?.exclusive) next.delete(i);
|
|
5020
|
+
next.add(focused);
|
|
5021
|
+
return next;
|
|
5022
|
+
});
|
|
5023
|
+
}
|
|
4900
5024
|
}
|
|
4901
|
-
|
|
5025
|
+
];
|
|
4902
5026
|
if (columns > 1) bindings.splice(1, 0, {
|
|
4903
5027
|
match: ["leftArrow", "rightArrow"],
|
|
4904
5028
|
label: "←→",
|
|
@@ -4923,57 +5047,72 @@ const MultiPickerMenu = ({ message, options, centered = false, columns = 1, opti
|
|
|
4923
5047
|
useKeyBindings("multi-picker", bindings);
|
|
4924
5048
|
const columnArrays = [];
|
|
4925
5049
|
for (let c = 0; c < columns; c++) columnArrays.push(options.slice(c * rows, c * rows + rows));
|
|
5050
|
+
const renderOption = (opt, flatIdx) => {
|
|
5051
|
+
const isFocused = !onButton && flatIdx === focused;
|
|
5052
|
+
const isSelected = selected.has(flatIdx);
|
|
5053
|
+
const label = opt.hint ? `${opt.label} (${opt.hint})` : opt.label;
|
|
5054
|
+
const checkbox = isSelected ? Icons.squareFilled : Icons.squareOpen;
|
|
5055
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
5056
|
+
flexDirection: "column",
|
|
5057
|
+
marginBottom: optionMarginBottom,
|
|
5058
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
5059
|
+
gap: 1,
|
|
5060
|
+
children: [
|
|
5061
|
+
/* @__PURE__ */ jsx(Text, {
|
|
5062
|
+
color: isSelected ? "white" : Colors.muted,
|
|
5063
|
+
dimColor: !isFocused && !isSelected,
|
|
5064
|
+
children: checkbox
|
|
5065
|
+
}),
|
|
5066
|
+
opt.icon && /* @__PURE__ */ jsx(Text, {
|
|
5067
|
+
color: opt.icon.color,
|
|
5068
|
+
children: opt.icon.glyph
|
|
5069
|
+
}),
|
|
5070
|
+
/* @__PURE__ */ jsx(Text, {
|
|
5071
|
+
color: opt.disabled ? Colors.muted : isFocused ? Colors.accent : void 0,
|
|
5072
|
+
bold: isFocused && !opt.disabled,
|
|
5073
|
+
dimColor: !isFocused || opt.disabled,
|
|
5074
|
+
children: label
|
|
5075
|
+
})
|
|
5076
|
+
]
|
|
5077
|
+
}), opt.description && /* @__PURE__ */ jsx(Box, {
|
|
5078
|
+
marginLeft: 4,
|
|
5079
|
+
width: DESCRIPTION_WIDTH,
|
|
5080
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
5081
|
+
dimColor: true,
|
|
5082
|
+
wrap: "wrap",
|
|
5083
|
+
children: opt.description
|
|
5084
|
+
})
|
|
5085
|
+
})]
|
|
5086
|
+
}, flatIdx);
|
|
5087
|
+
};
|
|
4926
5088
|
return /* @__PURE__ */ jsxs(Box, {
|
|
4927
5089
|
flexDirection: "column",
|
|
4928
5090
|
alignItems: centered ? "center" : void 0,
|
|
4929
5091
|
children: [
|
|
4930
5092
|
/* @__PURE__ */ jsx(PromptLabel, { message }),
|
|
4931
|
-
/* @__PURE__ */
|
|
5093
|
+
viewport.needsScroll ? /* @__PURE__ */ jsxs(Box, {
|
|
5094
|
+
flexDirection: "column",
|
|
5095
|
+
marginLeft: centered ? 0 : 2,
|
|
5096
|
+
marginTop: message ? 1 : 0,
|
|
5097
|
+
children: [
|
|
5098
|
+
/* @__PURE__ */ jsx(Text, {
|
|
5099
|
+
dimColor: true,
|
|
5100
|
+
children: viewport.hiddenAbove > 0 ? `↑ ${viewport.hiddenAbove} more [P] for previous page` : " "
|
|
5101
|
+
}),
|
|
5102
|
+
options.slice(viewport.start, viewport.end).map((opt, relIdx) => renderOption(opt, viewport.start + relIdx)),
|
|
5103
|
+
/* @__PURE__ */ jsx(Text, {
|
|
5104
|
+
dimColor: true,
|
|
5105
|
+
children: viewport.hiddenBelow > 0 ? `↓ ${viewport.hiddenBelow} more [N] for next page` : " "
|
|
5106
|
+
})
|
|
5107
|
+
]
|
|
5108
|
+
}) : /* @__PURE__ */ jsx(Box, {
|
|
4932
5109
|
flexDirection: "row",
|
|
4933
5110
|
gap: 4,
|
|
4934
5111
|
marginLeft: centered ? 0 : 2,
|
|
4935
|
-
marginTop: 1,
|
|
5112
|
+
marginTop: message ? 1 : 0,
|
|
4936
5113
|
children: columnArrays.map((colOpts, colIdx) => /* @__PURE__ */ jsx(Box, {
|
|
4937
5114
|
flexDirection: "column",
|
|
4938
|
-
children: colOpts.map((opt, rowIdx) =>
|
|
4939
|
-
const flatIdx = colIdx * rows + rowIdx;
|
|
4940
|
-
const isFocused = !onButton && flatIdx === focused;
|
|
4941
|
-
const isSelected = selected.has(flatIdx);
|
|
4942
|
-
const label = opt.hint ? `${opt.label} (${opt.hint})` : opt.label;
|
|
4943
|
-
const checkbox = isSelected ? Icons.squareFilled : Icons.squareOpen;
|
|
4944
|
-
return /* @__PURE__ */ jsxs(Box, {
|
|
4945
|
-
flexDirection: "column",
|
|
4946
|
-
marginBottom: optionMarginBottom,
|
|
4947
|
-
children: [/* @__PURE__ */ jsxs(Box, {
|
|
4948
|
-
gap: 1,
|
|
4949
|
-
children: [
|
|
4950
|
-
/* @__PURE__ */ jsx(Text, {
|
|
4951
|
-
color: isSelected ? "white" : Colors.muted,
|
|
4952
|
-
dimColor: !isFocused && !isSelected,
|
|
4953
|
-
children: checkbox
|
|
4954
|
-
}),
|
|
4955
|
-
opt.icon && /* @__PURE__ */ jsx(Text, {
|
|
4956
|
-
color: opt.icon.color,
|
|
4957
|
-
children: opt.icon.glyph
|
|
4958
|
-
}),
|
|
4959
|
-
/* @__PURE__ */ jsx(Text, {
|
|
4960
|
-
color: opt.disabled ? Colors.muted : isFocused ? Colors.accent : void 0,
|
|
4961
|
-
bold: isFocused && !opt.disabled,
|
|
4962
|
-
dimColor: !isFocused || opt.disabled,
|
|
4963
|
-
children: label
|
|
4964
|
-
})
|
|
4965
|
-
]
|
|
4966
|
-
}), opt.description && /* @__PURE__ */ jsx(Box, {
|
|
4967
|
-
marginLeft: 4,
|
|
4968
|
-
width: 56,
|
|
4969
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
4970
|
-
dimColor: true,
|
|
4971
|
-
wrap: "wrap",
|
|
4972
|
-
children: opt.description
|
|
4973
|
-
})
|
|
4974
|
-
})]
|
|
4975
|
-
}, flatIdx);
|
|
4976
|
-
})
|
|
5115
|
+
children: colOpts.map((opt, rowIdx) => renderOption(opt, colIdx * rows + rowIdx))
|
|
4977
5116
|
}, colIdx))
|
|
4978
5117
|
}),
|
|
4979
5118
|
/* @__PURE__ */ jsx(Box, {
|
|
@@ -5169,7 +5308,7 @@ async function runDoctorCI(options) {
|
|
|
5169
5308
|
getUI().intro("Welcome to the PostHog setup wizard");
|
|
5170
5309
|
getUI().log.info("Running posthog-doctor in CI mode");
|
|
5171
5310
|
try {
|
|
5172
|
-
const { getOrAskForProjectData } = await import("./setup-utils-
|
|
5311
|
+
const { getOrAskForProjectData } = await import("./setup-utils-6qyTDNyd.js").then((n) => n.r);
|
|
5173
5312
|
const { host, accessToken, projectId } = await getOrAskForProjectData({
|
|
5174
5313
|
signup: false,
|
|
5175
5314
|
ci: true,
|
|
@@ -5187,7 +5326,7 @@ async function runDoctorCI(options) {
|
|
|
5187
5326
|
for (const issue of sorted) getUI().log.info(` • [${issue.severity}] ${getKindMeta(issue.kind).title}`);
|
|
5188
5327
|
process.exit(1);
|
|
5189
5328
|
} catch (error) {
|
|
5190
|
-
const { ApiError } = await import("./api-
|
|
5329
|
+
const { ApiError } = await import("./api-BSq9hLu5.js").then((n) => n.n);
|
|
5191
5330
|
const message = error instanceof ApiError && error.statusCode === 401 ? "Your PostHog API key is invalid or expired." : error instanceof Error ? error.message : String(error);
|
|
5192
5331
|
getUI().log.error(`Doctor failed: ${message}`);
|
|
5193
5332
|
process.exit(1);
|
|
@@ -5269,8 +5408,8 @@ function runSlackConnect(argv) {
|
|
|
5269
5408
|
(async () => {
|
|
5270
5409
|
const debug = argv.debug;
|
|
5271
5410
|
try {
|
|
5272
|
-
const { startTUI } = await import("./start-tui-
|
|
5273
|
-
const { buildSession } = await import("./wizard-session-
|
|
5411
|
+
const { startTUI } = await import("./start-tui-DNkm-n-4.js");
|
|
5412
|
+
const { buildSession } = await import("./wizard-session-DsK16SGs.js");
|
|
5274
5413
|
const tui = startTUI(VERSION, Program.SlackConnect);
|
|
5275
5414
|
tui.store.session = buildSession({
|
|
5276
5415
|
debug,
|
|
@@ -5552,6 +5691,6 @@ function resolveInstallDir() {
|
|
|
5552
5691
|
}
|
|
5553
5692
|
Wizard.use(basicIntegrationCommand).use(mcpCommand).use(mcpAnalyticsCommand).use(aiObservabilityCommand).use(cliCommand).use(auditCommand).use(doctorCommand).use(migrateCommand).use(revenueCommand).use(warehouseCommand).use(selfDrivingCommand).use(slackCommand).use(uploadSourcemapsCommand).use(skillCommand).init();
|
|
5554
5693
|
//#endregion
|
|
5555
|
-
export { STRIPE_SDKS as S,
|
|
5694
|
+
export { STRIPE_SDKS as C, POSTHOG_SDKS as S, DISPLAY_NAME as _, useStdoutDimensions as a, fetchHealthIssues as b, runWizardHeadless as c, PROGRAM_REGISTRY as d, Program as f, AUTOMATABLE_VARIANTS as g, SELF_DRIVING_INTEGRATE_PATH_KEY as h, useKeyboardHintsContext as i, runWizardCI as l, detectSelfDrivingIntegrationProjects as m, useKeyBindings as n, ConfirmButton as o, getProgramConfig as p, KeyboardHintsProvider as r, PromptLabel as s, PickerMenu as t, runWizard as u, SOURCE_MAPS_CONTEXT_KEYS as v, getContentBlocks$3 as x, getKindMeta as y };
|
|
5556
5695
|
|
|
5557
5696
|
//# sourceMappingURL=bin.js.map
|