@adhdev/daemon-standalone 0.9.76-rc.20 → 0.9.76-rc.21

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.76-rc.20",
3
+ "version": "0.9.76-rc.21",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -56385,11 +56385,16 @@ function unwrapCommandPayload(value) {
56385
56385
  return value?.result?.result ?? value?.result ?? value;
56386
56386
  }
56387
56387
  function findNestedPayload(value, predicate) {
56388
- let cursor = value;
56389
- for (let depth = 0; depth < 8; depth += 1) {
56390
- if (predicate(cursor)) return cursor;
56391
- if (!cursor || typeof cursor !== "object" || !("result" in cursor)) break;
56392
- cursor = cursor.result;
56388
+ const seen = /* @__PURE__ */ new Set();
56389
+ const stack = [{ payload: value, depth: 0 }];
56390
+ while (stack.length) {
56391
+ const { payload, depth } = stack.pop();
56392
+ if (predicate(payload)) return payload;
56393
+ if (!payload || typeof payload !== "object" || seen.has(payload) || depth >= 8) continue;
56394
+ seen.add(payload);
56395
+ for (const key of ["payload", "result"]) {
56396
+ if (key in payload) stack.push({ payload: payload[key], depth: depth + 1 });
56397
+ }
56393
56398
  }
56394
56399
  return value;
56395
56400
  }