@posthog/wizard 2.41.0 → 2.42.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-Bvv6Vh5y.js → add-mcp-server-to-clients-fGAJ6wRG.js} +5 -5
- package/dist/{add-mcp-server-to-clients-Bvv6Vh5y.js.map → add-mcp-server-to-clients-fGAJ6wRG.js.map} +1 -1
- package/dist/{agent-interface-CFeI8jzW.js → agent-interface-dPcuJv8g.js} +8 -9
- package/dist/agent-interface-dPcuJv8g.js.map +1 -0
- package/dist/{agent-runner-B0pWHl5j.js → agent-runner-3bDJ_WLl.js} +120 -63
- package/dist/agent-runner-3bDJ_WLl.js.map +1 -0
- package/dist/analytics-B33Hy7zS.js +2 -0
- package/dist/{analytics-C1qxjbYZ.js → analytics-jQRtyqzG.js} +5 -2
- package/dist/analytics-jQRtyqzG.js.map +1 -0
- package/dist/{api-CEMR_Aa6.js → api-Bweisj9K.js} +3 -3
- package/dist/{api-CEMR_Aa6.js.map → api-Bweisj9K.js.map} +1 -1
- package/dist/bin.js +66 -65
- package/dist/bin.js.map +1 -1
- package/dist/{ci-install-BBZscv3z.js → ci-install-BoATzVVs.js} +4 -4
- package/dist/{ci-install-BBZscv3z.js.map → ci-install-BoATzVVs.js.map} +1 -1
- package/dist/{debug-BMkCmZdo.js → debug--QPXcpzv.js} +4 -5
- package/dist/{debug-BMkCmZdo.js.map → debug--QPXcpzv.js.map} +1 -1
- package/dist/{debug-DBrsvcym.js → debug-DCQHRXu9.js} +1 -1
- package/dist/{defaults-BxiMLkQY.js → defaults-CeNThA-1.js} +1 -1
- package/dist/{defaults-BxiMLkQY.js.map → defaults-CeNThA-1.js.map} +1 -1
- package/dist/{env-api-key-DDVkPQmo.js → env-api-key-cjD4yfGT.js} +1 -1
- package/dist/{env-api-key-DDVkPQmo.js.map → env-api-key-cjD4yfGT.js.map} +1 -1
- package/dist/{environment-B7DmpnXD.js → environment-Xdauxvph.js} +3 -3
- package/dist/{environment-B7DmpnXD.js.map → environment-Xdauxvph.js.map} +1 -1
- package/dist/{file-utils-BCxAu-vq.js → file-utils-BJhGBl-W.js} +2 -2
- package/dist/{file-utils-BCxAu-vq.js.map → file-utils-BJhGBl-W.js.map} +1 -1
- package/dist/{headless-ui-NFf-5XOW.js → headless-ui-XdCxxQ0b.js} +2 -2
- package/dist/{headless-ui-NFf-5XOW.js.map → headless-ui-XdCxxQ0b.js.map} +1 -1
- package/dist/{interactive-CBrzEFly.js → interactive-CwtUeGJT.js} +2 -2
- package/dist/{interactive-CBrzEFly.js.map → interactive-CwtUeGJT.js.map} +1 -1
- package/dist/{mcp-C7dn0DIC.js → mcp-DIuzSJ8f.js} +15 -19
- package/dist/mcp-DIuzSJ8f.js.map +1 -0
- package/dist/{mcp-prompt-streaming-uXF2xskx.js → mcp-prompt-streaming-CCS2EkfY.js} +8 -10
- package/dist/mcp-prompt-streaming-CCS2EkfY.js.map +1 -0
- package/dist/{non-interactive-CDYGf19o.js → non-interactive-Cjb5uLLn.js} +2 -2
- package/dist/{non-interactive-CDYGf19o.js.map → non-interactive-Cjb5uLLn.js.map} +1 -1
- package/dist/{package-manager-BHAvpGav.js → package-manager-D_05Bmr0.js} +2 -2
- package/dist/{package-manager-BHAvpGav.js.map → package-manager-D_05Bmr0.js.map} +1 -1
- package/dist/{playground-B8OhYzyc.js → playground-BtB7RvUT.js} +26 -21
- package/dist/playground-BtB7RvUT.js.map +1 -0
- package/dist/{posthog-BHbtnNQE.js → posthog-DwKlq0HM.js} +2 -2
- package/dist/posthog-DwKlq0HM.js.map +1 -0
- package/dist/{posthog-integration-G839iLK6.js → posthog-integration-Cw1QDMFi.js} +24 -25
- package/dist/posthog-integration-Cw1QDMFi.js.map +1 -0
- package/dist/{provisioning-BOhuDX6i.js → provisioning-CmpiiTaR.js} +67 -6
- package/dist/provisioning-CmpiiTaR.js.map +1 -0
- package/dist/{registry-CC26CjWO.js → registry-DPriFJQI.js} +4 -4
- package/dist/{registry-CC26CjWO.js.map → registry-DPriFJQI.js.map} +1 -1
- package/dist/{security-wlqqLk44.js → security-DJrWWO0M.js} +4 -4
- package/dist/{security-wlqqLk44.js.map → security-DJrWWO0M.js.map} +1 -1
- package/dist/{setup-utils-NwB2Qj6N.js → setup-utils-C8yipMUt.js} +137 -32
- package/dist/setup-utils-C8yipMUt.js.map +1 -0
- package/dist/{start-tui-DQndpyTU.js → start-tui-BMZL7mKh.js} +33 -30
- package/dist/start-tui-BMZL7mKh.js.map +1 -0
- package/dist/{steps-CC_Ge4sR.js → steps-Dhq5VReA.js} +7 -7
- package/dist/{steps-CC_Ge4sR.js.map → steps-Dhq5VReA.js.map} +1 -1
- package/dist/{store-1-pQpHlY.js → store-Bu1xO0_5.js} +5 -5
- package/dist/{store-1-pQpHlY.js.map → store-Bu1xO0_5.js.map} +1 -1
- package/dist/{subagent-FMDybA8X.js → subagent-mVY-kDU0.js} +2 -2
- package/dist/{subagent-FMDybA8X.js.map → subagent-mVY-kDU0.js.map} +1 -1
- package/dist/{task-stream-d-R9J0g4.js → task-stream-Ne-9ZOnf.js} +3 -3
- package/dist/{task-stream-d-R9J0g4.js.map → task-stream-Ne-9ZOnf.js.map} +1 -1
- package/dist/{tasks-BfDJpHgK.js → tasks-2af2kDE3.js} +2 -2
- package/dist/{tasks-BfDJpHgK.js.map → tasks-2af2kDE3.js.map} +1 -1
- package/dist/{telemetry-CcysC4ji.js → telemetry-wGk3UsDw.js} +3 -3
- package/dist/{telemetry-CcysC4ji.js.map → telemetry-wGk3UsDw.js.map} +1 -1
- package/dist/{terminal-CWpmzTgT.js → terminal-CnYduoIp.js} +49 -25
- package/dist/terminal-CnYduoIp.js.map +1 -0
- package/dist/{tools-BsOywKLp.js → tools-BTq5sLH9.js} +4 -4
- package/dist/{tools-BsOywKLp.js.map → tools-BTq5sLH9.js.map} +1 -1
- package/dist/{types-evL_rPob.js → types-y3HkjtSq.js} +1 -1
- package/dist/{types-evL_rPob.js.map → types-y3HkjtSq.js.map} +1 -1
- package/dist/{wizard-abort-56bo4Zhs.js → wizard-abort-CSMnla3D.js} +4 -4
- package/dist/{wizard-abort-56bo4Zhs.js.map → wizard-abort-CSMnla3D.js.map} +1 -1
- package/dist/{wizard-abort-7oUXxutu.js → wizard-abort-D8Lj609C.js} +1 -1
- package/dist/{wizard-session-BoXAZEOf.js → wizard-session-BudcixsA.js} +1 -2
- package/dist/wizard-session-BudcixsA.js.map +1 -0
- package/dist/{wizard-session-C8W_6X0j.js → wizard-session-DXivb7kv.js} +1 -1
- package/dist/{wizard-tools-BXd4PCO3.js → wizard-tools-BBLQk1YC.js} +4 -4
- package/dist/{wizard-tools-BXd4PCO3.js.map → wizard-tools-BBLQk1YC.js.map} +1 -1
- package/dist/wizard-ui-WZ48rUgr.js.map +1 -1
- package/dist/yara-hooks-B42cYxIF.js +2 -0
- package/dist/{yara-hooks-BZmYgr9V.js → yara-hooks-Ciy8d0ok.js} +4 -4
- package/dist/{yara-hooks-BZmYgr9V.js.map → yara-hooks-Ciy8d0ok.js.map} +1 -1
- package/package.json +1 -1
- package/dist/agent-interface-CFeI8jzW.js.map +0 -1
- package/dist/agent-runner-B0pWHl5j.js.map +0 -1
- package/dist/analytics-C1qxjbYZ.js.map +0 -1
- package/dist/analytics-_8xKpUAa.js +0 -2
- package/dist/host-resolution-UZELMVTQ.js +0 -115
- package/dist/host-resolution-UZELMVTQ.js.map +0 -1
- package/dist/mcp-C7dn0DIC.js.map +0 -1
- package/dist/mcp-prompt-streaming-uXF2xskx.js.map +0 -1
- package/dist/playground-B8OhYzyc.js.map +0 -1
- package/dist/posthog-BHbtnNQE.js.map +0 -1
- package/dist/posthog-integration-G839iLK6.js.map +0 -1
- package/dist/provisioning-BOhuDX6i.js.map +0 -1
- package/dist/setup-utils-NwB2Qj6N.js.map +0 -1
- package/dist/start-tui-DQndpyTU.js.map +0 -1
- package/dist/terminal-CWpmzTgT.js.map +0 -1
- package/dist/urls-PfZ1TYOf.js +0 -67
- package/dist/urls-PfZ1TYOf.js.map +0 -1
- package/dist/wizard-session-BoXAZEOf.js.map +0 -1
- package/dist/yara-hooks-D0h7Vu7A.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks-
|
|
1
|
+
{"version":3,"file":"tasks-2af2kDE3.js","names":[],"sources":["../src/lib/agent/runner/harness/pi/tasks.ts"],"sourcesContent":["/**\n * Task/todo parity for pi (#526). The same four Task tools the anthropic path\n * exposes (TaskCreate/Update/Get/List), as pi `defineTool` tools backed by a\n * shared in-memory store. Every mutation pushes the list to the TUI via\n * `getUI().syncTodos`, so the todo panel updates live under pi exactly like the\n * anthropic path — the thing that was missing before.\n */\n\nimport { Type } from 'typebox';\nimport { defineTool } from '@earendil-works/pi-coding-agent';\nimport type { ToolDefinition } from '@earendil-works/pi-coding-agent';\nimport { getUI } from '@ui';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed';\nexport interface TaskEntry {\n content: string;\n status: TaskStatus;\n activeForm?: string;\n}\nexport type TaskStore = Map<string, TaskEntry>;\n\nfunction text(s: string): {\n content: [{ type: 'text'; text: string }];\n details: unknown;\n} {\n return { content: [{ type: 'text', text: s }], details: {} };\n}\n\nfunction syncToTui(store: TaskStore): void {\n getUI().syncTodos(\n Array.from(store.values()).map((t) => ({\n content: t.content,\n status: t.status,\n activeForm: t.activeForm,\n })),\n );\n}\n\n/** Build the four Task tools over a fresh store. */\nexport function createWizardPiTaskTools(): {\n tools: ToolDefinition[];\n store: TaskStore;\n} {\n const store: TaskStore = new Map();\n\n const taskCreate = defineTool({\n name: 'TaskCreate',\n label: 'Create task',\n description:\n 'Create a task in the shared todo list. Returns its assigned id.',\n promptSnippet:\n 'TaskCreate(content) — add a todo (surfaces progress in the UI)',\n parameters: Type.Object({\n content: Type.String({ description: 'Imperative task description' }),\n activeForm: Type.Optional(\n Type.String({ description: 'Present-continuous form for the spinner' }),\n ),\n }),\n // eslint-disable-next-line @typescript-eslint/require-await -- pi tool contract returns a Promise\n async execute(_id, args) {\n const id = `task-${store.size + 1}`;\n store.set(id, {\n content: args.content,\n status: 'pending',\n activeForm: args.activeForm,\n });\n syncToTui(store);\n return text(`Created ${id}`);\n },\n });\n\n const taskUpdate = defineTool({\n name: 'TaskUpdate',\n label: 'Update task',\n description:\n 'Update an existing task by id (status, content, or activeForm).',\n promptSnippet:\n 'TaskUpdate(taskId, status) — mark a todo in_progress/completed',\n parameters: Type.Object({\n taskId: Type.String(),\n status: Type.Optional(\n Type.Union([\n Type.Literal('pending'),\n Type.Literal('in_progress'),\n Type.Literal('completed'),\n ]),\n ),\n content: Type.Optional(Type.String()),\n activeForm: Type.Optional(Type.String()),\n }),\n // eslint-disable-next-line @typescript-eslint/require-await -- pi tool contract returns a Promise\n async execute(_id, args) {\n const existing = store.get(args.taskId);\n if (!existing) return text(`No such task: ${args.taskId}`);\n store.set(args.taskId, {\n content: args.content ?? existing.content,\n status: (args.status as TaskStatus) ?? existing.status,\n activeForm: args.activeForm ?? existing.activeForm,\n });\n syncToTui(store);\n return text(`Updated ${args.taskId}`);\n },\n });\n\n const taskGet = defineTool({\n name: 'TaskGet',\n label: 'Get task',\n description: 'Fetch a single task by id.',\n parameters: Type.Object({ taskId: Type.String() }),\n // eslint-disable-next-line @typescript-eslint/require-await -- pi tool contract returns a Promise\n async execute(_id, args) {\n const t = store.get(args.taskId);\n return text(\n t\n ? JSON.stringify({ id: args.taskId, ...t })\n : `No such task: ${args.taskId}`,\n );\n },\n });\n\n const taskList = defineTool({\n name: 'TaskList',\n label: 'List tasks',\n description: 'List all tasks in the shared todo list.',\n parameters: Type.Object({}),\n // eslint-disable-next-line @typescript-eslint/require-await -- pi tool contract returns a Promise\n async execute() {\n return text(\n JSON.stringify(\n Array.from(store.entries()).map(([id, t]) => ({ id, ...t })),\n ),\n );\n },\n });\n\n return { tools: [taskCreate, taskUpdate, taskGet, taskList], store };\n}\n"],"mappings":";;;;;;;;;;;AAqBA,SAAS,KAAK,GAGZ;AACA,QAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAQ,MAAM;GAAG,CAAC;EAAE,SAAS,EAAE;EAAE;;AAG9D,SAAS,UAAU,OAAwB;AACzC,QAAO,CAAC,UACN,MAAM,KAAK,MAAM,QAAQ,CAAC,CAAC,KAAK,OAAO;EACrC,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,YAAY,EAAE;EACf,EAAE,CACJ;;;AAIH,SAAgB,0BAGd;CACA,MAAM,wBAAmB,IAAI,KAAK;AA4FlC,QAAO;EAAE,OAAO;GA1FG,WAAW;IAC5B,MAAM;IACN,OAAO;IACP,aACE;IACF,eACE;IACF,YAAY,KAAK,OAAO;KACtB,SAAS,KAAK,OAAO,EAAE,aAAa,+BAA+B,CAAC;KACpE,YAAY,KAAK,SACf,KAAK,OAAO,EAAE,aAAa,2CAA2C,CAAC,CACxE;KACF,CAAC;IAEF,MAAM,QAAQ,KAAK,MAAM;KACvB,MAAM,KAAK,QAAQ,MAAM,OAAO;AAChC,WAAM,IAAI,IAAI;MACZ,SAAS,KAAK;MACd,QAAQ;MACR,YAAY,KAAK;MAClB,CAAC;AACF,eAAU,MAAM;AAChB,YAAO,KAAK,WAAW,KAAK;;IAE/B,CAAC;GAEiB,WAAW;IAC5B,MAAM;IACN,OAAO;IACP,aACE;IACF,eACE;IACF,YAAY,KAAK,OAAO;KACtB,QAAQ,KAAK,QAAQ;KACrB,QAAQ,KAAK,SACX,KAAK,MAAM;MACT,KAAK,QAAQ,UAAU;MACvB,KAAK,QAAQ,cAAc;MAC3B,KAAK,QAAQ,YAAY;MAC1B,CAAC,CACH;KACD,SAAS,KAAK,SAAS,KAAK,QAAQ,CAAC;KACrC,YAAY,KAAK,SAAS,KAAK,QAAQ,CAAC;KACzC,CAAC;IAEF,MAAM,QAAQ,KAAK,MAAM;KACvB,MAAM,WAAW,MAAM,IAAI,KAAK,OAAO;AACvC,SAAI,CAAC,SAAU,QAAO,KAAK,iBAAiB,KAAK,SAAS;AAC1D,WAAM,IAAI,KAAK,QAAQ;MACrB,SAAS,KAAK,WAAW,SAAS;MAClC,QAAS,KAAK,UAAyB,SAAS;MAChD,YAAY,KAAK,cAAc,SAAS;MACzC,CAAC;AACF,eAAU,MAAM;AAChB,YAAO,KAAK,WAAW,KAAK,SAAS;;IAExC,CAAC;GAEc,WAAW;IACzB,MAAM;IACN,OAAO;IACP,aAAa;IACb,YAAY,KAAK,OAAO,EAAE,QAAQ,KAAK,QAAQ,EAAE,CAAC;IAElD,MAAM,QAAQ,KAAK,MAAM;KACvB,MAAM,IAAI,MAAM,IAAI,KAAK,OAAO;AAChC,YAAO,KACL,IACI,KAAK,UAAU;MAAE,IAAI,KAAK;MAAQ,GAAG;MAAG,CAAC,GACzC,iBAAiB,KAAK,SAC3B;;IAEJ,CAAC;GAEe,WAAW;IAC1B,MAAM;IACN,OAAO;IACP,aAAa;IACb,YAAY,KAAK,OAAO,EAAE,CAAC;IAE3B,MAAM,UAAU;AACd,YAAO,KACL,KAAK,UACH,MAAM,KAAK,MAAM,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,QAAQ;MAAE;MAAI,GAAG;MAAG,EAAE,CAC7D,CACF;;IAEJ,CAAC;GAEyD;EAAE;EAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./debug
|
|
2
|
-
import { n as analytics } from "./analytics-
|
|
1
|
+
import "./debug--QPXcpzv.js";
|
|
2
|
+
import { n as analytics } from "./analytics-jQRtyqzG.js";
|
|
3
3
|
import opn from "opn";
|
|
4
4
|
//#region src/utils/links.ts
|
|
5
5
|
/**
|
|
@@ -65,4 +65,4 @@ function updateProgress(step) {
|
|
|
65
65
|
//#endregion
|
|
66
66
|
export { withUtm as i, openTrackedLink as n, setEntryCommand as r, withProgress as t };
|
|
67
67
|
|
|
68
|
-
//# sourceMappingURL=telemetry-
|
|
68
|
+
//# sourceMappingURL=telemetry-wGk3UsDw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-
|
|
1
|
+
{"version":3,"file":"telemetry-wGk3UsDw.js","names":[],"sources":["../src/utils/links.ts","../src/telemetry.ts"],"sourcesContent":["/**\n * Outbound links: UTM tagging and tracked opens.\n *\n * Every URL the wizard sends a user to — auto-opened or printed in the TUI —\n * carries `utm_source=wizard`, `utm_medium=cli`, `utm_content=<which link>`.\n * The command dimension rides on every wizard event as the `command` tag.\n * Opening a link also captures a wizard event.\n */\nimport opn from 'opn';\nimport { NODE_ENV } from '@env';\nimport { analytics } from './analytics';\n\n/**\n * Record the CLI command this run was started with (e.g. `integrate`,\n * `slack`, `mcp-add`). Set once at dispatch; tagged onto every wizard\n * event so wizard-side events segment by command.\n */\nexport function setEntryCommand(command: string): void {\n analytics.setTag('command', command);\n}\n\n/**\n * Tag a URL with the wizard's UTM params. `content` names the specific link\n * (e.g. `oauth-signup`, `slack-connect-setup`). URLs that already carry a\n * utm_source — or don't parse — are returned untouched.\n */\nexport function withUtm(url: string, content: string): string {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return url;\n }\n if (parsed.searchParams.has('utm_source')) return url;\n parsed.searchParams.set('utm_source', 'wizard');\n parsed.searchParams.set('utm_medium', 'cli');\n parsed.searchParams.set('utm_content', content);\n return parsed.toString();\n}\n\n/**\n * Open a URL in the user's browser, UTM-tagged (pass `skipUtm` for\n * destinations that aren't PostHog properties or are already final), and\n * capture the interaction. `auto` marks opens the wizard initiated itself,\n * as opposed to a user picking a link on screen. opn throws in headless\n * environments — the URL is always also printed on screen, so the failure\n * is swallowed.\n */\nexport function openTrackedLink(\n url: string,\n content: string,\n opts?: { auto?: boolean; skipUtm?: boolean },\n): void {\n const finalUrl = opts?.skipUtm ? url : withUtm(url, content);\n analytics.wizardCapture('link opened', {\n content,\n url: finalUrl,\n auto: opts?.auto ?? false,\n });\n if (NODE_ENV !== 'test') {\n opn(finalUrl, { wait: false }).catch(() => {\n // No browser available — the printed URL is the fallback.\n });\n }\n}\n","import { analytics } from '@utils/analytics';\n\nexport function withProgress<T>(step: string, callback: () => T): T {\n updateProgress(step);\n return callback();\n}\n\nexport function updateProgress(step: string) {\n analytics.setTag('progress', step);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAgB,gBAAgB,SAAuB;AACrD,WAAU,OAAO,WAAW,QAAQ;;;;;;;AAQtC,SAAgB,QAAQ,KAAa,SAAyB;CAC5D,IAAI;AACJ,KAAI;AACF,WAAS,IAAI,IAAI,IAAI;SACf;AACN,SAAO;;AAET,KAAI,OAAO,aAAa,IAAI,aAAa,CAAE,QAAO;AAClD,QAAO,aAAa,IAAI,cAAc,SAAS;AAC/C,QAAO,aAAa,IAAI,cAAc,MAAM;AAC5C,QAAO,aAAa,IAAI,eAAe,QAAQ;AAC/C,QAAO,OAAO,UAAU;;;;;;;;;;AAW1B,SAAgB,gBACd,KACA,SACA,MACM;CACN,MAAM,WAAW,MAAM,UAAU,MAAM,QAAQ,KAAK,QAAQ;AAC5D,WAAU,cAAc,eAAe;EACrC;EACA,KAAK;EACL,MAAM,MAAM,QAAQ;EACrB,CAAC;AAEA,KAAI,UAAU,EAAE,MAAM,OAAO,CAAC,CAAC,YAAY,GAEzC;;;;AC5DN,SAAgB,aAAgB,MAAc,UAAsB;AAClE,gBAAe,KAAK;AACpB,QAAO,UAAU;;AAGnB,SAAgB,eAAe,MAAc;AAC3C,WAAU,OAAO,YAAY,KAAK"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as analytics } from "./analytics-
|
|
3
|
-
import { i as withUtm, n as openTrackedLink } from "./telemetry-
|
|
4
|
-
import { t as getOrAskForProjectData } from "./setup-utils-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import { i as
|
|
10
|
-
import {
|
|
11
|
-
import { c as TextBlock, d as isLinesBlock, f as isObjectBlock, l as computeVisibleRange, m as Icons, p as Colors, u as isClearBlock } from "./posthog-integration-G839iLK6.js";
|
|
1
|
+
import { L as POSTHOG_APP_URL, ct as getSkillsBaseUrl, h as SERVICE_LABELS, s as logToFile } from "./debug--QPXcpzv.js";
|
|
2
|
+
import { n as analytics } from "./analytics-jQRtyqzG.js";
|
|
3
|
+
import { i as withUtm, n as openTrackedLink } from "./telemetry-wGk3UsDw.js";
|
|
4
|
+
import { t as getOrAskForProjectData } from "./setup-utils-C8yipMUt.js";
|
|
5
|
+
import { a as fetchUserData, i as fetchSlackConnected } from "./api-Bweisj9K.js";
|
|
6
|
+
import "./wizard-session-BudcixsA.js";
|
|
7
|
+
import { a as formatTokenCount, i as formatCostUsd } from "./agent-runner-3bDJ_WLl.js";
|
|
8
|
+
import { i as fetchSkillMenu } from "./wizard-tools-BBLQk1YC.js";
|
|
9
|
+
import { i as AUDIT_SEVERITY_STYLE } from "./types-y3HkjtSq.js";
|
|
10
|
+
import { c as TextBlock, d as isLinesBlock, f as isObjectBlock, l as computeVisibleRange, m as Icons, p as Colors, u as isClearBlock } from "./posthog-integration-Cw1QDMFi.js";
|
|
12
11
|
import { a as ConfirmButton, d as Program, i as useKeyboardHintsContext, n as useKeyBindings, o as PromptLabel, r as KeyboardHintsProvider, t as PickerMenu, v as getKindMeta } from "./bin.js";
|
|
13
|
-
import { r as totalTokenCount } from "./store-
|
|
14
|
-
import { n as AVAILABLE_FEATURES, o as isAllFeaturesSelected, t as ALL_FEATURE_VALUES } from "./defaults-
|
|
12
|
+
import { r as totalTokenCount } from "./store-Bu1xO0_5.js";
|
|
13
|
+
import { n as AVAILABLE_FEATURES, o as isAllFeaturesSelected, t as ALL_FEATURE_VALUES } from "./defaults-CeNThA-1.js";
|
|
15
14
|
import opn from "opn";
|
|
16
15
|
import * as fs$1 from "fs";
|
|
17
16
|
import { Box, Text, measureElement, useInput, useStdout } from "ink";
|
|
@@ -2133,7 +2132,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
|
|
|
2133
2132
|
}
|
|
2134
2133
|
}),
|
|
2135
2134
|
phase === "feature-select" && /* @__PURE__ */ jsx(GroupedPickerMenu, {
|
|
2136
|
-
message: "Select
|
|
2135
|
+
message: "Select the PostHog areas your agent can reach",
|
|
2137
2136
|
groups: AVAILABLE_FEATURES,
|
|
2138
2137
|
initialSelected: [],
|
|
2139
2138
|
onSelect: (features) => {
|
|
@@ -2146,7 +2145,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
|
|
|
2146
2145
|
marginBottom: 1,
|
|
2147
2146
|
children: /* @__PURE__ */ jsx(Text, {
|
|
2148
2147
|
dimColor: true,
|
|
2149
|
-
children: "You'll choose which
|
|
2148
|
+
children: "You'll choose which PostHog areas to enable in Claude's UI after connecting."
|
|
2150
2149
|
})
|
|
2151
2150
|
}), /* @__PURE__ */ jsx(ConnectorContinue, { onContinue: () => void doInstall(selectedClientNames, []) })]
|
|
2152
2151
|
}),
|
|
@@ -3134,6 +3133,24 @@ function normalizeToolName(toolName) {
|
|
|
3134
3133
|
const idx = toolName.lastIndexOf("__");
|
|
3135
3134
|
return idx >= 0 ? toolName.slice(idx + 2) : toolName;
|
|
3136
3135
|
}
|
|
3136
|
+
/**
|
|
3137
|
+
* CLI mode wraps every real tool in a single `exec` tool whose `command`
|
|
3138
|
+
* string names the inner tool: `call query-trends {…}` → `query-trends`. The
|
|
3139
|
+
* inner name is the first token after `call` (past any `--flag` options).
|
|
3140
|
+
*/
|
|
3141
|
+
const EXEC_INNER_TOOL = /^call\s+(?:--\w+\s+)*([a-z0-9-]+)/;
|
|
3142
|
+
/**
|
|
3143
|
+
* Resolve the `TOOL_FOLLOW_UPS` lookup key from the last tool call, under both
|
|
3144
|
+
* server modes. Tools mode passes the real tool name directly; CLI mode passes
|
|
3145
|
+
* `exec` plus the command string, so we extract the inner tool from it. A
|
|
3146
|
+
* non-`call` exec command (`search`, `info`) has no inner tool and yields null,
|
|
3147
|
+
* so the lookup falls through to the generic pools.
|
|
3148
|
+
*/
|
|
3149
|
+
function resolveToolKey(toolName, toolCommand) {
|
|
3150
|
+
const normalized = normalizeToolName(toolName);
|
|
3151
|
+
if (normalized !== "exec") return normalized;
|
|
3152
|
+
return toolCommand?.match(EXEC_INNER_TOOL)?.[1] ?? null;
|
|
3153
|
+
}
|
|
3137
3154
|
/** Pick `n` items from a pool starting at a rotation offset. */
|
|
3138
3155
|
function pickRotated(pool, n, rotation) {
|
|
3139
3156
|
if (pool.length === 0) return [];
|
|
@@ -3185,8 +3202,8 @@ function getRoleGreeting(role) {
|
|
|
3185
3202
|
* so successive visits surface different slices.
|
|
3186
3203
|
*/
|
|
3187
3204
|
function getFollowUps(args) {
|
|
3188
|
-
const { lastToolName, role, branchHistory } = args;
|
|
3189
|
-
const normalized =
|
|
3205
|
+
const { lastToolName, lastToolCommand, role, branchHistory } = args;
|
|
3206
|
+
const normalized = resolveToolKey(lastToolName, lastToolCommand ?? null);
|
|
3190
3207
|
const depth = branchHistory.length;
|
|
3191
3208
|
const candidates = [];
|
|
3192
3209
|
if (normalized && TOOL_FOLLOW_UPS[normalized]) candidates.push(...TOOL_FOLLOW_UPS[normalized]);
|
|
@@ -3278,6 +3295,7 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
|
|
|
3278
3295
|
const [runCount, setRunCount] = useState(0);
|
|
3279
3296
|
const canPickAnother = runCount < MAX_PROMPT_RUNS;
|
|
3280
3297
|
const [lastToolName, setLastToolName] = useState(null);
|
|
3298
|
+
const [lastToolCommand, setLastToolCommand] = useState(null);
|
|
3281
3299
|
const [branchHistory, setBranchHistory] = useState([]);
|
|
3282
3300
|
const runAbortRef = useRef(null);
|
|
3283
3301
|
const currentSessionIdRef = useRef(null);
|
|
@@ -3320,6 +3338,7 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
|
|
|
3320
3338
|
setRunStartedAt(startedAt);
|
|
3321
3339
|
setRunChunks([]);
|
|
3322
3340
|
setLastToolName(null);
|
|
3341
|
+
setLastToolCommand(null);
|
|
3323
3342
|
setRunDurationSecs(null);
|
|
3324
3343
|
const finishStream = (kind, durationMs, errorText) => {
|
|
3325
3344
|
if (controller.signal.aborted) return;
|
|
@@ -3349,7 +3368,10 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
|
|
|
3349
3368
|
})) {
|
|
3350
3369
|
if (controller.signal.aborted) return;
|
|
3351
3370
|
setRunChunks((prev) => [...prev, chunk]);
|
|
3352
|
-
if (chunk.kind === "tool-call")
|
|
3371
|
+
if (chunk.kind === "tool-call") {
|
|
3372
|
+
setLastToolName(chunk.toolName);
|
|
3373
|
+
setLastToolCommand(chunk.command ?? null);
|
|
3374
|
+
}
|
|
3353
3375
|
if (chunk.kind === "done") {
|
|
3354
3376
|
if (chunk.sessionId) currentSessionIdRef.current = chunk.sessionId;
|
|
3355
3377
|
finishStream("done", Date.now() - startedAt);
|
|
@@ -3510,6 +3532,7 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
|
|
|
3510
3532
|
flexDirection: "column",
|
|
3511
3533
|
children: /* @__PURE__ */ jsx(FollowUpPhase, {
|
|
3512
3534
|
lastToolName,
|
|
3535
|
+
lastToolCommand,
|
|
3513
3536
|
lastPrompt: runningPrompt,
|
|
3514
3537
|
chunks: runChunks,
|
|
3515
3538
|
role: session.roleAtOrganization,
|
|
@@ -3845,14 +3868,16 @@ const ChunkLine = ({ chunk }) => {
|
|
|
3845
3868
|
});
|
|
3846
3869
|
return null;
|
|
3847
3870
|
};
|
|
3848
|
-
const FollowUpPhase = ({ lastToolName, lastPrompt, chunks, role, branchHistory, canPickAnother, maxRuns, onSelect }) => {
|
|
3871
|
+
const FollowUpPhase = ({ lastToolName, lastToolCommand, lastPrompt, chunks, role, branchHistory, canPickAnother, maxRuns, onSelect }) => {
|
|
3849
3872
|
const followUps = useMemo(() => getFollowUps({
|
|
3850
3873
|
lastToolName,
|
|
3874
|
+
lastToolCommand,
|
|
3851
3875
|
lastPrompt: lastPrompt || "",
|
|
3852
3876
|
role,
|
|
3853
3877
|
branchHistory
|
|
3854
3878
|
}), [
|
|
3855
3879
|
lastToolName,
|
|
3880
|
+
lastToolCommand,
|
|
3856
3881
|
lastPrompt,
|
|
3857
3882
|
role,
|
|
3858
3883
|
branchHistory
|
|
@@ -4699,7 +4724,7 @@ const SlackConnectScreen = ({ store }) => {
|
|
|
4699
4724
|
let timer;
|
|
4700
4725
|
const controller = new AbortController();
|
|
4701
4726
|
const check = () => {
|
|
4702
|
-
fetchSlackConnected(credentials.accessToken, credentials.projectId, credentials.host, controller.signal).then((isConnected) => {
|
|
4727
|
+
fetchSlackConnected(credentials.accessToken, credentials.projectId, credentials.host.apiHost, controller.signal).then((isConnected) => {
|
|
4703
4728
|
if (cancelled) return;
|
|
4704
4729
|
if (isConnected) {
|
|
4705
4730
|
if (store.session.slackConnected === false) analytics.wizardCapture("slack connect completed", { role });
|
|
@@ -5251,7 +5276,6 @@ const AiOptInRequiredScreen = ({ store }) => {
|
|
|
5251
5276
|
const { session } = store;
|
|
5252
5277
|
const isAdmin = ((session.apiUser?.organization)?.membership_level ?? 0) >= ORG_ADMIN_LEVEL;
|
|
5253
5278
|
const variant = isAdmin ? "admin" : "non-admin";
|
|
5254
|
-
const region = session.region ?? "us";
|
|
5255
5279
|
const projectId = session.credentials?.projectId;
|
|
5256
5280
|
const settingsUrl = projectId != null ? `${POSTHOG_APP_URL}/project/${projectId}/${SETTINGS_PATH}${SETTINGS_ANCHOR}` : `${POSTHOG_APP_URL}/${SETTINGS_PATH}${SETTINGS_ANCHOR}`;
|
|
5257
5281
|
const [showSkill, setShowSkill] = useState(false);
|
|
@@ -5280,14 +5304,14 @@ const AiOptInRequiredScreen = ({ store }) => {
|
|
|
5280
5304
|
variant,
|
|
5281
5305
|
action: "retry"
|
|
5282
5306
|
});
|
|
5283
|
-
const
|
|
5284
|
-
if (!accessToken) {
|
|
5307
|
+
const credentials = session.credentials;
|
|
5308
|
+
if (!credentials?.accessToken) {
|
|
5285
5309
|
setRetryError("Missing credentials — cannot retry.");
|
|
5286
5310
|
return;
|
|
5287
5311
|
}
|
|
5288
5312
|
setRetrying(true);
|
|
5289
5313
|
setRetryError(null);
|
|
5290
|
-
fetchUserData(accessToken,
|
|
5314
|
+
fetchUserData(credentials.accessToken, credentials.host.appHost).then((user) => {
|
|
5291
5315
|
store.setApiUser(user);
|
|
5292
5316
|
}).catch((err) => {
|
|
5293
5317
|
setRetryError(err instanceof Error ? err.message : "Retry failed.");
|
|
@@ -5473,4 +5497,4 @@ function releaseTerminal() {
|
|
|
5473
5497
|
//#endregion
|
|
5474
5498
|
export { ConfirmationInput as A, TabContainer as C, LinkText as D, LogViewer as E, SplitView as F, CardLayout as I, useStdoutDimensions as M, ProgressList as N, extractUrls as O, LoadingBox as P, HNViewer as S, EventPlanViewer as T, SEVERITY_ORDER as _, useSkillEntry as a, LearnCard as b, SlackConnectScreen as c, AuditChecksViewer as d, McpSuggestedPromptsScreen as f, SEVERITY_LABEL as g, IssueTable as h, SkillSourceInfo as i, GroupedPickerMenu as j, ModalOverlay as k, AUDIT_AREA_SLIDES as l, McpScreen as m, releaseTerminal as n, OutroScreen as o, TAILORED_ROLES as p, AiOptInRequiredScreen as r, useDismissOnAnyKey as s, enterDarkTerminal as t, VisualBox as u, ServiceHealthList as v, ScreenContainer as w, ContentSequencer as x, TipsCard as y };
|
|
5475
5499
|
|
|
5476
|
-
//# sourceMappingURL=terminal-
|
|
5500
|
+
//# sourceMappingURL=terminal-CnYduoIp.js.map
|