acp-chat 0.2.3 → 0.2.5
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 +20 -4
- package/dist/cli.js +0 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -13,11 +13,21 @@ npm install acp-chat
|
|
|
13
13
|
```bash
|
|
14
14
|
# Create new session and send message
|
|
15
15
|
npx acp-chat new "Hello"
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
|
|
16
|
+
# Output:
|
|
17
|
+
# CLIENT_SESSION_ID=client-1234567890-abc123
|
|
18
|
+
# SESSION_ID=019d0a91-deb3-72c1-857a-80cfeea503cc
|
|
19
|
+
# <agent response>
|
|
20
|
+
|
|
21
|
+
# Continue existing session (requires both IDs)
|
|
22
|
+
npx acp-chat <clientSessionId> <sessionId> "Follow-up message"
|
|
23
|
+
# Example:
|
|
24
|
+
npx acp-chat client-1234567890-abc123 019d0a91-deb3-72c1-857a-80cfeea503cc "What about X?"
|
|
19
25
|
```
|
|
20
26
|
|
|
27
|
+
Environment variables:
|
|
28
|
+
- `ACP_BUS_ADDRESS` — bus address (default: `127.0.0.1:9800`)
|
|
29
|
+
- `ACP_AGENT_ID` — target agent ID (default: `codex-acp`)
|
|
30
|
+
|
|
21
31
|
## Programmatic Usage
|
|
22
32
|
|
|
23
33
|
```typescript
|
|
@@ -37,6 +47,8 @@ const client = createACPClient(ndjsonClient, {
|
|
|
37
47
|
agentId: 'codex-acp',
|
|
38
48
|
requestTimeoutMs: 5 * 60 * 1000,
|
|
39
49
|
clientInfo: { name: 'my-app', version: '1.0.0' },
|
|
50
|
+
// For continuing a session, pass the clientSessionId:
|
|
51
|
+
// clientSessionId: 'client-1234567890-abc123',
|
|
40
52
|
});
|
|
41
53
|
|
|
42
54
|
// Stream responses in real-time
|
|
@@ -49,6 +61,9 @@ client.on('update', (sessionId, update) => {
|
|
|
49
61
|
await client.initialize();
|
|
50
62
|
|
|
51
63
|
const session = await client.sessionNew();
|
|
64
|
+
// Save both IDs for continuing the session later:
|
|
65
|
+
// - session.clientSessionId — needed to restore client connection
|
|
66
|
+
// - session.sessionId — needed to identify the dialogue
|
|
52
67
|
const result = await client.sessionPrompt(session.sessionId, 'Hello!');
|
|
53
68
|
|
|
54
69
|
console.log(result.text);
|
|
@@ -70,11 +85,12 @@ Options:
|
|
|
70
85
|
- `agentId`: Target agent identifier
|
|
71
86
|
- `requestTimeoutMs`: Request timeout (default: 120000)
|
|
72
87
|
- `clientInfo`: Client identification info
|
|
88
|
+
- `clientSessionId`: Existing client session ID (for continuing sessions)
|
|
73
89
|
|
|
74
90
|
### Client Methods
|
|
75
91
|
|
|
76
92
|
- `initialize()`: Initialize the ACP connection
|
|
77
|
-
- `sessionNew(configOptions?)`: Create a new session
|
|
93
|
+
- `sessionNew(configOptions?)`: Create a new session (returns `sessionId` and `clientSessionId`)
|
|
78
94
|
- `sessionPrompt(sessionId, text, role?)`: Send a prompt
|
|
79
95
|
- `sessionConfigure(sessionId, options)`: Configure session
|
|
80
96
|
- `sessionCancel(sessionId)`: Cancel ongoing operation
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acp-chat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "ACP Chat — agent-to-agent dialogue over TCP/Unix socket using the ACP protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/morozow/acp-chat",
|
|
10
|
+
"type": "git"
|
|
11
|
+
},
|
|
8
12
|
"bin": {
|
|
9
13
|
"acp-chat": "dist/cli.js"
|
|
10
14
|
},
|