@multi-agent-protocol/sdk 0.0.2 → 0.0.3
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 +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @multi-agent-protocol/sdk
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for the Multi-Agent Protocol (MAP) - a JSON-RPC based protocol for observing, coordinating, and routing messages within multi-agent AI systems.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @multi-agent-protocol/sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Features
|
|
@@ -19,7 +19,7 @@ The SDK provides specialized connection classes for different participant types:
|
|
|
19
19
|
- **`GatewayConnection`** - For federation between MAP systems
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
|
-
import { ClientConnection, AgentConnection, GatewayConnection } from '@
|
|
22
|
+
import { ClientConnection, AgentConnection, GatewayConnection } from '@multi-agent-protocol/sdk';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### Streaming & Subscriptions
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
canMessageAgent,
|
|
98
98
|
filterVisibleAgents,
|
|
99
99
|
resolveAgentPermissions
|
|
100
|
-
} from '@
|
|
100
|
+
} from '@multi-agent-protocol/sdk';
|
|
101
101
|
|
|
102
102
|
// Check if a participant can see an agent
|
|
103
103
|
const canSee = canSeeAgent(systemConfig, callerAgent, targetAgent);
|
|
@@ -114,7 +114,7 @@ const permissions = resolveAgentPermissions(agent, permissionConfig);
|
|
|
114
114
|
Connect multiple MAP systems with envelope-based routing:
|
|
115
115
|
|
|
116
116
|
```typescript
|
|
117
|
-
import { GatewayConnection, createFederationEnvelope } from '@
|
|
117
|
+
import { GatewayConnection, createFederationEnvelope } from '@multi-agent-protocol/sdk';
|
|
118
118
|
|
|
119
119
|
const gateway = new GatewayConnection(stream, {
|
|
120
120
|
name: 'Federation Gateway',
|
|
@@ -141,7 +141,7 @@ await gateway.routeToSystem('system-b', message);
|
|
|
141
141
|
Buffer and release events in causal order:
|
|
142
142
|
|
|
143
143
|
```typescript
|
|
144
|
-
import { CausalEventBuffer } from '@
|
|
144
|
+
import { CausalEventBuffer } from '@multi-agent-protocol/sdk';
|
|
145
145
|
|
|
146
146
|
const buffer = new CausalEventBuffer({
|
|
147
147
|
maxSize: 1000,
|
|
@@ -161,9 +161,9 @@ buffer.add(event); // Buffered until causedBy dependencies are released
|
|
|
161
161
|
The SDK includes a `TestServer` for integration testing:
|
|
162
162
|
|
|
163
163
|
```typescript
|
|
164
|
-
import { TestServer } from '@
|
|
165
|
-
import { ClientConnection } from '@
|
|
166
|
-
import { createStreamPair } from '@
|
|
164
|
+
import { TestServer } from '@multi-agent-protocol/sdk/testing';
|
|
165
|
+
import { ClientConnection } from '@multi-agent-protocol/sdk';
|
|
166
|
+
import { createStreamPair } from '@multi-agent-protocol/sdk';
|
|
167
167
|
|
|
168
168
|
const server = new TestServer({ name: 'Test Server' });
|
|
169
169
|
const [clientStream, serverStream] = createStreamPair();
|