channels.tools 0.1.3 → 0.1.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/package.json +1 -1
  2. package/src/index.ts +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channels.tools",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Channels for the pi coding agent: connect channel servers that push events into a live session — wake it when idle, queue when busy — and proxy their tools. A client for the claude/channel convention.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -70,7 +70,12 @@ export function createExtension(pi: any, deps: Deps = {}): void {
70
70
  log: (message) => log(message),
71
71
  });
72
72
 
73
- let ui: { setStatus?: (key: string, value?: string) => void } | undefined;
73
+ let ui:
74
+ | {
75
+ setStatus?: (key: string, value?: string) => void;
76
+ notify?: (message: string, type?: string) => void;
77
+ }
78
+ | undefined;
74
79
  const registeredNames = new Set<string>();
75
80
 
76
81
  function uiSetStatus(status: string): void {
@@ -78,7 +83,11 @@ export function createExtension(pi: any, deps: Deps = {}): void {
78
83
  }
79
84
 
80
85
  function log(message: string): void {
81
- process.stderr.write(`[channels] ${message}\n`);
86
+ // Raw stderr writes corrupt the TUI's input line (the text bleeds into
87
+ // the editor and sticks until pi exits). Once session_start has handed
88
+ // us ctx.ui, route through notify; stderr is only the pre-UI fallback.
89
+ if (ui?.notify) ui.notify(`[channels] ${message}`, "info");
90
+ else process.stderr.write(`[channels] ${message}\n`);
82
91
  }
83
92
 
84
93
  function registerTools(connections: Connection[]): void {