@canonmsg/claude-code-plugin 0.14.12 → 0.14.14

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.
package/dist/host.js CHANGED
@@ -182,6 +182,8 @@ function buildClaudeRuntimeDescriptor(input) {
182
182
  ...RUNTIME_NEW_SESSION_ACTION,
183
183
  primitive: 'session.new',
184
184
  },
185
+ RUNTIME_STOP_ACTION,
186
+ RUNTIME_STOP_AND_DROP_ACTION,
185
187
  ];
186
188
  return buildFirstPartyCodingRuntimeDescriptor({
187
189
  clientType: 'claude-code',
@@ -195,86 +197,6 @@ function buildClaudeRuntimeDescriptor(input) {
195
197
  admissionActions: HOST_ADMISSION_ACTIONS_DISABLED,
196
198
  presentation: input.presentation,
197
199
  commands,
198
- actions: [
199
- {
200
- id: 'plan',
201
- label: 'Plan first',
202
- description: 'Switch Claude into Plan mode. Text after /plan is kept as a ready prompt while the mode applies.',
203
- aliases: ['plan'],
204
- category: 'plan',
205
- placements: ['composer_slash', 'command_palette'],
206
- availability: ['always'],
207
- trailingTextBehavior: 'send_as_prompt',
208
- dispatch: {
209
- kind: 'control',
210
- controlId: 'permissionMode',
211
- value: 'plan',
212
- },
213
- },
214
- {
215
- id: 'runtime-status',
216
- label: 'Runtime status',
217
- description: 'Open Claude runtime details, including account, project, and policy status.',
218
- aliases: ['status'],
219
- category: 'details',
220
- placements: ['composer_slash', 'command_palette'],
221
- availability: ['always'],
222
- dispatch: { kind: 'open_details', target: 'status' },
223
- },
224
- {
225
- id: 'mcp-inventory',
226
- label: 'MCP servers',
227
- description: 'Open the Claude MCP inventory published by the host.',
228
- aliases: ['mcp'],
229
- category: 'details',
230
- placements: ['composer_slash', 'command_palette'],
231
- availability: ['always'],
232
- dispatch: { kind: 'open_details', target: 'mcp' },
233
- },
234
- {
235
- id: 'plugin-inventory',
236
- label: 'Plugins',
237
- description: 'Open the Claude plugin and command inventory published by the host.',
238
- aliases: ['plugins'],
239
- category: 'details',
240
- placements: ['composer_slash', 'command_palette'],
241
- availability: ['always'],
242
- dispatch: { kind: 'open_details', target: 'plugins' },
243
- },
244
- {
245
- id: 'model-details',
246
- label: 'Model control',
247
- description: 'Open runtime details and use the live Model control.',
248
- aliases: ['model'],
249
- category: 'details',
250
- placements: ['composer_slash', 'command_palette'],
251
- availability: ['always'],
252
- dispatch: { kind: 'open_details', target: 'model' },
253
- },
254
- {
255
- id: 'permission-details',
256
- label: 'Permission mode',
257
- description: 'Open runtime details and use the live Permission mode control.',
258
- aliases: ['permission'],
259
- category: 'details',
260
- placements: ['composer_slash', 'command_palette'],
261
- availability: ['always'],
262
- dispatch: { kind: 'open_details', target: 'permissionMode' },
263
- },
264
- {
265
- id: 'effort-details',
266
- label: 'Thinking level',
267
- description: 'Open runtime details and use the live Thinking level control.',
268
- aliases: ['effort'],
269
- category: 'details',
270
- placements: ['composer_slash', 'command_palette'],
271
- availability: ['always'],
272
- dispatch: { kind: 'open_details', target: 'effort' },
273
- },
274
- RUNTIME_STOP_ACTION,
275
- RUNTIME_STOP_AND_DROP_ACTION,
276
- RUNTIME_NEW_SESSION_ACTION,
277
- ],
278
200
  });
279
201
  }
280
202
  function parseClaudePermissionMode(value) {
@@ -935,11 +857,13 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
935
857
  return Promise.resolve();
936
858
  const turnId = session.currentTurnId ?? snapshot.turnId;
937
859
  session.streamingText = snapshot.text;
860
+ const blocks = snapshot.blocks?.map((block) => ({ ...block, turnId }));
938
861
  return runtimeState.writeStreaming(conversationId, {
939
862
  text: snapshot.text,
940
863
  status: snapshot.status,
941
864
  messageId: turnId,
942
865
  turnId,
866
+ blocks,
943
867
  });
944
868
  },
