@canonmsg/agent-sdk 3.4.2 → 3.4.4

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.
@@ -1077,13 +1077,13 @@ export class CanonAgent {
1077
1077
  * where the last-started agent's token wins in multi-agent processes.
1078
1078
  */
1079
1079
  createRuntimeStatePublisher() {
1080
- if (!this.agentId)
1080
+ if (!this.agentId || !this.rtdbHandle)
1081
1081
  return null;
1082
1082
  return createRuntimeStatePublisher({
1083
+ rtdb: this.rtdbHandle,
1083
1084
  agentId: this.agentId,
1084
1085
  clientType: this.options.clientType ?? 'generic',
1085
1086
  hostMode: this.options.runtimeControlSurface === 'host',
1086
- ...(this.rtdbHandle ? { rtdb: this.rtdbHandle } : {}),
1087
1087
  });
1088
1088
  }
1089
1089
  requireRuntimeStatePublisher() {
@@ -1393,7 +1393,11 @@ export class CanonAgent {
1393
1393
  const deleteMessage = (messageId) => this.apiClient.deleteMessage(conversationId, messageId);
1394
1394
  const markAsRead = () => this.apiClient.markAsRead(conversationId);
1395
1395
  const leave = () => this.apiClient.leaveConversation(conversationId);
1396
- const react = (messageId, emoji) => this.apiClient.react(conversationId, messageId, emoji);
1396
+ // Handler contract stays Promise<void>; the client's toggle result
1397
+ // (added/removed + reactions) is a bridge-era addition it doesn't use.
1398
+ const react = async (messageId, emoji) => {
1399
+ await this.apiClient.react(conversationId, messageId, emoji);
1400
+ };
1397
1401
  const addMember = (userId) => this.apiClient.addMember(conversationId, userId);
1398
1402
  const removeMember = (userId) => this.apiClient.removeMember(conversationId, userId);
1399
1403
  const sendContextualMessage = (target, text, options) => this.apiClient.sendContextualMessage({
@@ -1955,7 +1959,7 @@ export class CanonAgent {
1955
1959
  await turnOutput.flush();
1956
1960
  },
1957
1961
  clear: async () => {
1958
- await turnOutput.clear();
1962
+ await turnOutput.clear().catch(() => { });
1959
1963
  },
1960
1964
  setTool: async (text) => {
1961
1965
  await writeTurn('tool');
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@canonmsg/agent-sdk",
3
- "version": "3.4.2",
3
+ "version": "3.4.4",
4
4
  "description": "Canon Agent SDK — build AI agents that participate in Canon conversations",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
12
  },
13
13
  "./media": {
14
- "import": "./dist/media.js",
15
- "types": "./dist/media.d.ts"
14
+ "types": "./dist/media.d.ts",
15
+ "import": "./dist/media.js"
16
16
  }
17
17
  },
18
18
  "files": [
@@ -28,7 +28,7 @@
28
28
  "node": ">=18.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@canonmsg/core": "^3.0.0"
31
+ "@canonmsg/core": "^3.2.0"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"