@canonmsg/codex-plugin 0.6.3 → 0.6.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.
@@ -31,6 +31,7 @@ type HostInboundMessage = {
31
31
  attachments?: CanonMessage['attachments'];
32
32
  senderType?: CanonMessage['senderType'];
33
33
  mentions?: string[] | null;
34
+ contactCard?: CanonMessage['contactCard'];
34
35
  };
35
36
  interface HostWorkspaceResolverOption {
36
37
  id: string;
@@ -54,9 +54,24 @@ export function renderCanonHostInboundContent(message, materialized) {
54
54
  const mat = materialized?.find((m) => m.index === i) ?? null;
55
55
  placeholders.push(describeAttachment(att, mat));
56
56
  }
57
+ if (message.contentType === 'contact_card' && message.contactCard) {
58
+ placeholders.push(describeContactCard(message.contactCard));
59
+ }
57
60
  const rendered = [...placeholders, body].filter(Boolean).join('\n');
58
61
  return rendered || '[Empty message]';
59
62
  }
63
+ function describeContactCard(card) {
64
+ const parts = [`${card.userType} · userId: ${card.userId}`];
65
+ if (card.accessLevel)
66
+ parts.push(`access: ${card.accessLevel}`);
67
+ if (card.ownerName)
68
+ parts.push(`owner: ${card.ownerName}`);
69
+ if (card.about)
70
+ parts.push(`about: ${card.about}`);
71
+ const identity = `📇 Contact card: "${card.displayName}" (${parts.join(' · ')}).`;
72
+ const hint = `This card is informational only in host mode. Canon does not currently expose a host-side tool here for starting a new direct conversation or sending a contact request to userId ${card.userId}.`;
73
+ return `${identity}\n${hint}`;
74
+ }
60
75
  function describeAttachment(attachment, materialized) {
61
76
  if (attachment.kind === 'image') {
62
77
  return '[Image attached]';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/codex-plugin",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Canon host integration for Codex CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,15 +21,16 @@
21
21
  "scripts"
22
22
  ],
23
23
  "scripts": {
24
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
25
- "dev": "tsc --watch",
24
+ "prepare:workspace-deps": "npm --prefix ../core run build && npm --prefix ../agent-sdk run build",
25
+ "build": "npm run prepare:workspace-deps && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
26
+ "dev": "npm run prepare:workspace-deps && tsc --watch",
26
27
  "smoke": "node scripts/smoke-test.mjs",
27
28
  "test": "vitest run",
28
29
  "prepack": "npm run build"
29
30
  },
30
31
  "dependencies": {
31
- "@canonmsg/agent-sdk": "^0.8.1",
32
- "@canonmsg/core": "^0.7.2"
32
+ "@canonmsg/agent-sdk": "^0.8.2",
33
+ "@canonmsg/core": "^0.7.4"
33
34
  },
34
35
  "engines": {
35
36
  "node": ">=18.0.0"