channels.tools 0.1.2 → 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.
package/README.md CHANGED
@@ -50,11 +50,10 @@ speak this protocol.
50
50
  - A server that crashes is retried with backoff; its tools re-register on
51
51
  reconnect. A misbehaving or non-conforming process is killed and logged.
52
52
 
53
- ## The protocol (`claude/channel` convention)
53
+ ## The protocol
54
54
 
55
55
  A channel server is a subprocess speaking **newline-delimited JSON-RPC 2.0
56
- over stdio** (no `Content-Length` framing). `claude/channel` is the
57
- convention's wire name.
56
+ over stdio** (no `Content-Length` framing, no network, no ports).
58
57
 
59
58
  1. **Handshake** — client sends `initialize`; the server's result must
60
59
  declare `capabilities.experimental["claude/channel"]` and may include an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channels.tools",
3
- "version": "0.1.2",
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 {