@easbot/agent 0.2.15 → 0.2.18

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.
@@ -1,52 +1,72 @@
1
1
  Manage a full-duplex conversation channel with another easbot agent endpoint.
2
- Use this as the single tool for connect, list, capabilities, send, status, config, interrupt, and close.
2
+ Use this as the single tool for connect, list, discover, capabilities, send, status, config, interrupt, and close.
3
3
 
4
4
  Inputs (kept minimal):
5
- - operation: connect | list | capabilities | send | status | config | interrupt | close
6
- - baseUrl: target easbot service base URL (required by connect)
7
- - connectionId: local managed connection id (required after connect)
8
- - prompt: message to send (required by send)
5
+ - operation: connect | list | discover | capabilities | send | status | config | interrupt | close
6
+ - baseUrl: target easbot service base URL (required for connect, e.g. http://localhost:3000)
7
+ - connectionId: local connection id (required for remote ops: capabilities/send/interrupt/close/status; auto-resolved from baseUrl if not provided)
8
+ - prompt: message to send (required for send)
9
9
 
10
- Behavior:
11
- - Local operations (no remote RPC):
12
- - config: inspect local agent config and managed connections
13
- - list: list local managed connections
14
- - status: inspect local managed connection state
15
- - close: release local connection state and cleanup interaction resources
16
- - Remote operations (requires target agent service):
17
- - connect: create/reuse remote session and bind to local connectionId
18
- - capabilities: query remote agent capabilities (ACP initialize)
19
- - send: push one message to remote session (async; no waiting)
20
- - before sending, you must have an active connectionId (connect first). The tool will automatically ensure an event subscription and stream remote responses back into the local SessionPrompt (no extra action from the LLM is required).
21
- - interrupt: cancel the remote session and cleanup local interaction state
22
- - use this when you need to abort an ongoing interaction
23
- - sends an interrupt signal to the remote server which will cancel the session
24
- - Local mapping persists in .easbot/client-connections.json
25
- - All message receiving is done via event streaming (WebSocket/SSE/STDIO)
10
+ Operations:
11
+ 1. connect: Create or reuse a remote session, bind to local connectionId
12
+ - Required: baseUrl (connectionId not needed)
13
+ - Returns: connectionId, sessionId, remoteAgentId, channel
14
+ - No service registration required; pure URL connection is supported
15
+ 2. list: List all locally managed connections (active sessions)
16
+ - Returns: array of connection info with connectionId, baseUrl, sessionId, remoteAgentId
17
+ 3. discover: Discover available agent services from registry
18
+ - Data sources: local config file (.easbot/agent-services.json), Config.Info.acp.clients, Gateway
19
+ - Returns: array of AgentServiceInfo { id, name, baseUrl, agentId, capabilities, status, metadata }
20
+ 4. capabilities: Query remote agent capabilities (ACP initialize)
21
+ - Required: connectionId (auto-resolved from baseUrl)
22
+ - Returns: protocolVersion, agentCapabilities, authMethods
23
+ 5. send: Push one message to remote session
24
+ - Required: connectionId, prompt
25
+ - Automatically establishes event subscription on first send
26
+ - Remote responses are injected into local SessionPrompt asynchronously
27
+ - Returns: pending round info (waiting for remote response)
28
+ 6. status: Inspect local managed connection state
29
+ - Required: connectionId (auto-resolved from baseUrl)
30
+ - Returns: connection state including sessionId, baseUrl, remoteAgentId, channel
31
+ 7. config: Inspect local agent client config and managed connections count
32
+ - Returns: acp config object and managedConnections count
33
+ 8. interrupt: Cancel remote session and cleanup local interaction state
34
+ - Required: connectionId (auto-resolved from baseUrl)
35
+ - Sends interrupt signal to remote server, cancels subscription
36
+ - Use when you need to abort an ongoing interaction
37
+ 9. close: Release local connection state and cleanup all interaction resources
38
+ - Required: connectionId (auto-resolved from baseUrl)
39
+ - Always call close when done to prevent resource leaks
40
+
41
+ Connection Flow:
42
+ 1. connect + baseUrl → creates connection, returns connectionId
43
+ 2. Other operations use connectionId → auto-resolved from baseUrl if not provided
44
+ 3. If baseUrl provided but no connectionId, searches existing connections by baseUrl
45
+ 4. If no matching connection found, connect operation is required first
46
+ 5. Use discover to find available services before connecting
47
+
48
+ Local vs Remote Operations:
49
+ - Local (no remote RPC): config, list, discover
50
+ - Remote (requires connectionId after connect): capabilities, send, status, interrupt, close
26
51
 
27
52
  Round Control:
28
53
  - Each connection has a maximum of 10 interaction rounds by default
29
54
  - One round = one question (send) + one answer (received response)
30
- - When round limit is reached, the subscription is automatically cancelled
31
- - Use `close` operation to manually cleanup when interaction is complete
32
-
33
- Interrupt Signal:
34
- - The tool automatically listens for abort signals from the local agent
35
- - When the local agent is interrupted (e.g., user cancels), the tool will:
36
- 1. Send an interrupt signal to the remote server
37
- 2. Cancel the local subscription
38
- 3. Cleanup the interaction state
39
- - You can also manually trigger interrupt using the `interrupt` operation
55
+ - When round limit is reached, subscription is automatically cancelled
56
+ - Use `close` to manually cleanup when interaction is complete
40
57
 
41
58
  Returns:
42
- - connectionId and remote sessionId
43
- - capabilities: protocolVersion, agentCapabilities, authMethods
44
- - subscription readiness for event-based message receiving
45
- - the tool does not expose a subscribe operation; it establishes subscription automatically on first send to forward remote responses into the local conversation
59
+ - Standard tool result: { title, metadata: { count, ... }, output: JSON }
60
+ - connectionId: local connection identifier
61
+ - remote sessionId: remote session identifier
62
+ - subscription: automatically established on first send
46
63
  - round info: completedRounds, pendingRound, maxRounds, remaining rounds
47
64
 
48
65
  Notes:
49
- - Sending without a prior connect (no usable connectionId) will fail with an explicit error instructing the agent to connect first.
50
- - The tool appends a minimal async hint to the prompt to clarify non-blocking behavior.
51
- - IMPORTANT: Always call `close` when you are done with the interaction to cleanup resources (subscription, connection state). This prevents resource leaks.
52
- - Use `interrupt` if you need to abort an ongoing interaction before completion.
66
+ - Send without prior connect will fail with explicit error
67
+ - The tool automatically establishes subscription on first send
68
+ - Remote responses flow back via subscription into local conversation
69
+ - IMPORTANT: Always call `close` when interaction is complete to cleanup resources
70
+ - Use `interrupt` to abort an ongoing interaction before completion
71
+ - Pure URL connection: no service registration needed, just provide baseUrl
72
+ - Use discover to find available agent services before connecting