@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.
Files changed (134) hide show
  1. package/README.md +19 -17
  2. package/dist/README.md +6 -4
  3. package/dist/{agent-interface-CemBvTAA.js → agent-interface-BFzBnz10.js} +184 -25
  4. package/dist/agent-interface-BFzBnz10.js.map +1 -0
  5. package/dist/{agent-prompt-loader-DPnj6SwU.js → agent-prompt-loader-CbCW6YbP.js} +6 -6
  6. package/dist/{agent-prompt-loader-DPnj6SwU.js.map → agent-prompt-loader-CbCW6YbP.js.map} +1 -1
  7. package/dist/{analytics-D21z3E5l.js → analytics-CGGE7OSa.js} +6 -3
  8. package/dist/analytics-CGGE7OSa.js.map +1 -0
  9. package/dist/analytics-D6NAIJxP.js +2 -0
  10. package/dist/api-DM4uMJ00.js +2 -0
  11. package/dist/{api-DtGIqQ2U.js → api-ZZhiRtbb.js} +3 -2
  12. package/dist/{api-DtGIqQ2U.js.map → api-ZZhiRtbb.js.map} +1 -1
  13. package/dist/api-key-login-C30LRht2.js +2 -0
  14. package/dist/{api-key-login-h3E2G3zu.js → api-key-login-D0KBr1dx.js} +5 -5
  15. package/dist/{api-key-login-h3E2G3zu.js.map → api-key-login-D0KBr1dx.js.map} +1 -1
  16. package/dist/bin.js +2 -2
  17. package/dist/{bounded-fs-CAsuF6al.js → bounded-fs-DwL2Tasp.js} +3 -3
  18. package/dist/{bounded-fs-CAsuF6al.js.map → bounded-fs-DwL2Tasp.js.map} +1 -1
  19. package/dist/{ci-install-CEYE02t-.js → ci-install-DKXrt_ow.js} +7 -7
  20. package/dist/{ci-install-CEYE02t-.js.map → ci-install-DKXrt_ow.js.map} +1 -1
  21. package/dist/{console-log-O828zyiq.js → console-log-DJiTqYT2.js} +3 -3
  22. package/dist/{console-log-O828zyiq.js.map → console-log-DJiTqYT2.js.map} +1 -1
  23. package/dist/{debug-BfQPD2Hg.js → debug-sB20p-Ek.js} +3 -3
  24. package/dist/{debug-BfQPD2Hg.js.map → debug-sB20p-Ek.js.map} +1 -1
  25. package/dist/{emit-RfAewcWv.js → emit-BqLCdV8Y.js} +2 -1
  26. package/dist/{emit-RfAewcWv.js.map → emit-BqLCdV8Y.js.map} +1 -1
  27. package/dist/{errors-CHrJzAZb.js → errors-DhFeR8Sp.js} +3 -3
  28. package/dist/{errors-CHrJzAZb.js.map → errors-DhFeR8Sp.js.map} +1 -1
  29. package/dist/{gateway-D3gIlR6b.js → gateway-Dg4Fm-nC.js} +7 -7
  30. package/dist/{gateway-D3gIlR6b.js.map → gateway-Dg4Fm-nC.js.map} +1 -1
  31. package/dist/{headless-DIX68UUA.js → headless-B3Ol1nkU.js} +1 -1
  32. package/dist/{headless-BJjhP0SI.js → headless-DhTDC9ga.js} +2 -2
  33. package/dist/{headless-BJjhP0SI.js.map → headless-DhTDC9ga.js.map} +1 -1
  34. package/dist/{host-resolution-D8GhEVoX.js → host-resolution-DDYJXiAQ.js} +4 -4
  35. package/dist/{host-resolution-D8GhEVoX.js.map → host-resolution-DDYJXiAQ.js.map} +1 -1
  36. package/dist/{install-Bw8tvDvS.js → install-CZeR38cD.js} +1 -1
  37. package/dist/{install-paPCzPHI.js → install-Dh8Z5R15.js} +41 -55
  38. package/dist/install-Dh8Z5R15.js.map +1 -0
  39. package/dist/{interactive-tdxZKWax.js → interactive-hqHk6kz4.js} +3 -3
  40. package/dist/{interactive-tdxZKWax.js.map → interactive-hqHk6kz4.js.map} +1 -1
  41. package/dist/{links-Cyj6v8kg.js → links-rMot83W2.js} +3 -3
  42. package/dist/{links-Cyj6v8kg.js.map → links-rMot83W2.js.map} +1 -1
  43. package/dist/{main-0p-YxUNa.js → main-DNIeasXx.js} +25 -25
  44. package/dist/main-DNIeasXx.js.map +1 -0
  45. package/dist/{mcp-D3Z5MXhA.js → mcp-SZcGfaOz.js} +3 -3
  46. package/dist/{mcp-D3Z5MXhA.js.map → mcp-SZcGfaOz.js.map} +1 -1
  47. package/dist/{mcp-prompt-streaming-COVbWnHt.js → mcp-prompt-streaming-BuRMBgbo.js} +5 -5
  48. package/dist/{mcp-prompt-streaming-COVbWnHt.js.map → mcp-prompt-streaming-BuRMBgbo.js.map} +1 -1
  49. package/dist/{models-D1SnCzvl.js → models-G1j-wgwe.js} +2 -2
  50. package/dist/{models-D1SnCzvl.js.map → models-G1j-wgwe.js.map} +1 -1
  51. package/dist/{non-interactive-DxRBc73O.js → non-interactive-DkldwWDM.js} +4 -4
  52. package/dist/{non-interactive-DxRBc73O.js.map → non-interactive-DkldwWDM.js.map} +1 -1
  53. package/dist/{oauth-session-Dde79Ycm.js → oauth-session-C2fVSGfr.js} +2 -2
  54. package/dist/{oauth-session-Dde79Ycm.js.map → oauth-session-C2fVSGfr.js.map} +1 -1
  55. package/dist/{orchestrator-tools-BSNhzzkT.js → orchestrator-tools-BchqG7Qi.js} +3 -3
  56. package/dist/{orchestrator-tools-BSNhzzkT.js.map → orchestrator-tools-BchqG7Qi.js.map} +1 -1
  57. package/dist/{package-manager-BRXlXo0p.js → package-manager-B3_qSybg.js} +4 -4
  58. package/dist/{package-manager-BRXlXo0p.js.map → package-manager-B3_qSybg.js.map} +1 -1
  59. package/dist/{pi-cM_4Gd_9.js → pi-Cw7CPXSl.js} +15 -15
  60. package/dist/{pi-cM_4Gd_9.js.map → pi-Cw7CPXSl.js.map} +1 -1
  61. package/dist/{playground-DTKy0XHT.js → playground-CPNrQfb3.js} +4 -4
  62. package/dist/{playground-DTKy0XHT.js.map → playground-CPNrQfb3.js.map} +1 -1
  63. package/dist/{posthog-integration-bwHwE87a.js → posthog-integration-FAWfClH3.js} +63 -50
  64. package/dist/posthog-integration-FAWfClH3.js.map +1 -0
  65. package/dist/programs-DjCmEcxb.js +3 -0
  66. package/dist/{programs-SeT1qNik.js → programs-Ml6OLybj.js} +88 -34
  67. package/dist/programs-Ml6OLybj.js.map +1 -0
  68. package/dist/{provisioning-JbJtq7hq.js → provisioning-BTVL49jD.js} +4 -4
  69. package/dist/{provisioning-JbJtq7hq.js.map → provisioning-BTVL49jD.js.map} +1 -1
  70. package/dist/provisioning-DL0xCJXH.js +2 -0
  71. package/dist/{queue-tools-BIZSJyt6.js → queue-tools-BQfRI_uD.js} +4 -4
  72. package/dist/{queue-tools-BIZSJyt6.js.map → queue-tools-BQfRI_uD.js.map} +1 -1
  73. package/dist/{results-DtKICAdz.js → results-ycm_Tf31.js} +37 -2
  74. package/dist/results-ycm_Tf31.js.map +1 -0
  75. package/dist/{run-CDurA5tO.js → run-Bgg-ctbA.js} +31 -15
  76. package/dist/run-Bgg-ctbA.js.map +1 -0
  77. package/dist/{run-DDCvLILJ.js → run-C6Ei6vvb.js} +10 -10
  78. package/dist/run-C6Ei6vvb.js.map +1 -0
  79. package/dist/{run-tool-DML8JJvt.js → run-tool-CrN2xWzU.js} +32 -16
  80. package/dist/{run-tool-DML8JJvt.js.map → run-tool-CrN2xWzU.js.map} +1 -1
  81. package/dist/run-tool-tNjm8S-E.js +2 -0
  82. package/dist/{runners-Dhu4pZTN.js → runners-GGYJs0Ny.js} +37 -19
  83. package/dist/runners-GGYJs0Ny.js.map +1 -0
  84. package/dist/{security-DEH8Rn0_.js → security-C36p8lu6.js} +44 -52
  85. package/dist/security-C36p8lu6.js.map +1 -0
  86. package/dist/{setup-utils-C5-WM-hS.js → setup-utils-Dfgse6pY.js} +3 -3
  87. package/dist/{setup-utils-C5-WM-hS.js.map → setup-utils-Dfgse6pY.js.map} +1 -1
  88. package/dist/{start-playground-DL4mVEUx.js → start-playground-D0TrdLmc.js} +7 -6
  89. package/dist/{start-playground-DL4mVEUx.js.map → start-playground-D0TrdLmc.js.map} +1 -1
  90. package/dist/{subagent-CnFvAq6E.js → subagent-DR5caRzL.js} +7 -7
  91. package/dist/subagent-DR5caRzL.js.map +1 -0
  92. package/dist/{task-BOScSm4W.js → task-C1qKgsAf.js} +18 -17
  93. package/dist/task-C1qKgsAf.js.map +1 -0
  94. package/dist/{telemetry-CP4rGicd.js → telemetry-Ch9ZJvm7.js} +2 -2
  95. package/dist/{telemetry-CP4rGicd.js.map → telemetry-Ch9ZJvm7.js.map} +1 -1
  96. package/dist/{terminal-J3OD3dN0.js → terminal-D20JFN3J.js} +97 -71
  97. package/dist/terminal-D20JFN3J.js.map +1 -0
  98. package/dist/{tools-CCMV3DmB.js → tools-BZseGChD.js} +15 -15
  99. package/dist/{tools-CCMV3DmB.js.map → tools-BZseGChD.js.map} +1 -1
  100. package/dist/{tools-Cz8tDptL.js → tools-CmSMclOD.js} +8 -8
  101. package/dist/{tools-Cz8tDptL.js.map → tools-CmSMclOD.js.map} +1 -1
  102. package/dist/{tui-Csf7VJxt.js → tui-BXe1D0tc.js} +4 -4
  103. package/dist/{tui-Csf7VJxt.js.map → tui-BXe1D0tc.js.map} +1 -1
  104. package/dist/{tui-BUZ2PWqN.js → tui-DJf3ZPRh.js} +1 -1
  105. package/dist/{upload-step-CEacB2RV.js → upload-step-BlAN7MC5.js} +3 -3
  106. package/dist/{upload-step-CEacB2RV.js.map → upload-step-BlAN7MC5.js.map} +1 -1
  107. package/dist/{urls-BDELGZHq.js → urls-eFaChZ9d.js} +2 -2
  108. package/dist/{urls-BDELGZHq.js.map → urls-eFaChZ9d.js.map} +1 -1
  109. package/dist/{wizard-abort-D3-75KyV.js → wizard-abort-BX3O4Hg4.js} +5 -5
  110. package/dist/{wizard-abort-D3-75KyV.js.map → wizard-abort-BX3O4Hg4.js.map} +1 -1
  111. package/dist/{yara-hooks-D8YDyX7o.js → yara-hooks-C4HOysrM.js} +4 -4
  112. package/dist/{yara-hooks-D8YDyX7o.js.map → yara-hooks-C4HOysrM.js.map} +1 -1
  113. package/dist/{yara-hooks-CZ1tKxy_.js → yara-hooks-DV4EkkZY.js} +1 -1
  114. package/package.json +2 -1
  115. package/dist/agent-interface-CemBvTAA.js.map +0 -1
  116. package/dist/analytics-B3ROGuIr.js +0 -2
  117. package/dist/analytics-D21z3E5l.js.map +0 -1
  118. package/dist/api-IhROOQNv.js +0 -2
  119. package/dist/api-key-login-OEntFvu5.js +0 -2
  120. package/dist/install-paPCzPHI.js.map +0 -1
  121. package/dist/main-0p-YxUNa.js.map +0 -1
  122. package/dist/posthog-integration-bwHwE87a.js.map +0 -1
  123. package/dist/programs-BhtyA3lE.js +0 -3
  124. package/dist/programs-SeT1qNik.js.map +0 -1
  125. package/dist/provisioning-BcXfeCMc.js +0 -2
  126. package/dist/results-DtKICAdz.js.map +0 -1
  127. package/dist/run-CDurA5tO.js.map +0 -1
  128. package/dist/run-DDCvLILJ.js.map +0 -1
  129. package/dist/run-tool-CTq9OOdT.js +0 -2
  130. package/dist/runners-Dhu4pZTN.js.map +0 -1
  131. package/dist/security-DEH8Rn0_.js.map +0 -1
  132. package/dist/subagent-CnFvAq6E.js.map +0 -1
  133. package/dist/task-BOScSm4W.js.map +0 -1
  134. package/dist/terminal-J3OD3dN0.js.map +0 -1
