@llblab/pi-telegram 0.36.4 → 0.36.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  > Each release keeps at most 8 outcome records of at most 512 characters.
4
4
 
5
+ ## 0.36.5: Separated Tool Errors
6
+
7
+ - `Separated Tool Errors`: Prefixes Telegram attachment and direct-message Tool failures with one normalized leading newline so Pi renders error evidence on a visually separated line beneath the Tool name without changing the underlying diagnostic text.
8
+
5
9
  ## 0.36.4: Async Host Settings Compatibility
6
10
 
7
11
  - `Async Host Settings`: Normalizes synchronous or asynchronous settings construction plus legacy enabled-model methods or generic `get` / `set` services at the Pi adapter boundary before model-menu reads and scoped-model persistence, improving compatible-host interoperability without changing native Pi behavior or weakening required `agent_settled` semantics.
@@ -436,6 +436,11 @@ async function buildTelegramOutboundAttachmentViews(options: {
436
436
  return pendingAttachments;
437
437
  }
438
438
 
439
+ function formatTelegramOutboundToolError(error: unknown): Error {
440
+ const message = error instanceof Error ? error.message : String(error);
441
+ return new Error(`\n${message.replace(/^\n+/u, "") || "Telegram outbound operation failed."}`);
442
+ }
443
+
439
444
  export function registerTelegramOutboundAttachmentTool(
440
445
  pi: ExtensionAPI,
441
446
  deps: TelegramOutboundAttachmentToolRegistrationDeps,
@@ -496,7 +501,7 @@ export function registerTelegramOutboundAttachmentTool(
496
501
  phase: "queue",
497
502
  count: params.paths.length,
498
503
  });
499
- throw error;
504
+ throw formatTelegramOutboundToolError(error);
500
505
  }
501
506
  },
502
507
  });
@@ -548,7 +553,7 @@ export function registerTelegramOutboundMessageTool(
548
553
  });
549
554
  } catch (error) {
550
555
  deps.recordRuntimeEvent?.("message", error, { phase: "direct" });
551
- throw error;
556
+ throw formatTelegramOutboundToolError(error);
552
557
  }
553
558
  },
554
559
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-telegram",
3
- "version": "0.36.4",
3
+ "version": "0.36.5",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"