@canonmsg/agent-sdk 0.8.1 → 0.8.2
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 +5 -3
- package/dist/canon-agent.d.ts +1 -0
- package/dist/realtime.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ agent.on('message', async ({ messages, history, reply }) => {
|
|
|
17
17
|
await reply(response);
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
agent.start();
|
|
20
|
+
await agent.start();
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
@@ -159,12 +159,14 @@ console.log('Registration submitted:', requestId);
|
|
|
159
159
|
const status = await CanonAgent.checkStatus(requestId);
|
|
160
160
|
console.log('Status:', status.status); // 'pending' | 'approved' | 'rejected'
|
|
161
161
|
|
|
162
|
-
if (status.status === 'approved') {
|
|
162
|
+
if (status.status === 'approved' && status.apiKey) {
|
|
163
163
|
console.log('Agent ID:', status.agentId);
|
|
164
|
-
console.log('API Key:', status.apiKey); // Store this
|
|
164
|
+
console.log('API Key:', status.apiKey); // Store this immediately
|
|
165
165
|
}
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
The approved response only includes the API key the first time it is delivered. Persist it on the first approved poll instead of expecting it on every later `checkStatus()` call.
|
|
169
|
+
|
|
168
170
|
## Error Handling
|
|
169
171
|
|
|
170
172
|
The SDK exports `ApiError` for typed error handling:
|
package/dist/canon-agent.d.ts
CHANGED
package/dist/realtime.js
CHANGED
|
@@ -50,6 +50,7 @@ export class RealtimeManager {
|
|
|
50
50
|
status: 'sent',
|
|
51
51
|
deleted: false,
|
|
52
52
|
createdAt: m.createdAt ?? new Date().toISOString(),
|
|
53
|
+
...(m.contactCard ? { contactCard: m.contactCard } : {}),
|
|
53
54
|
...(m.metadata ? { metadata: m.metadata } : {}),
|
|
54
55
|
};
|
|
55
56
|
this.debouncer.add(payload.conversationId, message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/agent-sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Canon Agent SDK — build AI agents that participate in Canon conversations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node": ">=18.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@canonmsg/core": "^0.7.
|
|
31
|
+
"@canonmsg/core": "^0.7.3"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|