@canonmsg/claude-code-plugin 0.19.3 → 0.19.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.
- package/dist/host.js +13 -7
- 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
|
|
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 = [
|
|
@@ -1116,7 +1117,11 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1116
1117
|
function flushStreaming() {
|
|
1117
1118
|
streamingOutput.flush().catch(() => { });
|
|
1118
1119
|
}
|
|
1119
|
-
function onStreamDelta(text) {
|
|
1120
|
+
function onStreamDelta(text, segmentId) {
|
|
1121
|
+
if (segmentId) {
|
|
1122
|
+
streamingOutput.appendTextSegmentDelta(segmentId, text);
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1120
1125
|
streamingOutput.appendDelta(text);
|
|
1121
1126
|
}
|
|
1122
1127
|
function isActiveTurnInterrupted() {
|
|
@@ -1530,7 +1535,8 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1530
1535
|
session.turnState = 'streaming';
|
|
1531
1536
|
stopVisibleWorkSignal();
|
|
1532
1537
|
writeTurn();
|
|
1533
|
-
|
|
1538
|
+
const blockIndex = typeof event.index === 'number' ? event.index : 'latest';
|
|
1539
|
+
onStreamDelta(event.delta.text, `text:${session.currentTurnId ?? conversationId}:${blockIndex}`);
|
|
1534
1540
|
}
|
|
1535
1541
|
break;
|
|
1536
1542
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/claude-code-plugin",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.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",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@anthropic-ai/claude-agent-sdk": "^0.2.141",
|
|
34
|
-
"@canonmsg/agent-sdk": "^3.
|
|
34
|
+
"@canonmsg/agent-sdk": "^3.4.1",
|
|
35
35
|
"@canonmsg/coding-agent-host": "^0.2.2",
|
|
36
|
-
"@canonmsg/core": "^2.
|
|
36
|
+
"@canonmsg/core": "^2.9.2",
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|