@nekzus/liop 2.4.0 → 2.4.1

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/bin/agent.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { LiopServer } from '../chunk-UBOQZVV5.js';
2
+ import { LiopServer } from '../chunk-DPW7RMAS.js';
3
3
  import '../chunk-JIJPZFR2.js';
4
4
  import { LiopMcpRouter } from '../chunk-GKV6M2PQ.js';
5
5
  import '../chunk-32ADSAJS.js';
package/dist/bridge.js CHANGED
@@ -1,4 +1,4 @@
1
- export { LiopMcpBridge, LiopStreamBridge } from './chunk-4LQPDN3W.js';
1
+ export { LiopMcpBridge, LiopStreamBridge } from './chunk-OLG56LGQ.js';
2
2
  import './chunk-PYKRQAER.js';
3
3
  import './chunk-72MNYFR6.js';
4
4
  //# sourceMappingURL=bridge.js.map
@@ -3363,7 +3363,7 @@ Data structure: ${schemaDigest}. Full schema: resource ${uri}. Guidelines: resou
3363
3363
  resetFieldBudget(clientId, toolName) {
3364
3364
  if (clientId === "__proto__" || clientId === "constructor" || clientId === "prototype" || toolName && (toolName === "__proto__" || toolName === "constructor" || toolName === "prototype")) {
3365
3365
  log.warn(
3366
- `[LiopServer] Blocked resetFieldBudget call due to prototype pollution keys.`
3366
+ `[LiopServer] Rejected resetFieldBudget for unsafe clientId/toolName: ${clientId}`
3367
3367
  );
3368
3368
  return;
3369
3369
  }
@@ -3380,10 +3380,10 @@ Data structure: ${schemaDigest}. Full schema: resource ${uri}. Guidelines: resou
3380
3380
  try {
3381
3381
  this.executeWithBudgetLock(storePath, (budget) => {
3382
3382
  if (toolName) {
3383
- if (budget[clientId]) {
3383
+ if (Object.hasOwn(budget, clientId) && budget[clientId]) {
3384
3384
  delete budget[clientId][toolName];
3385
3385
  }
3386
- } else {
3386
+ } else if (Object.hasOwn(budget, clientId)) {
3387
3387
  delete budget[clientId];
3388
3388
  }
3389
3389
  return { result: void 0, updatedBudget: budget };
@@ -3401,12 +3401,22 @@ Data structure: ${schemaDigest}. Full schema: resource ${uri}. Guidelines: resou
3401
3401
  getPersistentBudget(storePath) {
3402
3402
  try {
3403
3403
  if (!fs2.existsSync(storePath)) {
3404
- return {};
3404
+ return /* @__PURE__ */ Object.create(null);
3405
3405
  }
3406
3406
  const content = fs2.readFileSync(storePath, "utf-8");
3407
- return JSON.parse(content || "{}");
3407
+ const parsed = JSON.parse(content || "{}");
3408
+ if (parsed && typeof parsed === "object") {
3409
+ const clean = /* @__PURE__ */ Object.create(null);
3410
+ for (const [k, v] of Object.entries(parsed)) {
3411
+ if (k !== "__proto__" && k !== "constructor" && k !== "prototype") {
3412
+ clean[k] = v;
3413
+ }
3414
+ }
3415
+ return clean;
3416
+ }
3417
+ return /* @__PURE__ */ Object.create(null);
3408
3418
  } catch {
3409
- return {};
3419
+ return /* @__PURE__ */ Object.create(null);
3410
3420
  }
3411
3421
  }
3412
3422
  savePersistentBudget(storePath, budget) {
@@ -3504,5 +3514,5 @@ Data structure: ${schemaDigest}. Full schema: resource ${uri}. Guidelines: resou
3504
3514
  };
3505
3515
 
3506
3516
  export { AUTH_DEFAULTS, AuditLogger, GENESIS_HASH, JwtValidator, LiopRpcServer, LiopServer, NerScanner, PII_PATTERNS, PII_PRESETS, PiiScanner, computeEntryHash, createOAuthServer, globalAuditLogger };
3507
- //# sourceMappingURL=chunk-UBOQZVV5.js.map
3508
- //# sourceMappingURL=chunk-UBOQZVV5.js.map
3517
+ //# sourceMappingURL=chunk-DPW7RMAS.js.map
3518
+ //# sourceMappingURL=chunk-DPW7RMAS.js.map