claude-threads 0.57.3 → 0.57.4

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 +21 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51294,9 +51294,11 @@ function formatLogEntries(entries) {
51294
51294
  case "lifecycle":
51295
51295
  summary = `lifecycle:${entry.action}${entry.username ? ` by ${anonymizer.anonymize(entry.username)}` : ""}`;
51296
51296
  break;
51297
- case "user_message":
51298
- summary = `user_message: ${anonymizer.anonymize(entry.username)} - [message redacted]`;
51297
+ case "user_message": {
51298
+ const msgPreview = entry.message ? sanitizeText(entry.message.slice(0, 50)) + (entry.message.length > 50 ? "..." : "") : "[empty]";
51299
+ summary = `${anonymizer.anonymize(entry.username)}: ${msgPreview}`;
51299
51300
  break;
51301
+ }
51300
51302
  case "command": {
51301
51303
  let args = entry.args || "";
51302
51304
  if (entry.command === "invite" || entry.command === "kick") {
@@ -51319,23 +51321,34 @@ function formatLogEntries(entries) {
51319
51321
  const msg = entry.event;
51320
51322
  const content = msg.message?.content?.[0];
51321
51323
  if (content?.type === "text") {
51322
- summary = `assistant: [text]`;
51324
+ const len = content.text?.length || 0;
51325
+ summary = `text (${len} chars)`;
51323
51326
  } else if (content?.type === "tool_use") {
51324
51327
  summary = `tool_use: ${content.name}`;
51325
51328
  } else if (content?.type === "thinking") {
51326
- summary = `assistant: [thinking]`;
51329
+ const len = content.thinking?.length || 0;
51330
+ summary = `thinking (${len} chars)`;
51327
51331
  } else {
51328
51332
  summary = `assistant: [${content?.type || "response"}]`;
51329
51333
  }
51330
51334
  } else if (eventType === "user") {
51331
- summary = `tool_result`;
51335
+ const toolResult = entry.event;
51336
+ const content = toolResult.message?.content?.[0];
51337
+ if (content?.is_error) {
51338
+ summary = `tool_result: error`;
51339
+ } else {
51340
+ summary = `tool_result: ok`;
51341
+ }
51332
51342
  } else if (eventType === "system") {
51333
51343
  const sysEvent = entry.event;
51334
- summary = `system:${sysEvent.subtype || "init"}`;
51344
+ summary = `system: ${sysEvent.subtype || "init"}`;
51335
51345
  } else if (eventType === "result") {
51336
- summary = `result: completed`;
51346
+ const resultEvent = entry.event;
51347
+ const cost = resultEvent.cost_usd ? `$${resultEvent.cost_usd.toFixed(3)}` : "";
51348
+ const duration = resultEvent.duration_ms ? `${Math.round(resultEvent.duration_ms / 1000)}s` : "";
51349
+ summary = `result: completed${cost ? ` ${cost}` : ""}${duration ? ` [${duration}]` : ""}`;
51337
51350
  } else {
51338
- summary = `claude_event:${eventType}`;
51351
+ summary = `claude: ${eventType}`;
51339
51352
  }
51340
51353
  break;
51341
51354
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-threads",
3
- "version": "0.57.3",
3
+ "version": "0.57.4",
4
4
  "description": "Share Claude Code sessions live in a Mattermost channel with interactive features",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",