@friendlyrobot/discord-pi-agent 0.9.10 → 0.10.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/index.js +6 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -104,15 +104,12 @@ async function formatWithPrettier(text) {
|
|
|
104
104
|
// src/reply-buffer.ts
|
|
105
105
|
var logger3 = createModuleLogger("reply-buffer");
|
|
106
106
|
async function collectReply(session, prompt, options = {}) {
|
|
107
|
-
const logPrefix = options.logPrefix ?? "[agent]";
|
|
108
107
|
let streamedText = "";
|
|
109
108
|
let eventCount = 0;
|
|
110
109
|
let toolCount = 0;
|
|
111
|
-
let sawAgentEnd = false;
|
|
112
110
|
const model = session.model ? `${session.model.provider}/${session.model.id}` : "none";
|
|
113
111
|
debugPrint(prompt, "Full Prompt");
|
|
114
112
|
logger3.debug({
|
|
115
|
-
logPrefix,
|
|
116
113
|
promptLength: prompt.length,
|
|
117
114
|
model,
|
|
118
115
|
prompt
|
|
@@ -129,24 +126,22 @@ async function collectReply(session, prompt, options = {}) {
|
|
|
129
126
|
toolCount += 1;
|
|
130
127
|
logger3.debug({
|
|
131
128
|
toolName: event.toolName,
|
|
132
|
-
input: truncateForLog(JSON.stringify(event.args))
|
|
133
|
-
|
|
134
|
-
}, "tool start");
|
|
129
|
+
input: truncateForLog(JSON.stringify(event.args))
|
|
130
|
+
}, `tool [${event.toolName}] start`);
|
|
135
131
|
}
|
|
136
132
|
if (event.type === "tool_execution_end") {
|
|
137
133
|
logger3.debug({
|
|
138
134
|
toolName: event.toolName,
|
|
139
135
|
isError: event.isError,
|
|
140
|
-
output: truncateForLog(extractToolOutput(event.result))
|
|
141
|
-
|
|
142
|
-
}, "tool end");
|
|
136
|
+
output: truncateForLog(extractToolOutput(event.result))
|
|
137
|
+
}, `tool [${event.toolName}] end`);
|
|
143
138
|
}
|
|
144
139
|
if (event.type === "agent_end") {
|
|
145
|
-
sawAgentEnd = true;
|
|
146
140
|
logger3.debug({
|
|
147
141
|
messageCount: event.messages.length,
|
|
148
142
|
model,
|
|
149
|
-
|
|
143
|
+
toolCount,
|
|
144
|
+
eventCount
|
|
150
145
|
}, "agent end");
|
|
151
146
|
}
|
|
152
147
|
});
|