@canonmsg/claude-code-plugin 0.19.4 → 0.19.6

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.
Files changed (2) hide show
  1. package/dist/host.js +9 -10
  2. package/package.json +3 -3
package/dist/host.js CHANGED
@@ -28,7 +28,7 @@ import { readFile } from 'node:fs/promises';
28
28
  import { query, } from '@anthropic-ai/claude-agent-sdk';
29
29
  import { isAnthropicImageAttachment, materializeMessageMedia, materializeReplyContextMedia, sendMediaFileMessage, toAnthropicImageBlock, } from '@canonmsg/agent-sdk';
30
30
  import { captureTurnArtifactSnapshot, collectTurnArtifacts, } from '@canonmsg/coding-agent-host';
31
- import { CLAUDE_EFFORT_OPTIONS, CLAUDE_PERMISSION_MODE_OPTIONS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildCanonInboundFrameV1, buildCanonTurnContextV2, buildConfiguredWorkspaceOptionsWithRoots, buildConversationEnvironmentKey, buildFirstPartyCodingRuntimeDescriptor, buildHydratedInboundContext, diffCanonMemberIds, buildPlanApprovalRequest, resolveQuestionAllowOther, buildPublicWorkspaceRoots, buildPublicWorkspaceOptions, buildRuntimePresentationPolicy, DEFAULT_FIRST_PARTY_RUNTIME_PRESENTATION, createConversationMetadataLoader, createTurnOutputController, createRuntimeStatePublisher, createTypingStatusPublisher, EXECUTION_ENVIRONMENT_MODES, CanonClient, CanonStream, ControlChannelPoller, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, DEFAULT_RUNTIME_CAPABILITIES, HOST_ADMISSION_ACTIONS_DISABLED, ApprovalManager, ExecutionEnvironmentError, FINAL_MESSAGE_HANDOFF_MS, buildLocalRuntimeId, getActiveProfileLock, heartbeatLocalRuntimeEntry, normalizeTurnMetadata, prepareConversationEnvironment, resolveCanonAgent, initRTDBAuth, sendMessageWithRetry, loadHostSessionConfig, loadRuntimeSessionState, markLocalRuntimeStopped, releaseConversationEnvironment, saveRuntimeSessionState, clearRuntimeSessionState, publishHostAgentRuntime, publishHostSessionSnapshots, renderCanonHostInboundContent, renderCodingHostInboundPrompt, resolveHostWorkspaceCwd, upsertLocalRuntimeEntry, } from '@canonmsg/core';
31
+ import { CLAUDE_EFFORT_OPTIONS, CLAUDE_PERMISSION_MODE_OPTIONS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildCanonInboundFrameV1, buildCanonTurnContextV2, buildConfiguredWorkspaceOptionsWithRoots, buildConversationEnvironmentKey, buildFirstPartyCodingRuntimeDescriptor, buildHydratedInboundContext, diffCanonMemberIds, buildPlanApprovalRequest, resolveQuestionAllowOther, buildPublicWorkspaceRoots, buildPublicWorkspaceOptions, buildRuntimePresentationPolicy, normalizeRuntimeCommandDescriptors, DEFAULT_FIRST_PARTY_RUNTIME_PRESENTATION, createConversationMetadataLoader, createTurnOutputController, createRuntimeStatePublisher, createTypingStatusPublisher, EXECUTION_ENVIRONMENT_MODES, CanonClient, CanonStream, ControlChannelPoller, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, DEFAULT_RUNTIME_CAPABILITIES, HOST_ADMISSION_ACTIONS_DISABLED, ApprovalManager, ExecutionEnvironmentError, FINAL_MESSAGE_HANDOFF_MS, buildLocalRuntimeId, getActiveProfileLock, heartbeatLocalRuntimeEntry, normalizeTurnMetadata, prepareConversationEnvironment, resolveCanonAgent, initRTDBAuth, sendMessageWithRetry, loadHostSessionConfig, loadRuntimeSessionState, markLocalRuntimeStopped, releaseConversationEnvironment, saveRuntimeSessionState, clearRuntimeSessionState, publishHostAgentRuntime, publishHostSessionSnapshots, renderCanonHostInboundContent, renderCodingHostInboundPrompt, resolveHostWorkspaceCwd, upsertLocalRuntimeEntry, } from '@canonmsg/core';
32
32
  import { decideAutoReply, } from './inbound-policy.js';
