@friendlyrobot/discord-pi-agent 0.10.0 → 0.10.1

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -126,15 +126,15 @@ async function collectReply(session, prompt, options = {}) {
126
126
  toolCount += 1;
127
127
  logger3.debug({
128
128
  toolName: event.toolName,
129
- input: truncateForLog(JSON.stringify(event.args))
130
- }, `tool [${event.toolName}] start`);
129
+ input: event.toolName === "bash" ? event.args.command : event.args
130
+ }, `tool start: [${event.toolName}] `);
131
131
  }
132
132
  if (event.type === "tool_execution_end") {
133
133
  logger3.debug({
134
134
  toolName: event.toolName,
135
135
  isError: event.isError,
136
- output: truncateForLog(extractToolOutput(event.result))
137
- }, `tool [${event.toolName}] end`);
136
+ output: event.result
137
+ }, `tool end: [${event.toolName}]`);
138
138
  }
139
139
  if (event.type === "agent_end") {
140
140
  logger3.debug({
@@ -164,22 +164,6 @@ async function collectReply(session, prompt, options = {}) {
164
164
  }
165
165
  return "No response generated.";
166
166
  }
167
- function truncateForLog(value, maxLength = 400) {
168
- if (value.length <= maxLength) {
169
- return value;
170
- }
171
- return `${value.slice(0, maxLength)}...`;
172
- }
173
- function extractToolOutput(output) {
174
- if (typeof output === "string") {
175
- return output;
176
- }
177
- try {
178
- return JSON.stringify(output);
179
- } catch {
180
- return String(output);
181
- }
182
- }
183
167
  function getLatestAssistantText(messages) {
184
168
  const latestAssistantMessage = [...messages].reverse().find((message) => {
185
169
  return message.role === "assistant";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@friendlyrobot/discord-pi-agent",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Reusable Discord gateway bridge for persistent pi agent sessions",
5
5
  "license": "MIT",
6
6
  "type": "module",