@adhdev/daemon-standalone 0.9.76-rc.27 → 0.9.76-rc.28

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.27",
3
+ "version": "0.9.76-rc.28",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -56572,7 +56572,16 @@ async function findNodeWithRefresh(ctx, nodeId) {
56572
56572
  return refreshed;
56573
56573
  }
56574
56574
  function unwrapCommandPayload(value) {
56575
- return value?.result?.result ?? value?.result ?? value;
56575
+ let current = value;
56576
+ const seen = /* @__PURE__ */ new Set();
56577
+ for (let depth = 0; depth < 8; depth += 1) {
56578
+ if (!current || typeof current !== "object" || seen.has(current)) break;
56579
+ seen.add(current);
56580
+ const nested = current.result ?? current.payload;
56581
+ if (!nested || typeof nested !== "object") break;
56582
+ current = nested;
56583
+ }
56584
+ return current;
56576
56585
  }
56577
56586
  function findNestedPayload(value, predicate) {
56578
56587
  const seen = /* @__PURE__ */ new Set();
@@ -56822,11 +56831,20 @@ async function meshSendTask(ctx, args) {
56822
56831
  return JSON.stringify({ error: `Node '${args.node_id}' is read-only` });
56823
56832
  }
56824
56833
  if (isLocalTransport(ctx.transport)) {
56825
- await commandForNode(ctx, node, "send_chat", {
56834
+ const result = await commandForNode(ctx, node, "send_chat", {
56826
56835
  message: args.message,
56827
56836
  sessionId: args.session_id,
56828
56837
  targetSessionId: args.session_id
56829
56838
  });
56839
+ const payload = unwrapCommandPayload(result);
56840
+ if (payload?.success === false) {
56841
+ return JSON.stringify({
56842
+ success: false,
56843
+ nodeId: args.node_id,
56844
+ sessionId: args.session_id,
56845
+ error: payload.error || "send_chat failed"
56846
+ });
56847
+ }
56830
56848
  return JSON.stringify({ success: true, nodeId: args.node_id, sessionId: args.session_id });
56831
56849
  } else {
56832
56850
  return JSON.stringify({ error: "Cloud mesh send_task not yet implemented" });
@@ -56840,11 +56858,13 @@ async function meshReadChat(ctx, args) {
56840
56858
  const result = await commandForNode(ctx, node, "read_chat", {
56841
56859
  sessionId: args.session_id,
56842
56860
  targetSessionId: args.session_id,
56861
+ workspace: node.workspace,
56843
56862
  ...cached2?.providerType ? { agentType: cached2.providerType, providerType: cached2.providerType } : {},
56844
56863
  ...providerSessionId ? { providerSessionId } : {},
56845
56864
  tailLimit: args.tail ?? 10
56846
56865
  });
56847
- return JSON.stringify(result, null, 2);
56866
+ const payload = unwrapCommandPayload(result);
56867
+ return JSON.stringify(payload, null, 2);
56848
56868
  } else {
56849
56869
  return JSON.stringify({ error: "Cloud mesh read_chat not yet implemented" });
56850
56870
  }