@adhdev/daemon-core 0.9.82-rc.27 → 0.9.82-rc.271

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.
Files changed (277) hide show
  1. package/dist/boot/daemon-lifecycle.d.ts +4 -0
  2. package/dist/boot/process-hardening.d.ts +50 -0
  3. package/dist/build-info.d.ts +37 -0
  4. package/dist/chat/source-machine.d.ts +166 -0
  5. package/dist/chat/source-resolver.d.ts +104 -0
  6. package/dist/chat/subscription-updates.d.ts +1 -0
  7. package/dist/cli-adapter-types.d.ts +23 -2
  8. package/dist/cli-adapters/cli-script-runner.d.ts +117 -0
  9. package/dist/cli-adapters/cli-state-engine.d.ts +198 -0
  10. package/dist/cli-adapters/provider-cli-adapter.d.ts +106 -63
  11. package/dist/cli-adapters/provider-cli-parse.d.ts +4 -0
  12. package/dist/cli-adapters/provider-cli-shared.d.ts +38 -0
  13. package/dist/cli-adapters/raw-terminal-io.d.ts +37 -0
  14. package/dist/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +6 -3
  15. package/dist/cli-adapters/terminal-backends/types.d.ts +10 -2
  16. package/dist/cli-adapters/terminal-screen.d.ts +4 -11
  17. package/dist/commands/cli-manager.d.ts +2 -1
  18. package/dist/commands/handler.d.ts +110 -0
  19. package/dist/commands/mesh-coordinator.d.ts +85 -1
  20. package/dist/commands/router.d.ts +160 -1
  21. package/dist/config/chat-history.d.ts +9 -0
  22. package/dist/config/config.d.ts +5 -0
  23. package/dist/config/mesh-config.d.ts +72 -1
  24. package/dist/git/git-commands.d.ts +9 -1
  25. package/dist/git/git-diff.d.ts +6 -0
  26. package/dist/git/git-status.d.ts +7 -0
  27. package/dist/git/git-types.d.ts +2 -50
  28. package/dist/index.d.ts +51 -12
  29. package/dist/index.js +33378 -12150
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +37922 -16795
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/installer.d.ts +1 -4
  34. package/dist/ipc/local-ipc-server.d.ts +91 -0
  35. package/dist/launch.d.ts +1 -1
  36. package/dist/logging/async-batch-writer.d.ts +10 -0
  37. package/dist/mesh/contracts.d.ts +164 -0
  38. package/dist/mesh/coordinator-prompt.d.ts +36 -0
  39. package/dist/mesh/coordinator-registry.d.ts +59 -0
  40. package/dist/mesh/mesh-active-work.d.ts +108 -0
  41. package/dist/mesh/mesh-delivery-policy.d.ts +131 -0
  42. package/dist/mesh/mesh-events-coordinator.d.ts +152 -0
  43. package/dist/mesh/mesh-events-pending.d.ts +40 -0
  44. package/dist/mesh/mesh-events-stale.d.ts +40 -0
  45. package/dist/mesh/mesh-events-utils.d.ts +47 -0
  46. package/dist/mesh/mesh-events.d.ts +5 -49
  47. package/dist/mesh/mesh-fast-forward.d.ts +81 -0
  48. package/dist/mesh/mesh-host-ownership.d.ts +9 -0
  49. package/dist/mesh/mesh-ledger-reconciliation.d.ts +23 -3
  50. package/dist/mesh/mesh-ledger.d.ts +77 -1
  51. package/dist/mesh/mesh-missions.d.ts +58 -0
  52. package/dist/mesh/mesh-refine-batch.d.ts +68 -0
  53. package/dist/mesh/mesh-refine-status.d.ts +62 -0
  54. package/dist/mesh/mesh-review-inbox.d.ts +90 -0
  55. package/dist/mesh/mesh-routing.d.ts +70 -0
  56. package/dist/mesh/mesh-runtime-store.d.ts +333 -0
  57. package/dist/mesh/mesh-task-stats.d.ts +49 -0
  58. package/dist/mesh/mesh-work-queue.d.ts +166 -5
  59. package/dist/mesh/preview-freshness.d.ts +18 -0
  60. package/dist/mesh/refine-config.d.ts +215 -0
  61. package/dist/mesh/worktree-bootstrap-config.d.ts +135 -0
  62. package/dist/providers/acp-provider-instance.d.ts +2 -0
  63. package/dist/providers/approval-utils.d.ts +13 -0
  64. package/dist/providers/cli-provider-instance.d.ts +61 -3
  65. package/dist/providers/contracts.d.ts +130 -6
  66. package/dist/providers/external-sources.d.ts +71 -0
  67. package/dist/providers/native-history/antigravity-cli-transcript.d.ts +100 -0
  68. package/dist/providers/native-history/claude-cli-transcript.d.ts +70 -0
  69. package/dist/providers/native-history/codex-cli-transcript.d.ts +73 -0
  70. package/dist/providers/native-history/dispatcher.d.ts +27 -0
  71. package/dist/providers/native-history/hermes-cli-transcript.d.ts +30 -0
  72. package/dist/providers/native-history/index.d.ts +13 -0
  73. package/dist/providers/provider-instance-manager.d.ts +13 -0
  74. package/dist/providers/provider-instance.d.ts +13 -1
  75. package/dist/providers/provider-loader.d.ts +26 -4
  76. package/dist/providers/provider-trust.d.ts +31 -0
  77. package/dist/providers/read-chat-contract.d.ts +29 -0
  78. package/dist/providers/sdk/v1/builders/acp/detect-status.d.ts +68 -0
  79. package/dist/providers/sdk/v1/builders/cli/detect-status.d.ts +85 -0
  80. package/dist/providers/sdk/v1/builders/cli/parse-approval-squash.d.ts +59 -0
  81. package/dist/providers/sdk/v1/builders/cli/parse-approval.d.ts +65 -0
  82. package/dist/providers/sdk/v1/builders/cli/parse-session.d.ts +91 -0
  83. package/dist/providers/sdk/v1/builders/cli/visible-region.d.ts +42 -0
  84. package/dist/providers/sdk/v1/fixture-tooling/format.d.ts +126 -0
  85. package/dist/providers/sdk/v1/fixture-tooling/index.d.ts +8 -0
  86. package/dist/providers/sdk/v1/fixture-tooling/replay.d.ts +38 -0
  87. package/dist/providers/sdk/v1/index.d.ts +30 -0
  88. package/dist/providers/sdk/v1/sandbox/README-design.d.ts +193 -0
  89. package/dist/providers/sdk/v1/sandbox/require-whitelist.d.ts +74 -0
  90. package/dist/providers/sdk/v1/sandbox/script-runner.d.ts +98 -0
  91. package/dist/providers/sdk/v1/types/cli/index.d.ts +277 -0
  92. package/dist/providers/sdk/v1/types/common/index.d.ts +203 -0
  93. package/dist/providers/sdk/v1/validators/index.d.ts +5 -0
  94. package/dist/providers/sdk/v1/validators/manifest.d.ts +40 -0
  95. package/dist/providers/sdk/v1/validators/taint.d.ts +52 -0
  96. package/dist/providers/spec/adapter.d.ts +59 -0
  97. package/dist/providers/spec/cli-adapter.d.ts +140 -0
  98. package/dist/providers/spec/evaluator.d.ts +23 -0
  99. package/dist/providers/spec/fsm-driver.d.ts +278 -0
  100. package/dist/providers/spec/fsm-evaluator.d.ts +72 -0
  101. package/dist/providers/spec/fsm-loader.d.ts +14 -0
  102. package/dist/providers/spec/fsm-types.d.ts +106 -0
  103. package/dist/providers/spec/native-history-executor.d.ts +41 -0
  104. package/dist/providers/spec/route.d.ts +4 -0
  105. package/dist/providers/spec/types.d.ts +144 -0
  106. package/dist/providers/transcript-v2.d.ts +176 -0
  107. package/dist/providers/types/interactive-prompt.d.ts +48 -0
  108. package/dist/repo-mesh-types.d.ts +146 -13
  109. package/dist/sessions/registry.d.ts +6 -0
  110. package/dist/shared-types-extra.d.ts +2 -4
  111. package/dist/shared-types.d.ts +42 -1
  112. package/dist/status/normalize.d.ts +1 -1
  113. package/dist/status/normalize.js +1 -0
  114. package/dist/status/normalize.js.map +1 -1
  115. package/dist/status/normalize.mjs +1 -0
  116. package/dist/status/normalize.mjs.map +1 -1
  117. package/dist/status/reporter.d.ts +2 -0
  118. package/dist/status/snapshot.d.ts +1 -0
  119. package/dist/types.d.ts +5 -0
  120. package/package.json +7 -3
  121. package/src/agent-stream/poller.ts +2 -3
  122. package/src/boot/daemon-lifecycle.ts +30 -10
  123. package/src/boot/process-hardening.ts +89 -0
  124. package/src/build-info.ts +73 -0
  125. package/src/chat/source-machine.ts +534 -0
  126. package/src/chat/source-resolver.ts +0 -0
  127. package/src/chat/subscription-updates.ts +20 -1
  128. package/src/cli-adapter-types.d.ts +1 -0
  129. package/src/cli-adapter-types.ts +22 -2
  130. package/src/cli-adapters/cli-script-runner.ts +421 -0
  131. package/src/cli-adapters/cli-state-engine.ts +1215 -0
  132. package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
  133. package/src/cli-adapters/provider-cli-adapter.ts +674 -1139
  134. package/src/cli-adapters/provider-cli-parse.d.ts +1 -0
  135. package/src/cli-adapters/provider-cli-parse.ts +13 -0
  136. package/src/cli-adapters/provider-cli-runtime.ts +3 -1
  137. package/src/cli-adapters/provider-cli-shared.d.ts +2 -0
  138. package/src/cli-adapters/provider-cli-shared.ts +68 -11
  139. package/src/cli-adapters/raw-terminal-io.ts +252 -0
  140. package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +53 -29
  141. package/src/cli-adapters/terminal-backends/types.ts +10 -3
  142. package/src/cli-adapters/terminal-screen.ts +16 -81
  143. package/src/commands/chat-commands.ts +1813 -60
  144. package/src/commands/cli-manager.ts +286 -14
  145. package/src/commands/handler.ts +809 -2
  146. package/src/commands/mesh-coordinator.ts +332 -122
  147. package/src/commands/router.ts +5730 -550
  148. package/src/config/chat-history.ts +229 -24
  149. package/src/config/config.ts +12 -0
  150. package/src/config/mesh-config.ts +303 -3
  151. package/src/config/recent-activity.ts +8 -2
  152. package/src/daemon/dev-auto-implement.ts +3 -2
  153. package/src/daemon/dev-cli-debug.ts +10 -1
  154. package/src/detection/ide-detector.ts +26 -16
  155. package/src/git/git-commands.ts +42 -12
  156. package/src/git/git-diff.ts +53 -0
  157. package/src/git/git-status.ts +198 -7
  158. package/src/git/git-types.ts +14 -62
  159. package/src/git/git-worktree.ts +8 -1
  160. package/src/index.ts +131 -11
  161. package/src/installer.d.ts +1 -1
  162. package/src/installer.ts +8 -6
  163. package/src/ipc/local-ipc-server.ts +278 -0
  164. package/src/launch.d.ts +1 -1
  165. package/src/launch.ts +37 -28
  166. package/src/logging/async-batch-writer.ts +55 -0
  167. package/src/logging/logger.ts +2 -1
  168. package/src/mesh/contracts.ts +329 -0
  169. package/src/mesh/coordinator-prompt.ts +219 -31
  170. package/src/mesh/coordinator-registry.ts +121 -0
  171. package/src/mesh/mesh-active-work.ts +468 -0
  172. package/src/mesh/mesh-delivery-policy.ts +315 -0
  173. package/src/mesh/mesh-events-coordinator.ts +1650 -0
  174. package/src/mesh/mesh-events-pending.ts +439 -0
  175. package/src/mesh/mesh-events-stale.ts +283 -0
  176. package/src/mesh/mesh-events-utils.ts +254 -0
  177. package/src/mesh/mesh-events.ts +26 -1035
  178. package/src/mesh/mesh-fast-forward.ts +839 -0
  179. package/src/mesh/mesh-host-ownership.ts +73 -0
  180. package/src/mesh/mesh-ledger-reconciliation.ts +12 -5
  181. package/src/mesh/mesh-ledger.ts +589 -102
  182. package/src/mesh/mesh-missions.ts +151 -0
  183. package/src/mesh/mesh-refine-batch.ts +197 -0
  184. package/src/mesh/mesh-refine-status.ts +231 -0
  185. package/src/mesh/mesh-review-inbox.ts +307 -0
  186. package/src/mesh/mesh-routing.ts +272 -0
  187. package/src/mesh/mesh-runtime-store.ts +1361 -0
  188. package/src/mesh/mesh-task-stats.ts +154 -0
  189. package/src/mesh/mesh-work-queue.ts +586 -145
  190. package/src/mesh/preview-freshness.ts +118 -0
  191. package/src/mesh/refine-config.ts +403 -0
  192. package/src/mesh/worktree-bootstrap-config.ts +326 -0
  193. package/src/providers/acp-provider-instance.ts +15 -1
  194. package/src/providers/approval-utils.d.ts +4 -0
  195. package/src/providers/approval-utils.ts +47 -5
  196. package/src/providers/chat-message-normalization.ts +4 -11
  197. package/src/providers/cli-provider-instance.ts +897 -81
  198. package/src/providers/contracts.d.ts +55 -0
  199. package/src/providers/contracts.ts +141 -6
  200. package/src/providers/external-sources.ts +218 -0
  201. package/src/providers/ide-provider-instance.ts +19 -5
  202. package/src/providers/native-history/antigravity-cli-transcript.ts +643 -0
  203. package/src/providers/native-history/claude-cli-transcript.ts +396 -0
  204. package/src/providers/native-history/codex-cli-transcript.ts +479 -0
  205. package/src/providers/native-history/dispatcher.ts +340 -0
  206. package/src/providers/native-history/hermes-cli-transcript.ts +230 -0
  207. package/src/providers/native-history/index.ts +30 -0
  208. package/src/providers/provider-instance-manager.ts +30 -0
  209. package/src/providers/provider-instance.ts +10 -1
  210. package/src/providers/provider-loader.ts +584 -50
  211. package/src/providers/provider-schema.ts +87 -14
  212. package/src/providers/provider-trust.ts +114 -0
  213. package/src/providers/read-chat-contract.ts +76 -16
  214. package/src/providers/sdk/README.md +49 -0
  215. package/src/providers/sdk/v1/builders/acp/detect-status.ts +144 -0
  216. package/src/providers/sdk/v1/builders/cli/detect-status.ts +262 -0
  217. package/src/providers/sdk/v1/builders/cli/parse-approval-squash.ts +158 -0
  218. package/src/providers/sdk/v1/builders/cli/parse-approval.ts +250 -0
  219. package/src/providers/sdk/v1/builders/cli/parse-session.ts +276 -0
  220. package/src/providers/sdk/v1/builders/cli/visible-region.ts +143 -0
  221. package/src/providers/sdk/v1/fixture-tooling/format.ts +130 -0
  222. package/src/providers/sdk/v1/fixture-tooling/index.ts +22 -0
  223. package/src/providers/sdk/v1/fixture-tooling/replay.ts +352 -0
  224. package/src/providers/sdk/v1/index.ts +152 -0
  225. package/src/providers/sdk/v1/sandbox/README-design.ts +195 -0
  226. package/src/providers/sdk/v1/sandbox/require-whitelist.ts +472 -0
  227. package/src/providers/sdk/v1/sandbox/script-runner.ts +150 -0
  228. package/src/providers/sdk/v1/schemas/cli/provider.schema.json +504 -0
  229. package/src/providers/sdk/v1/schemas/primitives/acp-session-protocol-v1.json +131 -0
  230. package/src/providers/sdk/v1/schemas/primitives/native-history-codex-rollout-v1.json +66 -0
  231. package/src/providers/sdk/v1/schemas/primitives/tui-approval-squash-v1.json +91 -0
  232. package/src/providers/sdk/v1/schemas/primitives/tui-assistant-block-v1.json +91 -0
  233. package/src/providers/sdk/v1/schemas/primitives/tui-cue-ordering-v1.json +47 -0
  234. package/src/providers/sdk/v1/schemas/primitives/tui-dispatch-order-v1.json +32 -0
  235. package/src/providers/sdk/v1/schemas/primitives/tui-footer-chrome-v1.json +42 -0
  236. package/src/providers/sdk/v1/schemas/primitives/tui-index-finder-v1.json +27 -0
  237. package/src/providers/sdk/v1/schemas/primitives/tui-modal-v1.json +125 -0
  238. package/src/providers/sdk/v1/schemas/primitives/tui-prompt-marker-v1.json +45 -0
  239. package/src/providers/sdk/v1/schemas/primitives/tui-session-id-extraction-v1.json +46 -0
  240. package/src/providers/sdk/v1/schemas/primitives/tui-settled-prompt-v1.json +71 -0
  241. package/src/providers/sdk/v1/schemas/primitives/tui-spinner-v1.json +83 -0
  242. package/src/providers/sdk/v1/schemas/primitives/tui-transcript-pty-v1.json +83 -0
  243. package/src/providers/sdk/v1/schemas/primitives/tui-visible-region-v1.json +57 -0
  244. package/src/providers/sdk/v1/schemas/primitives/tui-welcome-screen-v1.json +35 -0
  245. package/src/providers/sdk/v1/types/cli/index.ts +365 -0
  246. package/src/providers/sdk/v1/types/common/index.ts +229 -0
  247. package/src/providers/sdk/v1/validators/index.ts +19 -0
  248. package/src/providers/sdk/v1/validators/manifest.ts +110 -0
  249. package/src/providers/sdk/v1/validators/taint.ts +309 -0
  250. package/src/providers/spec/adapter.ts +155 -0
  251. package/src/providers/spec/cli-adapter.ts +730 -0
  252. package/src/providers/spec/evaluator.ts +345 -0
  253. package/src/providers/spec/fsm-driver.ts +868 -0
  254. package/src/providers/spec/fsm-evaluator.ts +255 -0
  255. package/src/providers/spec/fsm-loader.ts +102 -0
  256. package/src/providers/spec/fsm-types.ts +199 -0
  257. package/src/providers/spec/native-history-executor.ts +943 -0
  258. package/src/providers/spec/route.ts +51 -0
  259. package/src/providers/spec/types.ts +189 -0
  260. package/src/providers/transcript-v2.ts +567 -0
  261. package/src/providers/types/interactive-prompt.ts +446 -0
  262. package/src/providers/version-archive.ts +38 -20
  263. package/src/repo-mesh-types.ts +175 -13
  264. package/src/sessions/registry.ts +6 -0
  265. package/src/shared-types-extra.ts +2 -4
  266. package/src/shared-types.ts +45 -1
  267. package/src/status/builders.ts +26 -6
  268. package/src/status/normalize.ts +2 -0
  269. package/src/status/reporter.ts +15 -0
  270. package/src/status/snapshot.ts +84 -25
  271. package/src/system/host-memory.ts +29 -12
  272. package/src/types.ts +5 -0
  273. package/dist/cli-adapters/terminal-backends/xterm-backend.d.ts +0 -17
  274. package/dist/mesh/mesh-sync.d.ts +0 -53
  275. package/src/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +0 -16
  276. package/src/cli-adapters/terminal-backends/xterm-backend.ts +0 -97
  277. package/src/mesh/mesh-sync.ts +0 -111
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { ProviderInstanceManager } from '../providers/provider-instance-manager.js';
8
8
  import { ProviderLoader } from '../providers/provider-loader.js';