@@ -1,22 +1,22 @@
1
- import { n as ErrorCodes } from "./emit-RfAewcWv.js";
2
- import { c as WIZARD_LOG_FILE, f as VERSION, h as RUN_SURFACE, i as getLogFilePath, o as logToFile, s as WIZARD_BENCHMARK_FILE, t as configureLogFile, v as runtimeEnv } from "./debug-BfQPD2Hg.js";
3
- import { C as HAIKU_MODEL, D as Integration, G as WIZARD_CONTACT_EMAIL, H as SONNET_5_MODEL, J as WIZARD_OAUTH_SCOPES, M as POSTHOG_DOCS_URL, Q as WIZARD_PROVISIONING_SCOPES, S as GPT5_6_TERRA_MODEL, T as Harness, U as Sequence, V as SETUP_REPORT_FILE, X as WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY, Y as WIZARD_ORCHESTRATOR_FLAG_KEY, Z as WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY, a as ciExcludedTaskTypes, b as GPT5_6_LUNA_MODEL, c as AGENTIC_DETECTION_RETRY_TIMEOUT_MS, n as analytics, o as mayReportScanResults, p as DETECTION_TIMEOUT_MS, q as WIZARD_INTERACTION_EVENT_NAME, rt as getSkillsBaseUrl, s as AGENTIC_DETECTION_FIRST_ATTEMPT_TIMEOUT_MS, tt as WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY, v as EVENT_PLAN_FILE, x as GPT5_6_SOL_MODEL } from "./analytics-D21z3E5l.js";
4
- import { r as withUtm, t as openTrackedLink } from "./links-Cyj6v8kg.js";
5
- import { a as WizardError, r as skillErrorCode, t as classifyRunFailure } from "./errors-CHrJzAZb.js";
6
- import { a as safeReadFile, i as readProjectFile, n as boundedGlob, o as walkProjectFiles } from "./bounded-fs-CAsuF6al.js";
7
- import { n as detectNodePackageManagers, t as detectAllPackageManagers } from "./package-manager-BRXlXo0p.js";
1
+ import { n as ErrorCodes } from "./emit-BqLCdV8Y.js";
2
+ import { c as WIZARD_LOG_FILE, f as VERSION, h as RUN_SURFACE, i as getLogFilePath, o as logToFile, s as WIZARD_BENCHMARK_FILE, t as configureLogFile, v as runtimeEnv } from "./debug-sB20p-Ek.js";
3
+ import { C as HAIKU_MODEL, D as Integration, G as WIZARD_CONTACT_EMAIL, H as SONNET_5_MODEL, J as WIZARD_OAUTH_SCOPES, M as POSTHOG_DOCS_URL, Q as WIZARD_PROVISIONING_SCOPES, S as GPT5_6_TERRA_MODEL, T as Harness, U as Sequence, V as SETUP_REPORT_FILE, X as WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY, Y as WIZARD_ORCHESTRATOR_FLAG_KEY, Z as WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY, a as ciExcludedTaskTypes, b as GPT5_6_LUNA_MODEL, c as AGENTIC_DETECTION_RETRY_TIMEOUT_MS, n as analytics, o as mayReportScanResults, p as DETECTION_TIMEOUT_MS, q as WIZARD_INTERACTION_EVENT_NAME, rt as getSkillsBaseUrl, s as AGENTIC_DETECTION_FIRST_ATTEMPT_TIMEOUT_MS, tt as WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY, v as EVENT_PLAN_FILE, x as GPT5_6_SOL_MODEL } from "./analytics-CGGE7OSa.js";
4
+ import { a as WizardError, r as skillErrorCode, t as classifyRunFailure } from "./errors-DhFeR8Sp.js";
5
+ import { r as withUtm, t as openTrackedLink } from "./links-rMot83W2.js";
6
+ import { a as safeReadFile, i as readProjectFile, n as boundedGlob, o as walkProjectFiles } from "./bounded-fs-DwL2Tasp.js";
7
+ import { n as detectNodePackageManagers, t as detectAllPackageManagers } from "./package-manager-B3_qSybg.js";
8
8
  import { n as getInstalledPackageVersion, r as hasDeclaredDependency, t as getDeclaredVersion } from "./package-json-2UrhE6kP.js";
