@clawchatsai/connector 0.0.67 → 0.0.68
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/index.js +10 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1110,6 +1110,16 @@ const plugin = {
|
|
|
1110
1110
|
// Capture MEDIA: paths from exec tool results before the gateway strips them from message text.
|
|
1111
1111
|
// Fires after every tool call; we filter to exec only and check for MEDIA: lines.
|
|
1112
1112
|
// Uses api.on() — the correct public API for typed lifecycle hooks (NOT registerTypedHook).
|
|
1113
|
+
// Re-arm the capability note after compaction so the agent regains MEDIA: knowledge.
|
|
1114
|
+
// Post-compaction the injected note is gone from context; clearing the session key
|
|
1115
|
+
// causes it to re-inject on the next user message.
|
|
1116
|
+
api.on('after_compaction', (_event, ctx) => {
|
|
1117
|
+
const sessionKey = ctx.sessionKey;
|
|
1118
|
+
if (sessionKey) {
|
|
1119
|
+
_hintedSessions.delete(sessionKey);
|
|
1120
|
+
console.log(`[clawchats] compaction detected — capability note re-armed for ${sessionKey}`);
|
|
1121
|
+
}
|
|
1122
|
+
}, { name: 'clawchats-rearm-after-compaction', description: 'Re-arms MEDIA: capability note after context compaction' });
|
|
1113
1123
|
api.on('after_tool_call', (event, ctx) => {
|
|
1114
1124
|
if (event.toolName !== 'exec' && event.toolName !== 'process')
|
|
1115
1125
|
return;
|