@clawchatsai/connector 0.0.67 → 0.0.69

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -417,7 +417,7 @@ function normalizeGatewayPayload(raw) {
417
417
  const sk = parsed.params.sessionKey || '';
418
418
  if (sk.includes(':chat:') && !_hintedSessions.has(sk)) {
419
419
  _hintedSessions.add(sk);
420
- parsed.params.message += '\n[ClawChats: files reach the chat UI when exec outputs MEDIA:/path works after Write tool too]';
420
+ parsed.params.message += '\n[ClawChats: after using Write tool, run exec with: echo "MEDIA:/path/to/file" to surface it in chat]';
421
421
  console.log(`[clawchats] capability-note injected for session ${sk}`);
422
422
  return JSON.stringify(parsed);
423
423
  }
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawchatsai/connector",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "type": "module",
5
5
  "description": "ClawChats OpenClaw plugin — P2P tunnel + local API bridge",
6
6
  "main": "dist/index.js",