@adhdev/daemon-core 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.mjs CHANGED
@@ -22436,7 +22436,7 @@ function buildCliSession(state, options) {
22436
22436
  mode: state.mode,
22437
22437
  resume: state.resume,
22438
22438
  activeChat,
22439
- ...state.activeInteractivePrompt ? { activeInteractivePrompt: state.activeInteractivePrompt } : {},
22439
+ activeInteractivePrompt: state.activeInteractivePrompt ?? null,
22440
22440
  ...summaryMetadata && { summaryMetadata },
22441
22441
  ...includeSessionMetadata && {
22442
22442
  capabilities: state.mode === "terminal" ? PTY_SESSION_CAPABILITIES : CLI_CHAT_SESSION_CAPABILITIES,
@@ -22451,7 +22451,8 @@ function buildCliSession(state, options) {
22451
22451
  lastUpdated: state.lastUpdated,
22452
22452
  settings: state.settings,
22453
22453
  ...coordinator && { coordinator },
22454
- ...meshQueueStats && { meshQueueStats }
22454
+ ...meshQueueStats && { meshQueueStats },
22455
+ ...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
22455
22456
  };
22456
22457
  }
22457
22458
  function buildAcpSession(state, options) {
@@ -22491,7 +22492,8 @@ function buildAcpSession(state, options) {
22491
22492
  lastUpdated: state.lastUpdated,
22492
22493
  settings: state.settings,
22493
22494
  ...coordinator && { coordinator },
22494
- ...meshQueueStats && { meshQueueStats }
22495
+ ...meshQueueStats && { meshQueueStats },
22496
+ ...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
22495
22497
  };
22496
22498
  }
22497
22499
  function buildSessionEntries(allStates, cdpManagers, options = {}) {
@@ -43466,14 +43468,27 @@ ${tail}` : ""
43466
43468
  const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
43467
43469
  let workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
43468
43470
  let submoduleIgnorePaths = Array.isArray(args?.submoduleIgnorePaths) ? args.submoduleIgnorePaths.filter((value) => typeof value === "string") : void 0;
43469
- if (!workspace && meshId && nodeId) {
43471
+ let nodeDaemonId;
43472
+ if (meshId && nodeId) {
43470
43473
  const meshRecord = await this.getMeshForCommand(meshId, args?.inlineMesh);
43471
43474
  const mesh = meshRecord?.mesh;
43472
43475
  const node = mesh?.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
43473
- workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
43476
+ if (!workspace) {
43477
+ workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
43478
+ }
43474
43479
  if (!submoduleIgnorePaths && Array.isArray(node?.policy?.submoduleIgnorePaths)) {
43475
43480
  submoduleIgnorePaths = node.policy.submoduleIgnorePaths.filter((value) => typeof value === "string");
43476
43481
  }
43482
+ nodeDaemonId = typeof node?.daemonId === "string" ? node.daemonId.trim() : void 0;
43483
+ }
43484
+ const selfDaemonId = this.deps.statusInstanceId;
43485
+ const isRemote = nodeDaemonId && selfDaemonId && nodeDaemonId !== selfDaemonId;
43486
+ if (isRemote && this.deps.dispatchMeshCommand) {
43487
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "fast_forward_mesh_node", {
43488
+ ...typeof args === "object" && args !== null ? args : {},
43489
+ workspace
43490
+ });
43491
+ return forwarded ?? { success: false, error: "no response from remote node" };
43477
43492
  }
43478
43493
  const result = await fastForwardMeshNode({
43479
43494
  meshId: meshId || void 0,
@@ -43511,6 +43526,14 @@ ${tail}` : ""
43511
43526
  }
43512
43527
  let worktreeCleanup;
43513
43528
  if (node?.isLocalWorktree) {
43529
+ const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
43530
+ const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
43531
+ if (isRemoteWorktree) {
43532
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
43533
+ ...typeof args === "object" && args !== null ? args : {}
43534
+ });
43535
+ return forwarded ?? { success: false, error: "no response from remote node" };
43536
+ }
43514
43537
  const cleanupResult = await this.cleanupLocalWorktreeNode({ mesh, node, nodeId, force: args?.force === true });
43515
43538
  if (cleanupResult.success === false) {
43516
43539
  return {
@@ -43577,6 +43600,13 @@ ${tail}` : ""
43577
43600
  if (!mesh) return { success: false, error: "Mesh not found" };
43578
43601
  const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
43579
43602
  if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
43603
+ const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
43604
+ if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
43605
+ const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
43606
+ ...typeof args === "object" && args !== null ? args : {}
43607
+ });
43608
+ return forwarded ?? { success: false, error: "no response from remote node" };
43609
+ }
43580
43610
  const repoRoot = sourceNode.repoRoot || sourceNode.workspace;
43581
43611
  const { createWorktree: createWorktree2 } = await Promise.resolve().then(() => (init_git_worktree(), git_worktree_exports));
43582
43612
  const result = await createWorktree2({
@@ -43809,6 +43839,13 @@ ${tail}` : ""
43809
43839
  const node = mesh.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
43810
43840
  if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
43811
43841
  if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
43842
+ const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
43843
+ if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
43844
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
43845
+ ...typeof args === "object" && args !== null ? args : {}
43846
+ });
43847
+ return forwarded ?? { success: false, error: "no response from remote node" };
43848
+ }
43812
43849
  const currentBootstrap = node.worktreeBootstrap;
43813
43850
  if (currentBootstrap?.status === "running") {
43814
43851
  return { success: false, error: "Bootstrap is already running for this node" };