33
33
  import { runCli } from './cli-entry.js';
34
34
  import { collectMissedInboundMessages, STARTUP_RECOVERY_MAX_MESSAGES, STARTUP_RECOVERY_PAGE_SIZE, } from './startup-recovery.js';
@@ -98,13 +98,11 @@ const MAX_NATIVE_SLASH_COMMANDS = 50;
98
98
  * through. Canon-injected aliases keep precedence over native names.
99
99
  */
100
100
  export function buildNativeSlashCommandDescriptors(native, reservedAliases) {
101
- const seen = new Set(reservedAliases);
102
101
  const descriptors = [];
103
102
  for (const command of native.slice(0, MAX_NATIVE_SLASH_COMMANDS)) {
104
103
  const name = String(command.name ?? '').replace(/^\//, '').trim();
105
- if (!name || !/^[A-Za-z0-9:_-]+$/.test(name) || seen.has(name))
104
+ if (!name)
106
105
  continue;
107
- seen.add(name);
108
106
  descriptors.push({
109
107
  id: `claude-native-${name}`,
110
108
  label: `/${name}`,
@@ -119,7 +117,10 @@ export function buildNativeSlashCommandDescriptors(native, reservedAliases) {
119
117
  dispatch: { kind: 'text_passthrough', template: `/${name}` },
120
118
  });
121
119
  }
122
- return descriptors;
120
+ return normalizeRuntimeCommandDescriptors(descriptors, {
121
+ reservedAliases,
122
+ maxCommands: MAX_NATIVE_SLASH_COMMANDS,
123
+ });
123
124
  }
124
125
  function buildClaudeRuntimeDescriptor(input) {
125
126
  const commands = [
@@ -2471,14 +2472,12 @@ export async function main() {
2471
2472
  return;
2472
2473
  }
2473
2474
  }
2474
- // Check for metadata replies (question answers, plan approvals)
2475
- if (m.metadata?.type === 'question_reply' || m.metadata?.type === 'plan_approval_reply') {
2475
+ // Check for metadata replies (plan approvals).
2476
+ if (m.metadata?.type === 'plan_approval_reply') {
2476
2477
  const existingSession = sessions.get(convoId);
2477
2478
  const pendingReply = existingSession?.pendingReply;
2478
2479
  const isOwnerReply = m.isOwner ?? (ownerId != null && m.senderId === ownerId);
2479
- const replyRequestId = m.metadata.type === 'question_reply'
2480
- ? m.metadata.questionId
2481
- : m.metadata.planId;
2480
+ const replyRequestId = m.metadata.planId;
2482
2481
  if (!pendingReply) {
2483
2482
  console.error(`[canon-host] [${convoId.slice(0, 8)}] Ignoring stale ${m.metadata.type} with no pending request`);
2484
2483
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/claude-code-plugin",
3
- "version": "0.19.4",
3
+ "version": "0.19.6",
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",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@anthropic-ai/claude-agent-sdk": "^0.2.141",
34
- "@canonmsg/agent-sdk": "^3.3.1",
34
+ "@canonmsg/agent-sdk": "^3.4.2",
35
35
  "@canonmsg/coding-agent-host": "^0.2.2",
36
- "@canonmsg/core": "^2.8.1",
36
+ "@canonmsg/core": "^3.0.0",
37
37
  "@modelcontextprotocol/sdk": "^1.29.0"
38
38
  },
39
39
  "engines": {