9
- import { type ProviderModule, type ProviderResumeCapability } from '../providers/contracts.js';
9
+ import { type MeshCoordinatorDelegatedWorkerIsolation, type ProviderModule, type ProviderResumeCapability } from '../providers/contracts.js';
10
10
  import type { CliAdapter } from '../cli-adapter-types.js';
11
11
  import type { PtyTransportFactory } from '../cli-adapters/pty-transport.js';
12
12
  import type { SessionRegistry } from '../sessions/registry.js';
@@ -68,6 +68,7 @@ export interface CoordinatorDelegatedCliLaunchOptionsInput {
68
68
  workspace: string;
69
69
  cliArgs?: string[];
70
70
  env?: Record<string, string>;
71
+ isolation?: MeshCoordinatorDelegatedWorkerIsolation;
71
72
  }
72
73
  export interface CoordinatorDelegatedCliLaunchOptions {
73
74
  cliArgs: string[];
@@ -104,7 +104,117 @@ export declare class DaemonCommandHandler implements CommandHelpers {
104
104
  setAgentStreamManager(manager: DaemonAgentStreamManager): void;
105
105
  handle(cmd: string, args: any): Promise<CommandResult>;
106
106
  private dispatch;
107
+ /**
108
+ * Reload providers from disk. Does NOT pull from the registry — the user
109
+ * controls installs explicitly via install_provider_manifest. To upgrade
110
+ * an installed provider, call install_provider_manifest again with the
111
+ * desired version (or with no version to pick up the latest from
112
+ * registry), or use check_provider_updates to see what is out of date.
113
+ */
107
114
  private handleRefreshScripts;
115
+ /**
116
+ * Return per-provider availability so the dashboard's provider catalog
117
+ * can show "Installed" badges. Reuses the existing detection state from
118
+ * ProviderLoader.getMachineProviderStatus() — no probing is triggered.
119
+ */
120
+ private handleListProviderAvailability;
121
+ /**
122
+ * Compute the *upstream cache root*. install_provider_manifest writes
123
+ * official-registry manifests here so the daemon's standard upstream
124
+ * layer picks them up — no special handling needed at load time, and
125
+ * the manifests inherit the official-trust badge instead of the
126
+ * untrusted-external one.
127
+ *
128
+ * Path matches ProviderLoader.upstreamDir but we recompute it from
129
+ * homedir() so this method stays usable in dev where userDir can
130
+ * point at a sibling git checkout.
131
+ */
132
+ private getUpstreamInstallRoot;
133
+ /**
134
+ * Download a single provider manifest from the registry and write it to
135
+ * ~/.adhdev/providers/.upstream/{category}/{type}/provider.json.
136
+ *
137
+ * Used by standalone onboarding to seed the upstream cache with the
138
+ * default provider set on first launch. Verifies SHA-256 checksum
139
+ * against the registry meta before persisting. Refuses to write
140
+ * outside the upstream root.
141
+ *
142
+ * Args: { type: string, category?: string, version?: string }
143
+ * If category/version are omitted, looks up the latest from the registry.
144
+ */
145
+ private handleInstallProviderManifest;
146
+ /**
147
+ * If `manifest.source = { type:'github', repo, ref, subdir? }` is set,
148
+ * walk each script directory the manifest references and download every
149
+ * file from the public GitHub raw endpoint. Returns a small summary so
150
+ * the caller can report what was fetched.
151
+ *
152
+ * Best-effort: failures don't reject the install — the manifest itself is
153
+ * usable for declarative-only providers, and the user still gets a clear
154
+ * error string back if a needed script is missing.
155
+ */
156
+ private fetchProviderSources;
157
+ /**
158
+ * Remove a provider manifest from the upstream cache root
159
+ * (~/.adhdev/providers/.upstream/{category}/{type}/). Refuses to touch
160
+ * anything outside that root. Used by onboarding to opt out of a
161
+ * provider the user doesn't want; the dashboard no longer exposes a
162
+ * per-provider uninstall button (external sources are removed as a
163
+ * whole via remove_provider_source).
164
+ */
165
+ private handleUninstallProviderManifest;
166
+ /**
167
+ * Return everything currently installed in the upstream cache with its
168
+ * version. This is the "what does this daemon have" answer used both by
169
+ * the UI and by the update checker.
170
+ */
171
+ private handleListInstalledProviders;
172
+ /**
173
+ * For each installed provider, ask the registry for its current latest
174
+ * version and report whether an update is available. The user can then
175
+ * call install_provider_manifest to upgrade (it overwrites the file).
176
+ *
177
+ * Returns { providers: [{ type, category, installedVersion, latestVersion,
178
+ * updateAvailable, error? }] }
179
+ */
180
+ private handleCheckProviderUpdates;
181
+ /**
182
+ * Register a new external provider source. The daemon clones the repo
183
+ * to ~/.adhdev/external/<name>/, walks it once to detect provided
184
+ * types, and surfaces any conflicts with already-installed types so
185
+ * the dashboard can ask the user how to resolve them.
186
+ *
187
+ * Args: { url: string, ref?: string, name?: string }
188
+ * - url: https://, git@, or any git-cloneable URL
189
+ * - ref: branch/tag/commit (default "main")
190
+ * - name: short identifier (default derived from URL)
191
+ *
192
+ * Returns: { source, providers, conflicts }
193
+ * - conflicts: list of types this new source provides that another
194
+ * source already exposes. UI uses this to prompt for active-source
195
+ * selection before the load takes effect.
196
+ */
197
+ private handleAddProviderSource;
198
+ /**
199
+ * Remove a registered external source. Deletes the clone directory and
200
+ * any active-source entry pointing to it.
201
+ *
202
+ * Args: { name: string }
203
+ */
204
+ private handleRemoveProviderSource;
205
+ /**
206
+ * List registered external sources + each source's currently installed
207
+ * providers + the active selection for any conflicting types. Used by
208
+ * the dashboard's "Sources" tab.
209
+ */
210
+ private handleListProviderSources;
211
+ /**
212
+ * Pick which source's copy of a conflicting provider type is active.
213
+ * Other sources' copies stay on disk but the loader ignores them.
214
+ *
215
+ * Args: { type: string, sourceName: string }
216
+ */
217
+ private handleSetActiveProviderSource;
108
218
  private proxyDevServerPost;
109
219
  private proxyDevServerGet;
110
220
  private proxyDevServerScaffold;
@@ -1,4 +1,4 @@
1
- import type { ProviderModule, MeshCoordinatorMcpConfigFormat } from '../providers/contracts.js';
1
+ import type { MeshCoordinatorMcpConfigFormat, MeshCoordinatorSystemPromptInjection, ProviderModule } from '../providers/contracts.js';
2
2
  export interface MeshCoordinatorMcpServerLaunch {
3
3
  command: string;
4
4
  args: string[];
@@ -25,6 +25,7 @@ export type MeshCoordinatorSetup = {
25
25
  command: string;
26
26
  requiresRestart: boolean;
27
27
  instructions: string;
28
+ mcpServer: MeshCoordinatorMcpServerLaunch;
28
29
  } | {
29
30
  kind: 'unsupported';
30
31
  reason: string;
@@ -42,3 +43,86 @@ export interface ResolveMeshCoordinatorSetupOptions {
42
43
  }
43
44
  export declare function createHermesManualMeshCoordinatorSetup(meshId: string, workspace: string): MeshCoordinatorSetup;
44
45
  export declare function resolveMeshCoordinatorSetup(options: ResolveMeshCoordinatorSetupOptions): MeshCoordinatorSetup;
46
+ /**
47
+ * Apply a provider's declared system-prompt injection rule, mutating `cliArgs`
48
+ * and `launchEnv` in place and writing any required workspace context file.
49
+ *
50
+ * Replaces the previous hard-coded `if (cliType === 'claude-cli') ... else if
51
+ * (cliType === 'hermes-cli') ...` branches in router.ts. Adding a new CLI is
52
+ * now provider.v1.json data, not a router edit.
53
+ *
54
+ * Failures are non-fatal: log and continue with whatever was applied so the
55
+ * coordinator session still launches, just without the prompt for that
56
+ * provider. A missing/unknown rule means "skip injection" — safe by default
57
+ * (the previous fallback unconditionally pushed --append-system-prompt onto
58
+ * every non-Claude CLI, which crashed agy on launch).
59
+ */
60
+ export interface CoordinatorInjectionEffect {
61
+ /** Absolute path the daemon wrote a wrapper-blocked file to. Only set for
62
+ * context_file injection. R48 schedules a strip after launch so workers
63
+ * don't see the wrapper on disk; R47's unregister cleanup uses it as a
64
+ * fallback if the timer never fires (process crash, etc). */
65
+ contextFilePath?: string;
66
+ }
67
+ export declare function applyMeshCoordinatorSystemPromptInjection(systemPrompt: string, injection: MeshCoordinatorSystemPromptInjection | undefined, ctx: {
68
+ cliArgs: string[];
69
+ launchEnv: Record<string, string>;
70
+ workspace: string;
71
+ cliType: string;
72
+ }): CoordinatorInjectionEffect;
73
+ /**
74
+ * Strip the daemon's wrapper block from a context_file we previously wrote.
75
+ *
76
+ * Used in two places:
77
+ * 1. R48 inject-then-remove: ~5s after spawn, after agy/gemini have read
78
+ * the file into their in-memory system-prompt cache. Removing it from
79
+ * disk at that point doesn't affect the running coordinator but keeps
80
+ * worker sessions (or fresh non-coordinator launches) in the same
81
+ * workspace from picking up our wrapper.
82
+ * 2. R47 unregister fallback: if the timer never fires (process crash,
83
+ * kill -9), coordinator-registry.unregisterMeshCoordinator runs the
84
+ * same logic when its entry is dropped.
85
+ *
86
+ * Idempotent: missing file is fine, missing sentinels are fine, returns
87
+ * silently. Leaves user-authored content outside the sentinels intact.
88
+ * Deletes the file outright if our wrapper was the only content.
89
+ */
90
+ export declare function stripCoordinatorWrapperFile(filePath: string): void;
91
+ export interface PtyExecResult {
92
+ exitCode: number | null;
93
+ signal: number | null;
94
+ output: string;
95
+ timedOut: boolean;
96
+ }
97
+ export interface MeshCoordinatorRegistrationStep {
98
+ command: string;
99
+ args: string[];
100
+ required: boolean;
101
+ label: 'remove_existing' | 'register';
102
+ }
103
+ /**
104
+ * Codex rejects `mcp add` when a server with the same name already exists.
105
+ * Replace that entry before registering so transport/mesh changes do not leave
106
+ * a fresh coordinator attached to stale MCP launch arguments.
107
+ */
108
+ export declare function buildMeshCoordinatorRegistrationPlan(cliType: string, serverName: string, registrationCommand: string): MeshCoordinatorRegistrationStep[];
109
+ /**
110
+ * Run a one-shot CLI command under a real PTY and collect its output.
111
+ *
112
+ * Some provider mcp-registration commands (`agy mcp add`, future bubbletea
113
+ * TUIs) refuse to run without `/dev/tty`. Daemon-side `execFileSync` runs
114
+ * pipe-only, so those commands fail with errors like
115
+ * `bubbletea: error opening TTY: open /dev/tty: device not configured`
116
+ * and silently skip the registration, leaving the launched session
117
+ * without the adhdev-mesh MCP tools — which is exactly what we saw with
118
+ * agy coordinators.
119
+ *
120
+ * Wrapping the registration through node-pty gives the child a real PTY,
121
+ * so the bubbletea check passes. We close stdin immediately and just
122
+ * collect stdout until the process exits or the timeout fires.
123
+ */
124
+ export declare function execUnderPty(command: string, args: string[], options?: {
125
+ cwd?: string;
126
+ env?: Record<string, string>;
127
+ timeoutMs?: number;
128
+ }): Promise<PtyExecResult>;
@@ -14,6 +14,88 @@ import { DaemonCliManager } from './cli-manager.js';
14
14
  import type { ProviderLoader } from '../providers/provider-loader.js';
15
15
  import type { ProviderInstanceManager } from '../providers/provider-instance-manager.js';
16
16
  import { SessionRegistry } from '../sessions/registry.js';
17
+ export declare function readCachedInlineMeshActiveSessionDetails(node: any): Array<Record<string, unknown>>;
18
+ type MeshRefineStageStatus = 'passed' | 'failed' | 'skipped';
19
+ type MeshRefineEffectiveDiffSummary = {
20
+ status: MeshRefineStageStatus;
21
+ /** True when there is at least one root-tree change between base and branch (incl. gitlink bumps). */
22
+ hasEffectiveDiff: boolean;
23
+ baseHead: string;
24
+ branchHead: string;
25
+ /** Root-level paths that differ between base and branch (capped). */
26
+ changedPaths?: string[];
27
+ /** Submodule paths with uncommitted/divergent commits but NO committed gitlink bump in the root tree. */
28
+ submoduleHints?: Array<{
29
+ path: string;
30
+ reason: string;
31
+ }>;
32
+ durationMs: number;
33
+ error?: string;
34
+ stdout?: string;
35
+ stderr?: string;
36
+ };
37
+ /**
38
+ * No-op guard: detect a "silent no-op" merge before the Refinery merge runs.
39
+ *
40
+ * A silent no-op occurs when the refine target branch's ROOT tree is byte-identical
41
+ * to the merge base (origin/main). This is the trap where a submodule (e.g. oss) has
42
+ * real commits but the root branch never committed the gitlink (oss-pointer) bump, so
43
+ * the root diff Refinery would merge is empty. Merging that produces a merge commit with
44
+ * no content change — reported as "success" while the actual work never reaches main.
45
+ *
46
+ * A committed gitlink bump (the legitimate oss-pointer bump) DOES show up in the root
47
+ * tree diff (as a 160000-mode entry), so this guard does NOT block legitimate refines —
48
+ * it only fires when the root tree diff vs base is COMPLETELY empty.
49
+ *
50
+ * Runs after the patch-equivalence gate; the "already merged via other path" case
51
+ * (branch has real changes already present in base) is handled upstream and never
52
+ * reaches here, so an empty root diff at this point is genuinely a no-op.
53
+ */
54
+ export declare function runMeshRefineEffectiveDiffGate(repoRoot: string, baseHead: string, branchHead: string): Promise<MeshRefineEffectiveDiffSummary>;
55
+ /**
56
+ * Result of evaluating whether a `git merge-tree --write-tree` submodule
57
+ * conflict is in fact a trivial gitlink fast-forward that should pass the
58
+ * patch-equivalence gate.
59
+ *
60
+ * `git merge-tree` (and `git merge` with the default recursive strategy)
61
+ * refuses to 3-way merge gitlinks unless the case is "trivial" — and it
62
+ * treats *any* gitlink that differs across merge-base/base/branch as
63
+ * non-trivial, even when the branch-side commit is a strict descendant of the
64
+ * base-side commit (i.e. a real fast-forward). Refinery only ever wants to
65
+ * accept the branch's recorded gitlink, so a fast-forwardable bump is safe to
66
+ * resolve to the branch side without any conflict.
67
+ */
68
+ type GitlinkTrivialFastForwardEvaluation = {
69
+ /** True only when the merge-tree conflict is *fully* explained by trivial-ff gitlinks. */
70
+ trivial: boolean;
71
+ /** Why the evaluation declined to treat the conflict as trivial (set when trivial=false). */
72
+ reason?: string;
73
+ /** Per-path detail for the changed gitlinks that were inspected. */
74
+ gitlinks: Array<{
75
+ path: string;
76
+ baseCommit?: string;
77
+ branchCommit?: string;
78
+ fastForward: boolean;
79
+ }>;
80
+ };
81
+ /**
82
+ * Decide whether a merge-tree submodule conflict between base and branch is a
83
+ * trivial gitlink fast-forward (and nothing else).
84
+ *
85
+ * The conflict is treated as trivial ONLY when:
86
+ * 1. at least one changed gitlink exists,
87
+ * 2. every changed gitlink fast-forwards (base-commit is an ancestor of the
88
+ * branch-commit inside that submodule's repo), and
89
+ * 3. the *only* paths that changed on both sides of the merge (i.e. the paths
90
+ * that could possibly produce a 3-way conflict — the intersection of
91
+ * mergeBase→base and mergeBase→branch changes) are gitlinks. Any
92
+ * overlapping non-gitlink path means a genuine content conflict could be
93
+ * hiding behind the submodule failure, so we keep the block.
94
+ *
95
+ * If any of these fail, the conflict is left as a genuine block. This never
96
+ * passes a regular-file conflict or a diverged (non-ff) gitlink.
97
+ */
98
+ export declare function evaluateGitlinkTrivialFastForward(repoRoot: string, baseHead: string, branchHead: string): GitlinkTrivialFastForwardEvaluation;
17
99
  export interface SessionHostControlPlane {
18
100
  getDiagnostics(payload?: {
19
101
  includeSessions?: boolean;
@@ -55,12 +137,14 @@ export interface CommandRouterDeps {
55
137
  value: any[];
56
138
  };
57
139
  sessionRegistry: SessionRegistry;
58
- /** Callback for CDP manager creation after launch_ide */
140
+ /** Callback after CDP manager created (transport-specific extras) */
59
141
  onCdpManagerCreated?: (ideType: string, manager: DaemonCdpManager) => void;
60
142
  /** Callback after IDE connected (e.g., startAgentStreamPolling) */
61
143
  onIdeConnected?: () => void;
62
144
  /** Callback after status change (stop_ide, restart) */
63
145
  onStatusChange?: () => void;
146
+ /** Callback when a mesh state is invalidated */
147
+ onMeshStateChange?: (meshId: string) => void;
64
148
  /** Callback after chat-related commands */
65
149
  onPostChatCommand?: () => void;
66
150
  /** Get a connected CDP manager (for agent stream reset check) */
@@ -87,10 +171,27 @@ export declare class DaemonCommandRouter {
87
171
  * Allows the MCP server to query mesh data via get_mesh even when
88
172
  * the mesh doesn't exist in the local meshes.json file. */
89
173
  private inlineMeshCache;
174
+ /** Coordinator-owned whole-mesh aggregate status snapshots. Browser callers read this by default. */
175
+ private aggregateMeshStatusCache;
176
+ /** In-memory async Refinery jobs keyed by meshId:nodeId to reject/return duplicate in-flight requests. */
177
+ private runningRefineJobs;
178
+ /** Terminal async Refinery jobs preserve a clear answer after the worktree node has been removed. */
179
+ private terminalRefineJobs;
180
+ /** In-memory async batch Refinery jobs keyed by meshId (one batch convergence per mesh at a time). */
181
+ private runningRefineBatchJobs;
182
+ /** Terminal async batch Refinery jobs preserve the last batch outcome for late readers. */
183
+ private terminalRefineBatchJobs;
90
184
  constructor(deps: CommandRouterDeps);
185
+ private cloneJsonValue;
186
+ private hydrateCachedAggregateMeshStatusFromInline;
187
+ private getCachedAggregateMeshStatus;
188
+ private rememberAggregateMeshStatus;
189
+ getCachedInlineMeshNodes(): any[];
91
190
  getCachedInlineMesh(meshId: string, inlineMesh?: unknown): any | undefined;
92
191
  private warmInlineMeshCache;
93
192
  private getMeshForCommand;
193
+ private invalidateAggregateMeshStatus;
194
+ private requireMeshHostMutationOwner;
94
195
  private updateInlineMeshNode;
95
196
  private removeInlineMeshNode;
96
197
  private normalizeMeshSessionCleanupMode;
@@ -113,6 +214,63 @@ export declare class DaemonCommandRouter {
113
214
  * @param source Log source ('ws' | 'p2p' | 'standalone' | etc.)
114
215
  */
115
216
  execute(cmd: string, args: any, source?: string): Promise<CommandRouterResult>;
217
+ private buildRefineJobKey;
218
+ private buildRefineJobHandle;
219
+ private queueRefineJobEvent;
220
+ private appendRefineJobLedger;
221
+ /**
222
+ * On daemon restart, scan all mesh ledgers for refine jobs that were dispatched
223
+ * but never completed/failed (i.e. the daemon died mid-job). Re-queue each one
224
+ * so the job runs to completion automatically without coordinator intervention.
225
+ */
226
+ resumePendingRefineJobsOnStartup(): Promise<void>;
227
+ private executeMeshRefineNodeSynchronously;
228
+ /**
229
+ * Batch refinery: converge multiple sibling worktree nodes onto the base branch
230
+ * in one sequential pipeline, absorbing the rebase + patch-equivalence churn that
231
+ * arises when several siblings touch the same submodule.
232
+ *
233
+ * Reuses executeMeshRefineNodeSynchronously per node — every node goes through the
234
+ * exact same validation / patch-equivalence / submodule-reachability / merge / cleanup
235
+ * gates, including its built-in auto-rebase onto fresh origin/<base>. Because each
236
+ * node fetches origin/<base> at the start of its own refine, a node merged earlier in
237
+ * the batch advances the base, and the next node's refine auto-rebases onto it before
238
+ * re-running patch-equivalence. No force-push, no reset — conflicting nodes are
239
+ * isolated as blocked_review while the rest of the batch proceeds.
240
+ */
241
+ private batchRefineMeshNodes;
242
+ /**
243
+ * Convergence core shared by the synchronous batch entry and the async batch job.
244
+ * Refines each node in order: the per-node refine pipeline fetches origin/<base>
245
+ * fresh, so each merged sibling advances the base before the next node's auto-rebase
246
+ * + patch-equivalence re-check. A blocked/failed node is isolated; the batch
247
+ * continues with the remaining nodes. Does NOT touch the per-node merge logic — it
248
+ * only sequences calls to executeMeshRefineNodeSynchronously and aggregates outcomes.
249
+ */
250
+ private runMeshRefineBatchConvergence;
251
+ private buildRefineBatchJobKey;
252
+ private buildRefineBatchJobHandle;
253
+ /**
254
+ * Emit a batch Refinery terminal/accepted event through the SAME pending-event +
255
+ * forward mechanism single-node refine uses (queueRefineJobEvent), so the
256
+ * coordinator's existing refine:accepted/completed/failed handling and message
257
+ * renderer apply unchanged. The aggregate per-node results ride along in `result`.
258
+ */
259
+ private queueRefineBatchJobEvent;
260
+ private appendRefineBatchJobLedger;
261
+ private finishMeshRefineBatchJob;
262
+ /**
263
+ * Async entry for the batch Refinery execute path. Mirrors startMeshRefineJob:
264
+ * resolves the plan synchronously (so target/ordering errors and the dry-run shape
265
+ * stay synchronous), then for execute=true registers an in-flight batch job, returns
266
+ * {async:true, status:'accepted', batch:true, ...plan} immediately, and runs the
267
+ * convergence loop in the background — emitting the same terminal refine event.
268
+ * Idempotent: a batch already in flight for this mesh returns the running handle
269
+ * with duplicate:true rather than spawning a second background job.
270
+ */
271
+ private startMeshRefineBatchJob;
272
+ private finishMeshRefineJob;
273
+ private startMeshRefineJob;
116
274
  /**
117
275
  * Daemon-level command execution (IDE start/stop/restart, CLI, detect, logs).
118
276
  * Returns null if not handled at this level → caller delegates to CommandHandler.
@@ -123,3 +281,4 @@ export declare class DaemonCommandRouter {
123
281
  */
124
282
  private stopIde;
125
283
  }
284
+ export {};
@@ -110,12 +110,21 @@ export declare function readProviderChatHistory(agentType: string, options?: {
110
110
  excludeRecentCount?: number;
111
111
  historyBehavior?: ProviderHistoryBehavior;
112
112
  scripts?: ProviderNativeHistoryScripts;
113
+ excludeInProgressTurn?: boolean;
114
+ sessionStartedAtMs?: number;
115
+ envOverrides?: Record<string, string>;
116
+ forceRefresh?: boolean;
113
117
  }): {
114
118
  messages: HistoryMessage[];
115
119
  hasMore: boolean;
116
120
  source: 'provider-native' | 'adhdev-mirror' | 'native-unavailable';
117
121
  sourcePath?: string;
118
122
  sourceMtimeMs?: number;
123
+ providerSessionId?: string;
124
+ workspace?: string;
125
+ nativeHistoryCoverage?: string;
126
+ partialReason?: string;
127
+ unavailableReason?: string;
119
128
  };
120
129
  export declare function listProviderHistorySessions(agentType: string, options?: {
121
130
  canonicalHistory?: ProviderCanonicalHistoryConfig;
@@ -86,6 +86,11 @@ export declare function isStableMachineId(machineId?: string | null): boolean;
86
86
  * Get the config directory path
87
87
  */
88
88
  export declare function getConfigDir(): string;
89
+ /**
90
+ * Get the daemon runtime data directory (~/.adhdev/daemon/).
91
+ * Distinct from the user-config dir so runtime state can be cleared independently.
92
+ */
93
+ export declare function getDaemonDataDir(): string;
89
94
  /**
90
95
  * Load configuration from disk
91
96
  */
@@ -5,7 +5,7 @@
5
5
  * Cloud mode syncs these to D1 via server routes; standalone mode
6
6
  * uses this file as the single source of truth.
7
7
  */
8
- import type { LocalMeshEntry, LocalMeshNodeEntry, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshNodeCapabilities, RepoMeshCoordinatorConfig } from '../repo-mesh-types.js';
8
+ import type { LocalMeshEntry, LocalMeshNodeEntry, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshNodeCapabilities, RepoMeshCoordinatorConfig, RepoMeshHostMetadata, RepoMeshDaemonRole } from '../repo-mesh-types.js';
9
9
  /**
10
10
  * Normalize a Git remote URL into a stable identity string.
11
11
  * e.g. "git@github.com:user/repo.git" → "github.com/user/repo"
@@ -22,6 +22,7 @@ export interface CreateMeshOptions {
22
22
  defaultBranch?: string;
23
23
  policy?: Partial<RepoMeshPolicy>;
24
24
  coordinator?: RepoMeshCoordinatorConfig;
25
+ meshHost?: RepoMeshHostMetadata;
25
26
  }
26
27
  export declare function createMesh(opts: CreateMeshOptions): LocalMeshEntry;
27
28
  export interface UpdateMeshOptions {
@@ -29,23 +30,93 @@ export interface UpdateMeshOptions {
29
30
  defaultBranch?: string;
30
31
  policy?: Partial<RepoMeshPolicy>;
31
32
  coordinator?: RepoMeshCoordinatorConfig;
33
+ meshHost?: RepoMeshHostMetadata;
32
34
  }
33
35
  export declare function updateMesh(meshId: string, opts: UpdateMeshOptions): LocalMeshEntry | undefined;
34
36
  export declare function deleteMesh(meshId: string): boolean;
37
+ export declare function tokenIdForManualPairing(token: string): string;
38
+ export interface ConfigureMeshHostPairingOptions {
39
+ hostAddress: string;
40
+ token: string;
41
+ now?: string;
42
+ }
43
+ export declare function configureMeshHostPairing(meshId: string, opts: ConfigureMeshHostPairingOptions): {
44
+ mesh: LocalMeshEntry;
45
+ meshHost: RepoMeshHostMetadata;
46
+ hostAddress: string;
47
+ } | undefined;
48
+ export interface CreateMeshHostPairingTokenOptions {
49
+ token?: string;
50
+ expiresAt?: string;
51
+ now?: string;
52
+ }
53
+ export declare function createMeshHostPairingToken(meshId: string, opts?: CreateMeshHostPairingTokenOptions): {
54
+ mesh: LocalMeshEntry;
55
+ meshHost: RepoMeshHostMetadata;
56
+ token: string;
57
+ tokenId: string;
58
+ expiresAt?: string;
59
+ } | undefined;
60
+ export interface MeshHostJoinMemberNodeInput {
61
+ id?: string;
62
+ workspace: string;
63
+ repoRoot?: string;
64
+ daemonId?: string;
65
+ machineId?: string;
66
+ userOverrides?: Partial<RepoMeshNodeCapabilities>;
67
+ policy?: RepoMeshNodePolicy;
68
+ role?: RepoMeshDaemonRole;
69
+ }
70
+ export interface ApplyMeshHostJoinOptions {
71
+ token: string;
72
+ memberNode: MeshHostJoinMemberNodeInput;
73
+ memberMeshId?: string;
74
+ now?: string;
75
+ }
76
+ export declare function applyMeshHostJoinRequest(meshId: string, opts: ApplyMeshHostJoinOptions): {
77
+ accepted: true;
78
+ mesh: LocalMeshEntry;
79
+ meshHost: RepoMeshHostMetadata;
80
+ node: LocalMeshNodeEntry;
81
+ tokenId: string;
82
+ } | {
83
+ accepted: false;
84
+ mesh?: LocalMeshEntry;
85
+ meshHost?: RepoMeshHostMetadata;
86
+ tokenId?: string;
87
+ reason: string;
88
+ } | undefined;
89
+ export declare function markMeshHostPairingJoined(meshId: string, opts: {
90
+ hostDaemonId?: string;
91
+ hostNodeId?: string;
92
+ joinedAt?: string;
93
+ token?: string;
94
+ tokenId?: string;
95
+ }): {
96
+ mesh: LocalMeshEntry;
97
+ meshHost: RepoMeshHostMetadata;
98
+ } | undefined;
35
99
  export interface AddNodeOptions {
36
100
  workspace: string;
37
101
  repoRoot?: string;
38
102
  daemonId?: string;
39
103
  machineId?: string;
104
+ capabilities?: string[];
40
105
  userOverrides?: Partial<RepoMeshNodeCapabilities>;
41
106
  policy?: RepoMeshNodePolicy;
42
107
  isLocalWorktree?: boolean;
43
108
  worktreeBranch?: string;
44
109
  clonedFromNodeId?: string;
110
+ worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
111
+ role?: RepoMeshDaemonRole;
45
112
  }
46
113
  export declare function addNode(meshId: string, opts: AddNodeOptions): LocalMeshNodeEntry | undefined;
47
114
  export declare function removeNode(meshId: string, nodeId: string): boolean;
48
115
  export declare function updateNode(meshId: string, nodeId: string, opts: {
49
116
  userOverrides?: Partial<RepoMeshNodeCapabilities>;
50
117
  policy?: RepoMeshNodePolicy;
118
+ worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
119
+ /** Per-node instruction surfaced in the coordinator prompt. Pass an
120
+ * empty string or undefined to clear it. */
121
+ systemPrompt?: string;
51
122
  }): LocalMeshNodeEntry | undefined;
@@ -23,8 +23,12 @@ export interface GitLogResult extends GitRepoIdentity {
23
23
  lastCheckedAt: number;
24
24
  }
25
25
  export interface GitCheckpointResult extends GitRepoIdentity {
26
- commit: string;
26
+ commit?: string;
27
27
  message: string;
28
+ status?: 'created' | 'skipped';
29
+ skipped?: boolean;
30
+ noop?: boolean;
31
+ reason?: 'nothing_to_commit';
28
32
  lastCheckedAt: number;
29
33
  }
30
34
  export interface GitStashPushResult extends GitRepoIdentity {
@@ -43,15 +47,19 @@ export interface GitCommandServices {
43
47
  getStatus?: (params: {
44
48
  workspace: string;
45
49
  refreshUpstream?: boolean;
50
+ includeSubmodules?: boolean;
51
+ submoduleIgnorePaths?: string[];
46
52
  }) => Promise<GitRepoStatus> | GitRepoStatus;
47
53
  getDiffSummary?: (params: {
48
54
  workspace: string;
49
55
  staged?: boolean;
56
+ base?: string;
50
57
  }) => Promise<GitDiffSummary> | GitDiffSummary;
51
58
  getDiffFile?: (params: {
52
59
  workspace: string;
53
60
  path: string;
54
61
  staged?: boolean;
62
+ base?: string;
55
63
  }) => Promise<GitFileDiff> | GitFileDiff;
56
64
  createSnapshot?: (params: {
57
65
  workspace: string;
@@ -3,6 +3,12 @@ export interface GitDiffOptions {
3
3
  timeoutMs?: number;
4
4
  maxFiles?: number;
5
5
  maxBytes?: number;
6
+ /**
7
+ * When set, diff `<baseRef>...HEAD` (merge-base range — "what this branch
8
+ * adds on top of base") instead of the working tree. Staged/untracked
9
+ * sections do not apply in this mode.
10
+ */
11
+ baseRef?: string;
6
12
  }
7
13
  export interface GitFileDiffResult {
8
14
  workspace: string;
@@ -1,4 +1,5 @@
1
1
  import type { GitRepoStatus } from './git-types.js';
2
+ import { type DaemonBuildInfo } from '../build-info.js';
2
3
  export interface GitStatusOptions {
3
4
  timeoutMs?: number;
4
5
  /** When true, include submodule status in the result. Defaults to true. */
@@ -10,6 +11,12 @@ export interface GitStatusOptions {
10
11
  * Callers should opt into this only for convergence-critical surfaces.
11
12
  */
12
13
  refreshUpstream?: boolean;
14
+ /**
15
+ * Test/override seam for the daemon build stamp used by the stale-build
16
+ * detector. Production callers omit this so the real baked-in build commit
17
+ * (getDaemonBuildInfo) is used.
18
+ */
19
+ daemonBuildInfo?: DaemonBuildInfo;
13
20
  }
14
21
  export declare function getGitRepoStatus(workspace: string, options?: GitStatusOptions): Promise<GitRepoStatus>;
15
22
  interface ParsedPorcelainStatus {