@posthog/wizard 2.80.1 → 2.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -17
- package/dist/README.md +6 -4
- package/dist/{agent-interface-CemBvTAA.js → agent-interface-BFzBnz10.js} +184 -25
- package/dist/agent-interface-BFzBnz10.js.map +1 -0
- package/dist/{agent-prompt-loader-DPnj6SwU.js → agent-prompt-loader-CbCW6YbP.js} +6 -6
- package/dist/{agent-prompt-loader-DPnj6SwU.js.map → agent-prompt-loader-CbCW6YbP.js.map} +1 -1
- package/dist/{analytics-D21z3E5l.js → analytics-CGGE7OSa.js} +6 -3
- package/dist/analytics-CGGE7OSa.js.map +1 -0
- package/dist/analytics-D6NAIJxP.js +2 -0
- package/dist/api-DM4uMJ00.js +2 -0
- package/dist/{api-DtGIqQ2U.js → api-ZZhiRtbb.js} +3 -2
- package/dist/{api-DtGIqQ2U.js.map → api-ZZhiRtbb.js.map} +1 -1
- package/dist/api-key-login-C30LRht2.js +2 -0
- package/dist/{api-key-login-h3E2G3zu.js → api-key-login-D0KBr1dx.js} +5 -5
- package/dist/{api-key-login-h3E2G3zu.js.map → api-key-login-D0KBr1dx.js.map} +1 -1
- package/dist/bin.js +2 -2
- package/dist/{bounded-fs-CAsuF6al.js → bounded-fs-DwL2Tasp.js} +3 -3
- package/dist/{bounded-fs-CAsuF6al.js.map → bounded-fs-DwL2Tasp.js.map} +1 -1
- package/dist/{ci-install-CEYE02t-.js → ci-install-DKXrt_ow.js} +7 -7
- package/dist/{ci-install-CEYE02t-.js.map → ci-install-DKXrt_ow.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-sB20p-Ek.js} +3 -3
- package/dist/{debug-BfQPD2Hg.js.map → debug-sB20p-Ek.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-Dg4Fm-nC.js} +7 -7
- package/dist/{gateway-D3gIlR6b.js.map → gateway-Dg4Fm-nC.js.map} +1 -1
- package/dist/{headless-DIX68UUA.js → headless-B3Ol1nkU.js} +1 -1
- package/dist/{headless-BJjhP0SI.js → headless-DhTDC9ga.js} +2 -2
- package/dist/{headless-BJjhP0SI.js.map → headless-DhTDC9ga.js.map} +1 -1
- package/dist/{host-resolution-D8GhEVoX.js → host-resolution-DDYJXiAQ.js} +4 -4
- package/dist/{host-resolution-D8GhEVoX.js.map → host-resolution-DDYJXiAQ.js.map} +1 -1
- package/dist/{install-Bw8tvDvS.js → install-CZeR38cD.js} +1 -1
- package/dist/{install-paPCzPHI.js → install-Dh8Z5R15.js} +41 -55
- package/dist/install-Dh8Z5R15.js.map +1 -0
- package/dist/{interactive-tdxZKWax.js → interactive-hqHk6kz4.js} +3 -3
- package/dist/{interactive-tdxZKWax.js.map → interactive-hqHk6kz4.js.map} +1 -1
- package/dist/{links-Cyj6v8kg.js → links-rMot83W2.js} +3 -3
- package/dist/{links-Cyj6v8kg.js.map → links-rMot83W2.js.map} +1 -1
- package/dist/{main-0p-YxUNa.js → main-DNIeasXx.js} +25 -25
- package/dist/main-DNIeasXx.js.map +1 -0
- package/dist/{mcp-D3Z5MXhA.js → mcp-SZcGfaOz.js} +3 -3
- package/dist/{mcp-D3Z5MXhA.js.map → mcp-SZcGfaOz.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-COVbWnHt.js → mcp-prompt-streaming-BuRMBgbo.js} +5 -5
- package/dist/{mcp-prompt-streaming-COVbWnHt.js.map → mcp-prompt-streaming-BuRMBgbo.js.map} +1 -1
- package/dist/{models-D1SnCzvl.js → models-G1j-wgwe.js} +2 -2
- package/dist/{models-D1SnCzvl.js.map → models-G1j-wgwe.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-C2fVSGfr.js} +2 -2
- package/dist/{oauth-session-Dde79Ycm.js.map → oauth-session-C2fVSGfr.js.map} +1 -1
- package/dist/{orchestrator-tools-BSNhzzkT.js → orchestrator-tools-BchqG7Qi.js} +3 -3
- package/dist/{orchestrator-tools-BSNhzzkT.js.map → orchestrator-tools-BchqG7Qi.js.map} +1 -1
- package/dist/{package-manager-BRXlXo0p.js → package-manager-B3_qSybg.js} +4 -4
- package/dist/{package-manager-BRXlXo0p.js.map → package-manager-B3_qSybg.js.map} +1 -1
- package/dist/{pi-cM_4Gd_9.js → pi-Cw7CPXSl.js} +15 -15
- package/dist/{pi-cM_4Gd_9.js.map → pi-Cw7CPXSl.js.map} +1 -1
- package/dist/{playground-DTKy0XHT.js → playground-CPNrQfb3.js} +4 -4
- package/dist/{playground-DTKy0XHT.js.map → playground-CPNrQfb3.js.map} +1 -1
- package/dist/{posthog-integration-bwHwE87a.js → posthog-integration-FAWfClH3.js} +63 -50
- package/dist/posthog-integration-FAWfClH3.js.map +1 -0
- package/dist/programs-DjCmEcxb.js +3 -0
- package/dist/{programs-SeT1qNik.js → programs-Ml6OLybj.js} +88 -34
- package/dist/programs-Ml6OLybj.js.map +1 -0
- package/dist/{provisioning-JbJtq7hq.js → provisioning-BTVL49jD.js} +4 -4
- package/dist/{provisioning-JbJtq7hq.js.map → provisioning-BTVL49jD.js.map} +1 -1
- package/dist/provisioning-DL0xCJXH.js +2 -0
- package/dist/{queue-tools-BIZSJyt6.js → queue-tools-BQfRI_uD.js} +4 -4
- package/dist/{queue-tools-BIZSJyt6.js.map → queue-tools-BQfRI_uD.js.map} +1 -1
- package/dist/{results-DtKICAdz.js → results-ycm_Tf31.js} +37 -2
- package/dist/results-ycm_Tf31.js.map +1 -0
- package/dist/{run-CDurA5tO.js → run-Bgg-ctbA.js} +31 -15
- package/dist/run-Bgg-ctbA.js.map +1 -0
- package/dist/{run-DDCvLILJ.js → run-C6Ei6vvb.js} +10 -10
- package/dist/run-C6Ei6vvb.js.map +1 -0
- package/dist/{run-tool-DML8JJvt.js → run-tool-CrN2xWzU.js} +32 -16
- package/dist/{run-tool-DML8JJvt.js.map → run-tool-CrN2xWzU.js.map} +1 -1
- package/dist/run-tool-tNjm8S-E.js +2 -0
- package/dist/{runners-Dhu4pZTN.js → runners-GGYJs0Ny.js} +37 -19
- package/dist/runners-GGYJs0Ny.js.map +1 -0
- package/dist/{security-DEH8Rn0_.js → security-C36p8lu6.js} +44 -52
- package/dist/security-C36p8lu6.js.map +1 -0
- package/dist/{setup-utils-C5-WM-hS.js → setup-utils-Dfgse6pY.js} +3 -3
- package/dist/{setup-utils-C5-WM-hS.js.map → setup-utils-Dfgse6pY.js.map} +1 -1
- package/dist/{start-playground-DL4mVEUx.js → start-playground-D0TrdLmc.js} +7 -6
- package/dist/{start-playground-DL4mVEUx.js.map → start-playground-D0TrdLmc.js.map} +1 -1
- package/dist/{subagent-CnFvAq6E.js → subagent-DR5caRzL.js} +7 -7
- package/dist/subagent-DR5caRzL.js.map +1 -0
- package/dist/{task-BOScSm4W.js → task-C1qKgsAf.js} +18 -17
- package/dist/task-C1qKgsAf.js.map +1 -0
- package/dist/{telemetry-CP4rGicd.js → telemetry-Ch9ZJvm7.js} +2 -2
- package/dist/{telemetry-CP4rGicd.js.map → telemetry-Ch9ZJvm7.js.map} +1 -1
- package/dist/{terminal-J3OD3dN0.js → terminal-D20JFN3J.js} +97 -71
- package/dist/terminal-D20JFN3J.js.map +1 -0
- package/dist/{tools-CCMV3DmB.js → tools-BZseGChD.js} +15 -15
- package/dist/{tools-CCMV3DmB.js.map → tools-BZseGChD.js.map} +1 -1
- package/dist/{tools-Cz8tDptL.js → tools-CmSMclOD.js} +8 -8
- package/dist/{tools-Cz8tDptL.js.map → tools-CmSMclOD.js.map} +1 -1
- package/dist/{tui-Csf7VJxt.js → tui-BXe1D0tc.js} +4 -4
- package/dist/{tui-Csf7VJxt.js.map → tui-BXe1D0tc.js.map} +1 -1
- package/dist/{tui-BUZ2PWqN.js → tui-DJf3ZPRh.js} +1 -1
- package/dist/{upload-step-CEacB2RV.js → upload-step-BlAN7MC5.js} +3 -3
- package/dist/{upload-step-CEacB2RV.js.map → upload-step-BlAN7MC5.js.map} +1 -1
- package/dist/{urls-BDELGZHq.js → urls-eFaChZ9d.js} +2 -2
- package/dist/{urls-BDELGZHq.js.map → urls-eFaChZ9d.js.map} +1 -1
- package/dist/{wizard-abort-D3-75KyV.js → wizard-abort-BX3O4Hg4.js} +5 -5
- package/dist/{wizard-abort-D3-75KyV.js.map → wizard-abort-BX3O4Hg4.js.map} +1 -1
- package/dist/{yara-hooks-D8YDyX7o.js → yara-hooks-C4HOysrM.js} +4 -4
- package/dist/{yara-hooks-D8YDyX7o.js.map → yara-hooks-C4HOysrM.js.map} +1 -1
- package/dist/{yara-hooks-CZ1tKxy_.js → yara-hooks-DV4EkkZY.js} +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,5 +1,5 @@
|
|
|
1
|
-
import { o as logToFile } from "./debug-
|
|
2
|
-
import { a as gatewayTerminalFailure } from "./gateway-
|
|
1
|
+
import { o as logToFile } from "./debug-sB20p-Ek.js";
|
|
2
|
+
import { a as gatewayTerminalFailure } from "./gateway-Dg4Fm-nC.js";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
4
|
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
//#region src/agent/runner/harness/pi/subagent.ts
|
|
@@ -10,10 +10,10 @@ import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
|
10
10
|
* about (it can't propagate the parent's disallowedTools into subagents).
|
|
11
11
|
*
|
|
12
12
|
* Controls on every child:
|
|
13
|
-
* - the
|
|
14
|
-
* so the child shares the
|
|
15
|
-
* - a read-only built-in toolset (read/grep/find/ls
|
|
16
|
-
* write/edit
|
|
13
|
+
* - the parent's subagent security gate (canUseTool + YARA, fail-closed, no
|
|
14
|
+
* `rm`) — shared state, so the child shares the tool-call cap and latch;
|
|
15
|
+
* - a read-only built-in toolset (read/grep/find/ls) plus allowlisted bash —
|
|
16
|
+
* no write/edit tools;
|
|
17
17
|
* - no custom tools — no .env writes, and crucially no `dispatch_agent`, so a
|
|
18
18
|
* child cannot recurse (depth is hard-capped at 1).
|
|
19
19
|
*/
|
|
@@ -110,4 +110,4 @@ function createDispatchAgentTool(ctx) {
|
|
|
110
110
|
//#endregion
|
|
111
111
|
export { createDispatchAgentTool };
|
|
112
112
|
|
|
113
|
-
//# sourceMappingURL=subagent-
|
|
113
|
+
//# sourceMappingURL=subagent-DR5caRzL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent-DR5caRzL.js","names":[],"sources":["../src/agent/runner/harness/pi/subagent.ts"],"sourcesContent":["/**\n * Controlled subagent dispatch for pi (#526). pi has no native subagent\n * mechanism, so a subagent is a nested `createAgentSession` we construct — which\n * means WE decide its powers, closing the leak the claude-agent-sdk path warns\n * about (it can't propagate the parent's disallowedTools into subagents).\n *\n * Controls on every child:\n * - the parent's subagent security gate (canUseTool + YARA, fail-closed, no\n * `rm`) — shared state, so the child shares the tool-call cap and latch;\n * - a read-only built-in toolset (read/grep/find/ls) plus allowlisted bash —\n * no write/edit tools;\n * - no custom tools — no .env writes, and crucially no `dispatch_agent`, so a\n * child cannot recurse (depth is hard-capped at 1).\n */\n\nimport { Type } from 'typebox';\nimport { defineTool } from '@earendil-works/pi-coding-agent';\nimport type { ToolDefinition } from '@earendil-works/pi-coding-agent';\nimport { logToFile } from '@utils/debug';\nimport { gatewayTerminalFailure } from './gateway';\nimport type { SubagentSecurityFactory } from './security';\n\n/**\n * Read-only built-ins a subagent may use. bash is supplied separately as the\n * parent's env-scrubbed tool (below), not the built-in, so a subagent's\n * subprocesses are locked down too.\n */\nconst SUBAGENT_TOOLS = ['read', 'grep', 'find', 'ls'];\n\nconst SUBAGENT_SYSTEM_PROMPT = [\n 'You are a read-only research subagent for the PostHog wizard.',\n 'You can read and search files and run safe build/inspect shell commands.',\n 'You cannot edit files, modify .env, or dispatch further subagents.',\n 'Investigate the task you are given and report concise findings as your final message.',\n].join('\\n');\n\nfunction text(s: string): {\n content: [{ type: 'text'; text: string }];\n details: unknown;\n} {\n return { content: [{ type: 'text', text: s }], details: {} };\n}\n\nfunction extractText(message: unknown): string {\n const content = (message as { content?: unknown })?.content;\n if (typeof content === 'string') return content;\n if (Array.isArray(content)) {\n return content\n .filter((c): c is { type: string; text: string } => {\n const b = c as { type?: string; text?: unknown };\n return b?.type === 'text' && typeof b.text === 'string';\n })\n .map((c) => c.text)\n .join('');\n }\n return '';\n}\n\nexport interface SubagentContext {\n /** Resolved gateway model (same as the parent). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n model: import('@earendil-works/pi-ai').Model<any>;\n /** Registry holding the gateway provider. */\n modelRegistry: import('@earendil-works/pi-coding-agent').ModelRegistry;\n cwd: string;\n agentDir: string;\n /** The parent's subagent gate: the same fence and shared state, with no rm. */\n securityFactory: SubagentSecurityFactory;\n /** The parent's env-scrubbed bash, so a subagent's subprocesses are locked down too. */\n bashTool: ToolDefinition;\n /** pi SDK entrypoints, already imported by the backend. */\n sdk: {\n createAgentSession: typeof import('@earendil-works/pi-coding-agent')['createAgentSession'];\n DefaultResourceLoader: typeof import('@earendil-works/pi-coding-agent')['DefaultResourceLoader'];\n SessionManager: typeof import('@earendil-works/pi-coding-agent')['SessionManager'];\n };\n}\n\nexport function createDispatchAgentTool(ctx: SubagentContext): ToolDefinition {\n return defineTool({\n name: 'dispatch_agent',\n label: 'Dispatch subagent',\n description:\n 'Delegate a focused, read-only research subtask to a subagent (e.g. \"find where events are captured\"). The subagent can read/search files and run safe shell, but CANNOT edit files, change .env, or dispatch further subagents. Returns its findings.',\n promptSnippet:\n 'dispatch_agent(description, prompt) — delegate a read-only research subtask',\n parameters: Type.Object({\n description: Type.String({ description: 'Short label for the subtask' }),\n prompt: Type.String({ description: 'Full instruction for the subagent' }),\n }),\n // eslint-disable-next-line @typescript-eslint/require-await -- pi tool contract returns a Promise\n async execute(_id, args) {\n const { createAgentSession, DefaultResourceLoader, SessionManager } =\n ctx.sdk;\n\n const loader = new DefaultResourceLoader({\n cwd: ctx.cwd,\n agentDir: ctx.agentDir,\n systemPrompt: SUBAGENT_SYSTEM_PROMPT,\n noExtensions: true,\n noSkills: true,\n noContextFiles: true,\n noPromptTemplates: true,\n noThemes: true,\n extensionFactories: [ctx.securityFactory as (pi: unknown) => void],\n });\n await loader.reload();\n\n const { session: child } = await createAgentSession({\n model: ctx.model,\n modelRegistry: ctx.modelRegistry,\n cwd: ctx.cwd,\n sessionManager: SessionManager.inMemory(ctx.cwd),\n resourceLoader: loader,\n tools: SUBAGENT_TOOLS, // read-only built-ins; no write/edit, no dispatch_agent\n customTools: [ctx.bashTool], // env-scrubbed bash only (still allowlist-fenced)\n });\n\n let result = '';\n let finalTurn:\n | {\n stopReason?: string;\n errorMessage?: string;\n diagnostics?: {\n error?: { name?: string; code?: string | number };\n }[];\n }\n | undefined;\n const unsub = child.subscribe((e) => {\n if (e.type === 'message_end') {\n if ((e.message as { role?: string })?.role === 'assistant')\n finalTurn = e.message as typeof finalTurn;\n const t = extractText(e.message).trim();\n if (t) result = t;\n }\n });\n logToFile(`[pi] subagent dispatch: ${args.description}`);\n try {\n await child.prompt(args.prompt);\n const failure = gatewayTerminalFailure(finalTurn);\n if (failure) throw new Error(`Subagent failed: ${failure.message}`);\n } finally {\n unsub();\n }\n logToFile(`[pi] subagent \"${args.description}\" → ${result.length} chars`);\n return text(result || 'Subagent completed with no textual result.');\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,iBAAiB;CAAC;CAAQ;CAAQ;CAAQ;CAAK;AAErD,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACD,CAAC,KAAK,KAAK;AAEZ,SAAS,KAAK,GAGZ;AACA,QAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAQ,MAAM;GAAG,CAAC;EAAE,SAAS,EAAE;EAAE;;AAG9D,SAAS,YAAY,SAA0B;CAC7C,MAAM,UAAW,SAAmC;AACpD,KAAI,OAAO,YAAY,SAAU,QAAO;AACxC,KAAI,MAAM,QAAQ,QAAQ,CACxB,QAAO,QACJ,QAAQ,MAA2C;EAClD,MAAM,IAAI;AACV,SAAO,GAAG,SAAS,UAAU,OAAO,EAAE,SAAS;GAC/C,CACD,KAAK,MAAM,EAAE,KAAK,CAClB,KAAK,GAAG;AAEb,QAAO;;AAuBT,SAAgB,wBAAwB,KAAsC;AAC5E,QAAO,WAAW;EAChB,MAAM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orCodes } from "./emit-
|
|
2
|
-
import { o as logToFile } from "./debug-
|
|
3
|
-
import { $ as WIZARD_REMARK_EVENT_NAME, it as wizardUserAgentForProgram, n as analytics } from "./analytics-
|
|
4
|
-
import { t as classifyRunFailure } from "./errors-
|
|
5
|
-
import { n as currentAccessToken } from "./oauth-session-
|
|
6
|
-
import { c as REMARK_INSTRUCTION, d as gatewayAuth, o as withGatewayRemint, r as buildGatewayProvider, t as GATEWAY_PROVIDER } from "./gateway-
|
|
7
|
-
import { h as AgentOutputSignals, v as assembleCommandments } from "./agent-interface-
|
|
8
|
-
import { c as runErrorType, i as lastStatusLine, l as createAioCapture, n as buildScrubbedEnv, o as withMode, r as extractText, s as bindPiCancellation, t as applyOutroMarkers } from "./pi-
|
|
9
|
-
import { g as TaskStatus } from "./queue-tools-
|
|
10
|
-
import { c as queueTools, l as renderToolInventory, r as allowsPostHogMcp } from "./agent-prompt-loader-
|
|
1
|
+
import { n as ErrorCodes } from "./emit-BqLCdV8Y.js";
|
|
2
|
+
import { o as logToFile } from "./debug-sB20p-Ek.js";
|
|
3
|
+
import { $ as WIZARD_REMARK_EVENT_NAME, it as wizardUserAgentForProgram, n as analytics } from "./analytics-CGGE7OSa.js";
|
|
4
|
+
import { t as classifyRunFailure } from "./errors-DhFeR8Sp.js";
|
|
5
|
+
import { n as currentAccessToken } from "./oauth-session-C2fVSGfr.js";
|
|
6
|
+
import { c as REMARK_INSTRUCTION, d as gatewayAuth, o as withGatewayRemint, r as buildGatewayProvider, t as GATEWAY_PROVIDER } from "./gateway-Dg4Fm-nC.js";
|
|
7
|
+
import { h as AgentOutputSignals, v as assembleCommandments } from "./agent-interface-BFzBnz10.js";
|
|
8
|
+
import { c as runErrorType, i as lastStatusLine, l as createAioCapture, n as buildScrubbedEnv, o as withMode, r as extractText, s as bindPiCancellation, t as applyOutroMarkers } from "./pi-Cw7CPXSl.js";
|
|
9
|
+
import { g as TaskStatus } from "./queue-tools-BQfRI_uD.js";
|
|
10
|
+
import { c as queueTools, l as renderToolInventory, r as allowsPostHogMcp } from "./agent-prompt-loader-CbCW6YbP.js";
|
|
11
11
|
//#region src/agent/runner/harness/pi/task.ts
|
|
12
12
|
/**
|
|
13
13
|
* Orchestrator-mode execution on pi: one fresh pi session per unit of work —
|
|
@@ -157,18 +157,19 @@ async function runPiTask(inputs) {
|
|
|
157
157
|
message: "pi: gateway model could not be resolved"
|
|
158
158
|
};
|
|
159
159
|
const askState = { pending: false };
|
|
160
|
-
const { createSecurityExtension } = await import("./security-
|
|
160
|
+
const { createSecurityExtension } = await import("./security-C36p8lu6.js");
|
|
161
161
|
const security = createSecurityExtension({
|
|
162
162
|
disallowedTools: fenceDisallowList(disallowedTools),
|
|
163
163
|
triageProvider: boot.triageProvider,
|
|
164
|
-
getWizardAskPending: () => askState.pending
|
|
164
|
+
getWizardAskPending: () => askState.pending,
|
|
165
|
+
workingDirectory: input.installDir
|
|
165
166
|
});
|
|
166
|
-
const { prewarmYaraScanner } = await import("./yara-hooks-
|
|
167
|
+
const { prewarmYaraScanner } = await import("./yara-hooks-DV4EkkZY.js");
|
|
167
168
|
prewarmYaraScanner();
|
|
168
169
|
const extensionFactories = [security.factory];
|
|
169
170
|
let posthogMcp = false;
|
|
170
171
|
if (allowsPostHogMcp(allowedTools)) try {
|
|
171
|
-
const { setupPostHogMcp } = await import("./mcp-
|
|
172
|
+
const { setupPostHogMcp } = await import("./mcp-SZcGfaOz.js");
|
|
172
173
|
const mcp = await setupPostHogMcp({
|
|
173
174
|
mcpUrl: boot.credentials.host.mcpUrl,
|
|
174
175
|
accessToken: await currentAccessToken(boot.credentials),
|
|
@@ -224,7 +225,7 @@ async function runPiTask(inputs) {
|
|
|
224
225
|
find: () => withMode(createFindToolDefinition(dir), "parallel"),
|
|
225
226
|
grep: () => withMode(createGrepToolDefinition(dir), "parallel")
|
|
226
227
|
}).filter(([name]) => codingTools.has(name)).map(([, make]) => make());
|
|
227
|
-
const { createWizardPiTools } = await import("./tools-
|
|
228
|
+
const { createWizardPiTools } = await import("./tools-CmSMclOD.js");
|
|
228
229
|
const wizardToolNames = allowedPiWizardTools(allowedTools);
|
|
229
230
|
const wizardTools = createWizardPiTools({
|
|
230
231
|
workingDirectory: dir,
|
|
@@ -237,7 +238,7 @@ async function runPiTask(inputs) {
|
|
|
237
238
|
askState.pending = pending;
|
|
238
239
|
}
|
|
239
240
|
}).filter((t) => wizardToolNames.has(t.name));
|
|
240
|
-
const { createPiOrchestratorTools } = await import("./orchestrator-tools-
|
|
241
|
+
const { createPiOrchestratorTools } = await import("./orchestrator-tools-BchqG7Qi.js");
|
|
241
242
|
const queueTools = createPiOrchestratorTools(orchestrator).filter((t) => orchestratorTools.has(t.name));
|
|
242
243
|
const customTools = [
|
|
243
244
|
...codingToolDefs,
|
|
@@ -433,4 +434,4 @@ async function runPiTask(inputs) {
|
|
|
433
434
|
//#endregion
|
|
434
435
|
export { runPiTask };
|
|
435
436
|
|
|
436
|
-
//# sourceMappingURL=task-
|
|
437
|
+
//# sourceMappingURL=task-C1qKgsAf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-C1qKgsAf.js","names":[],"sources":["../src/agent/runner/harness/pi/task.ts"],"sourcesContent":["/**\n * Orchestrator-mode execution on pi: one fresh pi session per unit of work —\n * the seed plan, or one drained task. The linear pipeline's concerns (skill\n * menu, todo panel, event-plan cleanup) stay in `index.ts`; this module builds\n * the leaner per-task session: gateway model, security fence, the task's\n * allowed coding tools, the wizard env tools, and the in-process orchestrator\n * queue tools.\n *\n * The task's `allowedTools` / `disallowedTools` arrive in the wizard's tool\n * vocabulary (`Read`, `Edit`, `Glob`, …, plus MCP-qualified orchestrator names\n * from `agentRunTools`). pi is where they become real: allowed names decide\n * which pi tool definitions get registered at all, and the disallow list is\n * ALSO handed to the security fence, so a name that never got registered stays\n * blocked even if the model hallucinates it.\n *\n * Loaded lazily from `index.ts` (typebox/ESM constraint, same as tools.ts).\n */\n\nimport { logToFile } from '@utils/debug';\nimport { analytics } from '@utils/analytics';\nimport {\n Harness,\n Sequence,\n WIZARD_REMARK_EVENT_NAME,\n wizardUserAgentForProgram,\n} from '@shared/constants';\nimport {\n allowsPostHogMcp,\n queueTools,\n renderToolInventory,\n} from '../../../agent-prompt-loader';\nimport { AgentErrorType } from '../../../agent-interface';\nimport { REMARK_INSTRUCTION } from '../../../signals';\nimport { AgentOutputSignals } from '../../../output-signals';\nimport { TaskStatus } from '../../sequence/orchestrator/queue';\nimport type { OrchestratorToolsContext } from '../../sequence/orchestrator/queue-tools';\nimport type { AgentResult, TaskRunInputs } from '../types';\nimport { gatewayAuth, type GatewayAuth } from '../../../gateway-session';\nimport { currentAccessToken } from '@shared/oauth-session';\nimport {\n buildGatewayProvider,\n GATEWAY_PROVIDER,\n withGatewayRemint,\n} from './gateway';\nimport { runErrorType } from './completion';\nimport { bindPiCancellation } from './cancellation';\nimport { classifyRunFailure, ErrorCodes } from '@shared/errors';\nimport { assembleCommandments } from '../../switchboard/commandments';\nimport {\n applyOutroMarkers,\n buildScrubbedEnv,\n extractText,\n lastStatusLine,\n withMode,\n} from './index';\nimport { createAioCapture } from '../../../aio-capture';\n\n/** wizard tool vocabulary → the pi tool definitions it unlocks. */\nconst CODING_TOOL_MAP: Record<string, readonly string[]> = {\n Read: ['read'],\n Edit: ['edit'],\n Write: ['write'],\n Bash: ['bash'],\n Glob: ['find', 'ls'],\n Grep: ['grep'],\n};\n\n/** `mcp__wizard-tools__wizard_ask` → `wizard_ask`; native names pass through. */\nfunction shortToolName(name: string): string {\n return name.replace(/^mcp__.+?__/, '');\n}\n\n/**\n * The pi coding tools a task may use. An empty allow list means \"no\n * restriction\" (mirrors the SDK), so every coding tool registers.\n */\nexport function allowedPiCodingTools(\n allowedTools: readonly string[] | undefined,\n): Set<string> {\n const allowed = (allowedTools ?? []).map(shortToolName);\n const names = allowed.length\n ? allowed.flatMap((name) => CODING_TOOL_MAP[name] ?? [])\n : Object.values(CODING_TOOL_MAP).flat();\n return new Set(names);\n}\n\n/**\n * The orchestrator queue tools this agent gets. Everything not disallowed:\n * the seed's frontmatter disallows `complete_task` (it is not a task), a\n * task's disallows `enqueue_task` (the seed owns the graph).\n */\nexport function allowedOrchestratorTools(\n disallowedTools: readonly string[] | undefined,\n): Set<string> {\n return new Set(queueTools(disallowedTools ?? []));\n}\n\n/**\n * The wizard tools a task gets. Four are always on — their handlers are fenced\n * and the coding tasks depend on them. The rest are opt-in per task through\n * its frontmatter: `wizard_ask` stops the run until a person answers, and the\n * skill-menu pair (`load_skill_menu`, `install_skill`) lets a task pull its\n * own skill variant.\n */\nconst ALWAYS_ON_WIZARD_TOOLS = [\n 'check_env_keys',\n 'set_env_values',\n 'detect_package_manager',\n 'publish_handoff',\n];\n\nconst OPT_IN_WIZARD_TOOLS = [\n 'wizard_ask',\n 'load_skill_menu',\n 'install_skill',\n // Audit programs only: they declare the ledger tools on `allowedTools`.\n 'audit_seed_checks',\n 'audit_add_checks',\n 'audit_resolve_checks',\n];\n\nexport function allowedPiWizardTools(\n allowedTools: readonly string[] | undefined,\n): Set<string> {\n const allowed = (allowedTools ?? []).map(shortToolName);\n return new Set([\n ...ALWAYS_ON_WIZARD_TOOLS,\n ...OPT_IN_WIZARD_TOOLS.filter((tool) => allowed.includes(tool)),\n ]);\n}\n\n/**\n * The disallow list for the security fence: the wizard-vocabulary names as\n * given (the fence translates pi built-ins to the same vocabulary) plus the\n * short names, so a disallowed orchestrator tool is blocked under the name pi\n * would call it by.\n */\nexport function fenceDisallowList(\n disallowedTools: readonly string[] | undefined,\n): string[] {\n const names = disallowedTools ?? [];\n return [...new Set([...names, ...names.map(shortToolName)])];\n}\n\n/** Nudges when the session returns without the work reaching a terminal state. */\nconst MAX_TASK_NUDGES = 3;\n\nconst TASK_NUDGE =\n 'You have not called complete_task yet. Finish your task now: if the work is done, call complete_task with your handoff; if it cannot be done, call it with status \"failed\" or \"not needed\" and say why.';\n\nconst SEED_NUDGE =\n 'The queue is still empty. Seed it now with enqueue_task calls for the task graph you planned.';\n\n/** Whether this unit of work has reached its terminal state. */\nfunction isSettled(ctx: OrchestratorToolsContext): boolean {\n if (!ctx.currentTaskId) {\n // The seed's job is a seeded queue, not a complete_task call.\n return ctx.store.list().length > 0;\n }\n const task = ctx.store.get(ctx.currentTaskId);\n return (\n !!task &&\n (task.status === TaskStatus.Done ||\n task.status === TaskStatus.Failed ||\n task.status === TaskStatus.Skipped)\n );\n}\n\nexport async function runPiTask(inputs: TaskRunInputs): Promise<AgentResult> {\n if (inputs.signal?.aborted) {\n return {\n kind: 'abort',\n classification: AgentErrorType.ABORT,\n message: 'Agent run cancelled',\n };\n }\n const {\n config,\n input,\n boot,\n emit,\n prompt,\n spinner,\n model: modelId,\n effort,\n allowedTools,\n disallowedTools,\n askBridge,\n orchestrator,\n spinnerMessage,\n successMessage,\n errorMessage,\n requestRemark,\n analyticsProperties,\n } = inputs;\n\n if (spinnerMessage) spinner.start(spinnerMessage);\n\n const capture = createAioCapture({\n enabled: input.flags.captureAio,\n projectApiKey: boot.credentials.projectApiKey,\n apiHost: boot.credentials.host.apiHost,\n runTags: boot.wizardMetadata,\n });\n\n const startTime = Date.now();\n const signals = new AgentOutputSignals();\n let assistantTurns = 0;\n const runDurations = () => {\n const durationMs = Date.now() - startTime;\n return {\n duration_ms: durationMs,\n duration_seconds: Math.round(durationMs / 1000),\n };\n };\n // How this task run failed: the closed AgentErrorType it is about to return.\n // Without it every terminal path below — a security termination, a rate\n // limit, a gateway error — arrived as the same unlabelled event, so a task\n // agent that died could be counted but not diagnosed. A security stop is not\n // an error, hence \"failure mode\" over \"error\".\n //\n // Not `reason`: the linear sequence emits this same event with a `reason`\n // holding the agent's free-text [ABORT] string, and one property cannot be\n // both a closed enum and unbounded prose without making either unreadable.\n const captureAborted = (failureMode: AgentErrorType) =>\n analytics.wizardCapture('agent aborted', {\n failure_mode: failureMode,\n ...runDurations(),\n model: modelId,\n ...analyticsProperties,\n });\n\n let mcpCleanup: (() => void) | undefined;\n let aioFailed = true;\n let cancellation: ReturnType<typeof bindPiCancellation> | undefined;\n try {\n const sdk = await import('@earendil-works/pi-coding-agent');\n const {\n createAgentSession,\n DefaultResourceLoader,\n SessionManager,\n AuthStorage,\n ModelRegistry,\n getAgentDir,\n createLsToolDefinition,\n createFindToolDefinition,\n createGrepToolDefinition,\n createBashToolDefinition,\n createReadToolDefinition,\n createEditToolDefinition,\n createWriteToolDefinition,\n } = sdk;\n\n // Reads the live OAuth token, so a mid-run rotation re-mints on the new one.\n const refreshAuth = async () =>\n gatewayAuth(\n boot.credentials.host,\n await currentAccessToken(boot.credentials),\n boot.programId,\n );\n const auth = await refreshAuth();\n const providerInputs = (current: GatewayAuth) => ({\n gatewayUrl: current.gatewayUrl,\n accessToken: current.token,\n teamId: current.teamId,\n wizardMetadata: boot.wizardMetadata,\n wizardFlags: boot.wizardFlags,\n modelId,\n // Per-task agents own their effort via the prompt frontmatter, falling\n // back to the model table.\n effort,\n });\n const { provider, caps } = buildGatewayProvider(providerInputs(auth));\n const registry = ModelRegistry.inMemory(AuthStorage.create());\n registry.registerProvider(GATEWAY_PROVIDER, provider as never);\n const model = registry.find(GATEWAY_PROVIDER, modelId);\n if (!model) {\n return {\n kind: 'failure',\n classification: AgentErrorType.API_ERROR,\n message: 'pi: gateway model could not be resolved',\n };\n }\n\n // Shared flag: true while a wizard_ask overlay is open. The ask tool sets\n // it (onAskPendingChange, below); the security fence reads it to pause\n // Write/Edit until the answer comes back. Wired the same way as the linear\n // pi run — without it the warehouse task could mutate files while its\n // credential prompt sits open (up to LONGER_ASK_TIMEOUT_MS).\n const askState = { pending: false };\n\n // The same fail-closed fence as the linear run, with the task's disallow\n // list layered in (both the wizard-vocabulary and pi-short names).\n const { createSecurityExtension } = await import('./security');\n const security = createSecurityExtension({\n disallowedTools: fenceDisallowList(disallowedTools),\n triageProvider: boot.triageProvider,\n getWizardAskPending: () => askState.pending,\n workingDirectory: input.installDir,\n });\n const { prewarmYaraScanner } = await import('../../../yara-hooks');\n void prewarmYaraScanner();\n\n // PostHog MCP, for the tasks whose prompt requests it. Tasks that never\n // asked skip the handshake and never see a posthog tool.\n const extensionFactories = [security.factory] as Array<\n (pi: unknown) => void\n >;\n let posthogMcp = false;\n if (allowsPostHogMcp(allowedTools)) {\n try {\n const { setupPostHogMcp } = await import('./mcp');\n const mcp = await setupPostHogMcp({\n mcpUrl: boot.credentials.host.mcpUrl,\n accessToken: await currentAccessToken(boot.credentials),\n // Same `program:` marker as the linear run, so a task's MCP writes are\n // attributed to the program that queued it. `anthropic/index.ts` uses\n // `programId` as the label on the task path too.\n userAgent: wizardUserAgentForProgram(config.programId),\n });\n extensionFactories.push(mcp.extensionFactory);\n mcpCleanup = mcp.cleanup;\n posthogMcp = true;\n } catch (err) {\n try {\n mcpCleanup?.();\n } catch {\n /* Setup cleanup is best effort. */\n }\n mcpCleanup = undefined;\n // Silent here reads as a task failure minutes later: a task that asked\n // for this tool can only skip or fail without it.\n logToFile(`[pi-task] PostHog MCP setup skipped: ${String(err)}`);\n analytics.wizardCapture('mcp setup failed', {\n harness: 'pi',\n scope: 'task',\n error: String(err).slice(0, 300),\n });\n }\n }\n\n const codingTools = allowedPiCodingTools(allowedTools);\n const orchestratorTools = allowedOrchestratorTools(disallowedTools);\n\n const resourceLoader = new DefaultResourceLoader({\n cwd: input.installDir,\n agentDir: getAgentDir(),\n systemPrompt: assembleCommandments({\n program: config.programId,\n sequence: Sequence.orchestrator,\n harness: Harness.pi,\n caps: { bash: codingTools.has('bash'), posthogMcp },\n }),\n noExtensions: true,\n noSkills: true,\n noContextFiles: true,\n noPromptTemplates: true,\n noThemes: true,\n extensionFactories,\n });\n await resourceLoader.reload();\n\n // The task's coding tools, gated by its allow list. Reads and searches run\n // in parallel; mutating tools stay sequential. Bash subprocesses get the\n // scrubbed env, same as the linear run.\n const dir = input.installDir;\n const codingToolFactories = {\n read: () => withMode(createReadToolDefinition(dir), 'parallel'),\n edit: () => withMode(createEditToolDefinition(dir), 'sequential'),\n write: () => withMode(createWriteToolDefinition(dir), 'sequential'),\n bash: () =>\n withMode(\n createBashToolDefinition(dir, {\n spawnHook: (ctx) => ({ ...ctx, env: buildScrubbedEnv() }),\n }),\n 'sequential',\n ),\n ls: () => withMode(createLsToolDefinition(dir), 'parallel'),\n find: () => withMode(createFindToolDefinition(dir), 'parallel'),\n grep: () => withMode(createGrepToolDefinition(dir), 'parallel'),\n } as const;\n const codingToolDefs = Object.entries(codingToolFactories)\n .filter(([name]) => codingTools.has(name))\n .map(([, make]) => make());\n\n // Wizard env + package-manager tools are always on — their handlers are\n // fenced, and init/build tasks depend on them. publish_handoff rides\n // along (it only emits) so the report task can publish the handoff; every\n // other task is told, on the call, that it still owes a complete_task.\n const { createWizardPiTools } = await import('./tools');\n const wizardToolNames = allowedPiWizardTools(allowedTools);\n const wizardTools = createWizardPiTools({\n workingDirectory: dir,\n skillsBaseUrl: boot.skillsBaseUrl,\n triageProvider: boot.triageProvider,\n emit,\n taskAgent: orchestrator.currentTaskId !== undefined,\n // Present only for a task allowed to ask; without it wizard_ask errors\n // instead of hanging on a prompt nobody will ever see.\n askBridge,\n // Pause Write/Edit while the ask overlay is open (see askState above).\n onAskPendingChange: (pending) => {\n askState.pending = pending;\n },\n }).filter((t) => wizardToolNames.has(t.name));\n\n const { createPiOrchestratorTools } = await import('./orchestrator-tools');\n const queueTools = createPiOrchestratorTools(orchestrator).filter((t) =>\n orchestratorTools.has(t.name),\n );\n\n const customTools = [...codingToolDefs, ...wizardTools, ...queueTools];\n const { session: agentSession } = await createAgentSession({\n model,\n modelRegistry: registry,\n thinkingLevel: caps.thinkingLevel,\n cwd: dir,\n sessionManager: SessionManager.inMemory(dir),\n resourceLoader,\n noTools: 'builtin',\n customTools,\n });\n cancellation = bindPiCancellation(inputs.signal, agentSession, (error) => {\n logToFile(`[pi-task] abort failed: ${String(error)}`);\n });\n await agentSession.bindExtensions({});\n\n // A turn that ends on a 401 from an aged bearer re-mints once and\n // continues with the nudge the task would get anyway.\n const turns = withGatewayRemint({\n signal: inputs.signal,\n session: agentSession,\n registry,\n auth,\n refreshAuth,\n providerInputs,\n continueText: () =>\n orchestrator.currentTaskId ? TASK_NUDGE : SEED_NUDGE,\n onRemint: () => {\n logToFile('[pi-task] gateway token renewed after a 401; continuing');\n analytics.wizardCapture('gateway token reminted', { harness: 'pi' });\n },\n });\n\n // The one complete list: exactly the tools registered on this session, in\n // the names the agent will call them by. posthog_exec binds as an extension.\n const toolNames = [\n ...customTools.map((t) => t.name),\n ...(posthogMcp ? ['posthog_exec'] : []),\n ];\n logToFile(`[pi-task] tools passed to model: ${toolNames.join(', ')}`);\n const taskPrompt = `${prompt}\\n\\n${renderToolInventory(toolNames)}`;\n\n const unsubscribe = agentSession.subscribe((event) => {\n // Mirror the turn into AIO. No-op when --capture-aio is off. Runs\n // before the role guard so the module's own filter is authoritative.\n capture.captureFromPiMessageEndEvent(event);\n\n switch (event.type) {\n case 'message_end': {\n // User prompts also emit message_end; only assistant turns count.\n if ((event.message as { role?: string })?.role !== 'assistant') {\n break;\n }\n assistantTurns += 1;\n turns.noteAssistantTurn(event.message);\n const assistant = extractText(event.message).trim();\n if (assistant) {\n logToFile(`[pi-task] assistant: ${assistant.slice(0, 1000)}`);\n applyOutroMarkers(assistant, emit);\n const statusText = lastStatusLine(assistant);\n if (statusText) {\n emit({ kind: 'status', message: statusText });\n spinner.message(statusText);\n }\n for (const line of assistant.split('\\n')) signals.push(line);\n }\n break;\n }\n case 'tool_execution_start': {\n const args = JSON.stringify(event.args ?? {}).slice(0, 200);\n logToFile(`[pi-task] → ${event.toolName} ${args}`);\n break;\n }\n case 'tool_execution_end': {\n if (event.isError) {\n const detail =\n typeof event.result === 'string'\n ? event.result\n : JSON.stringify(event.result ?? '');\n logToFile(`[pi-task] ✗ ${event.toolName}: ${detail.slice(0, 300)}`);\n }\n break;\n }\n default:\n break;\n }\n });\n\n // Seed AIO capture with this task's prompt — includes any handoff data\n // from prior tasks (the orchestrator bakes it into the prompt string\n // before it reaches this call site).\n capture.setInitialPrompt(taskPrompt);\n\n let terminal = turns.terminalFailure();\n try {\n if (inputs.signal?.aborted)\n return {\n kind: 'abort',\n classification: AgentErrorType.ABORT,\n message: 'Agent run cancelled',\n };\n await turns.prompt(taskPrompt);\n terminal = turns.terminalFailure();\n\n // pi's prompt() resolves the moment a turn carries no tool call — which\n // an agent mid-plan does emit. While the work has not reached its\n // terminal state (task not reported, seed queue still empty), nudge.\n let nudges = 0;\n while (\n nudges < MAX_TASK_NUDGES &&\n !security.state.criticalViolation &&\n !inputs.signal?.aborted &&\n !terminal &&\n !isSettled(orchestrator)\n ) {\n nudges += 1;\n logToFile(\n `[pi-task] completion guard: not settled, nudge ${nudges}/${MAX_TASK_NUDGES}`,\n );\n await turns.prompt(\n orchestrator.currentTaskId ? TASK_NUDGE : SEED_NUDGE,\n );\n terminal = turns.terminalFailure();\n }\n\n if (\n requestRemark &&\n !security.state.criticalViolation &&\n !terminal &&\n !inputs.signal?.aborted\n ) {\n try {\n await agentSession.prompt(REMARK_INSTRUCTION);\n } catch (err) {\n logToFile(`[pi-task] remark request failed: ${String(err)}`);\n }\n }\n } finally {\n try {\n unsubscribe();\n } catch {\n /* Keep the terminal result. */\n }\n }\n\n if (inputs.signal?.aborted) {\n return {\n kind: 'abort',\n classification: AgentErrorType.ABORT,\n message: 'Agent run cancelled',\n };\n }\n\n if (terminal && !security.state.criticalViolation) {\n if (errorMessage || spinnerMessage)\n spinner.stop(errorMessage ?? 'Task failed');\n captureAborted(terminal.classification);\n if (terminal.status === 401) {\n return {\n kind: 'decided_failure',\n failure: {\n code: ErrorCodes.AuthInvalidOrExpired,\n message: 'Authentication failed (401)',\n detail: { providerMessage: terminal.message },\n },\n };\n }\n return terminal.classification === AgentErrorType.ABORT\n ? {\n kind: 'abort',\n classification: AgentErrorType.ABORT,\n message: terminal.message,\n }\n : {\n kind: 'failure',\n classification: terminal.classification,\n message: terminal.message,\n };\n }\n\n if (security.state.criticalViolation) {\n spinner.stop('Security violation detected');\n logToFile(\n `[pi-task] terminated: YARA violation (blocked ${security.state.blockedCount} call(s))`,\n );\n captureAborted(AgentErrorType.YARA_VIOLATION);\n return { kind: 'failure', classification: AgentErrorType.YARA_VIOLATION };\n }\n\n const remark = signals.remark();\n if (remark) {\n analytics.capture(WIZARD_REMARK_EVENT_NAME, { remark });\n }\n\n const stats = agentSession.getSessionStats();\n const durations = runDurations();\n analytics.wizardCapture('agent completed', {\n ...durations,\n model: modelId,\n num_turns: assistantTurns,\n input_tokens: stats.tokens.input,\n output_tokens: stats.tokens.output,\n cache_creation_input_tokens: stats.tokens.cacheWrite,\n cache_read_input_tokens: stats.tokens.cacheRead,\n ...analyticsProperties,\n });\n // Per-task usage on one parseable line so a run's per-task time and cost are\n // observable from the log, not only from analytics.\n const taskType =\n typeof (analyticsProperties as { task_type?: unknown })?.task_type ===\n 'string'\n ? (analyticsProperties as { task_type: string }).task_type\n : modelId;\n logToFile(\n `[pi-task] usage task=${taskType} model=${modelId} effort=${caps.thinkingLevel} dur=${durations.duration_seconds}s turns=${assistantTurns} in=${stats.tokens.input} out=${stats.tokens.output} cacheR=${stats.tokens.cacheRead} cacheW=${stats.tokens.cacheWrite}`,\n );\n if (successMessage) spinner.stop(successMessage);\n aioFailed = false;\n return { kind: 'success' };\n } catch (err) {\n if (inputs.signal?.aborted) {\n return {\n kind: 'abort',\n classification: AgentErrorType.ABORT,\n message: 'Agent run cancelled',\n };\n }\n const message = err instanceof Error ? err.message : String(err);\n logToFile(`[pi-task] run error: ${message}`);\n if (errorMessage || spinnerMessage) {\n spinner.stop(errorMessage ?? 'Task failed');\n }\n const coded = classifyRunFailure(err);\n if (coded.coded && err instanceof Error) {\n captureAborted(AgentErrorType.API_ERROR);\n return {\n kind: 'decided_failure',\n failure: { code: coded.code, message: coded.message, error: err },\n };\n }\n const classification = runErrorType(message);\n captureAborted(classification);\n return {\n kind: 'failure',\n classification,\n message,\n error: err instanceof Error ? err : undefined,\n };\n } finally {\n await cancellation?.settle();\n try {\n mcpCleanup?.();\n } catch {\n /* Keep the terminal result. */\n }\n try {\n capture.finishPiRun(aioFailed);\n } catch {\n /* Telemetry is best effort. */\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,kBAAqD;CACzD,MAAM,CAAC,OAAO;CACd,MAAM,CAAC,OAAO;CACd,OAAO,CAAC,QAAQ;CAChB,MAAM,CAAC,OAAO;CACd,MAAM,CAAC,QAAQ,KAAK;CACpB,MAAM,CAAC,OAAO;CACf;;AAGD,SAAS,cAAc,MAAsB;AAC3C,QAAO,KAAK,QAAQ,eAAe,GAAG;;;;;;AAOxC,SAAgB,qBACd,cACa;CACb,MAAM,WAAW,gBAAgB,EAAE,EAAE,IAAI,cAAc;CACvD,MAAM,QAAQ,QAAQ,SAClB,QAAQ,SAAS,SAAS,gBAAgB,SAAS,EAAE,CAAC,GACtD,OAAO,OAAO,gBAAgB,CAAC,MAAM;AACzC,QAAO,IAAI,IAAI,MAAM;;;;;;;AAQvB,SAAgB,yBACd,iBACa;AACb,QAAO,IAAI,IAAI,WAAW,mBAAmB,EAAE,CAAC,CAAC;;;;;;;;;AAUnD,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACD;AAED,MAAM,sBAAsB;CAC1B;CACA;CACA;CAEA;CACA;CACA;CACD;AAED,SAAgB,qBACd,cACa;CACb,MAAM,WAAW,gBAAgB,EAAE,EAAE,IAAI,cAAc;AACvD,QAAO,IAAI,IAAI,CACb,GAAG,wBACH,GAAG,oBAAoB,QAAQ,SAAS,QAAQ,SAAS,KAAK,CAAC,CAChE,CAAC;;;;;;;;AASJ,SAAgB,kBACd,iBACU;CACV,MAAM,QAAQ,mBAAmB,EAAE;AACnC,QAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,OAAO,GAAG,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;;;AAI9D,MAAM,kBAAkB;AAExB,MAAM,aACJ;AAEF,MAAM,aACJ;;AAGF,SA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,MAAM,WAAW;UACnB,KAAK;AACZ,MAAI,OAAO,QAAQ,QACjB,QAAO;GACL,MAAM;GACN,gBAAA;GACA,SAAS;GACV;EAEH,MAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;AAChE,YAAU,wBAAwB,UAAU;AAC5C,MAAI,gBAAgB,eAClB,SAAQ,KAAK,gBAAgB,cAAc;EAE7C,MAAM,QAAQ,mBAAmB,IAAI;AACrC,MAAI,MAAM,SAAS,eAAe,OAAO;AACvC,kBAAA,mBAAwC;AACxC,UAAO;IACL,MAAM;IACN,SAAS;KAAE,MAAM,MAAM;KAAM,SAAS,MAAM;KAAS,OAAO;KAAK;IAClE;;EAEH,MAAM,iBAAiB,aAAa,QAAQ;AAC5C,iBAAe,eAAe;AAC9B,SAAO;GACL,MAAM;GACN;GACA;GACA,OAAO,eAAe,QAAQ,MAAM,KAAA;GACrC;WACO;AACR,QAAM,cAAc,QAAQ;AAC5B,MAAI;AACF,iBAAc;UACR;AAGR,MAAI;AACF,WAAQ,YAAY,UAAU;UACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as analytics } from "./analytics-
|
|
1
|
+
import { n as analytics } from "./analytics-CGGE7OSa.js";
|
|
2
2
|
//#region src/shared/utils/telemetry.ts
|
|
3
3
|
function withProgress(step, callback) {
|
|
4
4
|
updateProgress(step);
|
|
@@ -10,4 +10,4 @@ function updateProgress(step) {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { withProgress as t };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=telemetry-
|
|
13
|
+
//# sourceMappingURL=telemetry-Ch9ZJvm7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-
|
|
1
|
+
{"version":3,"file":"telemetry-Ch9ZJvm7.js","names":[],"sources":["../src/shared/utils/telemetry.ts"],"sourcesContent":["import { analytics } from './analytics';\n\nexport function withProgress<T>(step: string, callback: () => T): T {\n updateProgress(step);\n return callback();\n}\n\nexport function updateProgress(step: string) {\n analytics.setTag('progress', step);\n}\n"],"mappings":";;AAEA,SAAgB,aAAgB,MAAc,UAAsB;AAClE,gBAAe,KAAK;AACpB,QAAO,UAAU;;AAGnB,SAAgB,eAAe,MAAc;AAC3C,WAAU,OAAO,YAAY,KAAK"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { n as ErrorCodes } from "./emit-BqLCdV8Y.js";
|
|
2
|
+
import { d as relativeToInstallDir, i as getLogFilePath, o as logToFile } from "./debug-sB20p-Ek.js";
|
|
3
|
+
import { A as POSTHOG_APP_URL, B as REPLAY_VISION_SUPPORTED, D as Integration, E as ISSUES_URL, F as POSTHOG_PRIVACY_URL, J as WIZARD_OAUTH_SCOPES, M as POSTHOG_DOCS_URL, O as OAUTH_PORTS, P as POSTHOG_ORG_AI_SETTINGS_URL, Q as WIZARD_PROVISIONING_SCOPES, R as POSTHOG_TERMS_URL, V as SETUP_REPORT_FILE, i as sessionProperties, k as OAUTH_TIMEOUT_MS, m as DUMMY_PROJECT_API_KEY, n as analytics, nt as WIZARD_USER_AGENT, rt as getSkillsBaseUrl } from "./analytics-CGGE7OSa.js";
|
|
4
|
+
import { A as getProvisioningScopesForProgram, B as SOURCE_MAPS_CONTEXT_KEYS, C as oauthErrorFromTokenBody, D as getCommandPath, E as findProgramConfig, F as detectErrorTrackingProjects, G as detectSelfDrivingIntegrationProjects, H as NO_DEFAULT_LIMIT, J as POSTHOG_PRESENT_KEY, K as GITHUB_REQUIRED_BODY, L as detectSourceMapsProjects, O as getOAuthScopesForProgram, P as ERROR_TRACKING_PROJECT_PATH_KEY, R as DISPLAY_NAME, S as oauthErrorFromCallbackParams, T as Program, U as PRICING_LONG, W as PRICING_SHORT, Y as SELF_DRIVING_INTEGRATE_PATH_KEY, _ as missingOAuthScopes, at as evaluateWizardReadiness, b as buildCallbackErrorHtml, c as buildSession, d as SessionStore, et as CONNECT_SLACK_SCOPE_ADDITIONS, f as applyAgentProgress, g as getOAuthClientId, h as OAuthTokenResponseSchema, it as SIGNUP_WIZARD_READINESS_CONFIG, j as getSubcommandPrograms, k as getProgramConfig, nt as getAuditChecks, ot as getBlockingServiceKeys, q as GITHUB_REQUIRED_MESSAGE, rt as SERVICE_LABELS, tt as withScopeAdditions, v as parseOAuthScopes, x as buildOAuthFailureMessage, y as OAuthError, z as MANUAL_SDK_VARIANTS } from "./programs-Ml6OLybj.js";
|
|
5
|
+
import "./errors-DhFeR8Sp.js";
|
|
6
|
+
import { r as withUtm, t as openTrackedLink } from "./links-rMot83W2.js";
|
|
7
|
+
import { t as withProgress } from "./telemetry-Ch9ZJvm7.js";
|
|
8
|
+
import { t as detectOrgAndProject } from "./setup-utils-Dfgse6pY.js";
|
|
9
|
+
import { r as currentCredentials } from "./oauth-session-C2fVSGfr.js";
|
|
10
|
+
import { g as isGrantRevoked } from "./agent-interface-BFzBnz10.js";
|
|
11
|
+
import { a as getOAuthUrl, i as getIntegrationAuthorizeUrl, s as resolveBaseUrl } from "./urls-eFaChZ9d.js";
|
|
12
|
+
import { t as HostResolution } from "./host-resolution-DDYJXiAQ.js";
|
|
13
|
+
import { A as formatCostUsd, C as FRAMEWORK_REGISTRY, E as streamMcpPrompt, c as POSTHOG_SDKS, j as formatTokenCount, k as computeTokenCostUsd, l as STRIPE_SDKS, p as getDetectedWarehouseSources } from "./posthog-integration-FAWfClH3.js";
|
|
14
|
+
import { y as fetchSkillMenu } from "./yara-hooks-C4HOysrM.js";
|
|
15
|
+
import { n as namesWithStatus, o as summarizeFailure, t as isOk } from "./results-ycm_Tf31.js";
|
|
16
|
+
import { f as getKindMeta, l as MCP_TUTORIAL_SCOPE_ADDITIONS, n as getTool, p as fetchHealthIssues, t as Tool } from "./tools-BZseGChD.js";
|
|
17
|
+
import { a as fetchGithubConnected, c as fetchUserData, n as ApiError, o as fetchProjectData, s as fetchSlackConnected } from "./api-ZZhiRtbb.js";
|
|
14
18
|
import { n as AVAILABLE_FEATURES, o as isAllFeaturesSelected, t as ALL_FEATURE_VALUES } from "./defaults-DDVl3tKN.js";
|
|
15
|
-
import { n as provisionNewAccount, r as requestDeepLink, t as ProvisionedAccountUnreadableError } from "./provisioning-
|
|
16
|
-
import { r as wizardAbort } from "./wizard-abort-
|
|
19
|
+
import { n as provisionNewAccount, r as requestDeepLink, t as ProvisionedAccountUnreadableError } from "./provisioning-BTVL49jD.js";
|
|
20
|
+
import { r as wizardAbort } from "./wizard-abort-BX3O4Hg4.js";
|
|
17
21
|
import { a as useStdoutDimensions, c as wrapAndTruncate, d as isObjectBlock, f as ConfirmButton, h as Icons, i as useKeyboardHintsContext, l as isClearBlock, m as Colors, n as useKeyBindings, o as computeVisibleRange, p as PromptLabel, r as KeyboardHintsProvider, s as wordWrap, t as PickerMenu, u as isLinesBlock } from "./PickerMenu-BGGeYqd-.js";
|
|
18
22
|
import * as fs$1 from "fs";
|
|
19
23
|
import path from "path";
|
|
@@ -6541,12 +6545,6 @@ const POSTHOG_INTEGRATION_FLOW = [
|
|
|
6541
6545
|
screenId: "mcp",
|
|
6542
6546
|
isComplete: (tui) => tui.mcpComplete
|
|
6543
6547
|
},
|
|
6544
|
-
{
|
|
6545
|
-
id: "slack-connect",
|
|
6546
|
-
label: "Connect Slack",
|
|
6547
|
-
screenId: "slack-connect",
|
|
6548
|
-
isComplete: (tui) => tui.slackStepDismissed
|
|
6549
|
-
},
|
|
6550
6548
|
{
|
|
6551
6549
|
id: "keep-skills",
|
|
6552
6550
|
label: "Keep Skills",
|
|
@@ -7056,7 +7054,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
|
|
|
7056
7054
|
})),
|
|
7057
7055
|
onSelect: (value) => {
|
|
7058
7056
|
const integration = Array.isArray(value) ? value[0] : value;
|
|
7059
|
-
import("./programs-
|
|
7057
|
+
import("./programs-DjCmEcxb.js").then(({ FRAMEWORK_REGISTRY }) => {
|
|
7060
7058
|
const config = FRAMEWORK_REGISTRY[integration];
|
|
7061
7059
|
store.setFrameworkConfig(integration, config);
|
|
7062
7060
|
store.setDetectedFramework(config.metadata.name);
|
|
@@ -8831,17 +8829,37 @@ const SelfDrivingHandoffScreen = ({ store }) => {
|
|
|
8831
8829
|
* Installing the App is a manual browser step, so polling is what flips the
|
|
8832
8830
|
* gate once the user comes back. The first tick also resolves the session's
|
|
8833
8831
|
* unknown (`null`) state.
|
|
8832
|
+
*
|
|
8833
|
+
* Each tick reads the token through the login's OAuth session, since the gate
|
|
8834
|
+
* can open, or sit, past the token's 1-hour life. A stale token 401s every
|
|
8835
|
+
* tick, and the gate then asks for an install the project already has.
|
|
8834
8836
|
*/
|
|
8835
8837
|
const POLL_INTERVAL_MS$1 = 3e3;
|
|
8836
8838
|
async function fetchLoginUrl(session) {
|
|
8837
8839
|
if (!session.signup || !session.credentials) return null;
|
|
8838
8840
|
return await requestDeepLink(session.credentials.accessToken, session.credentials.host) ?? `${session.credentials.host.appHost}/login`;
|
|
8839
8841
|
}
|
|
8842
|
+
const isUnauthorized = (err) => axios.isAxiosError(err) && err.response?.status === 401;
|
|
8843
|
+
/** One check. A 401 rotates the token once and retries before it counts as a failure. */
|
|
8844
|
+
async function checkGithubConnected(store, signal) {
|
|
8845
|
+
const held = store.session.credentials;
|
|
8846
|
+
if (!held) return false;
|
|
8847
|
+
const check = (credentials) => fetchGithubConnected(credentials.accessToken, credentials.projectId, credentials.host.apiHost, signal);
|
|
8848
|
+
const credentials = await currentCredentials(held);
|
|
8849
|
+
try {
|
|
8850
|
+
return await check(credentials);
|
|
8851
|
+
} catch (err) {
|
|
8852
|
+
if (!isUnauthorized(err) || !credentials.refreshToken || isGrantRevoked()) throw err;
|
|
8853
|
+
const rotated = await currentCredentials(credentials, true);
|
|
8854
|
+
if (rotated.accessToken === credentials.accessToken) throw err;
|
|
8855
|
+
return check(rotated);
|
|
8856
|
+
}
|
|
8857
|
+
}
|
|
8840
8858
|
function useGithubConnection(store) {
|
|
8841
|
-
const
|
|
8859
|
+
const loggedIn = store.session.credentials !== null;
|
|
8842
8860
|
const connected = store.githubConnected === true;
|
|
8843
8861
|
useEffect(() => {
|
|
8844
|
-
if (!
|
|
8862
|
+
if (!loggedIn || connected) return;
|
|
8845
8863
|
const controller = new AbortController();
|
|
8846
8864
|
let stopped = false;
|
|
8847
8865
|
let timer;
|
|
@@ -8856,7 +8874,7 @@ function useGithubConnection(store) {
|
|
|
8856
8874
|
(async () => {
|
|
8857
8875
|
while (!stopped) {
|
|
8858
8876
|
try {
|
|
8859
|
-
const isConnected = await
|
|
8877
|
+
const isConnected = await checkGithubConnected(store, controller.signal);
|
|
8860
8878
|
if (stopped) return;
|
|
8861
8879
|
if (isConnected) {
|
|
8862
8880
|
if (store.githubConnected === false) analytics.wizardCapture("github connect completed");
|
|
@@ -8881,7 +8899,7 @@ function useGithubConnection(store) {
|
|
|
8881
8899
|
controller.abort();
|
|
8882
8900
|
};
|
|
8883
8901
|
}, [
|
|
8884
|
-
|
|
8902
|
+
loggedIn,
|
|
8885
8903
|
connected,
|
|
8886
8904
|
store
|
|
8887
8905
|
]);
|
|
@@ -9665,6 +9683,11 @@ const TUI_TOOLS$3 = { "posthog-doctor": {
|
|
|
9665
9683
|
const markDone = (store, outcome, clients = [], featuresSelected, loginCommands = []) => {
|
|
9666
9684
|
store.setMcpComplete(outcome, clients, featuresSelected, loginCommands);
|
|
9667
9685
|
};
|
|
9686
|
+
/** Report the outcome as the results show, and complete the step on Enter. */
|
|
9687
|
+
const doneOnEnter = (store, outcome, clients = [], featuresSelected, loginCommands = []) => {
|
|
9688
|
+
store.reportMcpOutcome(outcome, clients, featuresSelected);
|
|
9689
|
+
return () => markDone(store, outcome, clients, featuresSelected, loginCommands);
|
|
9690
|
+
};
|
|
9668
9691
|
/**
|
|
9669
9692
|
* The editor-owned login commands still to run after this install: fresh
|
|
9670
9693
|
* config entries use the client's own server name, plugin-provided servers
|
|
@@ -9772,7 +9795,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
|
|
|
9772
9795
|
}
|
|
9773
9796
|
} catch (err) {
|
|
9774
9797
|
setDetectError(errorText(err));
|
|
9775
|
-
finishFlow.current = (
|
|
9798
|
+
finishFlow.current = doneOnEnter(store, "failed");
|
|
9776
9799
|
setPhase("none");
|
|
9777
9800
|
}
|
|
9778
9801
|
})();
|
|
@@ -9826,7 +9849,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
|
|
|
9826
9849
|
const outcome = ready.length > 0 ? "installed" : "failed";
|
|
9827
9850
|
const featuresReport = reportFeatures(features ?? [...ALL_FEATURE_VALUES]);
|
|
9828
9851
|
const logins = oauthFlow ? pendingLoginCommands(clients, mcpResult, pluginResult) : [];
|
|
9829
|
-
finishFlow.current = (
|
|
9852
|
+
finishFlow.current = doneOnEnter(store, outcome, ready.map((r) => r.name), featuresReport, logins);
|
|
9830
9853
|
setPhase("done");
|
|
9831
9854
|
};
|
|
9832
9855
|
const doRemove = async () => {
|
|
@@ -9839,8 +9862,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
|
|
|
9839
9862
|
}
|
|
9840
9863
|
setMcpResults(result);
|
|
9841
9864
|
const removed = result.filter(isOk);
|
|
9842
|
-
|
|
9843
|
-
finishFlow.current = () => markDone(store, outcome, removed.map((r) => r.name));
|
|
9865
|
+
finishFlow.current = doneOnEnter(store, removed.length > 0 ? "installed" : "failed", removed.map((r) => r.name));
|
|
9844
9866
|
setPhase("done");
|
|
9845
9867
|
};
|
|
9846
9868
|
const installValueBullets = [
|
|
@@ -10072,29 +10094,19 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
|
|
|
10072
10094
|
};
|
|
10073
10095
|
//#endregion
|
|
10074
10096
|
//#region src/tui/tools/mcp/flow.ts
|
|
10075
|
-
const MCP_ADD_FLOW = [
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
},
|
|
10089
|
-
{
|
|
10090
|
-
id: "mcp-suggested-prompts",
|
|
10091
|
-
label: "Suggested prompts",
|
|
10092
|
-
screenId: "mcp-suggested-prompts",
|
|
10093
|
-
show: (s) => s.mcpOutcome === "installed",
|
|
10094
|
-
isComplete: (s) => s.mcpSuggestedPromptsDismissed,
|
|
10095
|
-
reportsAsProgramId: "mcp-tutorial"
|
|
10096
|
-
}
|
|
10097
|
-
];
|
|
10097
|
+
const MCP_ADD_FLOW = [{
|
|
10098
|
+
id: "mcp-add",
|
|
10099
|
+
label: "Add MCP server",
|
|
10100
|
+
screenId: "mcp-add",
|
|
10101
|
+
isComplete: (s) => s.mcpComplete
|
|
10102
|
+
}, {
|
|
10103
|
+
id: "mcp-suggested-prompts",
|
|
10104
|
+
label: "Suggested prompts",
|
|
10105
|
+
screenId: "mcp-suggested-prompts",
|
|
10106
|
+
show: (s) => s.mcpOutcome === "installed",
|
|
10107
|
+
isComplete: (s) => s.mcpSuggestedPromptsDismissed,
|
|
10108
|
+
reportsAsProgramId: "mcp-tutorial"
|
|
10109
|
+
}];
|
|
10098
10110
|
/**
|
|
10099
10111
|
* `wizard mcp remove` — single-step uninstall flow.
|
|
10100
10112
|
*
|
|
@@ -10130,11 +10142,6 @@ const MCP_TUTORIAL_FLOW = [{
|
|
|
10130
10142
|
label: "MCP tutorial",
|
|
10131
10143
|
screenId: "mcp-suggested-prompts",
|
|
10132
10144
|
isComplete: (s) => s.mcpSuggestedPromptsDismissed
|
|
10133
|
-
}, {
|
|
10134
|
-
id: "slack-connect",
|
|
10135
|
-
label: "Connect Slack",
|
|
10136
|
-
screenId: "slack-connect",
|
|
10137
|
-
isComplete: (s) => s.slackStepDismissed
|
|
10138
10145
|
}];
|
|
10139
10146
|
//#endregion
|
|
10140
10147
|
//#region src/tui/tools/mcp/services/mcp-role-prompts.copy.ts
|
|
@@ -13384,7 +13391,7 @@ const MINT_FAILURE_CONTACT = "Email wizard@posthog.com and tell us what happened
|
|
|
13384
13391
|
/** The agent run ended in an error, whatever the reason. Login failures also
|
|
13385
13392
|
* set an error outro but never had credentials, so they stay on the outro. */
|
|
13386
13393
|
function isRunFailure(session) {
|
|
13387
|
-
return session.outroData?.kind === "error" && session.credentials !== null;
|
|
13394
|
+
return session.outroData?.kind === "error" && session.credentials !== null && session.outroData.errorCode !== ErrorCodes.AgentYaraViolation;
|
|
13388
13395
|
}
|
|
13389
13396
|
//#endregion
|
|
13390
13397
|
//#region src/tui/flow.ts
|
|
@@ -13489,10 +13496,6 @@ const MINT_HANDOFF_SEQUENCE = [
|
|
|
13489
13496
|
id: "mcp",
|
|
13490
13497
|
isComplete: (s) => s.mcpComplete
|
|
13491
13498
|
},
|
|
13492
|
-
{
|
|
13493
|
-
id: "slack-connect",
|
|
13494
|
-
isComplete: (s) => s.slackStepDismissed
|
|
13495
|
-
},
|
|
13496
13499
|
{
|
|
13497
13500
|
id: "keep-skills",
|
|
13498
13501
|
isComplete: (s) => s.skillsComplete
|
|
@@ -13529,11 +13532,11 @@ var WizardRouter = class {
|
|
|
13529
13532
|
if (runFailed && view.mintHandoff === "exit") return "exit";
|
|
13530
13533
|
if (runFailed && !view.mintHandoff) return "mint-failure";
|
|
13531
13534
|
if (this.overlays.length > 0) return this.overlays[this.overlays.length - 1];
|
|
13535
|
+
if (!runFailed && session.runPhase === "error" && session.outroData?.kind === "error") return view.outroDismissed ? "exit" : "outro";
|
|
13532
13536
|
const sequence = runFailed ? MINT_HANDOFF_SEQUENCE : this.sequence;
|
|
13533
13537
|
for (const entry of sequence) {
|
|
13534
13538
|
if (entry.show && !entry.show(view)) continue;
|
|
13535
13539
|
if (entry.isComplete && entry.isComplete(view)) continue;
|
|
13536
|
-
if (entry.id === "auth" && session.runPhase === "error" && session.outroData) return "outro";
|
|
13537
13540
|
return entry.id;
|
|
13538
13541
|
}
|
|
13539
13542
|
return sequence[sequence.length - 1].id;
|
|
@@ -15220,8 +15223,12 @@ const OutroScreen = ({ store }) => {
|
|
|
15220
15223
|
bold: true,
|
|
15221
15224
|
children: ["✘ ", outroData.message || "An error occurred"]
|
|
15222
15225
|
}),
|
|
15223
|
-
outroData.
|
|
15226
|
+
outroData.instruction && /* @__PURE__ */ jsx(Box, {
|
|
15224
15227
|
marginTop: 1,
|
|
15228
|
+
children: /* @__PURE__ */ jsx(Text, { children: outroData.instruction })
|
|
15229
|
+
}),
|
|
15230
|
+
outroData.body && /* @__PURE__ */ jsx(Box, {
|
|
15231
|
+
marginTop: outroData.instruction ? 0 : 1,
|
|
15225
15232
|
children: /* @__PURE__ */ jsx(Text, {
|
|
15226
15233
|
dimColor: true,
|
|
15227
15234
|
children: outroData.body
|
|
@@ -15229,7 +15236,14 @@ const OutroScreen = ({ store }) => {
|
|
|
15229
15236
|
}),
|
|
15230
15237
|
outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
|
|
15231
15238
|
marginTop: 1,
|
|
15232
|
-
|
|
15239
|
+
flexDirection: "column",
|
|
15240
|
+
children: outroData.docsLabel ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
|
|
15241
|
+
dimColor: true,
|
|
15242
|
+
children: outroData.docsLabel
|
|
15243
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
15244
|
+
color: "cyan",
|
|
15245
|
+
children: outroData.docsUrl
|
|
15246
|
+
})] }) : /* @__PURE__ */ jsxs(Text, { children: ["Docs: ", /* @__PURE__ */ jsx(Text, {
|
|
15233
15247
|
color: "cyan",
|
|
15234
15248
|
children: outroData.docsUrl
|
|
15235
15249
|
})] })
|
|
@@ -15244,10 +15258,14 @@ const OutroScreen = ({ store }) => {
|
|
|
15244
15258
|
})
|
|
15245
15259
|
}),
|
|
15246
15260
|
/* @__PURE__ */ jsx(Box, {
|
|
15247
|
-
marginTop: 1,
|
|
15248
|
-
children: /* @__PURE__ */
|
|
15261
|
+
marginTop: outroData.kind === "error" ? 2 : 1,
|
|
15262
|
+
children: /* @__PURE__ */ jsxs(Text, {
|
|
15249
15263
|
color: Colors.muted,
|
|
15250
|
-
children:
|
|
15264
|
+
children: [
|
|
15265
|
+
"Press any key to",
|
|
15266
|
+
" ",
|
|
15267
|
+
outroData.kind === "error" ? "exit" : "continue"
|
|
15268
|
+
]
|
|
15251
15269
|
})
|
|
15252
15270
|
})
|
|
15253
15271
|
]
|
|
@@ -15329,6 +15347,7 @@ var WizardStore = class {
|
|
|
15329
15347
|
_enterScreenHooks = /* @__PURE__ */ new Map();
|
|
15330
15348
|
/** Gate promises derived from program step definitions. */
|
|
15331
15349
|
_gates = /* @__PURE__ */ new Map();
|
|
15350
|
+
_mcpOutcomeReported = false;
|
|
15332
15351
|
version = "";
|
|
15333
15352
|
/** Navigation router — resolves active screen from session state. */
|
|
15334
15353
|
router;
|
|
@@ -15851,7 +15870,10 @@ var WizardStore = class {
|
|
|
15851
15870
|
addDiscoveredFeature(feature) {
|
|
15852
15871
|
this.sessions.addDiscoveredFeature(feature);
|
|
15853
15872
|
}
|
|
15854
|
-
|
|
15873
|
+
/** Capture the MCP step's outcome once; the screen reports it as the results show, before Enter. */
|
|
15874
|
+
reportMcpOutcome(outcome, installedClients = [], featuresSelected) {
|
|
15875
|
+
if (this._mcpOutcomeReported) return;
|
|
15876
|
+
this._mcpOutcomeReported = true;
|
|
15855
15877
|
const featuresPayload = outcome === "installed" && featuresSelected !== void 0 ? { mcp_features_selected: featuresSelected } : {};
|
|
15856
15878
|
analytics.wizardCapture("mcp complete", {
|
|
15857
15879
|
mcp_outcome: outcome,
|
|
@@ -15859,6 +15881,10 @@ var WizardStore = class {
|
|
|
15859
15881
|
...featuresPayload,
|
|
15860
15882
|
...sessionProperties(this.session)
|
|
15861
15883
|
});
|
|
15884
|
+
}
|
|
15885
|
+
/** Complete the MCP step; its `mcp complete` capture goes through `reportMcpOutcome`, so once per store. */
|
|
15886
|
+
setMcpComplete(outcome = "skipped", installedClients = [], featuresSelected, loginCommands = []) {
|
|
15887
|
+
this.reportMcpOutcome(outcome, installedClients, featuresSelected);
|
|
15862
15888
|
this._write({
|
|
15863
15889
|
mcpComplete: true,
|
|
15864
15890
|
mcpOutcome: outcome,
|
|
@@ -16159,4 +16185,4 @@ function releaseTerminal() {
|
|
|
16159
16185
|
//#endregion
|
|
16160
16186
|
export { AUDIT_AREA_SLIDES as A, totalTokenCount as B, assembleProfile as C, getTuiProgram as D, IssueTable as E, ContentSequencer as F, ModalOverlay as G, LogViewer as H, HNViewer as I, ProgressList as J, ConfirmationInput as K, TabContainer as L, IntroScreenLayout as M, PRIVACY_PANEL_LABEL as N, displayProgress as O, PrivacyPanel as P, getContentBlocks$5 as Q, ScreenContainer as R, McpSuggestedPromptsScreen as S, McpScreen as T, LinkText as U, EventPlanViewer as V, extractUrls as W, SplitView as X, LoadingBox as Y, CardLayout as Z, getTuiTool as _, SlackConnectScreen as a, extractOAuthCode as b, LearnCard as c, MINT_FAILURE_BODY as d, MINT_FAILURE_CONTACT as f, listFlowOwners as g, flowOwner as h, OutroScreen as i, AuditChecksViewer as j, useDismissOnAnyKey as k, AiOptInRequiredScreen as l, isRunFailure as m, releaseTerminal as n, TipsCard as o, MINT_FAILURE_MESSAGE as p, GroupedPickerMenu as q, WizardStore as r, VisualizerTab as s, enterDarkTerminal as t, ServiceHealthList as u, seededProfile as v, TAILORED_ROLES as w, abortOnScreens as x, getOrAskForProjectData as y, ViewportTooSmall as z };
|
|
16161
16187
|
|
|
16162
|
-
//# sourceMappingURL=terminal-
|
|
16188
|
+
//# sourceMappingURL=terminal-D20JFN3J.js.map
|