@canonmsg/claude-code-plugin 0.14.7 → 0.14.8
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 -13
- package/dist/session-state.d.ts +1 -0
- package/dist/session-state.js +1 -0
- package/package.json +3 -3
package/dist/host.js
CHANGED
|
@@ -909,6 +909,7 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
|
|
|
909
909
|
turnState: 'idle',
|
|
910
910
|
currentTurnId: null,
|
|
911
911
|
currentTurnOpenedAt: null,
|
|
912
|
+
currentTurnUpdatedAt: null,
|
|
912
913
|
activeSelfContextId: null,
|
|
913
914
|
lastAcceptedIntent: null,
|
|
914
915
|
lastActivity: Date.now(),
|
|
@@ -1130,6 +1131,13 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
|
|
|
1130
1131
|
writeState();
|
|
1131
1132
|
}
|
|
1132
1133
|
function writeTurn() {
|
|
1134
|
+
const isOpenTurn = session.turnState === 'thinking'
|
|
1135
|
+
|| session.turnState === 'streaming'
|
|
1136
|
+
|| session.turnState === 'tool'
|
|
1137
|
+
|| session.turnState === 'waiting_input';
|
|
1138
|
+
if (isOpenTurn) {
|
|
1139
|
+
session.currentTurnUpdatedAt = Date.now();
|
|
1140
|
+
}
|
|
1133
1141
|
runtimeState.writeTurnState(conversationId, {
|
|
1134
1142
|
turnId: session.currentTurnId,
|
|
1135
1143
|
state: session.turnState,
|
|
@@ -1138,6 +1146,7 @@ function createSession(conversationId, environment, agentId, client, runtimeStat
|
|
|
1138
1146
|
lastAcceptedIntent: session.lastAcceptedIntent,
|
|
1139
1147
|
capabilities: CLAUDE_RUNTIME_CAPABILITIES,
|
|
1140
1148
|
...(session.currentTurnOpenedAt ? { openedAt: session.currentTurnOpenedAt } : {}),
|
|
1149
|
+
...(isOpenTurn && session.currentTurnUpdatedAt ? { turnUpdatedAt: session.currentTurnUpdatedAt } : {}),
|
|
1141
1150
|
...(session.turnState === 'idle' || session.turnState === 'completed' || session.turnState === 'interrupted'
|
|
1142
1151
|
? { completedAt: { '.sv': 'timestamp' } }
|
|
1143
1152
|
: {}),
|
|
@@ -1885,18 +1894,7 @@ export async function main() {
|
|
|
1885
1894
|
session.pendingInputs = session.pendingInputs.filter((input) => input.sourceMessageId !== sourceMessageId);
|
|
1886
1895
|
if (session.pendingInputs.length === before)
|
|
1887
1896
|
return;
|
|
1888
|
-
|
|
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(() => { });
|
|
1897
|
+
session.writeTurn();
|
|
1900
1898
|
}
|
|
1901
1899
|
function evictOldestIdle() {
|
|
1902
1900
|
let oldest = null;
|
|
@@ -2457,7 +2455,9 @@ export async function main() {
|
|
|
2457
2455
|
const heartbeat = setInterval(() => {
|
|
2458
2456
|
for (const session of sessions.values()) {
|
|
2459
2457
|
session.writeState();
|
|
2460
|
-
session.
|
|
2458
|
+
if (session.state.state !== 'running' && session.state.state !== 'requires_action') {
|
|
2459
|
+
session.writeTurn();
|
|
2460
|
+
}
|
|
2461
2461
|
}
|
|
2462
2462
|
void publishRuntimeHeartbeat();
|
|
2463
2463
|
}, HEARTBEAT_MS);
|
package/dist/session-state.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface ClaudeCompletedTurnState {
|
|
|
31
31
|
turnState: TurnLifecycleState;
|
|
32
32
|
currentTurnId: string | null;
|
|
33
33
|
currentTurnOpenedAt: number | null;
|
|
34
|
+
currentTurnUpdatedAt: number | null;
|
|
34
35
|
lastAcceptedIntent: DeliveryIntent | null;
|
|
35
36
|
}
|
|
36
37
|
export declare function createClaudeInputEnvelope(input: {
|
package/dist/session-state.js
CHANGED
|
@@ -36,6 +36,7 @@ export function resetClaudeCompletedTurnState(session) {
|
|
|
36
36
|
session.state.state = 'idle';
|
|
37
37
|
session.currentTurnId = null;
|
|
38
38
|
session.currentTurnOpenedAt = null;
|
|
39
|
+
session.currentTurnUpdatedAt = null;
|
|
39
40
|
session.lastAcceptedIntent = null;
|
|
40
41
|
session.pendingFinalText = null;
|
|
41
42
|
session.pendingFinalDelivery = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/claude-code-plugin",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.8",
|
|
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.
|
|
35
|
-
"@canonmsg/core": "^0.
|
|
34
|
+
"@canonmsg/agent-sdk": "^1.5.3",
|
|
35
|
+
"@canonmsg/core": "^0.20.0",
|
|
36
36
|
"@modelcontextprotocol/sdk": "^1.12.0"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|