@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.js CHANGED
@@ -22768,7 +22768,7 @@ function buildCliSession(state, options) {
22768
22768
  mode: state.mode,
22769
22769
  resume: state.resume,
22770
22770
  activeChat,
22771
- ...state.activeInteractivePrompt ? { activeInteractivePrompt: state.activeInteractivePrompt } : {},
22771
+ activeInteractivePrompt: state.activeInteractivePrompt ?? null,
22772
22772
  ...summaryMetadata && { summaryMetadata },
22773
22773
  ...includeSessionMetadata && {
22774
22774
  capabilities: state.mode === "terminal" ? PTY_SESSION_CAPABILITIES : CLI_CHAT_SESSION_CAPABILITIES,
@@ -22783,7 +22783,8 @@ function buildCliSession(state, options) {
22783
22783
  lastUpdated: state.lastUpdated,
22784
22784
  settings: state.settings,
22785
22785
  ...coordinator && { coordinator },
22786
- ...meshQueueStats && { meshQueueStats }
22786
+ ...meshQueueStats && { meshQueueStats },
22787
+ ...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
22787
22788
  };
22788
22789
  }
22789
22790
  function buildAcpSession(state, options) {
@@ -22823,7 +22824,8 @@ function buildAcpSession(state, options) {
22823
22824
  lastUpdated: state.lastUpdated,
22824
22825
  settings: state.settings,
22825
22826
  ...coordinator && { coordinator },
22826
- ...meshQueueStats && { meshQueueStats }
22827
+ ...meshQueueStats && { meshQueueStats },
22828
+ ...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
22827
22829
  };
22828
22830
  }
22829
22831
  function buildSessionEntries(allStates, cdpManagers, options = {}) {
@@ -43793,14 +43795,27 @@ ${tail}` : ""
43793
43795
  const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
43794
43796
  let workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
43795
43797
  let submoduleIgnorePaths = Array.isArray(args?.submoduleIgnorePaths) ? args.submoduleIgnorePaths.filter((value) => typeof value === "string") : void 0;
43796
- if (!workspace && meshId && nodeId) {
43798
+ let nodeDaemonId;
43799
+ if (meshId && nodeId) {
43797
43800
  const meshRecord = await this.getMeshForCommand(meshId, args?.inlineMesh);
43798
43801
  const mesh = meshRecord?.mesh;
43799
43802
  const node = mesh?.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
43800
- workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
43803
+ if (!workspace) {
43804
+ workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
43805
+ }
43801
43806
  if (!submoduleIgnorePaths && Array.isArray(node?.policy?.submoduleIgnorePaths)) {
43802
43807
  submoduleIgnorePaths = node.policy.submoduleIgnorePaths.filter((value) => typeof value === "string");
43803
43808
  }
43809
+ nodeDaemonId = typeof node?.daemonId === "string" ? node.daemonId.trim() : void 0;
43810
+ }
43811
+ const selfDaemonId = this.deps.statusInstanceId;
43812
+ const isRemote = nodeDaemonId && selfDaemonId && nodeDaemonId !== selfDaemonId;
43813
+ if (isRemote && this.deps.dispatchMeshCommand) {
43814
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "fast_forward_mesh_node", {
43815
+ ...typeof args === "object" && args !== null ? args : {},
43816
+ workspace
43817
+ });
43818
+ return forwarded ?? { success: false, error: "no response from remote node" };
43804
43819
  }
43805
43820
  const result = await fastForwardMeshNode({
43806
43821
  meshId: meshId || void 0,
@@ -43838,6 +43853,14 @@ ${tail}` : ""
43838
43853
  }
43839
43854
  let worktreeCleanup;
43840
43855
  if (node?.isLocalWorktree) {
43856
+ const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
43857
+ const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
43858
+ if (isRemoteWorktree) {
43859
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
43860
+ ...typeof args === "object" && args !== null ? args : {}
43861
+ });
43862
+ return forwarded ?? { success: false, error: "no response from remote node" };
43863
+ }
43841
43864
  const cleanupResult = await this.cleanupLocalWorktreeNode({ mesh, node, nodeId, force: args?.force === true });
43842
43865
  if (cleanupResult.success === false) {
43843
43866
  return {
@@ -43904,6 +43927,13 @@ ${tail}` : ""
43904
43927
  if (!mesh) return { success: false, error: "Mesh not found" };
43905
43928
  const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
43906
43929
  if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
43930
+ const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
43931
+ if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
43932
+ const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
43933
+ ...typeof args === "object" && args !== null ? args : {}
43934
+ });
43935
+ return forwarded ?? { success: false, error: "no response from remote node" };
43936
+ }
43907
43937
  const repoRoot = sourceNode.repoRoot || sourceNode.workspace;
43908
43938
  const { createWorktree: createWorktree2 } = await Promise.resolve().then(() => (init_git_worktree(), git_worktree_exports));
43909
43939
  const result = await createWorktree2({
@@ -44136,6 +44166,13 @@ ${tail}` : ""
44136
44166
  const node = mesh.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
44137
44167
  if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
44138
44168
  if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
44169
+ const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
44170
+ if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
44171
+ const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
44172
+ ...typeof args === "object" && args !== null ? args : {}
44173
+ });
44174
+ return forwarded ?? { success: false, error: "no response from remote node" };
44175
+ }
44139
44176
  const currentBootstrap = node.worktreeBootstrap;
44140
44177
  if (currentBootstrap?.status === "running") {
44141
44178
  return { success: false, error: "Bootstrap is already running for this node" };