@canonmsg/claude-code-plugin 0.14.6 → 0.14.7

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 +25 -0
  2. package/package.json +3 -3
package/dist/host.js CHANGED
@@ -605,6 +605,7 @@ const FINAL_DELIVERY_RETRY_MS = 2_000;
605
605
  const CLAUDE_RUNTIME_CAPABILITIES = {
606
606
  ...DEFAULT_RUNTIME_CAPABILITIES,
607
607
  supportsInterrupt: true,
608
+ supportsInputInterrupt: true,
608
609
  supportsQueue: true,
609
610
  supportsInterleave: false,
610
611
  supportsRequiresAction: true,
@@ -1876,6 +1877,27 @@ export async function main() {
1876
1877
  return client.updateMessageDisposition(conversationId, input.sourceMessageId, 'rejected').catch(() => { });
1877
1878
  }));
1878
1879
  }
1880
+ function removeQueuedInput(conversationId, sourceMessageId) {
1881
+ const session = sessions.get(conversationId);
1882
+ if (!session || session.pendingInputs.length === 0)
1883
+ return;
1884
+ const before = session.pendingInputs.length;
1885
+ session.pendingInputs = session.pendingInputs.filter((input) => input.sourceMessageId !== sourceMessageId);
1886
+ if (session.pendingInputs.length === before)
1887
+ return;
1888
+ runtimeState.writeTurnState(conversationId, {
1889
+ turnId: session.currentTurnId,
1890
+ state: session.turnState,
1891
+ queueDepth: session.pendingInputs.length,
1892
+ currentSpeakerId: agentId,
1893
+ lastAcceptedIntent: session.lastAcceptedIntent,
1894
+ capabilities: CLAUDE_RUNTIME_CAPABILITIES,
1895
+ ...(session.currentTurnOpenedAt ? { openedAt: session.currentTurnOpenedAt } : {}),
1896
+ ...(session.turnState === 'idle' || session.turnState === 'completed' || session.turnState === 'interrupted'
1897
+ ? { completedAt: { '.sv': 'timestamp' } }
1898
+ : {}),
1899
+ }).catch(() => { });
1900
+ }
1879
1901
  function evictOldestIdle() {
1880
1902
  let oldest = null;
1881
1903
  for (const s of sessions.values()) {
@@ -2275,6 +2297,9 @@ export async function main() {
2275
2297
  }
2276
2298
  })();
2277
2299
  },
2300
+ onMessageDeleted: (payload) => {
2301
+ removeQueuedInput(payload.conversationId, payload.messageId);
2302
+ },
2278
2303
  onConversationUpdated: (payload) => {
2279
2304
  handleConversationUpdated(payload);
2280
2305
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/claude-code-plugin",
3
- "version": "0.14.6",
3
+ "version": "0.14.7",
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,8 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@anthropic-ai/claude-agent-sdk": "^0.2.101",
34
- "@canonmsg/agent-sdk": "^1.5.1",
35
- "@canonmsg/core": "^0.19.2",
34
+ "@canonmsg/agent-sdk": "^1.5.2",
35
+ "@canonmsg/core": "^0.19.3",
36
36
  "@modelcontextprotocol/sdk": "^1.12.0"
37
37
  },
38
38
  "engines": {