@clawchatsai/connector 0.0.65 → 0.0.67

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 +12 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -388,6 +388,8 @@ async function stopClawChats(ctx) {
388
388
  * guard checks MediaPath/MediaPaths but not inline base64 attachments).
389
389
  * Injecting a minimal placeholder ensures the agent run proceeds.
390
390
  */
391
+ // Track which ClawChats thread sessions have received the capability note (once per session).
392
+ const _hintedSessions = new Set();
391
393
  function normalizeGatewayPayload(raw) {
392
394
  try {
393
395
  const parsed = JSON.parse(raw);
@@ -409,6 +411,16 @@ function normalizeGatewayPayload(raw) {
409
411
  parsed.params.message = '[Image]';
410
412
  return JSON.stringify(parsed);
411
413
  }
414
+ // Capability note: inform the agent that exec stdout lines starting with MEDIA:/path
415
+ // cause that file to appear inline in chat. Phrased descriptively (not imperatively)
416
+ // to avoid triggering prompt-injection scanners. Injected once per session (~8 tokens).
417
+ const sk = parsed.params.sessionKey || '';
418
+ if (sk.includes(':chat:') && !_hintedSessions.has(sk)) {
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]';
421
+ console.log(`[clawchats] capability-note injected for session ${sk}`);
422
+ return JSON.stringify(parsed);
423
+ }
412
424
  }
413
425
  }
414
426
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawchatsai/connector",
3
- "version": "0.0.65",
3
+ "version": "0.0.67",
4
4
  "type": "module",
5
5
  "description": "ClawChats OpenClaw plugin — P2P tunnel + local API bridge",
6
6
  "main": "dist/index.js",