@adhdev/daemon-standalone 0.9.82-rc.227 → 0.9.82-rc.228

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/index.js CHANGED
@@ -52418,7 +52418,7 @@ ${effect.notification.body || ""}`.trim();
52418
52418
  mode: state.mode,
52419
52419
  resume: state.resume,
52420
52420
  activeChat,
52421
- ...state.activeInteractivePrompt ? { activeInteractivePrompt: state.activeInteractivePrompt } : {},
52421
+ activeInteractivePrompt: state.activeInteractivePrompt ?? null,
52422
52422
  ...summaryMetadata && { summaryMetadata },
52423
52423
  ...includeSessionMetadata && {
52424
52424
  capabilities: state.mode === "terminal" ? PTY_SESSION_CAPABILITIES : CLI_CHAT_SESSION_CAPABILITIES,
@@ -52433,7 +52433,8 @@ ${effect.notification.body || ""}`.trim();
52433
52433
  lastUpdated: state.lastUpdated,
52434
52434
  settings: state.settings,
52435
52435
  ...coordinator && { coordinator },
52436
- ...meshQueueStats && { meshQueueStats }
52436
+ ...meshQueueStats && { meshQueueStats },
52437
+ ...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
52437
52438
  };
52438
52439
  }
52439
52440
  function buildAcpSession(state, options) {
@@ -52473,7 +52474,8 @@ ${effect.notification.body || ""}`.trim();
52473
52474
  lastUpdated: state.lastUpdated,
52474
52475
  settings: state.settings,
52475
52476
  ...coordinator && { coordinator },
52476
- ...meshQueueStats && { meshQueueStats }
52477
+ ...meshQueueStats && { meshQueueStats },
52478
+ ...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
52477
52479
  };
52478
52480
  }
52479
52481
  function buildSessionEntries(allStates, cdpManagers, options = {}) {
@@ -73337,14 +73339,27 @@ ${tail}` : ""
73337
73339
  const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
73338
73340
  let workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
73339
73341
  let submoduleIgnorePaths = Array.isArray(args?.submoduleIgnorePaths) ? args.submoduleIgnorePaths.filter((value) => typeof value === "string") : void 0;
73340
- if (!workspace && meshId && nodeId) {
73342
+ let nodeDaemonId;
73343
+ if (meshId && nodeId) {
73341
73344
  const meshRecord = await this.getMeshForCommand(meshId, args?.inlineMesh);
73342
73345
  const mesh = meshRecord?.mesh;
73343
73346
  const node = mesh?.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
73344
- workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
73347
+ if (!workspace) {
73348
+ workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
73349
+ }
73345
73350
  if (!submoduleIgnorePaths && Array.isArray(node?.policy?.submoduleIgnorePaths)) {
73346
73351
  submoduleIgnorePaths = node.policy.submoduleIgnorePaths.filter((value) => typeof value === "string");
73347
73352
  }
73353
+ nodeDaemonId = typeof node?.daemonId === "string" ? node.daemonId.trim() : void 0;
73354
+ }
73355
+ const selfDaemonId = this.deps.statusInstanceId;
73356
+ const isRemote = nodeDaemonId && selfDaemonId && nodeDaemonId !== selfDaemonId;
73357
+ if (isRemote && this.deps.dispatchMeshCommand) {
73358
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "fast_forward_mesh_node", {
73359
+ ...typeof args === "object" && args !== null ? args : {},
73360
+ workspace
73361
+ });
73362
+ return forwarded ?? { success: false, error: "no response from remote node" };
73348
73363
  }
73349
73364
  const result = await fastForwardMeshNode({
73350
73365
  meshId: meshId || void 0,
@@ -73382,6 +73397,14 @@ ${tail}` : ""
73382
73397
  }
73383
73398
  let worktreeCleanup;
73384
73399
  if (node?.isLocalWorktree) {
73400
+ const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
73401
+ const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
73402
+ if (isRemoteWorktree) {
73403
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
73404
+ ...typeof args === "object" && args !== null ? args : {}
73405
+ });
73406
+ return forwarded ?? { success: false, error: "no response from remote node" };
73407
+ }
73385
73408
  const cleanupResult = await this.cleanupLocalWorktreeNode({ mesh, node, nodeId, force: args?.force === true });
73386
73409
  if (cleanupResult.success === false) {
73387
73410
  return {
@@ -73448,6 +73471,13 @@ ${tail}` : ""
73448
73471
  if (!mesh) return { success: false, error: "Mesh not found" };
73449
73472
  const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
73450
73473
  if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
73474
+ const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
73475
+ if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
73476
+ const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
73477
+ ...typeof args === "object" && args !== null ? args : {}
73478
+ });
73479
+ return forwarded ?? { success: false, error: "no response from remote node" };
73480
+ }
73451
73481
  const repoRoot = sourceNode.repoRoot || sourceNode.workspace;
73452
73482
  const { createWorktree: createWorktree2 } = await Promise.resolve().then(() => (init_git_worktree(), git_worktree_exports));
73453
73483
  const result = await createWorktree2({
@@ -73680,6 +73710,13 @@ ${tail}` : ""
73680
73710
  const node = mesh.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
73681
73711
  if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
73682
73712
  if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
73713
+ const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
73714
+ if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
73715
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
73716
+ ...typeof args === "object" && args !== null ? args : {}
73717
+ });
73718
+ return forwarded ?? { success: false, error: "no response from remote node" };
73719
+ }
73683
73720
  const currentBootstrap = node.worktreeBootstrap;
73684
73721
  if (currentBootstrap?.status === "running") {
73685
73722
  return { success: false, error: "Bootstrap is already running for this node" };