Improve cursor logging

This commit is contained in:
Colin McDonnell
2025-12-02 20:48:07 -08:00
parent 07a2ec3ab2
commit 6ce1d9773c
4 changed files with 36 additions and 19 deletions
+10 -6
View File
@@ -83859,7 +83859,7 @@ function query({
// package.json
var package_default = {
name: "@pullfrog/action",
version: "0.0.119",
version: "0.0.120",
type: "module",
files: [
"index.js",
@@ -93400,7 +93400,7 @@ var cursor = agent({
},
run: async ({ payload, apiKey, cliPath, mcpServers }) => {
configureCursorMcpServers({ mcpServers, cliPath });
const loggedAssistantMessages = /* @__PURE__ */ new Set();
const loggedModelCallIds = /* @__PURE__ */ new Set();
const messageHandlers4 = {
system: (_event) => {
},
@@ -93410,8 +93410,13 @@ var cursor = agent({
},
assistant: (event) => {
const text = event.message?.content?.[0]?.text?.trim();
if (text && !loggedAssistantMessages.has(text)) {
loggedAssistantMessages.add(text);
if (!text) return;
if (event.model_call_id) {
if (!loggedModelCallIds.has(event.model_call_id)) {
loggedModelCallIds.add(event.model_call_id);
log.box(text, { title: "Cursor" });
}
} else {
log.box(text, { title: "Cursor" });
}
},
@@ -93456,7 +93461,7 @@ var cursor = agent({
fullPrompt,
"--output-format",
"stream-json",
"--stream-partial-output",
// "--stream-partial-output",
"--approve-mcps",
"--force"
],
@@ -93486,7 +93491,6 @@ var cursor = agent({
if (handler2) {
await handler2(event);
}
log.debug(`[cursor event] ${JSON.stringify(event, null, 2)}`);
} catch {
}
});