@canonmsg/claude-code-plugin 0.34.2 → 0.34.3
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/.claude-plugin/plugin.json +1 -1
- package/dist/host.js +9 -171
- package/package.json +3 -3
package/dist/host.js
CHANGED
|
@@ -431,14 +431,6 @@ function resolveWorkspaceCwd() {
|
|
|
431
431
|
defaultCwd: workingDir,
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
|
-
function resolveExecutionFallbackReason(environment) {
|
|
435
|
-
if (!environment?.reason || environment.mode !== 'locked') {
|
|
436
|
-
return null;
|
|
437
|
-
}
|
|
438
|
-
return environment.reason === 'Sharing the base workspace (locked mode)'
|
|
439
|
-
? null
|
|
440
|
-
: environment.reason;
|
|
441
|
-
}
|
|
442
434
|
async function detectRuntimeModels(cwd) {
|
|
443
435
|
const discovered = await detectRuntimeModelsForSelection(cwd, 'default');
|
|
444
436
|
const supplemental = await detectSupplementalRuntimeModels(cwd, deriveClaudeSupplementalModelProbes(discovered));
|
|
@@ -559,147 +551,6 @@ async function readApprovalDiffPreImage(filePath) {
|
|
|
559
551
|
throw error;
|
|
560
552
|
}
|
|
561
553
|
}
|
|
562
|
-
function mapClaudeMcpStatus(status) {
|
|
563
|
-
switch (status) {
|
|
564
|
-
case 'connected':
|
|
565
|
-
return 'ready';
|
|
566
|
-
case 'needs-auth':
|
|
567
|
-
return 'auth_needed';
|
|
568
|
-
case 'disabled':
|
|
569
|
-
return 'configured';
|
|
570
|
-
case 'failed':
|
|
571
|
-
return 'error';
|
|
572
|
-
default:
|
|
573
|
-
return 'unknown';
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
function buildClaudeRuntimeInfo(input) {
|
|
577
|
-
const { descriptor, metadata } = input;
|
|
578
|
-
const statusItems = [
|
|
579
|
-
metadata.account?.email
|
|
580
|
-
? {
|
|
581
|
-
id: 'account',
|
|
582
|
-
label: 'Account',
|
|
583
|
-
value: 'Connected',
|
|
584
|
-
tone: 'success',
|
|
585
|
-
tier: 'diagnostic',
|
|
586
|
-
}
|
|
587
|
-
: null,
|
|
588
|
-
metadata.account?.subscriptionType
|
|
589
|
-
? {
|
|
590
|
-
id: 'subscription',
|
|
591
|
-
label: 'Plan',
|
|
592
|
-
value: metadata.account.subscriptionType,
|
|
593
|
-
}
|
|
594
|
-
: null,
|
|
595
|
-
metadata.account?.apiProvider
|
|
596
|
-
? {
|
|
597
|
-
id: 'provider',
|
|
598
|
-
label: 'Provider',
|
|
599
|
-
value: metadata.account.apiProvider,
|
|
600
|
-
}
|
|
601
|
-
: null,
|
|
602
|
-
metadata.account?.tokenSource || metadata.account?.apiKeySource
|
|
603
|
-
? {
|
|
604
|
-
id: 'auth',
|
|
605
|
-
label: 'Auth',
|
|
606
|
-
value: metadata.account.tokenSource ?? metadata.account?.apiKeySource ?? 'connected',
|
|
607
|
-
tier: 'diagnostic',
|
|
608
|
-
}
|
|
609
|
-
: null,
|
|
610
|
-
runtimeModels[0]
|
|
611
|
-
? {
|
|
612
|
-
id: 'fallbackModel',
|
|
613
|
-
label: 'Fallback model',
|
|
614
|
-
value: runtimeModels[0].label,
|
|
615
|
-
tier: 'diagnostic',
|
|
616
|
-
source: 'host-default',
|
|
617
|
-
}
|
|
618
|
-
: null,
|
|
619
|
-
{
|
|
620
|
-
id: 'toolPolicy',
|
|
621
|
-
label: 'Tool policy',
|
|
622
|
-
value: 'Claude Code preset',
|
|
623
|
-
tier: 'detail',
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
id: 'browser',
|
|
627
|
-
label: 'Browser tools',
|
|
628
|
-
value: 'Runtime policy',
|
|
629
|
-
tier: 'detail',
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
id: 'mediaOut',
|
|
633
|
-
label: 'Media out',
|
|
634
|
-
value: 'Generated media artifacts',
|
|
635
|
-
tier: 'detail',
|
|
636
|
-
},
|
|
637
|
-
].filter((item) => Boolean(item));
|
|
638
|
-
return {
|
|
639
|
-
descriptor,
|
|
640
|
-
surfaceMode: 'host',
|
|
641
|
-
statusItems,
|
|
642
|
-
inventories: [
|
|
643
|
-
{
|
|
644
|
-
id: 'mcp',
|
|
645
|
-
label: 'MCP',
|
|
646
|
-
entries: metadata.mcpServers.map((server) => ({
|
|
647
|
-
id: server.name,
|
|
648
|
-
label: server.name,
|
|
649
|
-
status: mapClaudeMcpStatus(server.status),
|
|
650
|
-
description: server.error
|
|
651
|
-
?? server.serverInfo?.version
|
|
652
|
-
?? server.scope
|
|
653
|
-
?? undefined,
|
|
654
|
-
})),
|
|
655
|
-
tier: 'diagnostic',
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
id: 'plugins',
|
|
659
|
-
label: 'Plugins',
|
|
660
|
-
entries: metadata.plugins.map((plugin) => ({
|
|
661
|
-
id: plugin.name,
|
|
662
|
-
label: plugin.name,
|
|
663
|
-
status: 'configured',
|
|
664
|
-
description: plugin.source ?? plugin.path,
|
|
665
|
-
})),
|
|
666
|
-
tier: 'diagnostic',
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
id: 'commands',
|
|
670
|
-
label: 'Commands',
|
|
671
|
-
entries: metadata.commands.map((command) => ({
|
|
672
|
-
id: command.name,
|
|
673
|
-
label: command.name.startsWith('/') ? command.name : `/${command.name}`,
|
|
674
|
-
status: 'configured',
|
|
675
|
-
description: command.description ?? command.argumentHint ?? undefined,
|
|
676
|
-
})),
|
|
677
|
-
tier: 'diagnostic',
|
|
678
|
-
},
|
|
679
|
-
{
|
|
680
|
-
id: 'agents',
|
|
681
|
-
label: 'Agents',
|
|
682
|
-
entries: metadata.agents.map((agent) => ({
|
|
683
|
-
id: agent.name,
|
|
684
|
-
label: agent.name,
|
|
685
|
-
status: 'configured',
|
|
686
|
-
description: agent.description ?? agent.model ?? undefined,
|
|
687
|
-
})),
|
|
688
|
-
tier: 'diagnostic',
|
|
689
|
-
},
|
|
690
|
-
],
|
|
691
|
-
execution: {
|
|
692
|
-
resolvedWorkspaceLabel: input.workspaceLabel,
|
|
693
|
-
resolvedCwd: input.resolvedCwd,
|
|
694
|
-
workspaceRootId: input.workspaceRootId ?? null,
|
|
695
|
-
workspaceRelativePath: input.workspaceRelativePath ?? null,
|
|
696
|
-
executionMode: input.executionMode,
|
|
697
|
-
executionBranch: input.executionBranch,
|
|
698
|
-
worktreePath: input.worktreePath,
|
|
699
|
-
fallbackReason: input.fallbackReason,
|
|
700
|
-
},
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
554
|
// ── Constants ───────────────────────────────────────────────────────
|
|
704
555
|
const MAX_SESSIONS = 5;
|
|
705
556
|
// IDLE_TIMEOUT_MS (30 minutes) is shared with the other coding-agent hosts.
|
|
@@ -2541,12 +2392,11 @@ export async function main() {
|
|
|
2541
2392
|
if (signal.aborted)
|
|
2542
2393
|
return;
|
|
2543
2394
|
const activeSessionQuery = sessions.values().next().value?.query ?? null;
|
|
2544
|
-
|
|
2395
|
+
await refreshClaudeRuntimeMetadata({
|
|
2545
2396
|
cwd: workingDir,
|
|
2546
2397
|
activeQuery: activeSessionQuery,
|
|
2547
2398
|
}).catch((error) => {
|
|
2548
2399
|
console.error('[canon-host] Failed to refresh Claude runtime metadata:', error);
|
|
2549
|
-
return runtimeMetadata;
|
|
2550
2400
|
});
|
|
2551
2401
|
if (signal.aborted)
|
|
2552
2402
|
return;
|
|
@@ -2570,27 +2420,18 @@ export async function main() {
|
|
|
2570
2420
|
if (signal.aborted)
|
|
2571
2421
|
return;
|
|
2572
2422
|
const results = await Promise.allSettled(Array.from(knownConversationIds).map(async (conversationId) => {
|
|
2573
|
-
const session = sessions.get(conversationId);
|
|
2574
|
-
const workspaceId = session
|
|
2575
|
-
? resolveWorkspaceIdForBaseCwd(session.environment.baseCwd)
|
|
2576
|
-
: runtimeDescriptor.defaultWorkspaceId;
|
|
2577
|
-
const workspace = workspaceOptions.find((option) => option.id === workspaceId) ?? null;
|
|
2578
2423
|
const descriptor = runtimeDescriptor.runtimeDescriptor;
|
|
2579
2424
|
if (!descriptor)
|
|
2580
2425
|
return;
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
executionBranch: session?.environment.branch ?? null,
|
|
2590
|
-
worktreePath: session?.environment.worktreePath ?? null,
|
|
2591
|
-
fallbackReason: resolveExecutionFallbackReason(session?.environment),
|
|
2426
|
+
await runtimeState.writeRuntimeInfo(conversationId, {
|
|
2427
|
+
surfaceMode: 'host',
|
|
2428
|
+
descriptor: {
|
|
2429
|
+
coreControls: [],
|
|
2430
|
+
supportsInterrupt: descriptor.supportsInterrupt,
|
|
2431
|
+
supportsInputInterrupt: descriptor.supportsInputInterrupt,
|
|
2432
|
+
streamingTextMode: descriptor.streamingTextMode,
|
|
2433
|
+
},
|
|
2592
2434
|
});
|
|
2593
|
-
await runtimeState.writeRuntimeInfo(conversationId, payload);
|
|
2594
2435
|
}));
|
|
2595
2436
|
const failure = results.find((result) => result.status === 'rejected');
|
|
2596
2437
|
if (failure?.status === 'rejected')
|
|
@@ -2715,9 +2556,6 @@ export async function main() {
|
|
|
2715
2556
|
client,
|
|
2716
2557
|
conversationCache,
|
|
2717
2558
|
});
|
|
2718
|
-
function resolveWorkspaceIdForBaseCwd(baseCwd) {
|
|
2719
|
-
return workspaceOptions.find((option) => option.cwd === baseCwd)?.id;
|
|
2720
|
-
}
|
|
2721
2559
|
async function refreshKnownConversationIds(force = false) {
|
|
2722
2560
|
if (!force && Date.now() - lastKnownConversationRefreshAt < HEARTBEAT_MS) {
|
|
2723
2561
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/claude-code-plugin",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.3",
|
|
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,10 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@anthropic-ai/claude-agent-sdk": "0.3.228",
|
|
34
|
-
"@canonmsg/agent-sdk": "^10.2.
|
|
34
|
+
"@canonmsg/agent-sdk": "^10.2.1",
|
|
35
35
|
"@canonmsg/agent-tools": "^0.9.0",
|
|
36
36
|
"@canonmsg/coding-agent-host": "^0.7.0",
|
|
37
|
-
"@canonmsg/core": "^12.
|
|
37
|
+
"@canonmsg/core": "^12.3.0",
|
|
38
38
|
"@canonmsg/rich-cards": "^0.10.4",
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.30.0"
|
|
40
40
|
},
|