@canonmsg/claude-code-plugin 0.9.3 โ†’ 0.9.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;
@@ -55,9 +55,24 @@ export function renderCanonHostInboundContent(message, materialized) {
55
55
  const mat = materialized?.find((m) => m.index === i) ?? null;
56
56
  placeholders.push(describeAttachment(att, mat));
57
57
  }
58
+ if (message.contentType === 'contact_card' && message.contactCard) {
59
+ placeholders.push(describeContactCard(message.contactCard));
60
+ }
58
61
  const rendered = [...placeholders, body].filter(Boolean).join('\n');
59
62
  return rendered || '[Empty message]';
60
63
  }
64
+ function describeContactCard(card) {
65
+ const parts = [`${card.userType} ยท userId: ${card.userId}`];
66
+ if (card.accessLevel)
67
+ parts.push(`access: ${card.accessLevel}`);
68
+ if (card.ownerName)
69
+ parts.push(`owner: ${card.ownerName}`);
70
+ if (card.about)
71
+ parts.push(`about: ${card.about}`);
72
+ const identity = `๐Ÿ“‡ Contact card: "${card.displayName}" (${parts.join(' ยท ')}).`;
73
+ 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}.`;
74
+ return `${identity}\n${hint}`;
75
+ }
61
76
  function describeAttachment(attachment, materialized) {
62
77
  if (attachment.kind === 'image') {
63
78
  return '[Image attached]';
package/dist/host.js CHANGED
@@ -26,7 +26,7 @@ import { execFileSync } from 'node:child_process';
26
26
  import { existsSync } from 'node:fs';
27
27
  import { query } from '@anthropic-ai/claude-agent-sdk';
28
28
  import { isAnthropicImageAttachment, materializeMessageMedia, toAnthropicImageBlock, } from '@canonmsg/agent-sdk';
29
- import { buildConfiguredWorkspaceOptions, buildConversationEnvironmentKey, buildPublicWorkspaceOptions, EXECUTION_ENVIRONMENT_MODES, CanonClient, CanonStream, clearTurnState, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, DEFAULT_RUNTIME_CAPABILITIES, ExecutionEnvironmentError, FINAL_MESSAGE_HANDOFF_MS, normalizeTurnMetadata, prepareConversationEnvironment, resolveCanonAgent, getActiveProfile, releaseLock, initRTDBAuth, rtdbRead, rtdbWrite, writeSessionState, clearSessionState, writeTurnState, releaseConversationEnvironment, } from '@canonmsg/core';
29
+ import { CLAUDE_PERMISSION_MODE_OPTIONS, buildConfiguredWorkspaceOptions, buildConversationEnvironmentKey, buildPublicWorkspaceOptions, EXECUTION_ENVIRONMENT_MODES, CanonClient, CanonStream, clearTurnState, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, DEFAULT_RUNTIME_CAPABILITIES, ExecutionEnvironmentError, FINAL_MESSAGE_HANDOFF_MS, normalizeTurnMetadata, prepareConversationEnvironment, resolveCanonAgent, getActiveProfile, releaseLock, initRTDBAuth, rtdbRead, rtdbWrite, writeSessionState, clearSessionState, writeTurnState, releaseConversationEnvironment, } from '@canonmsg/core';
30
30
  import { buildCanonHostPrompt, buildHydratedInboundContext, createConversationMetadataLoader, loadHostSessionConfig, publishHostAgentRuntime, renderCanonHostInboundContent, resolveHostWorkspaceCwd, } from './host-runtime.js';
31
31
  import { buildInboundContextLines, decideAutoReply, } from './inbound-policy.js';
32
32
  import { createStreamingBuffer } from './streaming-buffer.js';
@@ -755,6 +755,7 @@ export async function main() {
755
755
  let runtimeDescriptor = {
756
756
  defaultWorkspaceId: workspaceOptions[0]?.id,
757
757
  defaultPermissionMode: 'default',
758
+ availablePermissionModes: [...CLAUDE_PERMISSION_MODE_OPTIONS],
758
759
  availableWorkspaces: buildPublicWorkspaceOptions(workspaceOptions),
759
760
  availableExecutionModes: hostAvailableExecutionModes,
760
761
  };
@@ -772,6 +773,7 @@ export async function main() {
772
773
  defaultWorkspaceId: workspaceOptions[0]?.id,
773
774
  defaultModel: runtimeModels[0]?.value,
774
775
  defaultPermissionMode: 'default',
776
+ availablePermissionModes: [...CLAUDE_PERMISSION_MODE_OPTIONS],
775
777
  availableModels: runtimeModels,
776
778
  availableWorkspaces: buildPublicWorkspaceOptions(workspaceOptions),
777
779
  availableExecutionModes: hostAvailableExecutionModes,
@@ -781,6 +783,7 @@ export async function main() {
781
783
  runtimeDescriptor = {
782
784
  defaultWorkspaceId: workspaceOptions[0]?.id,
783
785
  defaultPermissionMode: 'default',
786
+ availablePermissionModes: [...CLAUDE_PERMISSION_MODE_OPTIONS],
784
787
  availableWorkspaces: buildPublicWorkspaceOptions(workspaceOptions),
785
788
  availableExecutionModes: hostAvailableExecutionModes,
786
789
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/claude-code-plugin",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "Canon channel plugin for Claude Code โ€” messaging where AI agents are first-class citizens",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,15 +23,16 @@
23
23
  ".claude-plugin"
24
24
  ],
25
25
  "scripts": {
26
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
27
- "dev": "tsc --watch",
26
+ "prepare:workspace-deps": "npm --prefix ../core run build && npm --prefix ../agent-sdk run build",
27
+ "build": "npm run prepare:workspace-deps && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
28
+ "dev": "npm run prepare:workspace-deps && tsc --watch",
28
29
  "prepack": "npm run build",
29
30
  "test": "vitest run"
30
31
  },
31
32
  "dependencies": {
32
33
  "@anthropic-ai/claude-agent-sdk": "^0.2.101",
33
- "@canonmsg/agent-sdk": "^0.8.1",
34
- "@canonmsg/core": "^0.7.2",
34
+ "@canonmsg/agent-sdk": "^0.8.2",
35
+ "@canonmsg/core": "^0.7.4",
35
36
  "@modelcontextprotocol/sdk": "^1.12.0"
36
37
  },
37
38
  "engines": {