agent-relay-server 0.3.10 → 0.3.12

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
@@ -311,6 +311,7 @@ claude/ # Claude Code plugin
311
311
  ├── monitors/monitors.json # Auto-start inbox monitor
312
312
  └── hooks/
313
313
  ├── relay-monitor.sh # Register, inject context, poll
314
+ ├── set-status.sh # Turn hooks: busy/idle status updates
314
315
  ├── session-end.sh # Mark agent offline
315
316
  └── poll-inbox.sh # Inbox poll loop
316
317
 
@@ -173,4 +173,4 @@ const identity = buildAgentIdentity({
173
173
  appServerUrl,
174
174
  });
175
175
 
176
- outputContext(`Agent Relay active. Agent ID: ${identity.id}. Relay URL: ${relayUrl}. Incoming messages will arrive as live user turns. To reply or send a message, POST JSON to ${relayUrl}/api/messages with from="${identity.id}", to, subject, and body.`);
176
+ outputContext(`Agent Relay active. Agent ID: ${identity.id}. Relay URL: ${relayUrl}. Incoming messages will arrive as live user turns. To reply or send a message, POST JSON to ${relayUrl}/api/messages with from="${identity.id}", to, subject, and body. Message etiquette: acknowledge incoming agent messages briefly unless they are obvious noise. Anti-loop rule: do not auto-reply to pure acknowledgements/thanks/received messages; acknowledge once, then follow up only when there is new work, a decision, or a deliverable.`);
@@ -524,6 +524,8 @@ function formatRelayPrompt(messages: RelayMessage[]): string {
524
524
  message.body,
525
525
  "",
526
526
  "Treat this as a live incoming message from another agent. Respond or act on it as appropriate.",
527
+ "Message etiquette: send a short acknowledgement or status reply unless the message is obvious noise.",
528
+ "Anti-loop rule: do not auto-reply to pure acknowledgements, thanks, or received messages; acknowledge once, then only send follow-ups when there is new work, a decision, or a deliverable.",
527
529
  `To reply, POST JSON to ${process.env.AGENT_RELAY_URL || "http://127.0.0.1:4850"}/api/messages with from set to your Agent Relay ID, to set to ${JSON.stringify(message.from)}, and replyTo set to ${message.id}.`,
528
530
  );
529
531
  return lines.join("\n");
@@ -550,6 +552,8 @@ function formatRelayPrompt(messages: RelayMessage[]): string {
550
552
 
551
553
  lines.push(
552
554
  "Treat these as live incoming messages from other agents. Synthesize them into one coherent response or action.",
555
+ "Message etiquette: send a short acknowledgement or status reply unless the messages are obvious noise.",
556
+ "Anti-loop rule: do not auto-reply to pure acknowledgements, thanks, or received messages; acknowledge once, then only send follow-ups when there is new work, a decision, or a deliverable.",
553
557
  `To reply, POST JSON to ${process.env.AGENT_RELAY_URL || "http://127.0.0.1:4850"}/api/messages with from set to your Agent Relay ID and replyTo set to the message you are answering.`,
554
558
  );
555
559
  return lines.join("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/public/index.html CHANGED
@@ -282,7 +282,7 @@
282
282
  <div class="card agent-card" :class="{ selected: selectedAgent === a.id }">
283
283
  <div class="card-body">
284
284
  <div class="d-flex align-items-start gap-2">
285
- <span class="status-dot mt-1" :class="[a.status, a.status !== 'offline' && !a.ready ? 'not-ready' : '']" :title="a.status !== 'offline' && !a.ready ? 'Starting up…' : a.status"></span>
285
+ <span class="status-dot mt-1" :class="[a.status, a.status !== 'offline' && !a.ready ? 'not-ready' : '']" :title="agentStatusTitle(a)"></span>
286
286
  <div class="flex-grow-1 min-width-0">
287
287
  <div class="d-flex align-items-center gap-2">
288
288
  <template x-if="a.label">
@@ -946,6 +946,16 @@ function relay() {
946
946
  return agent ? this.displayName(agent) : target.slice(-8);
947
947
  },
948
948
 
949
+ agentStatusTitle(agent) {
950
+ if (!agent) return '';
951
+ if (agent.status === 'offline') return 'offline';
952
+ if (agent.ready) return agent.status;
953
+ const lastSeenMs = new Date(agent.lastSeen).getTime();
954
+ if (!Number.isFinite(lastSeenMs)) return 'Trying to reconnect…';
955
+ const ageSec = Math.max(0, (Date.now() - lastSeenMs) / 1000);
956
+ return ageSec <= 45 ? 'Starting up…' : 'Trying to reconnect…';
957
+ },
958
+
949
959
  timeAgo(iso) {
950
960
  if (!iso) return '';
951
961
  const ts = new Date(iso).getTime();