9
- import { i as createVersionBucket, n as isUsingTypeScript, r as tryGetPackageJson } from "./setup-utils-C5-WM-hS.js";
10
- import { n as currentAccessToken } from "./oauth-session-Dde79Ycm.js";
11
- import { d as gatewayAuth, p as useRunGatewayCredential, s as AgentSignals } from "./gateway-D3gIlR6b.js";
12
- import { a as requireKnownModel, o as triageModelFor, r as isValidModel } from "./models-D1SnCzvl.js";
13
- import { R as WIZARD_TOOL_NAMES, at as isEnvFileName, ct as createTriageLLMProvider, et as createWizardAskBridge, i as runAgent$1, it as MAX_ENV_KEY_SET, n as buildRunTags, nt as LONGER_ASK_TIMEOUT_MS, ot as parseEnvKeyNames, p as registerCleanup, r as initializeAgent, rt as shouldDisableAsk, st as toPromptSafeRelativePath } from "./agent-interface-CemBvTAA.js";
14
- import { n as mcpUrlFor } from "./host-resolution-D8GhEVoX.js";
15
- import { a as piBackend, d as createEmitSpinner, f as createProgressCollector, l as createAioCapture, u as createEmitLog } from "./pi-cM_4Gd_9.js";
16
- import { d as uncoveredBySink, g as TaskStatus, h as SkipReason, m as QueueStore, p as QUEUE_DIR_NAME, u as dependencyClosure } from "./queue-tools-BIZSJyt6.js";
17
- import { a as flushScanReport, p as scanInstalledSkill$1, s as formatYaraAbortMessage, v as installSkillById, y as fetchSkillMenu } from "./yara-hooks-D8YDyX7o.js";
18
- import { a as assembleTaskPrompt, d as taskModelSpec, i as assembleSeedPrompt, n as agentRunTools, o as loadAgentRegistry, s as promptModelFor, t as ASK_TOOL, u as resolveTask } from "./agent-prompt-loader-DPnj6SwU.js";
19
- import { r as requestDeepLink } from "./provisioning-JbJtq7hq.js";
9
+ import { i as createVersionBucket, n as isUsingTypeScript, r as tryGetPackageJson } from "./setup-utils-Dfgse6pY.js";
10
+ import { n as currentAccessToken } from "./oauth-session-C2fVSGfr.js";
11
+ import { d as gatewayAuth, p as useRunGatewayCredential, s as AgentSignals } from "./gateway-Dg4Fm-nC.js";
12
+ import { a as requireKnownModel, o as triageModelFor, r as isValidModel } from "./models-G1j-wgwe.js";
13
+ import { B as WIZARD_TOOL_NAMES, at as shouldDisableAsk, ct as parseEnvKeyNames, i as runAgent$1, it as LONGER_ASK_TIMEOUT_MS, lt as toPromptSafeRelativePath, n as buildRunTags, nt as createWizardAskBridge, ot as MAX_ENV_KEY_SET, p as registerCleanup, r as initializeAgent, st as isEnvFileName, ut as createTriageLLMProvider } from "./agent-interface-BFzBnz10.js";
14
+ import { n as mcpUrlFor } from "./host-resolution-DDYJXiAQ.js";
15
+ import { a as piBackend, d as createEmitSpinner, f as createProgressCollector, l as createAioCapture, u as createEmitLog } from "./pi-Cw7CPXSl.js";
16
+ import { d as uncoveredBySink, g as TaskStatus, h as SkipReason, m as QueueStore, p as QUEUE_DIR_NAME, u as dependencyClosure } from "./queue-tools-BQfRI_uD.js";
17
+ import { a as flushScanReport, p as scanInstalledSkill$1, s as formatYaraAbortMessage, v as installSkillById, y as fetchSkillMenu } from "./yara-hooks-C4HOysrM.js";
18
+ import { a as assembleTaskPrompt, d as taskModelSpec, i as assembleSeedPrompt, n as agentRunTools, o as loadAgentRegistry, s as promptModelFor, t as ASK_TOOL, u as resolveTask } from "./agent-prompt-loader-CbCW6YbP.js";
19
+ import { r as requestDeepLink } from "./provisioning-BTVL49jD.js";
20
20
  import * as semver from "semver";