945
869
  clearSnapshot: () => {
@@ -961,6 +885,10 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
961
885
  function clearStreaming() {
962
886
  return streamingOutput.clear().catch(() => { });
963
887
  }
888
+ function getFinalTurnTrail() {
889
+ const turnId = session.currentTurnId ?? `claude-${conversationId}`;
890
+ return streamingOutput.getFinalTrail().map((block) => ({ ...block, turnId }));
891
+ }
964
892
  function clearIdleResetTimer() {
965
893
  if (!session.idleResetTimer)
966
894
  return;
@@ -1039,8 +967,10 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
1039
967
  turnKey: deliverTurn.turnKey,
1040
968
  sourceMessageId: deliverTurn.sourceMessageId ?? undefined,
1041
969
  turnSemantics: 'turn_complete',
1042
- turnComplete: true,
1043
970
  deliveryIntent: session.lastAcceptedIntent ?? undefined,
971
+ ...(getFinalTurnTrail().length > 0
972
+ ? { turnTrail: getFinalTurnTrail() }
973
+ : {}),
1044
974
  },
1045
975
  });
1046
976
  session.finalizedTurnKeys.add(deliverTurn.turnKey);
@@ -1268,11 +1198,20 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
1268
1198
  if (event?.type === 'content_block_start' && event.content_block?.type === 'tool_use') {
1269
1199
  session.toolInProgress = true;
1270
1200
  session.turnState = 'tool';
1201
+ streamingOutput.addBlock({
1202
+ id: `tool:${session.currentTurnId ?? conversationId}`,
1203
+ kind: 'tool',
1204
+ status: 'running',
1205
+ title: typeof event.content_block?.name === 'string'
1206
+ ? event.content_block.name
1207
+ : 'Claude tool use',
1208
+ }).catch(() => { });
1271
1209
  startVisibleWorkSignal();
1272
1210
  writeTurn();
1273
1211
  }
1274
1212
  else if (event?.type === 'content_block_stop' && session.toolInProgress) {
1275
1213
  session.toolInProgress = false;
1214
+ streamingOutput.completeBlock(`tool:${session.currentTurnId ?? conversationId}`).catch(() => { });
1276
1215
  if (session.state.state === 'running') {
1277
1216
  session.turnState = 'thinking';
1278
1217
  startVisibleWorkSignal();
@@ -2096,7 +2035,6 @@ export async function main() {
2096
2035
  ...(activeSelfContextId ? { selfContextId: activeSelfContextId } : {}),
2097
2036
  metadata: {
2098
2037
  turnSemantics: 'turn_complete',
2099
- turnComplete: true,
2100
2038
  replyBehavior: 'suppress_auto_reply',
2101
2039
  },
2102
2040
  }).catch(() => { });
@@ -2175,7 +2113,6 @@ export async function main() {
2175
2113
  if (m.metadata?.type === 'approval_reply' || (approvalManager?.pendingCount ?? 0) > 0) {
2176
2114
  const consumed = approvalManager?.handleMessage(convoId, {
2177
2115
  senderId: m.senderId,
2178
- text: m.text ?? undefined,
2179
2116
  metadata: m.metadata,
2180
2117
  }) ?? false;
2181
2118
  if (m.metadata?.type === 'approval_reply') {
@@ -2275,7 +2212,6 @@ export async function main() {
2275
2212
  ...(activeSelfContextId ? { selfContextId: activeSelfContextId } : {}),
2276
2213
  metadata: {
2277
2214
  turnSemantics: 'turn_complete',
2278
- turnComplete: true,
2279
2215
  replyBehavior: 'suppress_auto_reply',
2280
2216
  },
2281
2217
  }).catch(() => { });
package/dist/server.js CHANGED
@@ -41,7 +41,6 @@ let approvalServer = null;
41
41
  const conversationCache = new Map();
42
42
  const TURN_COMPLETE_METADATA = {
43
43
  turnSemantics: 'turn_complete',
44
- turnComplete: true,
45
44
  };
46
45
  /** Last owner-visible conversation to route approval cards into. */
47
46
  let approvalConversationId = null;
@@ -419,7 +418,6 @@ async function handleInboundMessage(payload) {
419
418
  if (approvalManager) {
420
419
  const consumed = approvalManager.handleMessage(payload.conversationId, {
421
420
  senderId: m.senderId,
422
- text: m.text ?? undefined,
423
421
  metadata: m.metadata,
424
422
  });
425
423
  if (consumed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/claude-code-plugin",
3
- "version": "0.14.12",
3
+ "version": "0.14.14",
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",
@@ -30,10 +30,10 @@
30
30
  "test": "vitest run"
31
31
  },
32
32
  "dependencies": {
33
- "@anthropic-ai/claude-agent-sdk": "^0.2.101",
34
- "@canonmsg/agent-sdk": "^1.7.0",
35
- "@canonmsg/core": "^0.24.0",
36
- "@modelcontextprotocol/sdk": "^1.12.0"
33
+ "@anthropic-ai/claude-agent-sdk": "^0.2.141",
34
+ "@canonmsg/agent-sdk": "^2.0.0",
35
+ "@canonmsg/core": "^1.0.0",
36
+ "@modelcontextprotocol/sdk": "^1.29.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=18.0.0"