@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/chat-bridge.js +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.15.37",
3
+ "version": "0.15.38",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -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