agent-relay 2.0.20 → 2.0.22
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/CHANGELOG.md +217 -24
- package/bin/relay-pty-darwin-arm64 +0 -0
- package/bin/relay-pty-darwin-x64 +0 -0
- package/bin/relay-pty-linux-x64 +0 -0
- package/dist/dashboard/out/404.html +1 -1
- package/dist/dashboard/out/app/onboarding.html +1 -1
- package/dist/dashboard/out/app/onboarding.txt +1 -1
- package/dist/dashboard/out/app.html +1 -1
- package/dist/dashboard/out/app.txt +1 -1
- package/dist/dashboard/out/cloud/link.html +1 -1
- package/dist/dashboard/out/cloud/link.txt +1 -1
- package/dist/dashboard/out/complete-profile.html +1 -1
- package/dist/dashboard/out/complete-profile.txt +1 -1
- package/dist/dashboard/out/connect-repos.html +1 -1
- package/dist/dashboard/out/connect-repos.txt +1 -1
- package/dist/dashboard/out/history.html +1 -1
- package/dist/dashboard/out/history.txt +1 -1
- package/dist/dashboard/out/index.html +1 -1
- package/dist/dashboard/out/index.txt +1 -1
- package/dist/dashboard/out/login.html +1 -1
- package/dist/dashboard/out/login.txt +1 -1
- package/dist/dashboard/out/metrics.html +1 -1
- package/dist/dashboard/out/metrics.txt +1 -1
- package/dist/dashboard/out/pricing.html +1 -1
- package/dist/dashboard/out/pricing.txt +1 -1
- package/dist/dashboard/out/providers/setup/claude.html +1 -1
- package/dist/dashboard/out/providers/setup/claude.txt +1 -1
- package/dist/dashboard/out/providers/setup/codex.html +1 -1
- package/dist/dashboard/out/providers/setup/codex.txt +1 -1
- package/dist/dashboard/out/providers/setup/cursor.html +1 -1
- package/dist/dashboard/out/providers/setup/cursor.txt +1 -1
- package/dist/dashboard/out/providers.html +1 -1
- package/dist/dashboard/out/providers.txt +1 -1
- package/dist/dashboard/out/signup.html +1 -1
- package/dist/dashboard/out/signup.txt +1 -1
- package/package.json +16 -16
- package/packages/api-types/package.json +1 -1
- package/packages/bridge/dist/spawner.js +1 -1
- package/packages/bridge/package.json +8 -8
- package/packages/cli-tester/package.json +1 -1
- package/packages/cloud/package.json +6 -6
- package/packages/config/package.json +2 -2
- package/packages/continuity/package.json +1 -1
- package/packages/daemon/dist/orchestrator.js +2 -0
- package/packages/daemon/dist/router.d.ts +5 -0
- package/packages/daemon/dist/router.js +31 -0
- package/packages/daemon/dist/server.d.ts +5 -0
- package/packages/daemon/dist/server.js +131 -1
- package/packages/daemon/package.json +12 -12
- package/packages/dashboard/package.json +13 -13
- package/packages/dashboard/ui-dist/404.html +1 -1
- package/packages/dashboard/ui-dist/app/onboarding.html +1 -1
- package/packages/dashboard/ui-dist/app/onboarding.txt +1 -1
- package/packages/dashboard/ui-dist/app.html +1 -1
- package/packages/dashboard/ui-dist/app.txt +1 -1
- package/packages/dashboard/ui-dist/cloud/link.html +1 -1
- package/packages/dashboard/ui-dist/cloud/link.txt +1 -1
- package/packages/dashboard/ui-dist/complete-profile.html +1 -1
- package/packages/dashboard/ui-dist/complete-profile.txt +1 -1
- package/packages/dashboard/ui-dist/connect-repos.html +1 -1
- package/packages/dashboard/ui-dist/connect-repos.txt +1 -1
- package/packages/dashboard/ui-dist/history.html +1 -1
- package/packages/dashboard/ui-dist/history.txt +1 -1
- package/packages/dashboard/ui-dist/index.html +1 -1
- package/packages/dashboard/ui-dist/index.txt +1 -1
- package/packages/dashboard/ui-dist/login.html +1 -1
- package/packages/dashboard/ui-dist/login.txt +1 -1
- package/packages/dashboard/ui-dist/metrics.html +1 -1
- package/packages/dashboard/ui-dist/metrics.txt +1 -1
- package/packages/dashboard/ui-dist/pricing.html +1 -1
- package/packages/dashboard/ui-dist/pricing.txt +1 -1
- package/packages/dashboard/ui-dist/providers/setup/claude.html +1 -1
- package/packages/dashboard/ui-dist/providers/setup/claude.txt +1 -1
- package/packages/dashboard/ui-dist/providers/setup/codex.html +1 -1
- package/packages/dashboard/ui-dist/providers/setup/codex.txt +1 -1
- package/packages/dashboard/ui-dist/providers/setup/cursor.html +1 -1
- package/packages/dashboard/ui-dist/providers/setup/cursor.txt +1 -1
- package/packages/dashboard/ui-dist/providers.html +1 -1
- package/packages/dashboard/ui-dist/providers.txt +1 -1
- package/packages/dashboard/ui-dist/signup.html +1 -1
- package/packages/dashboard/ui-dist/signup.txt +1 -1
- package/packages/dashboard-server/package.json +12 -12
- package/packages/hooks/package.json +4 -4
- package/packages/mcp/dist/client.d.ts +15 -0
- package/packages/mcp/dist/client.js +9 -0
- package/packages/mcp/dist/server.js +13 -1
- package/packages/mcp/dist/tools/index.d.ts +2 -0
- package/packages/mcp/dist/tools/index.js +2 -0
- package/packages/mcp/dist/tools/relay-connected.d.ts +17 -0
- package/packages/mcp/dist/tools/relay-connected.js +40 -0
- package/packages/mcp/dist/tools/relay-remove-agent.d.ts +20 -0
- package/packages/mcp/dist/tools/relay-remove-agent.js +50 -0
- package/packages/mcp/package.json +2 -2
- package/packages/memory/package.json +2 -2
- package/packages/policy/package.json +2 -2
- package/packages/protocol/dist/types.d.ts +46 -1
- package/packages/protocol/package.json +1 -1
- package/packages/resiliency/package.json +1 -1
- package/packages/sdk/dist/client.d.ts +22 -1
- package/packages/sdk/dist/client.js +31 -0
- package/packages/sdk/dist/protocol/index.d.ts +1 -1
- package/packages/sdk/dist/protocol/types.d.ts +35 -1
- package/packages/sdk/package.json +2 -2
- package/packages/spawner/package.json +1 -1
- package/packages/state/package.json +1 -1
- package/packages/storage/dist/adapter.d.ts +4 -0
- package/packages/storage/dist/sqlite-adapter.d.ts +10 -0
- package/packages/storage/dist/sqlite-adapter.js +26 -0
- package/packages/storage/package.json +2 -2
- package/packages/telemetry/package.json +1 -1
- package/packages/trajectory/package.json +2 -2
- package/packages/user-directory/package.json +2 -2
- package/packages/utils/package.json +1 -1
- package/packages/wrapper/dist/relay-pty-orchestrator.js +9 -11
- package/packages/wrapper/package.json +6 -6
- /package/dist/dashboard/out/_next/static/{PwtT8u1tFMW_S1HUv0i5S → 91mkGYq3qbG8WHE6VytQ8}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{PwtT8u1tFMW_S1HUv0i5S → 91mkGYq3qbG8WHE6VytQ8}/_ssgManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{52xh7eSCZzG97BVf5zzLY → 91mkGYq3qbG8WHE6VytQ8}/_buildManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{52xh7eSCZzG97BVf5zzLY → 91mkGYq3qbG8WHE6VytQ8}/_ssgManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{NN1eZ4W4r5XU6mkmJWV2- → T2rV14eEU5OweDeV29SvG}/_buildManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{NN1eZ4W4r5XU6mkmJWV2- → T2rV14eEU5OweDeV29SvG}/_ssgManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{PwtT8u1tFMW_S1HUv0i5S → l8L2OscDSR2vsMIlWcC48}/_buildManifest.js +0 -0
- /package/packages/dashboard/ui-dist/_next/static/{PwtT8u1tFMW_S1HUv0i5S → l8L2OscDSR2vsMIlWcC48}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const relayRemoveAgentSchema = z.object({
|
|
3
|
+
name: z.string().describe('Name of the agent to remove from the registry'),
|
|
4
|
+
remove_messages: z.boolean().optional().default(false).describe('Also remove all messages from/to this agent'),
|
|
5
|
+
});
|
|
6
|
+
export const relayRemoveAgentTool = {
|
|
7
|
+
name: 'relay_remove_agent',
|
|
8
|
+
description: `Remove a stale agent from the relay registry.
|
|
9
|
+
|
|
10
|
+
Use this to clean up agents that are no longer needed or have become stale.
|
|
11
|
+
This removes the agent from:
|
|
12
|
+
- The agent registry (agents.json)
|
|
13
|
+
- The sessions table in storage
|
|
14
|
+
- Optionally, all messages from/to this agent
|
|
15
|
+
|
|
16
|
+
WARNING: This permanently removes the agent's history. Use with caution.`,
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
name: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: 'Name of the agent to remove',
|
|
23
|
+
},
|
|
24
|
+
remove_messages: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
description: 'Also remove all messages from/to this agent',
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ['name'],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Remove an agent from the registry.
|
|
35
|
+
*/
|
|
36
|
+
export async function handleRelayRemoveAgent(client, input) {
|
|
37
|
+
const result = await client.removeAgent(input.name, {
|
|
38
|
+
removeMessages: input.remove_messages,
|
|
39
|
+
});
|
|
40
|
+
if (result.success && result.removed) {
|
|
41
|
+
return `✓ ${result.message}`;
|
|
42
|
+
}
|
|
43
|
+
else if (result.success && !result.removed) {
|
|
44
|
+
return `Agent "${input.name}" was not found in registry or storage.`;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return `✗ Failed to remove agent: ${result.message}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=relay-remove-agent.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "MCP server for Agent Relay - native messaging tools for AI agents in Claude, Cursor, and VS Code",
|
|
5
5
|
"author": "Agent Workforce Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"prepublishOnly": "npm run clean && npm run build && npm test"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@agent-relay/config": "2.0.
|
|
50
|
+
"@agent-relay/config": "2.0.22",
|
|
51
51
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
52
52
|
"smol-toml": "^1.6.0",
|
|
53
53
|
"zod": "^3.23.8"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/memory",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Semantic memory storage and retrieval system for agent-relay with multiple backend support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test:watch": "vitest"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agent-relay/hooks": "2.0.
|
|
25
|
+
"@agent-relay/hooks": "2.0.22"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.19.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/policy",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Agent policy management with multi-level fallback (repo, local PRPM, cloud workspace)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test:watch": "vitest"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agent-relay/config": "2.0.
|
|
25
|
+
"@agent-relay/config": "2.0.22"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.19.3",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* These types define the wire protocol for agent-to-agent communication.
|
|
6
6
|
*/
|
|
7
7
|
export declare const PROTOCOL_VERSION = 1;
|
|
8
|
-
export type MessageType = 'HELLO' | 'WELCOME' | 'SEND' | 'DELIVER' | 'ACK' | 'NACK' | 'PING' | 'PONG' | 'ERROR' | 'BUSY' | 'RESUME' | 'BYE' | 'STATE' | 'SYNC' | 'SYNC_SNAPSHOT' | 'SYNC_DELTA' | 'SUBSCRIBE' | 'UNSUBSCRIBE' | 'SHADOW_BIND' | 'SHADOW_UNBIND' | 'LOG' | 'CHANNEL_JOIN' | 'CHANNEL_LEAVE' | 'CHANNEL_MESSAGE' | 'CHANNEL_INFO' | 'CHANNEL_MEMBERS' | 'CHANNEL_TYPING' | 'SPAWN' | 'SPAWN_RESULT' | 'RELEASE' | 'RELEASE_RESULT' | 'STATUS' | 'STATUS_RESPONSE' | 'INBOX' | 'INBOX_RESPONSE' | 'LIST_AGENTS' | 'LIST_AGENTS_RESPONSE' | 'HEALTH' | 'HEALTH_RESPONSE' | 'METRICS' | 'METRICS_RESPONSE';
|
|
8
|
+
export type MessageType = 'HELLO' | 'WELCOME' | 'SEND' | 'DELIVER' | 'ACK' | 'NACK' | 'PING' | 'PONG' | 'ERROR' | 'BUSY' | 'RESUME' | 'BYE' | 'STATE' | 'SYNC' | 'SYNC_SNAPSHOT' | 'SYNC_DELTA' | 'SUBSCRIBE' | 'UNSUBSCRIBE' | 'SHADOW_BIND' | 'SHADOW_UNBIND' | 'LOG' | 'CHANNEL_JOIN' | 'CHANNEL_LEAVE' | 'CHANNEL_MESSAGE' | 'CHANNEL_INFO' | 'CHANNEL_MEMBERS' | 'CHANNEL_TYPING' | 'SPAWN' | 'SPAWN_RESULT' | 'RELEASE' | 'RELEASE_RESULT' | 'STATUS' | 'STATUS_RESPONSE' | 'INBOX' | 'INBOX_RESPONSE' | 'LIST_AGENTS' | 'LIST_AGENTS_RESPONSE' | 'LIST_CONNECTED_AGENTS' | 'LIST_CONNECTED_AGENTS_RESPONSE' | 'REMOVE_AGENT' | 'REMOVE_AGENT_RESPONSE' | 'HEALTH' | 'HEALTH_RESPONSE' | 'METRICS' | 'METRICS_RESPONSE';
|
|
9
9
|
export type PayloadKind = 'message' | 'action' | 'state' | 'thinking';
|
|
10
10
|
/**
|
|
11
11
|
* Base envelope structure for all protocol messages.
|
|
@@ -412,12 +412,57 @@ export interface ListAgentsResponsePayload {
|
|
|
412
412
|
parent?: string;
|
|
413
413
|
}>;
|
|
414
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Payload for LIST_CONNECTED_AGENTS request.
|
|
417
|
+
* Returns only currently connected agents (not historical/registered agents).
|
|
418
|
+
*/
|
|
419
|
+
export interface ListConnectedAgentsPayload {
|
|
420
|
+
/** Filter by project */
|
|
421
|
+
project?: string;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Payload for LIST_CONNECTED_AGENTS_RESPONSE.
|
|
425
|
+
*/
|
|
426
|
+
export interface ListConnectedAgentsResponsePayload {
|
|
427
|
+
/** List of currently connected agents */
|
|
428
|
+
agents: Array<{
|
|
429
|
+
name: string;
|
|
430
|
+
cli?: string;
|
|
431
|
+
idle?: boolean;
|
|
432
|
+
parent?: string;
|
|
433
|
+
}>;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Payload for REMOVE_AGENT request.
|
|
437
|
+
* Removes an agent from the registry (sessions, agents.json).
|
|
438
|
+
*/
|
|
439
|
+
export interface RemoveAgentPayload {
|
|
440
|
+
/** Agent name to remove */
|
|
441
|
+
name: string;
|
|
442
|
+
/** If true, also removes all messages from/to this agent */
|
|
443
|
+
removeMessages?: boolean;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Payload for REMOVE_AGENT_RESPONSE.
|
|
447
|
+
*/
|
|
448
|
+
export interface RemoveAgentResponsePayload {
|
|
449
|
+
/** Whether the operation succeeded */
|
|
450
|
+
success: boolean;
|
|
451
|
+
/** Whether an agent was actually removed */
|
|
452
|
+
removed: boolean;
|
|
453
|
+
/** Human-readable message */
|
|
454
|
+
message?: string;
|
|
455
|
+
}
|
|
415
456
|
export type StatusEnvelope = Envelope<StatusPayload>;
|
|
416
457
|
export type StatusResponseEnvelope = Envelope<StatusResponsePayload>;
|
|
417
458
|
export type InboxEnvelope = Envelope<InboxPayload>;
|
|
418
459
|
export type InboxResponseEnvelope = Envelope<InboxResponsePayload>;
|
|
419
460
|
export type ListAgentsEnvelope = Envelope<ListAgentsPayload>;
|
|
420
461
|
export type ListAgentsResponseEnvelope = Envelope<ListAgentsResponsePayload>;
|
|
462
|
+
export type ListConnectedAgentsEnvelope = Envelope<ListConnectedAgentsPayload>;
|
|
463
|
+
export type ListConnectedAgentsResponseEnvelope = Envelope<ListConnectedAgentsResponsePayload>;
|
|
464
|
+
export type RemoveAgentEnvelope = Envelope<RemoveAgentPayload>;
|
|
465
|
+
export type RemoveAgentResponseEnvelope = Envelope<RemoveAgentResponsePayload>;
|
|
421
466
|
/**
|
|
422
467
|
* Payload for HEALTH request.
|
|
423
468
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Lightweight client for agent-to-agent communication via Agent Relay daemon.
|
|
6
6
|
*/
|
|
7
|
-
import { type Envelope, type SendPayload, type SendMeta, type AckPayload, type PayloadKind, type SpeakOnTrigger, type EntityType, type ChannelMessagePayload, type MessageAttachment, type SpawnResultPayload, type ReleaseResultPayload, type StatusResponsePayload, type InboxMessage, type AgentInfo, type HealthResponsePayload, type MetricsResponsePayload, type CreateProposalOptions, type VoteOptions } from './protocol/types.js';
|
|
7
|
+
import { type Envelope, type SendPayload, type SendMeta, type AckPayload, type PayloadKind, type SpeakOnTrigger, type EntityType, type ChannelMessagePayload, type MessageAttachment, type SpawnResultPayload, type ReleaseResultPayload, type StatusResponsePayload, type InboxMessage, type AgentInfo, type RemoveAgentResponsePayload, type HealthResponsePayload, type MetricsResponsePayload, type CreateProposalOptions, type VoteOptions } from './protocol/types.js';
|
|
8
8
|
export type ClientState = 'DISCONNECTED' | 'CONNECTING' | 'HANDSHAKING' | 'READY' | 'BACKOFF';
|
|
9
9
|
export interface SyncOptions {
|
|
10
10
|
timeoutMs?: number;
|
|
@@ -289,6 +289,27 @@ export declare class RelayClient {
|
|
|
289
289
|
getMetrics(options?: {
|
|
290
290
|
agent?: string;
|
|
291
291
|
}): Promise<MetricsResponsePayload>;
|
|
292
|
+
/**
|
|
293
|
+
* List only currently connected agents (not historical/registered agents).
|
|
294
|
+
* Use this instead of listAgents() when you need accurate liveness information.
|
|
295
|
+
* @param options - Filter options
|
|
296
|
+
* @param options.project - Filter by project
|
|
297
|
+
* @returns Array of currently connected agent info
|
|
298
|
+
*/
|
|
299
|
+
listConnectedAgents(options?: {
|
|
300
|
+
project?: string;
|
|
301
|
+
}): Promise<AgentInfo[]>;
|
|
302
|
+
/**
|
|
303
|
+
* Remove an agent from the registry (sessions, agents.json).
|
|
304
|
+
* Use this to clean up stale agents that are no longer needed.
|
|
305
|
+
* @param name - Agent name to remove
|
|
306
|
+
* @param options - Removal options
|
|
307
|
+
* @param options.removeMessages - Also remove all messages from/to this agent (default: false)
|
|
308
|
+
* @returns Result indicating if the agent was removed
|
|
309
|
+
*/
|
|
310
|
+
removeAgent(name: string, options?: {
|
|
311
|
+
removeMessages?: boolean;
|
|
312
|
+
}): Promise<RemoveAgentResponsePayload>;
|
|
292
313
|
private setState;
|
|
293
314
|
private sendHello;
|
|
294
315
|
private send;
|
|
@@ -731,6 +731,35 @@ export class RelayClient {
|
|
|
731
731
|
};
|
|
732
732
|
return this.query('METRICS', payload);
|
|
733
733
|
}
|
|
734
|
+
/**
|
|
735
|
+
* List only currently connected agents (not historical/registered agents).
|
|
736
|
+
* Use this instead of listAgents() when you need accurate liveness information.
|
|
737
|
+
* @param options - Filter options
|
|
738
|
+
* @param options.project - Filter by project
|
|
739
|
+
* @returns Array of currently connected agent info
|
|
740
|
+
*/
|
|
741
|
+
async listConnectedAgents(options = {}) {
|
|
742
|
+
const payload = {
|
|
743
|
+
project: options.project,
|
|
744
|
+
};
|
|
745
|
+
const response = await this.query('LIST_CONNECTED_AGENTS', payload);
|
|
746
|
+
return response.agents || [];
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Remove an agent from the registry (sessions, agents.json).
|
|
750
|
+
* Use this to clean up stale agents that are no longer needed.
|
|
751
|
+
* @param name - Agent name to remove
|
|
752
|
+
* @param options - Removal options
|
|
753
|
+
* @param options.removeMessages - Also remove all messages from/to this agent (default: false)
|
|
754
|
+
* @returns Result indicating if the agent was removed
|
|
755
|
+
*/
|
|
756
|
+
async removeAgent(name, options = {}) {
|
|
757
|
+
const payload = {
|
|
758
|
+
name,
|
|
759
|
+
removeMessages: options.removeMessages,
|
|
760
|
+
};
|
|
761
|
+
return this.query('REMOVE_AGENT', payload);
|
|
762
|
+
}
|
|
734
763
|
// Private methods
|
|
735
764
|
setState(state) {
|
|
736
765
|
this._state = state;
|
|
@@ -839,6 +868,8 @@ export class RelayClient {
|
|
|
839
868
|
case 'STATUS_RESPONSE':
|
|
840
869
|
case 'INBOX_RESPONSE':
|
|
841
870
|
case 'LIST_AGENTS_RESPONSE':
|
|
871
|
+
case 'LIST_CONNECTED_AGENTS_RESPONSE':
|
|
872
|
+
case 'REMOVE_AGENT_RESPONSE':
|
|
842
873
|
case 'HEALTH_RESPONSE':
|
|
843
874
|
case 'METRICS_RESPONSE':
|
|
844
875
|
this.handleQueryResponse(envelope);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Protocol exports for @agent-relay/sdk
|
|
3
3
|
*/
|
|
4
|
-
export { PROTOCOL_VERSION, type MessageType, type PayloadKind, type Envelope, type EntityType, type HelloPayload, type WelcomePayload, type SendPayload, type SendMeta, type SyncMeta, type DeliveryInfo, type AckPayload, type NackPayload, type BusyPayload, type PingPayload, type PongPayload, type ErrorCode, type ErrorPayload, type LogPayload, type SyncStream, type SyncPayload, type SpeakOnTrigger, type ShadowConfig, type ShadowBindPayload, type ShadowUnbindPayload, type SpawnPayload, type SpawnPolicyDecision, type SpawnResultPayload, type ReleasePayload, type ReleaseResultPayload, type ConsensusType, type VoteValue, type ProposalStatus, type CreateProposalOptions, type VoteOptions, type MessageAttachment, type ChannelJoinPayload, type ChannelLeavePayload, type ChannelMessagePayload, type StatusPayload, type StatusResponsePayload, type InboxPayload, type InboxMessage, type InboxResponsePayload, type ListAgentsPayload, type AgentInfo, type ListAgentsResponsePayload, type HealthPayload, type CrashRecord, type AlertRecord, type HealthResponsePayload, type MetricsPayload, type AgentMetrics, type MetricsResponsePayload, type HelloEnvelope, type WelcomeEnvelope, type SendEnvelope, type DeliverEnvelope, type AckEnvelope, type NackEnvelope, type PingEnvelope, type PongEnvelope, type ErrorEnvelope, type BusyEnvelope, type LogEnvelope, type SyncEnvelope, type ShadowBindEnvelope, type ShadowUnbindEnvelope, type SpawnEnvelope, type SpawnResultEnvelope, type ReleaseEnvelope, type ReleaseResultEnvelope, type ChannelJoinEnvelope, type ChannelLeaveEnvelope, type ChannelMessageEnvelope, type StatusEnvelope, type StatusResponseEnvelope, type InboxEnvelope, type InboxResponseEnvelope, type ListAgentsEnvelope, type ListAgentsResponseEnvelope, type HealthEnvelope, type HealthResponseEnvelope, type MetricsEnvelope, type MetricsResponseEnvelope, } from './types.js';
|
|
4
|
+
export { PROTOCOL_VERSION, type MessageType, type PayloadKind, type Envelope, type EntityType, type HelloPayload, type WelcomePayload, type SendPayload, type SendMeta, type SyncMeta, type DeliveryInfo, type AckPayload, type NackPayload, type BusyPayload, type PingPayload, type PongPayload, type ErrorCode, type ErrorPayload, type LogPayload, type SyncStream, type SyncPayload, type SpeakOnTrigger, type ShadowConfig, type ShadowBindPayload, type ShadowUnbindPayload, type SpawnPayload, type SpawnPolicyDecision, type SpawnResultPayload, type ReleasePayload, type ReleaseResultPayload, type ConsensusType, type VoteValue, type ProposalStatus, type CreateProposalOptions, type VoteOptions, type MessageAttachment, type ChannelJoinPayload, type ChannelLeavePayload, type ChannelMessagePayload, type StatusPayload, type StatusResponsePayload, type InboxPayload, type InboxMessage, type InboxResponsePayload, type ListAgentsPayload, type AgentInfo, type ListAgentsResponsePayload, type ListConnectedAgentsPayload, type ListConnectedAgentsResponsePayload, type RemoveAgentPayload, type RemoveAgentResponsePayload, type HealthPayload, type CrashRecord, type AlertRecord, type HealthResponsePayload, type MetricsPayload, type AgentMetrics, type MetricsResponsePayload, type HelloEnvelope, type WelcomeEnvelope, type SendEnvelope, type DeliverEnvelope, type AckEnvelope, type NackEnvelope, type PingEnvelope, type PongEnvelope, type ErrorEnvelope, type BusyEnvelope, type LogEnvelope, type SyncEnvelope, type ShadowBindEnvelope, type ShadowUnbindEnvelope, type SpawnEnvelope, type SpawnResultEnvelope, type ReleaseEnvelope, type ReleaseResultEnvelope, type ChannelJoinEnvelope, type ChannelLeaveEnvelope, type ChannelMessageEnvelope, type StatusEnvelope, type StatusResponseEnvelope, type InboxEnvelope, type InboxResponseEnvelope, type ListAgentsEnvelope, type ListAgentsResponseEnvelope, type ListConnectedAgentsEnvelope, type ListConnectedAgentsResponseEnvelope, type RemoveAgentEnvelope, type RemoveAgentResponseEnvelope, type HealthEnvelope, type HealthResponseEnvelope, type MetricsEnvelope, type MetricsResponseEnvelope, } from './types.js';
|
|
5
5
|
export { MAX_FRAME_BYTES, HEADER_SIZE, LEGACY_HEADER_SIZE, type WireFormat, initMessagePack, hasMessagePack, encodeFrame, encodeFrameLegacy, FrameParser, } from './framing.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* These types define the wire protocol for agent-to-agent communication.
|
|
6
6
|
*/
|
|
7
7
|
export declare const PROTOCOL_VERSION = 1;
|
|
8
|
-
export type MessageType = 'HELLO' | 'WELCOME' | 'SEND' | 'DELIVER' | 'ACK' | 'NACK' | 'PING' | 'PONG' | 'ERROR' | 'BUSY' | 'RESUME' | 'BYE' | 'STATE' | 'SYNC' | 'SYNC_SNAPSHOT' | 'SYNC_DELTA' | 'SUBSCRIBE' | 'UNSUBSCRIBE' | 'SHADOW_BIND' | 'SHADOW_UNBIND' | 'LOG' | 'CHANNEL_JOIN' | 'CHANNEL_LEAVE' | 'CHANNEL_MESSAGE' | 'CHANNEL_INFO' | 'CHANNEL_MEMBERS' | 'CHANNEL_TYPING' | 'SPAWN' | 'SPAWN_RESULT' | 'RELEASE' | 'RELEASE_RESULT' | 'STATUS' | 'STATUS_RESPONSE' | 'INBOX' | 'INBOX_RESPONSE' | 'LIST_AGENTS' | 'LIST_AGENTS_RESPONSE' | 'HEALTH' | 'HEALTH_RESPONSE' | 'METRICS' | 'METRICS_RESPONSE';
|
|
8
|
+
export type MessageType = 'HELLO' | 'WELCOME' | 'SEND' | 'DELIVER' | 'ACK' | 'NACK' | 'PING' | 'PONG' | 'ERROR' | 'BUSY' | 'RESUME' | 'BYE' | 'STATE' | 'SYNC' | 'SYNC_SNAPSHOT' | 'SYNC_DELTA' | 'SUBSCRIBE' | 'UNSUBSCRIBE' | 'SHADOW_BIND' | 'SHADOW_UNBIND' | 'LOG' | 'CHANNEL_JOIN' | 'CHANNEL_LEAVE' | 'CHANNEL_MESSAGE' | 'CHANNEL_INFO' | 'CHANNEL_MEMBERS' | 'CHANNEL_TYPING' | 'SPAWN' | 'SPAWN_RESULT' | 'RELEASE' | 'RELEASE_RESULT' | 'STATUS' | 'STATUS_RESPONSE' | 'INBOX' | 'INBOX_RESPONSE' | 'LIST_AGENTS' | 'LIST_AGENTS_RESPONSE' | 'LIST_CONNECTED_AGENTS' | 'LIST_CONNECTED_AGENTS_RESPONSE' | 'REMOVE_AGENT' | 'REMOVE_AGENT_RESPONSE' | 'HEALTH' | 'HEALTH_RESPONSE' | 'METRICS' | 'METRICS_RESPONSE';
|
|
9
9
|
export type PayloadKind = 'message' | 'action' | 'state' | 'thinking';
|
|
10
10
|
/**
|
|
11
11
|
* Base envelope structure for all protocol messages.
|
|
@@ -410,6 +410,36 @@ export interface AgentInfo {
|
|
|
410
410
|
export interface ListAgentsResponsePayload {
|
|
411
411
|
agents: AgentInfo[];
|
|
412
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* Payload for LIST_CONNECTED_AGENTS request.
|
|
415
|
+
* Returns only currently connected agents (not historical/registered agents).
|
|
416
|
+
*/
|
|
417
|
+
export interface ListConnectedAgentsPayload {
|
|
418
|
+
project?: string;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Response payload for LIST_CONNECTED_AGENTS request.
|
|
422
|
+
*/
|
|
423
|
+
export interface ListConnectedAgentsResponsePayload {
|
|
424
|
+
agents: AgentInfo[];
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Payload for REMOVE_AGENT request.
|
|
428
|
+
* Removes an agent from the registry (sessions, agents.json).
|
|
429
|
+
*/
|
|
430
|
+
export interface RemoveAgentPayload {
|
|
431
|
+
name: string;
|
|
432
|
+
/** If true, also removes all messages from/to this agent */
|
|
433
|
+
removeMessages?: boolean;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Response payload for REMOVE_AGENT request.
|
|
437
|
+
*/
|
|
438
|
+
export interface RemoveAgentResponsePayload {
|
|
439
|
+
success: boolean;
|
|
440
|
+
removed: boolean;
|
|
441
|
+
message?: string;
|
|
442
|
+
}
|
|
413
443
|
/**
|
|
414
444
|
* Payload for HEALTH request.
|
|
415
445
|
*/
|
|
@@ -519,6 +549,10 @@ export type InboxEnvelope = Envelope<InboxPayload>;
|
|
|
519
549
|
export type InboxResponseEnvelope = Envelope<InboxResponsePayload>;
|
|
520
550
|
export type ListAgentsEnvelope = Envelope<ListAgentsPayload>;
|
|
521
551
|
export type ListAgentsResponseEnvelope = Envelope<ListAgentsResponsePayload>;
|
|
552
|
+
export type ListConnectedAgentsEnvelope = Envelope<ListConnectedAgentsPayload>;
|
|
553
|
+
export type ListConnectedAgentsResponseEnvelope = Envelope<ListConnectedAgentsResponsePayload>;
|
|
554
|
+
export type RemoveAgentEnvelope = Envelope<RemoveAgentPayload>;
|
|
555
|
+
export type RemoveAgentResponseEnvelope = Envelope<RemoveAgentResponsePayload>;
|
|
522
556
|
export type HealthEnvelope = Envelope<HealthPayload>;
|
|
523
557
|
export type HealthResponseEnvelope = Envelope<HealthResponsePayload>;
|
|
524
558
|
export type MetricsEnvelope = Envelope<MetricsPayload>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Lightweight SDK for agent-to-agent communication via Agent Relay",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@agent-relay/protocol": "2.0.
|
|
58
|
+
"@agent-relay/protocol": "2.0.22"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=18.0.0"
|
|
@@ -96,6 +96,10 @@ export interface StorageAdapter {
|
|
|
96
96
|
}>>;
|
|
97
97
|
/** Get channels that an agent is a member of (based on stored membership events) */
|
|
98
98
|
getChannelMembershipsForAgent?(memberName: string): Promise<string[]>;
|
|
99
|
+
/** Remove an agent from sessions table */
|
|
100
|
+
removeAgent?(agentName: string): Promise<void>;
|
|
101
|
+
/** Remove all messages from/to an agent */
|
|
102
|
+
removeMessagesForAgent?(agentName: string): Promise<void>;
|
|
99
103
|
}
|
|
100
104
|
/**
|
|
101
105
|
* Storage configuration options.
|
|
@@ -109,5 +109,15 @@ export declare class SqliteStorageAdapter implements StorageAdapter {
|
|
|
109
109
|
* @returns List of channel names where the agent's latest action is not "leave"
|
|
110
110
|
*/
|
|
111
111
|
getChannelMembershipsForAgent(memberName: string): Promise<string[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Remove an agent from the sessions table.
|
|
114
|
+
* This is used to clean up stale agents from the registry.
|
|
115
|
+
*/
|
|
116
|
+
removeAgent(agentName: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Remove all messages from/to an agent.
|
|
119
|
+
* Use with caution - this permanently deletes message history.
|
|
120
|
+
*/
|
|
121
|
+
removeMessagesForAgent(agentName: string): Promise<void>;
|
|
112
122
|
}
|
|
113
123
|
//# sourceMappingURL=sqlite-adapter.d.ts.map
|
|
@@ -750,5 +750,31 @@ export class SqliteStorageAdapter {
|
|
|
750
750
|
const rows = stmt.all(memberName);
|
|
751
751
|
return rows.map(row => row.channel);
|
|
752
752
|
}
|
|
753
|
+
/**
|
|
754
|
+
* Remove an agent from the sessions table.
|
|
755
|
+
* This is used to clean up stale agents from the registry.
|
|
756
|
+
*/
|
|
757
|
+
async removeAgent(agentName) {
|
|
758
|
+
if (!this.db) {
|
|
759
|
+
await this.init();
|
|
760
|
+
}
|
|
761
|
+
const stmt = this.db.prepare(`
|
|
762
|
+
DELETE FROM sessions WHERE agent_name = ?
|
|
763
|
+
`);
|
|
764
|
+
stmt.run(agentName);
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Remove all messages from/to an agent.
|
|
768
|
+
* Use with caution - this permanently deletes message history.
|
|
769
|
+
*/
|
|
770
|
+
async removeMessagesForAgent(agentName) {
|
|
771
|
+
if (!this.db) {
|
|
772
|
+
await this.init();
|
|
773
|
+
}
|
|
774
|
+
const stmt = this.db.prepare(`
|
|
775
|
+
DELETE FROM messages WHERE sender = ? OR recipient = ?
|
|
776
|
+
`);
|
|
777
|
+
stmt.run(agentName, agentName);
|
|
778
|
+
}
|
|
753
779
|
}
|
|
754
780
|
//# sourceMappingURL=sqlite-adapter.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/storage",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Storage adapters and interfaces for Relay message/session persistence",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@agent-relay/protocol": "2.0.
|
|
59
|
+
"@agent-relay/protocol": "2.0.22"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/node": "^22.19.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/trajectory",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Trajectory integration utilities (trail/PDERO) for Relay",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test:watch": "vitest"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agent-relay/config": "2.0.
|
|
25
|
+
"@agent-relay/config": "2.0.22"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.19.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/user-directory",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "User directory service for agent-relay (per-user credential storage)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test:watch": "vitest"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agent-relay/resiliency": "2.0.
|
|
25
|
+
"@agent-relay/resiliency": "2.0.22"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.19.3",
|
|
@@ -19,6 +19,7 @@ import { spawn } from 'node:child_process';
|
|
|
19
19
|
import { createConnection } from 'node:net';
|
|
20
20
|
import { createHash } from 'node:crypto';
|
|
21
21
|
import { join, dirname } from 'node:path';
|
|
22
|
+
import { homedir } from 'node:os';
|
|
22
23
|
import { existsSync, unlinkSync, mkdirSync, symlinkSync, lstatSync, rmSync, watch, readdirSync, readlinkSync, writeFileSync, appendFileSync } from 'node:fs';
|
|
23
24
|
import { getProjectPaths } from '@agent-relay/config/project-namespace';
|
|
24
25
|
import { fileURLToPath } from 'node:url';
|
|
@@ -140,17 +141,12 @@ export class RelayPtyOrchestrator extends BaseWrapper {
|
|
|
140
141
|
this._legacyOutboxPath = `/tmp/relay-outbox/${config.name}`;
|
|
141
142
|
}
|
|
142
143
|
else {
|
|
143
|
-
// Local mode: use
|
|
144
|
+
// Local mode: use project paths directly (no symlinks needed)
|
|
144
145
|
this._outboxPath = this._canonicalOutboxPath;
|
|
145
|
-
// Socket
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
const tmpSocketPath = `/tmp/relay-local/${projectPaths.projectId}/sockets/${config.name}.sock`;
|
|
150
|
-
console.warn(`[relay-pty-orchestrator:${config.name}] Socket path too long (${localSocketPath.length} chars); using /tmp fallback`);
|
|
151
|
-
localSocketPath = tmpSocketPath;
|
|
152
|
-
}
|
|
153
|
-
this.socketPath = localSocketPath;
|
|
146
|
+
// Socket path: use ~/.agent-relay/sockets/{projectId}/{agentName}.sock
|
|
147
|
+
// This keeps paths short (uses 12-char hashed projectId) while staying organized
|
|
148
|
+
// Example: /Users/foo/.agent-relay/sockets/abc123def456/MyAgent.sock (~65 chars)
|
|
149
|
+
this.socketPath = join(homedir(), '.agent-relay', 'sockets', projectPaths.projectId, `${config.name}.sock`);
|
|
154
150
|
// Legacy path for backwards compat (older agents might still use /tmp/relay-outbox)
|
|
155
151
|
// Even in local mode, we need this symlink for agents with stale instructions
|
|
156
152
|
this._legacyOutboxPath = `/tmp/relay-outbox/${config.name}`;
|
|
@@ -651,7 +647,9 @@ export class RelayPtyOrchestrator extends BaseWrapper {
|
|
|
651
647
|
// Wait for process to start
|
|
652
648
|
await sleep(500);
|
|
653
649
|
if (proc.exitCode !== null) {
|
|
654
|
-
|
|
650
|
+
// Include any captured stderr in the error for debugging
|
|
651
|
+
const stderrInfo = stderrBuffer ? `\nStderr: ${stderrBuffer.slice(0, 500)}` : '';
|
|
652
|
+
throw new Error(`relay-pty exited immediately with code ${proc.exitCode}${stderrInfo}`);
|
|
655
653
|
}
|
|
656
654
|
// Register for memory/CPU monitoring
|
|
657
655
|
if (proc.pid) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-relay/wrapper",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "CLI agent wrappers for Agent Relay - tmux, pty integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"clean": "rm -rf dist"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@agent-relay/api-types": "2.0.
|
|
34
|
-
"@agent-relay/protocol": "2.0.
|
|
35
|
-
"@agent-relay/config": "2.0.
|
|
36
|
-
"@agent-relay/continuity": "2.0.
|
|
37
|
-
"@agent-relay/resiliency": "2.0.
|
|
33
|
+
"@agent-relay/api-types": "2.0.22",
|
|
34
|
+
"@agent-relay/protocol": "2.0.22",
|
|
35
|
+
"@agent-relay/config": "2.0.22",
|
|
36
|
+
"@agent-relay/continuity": "2.0.22",
|
|
37
|
+
"@agent-relay/resiliency": "2.0.22"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"typescript": "^5.9.3",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|