From 07a2ec3ab2b4a014c1373e1982a94d924a634b30 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Tue, 2 Dec 2025 20:32:10 -0800 Subject: [PATCH] 0.0.119 --- entry | 103 ++++++++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 54 insertions(+), 51 deletions(-) diff --git a/entry b/entry index 07d9fb4..da267fb 100755 --- a/entry +++ b/entry @@ -83859,7 +83859,7 @@ function query({ // package.json var package_default = { name: "@pullfrog/action", - version: "0.0.118", + version: "0.0.119", type: "module", files: [ "index.js", @@ -92367,7 +92367,7 @@ Before starting any work, you must first determine which mode to use by examinin Available modes: -${[...modes, ...payload.modes].map((w) => ` - "${w.name}": ${w.description}`).join("\n")} +${(payload.modes.length > 0 ? payload.modes : modes).map((w) => ` - "${w.name}": ${w.description}`).join("\n")} **IMPORTANT**: The first thing you must do is: 1. Examine the user's request/prompt carefully @@ -93390,50 +93390,6 @@ import { spawn as spawn3 } from "node:child_process"; import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync2 } from "node:fs"; import { homedir as homedir2 } from "node:os"; import { join as join6 } from "node:path"; -var messageHandlers3 = { - system: (_event) => { - }, - user: (_event) => { - }, - thinking: (_event) => { - }, - assistant: (event) => { - if (event.model_call_id) { - const text = event.message?.content?.[0]?.text; - if (text?.trim()) { - log.box(text.trim(), { title: "Cursor" }); - } - } - }, - tool_call: (event) => { - if (event.subtype === "started") { - const mcpToolCall = event.tool_call?.mcpToolCall; - const builtinToolCall = event.tool_call?.builtinToolCall; - if (mcpToolCall?.args?.toolName && mcpToolCall?.args?.args) { - log.toolCall({ - toolName: mcpToolCall.args.toolName, - input: mcpToolCall.args.args - }); - } else if (builtinToolCall?.args?.name && builtinToolCall?.args?.args) { - log.toolCall({ - toolName: builtinToolCall.args.name, - input: builtinToolCall.args.args - }); - } - } else if (event.subtype === "completed") { - const isError = event.tool_call?.mcpToolCall?.result?.success?.isError; - if (isError) { - log.warning("Tool call failed"); - } - } - }, - result: async (event) => { - if (event.subtype === "success" && event.duration_ms) { - const durationSec = (event.duration_ms / 1e3).toFixed(1); - log.debug(`Cursor completed in ${durationSec}s`); - } - } -}; var cursor = agent({ name: "cursor", install: async () => { @@ -93444,6 +93400,50 @@ var cursor = agent({ }, run: async ({ payload, apiKey, cliPath, mcpServers }) => { configureCursorMcpServers({ mcpServers, cliPath }); + const loggedAssistantMessages = /* @__PURE__ */ new Set(); + const messageHandlers4 = { + system: (_event) => { + }, + user: (_event) => { + }, + thinking: (_event) => { + }, + assistant: (event) => { + const text = event.message?.content?.[0]?.text?.trim(); + if (text && !loggedAssistantMessages.has(text)) { + loggedAssistantMessages.add(text); + log.box(text, { title: "Cursor" }); + } + }, + tool_call: (event) => { + if (event.subtype === "started") { + const mcpToolCall = event.tool_call?.mcpToolCall; + const builtinToolCall = event.tool_call?.builtinToolCall; + if (mcpToolCall?.args?.toolName && mcpToolCall?.args?.args) { + log.toolCall({ + toolName: mcpToolCall.args.toolName, + input: mcpToolCall.args.args + }); + } else if (builtinToolCall?.args?.name && builtinToolCall?.args?.args) { + log.toolCall({ + toolName: builtinToolCall.args.name, + input: builtinToolCall.args.args + }); + } + } else if (event.subtype === "completed") { + const isError = event.tool_call?.mcpToolCall?.result?.success?.isError; + if (isError) { + log.warning("Tool call failed"); + } + } + }, + result: async (event) => { + if (event.subtype === "success" && event.duration_ms) { + const durationSec = (event.duration_ms / 1e3).toFixed(1); + log.debug(`Cursor completed in ${durationSec}s`); + } + } + }; try { const fullPrompt = addInstructions(payload); log.info("Running Cursor CLI..."); @@ -93479,7 +93479,10 @@ var cursor = agent({ stdout += text; try { const event = JSON.parse(text); - const handler2 = messageHandlers3[event.type]; + if (event.type === "thinking" && event.subtype === "delta" && !event.text) { + return; + } + const handler2 = messageHandlers4[event.type]; if (handler2) { await handler2(event); } @@ -93640,7 +93643,7 @@ async function spawn4(options) { // agents/gemini.ts var assistantMessageBuffer = ""; -var messageHandlers4 = { +var messageHandlers3 = { init: (_event) => { assistantMessageBuffer = ""; }, @@ -93740,7 +93743,7 @@ var gemini = agent({ log.debug(`[gemini stdout] ${trimmed}`); try { const event = JSON.parse(trimmed); - const handler2 = messageHandlers4[event.type]; + const handler2 = messageHandlers3[event.type]; if (handler2) { await handler2(event); } @@ -122737,7 +122740,7 @@ function parsePayload(inputs) { agent: null, prompt: inputs.prompt, event: { - trigger: "workflow_dispatch" + trigger: "unknown" }, modes }; diff --git a/package.json b/package.json index 2070e4f..74c9692 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pullfrog/action", - "version": "0.0.118", + "version": "0.0.119", "type": "module", "files": [ "index.js",