21
21
  import { major, minVersion } from "semver";
22
22
  import fs, { cpSync, existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "fs";
@@ -2042,6 +2042,7 @@ function requireTaskHarness(pick) {
2042
2042
  if (!harness.runTask) throw new Error(`Harness "${pick.harness}" does not implement runTask; orchestrator mode requires it.`);
2043
2043
  return harness;
2044
2044
  }
2045
+ /** How an agent result ends the run, or undefined when it doesn't. */
2045
2046
  function terminalResult(result) {
2046
2047
  switch (result.kind) {
2047
2048
  case "success": return;
@@ -2061,7 +2062,7 @@ function terminalResult(result) {
2061
2062
  outcome: "failed",
2062
2063
  failure: {
2063
2064
  code: AGENT_ERROR_CODE[result.classification],
2064
- message: result.message ?? "Agent failed",
2065
+ message: result.classification === "WIZARD_YARA_VIOLATION" ? formatYaraAbortMessage() : result.message ?? "Agent failed",
2065
2066
  error: result.error
2066
2067
  }
2067
2068
  };
@@ -2266,6 +2267,10 @@ function drainVerdict(tasks) {
2266
2267
  blockedTypes: pending.map((t) => t.type)
2267
2268
  };
2268
2269
  }
2270
+ /** A drain where a required step failed, or where nothing failed but steps were blocked and never ran. */
2271
+ function drainFailureCode(verdict) {
2272
+ return verdict.requiredFailedTypes.length > 0 ? ErrorCodes.AgentOrchestratorTasksFailed : ErrorCodes.AgentOrchestratorTasksBlocked;
2273
+ }
2269
2274
  /**
2270
2275
  * The one-line "what went wrong" the abort message leads with.
2271
2276
  *
@@ -2788,16 +2793,17 @@ or integrate manually here:
2788
2793
  const whatFailed = describeDrainFailure(verdict);
2789
2794
  const missingScopes = (boot.credentials.missingScopes ?? []).filter((scope) => WIZARD_PROVISIONING_SCOPES.some((required) => required === scope) || !WIZARD_OAUTH_SCOPES.some((requested) => requested === scope));
2790
2795
  const message = missingScopes.length > 0 ? `The wizard could not finish setup: ${whatFailed}, and this run was authorized without the following permission${missingScopes.length === 1 ? "" : "s"}: ${missingScopes.join(", ")}.\n\nPlease try again, approving all permissions on the PostHog authorization screen. If it still fails, report it to: ${WIZARD_CONTACT_EMAIL}` : `The wizard was unable to set up PostHog: ${whatFailed}.\n\nPlease report this to: ${WIZARD_CONTACT_EMAIL}`;
2796
+ const code = drainFailureCode(verdict);
2791
2797
  return failed({
2792
- code: ErrorCodes.AgentOrchestratorTasksFailed,
2798
+ code,
2793
2799
  message,
2794
- error: new WizardError("orchestrator drain ended with failed tasks", {
2800
+ error: new WizardError(code === ErrorCodes.AgentOrchestratorTasksFailed ? "orchestrator drain ended with failed tasks" : "orchestrator drain ended with blocked tasks", {
2795
2801
  tasks_failed: summary.failed,
2796
2802
  tasks_blocked: blocked,
2797
2803
  failed_types: failedTypes,
2798
2804
  missing_oauth_scopes: missingScopes.join(" "),
2799
2805
  queue_state: JSON.stringify(store.list())
2800
- }, ErrorCodes.AgentOrchestratorTasksFailed)
2806
+ }, code)
2801
2807
  });
2802
2808
  }
2803
2809
  if (summary.total === 0) return failed({
@@ -3199,7 +3205,7 @@ function safeErrorMessage(error) {
3199
3205
  * chunk does not grow.
3200
3206
  */
3201
3207
  async function scanInstalledSkill(skillDir, llmProvider) {
3202
- return (await import("./yara-hooks-CZ1tKxy_.js")).scanInstalledSkill(skillDir, llmProvider);
3208
+ return (await import("./yara-hooks-DV4EkkZY.js")).scanInstalledSkill(skillDir, llmProvider);
3203
3209
  }
3204
3210
  /**
3205
3211
  * The MCP tutorial's prompt stream: one prompt against the PostHog MCP server,
@@ -3208,7 +3214,7 @@ async function scanInstalledSkill(skillDir, llmProvider) {
3208
3214
  * startup chunk does not grow.
3209
3215
  */
3210
3216
  async function* streamMcpPrompt(args) {
3211
- yield* (await import("./mcp-prompt-streaming-COVbWnHt.js")).streamMcpPrompt(args);
3217
+ yield* (await import("./mcp-prompt-streaming-BuRMBgbo.js")).streamMcpPrompt(args);
3212
3218
  }
3213
3219
  //#endregion
3214
3220
  //#region src/programs/frameworks/python/utils.ts
@@ -9927,33 +9933,42 @@ function detectExistingPostHog(ctx, installDir) {
9927
9933
  * A decided stop, such as an unsupported platform. A program throws it rather
9928
9934
  * than exiting: `runProgram` settles it as an aborted outcome from detection
9929
9935
  * and a failed one from a run definition, and the CLI turns that into its exit.
9936
+ * `outroData` is the structured outro for hosts that render one; `message` is
9937
+ * the plain text for every other host.
9930
9938
  */
9931
9939
  var ProgramAbort = class extends Error {
9932
9940
  code;
9941
+ outroData;
9933
9942
  constructor(failure) {
9934
9943
  super(failure.message);
9935
9944
  this.name = "ProgramAbort";
9936
9945
  this.code = failure.code;
9946
+ this.outroData = failure.outroData;
9937
9947
  }
9938
9948
  };
9939
9949
  //#endregion
9940
- //#region src/shared/oauth-scopes.ts
9941
- /**
9942
- * Extra scope the Connect-Slack step needs on top of `WIZARD_OAUTH_SCOPES`.
9943
- *
9944
- * The step polls `/api/projects/:id/integrations/` (`fetchSlackConnected`)
9945
- * to render the already-connected variant and to flip live once the user
9946
- * completes the Slack OAuth step in the browser. Without `integration:read`
9947
- * the first poll 403s, the screen stops polling, and an already-connected
9948
- * project is nagged with the connect nudge. Used by the default integration
9949
- * run (the step ends the run) and by the `wizard slack` tool (the step is
9950
- * the whole flow).
9951
- */
9952
- const CONNECT_SLACK_SCOPE_ADDITIONS = ["integration:read"];
9953
- /** `base` then `additions`, deduped, base first. */
9954
- function withScopeAdditions(base, additions) {
9955
- if (!additions || additions.length === 0) return base;
9956
- return [...new Set([...base, ...additions])];
9950
+ //#region src/programs/shared/abort-no-framework.ts
9951
+ function abortNoFrameworkDetected(overrides = {}) {
9952
+ const message = overrides.message ?? "Could not detect a framework";
9953
+ const outroData = {
9954
+ kind: "error",
9955
+ message,
9956
+ instruction: "Run the wizard from an app root directory.",
9957
+ body: "That's the folder containing package.json or an equivalent project file.",
9958
+ docsLabel: "Supported frameworks and manual setup:",
9959
+ docsUrl: "https://posthog.com/docs/libraries",
9960
+ ...overrides
9961
+ };
9962
+ throw new ProgramAbort({
9963
+ code: ErrorCodes.DetectNoFramework,
9964
+ message: [
9965
+ message,
9966
+ outroData.instruction,
9967
+ outroData.body,
9968
+ `${outroData.docsLabel} ${outroData.docsUrl}`
9969
+ ].join("\n\n"),
9970
+ outroData
9971
+ });
9957
9972
  }
9958
9973
  //#endregion
9959
9974
  //#region src/programs/posthog-integration/handoff.ts
@@ -10035,7 +10050,7 @@ function warehouseSourceUrl(host, projectId, kind) {
10035
10050
  * A pointer at the app, not an inline flow. Connecting a source needs
10036
10051
  * interactive credential collection, and chaining that as a second agent run
10037
10052
  * before the outro would let any of its terminal failure paths end the run
10038
- * — costing the user the success outro and the post-outro MCP / Slack steps on
10053
+ * — costing the user the success outro and the post-outro MCP step on
10039
10054
  * a run where PostHog installed fine.
10040
10055
  *
10041
10056
  * Each source gets its own pre-filled link, because the alternative we shipped
@@ -10140,16 +10155,13 @@ const config = {
10140
10155
  eventPlanFile: EVENT_PLAN_FILE,
10141
10156
  onReady: (ctx) => detectPostHogIntegration(ctx),
10142
10157
  disallowedTools: [WIZARD_TOOL_NAMES.wizardAsk],
10143
- oauthScopeAdditions: [...CONNECT_SLACK_SCOPE_ADDITIONS, ...WAREHOUSE_SOURCE_SCOPE_ADDITIONS],
10158
+ oauthScopeAdditions: [...WAREHOUSE_SOURCE_SCOPE_ADDITIONS],
10144
10159
  seedTasks: warehouseSeedTasks,
10145
10160
  excludedTaskTypes: (flags) => flags["wizard-default-aio-logs"] === "false" ? ["ai-observability", "logs"] : [],
10146
10161
  ciPreRun: async (session, runner) => {
10147
10162
  await scopeInstallDirToProject(session, runner);
10148
10163
  const integration = await detectFramework(session.installDir);
10149
- if (!integration) throw new ProgramAbort({
10150
- code: ErrorCodes.DetectNoFramework,
10151
- message: "Could not auto-detect your framework for this project."
10152
- });
10164
+ if (!integration) abortNoFrameworkDetected();
10153
10165
  session.integration = integration;
10154
10166
  analytics.setTag("integration", integration);
10155
10167
  const frameworkConfig = FRAMEWORK_REGISTRY[integration];
@@ -10167,6 +10179,7 @@ const config = {
10167
10179
  },
10168
10180
  run: async (session, runner) => {
10169
10181
  const config = session.frameworkConfig;
10182
+ if (!config) abortNoFrameworkDetected();
10170
10183
  const typeScriptDetected = isUsingTypeScript({ installDir: session.installDir });
10171
10184
  session.typescript = typeScriptDetected;
10172
10185
  analytics.setTag("typescript", typeScriptDetected);
@@ -10244,7 +10257,7 @@ ${warehouseReportInstruction(session)}
10244
10257
  postRun: async (sess, credentials) => {
10245
10258
  const envVars = config.environment.getEnvVars(credentials.projectApiKey, credentials.host.apiHost);
10246
10259
  if (config.environment.uploadToHosting) {
10247
- const { uploadEnvironmentVariablesStep } = await import("./upload-step-CEacB2RV.js");
10260
+ const { uploadEnvironmentVariablesStep } = await import("./upload-step-BlAN7MC5.js");
10248
10261
  const uploadedEnvVars = await uploadEnvironmentVariablesStep(envVars, {
10249
10262
  integration: config.metadata.integration,
10250
10263
  installDir: sess.installDir,
@@ -10286,6 +10299,6 @@ ${warehouseReportInstruction(session)}
10286
10299
  }
10287
10300
  };
10288
10301
  //#endregion
10289
- export { computeTokenCostUsd as A, detectFramework as C, streamMcpPrompt as D, scanInstalledSkill as E, formatTokenCount as M, runAgent as O, gatherFrameworkContext as S, SPINNER_MESSAGE as T, toIntegrationCandidates as _, ProgramAbort as a, loadWizardFlags as b, stampAiSdkDetected as c, findPackageJsons as d, DETECTED_WAREHOUSE_SOURCES_KEY as f, scopeInstallDirToProject as g, detectIntegrationProjects as h, withScopeAdditions as i, formatCostUsd as j, DEFAULT_BINDING as k, POSTHOG_SDKS as l, getDetectedWarehouseSources as m, WAREHOUSE_SOURCE_SCOPE_ADDITIONS as n, detectPostHogIntegration as o, detectWarehouseSources as p, CONNECT_SLACK_SCOPE_ADDITIONS as r, reportWarehouseSourcesDetected as s, config as t, STRIPE_SDKS as u, detectProjectsWithAgent as v, FRAMEWORK_REGISTRY as w, noteDetectedFramework as x, resolveProjectDir as y };
10302
+ export { formatCostUsd as A, FRAMEWORK_REGISTRY as C, runAgent as D, streamMcpPrompt as E, DEFAULT_BINDING as O, detectFramework as S, scanInstalledSkill as T, detectProjectsWithAgent as _, detectPostHogIntegration as a, noteDetectedFramework as b, POSTHOG_SDKS as c, DETECTED_WAREHOUSE_SOURCES_KEY as d, detectWarehouseSources as f, toIntegrationCandidates as g, scopeInstallDirToProject as h, ProgramAbort as i, formatTokenCount as j, computeTokenCostUsd as k, STRIPE_SDKS as l, detectIntegrationProjects as m, WAREHOUSE_SOURCE_SCOPE_ADDITIONS as n, reportWarehouseSourcesDetected as o, getDetectedWarehouseSources as p, abortNoFrameworkDetected as r, stampAiSdkDetected as s, config as t, findPackageJsons as u, resolveProjectDir as v, SPINNER_MESSAGE as w, gatherFrameworkContext as x, loadWizardFlags as y };
10290
10303
 
10291
- //# sourceMappingURL=posthog-integration-bwHwE87a.js.map
10304
+ //# sourceMappingURL=posthog-integration-FAWfClH3.js.map