@posthog/wizard 2.80.1 → 2.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -17
- package/dist/README.md +6 -4
- package/dist/{agent-interface-CemBvTAA.js → agent-interface-DMP3DZRd.js} +184 -25
- package/dist/agent-interface-DMP3DZRd.js.map +1 -0
- package/dist/{agent-prompt-loader-DPnj6SwU.js → agent-prompt-loader-BrivWIna.js} +6 -6
- package/dist/{agent-prompt-loader-DPnj6SwU.js.map → agent-prompt-loader-BrivWIna.js.map} +1 -1
- package/dist/{analytics-D21z3E5l.js → analytics-X7JfAmh6.js} +6 -3
- package/dist/analytics-X7JfAmh6.js.map +1 -0
- package/dist/analytics-dcL9EQ4r.js +2 -0
- package/dist/{api-DtGIqQ2U.js → api-BkDwZoL4.js} +3 -2
- package/dist/{api-DtGIqQ2U.js.map → api-BkDwZoL4.js.map} +1 -1
- package/dist/api-BrMGAI-b.js +2 -0
- package/dist/api-key-login-CZEgx2jb.js +2 -0
- package/dist/{api-key-login-h3E2G3zu.js → api-key-login-DE0yKkP4.js} +5 -5
- package/dist/{api-key-login-h3E2G3zu.js.map → api-key-login-DE0yKkP4.js.map} +1 -1
- package/dist/bin.js +2 -2
- package/dist/{bounded-fs-CAsuF6al.js → bounded-fs-iDiqDQ9v.js} +3 -3
- package/dist/{bounded-fs-CAsuF6al.js.map → bounded-fs-iDiqDQ9v.js.map} +1 -1
- package/dist/{ci-install-CEYE02t-.js → ci-install-BAftKh2Z.js} +7 -7
- package/dist/{ci-install-CEYE02t-.js.map → ci-install-BAftKh2Z.js.map} +1 -1
- package/dist/{console-log-O828zyiq.js → console-log-DJiTqYT2.js} +3 -3
- package/dist/{console-log-O828zyiq.js.map → console-log-DJiTqYT2.js.map} +1 -1
- package/dist/{debug-BfQPD2Hg.js → debug-C3tLP-ZW.js} +3 -3
- package/dist/{debug-BfQPD2Hg.js.map → debug-C3tLP-ZW.js.map} +1 -1
- package/dist/{emit-RfAewcWv.js → emit-BqLCdV8Y.js} +2 -1
- package/dist/{emit-RfAewcWv.js.map → emit-BqLCdV8Y.js.map} +1 -1
- package/dist/{errors-CHrJzAZb.js → errors-DhFeR8Sp.js} +3 -3
- package/dist/{errors-CHrJzAZb.js.map → errors-DhFeR8Sp.js.map} +1 -1
- package/dist/{gateway-D3gIlR6b.js → gateway-IQjQ582o.js} +7 -7
- package/dist/{gateway-D3gIlR6b.js.map → gateway-IQjQ582o.js.map} +1 -1
- package/dist/{headless-BJjhP0SI.js → headless-DOhxEmw5.js} +2 -2
- package/dist/{headless-BJjhP0SI.js.map → headless-DOhxEmw5.js.map} +1 -1
- package/dist/{headless-DIX68UUA.js → headless-XNvdWVEp.js} +1 -1
- package/dist/{host-resolution-D8GhEVoX.js → host-resolution-DI2oucSK.js} +4 -4
- package/dist/{host-resolution-D8GhEVoX.js.map → host-resolution-DI2oucSK.js.map} +1 -1
- package/dist/{install-paPCzPHI.js → install-BixbBDLR.js} +41 -55
- package/dist/install-BixbBDLR.js.map +1 -0
- package/dist/{install-Bw8tvDvS.js → install-DaZ6pvEl.js} +1 -1
- package/dist/{interactive-tdxZKWax.js → interactive-WLNQWF0D.js} +3 -3
- package/dist/{interactive-tdxZKWax.js.map → interactive-WLNQWF0D.js.map} +1 -1
- package/dist/{links-Cyj6v8kg.js → links-Bye4fsrj.js} +3 -3
- package/dist/{links-Cyj6v8kg.js.map → links-Bye4fsrj.js.map} +1 -1
- package/dist/{main-0p-YxUNa.js → main-CN8nbuZO.js} +25 -25
- package/dist/main-CN8nbuZO.js.map +1 -0
- package/dist/{mcp-D3Z5MXhA.js → mcp-B2o4d9DS.js} +3 -3
- package/dist/{mcp-D3Z5MXhA.js.map → mcp-B2o4d9DS.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-COVbWnHt.js → mcp-prompt-streaming-COs1DfAm.js} +5 -5
- package/dist/{mcp-prompt-streaming-COVbWnHt.js.map → mcp-prompt-streaming-COs1DfAm.js.map} +1 -1
- package/dist/{models-D1SnCzvl.js → models-Cow22jET.js} +2 -2
- package/dist/{models-D1SnCzvl.js.map → models-Cow22jET.js.map} +1 -1
- package/dist/{non-interactive-DxRBc73O.js → non-interactive-DkldwWDM.js} +4 -4
- package/dist/{non-interactive-DxRBc73O.js.map → non-interactive-DkldwWDM.js.map} +1 -1
- package/dist/{oauth-session-Dde79Ycm.js → oauth-session-Bj_-BY7o.js} +2 -2
- package/dist/{oauth-session-Dde79Ycm.js.map → oauth-session-Bj_-BY7o.js.map} +1 -1
- package/dist/{orchestrator-tools-BSNhzzkT.js → orchestrator-tools-lhFIBGnp.js} +3 -3
- package/dist/{orchestrator-tools-BSNhzzkT.js.map → orchestrator-tools-lhFIBGnp.js.map} +1 -1
- package/dist/{package-manager-BRXlXo0p.js → package-manager-DZ4wcTz3.js} +4 -4
- package/dist/{package-manager-BRXlXo0p.js.map → package-manager-DZ4wcTz3.js.map} +1 -1
- package/dist/{pi-cM_4Gd_9.js → pi-DREdQRPP.js} +15 -15
- package/dist/{pi-cM_4Gd_9.js.map → pi-DREdQRPP.js.map} +1 -1
- package/dist/{playground-DTKy0XHT.js → playground-CJx3lwTH.js} +4 -4
- package/dist/{playground-DTKy0XHT.js.map → playground-CJx3lwTH.js.map} +1 -1
- package/dist/{posthog-integration-bwHwE87a.js → posthog-integration-DDSPdbpw.js} +63 -50
- package/dist/posthog-integration-DDSPdbpw.js.map +1 -0
- package/dist/{programs-SeT1qNik.js → programs-6SFfUBmm.js} +88 -34
- package/dist/programs-6SFfUBmm.js.map +1 -0
- package/dist/programs-DvlhdeM_.js +3 -0
- package/dist/provisioning-CPGWgv7p.js +2 -0
- package/dist/{provisioning-JbJtq7hq.js → provisioning-tRDPH7EQ.js} +4 -4
- package/dist/{provisioning-JbJtq7hq.js.map → provisioning-tRDPH7EQ.js.map} +1 -1
- package/dist/{queue-tools-BIZSJyt6.js → queue-tools-DrJKvFHZ.js} +4 -4
- package/dist/{queue-tools-BIZSJyt6.js.map → queue-tools-DrJKvFHZ.js.map} +1 -1
- package/dist/{results-DtKICAdz.js → results-Crcubw0Q.js} +37 -2
- package/dist/results-Crcubw0Q.js.map +1 -0
- package/dist/{run-DDCvLILJ.js → run-BrIGaPy7.js} +10 -10
- package/dist/run-BrIGaPy7.js.map +1 -0
- package/dist/{run-CDurA5tO.js → run-DVFTMbxf.js} +31 -15
- package/dist/run-DVFTMbxf.js.map +1 -0
- package/dist/{run-tool-DML8JJvt.js → run-tool-CxdPXmlY.js} +37 -21
- package/dist/{run-tool-DML8JJvt.js.map → run-tool-CxdPXmlY.js.map} +1 -1
- package/dist/run-tool-GfISLgEs.js +2 -0
- package/dist/{runners-Dhu4pZTN.js → runners-loOOmHyc.js} +37 -19
- package/dist/runners-loOOmHyc.js.map +1 -0
- package/dist/{security-DEH8Rn0_.js → security-C_grSgIM.js} +44 -52
- package/dist/security-C_grSgIM.js.map +1 -0
- package/dist/{setup-utils-C5-WM-hS.js → setup-utils-BYXbb9NM.js} +3 -3
- package/dist/{setup-utils-C5-WM-hS.js.map → setup-utils-BYXbb9NM.js.map} +1 -1
- package/dist/{start-playground-DL4mVEUx.js → start-playground-Blh0Swil.js} +13 -12
- package/dist/{start-playground-DL4mVEUx.js.map → start-playground-Blh0Swil.js.map} +1 -1
- package/dist/{subagent-CnFvAq6E.js → subagent-DQ_enM8C.js} +7 -7
- package/dist/subagent-DQ_enM8C.js.map +1 -0
- package/dist/{task-BOScSm4W.js → task-Dm9wZbVW.js} +18 -17
- package/dist/task-Dm9wZbVW.js.map +1 -0
- package/dist/{telemetry-CP4rGicd.js → telemetry-NeZhrBeW.js} +2 -2
- package/dist/{telemetry-CP4rGicd.js.map → telemetry-NeZhrBeW.js.map} +1 -1
- package/dist/{terminal-J3OD3dN0.js → terminal-Z4hCXfie.js} +186 -134
- package/dist/terminal-Z4hCXfie.js.map +1 -0
- package/dist/{tools-Cz8tDptL.js → tools-1aM6bI9Y.js} +8 -8
- package/dist/{tools-Cz8tDptL.js.map → tools-1aM6bI9Y.js.map} +1 -1
- package/dist/{tools-CCMV3DmB.js → tools-dUJHRo6X.js} +15 -15
- package/dist/{tools-CCMV3DmB.js.map → tools-dUJHRo6X.js.map} +1 -1
- package/dist/{tui-BUZ2PWqN.js → tui-CCO7VVTA.js} +1 -1
- package/dist/{tui-Csf7VJxt.js → tui-Cmi_ckGg.js} +4 -4
- package/dist/{tui-Csf7VJxt.js.map → tui-Cmi_ckGg.js.map} +1 -1
- package/dist/{upload-step-CEacB2RV.js → upload-step-e2Jp2fcr.js} +3 -3
- package/dist/{upload-step-CEacB2RV.js.map → upload-step-e2Jp2fcr.js.map} +1 -1
- package/dist/{urls-BDELGZHq.js → urls-Cu4RO30x.js} +2 -2
- package/dist/{urls-BDELGZHq.js.map → urls-Cu4RO30x.js.map} +1 -1
- package/dist/{wizard-abort-D3-75KyV.js → wizard-abort-BPEiPCXk.js} +5 -5
- package/dist/{wizard-abort-D3-75KyV.js.map → wizard-abort-BPEiPCXk.js.map} +1 -1
- package/dist/{yara-hooks-CZ1tKxy_.js → yara-hooks-CFD60h78.js} +1 -1
- package/dist/{yara-hooks-D8YDyX7o.js → yara-hooks-canFIYTc.js} +4 -4
- package/dist/{yara-hooks-D8YDyX7o.js.map → yara-hooks-canFIYTc.js.map} +1 -1
- package/package.json +2 -1
- package/dist/agent-interface-CemBvTAA.js.map +0 -1
- package/dist/analytics-B3ROGuIr.js +0 -2
- package/dist/analytics-D21z3E5l.js.map +0 -1
- package/dist/api-IhROOQNv.js +0 -2
- package/dist/api-key-login-OEntFvu5.js +0 -2
- package/dist/install-paPCzPHI.js.map +0 -1
- package/dist/main-0p-YxUNa.js.map +0 -1
- package/dist/posthog-integration-bwHwE87a.js.map +0 -1
- package/dist/programs-BhtyA3lE.js +0 -3
- package/dist/programs-SeT1qNik.js.map +0 -1
- package/dist/provisioning-BcXfeCMc.js +0 -2
- package/dist/results-DtKICAdz.js.map +0 -1
- package/dist/run-CDurA5tO.js.map +0 -1
- package/dist/run-DDCvLILJ.js.map +0 -1
- package/dist/run-tool-CTq9OOdT.js +0 -2
- package/dist/runners-Dhu4pZTN.js.map +0 -1
- package/dist/security-DEH8Rn0_.js.map +0 -1
- package/dist/subagent-CnFvAq6E.js.map +0 -1
- package/dist/task-BOScSm4W.js.map +0 -1
- package/dist/terminal-J3OD3dN0.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as initLogFile, f as VERSION, o as logToFile } from "./debug-
|
|
2
|
-
import { n as analytics } from "./analytics-
|
|
3
|
-
import { a as PostHogDestination, c as buildSession,
|
|
4
|
-
import { t as classifyRunFailure } from "./errors-
|
|
5
|
-
import { n as printAbortOutro } from "./console-log-
|
|
6
|
-
import { m as runCleanups } from "./agent-interface-
|
|
7
|
-
import {
|
|
8
|
-
import { c as flushAnalytics } from "./tools-
|
|
9
|
-
import { n as startHostExit, r as wizardAbort, t as registerShutdown } from "./wizard-abort-
|
|
10
|
-
import { O as displayProgress, _ as getTuiTool, m as isRunFailure, x as abortOnScreens } from "./terminal-
|
|
11
|
-
import { a as startTUI, n as localServicesError, o as oauthCredentials, r as reportFatal, t as driveTuiTool } from "./run-tool-
|
|
1
|
+
import { a as initLogFile, f as VERSION, o as logToFile } from "./debug-C3tLP-ZW.js";
|
|
2
|
+
import { n as analytics } from "./analytics-X7JfAmh6.js";
|
|
3
|
+
import { a as PostHogDestination, c as buildSession, i as createWizardRunSync, k as getProgramConfig, nt as getAuditChecks, o as createFileDestination, r as TaskStreamPush, s as storeInteraction, u as runProgram } from "./programs-6SFfUBmm.js";
|
|
4
|
+
import { t as classifyRunFailure } from "./errors-DhFeR8Sp.js";
|
|
5
|
+
import { n as printAbortOutro } from "./console-log-DJiTqYT2.js";
|
|
6
|
+
import { m as runCleanups } from "./agent-interface-DMP3DZRd.js";
|
|
7
|
+
import { i as ProgramAbort, y as loadWizardFlags } from "./posthog-integration-DDSPdbpw.js";
|
|
8
|
+
import { c as flushAnalytics } from "./tools-dUJHRo6X.js";
|
|
9
|
+
import { n as startHostExit, r as wizardAbort, t as registerShutdown } from "./wizard-abort-BPEiPCXk.js";
|
|
10
|
+
import { O as displayProgress, _ as getTuiTool, m as isRunFailure, x as abortOnScreens } from "./terminal-Z4hCXfie.js";
|
|
11
|
+
import { a as startTUI, n as localServicesError, o as oauthCredentials, r as reportFatal, t as driveTuiTool } from "./run-tool-CxdPXmlY.js";
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
//#region src/tui/workflow.ts
|
|
14
14
|
function tuiWorkflow(store, programId) {
|
|
@@ -41,6 +41,8 @@ function tuiWorkflow(store, programId) {
|
|
|
41
41
|
* intro that hands off to a tool drives the tool's screens instead. The CLI
|
|
42
42
|
* builds the launch values, owns the signals and applies the exit code.
|
|
43
43
|
*/
|
|
44
|
+
/** How long a screen's exit request waits for analytics before it exits anyway. */
|
|
45
|
+
const EXIT_REPORT_BUDGET_MS = 2e3;
|
|
44
46
|
/**
|
|
45
47
|
* Run `config` in the TUI. Resolves with the exit code: the run's, a screen's
|
|
46
48
|
* exit request, a decided failure's through `wizardAbort`, or 130 or 143 on a signal.
|
|
@@ -86,7 +88,20 @@ async function runTui(config, launch) {
|
|
|
86
88
|
const activeTui = tui;
|
|
87
89
|
const { store } = activeTui;
|
|
88
90
|
store.subscribe(() => {
|
|
89
|
-
|
|
91
|
+
const code = store.exitRequest;
|
|
92
|
+
if (code === null || handedOff || exitInProgress || signalled) return;
|
|
93
|
+
exitInProgress = true;
|
|
94
|
+
launch.signal.removeEventListener("abort", onAbort);
|
|
95
|
+
activeTui.unmount();
|
|
96
|
+
const report = async () => {
|
|
97
|
+
try {
|
|
98
|
+
await analytics.shutdown(code === 0 ? "cancelled" : "error");
|
|
99
|
+
} catch {
|
|
100
|
+
logToFile("[run-wizard] exit request shutdown failed");
|
|
101
|
+
}
|
|
102
|
+
await flushAnalytics();
|
|
103
|
+
};
|
|
104
|
+
Promise.race([report(), new Promise((resolve) => setTimeout(resolve, EXIT_REPORT_BUDGET_MS))]).then(() => exit.end(code));
|
|
90
105
|
});
|
|
91
106
|
const session = buildSession(launch.session);
|
|
92
107
|
if (launch.skillId) session.skillId = launch.skillId;
|
|
@@ -101,7 +116,8 @@ async function runTui(config, launch) {
|
|
|
101
116
|
if (!(error instanceof ProgramAbort)) throw error;
|
|
102
117
|
await abortOnScreens(store, {
|
|
103
118
|
code: error.code,
|
|
104
|
-
message: error.message
|
|
119
|
+
message: error.message,
|
|
120
|
+
outroData: error.outroData
|
|
105
121
|
});
|
|
106
122
|
}
|
|
107
123
|
await store.getGate("intro");
|
|
@@ -174,7 +190,7 @@ async function runTui(config, launch) {
|
|
|
174
190
|
const runFailed = isRunFailure(store.session);
|
|
175
191
|
await activeStream.finishRun(runFailed ? "failed" : "completed");
|
|
176
192
|
await store.waitUntil((s) => s.mintHandoff === "exit" || s.skillsComplete);
|
|
177
|
-
if (exit.ended) return;
|
|
193
|
+
if (exit.ended || exitInProgress) return;
|
|
178
194
|
exitInProgress = true;
|
|
179
195
|
await activeStream.shutdown(2e3);
|
|
180
196
|
unregisterShutdown?.();
|
|
@@ -245,4 +261,4 @@ async function runProgramOnScreens(config, store, { credentials, signal }) {
|
|
|
245
261
|
//#endregion
|
|
246
262
|
export { runTui };
|
|
247
263
|
|
|
248
|
-
//# sourceMappingURL=run-
|
|
264
|
+
//# sourceMappingURL=run-DVFTMbxf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-DVFTMbxf.js","names":[],"sources":["../src/tui/workflow.ts","../src/tui/run.ts"],"sourcesContent":["/** The TUI's answers to the steps `runProgram` waits on: its screens, gates and overlays. */\nimport { RunOutcome } from '@programs';\nimport type { ProgramId, ProgramWorkflowConnector } from '@programs/types';\nimport type { WizardStore } from './store.js';\n\nexport function tuiWorkflow(\n store: WizardStore,\n programId: ProgramId,\n): ProgramWorkflowConnector {\n return {\n async confirmStep(step) {\n switch (step.kind) {\n case 'ai-approval':\n // AiOptInRequiredScreen holds here, before any source leaves the machine.\n await store.getGate('ai-opt-in');\n return true;\n case 'service-outage':\n // The health-check screen shows the outage; the run stops.\n store.setReadinessResult(step.readiness);\n return false;\n case 'settings-conflict':\n await store.showSettingsOverride(step.conflicts, step.fix);\n return true;\n case 'run':\n // Each screen before the run's step settles first; a hidden step doesn't run.\n return store.reachStep(step.stepId);\n }\n },\n finishStep(step, result) {\n // Only a composed sub-run that succeeded completes its step; a failed one keeps its tasks for the outro and the stream. The program's run step follows its phase.\n if (\n step.programId !== programId &&\n result.outcome === RunOutcome.Success\n ) {\n store.completeRunStep(step.stepId);\n }\n },\n };\n}\n","/**\n * The TUI host: the full-screen wizard. It renders its screens over its own\n * store, settles the intro, and calls `runProgram` once with the OAuth login,\n * the WizardAsk screen as the answerer and its screens as the workflow. An\n * intro that hands off to a tool drives the tool's screens instead. The CLI\n * builds the launch values, owns the signals and applies the exit code.\n */\nimport { join } from 'node:path';\nimport {\n buildSession,\n createFileDestination,\n createWizardRunSync,\n getAuditChecks,\n getProgramConfig,\n loadWizardFlags,\n PostHogDestination,\n ProgramAbort,\n RunOutcome,\n runProgram,\n storeInteraction,\n TaskStreamPush,\n} from '@programs';\nimport type { CredentialsProvider, ProgramConfig } from '@programs/types';\nimport { classifyRunFailure } from '@shared/errors';\nimport { OutroKind } from '@shared/outro';\nimport { RunPhase } from '@shared/run-state';\nimport { VERSION } from '@shared/version';\nimport { analytics } from '@utils/analytics';\nimport { runCleanups } from '@utils/cleanup';\nimport { initLogFile, logToFile } from '@utils/debug';\nimport { flushAnalytics } from '@utils/flush-analytics';\nimport {\n registerShutdown,\n startHostExit,\n wizardAbort,\n} from '@host/wizard-abort';\nimport { printAbortOutro } from '@shared/console-log';\nimport { getTuiTool } from '@tui/tools/index';\nimport { abortOnScreens } from './abort.js';\nimport { displayProgress } from './agent-progress.js';\nimport { oauthCredentials } from './auth/login.js';\nimport { isRunFailure } from './mint-failure.js';\nimport { driveTuiTool, localServicesError, reportFatal } from './run-tool.js';\nimport { startTUI } from './start-tui.js';\nimport type { WizardStore } from './store.js';\nimport type { TuiLaunch } from './launch.js';\nimport { tuiWorkflow } from './workflow.js';\n\n/** How long a screen's exit request waits for analytics before it exits anyway. */\nconst EXIT_REPORT_BUDGET_MS = 2000;\n\n/**\n * Run `config` in the TUI. Resolves with the exit code: the run's, a screen's\n * exit request, a decided failure's through `wizardAbort`, or 130 or 143 on a signal.\n */\nexport async function runTui(\n config: ProgramConfig,\n launch: TuiLaunch,\n): Promise<number> {\n const exit = startHostExit();\n let tui: ReturnType<typeof startTUI> | null = null;\n let stream: TaskStreamPush | null = null;\n let unregisterShutdown: (() => void) | undefined;\n // A signal cancels the run and any pending question before the exit.\n const runAbort = new AbortController();\n let exitInProgress = false;\n let signalled = false;\n // A tool the intro handed off to ends the run once its analytics flush.\n let handedOff = false;\n\n // Flush a terminal-phase push so the web app sees the run ended in error\n // rather than hanging on the last \"running\" snapshot. Registered before the\n // stream exists: Ctrl-C on the intro must still restore the terminal and run\n // the cleanups, and there is no run to report yet.\n const onSignal = (signal: 'SIGINT' | 'SIGTERM'): void => {\n if (signalled || exitInProgress || exit.ended) return;\n signalled = true;\n runAbort.abort();\n logToFile('[run-wizard] signal received, flushing task stream');\n // Settings restore is sync fs work, so it runs before a flush that may time out.\n runCleanups();\n if (tui?.store.session.runPhase === RunPhase.Running) {\n tui.store.setRunPhase(RunPhase.Error);\n }\n void Promise.all([\n stream?.shutdown(2000, 'cancelled'),\n analytics.shutdown('cancelled'),\n ])\n .catch(() => logToFile('[run-wizard] cancellation shutdown failed'))\n .finally(() => {\n unregisterShutdown?.();\n try {\n tui?.unmount();\n } catch {\n // terminal may already be torn down\n }\n exit.end(signal === 'SIGTERM' ? 143 : 130);\n });\n };\n const onAbort = () =>\n onSignal(launch.signal.reason === 'SIGTERM' ? 'SIGTERM' : 'SIGINT');\n // A signal that landed before this host subscribed ends the run too.\n if (launch.signal.aborted) onAbort();\n else launch.signal.addEventListener('abort', onAbort, { once: true });\n\n // Before the TUI mounts: once Ink owns the alt screen, anything written\n // to it is wiped on unmount (see the catch block below), so an abort here\n // would leave the user on a loading screen with no message.\n const localError = await localServicesError(launch.session.baseUrl);\n if (signalled) return exit.exited;\n if (localError) {\n wizardAbort(\n { present: printAbortOutro, exit },\n { message: localError },\n ).catch((error: unknown) => exit.fail(error));\n return exit.exited;\n }\n\n const main = async (): Promise<void> => {\n // Ink handles Ctrl-C itself in raw mode; it arrives here as an interrupt.\n tui = startTUI(VERSION, config.id, () => onSignal('SIGINT'));\n const activeTui = tui;\n const { store } = activeTui;\n // A screen's exit request unmounts, reports the run's end within a bounded wait, then exits with no stream shutdown.\n store.subscribe(() => {\n const code = store.exitRequest;\n if (code === null || handedOff || exitInProgress || signalled) return;\n exitInProgress = true;\n launch.signal.removeEventListener('abort', onAbort);\n activeTui.unmount();\n const report = async (): Promise<void> => {\n try {\n await analytics.shutdown(code === 0 ? 'cancelled' : 'error');\n } catch {\n logToFile('[run-wizard] exit request shutdown failed');\n }\n await flushAnalytics();\n };\n void Promise.race([\n report(),\n new Promise((resolve) => setTimeout(resolve, EXIT_REPORT_BUDGET_MS)),\n ]).then(() => exit.end(code));\n });\n\n const session = buildSession(launch.session);\n if (launch.skillId) {\n session.skillId = launch.skillId;\n } else if (config.skillId) {\n session.skillId = config.skillId;\n }\n store.launch(session, launch.session, config.id);\n\n const credentials = launch.credentials ?? oauthCredentials(store);\n launch.onStore?.(store);\n\n // Detection, then the intro, where the user may switch program.\n for (;;) {\n try {\n await store.runReadyHooks();\n } catch (error) {\n if (!(error instanceof ProgramAbort)) throw error;\n await abortOnScreens(store, {\n code: error.code,\n message: error.message,\n outroData: error.outroData,\n });\n }\n await store.getGate('intro');\n const active = store.router.activeProgram;\n if (active === config.id) break;\n const tool = getTuiTool(active);\n if (tool) {\n handedOff = true;\n const code = await driveTuiTool(store, tool, {\n toolId: active,\n signal: runAbort.signal,\n });\n if (signalled || exit.ended) return;\n exitInProgress = true;\n launch.signal.removeEventListener('abort', onAbort);\n activeTui.unmount();\n await flushAnalytics();\n exit.end(code);\n return;\n }\n config = getProgramConfig(active);\n }\n\n // After the switch loop, not before: the stream bakes its program id,\n // session id, and event-plan path in at construction, so a stream built\n // for the launch program would report the whole run under a program the\n // user left on the intro screen. Nothing before this point produces a\n // task to push.\n // Consent gates the push, not the dump: `--no-telemetry` still logs.\n const fileDestination = createFileDestination(launch.taskStreamLog);\n const destinations = [\n ...(session.noTelemetry\n ? []\n : [\n new PostHogDestination({\n getCredentials: () => store.session.credentials,\n onError: (err) => logToFile('[task-stream-push]', err.message),\n }),\n ]),\n ...(fileDestination ? [fileDestination] : []),\n ];\n const programConfig = config;\n const activeStream = new TaskStreamPush({\n store: store.sessions,\n getFlags: () => analytics.getCachedWizardFlags(),\n programId: programConfig.streamWorkflowId ?? programConfig.id,\n runSync: createWizardRunSync({\n mode: 'local',\n programId: programConfig.id,\n assignedId: launch.runId,\n noTelemetry: session.noTelemetry,\n getSession: () => store.session,\n }),\n destinations,\n eventPlanPath: programConfig.eventPlanFile\n ? join(session.installDir, programConfig.eventPlanFile)\n : undefined,\n auditChecks: programConfig.auditLedgerFile\n ? () => getAuditChecks(store.session)\n : undefined,\n enabled: destinations.length > 0,\n });\n stream = activeStream;\n activeStream.attach();\n unregisterShutdown = registerShutdown((outcome) => {\n if (store.session.runPhase === RunPhase.Running) {\n store.setRunPhase(RunPhase.Error);\n }\n return activeStream.shutdown(2000, outcome);\n });\n\n await store.getGate('integration-check');\n await store.getGate('health-check');\n\n try {\n await runProgramOnScreens(programConfig, store, {\n credentials,\n signal: runAbort.signal,\n });\n } catch (error) {\n // The run threw before its own error handling rendered an outro.\n // Show the handoff screen and let the user's agent take over.\n const failure = classifyRunFailure(error);\n logToFile('[run-wizard] run failed, handing off:', error);\n runCleanups();\n analytics.captureException(\n error instanceof Error ? error : new Error(String(error)),\n { error_code: failure.code },\n );\n store.showOutroError({\n kind: OutroKind.Error,\n errorCode: failure.code,\n message: failure.message,\n });\n }\n\n if (signalled) return;\n const runFailed = isRunFailure(store.session);\n await activeStream.finishRun(runFailed ? 'failed' : 'completed');\n await store.waitUntil((s) => s.mintHandoff === 'exit' || s.skillsComplete);\n // A screen already ended the run (KeepSkills after a success): start no flush it would cut off.\n if (exit.ended || exitInProgress) return;\n\n exitInProgress = true;\n await activeStream.shutdown(2000);\n unregisterShutdown?.();\n launch.signal.removeEventListener('abort', onAbort);\n if (runFailed) await analytics.shutdown('error');\n activeTui.unmount();\n exit.end(runFailed ? 1 : 0);\n };\n\n main().catch(async (err: unknown) => {\n if (signalled || exit.ended) return;\n // File-log first — the cleanup below can throw or exit.\n logToFile('[run-wizard] FATAL:', err);\n // Run cleanups before anything async so settings are restored even if\n // the stream shutdown hangs.\n runCleanups();\n // The task-stream debounce timer keeps the event loop alive, so\n // we have to drain it before exiting on the error path.\n exitInProgress = true;\n launch.signal.removeEventListener('abort', onAbort);\n try {\n await stream?.shutdown(2000, 'failed');\n } catch {\n // ignore\n }\n unregisterShutdown?.();\n try {\n tui?.unmount();\n } catch {\n // ignore\n }\n reportFatal(err);\n exit.end(1);\n });\n\n return exit.exited;\n}\n\n/**\n * The program's run, answered by the screens: `credentials` logs in, the\n * WizardAsk screen answers, and the flow's screens settle each step. A failure\n * shows its outro and ends the run through `wizardAbort`.\n */\nexport async function runProgramOnScreens(\n config: ProgramConfig,\n store: WizardStore,\n {\n credentials,\n signal,\n }: { credentials: CredentialsProvider; signal?: AbortSignal },\n): Promise<void> {\n initLogFile();\n logToFile(`[agent-runner] START ${config.id} build=${analytics.build}`);\n\n // runProgram turns a throwing capability into a failed run; the TUI shows\n // the handoff for those, so the throw is kept and rethrown.\n let capabilityFailure: { error: unknown } | undefined;\n const keepFailure = <T>(work: Promise<T>): Promise<T> =>\n work.catch((error: unknown) => {\n capabilityFailure ??= { error };\n throw error;\n });\n const result = await runProgram(\n config.id,\n { store: store.sessions, config },\n {\n credentials: {\n resolve: (programId, context) =>\n keepFailure(credentials.resolve(programId, context)),\n },\n interaction: storeInteraction(store.sessions),\n workflow: tuiWorkflow(store, config.id),\n onProgress: displayProgress(store),\n featureFlags: () => keepFailure(loadWizardFlags()),\n signal,\n },\n );\n if (capabilityFailure) throw capabilityFailure.error;\n // A signal cancelled the run; the handler that aborted it settles.\n if (signal?.aborted) return;\n\n if (result.outcome === RunOutcome.Crashed) throw result.failure?.error;\n if (result.outcome !== RunOutcome.Success) {\n if (result.failure?.authErrorDetail) {\n store.showAuthError(result.failure.authErrorDetail);\n }\n // The terminal status follows how the run ended, not whether an Error came back.\n await abortOnScreens(store, {\n ...result.failure,\n status: result.outcome === RunOutcome.Aborted ? 'cancelled' : 'error',\n });\n return;\n }\n // The run already succeeded: a failed flush is logged, never the outcome.\n try {\n await analytics.shutdown('success');\n } catch (error) {\n logToFile('[agent-runner] analytics shutdown failed:', error);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAKA,SAAgB,YACd,OACA,WAC0B;AAC1B,QAAO;EACL,MAAM,YAAY,MAAM;AACtB,WAAQ,KAAK,MAAb;IACE,KAAK;AAEH,WAAM,MAAM,QAAQ,YAAY;AAChC,YAAO;IACT,KAAK;AAEH,WAAM,mBAAmB,KAAK,UAAU;AACxC,YAAO;IACT,KAAK;AACH,WAAM,MAAM,qBAAqB,KAAK,WAAW,KAAK,IAAI;AAC1D,YAAO;IACT,KAAK,MAEH,QAAO,MAAM,UAAU,KAAK,OAAO;;;EAGzC,WAAW,MAAM,QAAQ;AAEvB,OACE,KAAK,cAAc,aACnB,OAAO,YAAA,UAEP,OAAM,gBAAgB,KAAK,OAAO;;EAGvC;;;;;;;;;;;;ACYH,MAAM,wBAAwB;;;;;AAM9B,eAAsB,OACpB,QACA,QACiB;CACjB,MAAM,OAAO,eAAe;CAC5B,IAAI,MAA0C;CAC9C,IAAI,SAAgC;CACpC,IAAI;CAEJ,MAAM,WAAW,IAAI,iBAAiB;CACtC,IAAI,iBAAiB;CACrB,IAAI,YAAY;CAEhB,IAAI,YAAY;CAMhB,MAAM,YAAY,WAAuC;AACvD,MAAI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AAO;GACV,QAAQ,OAAO,YAAA,YAAiC,cAAc;GAC/D,CAAC;AACF;;AAGF,KAAI;AACF,QAAM,UAAU,SAAS,UAAU;UAC5B,OAAO;AACd,YAAU,6CAA6C,MAAM"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { n as ErrorCodes, t as emitWizardError } from "./emit-
|
|
2
|
-
import { f as VERSION, i as getLogFilePath, o as logToFile } from "./debug-
|
|
3
|
-
import { M as POSTHOG_DOCS_URL, O as OAUTH_PORTS, ct as getLocalDev, k as OAUTH_TIMEOUT_MS, n as analytics, rt as getSkillsBaseUrl, st as checkLocalServices, y as GITHUB_SKILLS_BASE_URL } from "./analytics-
|
|
4
|
-
import { c as buildSession, it as
|
|
5
|
-
import { a as WizardError, t as classifyRunFailure } from "./errors-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { n as ErrorCodes, t as emitWizardError } from "./emit-BqLCdV8Y.js";
|
|
2
|
+
import { f as VERSION, i as getLogFilePath, o as logToFile } from "./debug-C3tLP-ZW.js";
|
|
3
|
+
import { M as POSTHOG_DOCS_URL, O as OAUTH_PORTS, ct as getLocalDev, k as OAUTH_TIMEOUT_MS, n as analytics, rt as getSkillsBaseUrl, st as checkLocalServices, y as GITHUB_SKILLS_BASE_URL } from "./analytics-X7JfAmh6.js";
|
|
4
|
+
import { c as buildSession, it as SIGNUP_WIZARD_READINESS_CONFIG, k as getProgramConfig, m as logIn, ot as getBlockingServiceKeys } from "./programs-6SFfUBmm.js";
|
|
5
|
+
import { a as WizardError, t as classifyRunFailure } from "./errors-DhFeR8Sp.js";
|
|
6
|
+
import { r as readFileHead } from "./bounded-fs-iDiqDQ9v.js";
|
|
7
|
+
import { n as printAbortOutro } from "./console-log-DJiTqYT2.js";
|
|
8
|
+
import { T as readNeedsAttention, m as runCleanups, w as NEEDS_ATTENTION_HEADING } from "./agent-interface-DMP3DZRd.js";
|
|
9
|
+
import { A as formatCostUsd, T as scanInstalledSkill, j as formatTokenCount } from "./posthog-integration-DDSPdbpw.js";
|
|
10
|
+
import { _ as downloadSkill, y as fetchSkillMenu } from "./yara-hooks-canFIYTc.js";
|
|
11
|
+
import { n as namesWithStatus, r as redactSecrets, s as toClientResult } from "./results-Crcubw0Q.js";
|
|
12
|
+
import { c as flushAnalytics } from "./tools-dUJHRo6X.js";
|
|
12
13
|
import { t as ALL_FEATURE_VALUES } from "./defaults-DDVl3tKN.js";
|
|
13
|
-
import { n as startHostExit, r as wizardAbort } from "./wizard-abort-
|
|
14
|
-
import { a as installPlugins, i as getSupportedPluginClients, n as getInstalledClients, o as removeMCPServer, r as getSupportedClients, s as isPluginCapable } from "./install-
|
|
14
|
+
import { n as startHostExit, r as wizardAbort } from "./wizard-abort-BPEiPCXk.js";
|
|
15
|
+
import { a as installPlugins, i as getSupportedPluginClients, n as getInstalledClients, o as removeMCPServer, r as getSupportedClients, s as isPluginCapable } from "./install-BixbBDLR.js";
|
|
15
16
|
import { a as useStdoutDimensions, h as Icons, m as Colors, n as useKeyBindings, t as PickerMenu } from "./PickerMenu-BGGeYqd-.js";
|
|
16
|
-
import { B as totalTokenCount, G as ModalOverlay, H as LogViewer, I as HNViewer, J as ProgressList, K as ConfirmationInput, L as TabContainer, M as IntroScreenLayout, N as PRIVACY_PANEL_LABEL, P as PrivacyPanel, Q as getContentBlocks, R as ScreenContainer, T as McpScreen, U as LinkText, V as EventPlanViewer, W as extractUrls, X as SplitView, Y as LoadingBox, _ as getTuiTool, a as SlackConnectScreen, b as extractOAuthCode, c as LearnCard, d as MINT_FAILURE_BODY, f as MINT_FAILURE_CONTACT, g as listFlowOwners, h as flowOwner, i as OutroScreen, k as useDismissOnAnyKey, l as AiOptInRequiredScreen, m as isRunFailure, n as releaseTerminal, o as TipsCard, p as MINT_FAILURE_MESSAGE, r as WizardStore, s as VisualizerTab, t as enterDarkTerminal, u as ServiceHealthList, x as abortOnScreens, y as getOrAskForProjectData } from "./terminal-
|
|
17
|
-
import path from "path";
|
|
17
|
+
import { B as totalTokenCount, G as ModalOverlay, H as LogViewer, I as HNViewer, J as ProgressList, K as ConfirmationInput, L as TabContainer, M as IntroScreenLayout, N as PRIVACY_PANEL_LABEL, P as PrivacyPanel, Q as getContentBlocks, R as ScreenContainer, T as McpScreen, U as LinkText, V as EventPlanViewer, W as extractUrls, X as SplitView, Y as LoadingBox, _ as getTuiTool, a as SlackConnectScreen, b as extractOAuthCode, c as LearnCard, d as MINT_FAILURE_BODY, f as MINT_FAILURE_CONTACT, g as listFlowOwners, h as flowOwner, i as OutroScreen, k as useDismissOnAnyKey, l as AiOptInRequiredScreen, m as isRunFailure, n as releaseTerminal, o as TipsCard, p as MINT_FAILURE_MESSAGE, r as WizardStore, s as VisualizerTab, t as enterDarkTerminal, u as ServiceHealthList, x as abortOnScreens, y as getOrAskForProjectData } from "./terminal-Z4hCXfie.js";
|
|
18
|
+
import path, { join } from "path";
|
|
18
19
|
import { tmpdir } from "node:os";
|
|
19
20
|
import path$1, { join as join$1 } from "node:path";
|
|
20
21
|
import { spawn } from "node:child_process";
|
|
@@ -965,15 +966,15 @@ const RunScreen = ({ store }) => {
|
|
|
965
966
|
label: "Tail logs",
|
|
966
967
|
component: /* @__PURE__ */ jsx(LogViewer, { filePath: getLogFilePath() })
|
|
967
968
|
},
|
|
968
|
-
{
|
|
969
|
-
id: "visualizer",
|
|
970
|
-
label: "Visualizer",
|
|
971
|
-
component: /* @__PURE__ */ jsx(VisualizerTab, { store })
|
|
972
|
-
},
|
|
973
969
|
{
|
|
974
970
|
id: "hn",
|
|
975
971
|
label: "HN",
|
|
976
972
|
component: /* @__PURE__ */ jsx(HNViewer, {})
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
id: "visualizer",
|
|
976
|
+
label: "Visualizer",
|
|
977
|
+
component: /* @__PURE__ */ jsx(VisualizerTab, { store })
|
|
977
978
|
}
|
|
978
979
|
],
|
|
979
980
|
statusMessage: statuses,
|
|
@@ -2199,6 +2200,8 @@ const RESET_ATTRS = "\x1B[0m";
|
|
|
2199
2200
|
const GREEN = "\x1B[32m";
|
|
2200
2201
|
const BOLD = "\x1B[1m";
|
|
2201
2202
|
const DIM = "\x1B[2m";
|
|
2203
|
+
const YELLOW = "\x1B[33m";
|
|
2204
|
+
const REPORT_HEAD_BYTES = 16 * 1024;
|
|
2202
2205
|
/**
|
|
2203
2206
|
* Mirrors the hidden Ctrl+T HUD's tally into post-exit scrollback — but only
|
|
2204
2207
|
* when the HUD is actually visible at exit (`store.tokenHudVisible`, which
|
|
@@ -2225,7 +2228,20 @@ function mcpLoginBlock(store) {
|
|
|
2225
2228
|
if (!commands || commands.length === 0) return null;
|
|
2226
2229
|
return `${GREEN}${BOLD}\u2714 Authenticate to finish (opens your browser):${RESET_ATTRS}\n` + commands.join("\n");
|
|
2227
2230
|
}
|
|
2231
|
+
/** The report's warning items, from the published handoff or else the report file. */
|
|
2232
|
+
function needsAttentionBlock(store) {
|
|
2233
|
+
const reportFile = store.session.outroData?.reportFile;
|
|
2234
|
+
const markdown = store.handoffText ?? (reportFile ? readFileHead(join(store.session.installDir, reportFile), REPORT_HEAD_BYTES) : null);
|
|
2235
|
+
const items = markdown ? readNeedsAttention(markdown) : [];
|
|
2236
|
+
if (items.length === 0) return null;
|
|
2237
|
+
return `${YELLOW}${BOLD}⚠ ${NEEDS_ATTENTION_HEADING}:${RESET_ATTRS}\n` + items.map((item) => ` • ${item}`).join("\n");
|
|
2238
|
+
}
|
|
2228
2239
|
function getExitLine(store) {
|
|
2240
|
+
const attention = isRunFailure(store.session) ? null : needsAttentionBlock(store);
|
|
2241
|
+
const body = exitSummary(store);
|
|
2242
|
+
return attention ? `${attention}\n\n${body}` : body;
|
|
2243
|
+
}
|
|
2244
|
+
function exitSummary(store) {
|
|
2229
2245
|
const outro = store.session.outroData;
|
|
2230
2246
|
const label = store.programLabel ?? "Wizard";
|
|
2231
2247
|
const costLine = tokenCostLine(store);
|
|
@@ -2417,4 +2433,4 @@ function reportFatal(error) {
|
|
|
2417
2433
|
//#endregion
|
|
2418
2434
|
export { startTUI as a, runTuiTool as i, localServicesError as n, oauthCredentials as o, reportFatal as r, driveTuiTool as t };
|
|
2419
2435
|
|
|
2420
|
-
//# sourceMappingURL=run-tool-
|
|
2436
|
+
//# sourceMappingURL=run-tool-CxdPXmlY.js.map
|