@lightcone-ai/daemon 0.15.37 → 0.15.38
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/package.json +1 -1
- package/src/chat-bridge.js +13 -1
package/package.json
CHANGED
package/src/chat-bridge.js
CHANGED
|
@@ -426,10 +426,22 @@ function cacheKeyFor(method, apiPath, body, {
|
|
|
426
426
|
return createHash('sha256').update(payload, 'utf8').digest('hex');
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
const DATA_URI_PREFIX = 'data:';
|
|
430
|
+
const GOVERNANCE_BINARY_PLACEHOLDER = '[binary content stripped]';
|
|
431
|
+
|
|
432
|
+
function stripBinaryContent(body) {
|
|
433
|
+
if (!body || typeof body !== 'object' || Array.isArray(body)) return body;
|
|
434
|
+
const stripped = { ...body };
|
|
435
|
+
if (typeof stripped.content === 'string' && stripped.content.startsWith(DATA_URI_PREFIX)) {
|
|
436
|
+
stripped.content = GOVERNANCE_BINARY_PLACEHOLDER;
|
|
437
|
+
}
|
|
438
|
+
return stripped;
|
|
439
|
+
}
|
|
440
|
+
|
|
429
441
|
function toolInputFor(apiPath, body) {
|
|
430
442
|
return {
|
|
431
443
|
...queryParamsFromPath(apiPath),
|
|
432
|
-
...(body && typeof body === 'object' ? body : {}),
|
|
444
|
+
...stripBinaryContent(body && typeof body === 'object' ? body : {}),
|
|
433
445
|
};
|
|
434
446
|
}
|
|
435
447
|
|