@grknbyk/agent-wire 0.4.0 → 0.4.1

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": "@grknbyk/agent-wire",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Let AI coding agents message each other through a shared Slack channel, over MCP.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/mcp.mjs CHANGED
@@ -293,7 +293,7 @@ export function serve() {
293
293
  result: {
294
294
  protocolVersion: '2024-11-05',
295
295
  capabilities: { tools: {} },
296
- serverInfo: { name: 'agent-wire', version: '0.4.0' },
296
+ serverInfo: { name: 'agent-wire', version: '0.4.1' },
297
297
  instructions: INSTRUCTIONS,
298
298
  },
299
299
  });
package/src/setup.mjs CHANGED
@@ -145,8 +145,22 @@ const markFor = (nickname) => {
145
145
  };
146
146
 
147
147
  export async function runSetup() {
148
+ // Setup is a conversation, so it needs a terminal on the other end. Without
149
+ // one, stdin reaches end of file before the first answer and rl.question()
150
+ // waits for a line that can never arrive: the process hangs with no output.
151
+ if (!process.stdin.isTTY) {
152
+ console.log('agent-wire setup needs an interactive terminal.');
153
+ console.log('Run it directly in your shell, not through a pipe, a script or an editor task.');
154
+ return 1;
155
+ }
156
+
148
157
  const rl = createInterface({ input: process.stdin, output: process.stdout });
149
- const ask = (question) => rl.question(question);
158
+ // A terminal can still close mid-answer, on Ctrl-D or a lost session. Race
159
+ // the question against that, or the same silent hang comes back.
160
+ const ask = (question) => Promise.race([
161
+ rl.question(question),
162
+ new Promise((_, reject) => rl.once('close', () => reject(new Error('input closed')))),
163
+ ]);
150
164
 
151
165
  try {
152
166
  console.log('agent-wire setup\n');
@@ -209,9 +223,14 @@ export async function runSetup() {
209
223
  console.log(`\nDone. You are ${config.mark} ${config.nickname} in #${channel.name}.`);
210
224
  console.log(`Config: ${paths.config}`);
211
225
  console.log('\nAdd this to your MCP client (Claude Code: `claude mcp add agent-wire -- npx -y @grknbyk/agent-wire serve`):');
212
- console.log(JSON.stringify({ mcpServers: { 'agent-wire': { command: 'npx', args: ['-y', 'agent-wire', 'serve'] } } }, null, 2));
226
+ console.log(JSON.stringify({ mcpServers: { 'agent-wire': { command: 'npx', args: ['-y', '@grknbyk/agent-wire', 'serve'] } } }, null, 2));
213
227
  console.log(`\nUpload assets/agent-wire.png as the app icon at https://api.slack.com/apps (Basic Information → Display Information).`);
214
228
  return 0;
229
+ } catch (error) {
230
+ if (error.message !== 'input closed') throw error;
231
+
232
+ console.log('\nStopped: no more input. Re-run setup — it resumes where it left off.');
233
+ return 1;
215
234
  } finally {
216
235
  rl.close();
217
236
  }