@canonmsg/agent-sdk 1.5.4 → 1.5.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/dist/canon-agent.d.ts +1 -0
- package/dist/canon-agent.js +10 -0
- package/package.json +2 -2
package/dist/canon-agent.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export declare class CanonAgent {
|
|
|
140
140
|
private publishAcceptedRuntimeSignal;
|
|
141
141
|
private abortActiveTurns;
|
|
142
142
|
private resolveBatchDeliveryIntent;
|
|
143
|
+
private markQueuedMessagesAccepted;
|
|
143
144
|
private notifyMessageInterrupt;
|
|
144
145
|
private createRuntimeStatePublisher;
|
|
145
146
|
private requireRuntimeStatePublisher;
|
package/dist/canon-agent.js
CHANGED
|
@@ -1005,6 +1005,14 @@ export class CanonAgent {
|
|
|
1005
1005
|
? 'interrupt'
|
|
1006
1006
|
: 'queue';
|
|
1007
1007
|
}
|
|
1008
|
+
async markQueuedMessagesAccepted(conversationId, messages) {
|
|
1009
|
+
await Promise.all(messages.map((message) => {
|
|
1010
|
+
if (!message.id || normalizeTurnMetadata(message.metadata)?.inboundDisposition !== 'queued') {
|
|
1011
|
+
return Promise.resolve();
|
|
1012
|
+
}
|
|
1013
|
+
return this.apiClient.updateMessageDisposition(conversationId, message.id, 'accepted_now').catch(() => { });
|
|
1014
|
+
}));
|
|
1015
|
+
}
|
|
1008
1016
|
async notifyMessageInterrupt(conversationId, abortSignal) {
|
|
1009
1017
|
if (!abortSignal || !this.interruptHandler)
|
|
1010
1018
|
return;
|
|
@@ -1059,6 +1067,7 @@ export class CanonAgent {
|
|
|
1059
1067
|
async executeHandler(conversationId, messages, session, provenanceByMessageId) {
|
|
1060
1068
|
if (!this.handler)
|
|
1061
1069
|
return;
|
|
1070
|
+
await this.markQueuedMessagesAccepted(conversationId, messages);
|
|
1062
1071
|
const turnId = randomUUID();
|
|
1063
1072
|
const turnOpenedAt = Date.now();
|
|
1064
1073
|
let turnState = 'thinking';
|
|
@@ -1401,6 +1410,7 @@ export class CanonAgent {
|
|
|
1401
1410
|
catch { }
|
|
1402
1411
|
const card = buildRuntimeInputRequest(inputId, {
|
|
1403
1412
|
kind: request.kind,
|
|
1413
|
+
responseUserId: agent.ownerId,
|
|
1404
1414
|
title: request.title,
|
|
1405
1415
|
prompt: request.prompt,
|
|
1406
1416
|
...(request.choices ? { choices: request.choices } : {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/agent-sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
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.
|
|
31
|
+
"@canonmsg/core": "^0.21.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|