@posthog/wizard 2.75.0 → 2.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-mcp-server-to-clients-CjfnPMbO.js → add-mcp-server-to-clients-Exddicp2.js} +5 -5
- package/dist/{add-mcp-server-to-clients-CjfnPMbO.js.map → add-mcp-server-to-clients-Exddicp2.js.map} +1 -1
- package/dist/{agent-interface-BKLTDSyN.js → agent-interface-CZWRgZMc.js} +69 -46
- package/dist/agent-interface-CZWRgZMc.js.map +1 -0
- package/dist/{agent-prompt-loader-DAagxT3p.js → agent-prompt-loader-BobuLDIg.js} +5 -5
- package/dist/{agent-prompt-loader-DAagxT3p.js.map → agent-prompt-loader-BobuLDIg.js.map} +1 -1
- package/dist/{agent-runner-BkQontri.js → agent-runner-C_R1X_UT.js} +40 -16
- package/dist/agent-runner-C_R1X_UT.js.map +1 -0
- package/dist/{analytics-DSK0GXg1.js → analytics-C_RyE8fz.js} +3 -2
- package/dist/analytics-C_RyE8fz.js.map +1 -0
- package/dist/analytics-DXvdQqyp.js +2 -0
- package/dist/{api-CwNulLDK.js → api-k5aGQpIZ.js} +3 -3
- package/dist/{api-CwNulLDK.js.map → api-k5aGQpIZ.js.map} +1 -1
- package/dist/bin.js +83 -59
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-D85Tk3nS.js → bounded-fs-BHLy83N9.js} +3 -3
- package/dist/{bounded-fs-D85Tk3nS.js.map → bounded-fs-BHLy83N9.js.map} +1 -1
- package/dist/{ci-install-CQLi_a-r.js → ci-install-CXt4c41q.js} +4 -4
- package/dist/{ci-install-CQLi_a-r.js.map → ci-install-CXt4c41q.js.map} +1 -1
- package/dist/{debug-CBmI5YUF.js → debug-BxMMpepn.js} +1 -1
- package/dist/{debug-DUmMVUHn.js → debug-C5Zz8hmm.js} +6 -4
- package/dist/{debug-DUmMVUHn.js.map → debug-C5Zz8hmm.js.map} +1 -1
- package/dist/{defaults-DDDwYTN5.js → defaults-DulzMJpN.js} +1 -1
- package/dist/{defaults-DDDwYTN5.js.map → defaults-DulzMJpN.js.map} +1 -1
- package/dist/{env-api-key-CGC1Bqwq.js → env-api-key-Ca-CrkgV.js} +2 -2
- package/dist/{env-api-key-CGC1Bqwq.js.map → env-api-key-Ca-CrkgV.js.map} +1 -1
- package/dist/{environment-DC4RDnzR.js → environment-B0uTamFf.js} +4 -4
- package/dist/{environment-DC4RDnzR.js.map → environment-B0uTamFf.js.map} +1 -1
- package/dist/file-CNstcW8F.js +60 -0
- package/dist/file-CNstcW8F.js.map +1 -0
- package/dist/{file-watcher-hafFFQib.js → file-watcher-CiT-oZpu.js} +2 -2
- package/dist/{file-watcher-hafFFQib.js.map → file-watcher-CiT-oZpu.js.map} +1 -1
- package/dist/{gateway-session-zwwZAyTt.js → gateway-session-BIVN_Xfr.js} +1 -1
- package/dist/{gateway-session-Ctc2xaz7.js → gateway-session-C3Uqwc4R.js} +4 -4
- package/dist/{gateway-session-Ctc2xaz7.js.map → gateway-session-C3Uqwc4R.js.map} +1 -1
- package/dist/{headless-ui-CQ46FOTh.js → headless-ui-TpSp-F43.js} +10 -5
- package/dist/headless-ui-TpSp-F43.js.map +1 -0
- package/dist/{interactive-5O4XQf59.js → interactive-B72L-sO5.js} +2 -2
- package/dist/{interactive-5O4XQf59.js.map → interactive-B72L-sO5.js.map} +1 -1
- package/dist/{mcp-D0Dni4tL.js → mcp-CNc6CLK0.js} +2 -2
- package/dist/{mcp-D0Dni4tL.js.map → mcp-CNc6CLK0.js.map} +1 -1
- package/dist/{mcp-prompt-streaming-DNCDeU51.js → mcp-prompt-streaming-BvBNkzjv.js} +5 -5
- package/dist/{mcp-prompt-streaming-DNCDeU51.js.map → mcp-prompt-streaming-BvBNkzjv.js.map} +1 -1
- package/dist/{mint-failure-CQqypC_v.js → mint-failure-CZ5FZ0Jd.js} +38 -17
- package/dist/mint-failure-CZ5FZ0Jd.js.map +1 -0
- package/dist/{non-interactive-D5-lCBy6.js → non-interactive-UeQlnU0U.js} +2 -2
- package/dist/{non-interactive-D5-lCBy6.js.map → non-interactive-UeQlnU0U.js.map} +1 -1
- package/dist/{orchestrator-tools-D8ZQS2DM.js → orchestrator-tools-CLADku26.js} +3 -3
- package/dist/{orchestrator-tools-D8ZQS2DM.js.map → orchestrator-tools-CLADku26.js.map} +1 -1
- package/dist/{package-manager-hyP-CPSZ.js → package-manager-CppzeIgu.js} +2 -2
- package/dist/{package-manager-hyP-CPSZ.js.map → package-manager-CppzeIgu.js.map} +1 -1
- package/dist/{pi-DARAk2I_.js → pi-Bs1Tbt0C.js} +12 -12
- package/dist/{pi-DARAk2I_.js.map → pi-Bs1Tbt0C.js.map} +1 -1
- package/dist/{playground-Djabnagq.js → playground-CZgZX4j0.js} +6 -6
- package/dist/{playground-Djabnagq.js.map → playground-CZgZX4j0.js.map} +1 -1
- package/dist/{posthog-C3Sncfan.js → posthog-BZ3NNCyh.js} +2 -2
- package/dist/{posthog-C3Sncfan.js.map → posthog-BZ3NNCyh.js.map} +1 -1
- package/dist/{provisioning-B74q1uSQ.js → provisioning-Ba7GWKzK.js} +3 -3
- package/dist/{provisioning-B74q1uSQ.js.map → provisioning-Ba7GWKzK.js.map} +1 -1
- package/dist/{queue-tools-FLMG8hcB.js → queue-tools-D09PNS0X.js} +3 -3
- package/dist/{queue-tools-FLMG8hcB.js.map → queue-tools-D09PNS0X.js.map} +1 -1
- package/dist/{registry-DZoReEU3.js → registry-COcpEsMD.js} +5 -5
- package/dist/{registry-DZoReEU3.js.map → registry-COcpEsMD.js.map} +1 -1
- package/dist/{security-DiBFYwh7.js → security-CpAT0fZa.js} +5 -5
- package/dist/{security-DiBFYwh7.js.map → security-CpAT0fZa.js.map} +1 -1
- package/dist/{setup-utils-C3tsa6D6.js → setup-utils-BUAoRjw3.js} +8 -8
- package/dist/{setup-utils-C3tsa6D6.js.map → setup-utils-BUAoRjw3.js.map} +1 -1
- package/dist/{start-tui-BXjJGNx2.js → start-tui-Bz23_yym.js} +20 -33
- package/dist/start-tui-Bz23_yym.js.map +1 -0
- package/dist/{steps-CeFanezY.js → steps-DbsDish5.js} +7 -7
- package/dist/{steps-CeFanezY.js.map → steps-DbsDish5.js.map} +1 -1
- package/dist/{store-DN_6FaoQ.js → store-D5ROpUje.js} +5 -5
- package/dist/store-D5ROpUje.js.map +1 -0
- package/dist/{subagent-BzhCH9c3.js → subagent-CSBZnhgK.js} +2 -2
- package/dist/{subagent-BzhCH9c3.js.map → subagent-CSBZnhgK.js.map} +1 -1
- package/dist/{task-DZKmaWYF.js → task-D8sTR7jZ.js} +17 -14
- package/dist/task-D8sTR7jZ.js.map +1 -0
- package/dist/{task-stream-h-b1nWdM.js → task-stream-Dl0XEsZ9.js} +48 -6
- package/dist/task-stream-Dl0XEsZ9.js.map +1 -0
- package/dist/{tasks-0Rb5AXpz.js → tasks-BDt427kT.js} +2 -2
- package/dist/{tasks-0Rb5AXpz.js.map → tasks-BDt427kT.js.map} +1 -1
- package/dist/{telemetry-QpeVhVtU.js → telemetry-Dp6zjZBj.js} +3 -3
- package/dist/{telemetry-QpeVhVtU.js.map → telemetry-Dp6zjZBj.js.map} +1 -1
- package/dist/{terminal-dLoYiXsd.js → terminal-pInlleVD.js} +12 -12
- package/dist/{terminal-dLoYiXsd.js.map → terminal-pInlleVD.js.map} +1 -1
- package/dist/{tools-DmwO0eBZ.js → tools-MkyMOjQI.js} +82 -18
- package/dist/tools-MkyMOjQI.js.map +1 -0
- package/dist/{wizard-abort-B0c5VDie.js → wizard-abort-BCnUgT9z.js} +3 -3
- package/dist/{wizard-abort-B0c5VDie.js.map → wizard-abort-BCnUgT9z.js.map} +1 -1
- package/dist/{wizard-abort-C9Jbm-m7.js → wizard-abort-BHLKVKLN.js} +1 -1
- package/dist/{yara-hooks-uCiAIcqU.js → yara-hooks-BJWVgTpU.js} +4 -4
- package/dist/{yara-hooks-uCiAIcqU.js.map → yara-hooks-BJWVgTpU.js.map} +1 -1
- package/dist/yara-hooks-Dp82xJGd.js +2 -0
- package/package.json +1 -1
- package/dist/agent-interface-BKLTDSyN.js.map +0 -1
- package/dist/agent-runner-BkQontri.js.map +0 -1
- package/dist/analytics-DSK0GXg1.js.map +0 -1
- package/dist/analytics-yurAACt5.js +0 -2
- package/dist/headless-ui-CQ46FOTh.js.map +0 -1
- package/dist/mint-failure-CQqypC_v.js.map +0 -1
- package/dist/start-tui-BXjJGNx2.js.map +0 -1
- package/dist/store-DN_6FaoQ.js.map +0 -1
- package/dist/task-DZKmaWYF.js.map +0 -1
- package/dist/task-stream-h-b1nWdM.js.map +0 -1
- package/dist/tools-DmwO0eBZ.js.map +0 -1
- package/dist/yara-hooks-B7prW1Ng.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-prompt-streaming-DNCDeU51.js","names":[],"sources":["../src/lib/agent/mcp-prompt-streaming.ts"],"sourcesContent":["/**\n * Streaming prompt runner for the McpSuggestedPromptsScreen.\n *\n * Calls the Claude Agent SDK's `query()` directly with just the PostHog\n * MCP server configured — no skills, no sandbox, no settings sources,\n * no wizard-tools. This is the lightweight cousin of `runAgent` in\n * `agent-interface.ts`: same SDK, much narrower surface, suitable for\n * \"user asked a question, show the answer\" interactions.\n *\n * The function is an async generator that yields `AgentChunk`s extracted\n * from the SDK's message stream. Callers (the screen) consume them via\n * `for await (...)` and render as they arrive.\n */\n\nimport type { AgentChunk } from '@ui/tui/services/mcp-suggested-prompts-services';\nimport type { Credentials } from '@lib/wizard-session';\nimport { DEFAULT_AGENT_MODEL, WIZARD_USER_AGENT } from '@lib/constants';\nimport { logToFile } from '@utils/debug';\nimport { gatewayAuth } from '@lib/gateway-session';\nimport { buildAgentEnv, buildRunTags } from '@lib/agent/agent-interface';\nimport { sanitizeAgentSubprocessEnv } from '@lib/agent/agent-env-isolation';\nimport { createIsolatedAgentConfigDir } from '@lib/agent/stored-login';\nimport { analytics } from '@utils/analytics';\n\n// Cached SDK module — first call pays the dynamic-import cost; later\n// calls reuse the same module.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _sdkModule: any | null = null;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nasync function loadSdk(): Promise<any> {\n if (!_sdkModule) {\n _sdkModule = await import('@anthropic-ai/claude-agent-sdk');\n }\n return _sdkModule;\n}\n\nconst MODEL = DEFAULT_AGENT_MODEL;\n\n// Bounded turn count so a single prompt can't loop forever on the\n// user's nickel. 20 gives the agent room for non-trivial multi-step\n// chains (multi-tool reads → reason → write → verify → summarize) while\n// still capping runaway loops. Worth tuning down once we see real\n// telemetry on average turn counts per prompt.\nconst MAX_TURNS = 30;\n\n/**\n * Extract a short, single-line summary from an arbitrary value. Used\n * for tool-call args and tool-result bodies so the screen has something\n * compact to render.\n */\nfunction summarize(value: unknown, maxLen = 120): string {\n if (value == null) return '';\n let text: string;\n if (typeof value === 'string') text = value;\n else {\n try {\n text = JSON.stringify(value);\n } catch {\n text = String(value);\n }\n }\n text = text.replace(/\\s+/g, ' ').trim();\n if (text.length > maxLen) text = text.slice(0, maxLen - 1) + '…';\n return text;\n}\n\n/**\n * Convert one SDK message into zero or more AgentChunks. Mirrors the\n * subset of message shapes the wizard's main runAgent middleware\n * handles, but narrowed to just the kinds the screen needs to render.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction messageToChunks(message: any): AgentChunk[] {\n const chunks: AgentChunk[] = [];\n\n if (message?.type === 'assistant') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const content = message.message?.content;\n if (Array.isArray(content)) {\n for (const block of content) {\n if (!block || typeof block !== 'object') continue;\n const type = (block as { type?: string }).type;\n if (type === 'text') {\n const text = (block as { text?: string }).text ?? '';\n if (text) chunks.push({ kind: 'text', text });\n } else if (type === 'tool_use') {\n const name = (block as { name?: string }).name ?? 'tool';\n const input = (block as { input?: unknown }).input;\n // CLI mode's exec tool takes a `command` string; keep it verbatim so\n // the screen can recover the inner tool name for follow-ups.\n const command = (input as { command?: unknown })?.command;\n chunks.push({\n kind: 'tool-call',\n toolName: name,\n detail: summarize(input),\n command: typeof command === 'string' ? command : undefined,\n });\n }\n }\n }\n }\n\n if (message?.type === 'user') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const content = message.message?.content;\n if (Array.isArray(content)) {\n for (const block of content) {\n if (!block || typeof block !== 'object') continue;\n const type = (block as { type?: string }).type;\n if (type === 'tool_result') {\n const detail = summarize((block as { content?: unknown }).content);\n chunks.push({ kind: 'tool-result', toolName: 'tool', detail });\n }\n }\n }\n }\n\n if (message?.type === 'result') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const sessionId = (message as { session_id?: string }).session_id;\n chunks.push({ kind: 'done', sessionId });\n }\n\n return chunks;\n}\n\n/**\n * Build a system-prompt append that nudges the agent to fit its response\n * inside the current terminal window. We can't actually constrain Claude\n * — this is a soft cap that the model usually honors. The screen also\n * applies a hard truncation cap as a fallback for non-compliant runs.\n *\n * Core principle nudged at the model: TALL CONTENT IS BAD, WIDE CONTENT\n * IS GOOD. Default terminal is 120 columns × 24 rows — that's a lot of\n * horizontal space, not much vertical. Spread data across columns, never\n * stack it down rows when a horizontal layout would work.\n */\nfunction buildTerminalFitPrompt(): string {\n const cols = process.stdout.columns ?? 120;\n const rows = process.stdout.rows ?? 24;\n // Reserve rows for wizard chrome (title, status, hint, margins).\n const messageBudget = Math.max(8, rows - 10);\n\n return [\n `You are responding inside a CLI window that is exactly ${cols} columns wide and ${rows} rows tall. The user CAN'T SCROLL — your entire reply must fit on screen.`,\n ``,\n `LAYOUT PRINCIPLE: tall content is the enemy, wide content is your friend. You have ${cols} columns of horizontal space; use them. Spread data across columns instead of stacking it down rows.`,\n ``,\n `Tables:`,\n `- Max 5 body rows. The prompts the user picks already constrain results to 5 or fewer — honor that and do not pad with extra rows.`,\n `- If a tool result returns more than 5 items, show the top 5 and mention the rest count inline (e.g. \"...and 12 more\").`,\n `- Prefer transposing wide-but-short data (items across columns, metrics down rows) when labels are short.`,\n `- A two-column table with many rows is the tall layout to AVOID.`,\n ``,\n `Other limits:`,\n `- Aim for 3-5 lines of prose. Maximum ${messageBudget} lines total.`,\n `- DO NOT announce what you are about to do. Skip preamble like \"I'll query…\", \"Let me check…\", \"Now I'll…\", \"I'm going to…\". Go straight to running tools and then the answer.`,\n `- Lists: if there are 6+ short items, format them inline (comma-separated), not as a vertical bullet list.`,\n `- For tool results, summarize the 1-3 numbers that matter. Do NOT echo raw JSON or the full payload.`,\n `- Code blocks: no language tag, no leading blank lines.`,\n `- No closing pleasantries (\"let me know if…\", \"feel free to…\"). Stop when the answer is delivered.`,\n `- No section headers unless the response actually has multiple sections.`,\n ``,\n `Naming saved artifacts:`,\n `- Every dashboard, insight, notebook, or annotation you create MUST include \"(wizard MCP tutorial)\" at the end of its title or name field. Examples: \"Weekly signups (wizard MCP tutorial)\", \"Top errors this week (wizard MCP tutorial)\", \"Onboarding analysis (wizard MCP tutorial)\".`,\n `- This applies on both create AND rename calls. If the user asks you to rename a saved artifact, preserve the \"(wizard MCP tutorial)\" suffix unless they explicitly ask you to drop it.`,\n `- Reason: lets the user find / clean up everything this tutorial created from one search in PostHog. Don't skip it — it's the only signal they'll have that an artifact came from the wizard.`,\n ``,\n `Tone & framing:`,\n `- This is a tutorial demoing PostHog (the product the user just installed). You are showing it off, not auditing it. Stay constructive and neutral about PostHog throughout.`,\n `- Don't editorialize about PostHog's reliability, performance, or cost. Describe what the data shows; treat anomalies as the user's data, not a platform issue.`,\n `- If a tool call fails or returns nothing, say \"the query didn't return data — try a different angle\" or similar. Do NOT speculate about outages, gateway issues, MCP problems, or service health.`,\n `- Avoid value-laden phrases like \"worth investigating\", \"concerning\", \"red flag\", \"problematic\", \"suspicious\", \"alarming\" when describing the user's metrics. Stick to what the numbers show; the user draws conclusions.`,\n ].join('\\n');\n}\n\n/**\n * Gateway trace tags for a tutorial prompt run — without them the gateway has\n * nothing to attribute its `$ai_generation` events to. Returns `{}` when no\n * program is supplied. Exported so the contract is testable without the SDK.\n */\nexport function buildTutorialRunTags(args: {\n programId?: string;\n integration?: string;\n}): Record<string, string> {\n if (!args.programId) return {};\n return buildRunTags({\n programId: args.programId,\n // The tutorial usually has no detected framework; fall back to the\n // program so the axis is never an empty string.\n integration: args.integration ?? args.programId,\n runId: analytics.runId,\n build: analytics.build,\n });\n}\n\nexport async function* runMcpPromptViaSdk(args: {\n prompt: string;\n credentials: Credentials;\n signal: AbortSignal;\n /** When set, the SDK loads the named session's prior turns as\n * context so the follow-up prompt can reference what the agent\n * already showed. */\n resumeSessionId?: string;\n /** Program this run's gateway spend attributes to. Omitting it fails the run\n * rather than going unattributed, so every caller must supply one. */\n programId?: string;\n /** Integration label for the trace tags; the tutorial usually has none. */\n integration?: string;\n}): AsyncIterable<AgentChunk> {\n const { prompt, credentials, signal, resumeSessionId } = args;\n\n // Assembled here rather than passed in so the TUI service layer doesn't\n // have to import this module's dependencies.\n const wizardMetadata = buildTutorialRunTags(args);\n\n // Route the SDK's LLM calls through the PostHog AI gateway, authed\n // with the run's minted token. Set BEFORE loading the SDK in\n // case any in-process code reads env at module init (cached base\n // URLs, OAuth setup, etc.) — same reason `initializeAgent` does this\n // before its query() call. Without these the SDK tries to\n // authenticate directly against Anthropic and 401s with \"Invalid\n // authentication credentials\".\n process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS = 'true';\n\n // The url and the bearer are one unit: a run must take both from the same\n // mint.\n const auth = await gatewayAuth(\n credentials.host,\n credentials.accessToken,\n args.programId,\n );\n const gatewayUrl = auth.gatewayUrl;\n process.env.ANTHROPIC_BASE_URL = gatewayUrl;\n process.env.ANTHROPIC_AUTH_TOKEN = auth.token;\n process.env.CLAUDE_CODE_OAUTH_TOKEN = auth.token;\n\n logToFile(\n `[runMcpPromptViaSdk] gatewayUrl=${gatewayUrl} tokenPrefix=${\n auth.token ? auth.token.slice(0, 4) + '***' : '(missing)'\n }`,\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { query } = await loadSdk();\n\n // Bridge external AbortSignal → SDK AbortController.\n const abortController = new AbortController();\n if (signal.aborted) abortController.abort();\n else\n signal.addEventListener('abort', () => abortController.abort(), {\n once: true,\n });\n\n const mcpUrl = credentials.host.mcpUrl;\n logToFile(\n `[runMcpPromptViaSdk] mcpUrl=${mcpUrl} model=${MODEL} resume=${\n resumeSessionId ?? '(none)'\n }`,\n );\n\n // The SDK expects an async generator for the prompt that stays open\n // until the result is received. For a single-turn prompt we yield one\n // user message and then await an abort (which fires when streaming\n // completes or the caller cancels).\n const createPromptStream = async function* () {\n yield {\n type: 'user' as const,\n session_id: '',\n message: { role: 'user' as const, content: prompt },\n parent_tool_use_id: null,\n };\n // Hold the stream open until abort. The SDK closes its end when it\n // sees a `result` message; we close ours via the abortController in\n // the finally block below.\n await new Promise<void>((resolve) => {\n if (abortController.signal.aborted) {\n resolve();\n return;\n }\n abortController.signal.addEventListener('abort', () => resolve(), {\n once: true,\n });\n });\n };\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const response = query({\n prompt: createPromptStream(),\n options: {\n abortController,\n model: MODEL,\n cwd: process.cwd(),\n permissionMode: 'acceptEdits',\n maxTurns: MAX_TURNS,\n // Match agent-interface.ts — the 1M context beta is what keeps\n // resumed follow-up sessions from truncating after a few turns.\n betas: ['context-1m-2025-08-07'],\n // Only load project-level skills/settings. Without this the SDK\n // defaults to ['user', 'project'] and a user's\n // `~/.claude/settings.json` (apiKeyHelper / env block) can\n // override the OAuth routing we set above.\n settingSources: ['project'],\n // When set, the SDK replays the named session's turns into the\n // new query so the follow-up prompt has full conversation\n // context. Omit on the first prompt for a fresh session.\n ...(resumeSessionId ? { resume: resumeSessionId } : {}),\n // Without `canUseTool` the SDK falls back to \"ask the user\" on\n // every MCP tool call — `permissionMode: 'acceptEdits'` only\n // relaxes Edit/Write, not MCP. Our Ink TUI has no surface to\n // answer that prompt, so the agent would stall mid-stream\n // saying things like \"needs your approval to create dashboard\".\n // The tutorial's whole point is demoing the MCP tools against\n // the user's project, so we auto-allow everything that matches\n // the prefix and deny anything else (defense in depth — the\n // `allowedTools` filter above already enforces this).\n canUseTool: (toolName: string, input: unknown) => {\n if (toolName.startsWith('mcp__posthog-wizard__')) {\n return Promise.resolve({\n behavior: 'allow' as const,\n updatedInput: (input ?? {}) as Record<string, unknown>,\n });\n }\n logToFile(`[runMcpPromptViaSdk] denying non-MCP tool: ${toolName}`);\n return Promise.resolve({\n behavior: 'deny' as const,\n message: `${toolName} is not available in the MCP tutorial — only PostHog MCP tools are permitted.`,\n });\n },\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: buildTerminalFitPrompt(),\n },\n mcpServers: {\n 'posthog-wizard': {\n type: 'http',\n url: mcpUrl,\n headers: {\n // Env reference, not the token: the SDK puts this config on the\n // spawned CLI's argv, where `ps` shows it to any local process.\n Authorization: 'Bearer ${POSTHOG_MCP_TOKEN}',\n 'User-Agent': WIZARD_USER_AGENT,\n },\n // CLI mode's single `exec` tool carries the full command reference\n // on its schema — keep it in context, never deferred behind tool\n // search.\n alwaysLoad: true,\n },\n },\n // Only let the agent use MCP tools — no shell, no file I/O,\n // no Read/Edit/Write. This is a chat-with-MCP run, not a\n // wizard skill execution.\n allowedTools: ['mcp__posthog-wizard__*'],\n env: {\n // Drop the ENTIRE ANTHROPIC_*/CLAUDE_CODE_* namespace from the\n // inherited env so no shell/settings value can silently bypass the\n // PostHog gateway and defeat quota tracking / the OAuth flow; the\n // wizard's own gateway routing is injected fresh below. See\n // agent-env-isolation.ts.\n ...sanitizeAgentSubprocessEnv(process.env),\n // Gateway routing from this run's own auth, not process.env: a\n // concurrent run writes those globals too, and there is an await\n // between the write above and this read.\n ANTHROPIC_BASE_URL: auth.gatewayUrl,\n ANTHROPIC_AUTH_TOKEN: auth.token,\n CLAUDE_CODE_OAUTH_TOKEN: auth.token,\n // Point the binary at an empty config dir so it cannot resolve a\n // stored Claude login and send that to the gateway, which 401s it.\n // See stored-login.ts.\n CLAUDE_CONFIG_DIR: createIsolatedAgentConfigDir(),\n CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS: 'true',\n // The MCP config resolves this in the child; sending the value would\n // put it on the CLI's argv.\n POSTHOG_MCP_TOKEN: credentials.accessToken,\n // SDK 0.3.142+ connects MCP servers in the background by\n // default; without this the agent may try to call tools\n // before posthog-wizard is connected on turn 1.\n MCP_CONNECTION_NONBLOCKING: '0',\n // This run's trace tags, which the gateway reads to attribute its\n // `$ai_generation` events. Flags stay empty: the tutorial doesn't\n // fork on any.\n ANTHROPIC_CUSTOM_HEADERS: buildAgentEnv(\n wizardMetadata ?? {},\n {},\n auth.teamId,\n ),\n },\n },\n });\n\n for await (const message of response as AsyncIterable<unknown>) {\n if (signal.aborted) return;\n for (const chunk of messageToChunks(message)) {\n yield chunk;\n if (chunk.kind === 'done') return;\n }\n }\n } catch (err) {\n const text = err instanceof Error ? err.message : String(err);\n logToFile(`[runMcpPromptViaSdk] error: ${text}`);\n yield { kind: 'error', text };\n } finally {\n // Closes the prompt stream so `query()` shuts down cleanly even if\n // we never saw a 'result' message.\n abortController.abort();\n }\n}\n"],"mappings":";;;;;AA2BA,IAAI,aAAyB;AAG7B,eAAe,UAAwB;AACrC,KAAI,CAAC,WACH,cAAa,MAAM,OAAO;AAE5B,QAAO;;AAGT,MAAM,QAAQ;AAOd,MAAM,YAAY;;;;;;AAOlB,SAAS,UAAU,OAAgB,SAAS,KAAa;AACvD,KAAI,SAAS,KAAM,QAAO;CAC1B,IAAI;AACJ,KAAI,OAAO,UAAU,SAAU,QAAO;KAEpC,KAAI;AACF,SAAO,KAAK,UAAU,MAAM;SACtB;AACN,SAAO,OAAO,MAAM;;AAGxB,QAAO,KAAK,QAAQ,QAAQ,IAAI,CAAC,MAAM;AACvC,KAAI,KAAK,SAAS,OAAQ,QAAO,KAAK,MAAM,GAAG,SAAS,EAAE,GAAG;AAC7D,QAAO;;;;;;;AAST,SAAS,gBAAgB,SAA4B;CACnD,MAAM,SAAuB,EAAE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,IAAI,UAAU,OAAO,IAAI;AAC7D,YAAU,+BAA+B,OAAO;AAChD,QAAM;GAAE,MAAM;GAAS;GAAM;WACrB;AAGR,kBAAgB,OAAO"}
|
|
1
|
+
{"version":3,"file":"mcp-prompt-streaming-BvBNkzjv.js","names":[],"sources":["../src/lib/agent/mcp-prompt-streaming.ts"],"sourcesContent":["/**\n * Streaming prompt runner for the McpSuggestedPromptsScreen.\n *\n * Calls the Claude Agent SDK's `query()` directly with just the PostHog\n * MCP server configured — no skills, no sandbox, no settings sources,\n * no wizard-tools. This is the lightweight cousin of `runAgent` in\n * `agent-interface.ts`: same SDK, much narrower surface, suitable for\n * \"user asked a question, show the answer\" interactions.\n *\n * The function is an async generator that yields `AgentChunk`s extracted\n * from the SDK's message stream. Callers (the screen) consume them via\n * `for await (...)` and render as they arrive.\n */\n\nimport type { AgentChunk } from '@ui/tui/services/mcp-suggested-prompts-services';\nimport type { Credentials } from '@lib/wizard-session';\nimport { DEFAULT_AGENT_MODEL, WIZARD_USER_AGENT } from '@lib/constants';\nimport { logToFile } from '@utils/debug';\nimport { gatewayAuth } from '@lib/gateway-session';\nimport { buildAgentEnv, buildRunTags } from '@lib/agent/agent-interface';\nimport { sanitizeAgentSubprocessEnv } from '@lib/agent/agent-env-isolation';\nimport { createIsolatedAgentConfigDir } from '@lib/agent/stored-login';\nimport { analytics } from '@utils/analytics';\n\n// Cached SDK module — first call pays the dynamic-import cost; later\n// calls reuse the same module.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _sdkModule: any | null = null;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nasync function loadSdk(): Promise<any> {\n if (!_sdkModule) {\n _sdkModule = await import('@anthropic-ai/claude-agent-sdk');\n }\n return _sdkModule;\n}\n\nconst MODEL = DEFAULT_AGENT_MODEL;\n\n// Bounded turn count so a single prompt can't loop forever on the\n// user's nickel. 20 gives the agent room for non-trivial multi-step\n// chains (multi-tool reads → reason → write → verify → summarize) while\n// still capping runaway loops. Worth tuning down once we see real\n// telemetry on average turn counts per prompt.\nconst MAX_TURNS = 30;\n\n/**\n * Extract a short, single-line summary from an arbitrary value. Used\n * for tool-call args and tool-result bodies so the screen has something\n * compact to render.\n */\nfunction summarize(value: unknown, maxLen = 120): string {\n if (value == null) return '';\n let text: string;\n if (typeof value === 'string') text = value;\n else {\n try {\n text = JSON.stringify(value);\n } catch {\n text = String(value);\n }\n }\n text = text.replace(/\\s+/g, ' ').trim();\n if (text.length > maxLen) text = text.slice(0, maxLen - 1) + '…';\n return text;\n}\n\n/**\n * Convert one SDK message into zero or more AgentChunks. Mirrors the\n * subset of message shapes the wizard's main runAgent middleware\n * handles, but narrowed to just the kinds the screen needs to render.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction messageToChunks(message: any): AgentChunk[] {\n const chunks: AgentChunk[] = [];\n\n if (message?.type === 'assistant') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const content = message.message?.content;\n if (Array.isArray(content)) {\n for (const block of content) {\n if (!block || typeof block !== 'object') continue;\n const type = (block as { type?: string }).type;\n if (type === 'text') {\n const text = (block as { text?: string }).text ?? '';\n if (text) chunks.push({ kind: 'text', text });\n } else if (type === 'tool_use') {\n const name = (block as { name?: string }).name ?? 'tool';\n const input = (block as { input?: unknown }).input;\n // CLI mode's exec tool takes a `command` string; keep it verbatim so\n // the screen can recover the inner tool name for follow-ups.\n const command = (input as { command?: unknown })?.command;\n chunks.push({\n kind: 'tool-call',\n toolName: name,\n detail: summarize(input),\n command: typeof command === 'string' ? command : undefined,\n });\n }\n }\n }\n }\n\n if (message?.type === 'user') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const content = message.message?.content;\n if (Array.isArray(content)) {\n for (const block of content) {\n if (!block || typeof block !== 'object') continue;\n const type = (block as { type?: string }).type;\n if (type === 'tool_result') {\n const detail = summarize((block as { content?: unknown }).content);\n chunks.push({ kind: 'tool-result', toolName: 'tool', detail });\n }\n }\n }\n }\n\n if (message?.type === 'result') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const sessionId = (message as { session_id?: string }).session_id;\n chunks.push({ kind: 'done', sessionId });\n }\n\n return chunks;\n}\n\n/**\n * Build a system-prompt append that nudges the agent to fit its response\n * inside the current terminal window. We can't actually constrain Claude\n * — this is a soft cap that the model usually honors. The screen also\n * applies a hard truncation cap as a fallback for non-compliant runs.\n *\n * Core principle nudged at the model: TALL CONTENT IS BAD, WIDE CONTENT\n * IS GOOD. Default terminal is 120 columns × 24 rows — that's a lot of\n * horizontal space, not much vertical. Spread data across columns, never\n * stack it down rows when a horizontal layout would work.\n */\nfunction buildTerminalFitPrompt(): string {\n const cols = process.stdout.columns ?? 120;\n const rows = process.stdout.rows ?? 24;\n // Reserve rows for wizard chrome (title, status, hint, margins).\n const messageBudget = Math.max(8, rows - 10);\n\n return [\n `You are responding inside a CLI window that is exactly ${cols} columns wide and ${rows} rows tall. The user CAN'T SCROLL — your entire reply must fit on screen.`,\n ``,\n `LAYOUT PRINCIPLE: tall content is the enemy, wide content is your friend. You have ${cols} columns of horizontal space; use them. Spread data across columns instead of stacking it down rows.`,\n ``,\n `Tables:`,\n `- Max 5 body rows. The prompts the user picks already constrain results to 5 or fewer — honor that and do not pad with extra rows.`,\n `- If a tool result returns more than 5 items, show the top 5 and mention the rest count inline (e.g. \"...and 12 more\").`,\n `- Prefer transposing wide-but-short data (items across columns, metrics down rows) when labels are short.`,\n `- A two-column table with many rows is the tall layout to AVOID.`,\n ``,\n `Other limits:`,\n `- Aim for 3-5 lines of prose. Maximum ${messageBudget} lines total.`,\n `- DO NOT announce what you are about to do. Skip preamble like \"I'll query…\", \"Let me check…\", \"Now I'll…\", \"I'm going to…\". Go straight to running tools and then the answer.`,\n `- Lists: if there are 6+ short items, format them inline (comma-separated), not as a vertical bullet list.`,\n `- For tool results, summarize the 1-3 numbers that matter. Do NOT echo raw JSON or the full payload.`,\n `- Code blocks: no language tag, no leading blank lines.`,\n `- No closing pleasantries (\"let me know if…\", \"feel free to…\"). Stop when the answer is delivered.`,\n `- No section headers unless the response actually has multiple sections.`,\n ``,\n `Naming saved artifacts:`,\n `- Every dashboard, insight, notebook, or annotation you create MUST include \"(wizard MCP tutorial)\" at the end of its title or name field. Examples: \"Weekly signups (wizard MCP tutorial)\", \"Top errors this week (wizard MCP tutorial)\", \"Onboarding analysis (wizard MCP tutorial)\".`,\n `- This applies on both create AND rename calls. If the user asks you to rename a saved artifact, preserve the \"(wizard MCP tutorial)\" suffix unless they explicitly ask you to drop it.`,\n `- Reason: lets the user find / clean up everything this tutorial created from one search in PostHog. Don't skip it — it's the only signal they'll have that an artifact came from the wizard.`,\n ``,\n `Tone & framing:`,\n `- This is a tutorial demoing PostHog (the product the user just installed). You are showing it off, not auditing it. Stay constructive and neutral about PostHog throughout.`,\n `- Don't editorialize about PostHog's reliability, performance, or cost. Describe what the data shows; treat anomalies as the user's data, not a platform issue.`,\n `- If a tool call fails or returns nothing, say \"the query didn't return data — try a different angle\" or similar. Do NOT speculate about outages, gateway issues, MCP problems, or service health.`,\n `- Avoid value-laden phrases like \"worth investigating\", \"concerning\", \"red flag\", \"problematic\", \"suspicious\", \"alarming\" when describing the user's metrics. Stick to what the numbers show; the user draws conclusions.`,\n ].join('\\n');\n}\n\n/**\n * Gateway trace tags for a tutorial prompt run — without them the gateway has\n * nothing to attribute its `$ai_generation` events to. Returns `{}` when no\n * program is supplied. Exported so the contract is testable without the SDK.\n */\nexport function buildTutorialRunTags(args: {\n programId?: string;\n integration?: string;\n}): Record<string, string> {\n if (!args.programId) return {};\n return buildRunTags({\n programId: args.programId,\n // The tutorial usually has no detected framework; fall back to the\n // program so the axis is never an empty string.\n integration: args.integration ?? args.programId,\n runId: analytics.runId,\n build: analytics.build,\n });\n}\n\nexport async function* runMcpPromptViaSdk(args: {\n prompt: string;\n credentials: Credentials;\n signal: AbortSignal;\n /** When set, the SDK loads the named session's prior turns as\n * context so the follow-up prompt can reference what the agent\n * already showed. */\n resumeSessionId?: string;\n /** Program this run's gateway spend attributes to. Omitting it fails the run\n * rather than going unattributed, so every caller must supply one. */\n programId?: string;\n /** Integration label for the trace tags; the tutorial usually has none. */\n integration?: string;\n}): AsyncIterable<AgentChunk> {\n const { prompt, credentials, signal, resumeSessionId } = args;\n\n // Assembled here rather than passed in so the TUI service layer doesn't\n // have to import this module's dependencies.\n const wizardMetadata = buildTutorialRunTags(args);\n\n // Route the SDK's LLM calls through the PostHog AI gateway, authed\n // with the run's minted token. Set BEFORE loading the SDK in\n // case any in-process code reads env at module init (cached base\n // URLs, OAuth setup, etc.) — same reason `initializeAgent` does this\n // before its query() call. Without these the SDK tries to\n // authenticate directly against Anthropic and 401s with \"Invalid\n // authentication credentials\".\n process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS = 'true';\n\n // The url and the bearer are one unit: a run must take both from the same\n // mint.\n const auth = await gatewayAuth(\n credentials.host,\n credentials.accessToken,\n args.programId,\n );\n const gatewayUrl = auth.gatewayUrl;\n process.env.ANTHROPIC_BASE_URL = gatewayUrl;\n process.env.ANTHROPIC_AUTH_TOKEN = auth.token;\n process.env.CLAUDE_CODE_OAUTH_TOKEN = auth.token;\n\n logToFile(\n `[runMcpPromptViaSdk] gatewayUrl=${gatewayUrl} tokenPrefix=${\n auth.token ? auth.token.slice(0, 4) + '***' : '(missing)'\n }`,\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { query } = await loadSdk();\n\n // Bridge external AbortSignal → SDK AbortController.\n const abortController = new AbortController();\n if (signal.aborted) abortController.abort();\n else\n signal.addEventListener('abort', () => abortController.abort(), {\n once: true,\n });\n\n const mcpUrl = credentials.host.mcpUrl;\n logToFile(\n `[runMcpPromptViaSdk] mcpUrl=${mcpUrl} model=${MODEL} resume=${\n resumeSessionId ?? '(none)'\n }`,\n );\n\n // The SDK expects an async generator for the prompt that stays open\n // until the result is received. For a single-turn prompt we yield one\n // user message and then await an abort (which fires when streaming\n // completes or the caller cancels).\n const createPromptStream = async function* () {\n yield {\n type: 'user' as const,\n session_id: '',\n message: { role: 'user' as const, content: prompt },\n parent_tool_use_id: null,\n };\n // Hold the stream open until abort. The SDK closes its end when it\n // sees a `result` message; we close ours via the abortController in\n // the finally block below.\n await new Promise<void>((resolve) => {\n if (abortController.signal.aborted) {\n resolve();\n return;\n }\n abortController.signal.addEventListener('abort', () => resolve(), {\n once: true,\n });\n });\n };\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const response = query({\n prompt: createPromptStream(),\n options: {\n abortController,\n model: MODEL,\n cwd: process.cwd(),\n permissionMode: 'acceptEdits',\n maxTurns: MAX_TURNS,\n // Match agent-interface.ts — the 1M context beta is what keeps\n // resumed follow-up sessions from truncating after a few turns.\n betas: ['context-1m-2025-08-07'],\n // Only load project-level skills/settings. Without this the SDK\n // defaults to ['user', 'project'] and a user's\n // `~/.claude/settings.json` (apiKeyHelper / env block) can\n // override the OAuth routing we set above.\n settingSources: ['project'],\n // When set, the SDK replays the named session's turns into the\n // new query so the follow-up prompt has full conversation\n // context. Omit on the first prompt for a fresh session.\n ...(resumeSessionId ? { resume: resumeSessionId } : {}),\n // Without `canUseTool` the SDK falls back to \"ask the user\" on\n // every MCP tool call — `permissionMode: 'acceptEdits'` only\n // relaxes Edit/Write, not MCP. Our Ink TUI has no surface to\n // answer that prompt, so the agent would stall mid-stream\n // saying things like \"needs your approval to create dashboard\".\n // The tutorial's whole point is demoing the MCP tools against\n // the user's project, so we auto-allow everything that matches\n // the prefix and deny anything else (defense in depth — the\n // `allowedTools` filter above already enforces this).\n canUseTool: (toolName: string, input: unknown) => {\n if (toolName.startsWith('mcp__posthog-wizard__')) {\n return Promise.resolve({\n behavior: 'allow' as const,\n updatedInput: (input ?? {}) as Record<string, unknown>,\n });\n }\n logToFile(`[runMcpPromptViaSdk] denying non-MCP tool: ${toolName}`);\n return Promise.resolve({\n behavior: 'deny' as const,\n message: `${toolName} is not available in the MCP tutorial — only PostHog MCP tools are permitted.`,\n });\n },\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: buildTerminalFitPrompt(),\n },\n mcpServers: {\n 'posthog-wizard': {\n type: 'http',\n url: mcpUrl,\n headers: {\n // Env reference, not the token: the SDK puts this config on the\n // spawned CLI's argv, where `ps` shows it to any local process.\n Authorization: 'Bearer ${POSTHOG_MCP_TOKEN}',\n 'User-Agent': WIZARD_USER_AGENT,\n },\n // CLI mode's single `exec` tool carries the full command reference\n // on its schema — keep it in context, never deferred behind tool\n // search.\n alwaysLoad: true,\n },\n },\n // Only let the agent use MCP tools — no shell, no file I/O,\n // no Read/Edit/Write. This is a chat-with-MCP run, not a\n // wizard skill execution.\n allowedTools: ['mcp__posthog-wizard__*'],\n env: {\n // Drop the ENTIRE ANTHROPIC_*/CLAUDE_CODE_* namespace from the\n // inherited env so no shell/settings value can silently bypass the\n // PostHog gateway and defeat quota tracking / the OAuth flow; the\n // wizard's own gateway routing is injected fresh below. See\n // agent-env-isolation.ts.\n ...sanitizeAgentSubprocessEnv(process.env),\n // Gateway routing from this run's own auth, not process.env: a\n // concurrent run writes those globals too, and there is an await\n // between the write above and this read.\n ANTHROPIC_BASE_URL: auth.gatewayUrl,\n ANTHROPIC_AUTH_TOKEN: auth.token,\n CLAUDE_CODE_OAUTH_TOKEN: auth.token,\n // Point the binary at an empty config dir so it cannot resolve a\n // stored Claude login and send that to the gateway, which 401s it.\n // See stored-login.ts.\n CLAUDE_CONFIG_DIR: createIsolatedAgentConfigDir(),\n CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS: 'true',\n // The MCP config resolves this in the child; sending the value would\n // put it on the CLI's argv.\n POSTHOG_MCP_TOKEN: credentials.accessToken,\n // SDK 0.3.142+ connects MCP servers in the background by\n // default; without this the agent may try to call tools\n // before posthog-wizard is connected on turn 1.\n MCP_CONNECTION_NONBLOCKING: '0',\n // This run's trace tags, which the gateway reads to attribute its\n // `$ai_generation` events. Flags stay empty: the tutorial doesn't\n // fork on any.\n ANTHROPIC_CUSTOM_HEADERS: buildAgentEnv(\n wizardMetadata ?? {},\n {},\n auth.teamId,\n ),\n },\n },\n });\n\n for await (const message of response as AsyncIterable<unknown>) {\n if (signal.aborted) return;\n for (const chunk of messageToChunks(message)) {\n yield chunk;\n if (chunk.kind === 'done') return;\n }\n }\n } catch (err) {\n const text = err instanceof Error ? err.message : String(err);\n logToFile(`[runMcpPromptViaSdk] error: ${text}`);\n yield { kind: 'error', text };\n } finally {\n // Closes the prompt stream so `query()` shuts down cleanly even if\n // we never saw a 'result' message.\n abortController.abort();\n }\n}\n"],"mappings":";;;;;AA2BA,IAAI,aAAyB;AAG7B,eAAe,UAAwB;AACrC,KAAI,CAAC,WACH,cAAa,MAAM,OAAO;AAE5B,QAAO;;AAGT,MAAM,QAAQ;AAOd,MAAM,YAAY;;;;;;AAOlB,SAAS,UAAU,OAAgB,SAAS,KAAa;AACvD,KAAI,SAAS,KAAM,QAAO;CAC1B,IAAI;AACJ,KAAI,OAAO,UAAU,SAAU,QAAO;KAEpC,KAAI;AACF,SAAO,KAAK,UAAU,MAAM;SACtB;AACN,SAAO,OAAO,MAAM;;AAGxB,QAAO,KAAK,QAAQ,QAAQ,IAAI,CAAC,MAAM;AACvC,KAAI,KAAK,SAAS,OAAQ,QAAO,KAAK,MAAM,GAAG,SAAS,EAAE,GAAG;AAC7D,QAAO;;;;;;;AAST,SAAS,gBAAgB,SAA4B;CACnD,MAAM,SAAuB,EAAE;AAE/B,KAAI,SAAS,SAAS,aAAa;EAEjC,MAAM,UAAU,QAAQ,SAAS;AACjC,MAAI,MAAM,QAAQ,QAAQ,CACxB,MAAK,MAAM,SAAS,SAAS;AAC3B,OAAI,CAAC,SAAS,OAAO,UAAU,SAAU;GACzC,MAAM,OAAQ,MAA4B;AAC1C,OAAI,SAAS,QAAQ;IACnB,MAAM,OAAQ,MAA4B,QAAQ;AAClD,QAAI,KAAM,QAAO,KAAK;KAAE,MAAM;KAAQ;KAAM,CAAC;cACpC,SAAS,YA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AAE;IAUtD,aAAa,UAAkB,UAAmB;AAChD,SAAI,SAAS,WAAW,wBAAwB,CAC9C,QAAO,QAAQ,QAAQ;MACrB,UAAU;MACV,cAAe,SAAS,EAAE;MAC3B,CAAC;AAEJ,eAAU,8CAA8C,WAAW;AACnE,YAAO,QAAQ,QAAQ;MACrB,UAAU;MACV,SAAS,GAAG,SAAS;MACtB,CAAC;;IAEJ,cAAc;KACZ,MAAM;KACN,QAAQ;KACR,QAAQ,wBAAwB;KACjC;IACD,YAAY,EACV,kBAAkB;KAChB,MAAM;KACN,KAAK;KACL,SAAS;MAGP,eAAe;MACf,cAAc;MACf;KAID,YAAY;KACb,EACF;IAID,cAAc,CAAC,yBAAyB;IACxC,KAAK;KAMH,GAAG,2BAA2B,QAAQ,IAAI;KAI1C,oBAAoB,KAAK;KACzB,sBAAsB,KAAK;KAC3B,yBAAyB,KAAK;KAI9B,mBAAmB,8BAA8B;KACjD,wCAAwC;KAGxC,mBAAmB,YAAY;KAI/B,4BAA4B;KAI5B,0BAA0B,cACxB,kBAAkB,EAAE,EACpB,EAAE,EACF,KAAK,OACN;KACF;IACF;GACF,CAAC;AAEF,aAAW,MAAM,WAAW,UAAoC;AAC9D,OAAI,OAAO,QAAS;AACpB,QAAK,MAAM,SAAS,gBAAgB,QAAQ,EAAE;AAC5C,UAAM;AACN,QAAI,MAAM,SAAS,OAAQ;;;UAGxB,KAAK;EACZ,MAAM,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;AAC7D,YAAU,+BAA+B,OAAO;AAChD,QAAM;GAAE,MAAM;GAAS;GAAM;WACrB;AAGR,kBAAgB,OAAO"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { d as ErrorCodes, o as AgentSignals } from "./errors--OqLxmWR.js";
|
|
2
|
-
import {
|
|
2
|
+
import { C as AGENTIC_DETECTION_TIMEOUT_MS, K as POSTHOG_DOCS_URL, St as headlessOption, V as Integration, _ as SIGNUP_WIZARD_READINESS_CONFIG, at as WIZARD_INTERACTION_EVENT_NAME, p as getUI, pt as WIZARD_USER_AGENT, r as debug, s as logToFile, v as evaluateWizardReadiness, wt as regionOption, y as getBlockingServiceKeys } from "./debug-C5Zz8hmm.js";
|
|
3
3
|
import { o as mayReportScanResults } from "./wizard-session-FSJCkTcP.js";
|
|
4
|
-
import { n as analytics } from "./analytics-
|
|
5
|
-
import { i as withUtm, n as openTrackedLink } from "./telemetry-
|
|
6
|
-
import "./bounded-fs-
|
|
7
|
-
import { i as tryGetPackageJson, n as isUsingTypeScript } from "./setup-utils-
|
|
8
|
-
import { i as requestDeepLink } from "./provisioning-
|
|
9
|
-
import { s as handleApiError } from "./api-
|
|
10
|
-
import { i as wizardAbort } from "./wizard-abort-
|
|
11
|
-
import {
|
|
12
|
-
import { _ as detectProjectsWithAgent, b as detectFramework, f as findPackageJsons, g as detectWarehouseSources, h as getDetectedWarehouseSources, m as detectWarehousePrerequisites, n as runAgent, p as WAREHOUSE_ABORT_CASES, r as shouldDisableAsk, s as detectPostHogIntegration, v as resolveProjectDir, x as authenticate, y as gatherFrameworkContext } from "./agent-runner-
|
|
13
|
-
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-
|
|
14
|
-
import { S as SETUP_REPORT_FILE$1, _ as AUDIT_CHECKS_KEY, g as AUDIT_CHECKS_FILE, h as EVENT_PLAN_FILE, v as AUDIT_REPORT_FILE } from "./yara-hooks-
|
|
15
|
-
import { C as writeJsonAtomic } from "./queue-tools-
|
|
4
|
+
import { n as analytics } from "./analytics-C_RyE8fz.js";
|
|
5
|
+
import { i as withUtm, n as openTrackedLink } from "./telemetry-Dp6zjZBj.js";
|
|
6
|
+
import "./bounded-fs-BHLy83N9.js";
|
|
7
|
+
import { i as tryGetPackageJson, n as isUsingTypeScript } from "./setup-utils-BUAoRjw3.js";
|
|
8
|
+
import { i as requestDeepLink } from "./provisioning-Ba7GWKzK.js";
|
|
9
|
+
import { s as handleApiError } from "./api-k5aGQpIZ.js";
|
|
10
|
+
import { i as wizardAbort } from "./wizard-abort-BCnUgT9z.js";
|
|
11
|
+
import { R as WIZARD_TOOL_NAMES, it as LONGER_ASK_TIMEOUT_MS } from "./agent-interface-CZWRgZMc.js";
|
|
12
|
+
import { _ as detectProjectsWithAgent, b as detectFramework, f as findPackageJsons, g as detectWarehouseSources, h as getDetectedWarehouseSources, m as detectWarehousePrerequisites, n as runAgent, p as WAREHOUSE_ABORT_CASES, r as shouldDisableAsk, s as detectPostHogIntegration, v as resolveProjectDir, x as authenticate, y as gatherFrameworkContext } from "./agent-runner-C_R1X_UT.js";
|
|
13
|
+
import { i as SPINNER_MESSAGE, t as FRAMEWORK_REGISTRY } from "./registry-COcpEsMD.js";
|
|
14
|
+
import { S as SETUP_REPORT_FILE$1, _ as AUDIT_CHECKS_KEY, g as AUDIT_CHECKS_FILE, h as EVENT_PLAN_FILE, v as AUDIT_REPORT_FILE } from "./yara-hooks-BJWVgTpU.js";
|
|
15
|
+
import { C as writeJsonAtomic } from "./queue-tools-D09PNS0X.js";
|
|
16
16
|
import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
17
17
|
import path, { join } from "path";
|
|
18
18
|
import * as os from "node:os";
|
|
@@ -1444,7 +1444,7 @@ ${warehouseReportInstruction(session)}
|
|
|
1444
1444
|
postRun: async (sess, credentials) => {
|
|
1445
1445
|
const envVars = config.environment.getEnvVars(credentials.projectApiKey, credentials.host.apiHost);
|
|
1446
1446
|
if (config.environment.uploadToHosting) {
|
|
1447
|
-
const { uploadEnvironmentVariablesStep } = await import("./steps-
|
|
1447
|
+
const { uploadEnvironmentVariablesStep } = await import("./steps-DbsDish5.js");
|
|
1448
1448
|
const uploadedEnvVars = await uploadEnvironmentVariablesStep(envVars, {
|
|
1449
1449
|
integration: config.metadata.integration,
|
|
1450
1450
|
session: sess
|
|
@@ -1847,6 +1847,9 @@ const AUDIT_ABORT_CASES = [{
|
|
|
1847
1847
|
* succeed — the skill writes the report to disk, then mirrors it into a
|
|
1848
1848
|
* PostHog notebook as its final step).
|
|
1849
1849
|
*
|
|
1850
|
+
* Every id the skill resolves needs a row here: a batch resolve rejects
|
|
1851
|
+
* atomically, so one missing id discards the whole call.
|
|
1852
|
+
*
|
|
1850
1853
|
* `posthog-side-findings` is a sweep row, not a rule: the skill reads what
|
|
1851
1854
|
* PostHog itself already computed for this project (error-tracking
|
|
1852
1855
|
* recommendations, health issues) and appends one row per open finding via
|
|
@@ -1873,6 +1876,12 @@ const AUDIT_SEED_CHECKS = [
|
|
|
1873
1876
|
label: "Initialization is correct",
|
|
1874
1877
|
status: "pending"
|
|
1875
1878
|
},
|
|
1879
|
+
{
|
|
1880
|
+
id: "init-not-duplicated",
|
|
1881
|
+
area: "Installation",
|
|
1882
|
+
label: "One initialization per runtime",
|
|
1883
|
+
status: "pending"
|
|
1884
|
+
},
|
|
1876
1885
|
{
|
|
1877
1886
|
id: "identify-stable-distinct-id",
|
|
1878
1887
|
area: "Identification",
|
|
@@ -2005,7 +2014,13 @@ const auditConfig = {
|
|
|
2005
2014
|
...baseConfig,
|
|
2006
2015
|
steps: auditSteps,
|
|
2007
2016
|
run: auditRun,
|
|
2008
|
-
|
|
2017
|
+
auditLedgerFile: AUDIT_CHECKS_FILE,
|
|
2018
|
+
allowedTools: [
|
|
2019
|
+
"Agent",
|
|
2020
|
+
WIZARD_TOOL_NAMES.auditSeedChecks,
|
|
2021
|
+
WIZARD_TOOL_NAMES.auditAddChecks,
|
|
2022
|
+
WIZARD_TOOL_NAMES.auditResolveChecks
|
|
2023
|
+
],
|
|
2009
2024
|
disallowedTools: [WIZARD_TOOL_NAMES.wizardAsk],
|
|
2010
2025
|
cliOptions: {
|
|
2011
2026
|
...headlessOption,
|
|
@@ -2135,7 +2150,13 @@ const eventsAuditConfig = {
|
|
|
2135
2150
|
skillId: "events-audit",
|
|
2136
2151
|
steps: EVENTS_AUDIT_PROGRAM,
|
|
2137
2152
|
reportFile: SETUP_REPORT_FILE$1,
|
|
2138
|
-
|
|
2153
|
+
auditLedgerFile: AUDIT_CHECKS_FILE,
|
|
2154
|
+
allowedTools: [
|
|
2155
|
+
"Agent",
|
|
2156
|
+
WIZARD_TOOL_NAMES.auditSeedChecks,
|
|
2157
|
+
WIZARD_TOOL_NAMES.auditAddChecks,
|
|
2158
|
+
WIZARD_TOOL_NAMES.auditResolveChecks
|
|
2159
|
+
],
|
|
2139
2160
|
disallowedTools: [WIZARD_TOOL_NAMES.wizardAsk],
|
|
2140
2161
|
run: (session) => {
|
|
2141
2162
|
const typeScriptDetected = isUsingTypeScript({ installDir: session.installDir });
|
|
@@ -5715,4 +5736,4 @@ function isRunFailure(session) {
|
|
|
5715
5736
|
//#endregion
|
|
5716
5737
|
export { wordWrap as $, installOrUpdatePostHogCli as A, webAnalyticsDoctorConfig as B, ERROR_TRACKING_PROJECT_PATH_KEY as C, CLI_STEERING_TARGETS as D, errorTrackingUploadSourceMapsConfig as E, MANUAL_SDK_INSTALL as F, createSkillProgram as G, getKindMeta as H, MANUAL_SDK_VARIANTS as I, getContentBlocks$4 as J, warehouseSourceConfig as K, RUST_SDK_CRATE as L, AUTOMATABLE_VARIANTS as M, DISPLAY_NAME as N, detectTargets as O, GO_SDK_MODULE as P, computeVisibleRange as Q, SOURCE_MAPS_CONTEXT_KEYS as R, errorTrackingConfig as S, replayVisionConfig as T, fetchHealthIssues as U, posthogDoctorConfig as V, auditConfig as W, posthogIntegrationConfig as X, SETUP_REPORT_FILE as Y, TextBlock as Z, PRICING_SHORT as _, PROGRAM_REGISTRY as a, GITHUB_REQUIRED_MESSAGE as b, getCommandPath as c, metricsConfig as d, isClearBlock as et, aiObservabilityConfig as f, PRICING_LONG as g, NO_DEFAULT_LIMIT as h, isRunFailure as i, Icons as it, installSteeringSnippet as j, findTarget as k, getLaunchablePrograms as l, selfDrivingConfig as m, MINT_FAILURE_CONTACT as n, isObjectBlock as nt, Program as o, mcpAnalyticsConfig as p, revenueAnalyticsConfig as q, MINT_FAILURE_MESSAGE as r, Colors as rt, agentSkillConfig as s, MINT_FAILURE_BODY as t, isLinesBlock as tt, getProgramConfig as u, detectSelfDrivingIntegrationProjects as v, detectErrorTrackingProjects as w, SELF_DRIVING_INTEGRATE_PATH_KEY as x, GITHUB_REQUIRED_BODY as y, migrationConfig as z };
|
|
5717
5738
|
|
|
5718
|
-
//# sourceMappingURL=mint-failure-
|
|
5739
|
+
//# sourceMappingURL=mint-failure-CZ5FZ0Jd.js.map
|