@adhdev/daemon-core 1.0.28-rc.3 → 1.0.28-rc.5

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-core",
3
- "version": "1.0.28-rc.3",
3
+ "version": "1.0.28-rc.5",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,8 +47,8 @@
47
47
  "author": "vilmire",
48
48
  "license": "AGPL-3.0-or-later",
49
49
  "dependencies": {
50
- "@adhdev/mesh-shared": "1.0.28-rc.3",
51
- "@adhdev/session-host-core": "1.0.28-rc.3",
50
+ "@adhdev/mesh-shared": "1.0.28-rc.5",
51
+ "@adhdev/session-host-core": "1.0.28-rc.5",
52
52
  "@agentclientprotocol/sdk": "^0.16.1",
53
53
  "ajv": "^8.20.0",
54
54
  "ajv-formats": "^3.0.1",
@@ -665,6 +665,7 @@ export const meshCrudHandlers: Record<string, MedFamilyHandler> = {
665
665
  const capabilities = Array.isArray(args?.capabilities)
666
666
  ? args.capabilities.map((t: any) => typeof t === 'string' ? t.trim() : '').filter(Boolean)
667
667
  : undefined;
668
+ const isLocalWorktree = args?.isLocalWorktree === true;
668
669
  const node = addNode(meshId, {
669
670
  workspace,
670
671
  ...(repoRoot ? { repoRoot } : {}),
@@ -672,6 +673,7 @@ export const meshCrudHandlers: Record<string, MedFamilyHandler> = {
672
673
  ...(machineId ? { machineId } : {}),
673
674
  ...(policy ? { policy } : {}),
674
675
  ...(role ? { role } : {}),
676
+ ...(isLocalWorktree ? { isLocalWorktree: true } : {}),
675
677
  ...(capabilities && capabilities.length ? { capabilities } : {}),
676
678
  });
677
679
  if (!node) return { success: false, error: 'Mesh not found' };
@@ -595,7 +595,21 @@ async function runDaemonUpgradeHelper(payload: DaemonUpgradeHelperPayload): Prom
595
595
  await waitForPidExit(payload.parentPid, 15000);
596
596
  }
597
597
 
598
- await stopSessionHostProcesses(sessionHostAppName);
598
+ // The only reason to kill the session-host during an upgrade is the Windows
599
+ // EBUSY hazard: node-pty's `conpty.node` (and the ghostty VT dll) stay
600
+ // EXCLUSIVELY locked while the host has them memory-mapped, so npm's
601
+ // copy-to-staging fails until the host exits (see stopSessionHostProcesses).
602
+ // POSIX can replace an open file freely — the running host keeps its handles
603
+ // to the old inode and keeps serving — so killing it there only tears down
604
+ // every hosted CLI session (coordinator + workers) for no benefit. Leave the
605
+ // host running on POSIX; on the next boot `ensureSessionHostReady()` reuses
606
+ // the still-listening socket and `cliManager.restoreHostedSessions()` rebinds
607
+ // the live runtimes. Windows keeps the kill unchanged.
608
+ if (process.platform === 'win32') {
609
+ await stopSessionHostProcesses(sessionHostAppName);
610
+ } else {
611
+ appendUpgradeLog('POSIX — session-host left running (survives upgrade; sessions rebind on next boot)');
612
+ }
599
613
  removeDaemonPidFile();
600
614
  // Scope the Windows atomic-upgrade layout to THIS daemon's instance so
601
615
  // `adhdev-preview update` rotates only the preview prefix/pointer/tools tree
package/src/index.ts CHANGED
@@ -363,7 +363,7 @@ export type { DaemonState } from './config/state-store.js';
363
363
  // ── Detection ──
364
364
  export { detectIDEs } from './detection/ide-detector.js';
365
365
  export type { IDEInfo } from './detection/ide-detector.js';
366
- export { detectCLIs } from './detection/cli-detector.js';
366
+ export { detectCLIs, detectCLI } from './detection/cli-detector.js';
367
367
  export { getHostMemorySnapshot } from './system/host-memory.js';
368
368
  export type { HostMemorySnapshot } from './system/host-memory.js';
369
369
  export {
@@ -1010,6 +1010,8 @@ const TOOLS_SECTION = `## Available Tools
1010
1010
  | \`mesh_approve\` | Approve/reject a pending agent action (a yes/no tool-consent modal) |
1011
1011
  | \`mesh_answer_question\` | Answer a delegated session's multi-choice QUESTION (AskUserQuestion / status awaiting_choice). NOT an approval — it offers labelled options (possibly multi-select or freeform). Pass the promptId from the agent:waiting_choice event + one answer per question (select by option label or 1-based index). Use this, never mesh_approve, for a question |
1012
1012
  | \`mesh_list_pending_approvals\` | List every session across the mesh awaiting an approval decision (the approval inbox) — read-only; enumerate all blocked sessions at once, then drive a mesh_approve for each |
1013
+ | \`mesh_create\` | Bootstrap a NEW mesh for a repo (name + repo_remote_url/repo_identity); optionally register the current workspace as the first node. The from-scratch entry point when no mesh exists yet |
1014
+ | \`mesh_add_node\` | Register a workspace as a node in an existing mesh (workspace + optional read_only/provider_priority). The second bootstrap step after mesh_create; use mesh_clone_node instead to create a fresh git worktree |
1013
1015
  | \`mesh_clone_node\` | Create a worktree node for isolated parallel branch work |
1014
1016
  | \`mesh_refine_node\` | Validate and merge a completed worktree node back into its base branch |
1015
1017
  | \`mesh_refine_batch\` | Batch Refinery: converge multiple sibling worktree nodes onto the base branch in one conflict-aware sequential pipeline |