@canonmsg/agent-sdk 1.5.5 → 1.6.0
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.js +9 -20
- package/package.json +2 -2
package/dist/canon-agent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApprovalManager, CanonClient, buildCanonGroupContext, createRuntimeStatePublisher, diffCanonMemberIds, FINAL_MESSAGE_HANDOFF_MS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildRuntimeInputOutcome,
|
|
1
|
+
import { ApprovalManager, CanonClient, buildCanonGroupContext, createRuntimeStatePublisher, diffCanonMemberIds, FINAL_MESSAGE_HANDOFF_MS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildRuntimeInputOutcome, initRTDBAuth, rtdbRead, rtdbWrite, normalizeTurnMetadata, reachOutToCanonContact, resolveCanonReplyContext, resolveMessageActiveSelfContextId, resolveRuntimeProvenance, selectActiveSelfContexts, } from '@canonmsg/core';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { AuthManager } from './auth.js';
|
|
4
4
|
import { Debouncer } from './debouncer.js';
|
|
@@ -1397,6 +1397,14 @@ export class CanonAgent {
|
|
|
1397
1397
|
inputId,
|
|
1398
1398
|
kind: request.kind,
|
|
1399
1399
|
expiresAt: expiresAtMs,
|
|
1400
|
+
responseUserId: agent.ownerId,
|
|
1401
|
+
title: request.title,
|
|
1402
|
+
prompt: request.prompt,
|
|
1403
|
+
...(request.choices ? { choices: request.choices } : {}),
|
|
1404
|
+
...(request.secretName ? { secretName: request.secretName } : {}),
|
|
1405
|
+
...(request.native ? { native: request.native } : {}),
|
|
1406
|
+
...(request.sensitive !== undefined ? { sensitive: request.sensitive } : {}),
|
|
1407
|
+
turnId: request.turnId ?? turnId,
|
|
1400
1408
|
});
|
|
1401
1409
|
requestCreated = true;
|
|
1402
1410
|
try {
|
|
@@ -1408,25 +1416,6 @@ export class CanonAgent {
|
|
|
1408
1416
|
await this.apiClient.setTyping(conversationId, false);
|
|
1409
1417
|
}
|
|
1410
1418
|
catch { }
|
|
1411
|
-
const card = buildRuntimeInputRequest(inputId, {
|
|
1412
|
-
kind: request.kind,
|
|
1413
|
-
responseUserId: agent.ownerId,
|
|
1414
|
-
title: request.title,
|
|
1415
|
-
prompt: request.prompt,
|
|
1416
|
-
...(request.choices ? { choices: request.choices } : {}),
|
|
1417
|
-
...(request.secretName ? { secretName: request.secretName } : {}),
|
|
1418
|
-
...(request.native ? { native: request.native } : {}),
|
|
1419
|
-
expiresAt,
|
|
1420
|
-
...(request.sensitive !== undefined ? { sensitive: request.sensitive } : {}),
|
|
1421
|
-
});
|
|
1422
|
-
await this.apiClient.sendMessage(conversationId, card.text, {
|
|
1423
|
-
metadata: {
|
|
1424
|
-
...card.metadata,
|
|
1425
|
-
turnId: request.turnId ?? turnId,
|
|
1426
|
-
turnSemantics: 'control',
|
|
1427
|
-
replyBehavior: 'suppress_auto_reply',
|
|
1428
|
-
},
|
|
1429
|
-
});
|
|
1430
1419
|
while (Date.now() < expiresAtMs) {
|
|
1431
1420
|
throwIfAborted();
|
|
1432
1421
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/agent-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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.22.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|