@clawchatsai/connector 0.0.77 → 0.0.78
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 +11 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -413,18 +413,8 @@ function normalizeGatewayPayload(raw) {
|
|
|
413
413
|
parsed.params.message = '[Image]';
|
|
414
414
|
return JSON.stringify(parsed);
|
|
415
415
|
}
|
|
416
|
-
// Capability note: inform the agent that exec stdout lines starting with MEDIA:/path
|
|
417
|
-
// cause that file to appear inline in chat. Phrased descriptively (not imperatively)
|
|
418
|
-
// to avoid triggering prompt-injection scanners. Injected once per session (~8 tokens).
|
|
419
|
-
const sk = parsed.params.sessionKey || '';
|
|
420
|
-
if (sk.includes(':chat:') && !_hintedSessions.has(sk)) {
|
|
421
|
-
_hintedSessions.add(sk);
|
|
422
|
-
parsed.params.message += '\n[ClawChats: after using Write tool, run exec with: echo "MEDIA:/path/to/file" to surface it in chat]';
|
|
423
|
-
console.log(`[clawchats] capability-note injected for session ${sk}`);
|
|
424
|
-
return JSON.stringify(parsed);
|
|
425
|
-
}
|
|
426
416
|
// Save inline base64 attachments to disk so the agent can reference them as file paths.
|
|
427
|
-
// Runs
|
|
417
|
+
// Runs before capability note so a gateway restart doesn't prevent path injection.
|
|
428
418
|
if (Array.isArray(parsed.params?.attachments) && parsed.params.attachments.length > 0 && _uploadsDir) {
|
|
429
419
|
const skMatch = (parsed.params.sessionKey || '').match(/^agent:[^:]+:[^:]+:chat:([^:]+)$/);
|
|
430
420
|
const threadId = skMatch?.[1] || 'misc';
|
|
@@ -452,6 +442,16 @@ function normalizeGatewayPayload(raw) {
|
|
|
452
442
|
return JSON.stringify(parsed);
|
|
453
443
|
}
|
|
454
444
|
}
|
|
445
|
+
// Capability note: inform the agent that exec stdout lines starting with MEDIA:/path
|
|
446
|
+
// cause that file to appear inline in chat. Phrased descriptively (not imperatively)
|
|
447
|
+
// to avoid triggering prompt-injection scanners. Injected once per session (~8 tokens).
|
|
448
|
+
const sk = parsed.params.sessionKey || '';
|
|
449
|
+
if (sk.includes(':chat:') && !_hintedSessions.has(sk)) {
|
|
450
|
+
_hintedSessions.add(sk);
|
|
451
|
+
parsed.params.message += '\n[ClawChats: after using Write tool, run exec with: echo "MEDIA:/path/to/file" to surface it in chat]';
|
|
452
|
+
console.log(`[clawchats] capability-note injected for session ${sk}`);
|
|
453
|
+
return JSON.stringify(parsed);
|
|
454
|
+
}
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
catch {
|