@canonmsg/claude-code-plugin 0.19.2 → 0.19.4
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 +68 -63
- package/dist/session-state.d.ts +6 -2
- package/dist/session-state.js +2 -1
- package/dist/tool-policy.js +2 -2
- package/package.json +4 -4
package/dist/host.js
CHANGED
|
@@ -27,8 +27,8 @@ import { existsSync } from 'node:fs';
|
|
|
27
27
|
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
|
-
import {
|
|
31
|
-
import { CLAUDE_EFFORT_OPTIONS, CLAUDE_PERMISSION_MODE_OPTIONS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, 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,
|
|
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';
|
|
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';
|
|
@@ -580,7 +580,7 @@ function buildClaudeRuntimeInfo(input) {
|
|
|
580
580
|
{
|
|
581
581
|
id: 'mediaOut',
|
|
582
582
|
label: 'Media out',
|
|
583
|
-
value: '
|
|
583
|
+
value: 'Generated media artifacts',
|
|
584
584
|
tier: 'detail',
|
|
585
585
|
},
|
|
586
586
|
].filter((item) => Boolean(item));
|
|
@@ -670,11 +670,7 @@ const CLAUDE_RUNTIME_CAPABILITIES = {
|
|
|
670
670
|
supportsNonFinalPermanentMessages: false,
|
|
671
671
|
};
|
|
672
672
|
function buildCanonPrompt(input) {
|
|
673
|
-
|
|
674
|
-
...(input.session ? buildClaudeSessionContextLines(input.session) : []),
|
|
675
|
-
...(input.artifactDir ? [buildTurnArtifactContextLine(input.artifactDir)] : []),
|
|
676
|
-
];
|
|
677
|
-
return renderCanonTurnBriefPrompt(buildCanonTurnContextV2({
|
|
673
|
+
return renderCodingHostInboundPrompt(buildCanonInboundFrameV1(buildCanonTurnContextV2({
|
|
678
674
|
content: input.content,
|
|
679
675
|
conversationId: input.conversationId,
|
|
680
676
|
participantContext: input.participantContext,
|
|
@@ -683,31 +679,13 @@ function buildCanonPrompt(input) {
|
|
|
683
679
|
activeSelfContextId: input.activeSelfContextId,
|
|
684
680
|
provenance: input.provenance,
|
|
685
681
|
replyContext: input.replyContext,
|
|
686
|
-
sessionContextLines: sessionContextLines.length ? sessionContextLines : undefined,
|
|
687
682
|
message: input.message,
|
|
688
|
-
}));
|
|
689
|
-
}
|
|
690
|
-
function optionLabel(value, options) {
|
|
691
|
-
if (!value)
|
|
692
|
-
return null;
|
|
693
|
-
const label = options.find((option) => option.value === value)?.label ?? value;
|
|
694
|
-
return label === value ? value : `${label} (${value})`;
|
|
683
|
+
})));
|
|
695
684
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
const model = optionLabel(session.state.model, session.availableModels);
|
|
701
|
-
return [
|
|
702
|
-
model ? `Selected model: ${model}` : null,
|
|
703
|
-
permissionMode ? `Permission mode: ${permissionMode}` : null,
|
|
704
|
-
effort ? `Thinking level: ${effort}` : null,
|
|
705
|
-
workspace ? `Project: ${workspace.label} (${workspace.id})` : null,
|
|
706
|
-
`Execution mode: ${session.environment.mode}`,
|
|
707
|
-
`Working directory: ${session.cwd}`,
|
|
708
|
-
session.environment.branch ? `Git branch: ${session.environment.branch}` : null,
|
|
709
|
-
session.environment.worktreePath ? `Worktree: ${session.environment.worktreePath}` : null,
|
|
710
|
-
].filter((line) => Boolean(line));
|
|
685
|
+
function resolveArtifactRoutingMode(participantContext) {
|
|
686
|
+
return participantContext.conversationType === 'direct' && participantContext.isOwner
|
|
687
|
+
? 'workspace-generated'
|
|
688
|
+
: 'disabled';
|
|
711
689
|
}
|
|
712
690
|
function renderInboundContent(message, materialized) {
|
|
713
691
|
return renderCanonHostInboundContent(message, materialized);
|
|
@@ -767,15 +745,15 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
767
745
|
messageQueue.push(input);
|
|
768
746
|
}
|
|
769
747
|
};
|
|
770
|
-
let enqueueInboundMessage = (msg, intent = 'queue', sourceMessageId, markAccepted = false, isOwnerTurn = false,
|
|
748
|
+
let enqueueInboundMessage = (msg, intent = 'queue', sourceMessageId, markAccepted = false, isOwnerTurn = false, artifactRoutingMode = 'disabled') => {
|
|
771
749
|
sendInput(createClaudeInputEnvelope({
|
|
772
750
|
kind: 'canon',
|
|
773
751
|
msg,
|
|
774
752
|
intent,
|
|
775
753
|
sourceMessageId,
|
|
776
754
|
markAccepted,
|
|
777
|
-
artifactDir,
|
|
778
755
|
isOwnerTurn,
|
|
756
|
+
artifactRoutingMode,
|
|
779
757
|
}));
|
|
780
758
|
};
|
|
781
759
|
const inputStream = {
|
|
@@ -1073,7 +1051,7 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1073
1051
|
environment,
|
|
1074
1052
|
query: q,
|
|
1075
1053
|
sendInput,
|
|
1076
|
-
enqueueInbound: (msg, intent = 'queue', sourceMessageId, markAccepted = false, isOwnerTurn = false,
|
|
1054
|
+
enqueueInbound: (msg, intent = 'queue', sourceMessageId, markAccepted = false, isOwnerTurn = false, artifactRoutingMode = 'disabled') => enqueueInboundMessage(msg, intent, sourceMessageId, markAccepted, isOwnerTurn, artifactRoutingMode),
|
|
1077
1055
|
state: {
|
|
1078
1056
|
model: undefined,
|
|
1079
1057
|
permissionMode: config.permissionMode,
|
|
@@ -1138,7 +1116,11 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1138
1116
|
function flushStreaming() {
|
|
1139
1117
|
streamingOutput.flush().catch(() => { });
|
|
1140
1118
|
}
|
|
1141
|
-
function onStreamDelta(text) {
|
|
1119
|
+
function onStreamDelta(text, segmentId) {
|
|
1120
|
+
if (segmentId) {
|
|
1121
|
+
streamingOutput.appendTextSegmentDelta(segmentId, text);
|
|
1122
|
+
return;
|
|
1123
|
+
}
|
|
1142
1124
|
streamingOutput.appendDelta(text);
|
|
1143
1125
|
}
|
|
1144
1126
|
function isActiveTurnInterrupted() {
|
|
@@ -1254,26 +1236,31 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1254
1236
|
return false;
|
|
1255
1237
|
}
|
|
1256
1238
|
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1239
|
+
function sendTurnArtifactFile(file) {
|
|
1240
|
+
return sendMediaFileMessage(client, conversationId, file.path, '', {
|
|
1241
|
+
...(session.activeSelfContextId ? { selfContextId: session.activeSelfContextId } : {}),
|
|
1242
|
+
metadata: buildArtifactMediaMetadata(),
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
async function routeWorkspaceGeneratedArtifacts(input) {
|
|
1246
|
+
if (!input.artifactBaseline)
|
|
1259
1247
|
return;
|
|
1260
1248
|
try {
|
|
1261
|
-
const result = await
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
...(session.activeSelfContextId ? { selfContextId: session.activeSelfContextId } : {}),
|
|
1265
|
-
metadata: buildArtifactMediaMetadata(),
|
|
1266
|
-
}),
|
|
1249
|
+
const result = await collectTurnArtifacts({
|
|
1250
|
+
cwd: session.cwd,
|
|
1251
|
+
baseline: input.artifactBaseline,
|
|
1267
1252
|
});
|
|
1268
|
-
for (const
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1253
|
+
for (const file of result.files) {
|
|
1254
|
+
try {
|
|
1255
|
+
const { messageId } = await sendTurnArtifactFile(file);
|
|
1256
|
+
console.error(`[canon-host] [${conversationId.slice(0, 8)}] Routed generated artifact ${file.relativePath ?? file.fileName} (${messageId})`);
|
|
1257
|
+
}
|
|
1258
|
+
catch (error) {
|
|
1259
|
+
console.error(`[canon-host] [${conversationId.slice(0, 8)}] Artifact upload failed for ${file.relativePath ?? file.fileName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1260
|
+
}
|
|
1274
1261
|
}
|
|
1275
1262
|
for (const skipped of result.skipped) {
|
|
1276
|
-
if (skipped.reason === 'too-large' || skipped.reason === 'file-cap' || skipped.reason === '
|
|
1263
|
+
if (skipped.reason === 'too-large' || skipped.reason === 'file-cap' || skipped.reason === 'scan-limit') {
|
|
1277
1264
|
console.error(`[canon-host] [${conversationId.slice(0, 8)}] Artifact skipped ${skipped.fileName} (${skipped.reason})`);
|
|
1278
1265
|
}
|
|
1279
1266
|
}
|
|
@@ -1282,6 +1269,11 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1282
1269
|
console.error(`[canon-host] [${conversationId.slice(0, 8)}] Artifact routing failed:`, error instanceof Error ? error.message : error);
|
|
1283
1270
|
}
|
|
1284
1271
|
}
|
|
1272
|
+
async function routeArtifactsForInput(input) {
|
|
1273
|
+
if (input.artifactRoutingMode === 'workspace-generated') {
|
|
1274
|
+
await routeWorkspaceGeneratedArtifacts(input);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1285
1277
|
function scheduleFinalDeliveryRetry(pending = session.pendingFinalDelivery) {
|
|
1286
1278
|
if (!pending || session.closed || session.pendingFinalDelivery?.turnKey !== pending.turnKey)
|
|
1287
1279
|
return;
|
|
@@ -1414,8 +1406,24 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1414
1406
|
return;
|
|
1415
1407
|
await client.updateMessageDisposition(conversationId, sourceMessageId, 'accepted_now').catch(() => { });
|
|
1416
1408
|
}
|
|
1409
|
+
async function prepareArtifactsForInput(input) {
|
|
1410
|
+
if (input.kind !== 'canon')
|
|
1411
|
+
return;
|
|
1412
|
+
if (!session.currentTurnId) {
|
|
1413
|
+
session.currentTurnId = randomUUID();
|
|
1414
|
+
session.currentTurnOpenedAt = Date.now();
|
|
1415
|
+
}
|
|
1416
|
+
if (input.artifactRoutingMode === 'workspace-generated') {
|
|
1417
|
+
input.artifactBaseline = await captureTurnArtifactSnapshot({ cwd: session.cwd }).catch((error) => {
|
|
1418
|
+
console.error(`[canon-host] [${conversationId.slice(0, 8)}] Artifact snapshot failed:`, error instanceof Error ? error.message : error);
|
|
1419
|
+
return null;
|
|
1420
|
+
});
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1417
1424
|
async function startCanonInput(input) {
|
|
1418
1425
|
await markQueuedMessageAccepted(input.sourceMessageId, input.markAccepted);
|
|
1426
|
+
await prepareArtifactsForInput(input);
|
|
1419
1427
|
session.state.state = 'running';
|
|
1420
1428
|
sendInput(input);
|
|
1421
1429
|
}
|
|
@@ -1429,7 +1437,7 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1429
1437
|
writeTurn();
|
|
1430
1438
|
void startCanonInput(next);
|
|
1431
1439
|
}
|
|
1432
|
-
enqueueInboundMessage = (msg, intent = 'queue', sourceMessageId = null, markAccepted = false, isOwnerTurn = false,
|
|
1440
|
+
enqueueInboundMessage = (msg, intent = 'queue', sourceMessageId = null, markAccepted = false, isOwnerTurn = false, artifactRoutingMode = 'disabled') => {
|
|
1433
1441
|
session.lastActivity = Date.now();
|
|
1434
1442
|
const input = createClaudeInputEnvelope({
|
|
1435
1443
|
kind: 'canon',
|
|
@@ -1437,8 +1445,8 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1437
1445
|
intent,
|
|
1438
1446
|
sourceMessageId,
|
|
1439
1447
|
markAccepted,
|
|
1440
|
-
artifactDir,
|
|
1441
1448
|
isOwnerTurn,
|
|
1449
|
+
artifactRoutingMode,
|
|
1442
1450
|
});
|
|
1443
1451
|
if (session.pendingFinalDelivery) {
|
|
1444
1452
|
session.pendingInputs.push(input);
|
|
@@ -1526,7 +1534,8 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1526
1534
|
session.turnState = 'streaming';
|
|
1527
1535
|
stopVisibleWorkSignal();
|
|
1528
1536
|
writeTurn();
|
|
1529
|
-
|
|
1537
|
+
const blockIndex = typeof event.index === 'number' ? event.index : 'latest';
|
|
1538
|
+
onStreamDelta(event.delta.text, `text:${session.currentTurnId ?? conversationId}:${blockIndex}`);
|
|
1530
1539
|
}
|
|
1531
1540
|
break;
|
|
1532
1541
|
}
|
|
@@ -1575,7 +1584,7 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1575
1584
|
// Turn artifacts land before the final text reply.
|
|
1576
1585
|
if (completedInput?.kind === 'canon'
|
|
1577
1586
|
&& !session.interruptedTurnKeys.has(completedInput.turnKey)) {
|
|
1578
|
-
await
|
|
1587
|
+
await routeArtifactsForInput(completedInput);
|
|
1579
1588
|
}
|
|
1580
1589
|
const resultText = typeof msg.result === 'string'
|
|
1581
1590
|
? msg.result.trim()
|
|
@@ -1665,7 +1674,7 @@ function createSession(conversationId, environment, agentId, client, typingSigna
|
|
|
1665
1674
|
type: 'user',
|
|
1666
1675
|
message: {
|
|
1667
1676
|
role: 'user',
|
|
1668
|
-
content: 'You are
|
|
1677
|
+
content: 'You are assisting in an ongoing chat. Reply naturally to the latest participant.',
|
|
1669
1678
|
},
|
|
1670
1679
|
parent_tool_use_id: null,
|
|
1671
1680
|
},
|
|
@@ -2375,7 +2384,6 @@ export async function main() {
|
|
|
2375
2384
|
return;
|
|
2376
2385
|
}
|
|
2377
2386
|
session.activeSelfContextId = activeSelfContextId;
|
|
2378
|
-
const artifactDir = await ensureTurnArtifactDir(session.cwd, `claude-${m.id ?? randomUUID()}`);
|
|
2379
2387
|
const promptText = buildCanonPrompt({
|
|
2380
2388
|
content,
|
|
2381
2389
|
conversationId: input.conversationId,
|
|
@@ -2386,13 +2394,12 @@ export async function main() {
|
|
|
2386
2394
|
provenance: hydrated.provenance,
|
|
2387
2395
|
replyContext,
|
|
2388
2396
|
message: m,
|
|
2389
|
-
session,
|
|
2390
|
-
artifactDir,
|
|
2391
2397
|
});
|
|
2392
2398
|
const messageContent = await buildCanonUserContent({
|
|
2393
2399
|
promptText,
|
|
2394
2400
|
materialized: [...replyMedia.materialized, ...materialized],
|
|
2395
2401
|
});
|
|
2402
|
+
const artifactRoutingMode = resolveArtifactRoutingMode(participantContext);
|
|
2396
2403
|
session.enqueueInbound({
|
|
2397
2404
|
type: 'user',
|
|
2398
2405
|
message: {
|
|
@@ -2400,7 +2407,7 @@ export async function main() {
|
|
|
2400
2407
|
content: messageContent,
|
|
2401
2408
|
},
|
|
2402
2409
|
parent_tool_use_id: null,
|
|
2403
|
-
}, deliveryIntent, m.id ?? null, shouldMarkAccepted, isOwner,
|
|
2410
|
+
}, deliveryIntent, m.id ?? null, shouldMarkAccepted, isOwner, artifactRoutingMode);
|
|
2404
2411
|
if (m.id) {
|
|
2405
2412
|
saveRuntimeSessionState(runtimeId, {
|
|
2406
2413
|
conversationId: input.conversationId,
|
|
@@ -2568,7 +2575,6 @@ export async function main() {
|
|
|
2568
2575
|
return;
|
|
2569
2576
|
}
|
|
2570
2577
|
session.activeSelfContextId = activeSelfContextId;
|
|
2571
|
-
const artifactDir = await ensureTurnArtifactDir(session.cwd, `claude-${m.id ?? randomUUID()}`);
|
|
2572
2578
|
const promptText = buildCanonPrompt({
|
|
2573
2579
|
content,
|
|
2574
2580
|
conversationId: convoId,
|
|
@@ -2579,13 +2585,12 @@ export async function main() {
|
|
|
2579
2585
|
provenance: hydrated.provenance,
|
|
2580
2586
|
replyContext,
|
|
2581
2587
|
message: m,
|
|
2582
|
-
session,
|
|
2583
|
-
artifactDir,
|
|
2584
2588
|
});
|
|
2585
2589
|
const messageContent = await buildCanonUserContent({
|
|
2586
2590
|
promptText,
|
|
2587
2591
|
materialized: [...replyMedia.materialized, ...materialized],
|
|
2588
2592
|
});
|
|
2593
|
+
const artifactRoutingMode = resolveArtifactRoutingMode(participantContext);
|
|
2589
2594
|
session.enqueueInbound({
|
|
2590
2595
|
type: 'user',
|
|
2591
2596
|
message: {
|
|
@@ -2593,7 +2598,7 @@ export async function main() {
|
|
|
2593
2598
|
content: messageContent,
|
|
2594
2599
|
},
|
|
2595
2600
|
parent_tool_use_id: null,
|
|
2596
|
-
}, deliveryIntent, m.id ?? null, shouldMarkAccepted, isOwner,
|
|
2601
|
+
}, deliveryIntent, m.id ?? null, shouldMarkAccepted, isOwner, artifactRoutingMode);
|
|
2597
2602
|
if (m.id) {
|
|
2598
2603
|
saveRuntimeSessionState(runtimeId, {
|
|
2599
2604
|
conversationId: convoId,
|
package/dist/session-state.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { SDKUserMessage } from '@anthropic-ai/claude-agent-sdk';
|
|
2
2
|
import type { DeliveryIntent, ModelOption, TurnLifecycleState } from '@canonmsg/core';
|
|
3
|
+
import type { TurnArtifactSnapshot } from '@canonmsg/coding-agent-host';
|
|
3
4
|
export type ClaudeInputKind = 'seed' | 'canon';
|
|
5
|
+
export type ClaudeArtifactRoutingMode = 'workspace-generated' | 'disabled';
|
|
4
6
|
export interface ClaudeInputEnvelope {
|
|
5
7
|
kind: ClaudeInputKind;
|
|
6
8
|
msg: SDKUserMessage;
|
|
7
9
|
intent: DeliveryIntent;
|
|
8
10
|
sourceMessageId: string | null;
|
|
9
11
|
markAccepted: boolean;
|
|
10
|
-
|
|
12
|
+
artifactRoutingMode: ClaudeArtifactRoutingMode;
|
|
13
|
+
artifactBaseline: TurnArtifactSnapshot | null;
|
|
11
14
|
turnKey: string;
|
|
12
15
|
isOwnerTurn: boolean;
|
|
13
16
|
}
|
|
@@ -42,7 +45,8 @@ export declare function createClaudeInputEnvelope(input: {
|
|
|
42
45
|
intent?: DeliveryIntent;
|
|
43
46
|
sourceMessageId?: string | null;
|
|
44
47
|
markAccepted?: boolean;
|
|
45
|
-
|
|
48
|
+
artifactRoutingMode?: ClaudeArtifactRoutingMode;
|
|
49
|
+
artifactBaseline?: TurnArtifactSnapshot | null;
|
|
46
50
|
isOwnerTurn?: boolean;
|
|
47
51
|
}): ClaudeInputEnvelope;
|
|
48
52
|
export declare function buildClaudeFinalMessageId(input: {
|
package/dist/session-state.js
CHANGED
|
@@ -8,7 +8,8 @@ export function createClaudeInputEnvelope(input) {
|
|
|
8
8
|
intent: input.intent ?? 'queue',
|
|
9
9
|
sourceMessageId,
|
|
10
10
|
markAccepted: Boolean(input.markAccepted),
|
|
11
|
-
|
|
11
|
+
artifactRoutingMode: input.artifactRoutingMode ?? 'disabled',
|
|
12
|
+
artifactBaseline: input.artifactBaseline ?? null,
|
|
12
13
|
isOwnerTurn: input.kind === 'canon'
|
|
13
14
|
? input.isOwnerTurn === true
|
|
14
15
|
: input.isOwnerTurn !== false,
|
package/dist/tool-policy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const NON_OWNER_DENY_MESSAGE = 'Only the agent owner can authorize
|
|
1
|
+
const NON_OWNER_DENY_MESSAGE = 'Only the agent owner can authorize runtime tool use in this chat.';
|
|
2
2
|
const NATIVE_APPROVAL_UNAVAILABLE_MESSAGE = 'Runtime action approval is not available for this conversation.';
|
|
3
|
-
const NATIVE_APPROVAL_DENIED_MESSAGE = 'The agent owner denied this action
|
|
3
|
+
const NATIVE_APPROVAL_DENIED_MESSAGE = 'The agent owner denied this action.';
|
|
4
4
|
export const CLAUDE_NATIVE_APPROVAL_PERMISSION_MODE = 'default';
|
|
5
5
|
const SENSITIVE_CLAUDE_TOOLS = new Set([
|
|
6
6
|
'agent',
|
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.4",
|
|
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.
|
|
35
|
-
"@canonmsg/coding-agent-host": "^0.2.
|
|
36
|
-
"@canonmsg/core": "^2.
|
|
34
|
+
"@canonmsg/agent-sdk": "^3.3.1",
|
|
35
|
+
"@canonmsg/coding-agent-host": "^0.2.2",
|
|
36
|
+
"@canonmsg/core": "^2.8.1",
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|