a2acalling 0.6.14 → 0.6.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "a2acalling",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "description": "Agent-to-agent calling for OpenClaw - A2A agent communication",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -23,9 +23,10 @@
23
23
  // a) Run quickstart with piped stdio, capturing all its output.
24
24
  // b) Save the output to a2a-onboarding.txt in the config dir (reliable
25
25
  // fallback — agents can always read this file).
26
- // c) Try /dev/tty (interactive terminals bypasses npm entirely).
27
- // d) Try /proc/$PPID/fd/2 (Linux writes directly to npm's stderr fd,
28
- // which IS the caller's stderr, bypassing npm's pipe buffer).
26
+ // c) Try /proc/$PPID/fd/2 FIRST (Linuxwrites directly to npm's
27
+ // stderr fd, which IS the caller's output stream. Agents capture
28
+ // via pipes, so this is the primary delivery path).
29
+ // d) Try /dev/tty (macOS/non-Linux — interactive terminals).
29
30
  // e) Last resort: process.stderr.write (npm may still buffer this).
30
31
  //
31
32
  // 3. Never fail the install. If quickstart can't launch (e.g. missing node
@@ -83,21 +84,23 @@ try {
83
84
  // to our own fds goes into npm's buffer. We need to bypass npm entirely.
84
85
 
85
86
  function tryWrite(output) {
86
- // Strategy 1: /dev/ttyinteractive terminals.
87
- // npm runs postinstall with piped stdio, but /dev/tty talks directly to
88
- // the user's terminal. Works for humans, not for agents.
87
+ // Strategy 1: /proc/$PPID/fd/2Linux, write to npm's stderr directly.
88
+ // npm's stderr IS the caller's stderr (the agent's output stream).
89
+ // This bypasses npm's pipe buffer because we open the fd independently.
90
+ // This is tried FIRST because agents are the primary users — their output
91
+ // is captured via pipes, and /dev/tty would send output to a terminal
92
+ // device they can't read from.
89
93
  try {
90
- const fd = fs.openSync('/dev/tty', 'w');
94
+ const fd = fs.openSync(`/proc/${process.ppid}/fd/2`, 'w');
91
95
  fs.writeSync(fd, output);
92
96
  fs.closeSync(fd);
93
97
  return true;
94
98
  } catch (_) {}
95
99
 
96
- // Strategy 2: /proc/$PPID/fd/2Linux, write to npm's stderr directly.
97
- // npm's stderr IS the caller's stderr (the agent's output stream).
98
- // This bypasses npm's pipe buffer because we open the fd independently.
100
+ // Strategy 2: /dev/ttyinteractive terminals (macOS, non-Linux).
101
+ // Talks directly to the user's terminal, bypassing npm's pipe.
99
102
  try {
100
- const fd = fs.openSync(`/proc/${process.ppid}/fd/2`, 'w');
103
+ const fd = fs.openSync('/dev/tty', 'w');
101
104
  fs.writeSync(fd, output);
102
105
  fs.closeSync(fd);
103
106
  return true;