@posthog/wizard 2.81.1 → 2.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-interface-DMP3DZRd.js → agent-interface-fcDXqb-_.js} +285 -66
- package/dist/agent-interface-fcDXqb-_.js.map +1 -0
- package/dist/{agent-prompt-loader-BrivWIna.js → agent-prompt-loader-F9gGPMt0.js} +6 -6
- package/dist/{agent-prompt-loader-BrivWIna.js.map → agent-prompt-loader-F9gGPMt0.js.map} +1 -1
- package/dist/analytics-C9QnGvuc.js +2 -0
- package/dist/{analytics-X7JfAmh6.js → analytics-GQv--mQm.js} +6 -4
- package/dist/analytics-GQv--mQm.js.map +1 -0
- package/dist/api-CsXfZKkq.js +2 -0
- package/dist/{api-BkDwZoL4.js → api-WUOSLXPJ.js} +71 -3
- package/dist/{api-BkDwZoL4.js.map → api-WUOSLXPJ.js.map} +1 -1
- package/dist/api-key-login-CDSxsYtP.js +2 -0
- package/dist/{api-key-login-DE0yKkP4.js → api-key-login-tysMeZnR.js} +5 -5
- package/dist/{api-key-login-DE0yKkP4.js.map → api-key-login-tysMeZnR.js.map} +1 -1
- package/dist/bin.js +1 -1
- package/dist/{bounded-fs-iDiqDQ9v.js → bounded-fs-B31zq2ir.js} +6 -4
- package/dist/bounded-fs-B31zq2ir.js.map +1 -0
- package/dist/{ci-install-BAftKh2Z.js → ci-install-CYSFbFXd.js} +4 -4
- package/dist/{ci-install-BAftKh2Z.js.map → ci-install-CYSFbFXd.js.map} +1 -1
- package/dist/{debug-C3tLP-ZW.js → debug-BTUMatFI.js} +3 -3
- package/dist/{debug-C3tLP-ZW.js.map → debug-BTUMatFI.js.map} +1 -1
- package/dist/{gateway-IQjQ582o.js → gateway-CJ8Jqbll.js} +20 -6
- package/dist/{gateway-IQjQ582o.js.map → gateway-CJ8Jqbll.js.map} +1 -1
- package/dist/{headless-XNvdWVEp.js → headless-DZ3mq07K.js} +1 -1
- package/dist/{headless-DOhxEmw5.js → headless-le-QqOuj.js} +2 -2
- package/dist/{headless-DOhxEmw5.js.map → headless-le-QqOuj.js.map} +1 -1
- package/dist/{host-resolution-DI2oucSK.js → host-resolution-Cht8bL39.js} +4 -4
- package/dist/{host-resolution-DI2oucSK.js.map → host-resolution-Cht8bL39.js.map} +1 -1
- package/dist/{install-DaZ6pvEl.js → install-55JbRsO-.js} +1 -1
- package/dist/{install-BixbBDLR.js → install-BhnFP3p3.js} +5 -5
- package/dist/{install-BixbBDLR.js.map → install-BhnFP3p3.js.map} +1 -1
- package/dist/{interactive-WLNQWF0D.js → interactive-9qRL8259.js} +3 -3
- package/dist/{interactive-WLNQWF0D.js.map → interactive-9qRL8259.js.map} +1 -1
- package/dist/{links-Bye4fsrj.js → links-5Blqk4Im.js} +3 -3
- package/dist/{links-Bye4fsrj.js.map → links-5Blqk4Im.js.map} +1 -1
- package/dist/{main-CN8nbuZO.js → main-CUIcozEG.js} +24 -21
- package/dist/main-CUIcozEG.js.map +1 -0
- package/dist/{mcp-B2o4d9DS.js → mcp-D73aCOHK.js} +3 -3
- package/dist/{mcp-B2o4d9DS.js.map → mcp-D73aCOHK.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-COs1DfAm.js → mcp-prompt-streaming-B5lIQ0l1.js} +5 -5
- package/dist/{mcp-prompt-streaming-COs1DfAm.js.map → mcp-prompt-streaming-B5lIQ0l1.js.map} +1 -1
- package/dist/{models-Cow22jET.js → models-CLTglHFZ.js} +6 -2
- package/dist/models-CLTglHFZ.js.map +1 -0
- package/dist/{oauth-session-Bj_-BY7o.js → oauth-session-CfkZ339p.js} +45 -3
- package/dist/oauth-session-CfkZ339p.js.map +1 -0
- package/dist/{orchestrator-tools-lhFIBGnp.js → orchestrator-tools-lvNVQhzs.js} +3 -3
- package/dist/{orchestrator-tools-lhFIBGnp.js.map → orchestrator-tools-lvNVQhzs.js.map} +1 -1
- package/dist/{package-manager-DZ4wcTz3.js → package-manager-BqRNp5y_.js} +4 -4
- package/dist/{package-manager-DZ4wcTz3.js.map → package-manager-BqRNp5y_.js.map} +1 -1
- package/dist/{pi-DREdQRPP.js → pi-2pYz2OY3.js} +61 -24
- package/dist/pi-2pYz2OY3.js.map +1 -0
- package/dist/{playground-CJx3lwTH.js → playground-jxZNxRwC.js} +4 -4
- package/dist/{playground-CJx3lwTH.js.map → playground-jxZNxRwC.js.map} +1 -1
- package/dist/{posthog-integration-DDSPdbpw.js → posthog-integration-DxRkw5DI.js} +79 -36
- package/dist/posthog-integration-DxRkw5DI.js.map +1 -0
- package/dist/{programs-DvlhdeM_.js → programs-D2793-PK.js} +2 -2
- package/dist/{programs-6SFfUBmm.js → programs-eTv2T2rs.js} +142 -62
- package/dist/programs-eTv2T2rs.js.map +1 -0
- package/dist/provisioning-CtQ0GEHa.js +2 -0
- package/dist/{provisioning-tRDPH7EQ.js → provisioning-c5JJ30KX.js} +4 -4
- package/dist/{provisioning-tRDPH7EQ.js.map → provisioning-c5JJ30KX.js.map} +1 -1
- package/dist/{queue-tools-DrJKvFHZ.js → queue-tools-10w8lhEs.js} +14 -5
- package/dist/queue-tools-10w8lhEs.js.map +1 -0
- package/dist/{results-Crcubw0Q.js → results-C45prSKD.js} +2 -2
- package/dist/{results-Crcubw0Q.js.map → results-C45prSKD.js.map} +1 -1
- package/dist/{run-DVFTMbxf.js → run-CM24OgPF.js} +10 -10
- package/dist/{run-DVFTMbxf.js.map → run-CM24OgPF.js.map} +1 -1
- package/dist/{run-BrIGaPy7.js → run-jugssomh.js} +7 -7
- package/dist/{run-BrIGaPy7.js.map → run-jugssomh.js.map} +1 -1
- package/dist/run-tool-BZFgFb_2.js +2 -0
- package/dist/{run-tool-CxdPXmlY.js → run-tool-DZrZFoGq.js} +13 -13
- package/dist/{run-tool-CxdPXmlY.js.map → run-tool-DZrZFoGq.js.map} +1 -1
- package/dist/{runners-loOOmHyc.js → runners-CoIYt0iI.js} +8 -8
- package/dist/{runners-loOOmHyc.js.map → runners-CoIYt0iI.js.map} +1 -1
- package/dist/{security-C_grSgIM.js → security-ppK2MwCn.js} +6 -5
- package/dist/{security-C_grSgIM.js.map → security-ppK2MwCn.js.map} +1 -1
- package/dist/{setup-utils-BYXbb9NM.js → setup-utils-B5E1rXLa.js} +3 -3
- package/dist/{setup-utils-BYXbb9NM.js.map → setup-utils-B5E1rXLa.js.map} +1 -1
- package/dist/{start-playground-Blh0Swil.js → start-playground-DujiUNFT.js} +7 -7
- package/dist/{start-playground-Blh0Swil.js.map → start-playground-DujiUNFT.js.map} +1 -1
- package/dist/{subagent-DQ_enM8C.js → subagent-BdDWA8j5.js} +12 -4
- package/dist/subagent-BdDWA8j5.js.map +1 -0
- package/dist/{task-Dm9wZbVW.js → task-Y8lWoDE7.js} +46 -23
- package/dist/task-Y8lWoDE7.js.map +1 -0
- package/dist/{telemetry-NeZhrBeW.js → telemetry-Cwqf0iur.js} +2 -2
- package/dist/{telemetry-NeZhrBeW.js.map → telemetry-Cwqf0iur.js.map} +1 -1
- package/dist/{terminal-Z4hCXfie.js → terminal-BLL-X6YP.js} +401 -41
- package/dist/terminal-BLL-X6YP.js.map +1 -0
- package/dist/{tools-dUJHRo6X.js → tools-C8k90ISV.js} +13 -13
- package/dist/{tools-dUJHRo6X.js.map → tools-C8k90ISV.js.map} +1 -1
- package/dist/{tools-1aM6bI9Y.js → tools-g42e5kJz.js} +15 -11
- package/dist/tools-g42e5kJz.js.map +1 -0
- package/dist/{tui-CCO7VVTA.js → tui-BPWJ-J-k.js} +1 -1
- package/dist/{tui-Cmi_ckGg.js → tui-CBnRWnrm.js} +4 -4
- package/dist/tui-CBnRWnrm.js.map +1 -0
- package/dist/{upload-step-e2Jp2fcr.js → upload-step-CFoxwd5t.js} +3 -3
- package/dist/{upload-step-e2Jp2fcr.js.map → upload-step-CFoxwd5t.js.map} +1 -1
- package/dist/{urls-Cu4RO30x.js → urls-BTZhm5eA.js} +2 -2
- package/dist/{urls-Cu4RO30x.js.map → urls-BTZhm5eA.js.map} +1 -1
- package/dist/{wizard-abort-BPEiPCXk.js → wizard-abort-HtpiSsQO.js} +4 -4
- package/dist/{wizard-abort-BPEiPCXk.js.map → wizard-abort-HtpiSsQO.js.map} +1 -1
- package/dist/{yara-hooks-canFIYTc.js → yara-hooks-BPYhN9WM.js} +4 -4
- package/dist/{yara-hooks-canFIYTc.js.map → yara-hooks-BPYhN9WM.js.map} +1 -1
- package/dist/{yara-hooks-CFD60h78.js → yara-hooks-BwhEDXIt.js} +1 -1
- package/package.json +1 -1
- package/dist/agent-interface-DMP3DZRd.js.map +0 -1
- package/dist/analytics-X7JfAmh6.js.map +0 -1
- package/dist/analytics-dcL9EQ4r.js +0 -2
- package/dist/api-BrMGAI-b.js +0 -2
- package/dist/api-key-login-CZEgx2jb.js +0 -2
- package/dist/bounded-fs-iDiqDQ9v.js.map +0 -1
- package/dist/main-CN8nbuZO.js.map +0 -1
- package/dist/models-Cow22jET.js.map +0 -1
- package/dist/oauth-session-Bj_-BY7o.js.map +0 -1
- package/dist/pi-DREdQRPP.js.map +0 -1
- package/dist/posthog-integration-DDSPdbpw.js.map +0 -1
- package/dist/programs-6SFfUBmm.js.map +0 -1
- package/dist/provisioning-CPGWgv7p.js +0 -2
- package/dist/queue-tools-DrJKvFHZ.js.map +0 -1
- package/dist/run-tool-GfISLgEs.js +0 -2
- package/dist/subagent-DQ_enM8C.js.map +0 -1
- package/dist/task-Dm9wZbVW.js.map +0 -1
- package/dist/terminal-Z4hCXfie.js.map +0 -1
- package/dist/tools-1aM6bI9Y.js.map +0 -1
- package/dist/tui-Cmi_ckGg.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground-
|
|
1
|
+
{"version":3,"file":"playground-jxZNxRwC.js","names":["runTuiPlayground"],"sources":["../src/cli/commands/basic-integration/playground.ts"],"sourcesContent":["import { VERSION } from '@shared/version';\nimport { runPlayground as runTuiPlayground } from '@tui';\nimport { exitWith } from '@cli/runners';\n\n/** Launch the TUI primitives playground. */\nexport function runPlayground(): void {\n exitWith(() => runTuiPlayground(VERSION));\n}\n"],"mappings":";;;;;AAKA,SAAgB,gBAAsB;AACpC,gBAAeA,gBAAiB,QAAQ,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
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-
|
|
3
|
-
import {
|
|
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-BTUMatFI.js";
|
|
3
|
+
import { $ as WIZARD_PROVISIONING_SCOPES, E as Harness, H as SETUP_REPORT_FILE, J as WIZARD_INTERACTION_EVENT_NAME, K as WIZARD_CONTACT_EMAIL, N as POSTHOG_DOCS_URL, O as Integration, Q as WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY, S as GPT5_6_TERRA_MODEL, U as SONNET_5_MODEL, W as Sequence, X as WIZARD_ORCHESTRATOR_FLAG_KEY, Y as WIZARD_OAUTH_SCOPES, Z as WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY, a as ciExcludedTaskTypes, b as GPT5_6_LUNA_MODEL, c as AGENTIC_DETECTION_RETRY_TIMEOUT_MS, it as getSkillsBaseUrl, n as analytics, nt as WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY, o as mayReportScanResults, p as DETECTION_TIMEOUT_MS, s as AGENTIC_DETECTION_FIRST_ATTEMPT_TIMEOUT_MS, v as EVENT_PLAN_FILE, w as HAIKU_MODEL, x as GPT5_6_SOL_MODEL } from "./analytics-GQv--mQm.js";
|
|
4
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-
|
|
6
|
-
import { a as safeReadFile, i as readProjectFile, n as boundedGlob, o as walkProjectFiles } from "./bounded-fs-
|
|
7
|
-
import { n as detectNodePackageManagers, t as detectAllPackageManagers } from "./package-manager-
|
|
5
|
+
import { r as withUtm, t as openTrackedLink } from "./links-5Blqk4Im.js";
|
|
6
|
+
import { a as safeReadFile, i as readProjectFile, n as boundedGlob, o as walkProjectFiles } from "./bounded-fs-B31zq2ir.js";
|
|
7
|
+
import { n as detectNodePackageManagers, t as detectAllPackageManagers } from "./package-manager-BqRNp5y_.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-
|
|
10
|
-
import { n as currentAccessToken } from "./oauth-session-
|
|
11
|
-
import {
|
|
12
|
-
import { a as requireKnownModel, o as triageModelFor, r as isValidModel } from "./models-
|
|
13
|
-
import {
|
|
14
|
-
import { n as mcpUrlFor } from "./host-resolution-
|
|
15
|
-
import { a as piBackend, d as
|
|
16
|
-
import {
|
|
17
|
-
import { a as flushScanReport, p as scanInstalledSkill$1, s as formatYaraAbortMessage, v as installSkillById, y as fetchSkillMenu } from "./yara-hooks-
|
|
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-
|
|
19
|
-
import { r as requestDeepLink } from "./provisioning-
|
|
9
|
+
import { i as createVersionBucket, n as isUsingTypeScript, r as tryGetPackageJson } from "./setup-utils-B5E1rXLa.js";
|
|
10
|
+
import { n as currentAccessToken } from "./oauth-session-CfkZ339p.js";
|
|
11
|
+
import { f as gatewayAuth, m as useRunGatewayCredential, s as AgentSignals } from "./gateway-CJ8Jqbll.js";
|
|
12
|
+
import { a as requireKnownModel, o as triageModelFor, r as isValidModel } from "./models-CLTglHFZ.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-fcDXqb-_.js";
|
|
14
|
+
import { n as mcpUrlFor } from "./host-resolution-Cht8bL39.js";
|
|
15
|
+
import { a as piBackend, d as createEmitLog, f as createEmitSpinner, p as createProgressCollector, u as createAioCapture } from "./pi-2pYz2OY3.js";
|
|
16
|
+
import { _ as TaskStatus, f as uncoveredBySink, g as SkipReason, h as QueueStore, m as QUEUE_DIR_NAME, u as dependencyClosure } from "./queue-tools-10w8lhEs.js";
|
|
17
|
+
import { a as flushScanReport, p as scanInstalledSkill$1, s as formatYaraAbortMessage, v as installSkillById, y as fetchSkillMenu } from "./yara-hooks-BPYhN9WM.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-F9gGPMt0.js";
|
|
19
|
+
import { r as requestDeepLink } from "./provisioning-c5JJ30KX.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";
|
|
@@ -26,9 +26,9 @@ import * as path$2 from "node:path";
|
|
|
26
26
|
import { execSync } from "node:child_process";
|
|
27
27
|
import * as fs$2 from "node:fs";
|
|
28
28
|
import fg from "fast-glob";
|
|
29
|
+
import fs$1 from "fs/promises";
|
|
29
30
|
import { randomUUID } from "crypto";
|
|
30
31
|
import { z } from "zod";
|
|
31
|
-
import fs$1 from "fs/promises";
|
|
32
32
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
33
33
|
//#region src/agent/runner/shared/bootstrap.ts
|
|
34
34
|
/**
|
|
@@ -69,6 +69,7 @@ async function prepareRun(config, input) {
|
|
|
69
69
|
skillsBaseUrl,
|
|
70
70
|
credentials,
|
|
71
71
|
programId,
|
|
72
|
+
handoffNotebook: config.handoffNotebook,
|
|
72
73
|
wizardFlags,
|
|
73
74
|
wizardFlagPayloads,
|
|
74
75
|
wizardMetadata,
|
|
@@ -168,6 +169,7 @@ const anthropicBackend = {
|
|
|
168
169
|
wizardFlags,
|
|
169
170
|
wizardMetadata,
|
|
170
171
|
programId: boot.programId,
|
|
172
|
+
handoffNotebook: boot.handoffNotebook,
|
|
171
173
|
integrationLabel: config.integrationLabel,
|
|
172
174
|
askBridge,
|
|
173
175
|
getPendingQuestion: askBridge?.getPendingQuestion,
|
|
@@ -223,6 +225,7 @@ const anthropicBackend = {
|
|
|
223
225
|
detectPackageManager: detectNodePackageManagers,
|
|
224
226
|
skillsBaseUrl: boot.skillsBaseUrl,
|
|
225
227
|
programId: boot.programId,
|
|
228
|
+
handoffNotebook: boot.handoffNotebook,
|
|
226
229
|
wizardFlags: boot.wizardFlags,
|
|
227
230
|
wizardMetadata: boot.wizardMetadata,
|
|
228
231
|
integrationLabel: config.programId,
|
|
@@ -2256,13 +2259,24 @@ async function askSeededConsent(type, notice, options = {}) {
|
|
|
2256
2259
|
function canAsk(prompt) {
|
|
2257
2260
|
return (prompt?.allowedTools ?? []).includes(ASK_TOOL);
|
|
2258
2261
|
}
|
|
2259
|
-
/**
|
|
2260
|
-
function
|
|
2262
|
+
/** Every task holds publish_handoff, but only the flow's sink owns the run report. */
|
|
2263
|
+
function deliversRunReport(sinkTypes, taskType, event) {
|
|
2264
|
+
return event.kind === "handoff" && sinkTypes.includes(taskType);
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Splits terminal failures into run-failing (required) and reported-only:
|
|
2268
|
+
* optional tasks, and required tasks that failed after they delivered the run
|
|
2269
|
+
* report to the user.
|
|
2270
|
+
*/
|
|
2271
|
+
function drainVerdict(tasks, reportDeliveredIds = /* @__PURE__ */ new Set()) {
|
|
2261
2272
|
const failed = tasks.filter((t) => t.status === TaskStatus.Failed);
|
|
2262
2273
|
const pending = tasks.filter((t) => t.status === TaskStatus.Pending);
|
|
2274
|
+
const optional = (t) => t.optional === true;
|
|
2275
|
+
const delivered = (t) => !optional(t) && reportDeliveredIds.has(t.id);
|
|
2263
2276
|
return {
|
|
2264
|
-
requiredFailedTypes: failed.filter((t) => t
|
|
2265
|
-
optionalFailedTypes: failed.filter(
|
|
2277
|
+
requiredFailedTypes: failed.filter((t) => !optional(t) && !delivered(t)).map((t) => t.type),
|
|
2278
|
+
optionalFailedTypes: failed.filter(optional).map((t) => t.type),
|
|
2279
|
+
deliveredFailedTypes: failed.filter(delivered).map((t) => t.type),
|
|
2266
2280
|
blocked: pending.length,
|
|
2267
2281
|
blockedTypes: pending.map((t) => t.type)
|
|
2268
2282
|
};
|
|
@@ -2337,7 +2351,11 @@ function effectiveExcludedTaskTypes(source, flags) {
|
|
|
2337
2351
|
}
|
|
2338
2352
|
async function runOrchestrator(context) {
|
|
2339
2353
|
const controller = new AbortController();
|
|
2340
|
-
|
|
2354
|
+
let hostCancelled = false;
|
|
2355
|
+
const abortFromHost = () => {
|
|
2356
|
+
hostCancelled = true;
|
|
2357
|
+
controller.abort();
|
|
2358
|
+
};
|
|
2341
2359
|
context.signal?.addEventListener("abort", abortFromHost, { once: true });
|
|
2342
2360
|
if (context.signal?.aborted) abortFromHost();
|
|
2343
2361
|
let cleaned = false;
|
|
@@ -2359,13 +2377,13 @@ async function runOrchestrator(context) {
|
|
|
2359
2377
|
return await executeOrchestrator({
|
|
2360
2378
|
...context,
|
|
2361
2379
|
signal: controller.signal
|
|
2362
|
-
}, cleanupQueue, controller);
|
|
2380
|
+
}, cleanupQueue, controller, () => hostCancelled);
|
|
2363
2381
|
} finally {
|
|
2364
2382
|
context.signal?.removeEventListener("abort", abortFromHost);
|
|
2365
2383
|
cleanupQueue();
|
|
2366
2384
|
}
|
|
2367
2385
|
}
|
|
2368
|
-
async function executeOrchestrator({ config, input, boot, emit, interaction, signal }, cleanupQueue, controller) {
|
|
2386
|
+
async function executeOrchestrator({ config, input, boot, emit, interaction, signal }, cleanupQueue, controller, hostCancelled) {
|
|
2369
2387
|
if (signal?.aborted) return cancelledRun();
|
|
2370
2388
|
const runId = randomUUID();
|
|
2371
2389
|
const { run } = config;
|
|
@@ -2393,6 +2411,7 @@ async function executeOrchestrator({ config, input, boot, emit, interaction, sig
|
|
|
2393
2411
|
const runStartMs = Date.now();
|
|
2394
2412
|
const metrics = new RunMetrics(runStartMs);
|
|
2395
2413
|
const durationMs = (t) => t.startedAt && t.finishedAt ? Date.parse(t.finishedAt) - Date.parse(t.startedAt) : void 0;
|
|
2414
|
+
const reportDeliveredIds = /* @__PURE__ */ new Set();
|
|
2396
2415
|
const store = new QueueStore(input.installDir, runId, { onTransition: (event, task) => {
|
|
2397
2416
|
const pick = resolveHarness(switchboardCtx, task.type);
|
|
2398
2417
|
const specModel = taskModelSpec(registry, task, pick.harness).model;
|
|
@@ -2437,7 +2456,8 @@ async function executeOrchestrator({ config, input, boot, emit, interaction, sig
|
|
|
2437
2456
|
analytics.wizardCapture("orchestrator task failed", {
|
|
2438
2457
|
...base,
|
|
2439
2458
|
duration_ms: durationMs(task),
|
|
2440
|
-
error: task.error?.type
|
|
2459
|
+
error: task.error?.type,
|
|
2460
|
+
report_delivered: reportDeliveredIds.has(task.id)
|
|
2441
2461
|
});
|
|
2442
2462
|
break;
|
|
2443
2463
|
case "requeue": break;
|
|
@@ -2678,7 +2698,10 @@ or integrate manually here:
|
|
|
2678
2698
|
config,
|
|
2679
2699
|
input,
|
|
2680
2700
|
boot,
|
|
2681
|
-
emit
|
|
2701
|
+
emit: (event) => {
|
|
2702
|
+
if (deliversRunReport(registry.sinkTypes, task.type, event)) reportDeliveredIds.add(task.id);
|
|
2703
|
+
emit(event);
|
|
2704
|
+
},
|
|
2682
2705
|
prompt: assembleTaskPrompt(promptContext, resolved.prompt, skillPaths),
|
|
2683
2706
|
spinner,
|
|
2684
2707
|
model: requireKnownModel(taskModel.model, taskPick.model),
|
|
@@ -2728,6 +2751,7 @@ or integrate manually here:
|
|
|
2728
2751
|
};
|
|
2729
2752
|
if (skipDeclinedSeededTasks(store, seededConsent, labelFor) > 0) renderQueue();
|
|
2730
2753
|
let fatal;
|
|
2754
|
+
let deliveredFatal = false;
|
|
2731
2755
|
try {
|
|
2732
2756
|
await drainQueue(store, runTask, {
|
|
2733
2757
|
...DEFAULT_DRAIN_OPTIONS,
|
|
@@ -2737,6 +2761,19 @@ or integrate manually here:
|
|
|
2737
2761
|
} catch (error) {
|
|
2738
2762
|
if (!(error instanceof RunTaskFatal)) throw error;
|
|
2739
2763
|
fatal = error;
|
|
2764
|
+
const running = store.list().filter((t) => t.status === TaskStatus.Running);
|
|
2765
|
+
const sink = running.find((t) => t.type === fatal?.taskType && reportDeliveredIds.has(t.id));
|
|
2766
|
+
if (!hostCancelled() && sink && running.length === 1) {
|
|
2767
|
+
const verdict = drainVerdict(store.list(), reportDeliveredIds);
|
|
2768
|
+
if (verdict.requiredFailedTypes.length === 0 && verdict.blocked === 0) {
|
|
2769
|
+
store.fail(sink.id, {
|
|
2770
|
+
type: "fatal-after-report",
|
|
2771
|
+
message: fatal.message
|
|
2772
|
+
});
|
|
2773
|
+
deliveredFatal = true;
|
|
2774
|
+
fatal = void 0;
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2740
2777
|
} finally {
|
|
2741
2778
|
config.hooks?.recordTaskOutcomes?.(store.list().map((t) => ({
|
|
2742
2779
|
type: t.type,
|
|
@@ -2744,7 +2781,7 @@ or integrate manually here:
|
|
|
2744
2781
|
optional: t.optional === true
|
|
2745
2782
|
})));
|
|
2746
2783
|
try {
|
|
2747
|
-
if (!signal?.aborted && referenceSkillId && referenceInstallPath) promoteReferenceSkill(path$3.join(input.installDir, referenceInstallPath), claudeSkillsDir, referenceSkillId);
|
|
2784
|
+
if ((!signal?.aborted || deliveredFatal) && referenceSkillId && referenceInstallPath) promoteReferenceSkill(path$3.join(input.installDir, referenceInstallPath), claudeSkillsDir, referenceSkillId);
|
|
2748
2785
|
} catch (err) {
|
|
2749
2786
|
try {
|
|
2750
2787
|
analytics.captureException(err instanceof Error ? err : new Error(String(err)), { step: "orchestrator_reference_promote" });
|
|
@@ -2759,8 +2796,9 @@ or integrate manually here:
|
|
|
2759
2796
|
} catch {}
|
|
2760
2797
|
}
|
|
2761
2798
|
}
|
|
2799
|
+
if (hostCancelled()) return cancelledRun();
|
|
2762
2800
|
if (fatal) {
|
|
2763
|
-
const stoppedBy = drainVerdict(store.list()).requiredFailedTypes;
|
|
2801
|
+
const stoppedBy = drainVerdict(store.list(), reportDeliveredIds).requiredFailedTypes;
|
|
2764
2802
|
if (fatal.taskType && !stoppedBy.includes(fatal.taskType)) stoppedBy.push(fatal.taskType);
|
|
2765
2803
|
reportBlockedTasks(store.list(), stoppedBy);
|
|
2766
2804
|
return {
|
|
@@ -2768,7 +2806,7 @@ or integrate manually here:
|
|
|
2768
2806
|
failure: fatal.failure
|
|
2769
2807
|
};
|
|
2770
2808
|
}
|
|
2771
|
-
if (signal?.aborted) return cancelledRun();
|
|
2809
|
+
if (signal?.aborted && !deliveredFatal) return cancelledRun();
|
|
2772
2810
|
renderQueue();
|
|
2773
2811
|
const summary = store.summary();
|
|
2774
2812
|
logToFile(`[orchestrator] DONE done=${summary.done} failed=${summary.failed} total=${summary.total}`);
|
|
@@ -2785,7 +2823,7 @@ or integrate manually here:
|
|
|
2785
2823
|
const reviewTask = store.list().find((t) => t.type === "review");
|
|
2786
2824
|
const conflict = reviewTask ? store.readHandoff(reviewTask.id)?.conflict : void 0;
|
|
2787
2825
|
const notRequired = summary[TaskStatus.Skipped];
|
|
2788
|
-
const verdict = drainVerdict(store.list());
|
|
2826
|
+
const verdict = drainVerdict(store.list(), reportDeliveredIds);
|
|
2789
2827
|
const blocked = verdict.blocked;
|
|
2790
2828
|
reportBlockedTasks(store.list(), verdict.requiredFailedTypes);
|
|
2791
2829
|
if (verdict.requiredFailedTypes.length > 0 || blocked > 0) {
|
|
@@ -2812,7 +2850,11 @@ or integrate manually here:
|
|
|
2812
2850
|
error: new WizardError("orchestrator drain produced zero tasks", { queue_state: JSON.stringify(store.list()) }, ErrorCodes.AgentOrchestratorHollowRun)
|
|
2813
2851
|
});
|
|
2814
2852
|
const optionalFailedCount = verdict.optionalFailedTypes.length;
|
|
2815
|
-
const stepNotes = [
|
|
2853
|
+
const stepNotes = [
|
|
2854
|
+
notRequired > 0 ? `${notRequired} skipped as not required` : "",
|
|
2855
|
+
optionalFailedCount > 0 ? `${optionalFailedCount} optional step failed` : "",
|
|
2856
|
+
verdict.deliveredFailedTypes.length > 0 ? "report delivered, then its step failed" : ""
|
|
2857
|
+
].filter(Boolean);
|
|
2816
2858
|
const message = conflict ? "PostHog set up, with one conflict to review." : `PostHog set up: ${summary.done}/${summary.total - notRequired - optionalFailedCount} steps completed${stepNotes.length > 0 ? ` (${stepNotes.join(", ")})` : ""}.`;
|
|
2817
2859
|
const outro = {
|
|
2818
2860
|
kind: "success",
|
|
@@ -3205,7 +3247,7 @@ function safeErrorMessage(error) {
|
|
|
3205
3247
|
* chunk does not grow.
|
|
3206
3248
|
*/
|
|
3207
3249
|
async function scanInstalledSkill(skillDir, llmProvider) {
|
|
3208
|
-
return (await import("./yara-hooks-
|
|
3250
|
+
return (await import("./yara-hooks-BwhEDXIt.js")).scanInstalledSkill(skillDir, llmProvider);
|
|
3209
3251
|
}
|
|
3210
3252
|
/**
|
|
3211
3253
|
* The MCP tutorial's prompt stream: one prompt against the PostHog MCP server,
|
|
@@ -3214,7 +3256,7 @@ async function scanInstalledSkill(skillDir, llmProvider) {
|
|
|
3214
3256
|
* startup chunk does not grow.
|
|
3215
3257
|
*/
|
|
3216
3258
|
async function* streamMcpPrompt(args) {
|
|
3217
|
-
yield* (await import("./mcp-prompt-streaming-
|
|
3259
|
+
yield* (await import("./mcp-prompt-streaming-B5lIQ0l1.js")).streamMcpPrompt(args);
|
|
3218
3260
|
}
|
|
3219
3261
|
//#endregion
|
|
3220
3262
|
//#region src/programs/frameworks/python/utils.ts
|
|
@@ -5509,7 +5551,7 @@ const KMP_AGENT_CONFIG = {
|
|
|
5509
5551
|
getAdditionalContextLines: () => [
|
|
5510
5552
|
"Framework docs ID: kmp (use posthog://docs/frameworks/kmp for documentation)",
|
|
5511
5553
|
"Initialize once, early in the app lifecycle, from shared code. All PostHog APIs live in the com.posthog.kmp package.",
|
|
5512
|
-
"Setup call: PostHog.setup(config = PostHogConfig(
|
|
5554
|
+
"Setup call: PostHog.setup(config = PostHogConfig(projectToken = \"<POSTHOG_PROJECT_TOKEN>\", host = \"<POSTHOG_HOST>\"), context = PostHogContext())",
|
|
5513
5555
|
"PostHogContext is platform-specific: on Android pass the Application via PostHogContext(application); on iOS and Web use the no-argument PostHogContext().",
|
|
5514
5556
|
"Imports: com.posthog.kmp.PostHog, com.posthog.kmp.PostHogConfig, com.posthog.kmp.PostHogContext."
|
|
5515
5557
|
]
|
|
@@ -10152,6 +10194,7 @@ const config = {
|
|
|
10152
10194
|
description: "Set up PostHog SDK integration",
|
|
10153
10195
|
id: "posthog-integration",
|
|
10154
10196
|
agentFlow: "integration-v2",
|
|
10197
|
+
handoffNotebook: true,
|
|
10155
10198
|
eventPlanFile: EVENT_PLAN_FILE,
|
|
10156
10199
|
onReady: (ctx) => detectPostHogIntegration(ctx),
|
|
10157
10200
|
disallowedTools: [WIZARD_TOOL_NAMES.wizardAsk],
|
|
@@ -10257,7 +10300,7 @@ ${warehouseReportInstruction(session)}
|
|
|
10257
10300
|
postRun: async (sess, credentials) => {
|
|
10258
10301
|
const envVars = config.environment.getEnvVars(credentials.projectApiKey, credentials.host.apiHost);
|
|
10259
10302
|
if (config.environment.uploadToHosting) {
|
|
10260
|
-
const { uploadEnvironmentVariablesStep } = await import("./upload-step-
|
|
10303
|
+
const { uploadEnvironmentVariablesStep } = await import("./upload-step-CFoxwd5t.js");
|
|
10261
10304
|
const uploadedEnvVars = await uploadEnvironmentVariablesStep(envVars, {
|
|
10262
10305
|
integration: config.metadata.integration,
|
|
10263
10306
|
installDir: sess.installDir,
|
|
@@ -10301,4 +10344,4 @@ ${warehouseReportInstruction(session)}
|
|
|
10301
10344
|
//#endregion
|
|
10302
10345
|
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 };
|
|
10303
10346
|
|
|
10304
|
-
//# sourceMappingURL=posthog-integration-
|
|
10347
|
+
//# sourceMappingURL=posthog-integration-DxRkw5DI.js.map
|