@jingyi0605/codingns 0.1.5 → 0.2.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.
Files changed (299) hide show
  1. package/README.md +44 -0
  2. package/bin/codingns.mjs +640 -53
  3. package/dist/public/assets/{TerminalPage-4p6EBqrR.js → TerminalPage-BkjqU9NG.js} +19 -19
  4. package/dist/public/assets/index-C6U8-9jg.css +1 -0
  5. package/dist/public/assets/index-CKSumuV2.js +109 -0
  6. package/dist/public/index.html +2 -2
  7. package/dist/server/config/env.d.ts +2 -0
  8. package/dist/server/config/env.js +8 -1
  9. package/dist/server/config/env.js.map +1 -1
  10. package/dist/server/modules/assistant-capability/assistant-capability-controller.d.ts +89 -0
  11. package/dist/server/modules/assistant-capability/assistant-capability-controller.js +138 -0
  12. package/dist/server/modules/assistant-capability/assistant-capability-controller.js.map +1 -0
  13. package/dist/server/modules/assistant-capability/assistant-capability-service.d.ts +115 -0
  14. package/dist/server/modules/assistant-capability/assistant-capability-service.js +241 -0
  15. package/dist/server/modules/assistant-capability/assistant-capability-service.js.map +1 -0
  16. package/dist/server/modules/butler/butler-control-session-service.js +69 -30
  17. package/dist/server/modules/butler/butler-control-session-service.js.map +1 -1
  18. package/dist/server/modules/butler/butler-follow-up-scheduler.d.ts +9 -0
  19. package/dist/server/modules/butler/butler-follow-up-scheduler.js +47 -11
  20. package/dist/server/modules/butler/butler-follow-up-scheduler.js.map +1 -1
  21. package/dist/server/modules/butler/butler-follow-up-service.d.ts +7 -1
  22. package/dist/server/modules/butler/butler-follow-up-service.js +10 -0
  23. package/dist/server/modules/butler/butler-follow-up-service.js.map +1 -1
  24. package/dist/server/modules/butler/butler-session-service.d.ts +2 -1
  25. package/dist/server/modules/butler/butler-session-service.js +10 -1
  26. package/dist/server/modules/butler/butler-session-service.js.map +1 -1
  27. package/dist/server/modules/butler/butler-session-summary-service.d.ts +8 -1
  28. package/dist/server/modules/butler/butler-session-summary-service.js +34 -7
  29. package/dist/server/modules/butler/butler-session-summary-service.js.map +1 -1
  30. package/dist/server/modules/butler/context-aggregator.js +44 -13
  31. package/dist/server/modules/butler/context-aggregator.js.map +1 -1
  32. package/dist/server/modules/butler/patrol-scheduler.d.ts +9 -0
  33. package/dist/server/modules/butler/patrol-scheduler.js +63 -9
  34. package/dist/server/modules/butler/patrol-scheduler.js.map +1 -1
  35. package/dist/server/modules/butler/session-summary-scheduler.d.ts +9 -0
  36. package/dist/server/modules/butler/session-summary-scheduler.js +47 -11
  37. package/dist/server/modules/butler/session-summary-scheduler.js.map +1 -1
  38. package/dist/server/modules/debug-target/debug-runtime-reconciliation-scheduler.d.ts +38 -0
  39. package/dist/server/modules/debug-target/debug-runtime-reconciliation-scheduler.js +99 -0
  40. package/dist/server/modules/debug-target/debug-runtime-reconciliation-scheduler.js.map +1 -0
  41. package/dist/server/modules/debug-target/debug-target-controller.d.ts +70 -0
  42. package/dist/server/modules/debug-target/debug-target-controller.js +113 -0
  43. package/dist/server/modules/debug-target/debug-target-controller.js.map +1 -0
  44. package/dist/server/modules/debug-target/debug-target-service.d.ts +102 -0
  45. package/dist/server/modules/debug-target/debug-target-service.js +1484 -0
  46. package/dist/server/modules/debug-target/debug-target-service.js.map +1 -0
  47. package/dist/server/modules/debug-target/framework-compatibility-matrix.d.ts +4 -0
  48. package/dist/server/modules/debug-target/framework-compatibility-matrix.js +45 -0
  49. package/dist/server/modules/debug-target/framework-compatibility-matrix.js.map +1 -0
  50. package/dist/server/modules/debug-target/launch-adapter-registry.d.ts +25 -0
  51. package/dist/server/modules/debug-target/launch-adapter-registry.js +445 -0
  52. package/dist/server/modules/debug-target/launch-adapter-registry.js.map +1 -0
  53. package/dist/server/modules/file/file-content-service.d.ts +2 -1
  54. package/dist/server/modules/file/file-content-service.js +53 -0
  55. package/dist/server/modules/file/file-content-service.js.map +1 -1
  56. package/dist/server/modules/file/file-controller.d.ts +12 -1
  57. package/dist/server/modules/file/file-controller.js +72 -1
  58. package/dist/server/modules/file/file-controller.js.map +1 -1
  59. package/dist/server/modules/file/file-preview-link-service.d.ts +22 -0
  60. package/dist/server/modules/file/file-preview-link-service.js +160 -0
  61. package/dist/server/modules/file/file-preview-link-service.js.map +1 -0
  62. package/dist/server/modules/git/commit-orchestrator.d.ts +4 -1
  63. package/dist/server/modules/git/commit-orchestrator.js +18 -1
  64. package/dist/server/modules/git/commit-orchestrator.js.map +1 -1
  65. package/dist/server/modules/git/git-auth.d.ts +25 -0
  66. package/dist/server/modules/git/git-auth.js +88 -0
  67. package/dist/server/modules/git/git-auth.js.map +1 -0
  68. package/dist/server/modules/git/git-controller.d.ts +6 -0
  69. package/dist/server/modules/git/git-controller.js +5 -1
  70. package/dist/server/modules/git/git-controller.js.map +1 -1
  71. package/dist/server/modules/git/git-read-service.d.ts +2 -1
  72. package/dist/server/modules/git/git-read-service.js +19 -2
  73. package/dist/server/modules/git/git-read-service.js.map +1 -1
  74. package/dist/server/modules/git/git-remote-credential-service.d.ts +9 -0
  75. package/dist/server/modules/git/git-remote-credential-service.js +76 -0
  76. package/dist/server/modules/git/git-remote-credential-service.js.map +1 -0
  77. package/dist/server/modules/git/git-write-service.d.ts +5 -2
  78. package/dist/server/modules/git/git-write-service.js +33 -17
  79. package/dist/server/modules/git/git-write-service.js.map +1 -1
  80. package/dist/server/modules/git/types.d.ts +3 -0
  81. package/dist/server/modules/git/workspace-repo-guard.js +3 -2
  82. package/dist/server/modules/git/workspace-repo-guard.js.map +1 -1
  83. package/dist/server/modules/provider/codex-model-options.d.ts +3 -1
  84. package/dist/server/modules/provider/codex-model-options.js +4 -1
  85. package/dist/server/modules/provider/codex-model-options.js.map +1 -1
  86. package/dist/server/modules/provider/opencode-model-options.d.ts +3 -1
  87. package/dist/server/modules/provider/opencode-model-options.js +5 -1
  88. package/dist/server/modules/provider/opencode-model-options.js.map +1 -1
  89. package/dist/server/modules/provider/provider-discovery-helper-client.d.ts +24 -0
  90. package/dist/server/modules/provider/provider-discovery-helper-client.js +14 -0
  91. package/dist/server/modules/provider/provider-discovery-helper-client.js.map +1 -1
  92. package/dist/server/modules/provider/provider-discovery-helper-process.js +54 -0
  93. package/dist/server/modules/provider/provider-discovery-helper-process.js.map +1 -1
  94. package/dist/server/modules/sessions/codex-app-server-helper-client.d.ts +2 -1
  95. package/dist/server/modules/sessions/codex-app-server-helper-client.js +103 -0
  96. package/dist/server/modules/sessions/codex-app-server-helper-client.js.map +1 -1
  97. package/dist/server/modules/sessions/codex-app-server-helper-process.js +106 -1
  98. package/dist/server/modules/sessions/codex-app-server-helper-process.js.map +1 -1
  99. package/dist/server/modules/sessions/session-controller.d.ts +26 -0
  100. package/dist/server/modules/sessions/session-controller.js +39 -1
  101. package/dist/server/modules/sessions/session-controller.js.map +1 -1
  102. package/dist/server/modules/sessions/session-history-service.d.ts +51 -5
  103. package/dist/server/modules/sessions/session-history-service.js +906 -59
  104. package/dist/server/modules/sessions/session-history-service.js.map +1 -1
  105. package/dist/server/modules/sessions/session-live-runtime-service.d.ts +5 -0
  106. package/dist/server/modules/sessions/session-live-runtime-service.js +59 -2
  107. package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
  108. package/dist/server/modules/sessions/session-provider-error-mapper.js +66 -0
  109. package/dist/server/modules/sessions/session-provider-error-mapper.js.map +1 -1
  110. package/dist/server/modules/tasks/event-loop-monitor.d.ts +21 -0
  111. package/dist/server/modules/tasks/event-loop-monitor.js +64 -0
  112. package/dist/server/modules/tasks/event-loop-monitor.js.map +1 -0
  113. package/dist/server/modules/tasks/observability-controller.d.ts +30 -0
  114. package/dist/server/modules/tasks/observability-controller.js +44 -0
  115. package/dist/server/modules/tasks/observability-controller.js.map +1 -0
  116. package/dist/server/modules/tasks/observability-service.d.ts +32 -0
  117. package/dist/server/modules/tasks/observability-service.js +104 -0
  118. package/dist/server/modules/tasks/observability-service.js.map +1 -0
  119. package/dist/server/modules/tasks/scheduler-metrics.d.ts +41 -0
  120. package/dist/server/modules/tasks/scheduler-metrics.js +92 -0
  121. package/dist/server/modules/tasks/scheduler-metrics.js.map +1 -0
  122. package/dist/server/modules/tasks/task-activity-log.d.ts +39 -0
  123. package/dist/server/modules/tasks/task-activity-log.js +43 -0
  124. package/dist/server/modules/tasks/task-activity-log.js.map +1 -0
  125. package/dist/server/modules/tasks/task-helper-client.d.ts +11 -0
  126. package/dist/server/modules/tasks/task-helper-client.js +132 -0
  127. package/dist/server/modules/tasks/task-helper-client.js.map +1 -0
  128. package/dist/server/modules/tasks/task-helper-process-handlers.d.ts +16 -0
  129. package/dist/server/modules/tasks/task-helper-process-handlers.js +14 -0
  130. package/dist/server/modules/tasks/task-helper-process-handlers.js.map +1 -0
  131. package/dist/server/modules/tasks/task-helper-process.d.ts +1 -0
  132. package/dist/server/modules/tasks/task-helper-process.js +49 -0
  133. package/dist/server/modules/tasks/task-helper-process.js.map +1 -0
  134. package/dist/server/modules/tasks/task-lane-executors.d.ts +2 -0
  135. package/dist/server/modules/tasks/task-lane-executors.js +15 -0
  136. package/dist/server/modules/tasks/task-lane-executors.js.map +1 -0
  137. package/dist/server/modules/tasks/task-manager.d.ts +15 -0
  138. package/dist/server/modules/tasks/task-manager.js +36 -0
  139. package/dist/server/modules/tasks/task-manager.js.map +1 -0
  140. package/dist/server/modules/tasks/task-metrics.d.ts +9 -0
  141. package/dist/server/modules/tasks/task-metrics.js +81 -0
  142. package/dist/server/modules/tasks/task-metrics.js.map +1 -0
  143. package/dist/server/modules/tasks/task-registry.d.ts +7 -0
  144. package/dist/server/modules/tasks/task-registry.js +21 -0
  145. package/dist/server/modules/tasks/task-registry.js.map +1 -0
  146. package/dist/server/modules/tasks/task-scheduler.d.ts +31 -0
  147. package/dist/server/modules/tasks/task-scheduler.js +473 -0
  148. package/dist/server/modules/tasks/task-scheduler.js.map +1 -0
  149. package/dist/server/modules/tasks/task-types.d.ts +106 -0
  150. package/dist/server/modules/tasks/task-types.js +23 -0
  151. package/dist/server/modules/tasks/task-types.js.map +1 -0
  152. package/dist/server/modules/terminal/command-template-service.d.ts +4 -0
  153. package/dist/server/modules/terminal/command-template-service.js +5 -3
  154. package/dist/server/modules/terminal/command-template-service.js.map +1 -1
  155. package/dist/server/modules/terminal/runtime/terminal-log-spooler.d.ts +7 -3
  156. package/dist/server/modules/terminal/runtime/terminal-log-spooler.js +95 -15
  157. package/dist/server/modules/terminal/runtime/terminal-log-spooler.js.map +1 -1
  158. package/dist/server/modules/terminal/runtime/terminal-log-writer-client.d.ts +21 -0
  159. package/dist/server/modules/terminal/runtime/terminal-log-writer-client.js +144 -0
  160. package/dist/server/modules/terminal/runtime/terminal-log-writer-client.js.map +1 -0
  161. package/dist/server/modules/terminal/runtime/terminal-log-writer-process.d.ts +1 -0
  162. package/dist/server/modules/terminal/runtime/terminal-log-writer-process.js +187 -0
  163. package/dist/server/modules/terminal/runtime/terminal-log-writer-process.js.map +1 -0
  164. package/dist/server/modules/terminal/terminal-service.d.ts +12 -0
  165. package/dist/server/modules/terminal/terminal-service.js +34 -17
  166. package/dist/server/modules/terminal/terminal-service.js.map +1 -1
  167. package/dist/server/modules/workbench/workbench-service.d.ts +23 -2
  168. package/dist/server/modules/workbench/workbench-service.js +126 -15
  169. package/dist/server/modules/workbench/workbench-service.js.map +1 -1
  170. package/dist/server/modules/workbench/workspace-panel-snapshot-service.d.ts +5 -1
  171. package/dist/server/modules/workbench/workspace-panel-snapshot-service.js +88 -19
  172. package/dist/server/modules/workbench/workspace-panel-snapshot-service.js.map +1 -1
  173. package/dist/server/modules/workspace/workspace-code-composition.d.ts +2 -0
  174. package/dist/server/modules/workspace/workspace-code-composition.js +154 -0
  175. package/dist/server/modules/workspace/workspace-code-composition.js.map +1 -0
  176. package/dist/server/modules/workspace/workspace-controller.d.ts +14 -0
  177. package/dist/server/modules/workspace/workspace-controller.js +19 -0
  178. package/dist/server/modules/workspace/workspace-controller.js.map +1 -1
  179. package/dist/server/modules/workspace/workspace-service.d.ts +21 -14
  180. package/dist/server/modules/workspace/workspace-service.js +183 -234
  181. package/dist/server/modules/workspace/workspace-service.js.map +1 -1
  182. package/dist/server/modules/worktree/worktree-cleanup-service.d.ts +35 -0
  183. package/dist/server/modules/worktree/worktree-cleanup-service.js +210 -0
  184. package/dist/server/modules/worktree/worktree-cleanup-service.js.map +1 -0
  185. package/dist/server/modules/worktree/worktree-controller.d.ts +44 -0
  186. package/dist/server/modules/worktree/worktree-controller.js +40 -0
  187. package/dist/server/modules/worktree/worktree-controller.js.map +1 -0
  188. package/dist/server/modules/worktree/worktree-manager.d.ts +34 -0
  189. package/dist/server/modules/worktree/worktree-manager.js +292 -0
  190. package/dist/server/modules/worktree/worktree-manager.js.map +1 -0
  191. package/dist/server/modules/worktree/worktree-merge-service.d.ts +52 -0
  192. package/dist/server/modules/worktree/worktree-merge-service.js +293 -0
  193. package/dist/server/modules/worktree/worktree-merge-service.js.map +1 -0
  194. package/dist/server/modules/worktree/worktree-sync-service.d.ts +23 -0
  195. package/dist/server/modules/worktree/worktree-sync-service.js +166 -0
  196. package/dist/server/modules/worktree/worktree-sync-service.js.map +1 -0
  197. package/dist/server/routes/assistant.d.ts +3 -0
  198. package/dist/server/routes/assistant.js +15 -0
  199. package/dist/server/routes/assistant.js.map +1 -0
  200. package/dist/server/routes/debug-targets.d.ts +3 -0
  201. package/dist/server/routes/debug-targets.js +15 -0
  202. package/dist/server/routes/debug-targets.js.map +1 -0
  203. package/dist/server/routes/files.js +2 -0
  204. package/dist/server/routes/files.js.map +1 -1
  205. package/dist/server/routes/git.js +1 -0
  206. package/dist/server/routes/git.js.map +1 -1
  207. package/dist/server/routes/observability.d.ts +3 -0
  208. package/dist/server/routes/observability.js +7 -0
  209. package/dist/server/routes/observability.js.map +1 -0
  210. package/dist/server/routes/sessions.js +1 -0
  211. package/dist/server/routes/sessions.js.map +1 -1
  212. package/dist/server/routes/workspaces.js +2 -0
  213. package/dist/server/routes/workspaces.js.map +1 -1
  214. package/dist/server/routes/worktrees.d.ts +3 -0
  215. package/dist/server/routes/worktrees.js +8 -0
  216. package/dist/server/routes/worktrees.js.map +1 -0
  217. package/dist/server/server/create-server.d.ts +38 -0
  218. package/dist/server/server/create-server.js +106 -11
  219. package/dist/server/server/create-server.js.map +1 -1
  220. package/dist/server/shared/utils/command-availability.d.ts +1 -0
  221. package/dist/server/shared/utils/command-availability.js +83 -0
  222. package/dist/server/shared/utils/command-availability.js.map +1 -0
  223. package/dist/server/shared/utils/secret-box.d.ts +2 -0
  224. package/dist/server/shared/utils/secret-box.js +29 -0
  225. package/dist/server/shared/utils/secret-box.js.map +1 -0
  226. package/dist/server/shared/utils/terminal-debug-log.js +5 -3
  227. package/dist/server/shared/utils/terminal-debug-log.js.map +1 -1
  228. package/dist/server/storage/repositories/ai-fallback-edit-repository.d.ts +11 -0
  229. package/dist/server/storage/repositories/ai-fallback-edit-repository.js +118 -0
  230. package/dist/server/storage/repositories/ai-fallback-edit-repository.js.map +1 -0
  231. package/dist/server/storage/repositories/debug-runtime-session-repository.d.ts +11 -0
  232. package/dist/server/storage/repositories/debug-runtime-session-repository.js +100 -0
  233. package/dist/server/storage/repositories/debug-runtime-session-repository.js.map +1 -0
  234. package/dist/server/storage/repositories/debug-service-repository.d.ts +9 -0
  235. package/dist/server/storage/repositories/debug-service-repository.js +99 -0
  236. package/dist/server/storage/repositories/debug-service-repository.js.map +1 -0
  237. package/dist/server/storage/repositories/debug-target-repository.d.ts +11 -0
  238. package/dist/server/storage/repositories/debug-target-repository.js +100 -0
  239. package/dist/server/storage/repositories/debug-target-repository.js.map +1 -0
  240. package/dist/server/storage/repositories/framework-analysis-result-repository.d.ts +9 -0
  241. package/dist/server/storage/repositories/framework-analysis-result-repository.js +98 -0
  242. package/dist/server/storage/repositories/framework-analysis-result-repository.js.map +1 -0
  243. package/dist/server/storage/repositories/git-remote-credential-repository.d.ts +9 -0
  244. package/dist/server/storage/repositories/git-remote-credential-repository.js +51 -0
  245. package/dist/server/storage/repositories/git-remote-credential-repository.js.map +1 -0
  246. package/dist/server/storage/repositories/port-lease-repository.d.ts +12 -0
  247. package/dist/server/storage/repositories/port-lease-repository.js +124 -0
  248. package/dist/server/storage/repositories/port-lease-repository.js.map +1 -0
  249. package/dist/server/storage/repositories/runtime-binding-repository.d.ts +10 -0
  250. package/dist/server/storage/repositories/runtime-binding-repository.js +89 -0
  251. package/dist/server/storage/repositories/runtime-binding-repository.js.map +1 -0
  252. package/dist/server/storage/repositories/session-fork-repository.d.ts +8 -0
  253. package/dist/server/storage/repositories/session-fork-repository.js +69 -0
  254. package/dist/server/storage/repositories/session-fork-repository.js.map +1 -0
  255. package/dist/server/storage/repositories/session-index-repository.js +40 -2
  256. package/dist/server/storage/repositories/session-index-repository.js.map +1 -1
  257. package/dist/server/storage/repositories/terminal-command-template-repository.js +77 -4
  258. package/dist/server/storage/repositories/terminal-command-template-repository.js.map +1 -1
  259. package/dist/server/storage/repositories/terminal-instance-repository.js +89 -7
  260. package/dist/server/storage/repositories/terminal-instance-repository.js.map +1 -1
  261. package/dist/server/storage/repositories/workspace-navigation-state-repository.d.ts +9 -0
  262. package/dist/server/storage/repositories/workspace-navigation-state-repository.js +49 -0
  263. package/dist/server/storage/repositories/workspace-navigation-state-repository.js.map +1 -0
  264. package/dist/server/storage/repositories/workspace-repository.d.ts +7 -1
  265. package/dist/server/storage/repositories/workspace-repository.js +32 -8
  266. package/dist/server/storage/repositories/workspace-repository.js.map +1 -1
  267. package/dist/server/storage/repositories/workspace-worktree-repository.d.ts +13 -0
  268. package/dist/server/storage/repositories/workspace-worktree-repository.js +158 -0
  269. package/dist/server/storage/repositories/workspace-worktree-repository.js.map +1 -0
  270. package/dist/server/storage/sqlite/client.js +408 -0
  271. package/dist/server/storage/sqlite/client.js.map +1 -1
  272. package/dist/server/storage/sqlite/schema.sql +268 -0
  273. package/dist/server/types/domain.d.ts +256 -1
  274. package/dist/server/ws/workbench-ws-hub.js +33 -9
  275. package/dist/server/ws/workbench-ws-hub.js.map +1 -1
  276. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.d.ts +6 -1
  277. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js +240 -7
  278. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js.map +1 -1
  279. package/node_modules/@codingns/session-sync-core/dist/providers/codex.d.ts +26 -1
  280. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +507 -2
  281. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -1
  282. package/node_modules/@codingns/session-sync-core/dist/providers/gemini.js +94 -5
  283. package/node_modules/@codingns/session-sync-core/dist/providers/gemini.js.map +1 -1
  284. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.d.ts +5 -1
  285. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js +293 -3
  286. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js.map +1 -1
  287. package/node_modules/@codingns/session-sync-core/dist/providers/utils.d.ts +1 -0
  288. package/node_modules/@codingns/session-sync-core/dist/providers/utils.js +117 -17
  289. package/node_modules/@codingns/session-sync-core/dist/providers/utils.js.map +1 -1
  290. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.d.ts +10 -0
  291. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js +128 -8
  292. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js.map +1 -1
  293. package/node_modules/@codingns/session-sync-core/dist/services.d.ts +2 -1
  294. package/node_modules/@codingns/session-sync-core/dist/services.js +55 -8
  295. package/node_modules/@codingns/session-sync-core/dist/services.js.map +1 -1
  296. package/node_modules/@codingns/session-sync-core/dist/types.d.ts +33 -0
  297. package/package.json +1 -1
  298. package/dist/public/assets/index-CxeghocY.css +0 -1
  299. package/dist/public/assets/index-DXusStl0.js +0 -108
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/routes/git.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAoB,EACpB,aAA4B;IAE5B,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE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,aAAa,CAAC,UAAU,CAAC,CAAC;IACtD,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ import type { ObservabilityController } from "../modules/tasks/observability-controller.js";
3
+ export declare function registerObservabilityRoutes(app: FastifyInstance, observabilityController: ObservabilityController): Promise<void>;
@@ -0,0 +1,7 @@
1
+ export async function registerObservabilityRoutes(app, observabilityController) {
2
+ app.post("/api/observability/runtime/session", observabilityController.createRuntimeSession);
3
+ app.post("/api/observability/runtime/session/:sessionId/heartbeat", observabilityController.heartbeatRuntimeSession);
4
+ app.delete("/api/observability/runtime/session/:sessionId", observabilityController.closeRuntimeSession);
5
+ app.get("/api/observability/runtime", observabilityController.getRuntimeSnapshot);
6
+ }
7
+ //# sourceMappingURL=observability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observability.js","sourceRoot":"","sources":["../../../src/routes/observability.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,GAAoB,EACpB,uBAAgD;IAEhD,GAAG,CAAC,IAAI,CAAC,oCAAoC,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;IAC7F,GAAG,CAAC,IAAI,CACN,yDAAyD,EACzD,uBAAuB,CAAC,uBAAuB,CAChD,CAAC;IACF,GAAG,CAAC,MAAM,CACR,+CAA+C,EAC/C,uBAAuB,CAAC,mBAAmB,CAC5C,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,4BAA4B,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;AACpF,CAAC"}
@@ -14,6 +14,7 @@ export async function registerSessionRoutes(app, sessionController) {
14
14
  app.patch("/api/sessions/:sessionId/title", sessionController.renameTitle);
15
15
  app.patch("/api/sessions/:sessionId/archive", sessionController.updateArchiveState);
16
16
  app.patch("/api/sessions/:sessionId/favorite", sessionController.updateFavoriteState);
17
+ app.post("/api/sessions/:sessionId/forks", sessionController.fork);
17
18
  app.post("/api/sessions/:sessionId/messages", sessionController.sendMessage);
18
19
  app.post("/api/sessions/:sessionId/messages/live", {
19
20
  bodyLimit: SESSION_MESSAGE_BODY_LIMIT_BYTES
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/routes/sessions.ts"],"names":[],"mappings":"AAIA,yDAAyD;AACzD,iDAAiD;AACjD,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjE,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,GAAoB,EACpB,iBAAoC;IAEpC,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACjD,GAAG,CAAC,GAAG,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACjE,GAAG,CAAC,GAAG,CAAC,wCAAwC,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC;IACrF,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7E,GAAG,CAAC,GAAG,CAAC,4DAA4D,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACxG,GAAG,CAAC,GAAG,CAAC,uCAAuC,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC;IACpF,GAAG,CAAC,GAAG,CAAC,8CAA8C,EAAE,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;IAClG,GAAG,CAAC,GAAG,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACvE,GAAG,CAAC,GAAG,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC1E,GAAG,CAAC,KAAK,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC3E,GAAG,CAAC,KAAK,CAAC,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,CACN,wCAAwC,EACxC;QACE,SAAS,EAAE,gCAAgC;KAC5C,EACD,iBAAiB,CAAC,eAAe,CAClC,CAAC;IACF,GAAG,CAAC,IAAI,CACN,+DAA+D,EAC/D,iBAAiB,CAAC,sBAAsB,CACzC,CAAC;IACF,GAAG,CAAC,IAAI,CACN,gCAAgC,EAChC;QACE,SAAS,EAAE,gCAAgC;KAC5C,EACD,iBAAiB,CAAC,kBAAkB,CACrC,CAAC;IACF,GAAG,CAAC,IAAI,CAAC,mDAAmD,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IACpG,GAAG,CAAC,IAAI,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC5E,GAAG,CAAC,IAAI,CAAC,+BAA+B,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACtE,GAAG,CAAC,IAAI,CAAC,iCAAiC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACtE,GAAG,CAAC,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzD,GAAG,CAAC,IAAI,CACN,0BAA0B,EAC1B;QACE,SAAS,EAAE,gCAAgC;KAC5C,EACD,iBAAiB,CAAC,SAAS,CAC5B,CAAC;IACF,GAAG,CAAC,MAAM,CAAC,6CAA6C,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;AACnG,CAAC"}
@@ -4,6 +4,8 @@ export async function registerWorkspaceRoutes(app, workspaceController) {
4
4
  app.post("/api/workspaces/directories", workspaceController.createDirectory);
5
5
  app.post("/api/workspaces/import", workspaceController.import);
6
6
  app.post("/api/workspaces/clone", workspaceController.clone);
7
+ app.put("/api/workspaces/reorder", workspaceController.reorder);
8
+ app.put("/api/workspaces/:workspaceId/navigation-state", workspaceController.updateNavigationState);
7
9
  app.get("/api/workspaces/:workspaceId/management", workspaceController.getManagementSummary);
8
10
  app.delete("/api/workspaces/:workspaceId", workspaceController.remove);
9
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/routes/workspaces.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,GAAoB,EACpB,mBAAwC;IAExC,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACrD,GAAG,CAAC,GAAG,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC9D,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC7E,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC/D,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7D,GAAG,CAAC,GAAG,CAAC,yCAAyC,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAC7F,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/routes/workspaces.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,GAAoB,EACpB,mBAAwC;IAExC,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACrD,GAAG,CAAC,GAAG,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC9D,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC7E,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC/D,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7D,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAChE,GAAG,CAAC,GAAG,CAAC,+CAA+C,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;IACpG,GAAG,CAAC,GAAG,CAAC,yCAAyC,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAC7F,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ import type { WorktreeController } from "../modules/worktree/worktree-controller.js";
3
+ export declare function registerWorktreeRoutes(app: FastifyInstance, worktreeController: WorktreeController): Promise<void>;
@@ -0,0 +1,8 @@
1
+ export async function registerWorktreeRoutes(app, worktreeController) {
2
+ app.get("/api/worktrees/tree", worktreeController.getTree);
3
+ app.post("/api/worktrees", worktreeController.create);
4
+ app.post("/api/worktrees/:workspaceId/merge-preview", worktreeController.getMergePreview);
5
+ app.post("/api/worktrees/:workspaceId/merge-into-parent", worktreeController.mergeIntoParent);
6
+ app.post("/api/worktrees/:workspaceId/cleanup", worktreeController.cleanup);
7
+ }
8
+ //# sourceMappingURL=worktrees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktrees.js","sourceRoot":"","sources":["../../../src/routes/worktrees.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,GAAoB,EACpB,kBAAsC;IAEtC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACtD,GAAG,CAAC,IAAI,CAAC,2CAA2C,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAC1F,GAAG,CAAC,IAAI,CAAC,+CAA+C,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAC9F,GAAG,CAAC,IAAI,CAAC,qCAAqC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC9E,CAAC"}
@@ -18,8 +18,11 @@ import { ProjectMemoryService } from "../modules/butler/project-memory-service.j
18
18
  import { SessionSummaryScheduler } from "../modules/butler/session-summary-scheduler.js";
19
19
  import { VerificationRunService } from "../modules/butler/verification-run-service.js";
20
20
  import { ClientService } from "../modules/client/client-service.js";
21
+ import { DebugRuntimeReconciliationScheduler } from "../modules/debug-target/debug-runtime-reconciliation-scheduler.js";
22
+ import { DebugTargetService } from "../modules/debug-target/debug-target-service.js";
21
23
  import { FileContentService } from "../modules/file/file-content-service.js";
22
24
  import { FileContextService } from "../modules/file/file-context-service.js";
25
+ import { FilePreviewLinkService } from "../modules/file/file-preview-link-service.js";
23
26
  import { FilePreviewService } from "../modules/file/file-preview-service.js";
24
27
  import { FileSearchService } from "../modules/file/file-search-service.js";
25
28
  import { FileTreeService } from "../modules/file/file-tree-service.js";
@@ -33,13 +36,19 @@ import { SessionChangedFileService } from "../modules/sessions/session-changed-f
33
36
  import { SessionHistoryService } from "../modules/sessions/session-history-service.js";
34
37
  import { SessionLiveRuntimeService } from "../modules/sessions/session-live-runtime-service.js";
35
38
  import { SessionMessageAttachmentService } from "../modules/sessions/session-message-attachment-service.js";
39
+ import { RuntimeObservabilityService } from "../modules/tasks/observability-service.js";
36
40
  import { CommandTemplateService } from "../modules/terminal/command-template-service.js";
37
41
  import { TerminalService } from "../modules/terminal/terminal-service.js";
38
42
  import { WorkbenchService } from "../modules/workbench/workbench-service.js";
39
43
  import { WorkspacePanelSnapshotService } from "../modules/workbench/workspace-panel-snapshot-service.js";
44
+ import { WorktreeCleanupService } from "../modules/worktree/worktree-cleanup-service.js";
45
+ import { WorktreeMergeService } from "../modules/worktree/worktree-merge-service.js";
46
+ import { WorktreeManager } from "../modules/worktree/worktree-manager.js";
47
+ import { WorktreeSyncService } from "../modules/worktree/worktree-sync-service.js";
40
48
  import { WorkspaceService } from "../modules/workspace/workspace-service.js";
41
49
  import { AuthTokenRepository } from "../storage/repositories/auth-token-repository.js";
42
50
  import { AuthUserRepository } from "../storage/repositories/auth-user-repository.js";
51
+ import { AiFallbackEditRepository } from "../storage/repositories/ai-fallback-edit-repository.js";
43
52
  import { BootstrapStateRepository } from "../storage/repositories/bootstrap-state-repository.js";
44
53
  import { ButlerControlSessionRepository } from "../storage/repositories/butler-control-session-repository.js";
45
54
  import { ButlerControlEventRepository } from "../storage/repositories/butler-control-event-repository.js";
@@ -55,10 +64,18 @@ import { PatrolRunRepository } from "../storage/repositories/patrol-run-reposito
55
64
  import { ProjectMemoryRepository } from "../storage/repositories/project-memory-repository.js";
56
65
  import { VerificationRunRepository } from "../storage/repositories/verification-run-repository.js";
57
66
  import { CommitRuleProfileRepository } from "../storage/repositories/commit-rule-profile-repository.js";
67
+ import { DebugRuntimeSessionRepository } from "../storage/repositories/debug-runtime-session-repository.js";
68
+ import { DebugServiceRepository } from "../storage/repositories/debug-service-repository.js";
69
+ import { DebugTargetRepository } from "../storage/repositories/debug-target-repository.js";
58
70
  import { FileContextBindingRepository } from "../storage/repositories/file-context-binding-repository.js";
71
+ import { FrameworkAnalysisResultRepository } from "../storage/repositories/framework-analysis-result-repository.js";
72
+ import { GitRemoteCredentialRepository } from "../storage/repositories/git-remote-credential-repository.js";
73
+ import { PortLeaseRepository } from "../storage/repositories/port-lease-repository.js";
59
74
  import { RecentFileRepository } from "../storage/repositories/recent-file-repository.js";
75
+ import { RuntimeBindingRepository } from "../storage/repositories/runtime-binding-repository.js";
60
76
  import { SessionBindingRepository } from "../storage/repositories/session-binding-repository.js";
61
77
  import { SessionChangedFileRepository } from "../storage/repositories/session-changed-file-repository.js";
78
+ import { SessionForkRepository } from "../storage/repositories/session-fork-repository.js";
62
79
  import { SessionIndexRepository } from "../storage/repositories/session-index-repository.js";
63
80
  import { SessionCheckpointRepository } from "../storage/repositories/session-checkpoint-repository.js";
64
81
  import { SessionMessageAttachmentRepository } from "../storage/repositories/session-message-attachment-repository.js";
@@ -74,6 +91,8 @@ import { TerminalRuntimeSessionRepository } from "../storage/repositories/termin
74
91
  import { UserPreferenceProfileRepository } from "../storage/repositories/user-preference-profile-repository.js";
75
92
  import { UserQuickPhrasePreferenceRepository } from "../storage/repositories/user-quick-phrase-preference-repository.js";
76
93
  import { WorkspaceRepository } from "../storage/repositories/workspace-repository.js";
94
+ import { WorkspaceWorktreeRepository } from "../storage/repositories/workspace-worktree-repository.js";
95
+ import { WorkspaceNavigationStateRepository } from "../storage/repositories/workspace-navigation-state-repository.js";
77
96
  export declare function createServer(config: HostConfig): {
78
97
  app: Fastify.FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, Fastify.FastifyBaseLogger, Fastify.FastifyTypeProviderDefault> & PromiseLike<Fastify.FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, Fastify.FastifyBaseLogger, Fastify.FastifyTypeProviderDefault>> & {
79
98
  __linterBrands: "SafePromiseLike";
@@ -86,6 +105,15 @@ export declare function createServer(config: HostConfig): {
86
105
  authUserRepository: AuthUserRepository;
87
106
  authTokenRepository: AuthTokenRepository;
88
107
  workspaceRepository: WorkspaceRepository;
108
+ workspaceWorktreeRepository: WorkspaceWorktreeRepository;
109
+ workspaceNavigationStateRepository: WorkspaceNavigationStateRepository;
110
+ debugTargetRepository: DebugTargetRepository;
111
+ debugServiceRepository: DebugServiceRepository;
112
+ frameworkAnalysisResultRepository: FrameworkAnalysisResultRepository;
113
+ debugRuntimeSessionRepository: DebugRuntimeSessionRepository;
114
+ portLeaseRepository: PortLeaseRepository;
115
+ runtimeBindingRepository: RuntimeBindingRepository;
116
+ aiFallbackEditRepository: AiFallbackEditRepository;
89
117
  butlerControlSessionRepository: ButlerControlSessionRepository;
90
118
  butlerControlEventRepository: ButlerControlEventRepository;
91
119
  butlerFollowUpTaskRepository: ButlerFollowUpTaskRepository;
@@ -100,10 +128,12 @@ export declare function createServer(config: HostConfig): {
100
128
  patrolRunRepository: PatrolRunRepository;
101
129
  verificationRunRepository: VerificationRunRepository;
102
130
  commitRuleProfileRepository: CommitRuleProfileRepository;
131
+ gitRemoteCredentialRepository: GitRemoteCredentialRepository;
103
132
  recentFileRepository: RecentFileRepository;
104
133
  fileContextBindingRepository: FileContextBindingRepository;
105
134
  sessionBindingRepository: SessionBindingRepository;
106
135
  sessionChangedFileRepository: SessionChangedFileRepository;
136
+ sessionForkRepository: SessionForkRepository;
107
137
  sessionCheckpointRepository: SessionCheckpointRepository;
108
138
  sessionIndexRepository: SessionIndexRepository;
109
139
  sessionMessageAttachmentRepository: SessionMessageAttachmentRepository;
@@ -122,8 +152,14 @@ export declare function createServer(config: HostConfig): {
122
152
  modules: {
123
153
  bootstrapService: BootstrapService;
124
154
  clientService: ClientService;
155
+ debugTargetService: DebugTargetService;
156
+ debugRuntimeReconciliationScheduler: DebugRuntimeReconciliationScheduler;
125
157
  authService: AuthService;
126
158
  workspaceService: WorkspaceService;
159
+ worktreeManager: WorktreeManager;
160
+ worktreeSyncService: WorktreeSyncService;
161
+ worktreeMergeService: WorktreeMergeService;
162
+ worktreeCleanupService: WorktreeCleanupService;
127
163
  workbenchService: WorkbenchService;
128
164
  butlerProfileService: ButlerProfileService;
129
165
  butlerSessionLiveRuntimeService: SessionLiveRuntimeService;
@@ -146,6 +182,7 @@ export declare function createServer(config: HostConfig): {
146
182
  fileSearchService: FileSearchService;
147
183
  fileContentService: FileContentService;
148
184
  filePreviewService: FilePreviewService;
185
+ filePreviewLinkService: FilePreviewLinkService;
149
186
  fileContextService: FileContextService;
150
187
  recentFileService: RecentFileService;
151
188
  gitReadService: GitReadService;
@@ -153,6 +190,7 @@ export declare function createServer(config: HostConfig): {
153
190
  commitOrchestrator: CommitOrchestrator;
154
191
  quickPhraseService: QuickPhraseService;
155
192
  preferenceProfileService: PreferenceProfileService;
193
+ runtimeObservabilityService: RuntimeObservabilityService;
156
194
  sessionHistoryService: SessionHistoryService;
157
195
  sessionChangedFileService: SessionChangedFileService;
158
196
  sessionMessageAttachmentService: SessionMessageAttachmentService;
@@ -3,6 +3,8 @@ import Fastify from "fastify";
3
3
  import { createAuthGuard } from "../middlewares/auth-guard.js";
4
4
  import { AuthController } from "../modules/auth/auth-controller.js";
5
5
  import { AuthService } from "../modules/auth/auth-service.js";
6
+ import { AssistantCapabilityController } from "../modules/assistant-capability/assistant-capability-controller.js";
7
+ import { AssistantCapabilityService } from "../modules/assistant-capability/assistant-capability-service.js";
6
8
  import { BootstrapController } from "../modules/bootstrap/bootstrap-controller.js";
7
9
  import { BootstrapService } from "../modules/bootstrap/bootstrap-service.js";
8
10
  import { ButlerControlSessionService } from "../modules/butler/butler-control-session-service.js";
@@ -32,11 +34,15 @@ import { SessionSummaryScheduler } from "../modules/butler/session-summary-sched
32
34
  import { VerificationRunService } from "../modules/butler/verification-run-service.js";
33
35
  import { ClientController } from "../modules/client/client-controller.js";
34
36
  import { ClientService } from "../modules/client/client-service.js";
37
+ import { DebugTargetController } from "../modules/debug-target/debug-target-controller.js";
38
+ import { DebugRuntimeReconciliationScheduler } from "../modules/debug-target/debug-runtime-reconciliation-scheduler.js";
39
+ import { DebugTargetService } from "../modules/debug-target/debug-target-service.js";
35
40
  import { FileAccessGuard } from "../modules/file/file-access-guard.js";
36
41
  import { FileContentService } from "../modules/file/file-content-service.js";
37
42
  import { FileContextController } from "../modules/file/file-context-controller.js";
38
43
  import { FileContextService } from "../modules/file/file-context-service.js";
39
44
  import { FileController } from "../modules/file/file-controller.js";
45
+ import { FilePreviewLinkService } from "../modules/file/file-preview-link-service.js";
40
46
  import { FilePreviewService } from "../modules/file/file-preview-service.js";
41
47
  import { FileSearchService } from "../modules/file/file-search-service.js";
42
48
  import { FileTreeService } from "../modules/file/file-tree-service.js";
@@ -47,6 +53,7 @@ import { CommitOrchestrator } from "../modules/git/commit-orchestrator.js";
47
53
  import { CommitRuleEngine } from "../modules/git/commit-rule-engine.js";
48
54
  import { GitCommandRunner } from "../modules/git/git-command-runner.js";
49
55
  import { GitController } from "../modules/git/git-controller.js";
56
+ import { GitRemoteCredentialService } from "../modules/git/git-remote-credential-service.js";
50
57
  import { GitReadService } from "../modules/git/git-read-service.js";
51
58
  import { GitRuleRepository } from "../modules/git/git-rule-repository.js";
52
59
  import { GitWriteService } from "../modules/git/git-write-service.js";
@@ -62,6 +69,13 @@ import { SessionActivityAuthorityService } from "../modules/sessions/session-act
62
69
  import { SessionHistoryService } from "../modules/sessions/session-history-service.js";
63
70
  import { SessionLiveRuntimeService } from "../modules/sessions/session-live-runtime-service.js";
64
71
  import { SessionMessageAttachmentService } from "../modules/sessions/session-message-attachment-service.js";
72
+ import { EventLoopMonitor } from "../modules/tasks/event-loop-monitor.js";
73
+ import { ObservabilityController } from "../modules/tasks/observability-controller.js";
74
+ import { RuntimeObservabilityService } from "../modules/tasks/observability-service.js";
75
+ import { SchedulerMetrics } from "../modules/tasks/scheduler-metrics.js";
76
+ import { TaskActivityLog } from "../modules/tasks/task-activity-log.js";
77
+ import { createTaskManager } from "../modules/tasks/task-manager.js";
78
+ import { createHostTaskLaneExecutors } from "../modules/tasks/task-lane-executors.js";
65
79
  import { CommandTemplateService } from "../modules/terminal/command-template-service.js";
66
80
  import { TerminalController } from "../modules/terminal/terminal-controller.js";
67
81
  import { TemplateReverseProxyService } from "../modules/terminal/template-reverse-proxy-service.js";
@@ -70,13 +84,21 @@ import { WorkbenchController } from "../modules/workbench/workbench-controller.j
70
84
  import { WorkbenchService } from "../modules/workbench/workbench-service.js";
71
85
  import { WorkspacePanelSnapshotService } from "../modules/workbench/workspace-panel-snapshot-service.js";
72
86
  import { WorkspaceFileWatcher } from "../modules/workbench/workspace-file-watcher.js";
87
+ import { WorktreeController } from "../modules/worktree/worktree-controller.js";
88
+ import { WorktreeCleanupService } from "../modules/worktree/worktree-cleanup-service.js";
89
+ import { WorktreeMergeService } from "../modules/worktree/worktree-merge-service.js";
90
+ import { WorktreeManager } from "../modules/worktree/worktree-manager.js";
91
+ import { WorktreeSyncService } from "../modules/worktree/worktree-sync-service.js";
73
92
  import { WorkspaceController } from "../modules/workspace/workspace-controller.js";
74
93
  import { WorkspaceService } from "../modules/workspace/workspace-service.js";
75
94
  import { registerAuthRoutes } from "../routes/auth.js";
95
+ import { registerAssistantCapabilityRoutes } from "../routes/assistant.js";
76
96
  import { registerButlerRoutes } from "../routes/butler.js";
77
97
  import { registerClientRoutes } from "../routes/client.js";
98
+ import { registerDebugTargetRoutes } from "../routes/debug-targets.js";
78
99
  import { registerFileRoutes } from "../routes/files.js";
79
100
  import { registerGitRoutes } from "../routes/git.js";
101
+ import { registerObservabilityRoutes } from "../routes/observability.js";
80
102
  import { registerPreferenceRoutes } from "../routes/preferences.js";
81
103
  import { registerProviderRoutes } from "../routes/providers.js";
82
104
  import { registerPublicRoutes } from "../routes/public.js";
@@ -85,12 +107,14 @@ import { registerSessionContextRoutes } from "../routes/session-contexts.js";
85
107
  import { registerSessionRoutes } from "../routes/sessions.js";
86
108
  import { registerTerminalRoutes } from "../routes/terminals.js";
87
109
  import { registerWorkbenchRoutes } from "../routes/workbench.js";
110
+ import { registerWorktreeRoutes } from "../routes/worktrees.js";
88
111
  import { registerWorkspaceRoutes } from "../routes/workspaces.js";
89
112
  import { DemoCleanupService, DemoOnlineTracker } from "../modules/demo/demo-cleanup-service.js";
90
113
  import { setErrorHandler } from "../shared/http/error-handler.js";
91
114
  import { startTerminalDebugEventLoopLagMonitor } from "../shared/utils/terminal-debug-log.js";
92
115
  import { AuthTokenRepository } from "../storage/repositories/auth-token-repository.js";
93
116
  import { AuthUserRepository } from "../storage/repositories/auth-user-repository.js";
117
+ import { AiFallbackEditRepository } from "../storage/repositories/ai-fallback-edit-repository.js";
94
118
  import { BootstrapStateRepository } from "../storage/repositories/bootstrap-state-repository.js";
95
119
  import { ButlerControlSessionRepository } from "../storage/repositories/butler-control-session-repository.js";
96
120
  import { ButlerControlEventRepository } from "../storage/repositories/butler-control-event-repository.js";
@@ -106,10 +130,18 @@ import { PatrolRunRepository } from "../storage/repositories/patrol-run-reposito
106
130
  import { ProjectMemoryRepository } from "../storage/repositories/project-memory-repository.js";
107
131
  import { VerificationRunRepository } from "../storage/repositories/verification-run-repository.js";
108
132
  import { CommitRuleProfileRepository } from "../storage/repositories/commit-rule-profile-repository.js";
133
+ import { DebugRuntimeSessionRepository } from "../storage/repositories/debug-runtime-session-repository.js";
134
+ import { DebugServiceRepository } from "../storage/repositories/debug-service-repository.js";
135
+ import { DebugTargetRepository } from "../storage/repositories/debug-target-repository.js";
109
136
  import { FileContextBindingRepository } from "../storage/repositories/file-context-binding-repository.js";
137
+ import { FrameworkAnalysisResultRepository } from "../storage/repositories/framework-analysis-result-repository.js";
138
+ import { GitRemoteCredentialRepository } from "../storage/repositories/git-remote-credential-repository.js";
139
+ import { PortLeaseRepository } from "../storage/repositories/port-lease-repository.js";
110
140
  import { RecentFileRepository } from "../storage/repositories/recent-file-repository.js";
141
+ import { RuntimeBindingRepository } from "../storage/repositories/runtime-binding-repository.js";
111
142
  import { SessionBindingRepository } from "../storage/repositories/session-binding-repository.js";
112
143
  import { SessionChangedFileRepository } from "../storage/repositories/session-changed-file-repository.js";
144
+ import { SessionForkRepository } from "../storage/repositories/session-fork-repository.js";
113
145
  import { SessionIndexRepository } from "../storage/repositories/session-index-repository.js";
114
146
  import { SessionCheckpointRepository } from "../storage/repositories/session-checkpoint-repository.js";
115
147
  import { SessionMessageAttachmentRepository } from "../storage/repositories/session-message-attachment-repository.js";
@@ -125,6 +157,8 @@ import { TerminalRuntimeSessionRepository } from "../storage/repositories/termin
125
157
  import { UserPreferenceProfileRepository } from "../storage/repositories/user-preference-profile-repository.js";
126
158
  import { UserQuickPhrasePreferenceRepository } from "../storage/repositories/user-quick-phrase-preference-repository.js";
127
159
  import { WorkspaceRepository } from "../storage/repositories/workspace-repository.js";
160
+ import { WorkspaceWorktreeRepository } from "../storage/repositories/workspace-worktree-repository.js";
161
+ import { WorkspaceNavigationStateRepository } from "../storage/repositories/workspace-navigation-state-repository.js";
128
162
  import { createDatabaseClient } from "../storage/sqlite/client.js";
129
163
  import { TerminalWsHub } from "../ws/terminal-ws-hub.js";
130
164
  import { WorkbenchWsHub } from "../ws/workbench-ws-hub.js";
@@ -146,6 +180,15 @@ export function createServer(config) {
146
180
  authUserRepository: new AuthUserRepository(database.db),
147
181
  authTokenRepository: new AuthTokenRepository(database.db),
148
182
  workspaceRepository: new WorkspaceRepository(database.db),
183
+ workspaceWorktreeRepository: new WorkspaceWorktreeRepository(database.db),
184
+ workspaceNavigationStateRepository: new WorkspaceNavigationStateRepository(database.db),
185
+ debugTargetRepository: new DebugTargetRepository(database.db),
186
+ debugServiceRepository: new DebugServiceRepository(database.db),
187
+ frameworkAnalysisResultRepository: new FrameworkAnalysisResultRepository(database.db),
188
+ debugRuntimeSessionRepository: new DebugRuntimeSessionRepository(database.db),
189
+ portLeaseRepository: new PortLeaseRepository(database.db),
190
+ runtimeBindingRepository: new RuntimeBindingRepository(database.db),
191
+ aiFallbackEditRepository: new AiFallbackEditRepository(database.db),
149
192
  butlerControlSessionRepository: new ButlerControlSessionRepository(database.db),
150
193
  butlerControlEventRepository: new ButlerControlEventRepository(database.db),
151
194
  butlerFollowUpTaskRepository: new ButlerFollowUpTaskRepository(database.db),
@@ -160,10 +203,12 @@ export function createServer(config) {
160
203
  patrolRunRepository: new PatrolRunRepository(database.db),
161
204
  verificationRunRepository: new VerificationRunRepository(database.db),
162
205
  commitRuleProfileRepository: new CommitRuleProfileRepository(database.db),
206
+ gitRemoteCredentialRepository: new GitRemoteCredentialRepository(database.db),
163
207
  recentFileRepository: new RecentFileRepository(database.db),
164
208
  fileContextBindingRepository: new FileContextBindingRepository(database.db),
165
209
  sessionBindingRepository: new SessionBindingRepository(database.db),
166
210
  sessionChangedFileRepository: new SessionChangedFileRepository(database.db),
211
+ sessionForkRepository: new SessionForkRepository(database.db),
167
212
  sessionCheckpointRepository: new SessionCheckpointRepository(database.db),
168
213
  sessionIndexRepository: new SessionIndexRepository(database.db),
169
214
  sessionMessageAttachmentRepository: new SessionMessageAttachmentRepository(database.db),
@@ -192,10 +237,16 @@ export function createServer(config) {
192
237
  ? { cleanupService: demoCleanupService, onlineTracker: demoOnlineTracker }
193
238
  : undefined;
194
239
  const authService = new AuthService(repositories.bootstrapStateRepository, repositories.authUserRepository, repositories.authTokenRepository, effectiveConfig, demoServices);
240
+ const butlerProfileService = new ButlerProfileService(repositories.butlerProfileRepository, repositories.butlerProjectRepository, path.dirname(config.databasePath));
195
241
  const gitCommandRunner = new GitCommandRunner({
196
242
  preferHelperProcess: !process.env.VITEST
197
243
  });
198
- const workspaceService = new WorkspaceService(repositories.workspaceRepository, gitCommandRunner);
244
+ const schedulerMetrics = new SchedulerMetrics();
245
+ const eventLoopMonitor = new EventLoopMonitor();
246
+ let runtimeObservabilityService;
247
+ const taskActivityLog = new TaskActivityLog(() => runtimeObservabilityService.hasActiveSession());
248
+ const taskManager = createTaskManager(taskActivityLog, createHostTaskLaneExecutors());
249
+ const workspaceService = new WorkspaceService(repositories.workspaceRepository, gitCommandRunner, repositories.workspaceNavigationStateRepository, butlerProfileService, repositories.workspaceWorktreeRepository, taskManager);
199
250
  const fileAccessGuard = new FileAccessGuard(workspaceService, app.log);
200
251
  const recentFileService = new RecentFileService(repositories.recentFileRepository);
201
252
  const fileVersionChecker = new FileVersionChecker();
@@ -203,21 +254,23 @@ export function createServer(config) {
203
254
  const fileSearchService = new FileSearchService(fileAccessGuard);
204
255
  const fileContentService = new FileContentService(fileAccessGuard, recentFileService, repositories.fileContextBindingRepository, fileVersionChecker);
205
256
  const filePreviewService = new FilePreviewService(fileAccessGuard, fileContentService);
257
+ const filePreviewLinkService = new FilePreviewLinkService(fileAccessGuard, config.filePreviewTokenSecret);
206
258
  const workspaceRepoGuard = new WorkspaceRepoGuard(workspaceService, gitCommandRunner);
207
259
  const gitReadService = new GitReadService(gitCommandRunner, workspaceRepoGuard);
208
- const gitWriteService = new GitWriteService(gitCommandRunner, workspaceRepoGuard, gitReadService);
260
+ const gitRemoteCredentialService = new GitRemoteCredentialService(repositories.gitRemoteCredentialRepository, config.gitCredentialSecret);
261
+ const gitWriteService = new GitWriteService(gitCommandRunner, workspaceRepoGuard, gitReadService, gitRemoteCredentialService);
209
262
  const gitRuleRepository = new GitRuleRepository(repositories.commitRuleProfileRepository);
210
263
  const quickPhraseService = new QuickPhraseService(repositories.userQuickPhrasePreferenceRepository);
211
264
  const preferenceProfileService = new PreferenceProfileService(repositories.userPreferenceProfileRepository);
212
265
  const commitRuleEngine = new CommitRuleEngine();
213
266
  const commitDraftService = new CommitDraftService(gitReadService);
214
- const commitOrchestrator = new CommitOrchestrator(gitRuleRepository, commitRuleEngine, commitDraftService, gitWriteService);
267
+ const commitOrchestrator = new CommitOrchestrator(gitRuleRepository, commitRuleEngine, commitDraftService, gitWriteService, repositories.aiFallbackEditRepository);
215
268
  const sessionMessageAttachmentService = new SessionMessageAttachmentService(repositories.sessionMessageAttachmentRepository, config);
216
269
  const sessionChangedFileService = new SessionChangedFileService(repositories.sessionChangedFileRepository);
217
270
  const sessionActivityAuthorityService = new SessionActivityAuthorityService();
218
- const sessionHistoryService = new SessionHistoryService(database.db, repositories.workspaceRepository, repositories.sessionBindingRepository, sessionChangedFileService, repositories.sessionIndexRepository, sessionMessageAttachmentService, repositories.sessionStateRepository, repositories.sessionStatusSnapshotRepository, config, sessionActivityAuthorityService, repositories.sessionMessageOriginRepository);
271
+ const sessionHistoryService = new SessionHistoryService(database.db, repositories.workspaceRepository, repositories.sessionBindingRepository, sessionChangedFileService, repositories.sessionIndexRepository, sessionMessageAttachmentService, repositories.sessionStateRepository, repositories.sessionStatusSnapshotRepository, config, sessionActivityAuthorityService, repositories.sessionMessageOriginRepository, repositories.sessionForkRepository, {}, taskManager);
272
+ runtimeObservabilityService = new RuntimeObservabilityService(() => sessionHistoryService.observeBackgroundTaskMetrics(), () => schedulerMetrics.observe(), eventLoopMonitor, taskActivityLog);
219
273
  const sessionLiveRuntimeService = new SessionLiveRuntimeService(sessionHistoryService, sessionMessageAttachmentService, workspaceService, sessionChangedFileService, repositories.sessionBindingRepository, repositories.authUserRepository, repositories.sessionSendQueueRepository, repositories.sessionIndexRepository, repositories.sessionStateRepository, repositories.sessionStatusSnapshotRepository, config, sessionActivityAuthorityService);
220
- const butlerProfileService = new ButlerProfileService(repositories.butlerProfileRepository, repositories.butlerProjectRepository, path.dirname(config.databasePath));
221
274
  const butlerRuntimeRootDir = path.join(path.dirname(config.databasePath), "butler-runtime");
222
275
  const butlerRuntimeConfig = {
223
276
  ...config,
@@ -237,7 +290,11 @@ export function createServer(config) {
237
290
  const butlerSessionLiveRuntimeService = new SessionLiveRuntimeService(sessionHistoryService, sessionMessageAttachmentService, workspaceService, sessionChangedFileService, repositories.sessionBindingRepository, repositories.authUserRepository, repositories.sessionSendQueueRepository, repositories.sessionIndexRepository, repositories.sessionStateRepository, repositories.sessionStatusSnapshotRepository, butlerRuntimeConfig, sessionActivityAuthorityService);
238
291
  const butlerSummarySessionLiveRuntimeService = new SessionLiveRuntimeService(sessionHistoryService, sessionMessageAttachmentService, workspaceService, sessionChangedFileService, repositories.sessionBindingRepository, repositories.authUserRepository, repositories.sessionSendQueueRepository, repositories.sessionIndexRepository, repositories.sessionStateRepository, repositories.sessionStatusSnapshotRepository, butlerSummaryRuntimeConfig, sessionActivityAuthorityService);
239
292
  const butlerFollowUpSessionLiveRuntimeService = new SessionLiveRuntimeService(sessionHistoryService, sessionMessageAttachmentService, workspaceService, sessionChangedFileService, repositories.sessionBindingRepository, repositories.authUserRepository, repositories.sessionSendQueueRepository, repositories.sessionIndexRepository, repositories.sessionStateRepository, repositories.sessionStatusSnapshotRepository, butlerFollowUpRuntimeConfig, sessionActivityAuthorityService);
240
- const workbenchService = new WorkbenchService(repositories.workspaceRepository, sessionHistoryService, butlerProfileService, repositories.butlerControlSessionRepository);
293
+ const worktreeManager = new WorktreeManager(workspaceService, repositories.workspaceWorktreeRepository, gitReadService, gitCommandRunner);
294
+ const worktreeSyncService = new WorktreeSyncService(workspaceService, repositories.workspaceWorktreeRepository, gitCommandRunner);
295
+ const worktreeMergeService = new WorktreeMergeService(workspaceService, repositories.workspaceWorktreeRepository, gitReadService, gitCommandRunner, worktreeSyncService);
296
+ const worktreeCleanupService = new WorktreeCleanupService(workspaceService, repositories.workspaceWorktreeRepository, repositories.sessionIndexRepository, repositories.terminalInstanceRepository, gitReadService, gitCommandRunner, worktreeSyncService);
297
+ const workbenchService = new WorkbenchService(repositories.workspaceRepository, repositories.workspaceNavigationStateRepository, sessionHistoryService, butlerProfileService, repositories.butlerControlSessionRepository, repositories.workspaceWorktreeRepository, taskManager);
241
298
  const butlerProjectService = new ButlerProjectService(repositories.butlerProjectRepository, repositories.butlerSessionRepository, repositories.workspaceRepository, butlerProfileService);
242
299
  const butlerInboxService = new ButlerInboxService(repositories.butlerProjectRepository, repositories.butlerInboxItemRepository);
243
300
  const butlerNotificationService = new ButlerNotificationService(repositories.butlerNotificationArchiveRepository);
@@ -259,7 +316,9 @@ export function createServer(config) {
259
316
  new RuntimePatrolProviderAdapter("claude-code", butlerFollowUpSessionLiveRuntimeService, sessionHistoryService)
260
317
  ]);
261
318
  const patrolExecutionService = new PatrolExecutionService(repositories.butlerProjectRepository, repositories.butlerSessionRepository, repositories.sessionCheckpointRepository, repositories.patrolPlanRepository, patrolRunService, repositories.projectMemoryRepository, repositories.sessionChangedFileRepository, repositories.authUserRepository, providerAdapterRegistry, instructionAdapter);
262
- const patrolScheduler = new PatrolScheduler(patrolPlanService, patrolRunService, patrolExecutionService);
319
+ const patrolScheduler = new PatrolScheduler(patrolPlanService, patrolRunService, patrolExecutionService, {
320
+ schedulerMetrics
321
+ });
263
322
  const sessionSummaryInstructionAdapter = new SessionSummaryInstructionAdapter();
264
323
  const butlerFollowUpEvaluationInstructionAdapter = new ButlerFollowUpEvaluationInstructionAdapter();
265
324
  const verificationRunService = new VerificationRunService(repositories.butlerProjectRepository, repositories.butlerSessionRepository, repositories.sessionCheckpointRepository, repositories.verificationRunRepository);
@@ -271,8 +330,12 @@ export function createServer(config) {
271
330
  });
272
331
  const butlerFollowUpService = new ButlerFollowUpService(butlerProfileService, butlerProjectService, butlerSessionService, repositories.butlerFollowUpTaskRepository, sessionHistoryService, repositories.sessionIndexRepository, sessionLiveRuntimeService, workspaceService, followUpProviderAdapterRegistry, butlerFollowUpEvaluationInstructionAdapter, butlerFollowUpRuntimeConfig.codexHomeDir, config.codexHomeDir, repositories.sessionMessageOriginRepository);
273
332
  const butlerActionContextService = new ButlerActionContextService(butlerProjectService, butlerSessionService, butlerFollowUpService);
274
- const sessionSummaryScheduler = new SessionSummaryScheduler(butlerSessionSummaryService);
275
- const butlerFollowUpScheduler = new ButlerFollowUpScheduler(butlerFollowUpService);
333
+ const sessionSummaryScheduler = new SessionSummaryScheduler(butlerSessionSummaryService, {
334
+ schedulerMetrics
335
+ });
336
+ const butlerFollowUpScheduler = new ButlerFollowUpScheduler(butlerFollowUpService, {
337
+ schedulerMetrics
338
+ });
276
339
  const butlerFollowUpTerminalSubscription = sessionLiveRuntimeService.registerTerminalStateListener(async (event) => {
277
340
  await butlerFollowUpService.handleSessionTerminal(event.sessionId, event.timestamp);
278
341
  });
@@ -280,28 +343,41 @@ export function createServer(config) {
280
343
  const butlerControlActionService = new ButlerControlActionService(butlerProfileService, repositories.butlerControlSessionRepository, repositories.butlerControlEventRepository, butlerProjectService, butlerSessionService, patrolRunService, patrolExecutionService, verificationRunService, butlerContextAggregator);
281
344
  const fileContextService = new FileContextService(sessionHistoryService, repositories.fileContextBindingRepository);
282
345
  const terminalService = new TerminalService(database.db, repositories.terminalInstanceRepository, repositories.terminalRuntimeSessionRepository, workspaceService, config.terminalIdleTimeoutSeconds, {
346
+ databasePath: config.databasePath,
283
347
  terminalLogRootDir: path.join(path.dirname(config.databasePath), "terminal-logs"),
284
348
  terminalLogFileRepository: repositories.terminalLogFileRepository,
285
349
  terminalLogSegmentRepository: repositories.terminalLogSegmentRepository
286
350
  });
351
+ const debugTargetService = new DebugTargetService(database.db, workspaceService, repositories.workspaceWorktreeRepository, repositories.debugTargetRepository, repositories.debugServiceRepository, repositories.frameworkAnalysisResultRepository, repositories.debugRuntimeSessionRepository, repositories.portLeaseRepository, repositories.runtimeBindingRepository, repositories.aiFallbackEditRepository, terminalService, repositories.terminalInstanceRepository, taskManager);
352
+ const debugRuntimeReconciliationScheduler = new DebugRuntimeReconciliationScheduler(debugTargetService, {
353
+ schedulerMetrics
354
+ });
287
355
  const commandTemplateService = new CommandTemplateService(database.db, repositories.terminalCommandTemplateRepository, workspaceService, terminalService);
288
356
  const templateReverseProxyService = new TemplateReverseProxyService(commandTemplateService);
289
- const workspacePanelSnapshotService = new WorkspacePanelSnapshotService(fileTreeService, gitReadService, terminalService, commandTemplateService, workspaceService);
357
+ const workspacePanelSnapshotService = new WorkspacePanelSnapshotService(fileTreeService, gitReadService, terminalService, commandTemplateService, workspaceService, taskManager);
290
358
  const fileWatcher = new WorkspaceFileWatcher(workspaceService);
291
359
  const bootstrapController = new BootstrapController(bootstrapService);
292
360
  const clientController = new ClientController(clientService);
361
+ const debugTargetController = new DebugTargetController(debugTargetService);
362
+ const handleDebugTargetTerminalExit = (event) => {
363
+ void debugTargetService.handleTerminalExit(event);
364
+ };
365
+ terminalService.on("exit", handleDebugTargetTerminalExit);
293
366
  const authController = new AuthController(authService);
294
367
  const workspaceController = new WorkspaceController(workspaceService);
368
+ const worktreeController = new WorktreeController(worktreeManager, worktreeSyncService, worktreeMergeService, worktreeCleanupService);
295
369
  const workbenchController = new WorkbenchController(workbenchService);
296
370
  const butlerController = new ButlerController(butlerProfileService, butlerControlSessionService, butlerControlActionService, butlerContextAggregator, butlerFollowUpService, butlerInboxService, butlerNotificationService, butlerProjectService, butlerSessionService, projectMemoryService, patrolPlanService, patrolRunService, patrolExecutionService, verificationRunService, butlerActionContextService);
297
371
  const sessionController = new SessionController(sessionHistoryService, sessionLiveRuntimeService, repositories.butlerControlSessionRepository);
372
+ const assistantCapabilityController = new AssistantCapabilityController(new AssistantCapabilityService(butlerProjectService, butlerSessionService, sessionHistoryService, sessionLiveRuntimeService, terminalService));
298
373
  const providerController = new ProviderController(sessionHistoryService, sessionLiveRuntimeService, config);
299
374
  const quickPhraseController = new QuickPhraseController(quickPhraseService);
300
375
  const profileController = new ProfileController(preferenceProfileService);
301
- const fileController = new FileController(fileTreeService, fileContentService, fileSearchService, recentFileService, filePreviewService);
376
+ const fileController = new FileController(fileTreeService, fileContentService, fileSearchService, recentFileService, filePreviewService, filePreviewLinkService);
302
377
  const fileContextController = new FileContextController(fileContentService, fileContextService);
303
378
  const gitController = new GitController(gitReadService, gitWriteService, commitOrchestrator);
304
379
  const terminalController = new TerminalController(terminalService, commandTemplateService);
380
+ const observabilityController = new ObservabilityController(runtimeObservabilityService);
305
381
  const wsHandle = createWsServer(app.server, new WsAuthGuard(authService), sessionHistoryService, sessionLiveRuntimeService, new TerminalWsHub(terminalService), new WorkbenchWsHub(workbenchService, workspacePanelSnapshotService, fileWatcher), butlerActionContextService);
306
382
  app.server.on("upgrade", (request, socket, head) => {
307
383
  templateReverseProxyService.handleWebSocketUpgrade(request, socket, head);
@@ -315,6 +391,9 @@ export function createServer(config) {
315
391
  });
316
392
  app.addHook("onRequest", createAuthGuard(authService));
317
393
  app.setErrorHandler(setErrorHandler);
394
+ app.addHook("onReady", async () => {
395
+ await debugTargetService.runBackgroundRuntimeReconciliation("debug_target.startup_runtime_recovery");
396
+ });
318
397
  // Demo 模式:自动创建演示用户
319
398
  if (config.demoMode) {
320
399
  const status = bootstrapService.getStatus();
@@ -325,8 +404,12 @@ export function createServer(config) {
325
404
  void registerPublicRoutes(app, bootstrapController);
326
405
  void registerProxyRoutes(app, templateReverseProxyService);
327
406
  void registerAuthRoutes(app, authController);
407
+ void registerAssistantCapabilityRoutes(app, assistantCapabilityController);
328
408
  void registerClientRoutes(app, clientController);
409
+ void registerDebugTargetRoutes(app, debugTargetController);
410
+ void registerObservabilityRoutes(app, observabilityController);
329
411
  void registerWorkspaceRoutes(app, workspaceController);
412
+ void registerWorktreeRoutes(app, worktreeController);
330
413
  void registerWorkbenchRoutes(app, workbenchController);
331
414
  void registerButlerRoutes(app, butlerController);
332
415
  void registerSessionRoutes(app, sessionController);
@@ -339,15 +422,19 @@ export function createServer(config) {
339
422
  patrolScheduler.start();
340
423
  sessionSummaryScheduler.start();
341
424
  butlerFollowUpScheduler.start();
425
+ debugRuntimeReconciliationScheduler.start();
342
426
  if (config.webUiDir) {
343
427
  registerStaticWebRoutes(app, config.webUiDir);
344
428
  }
345
429
  app.addHook("onClose", async () => {
346
430
  stopTerminalDebugEventLoopLagMonitor();
431
+ eventLoopMonitor.dispose();
347
432
  butlerFollowUpTerminalSubscription.close();
348
433
  await patrolScheduler.dispose();
349
434
  await sessionSummaryScheduler.dispose();
350
435
  await butlerFollowUpScheduler.dispose();
436
+ await debugRuntimeReconciliationScheduler.dispose();
437
+ terminalService.off("exit", handleDebugTargetTerminalExit);
351
438
  await terminalService.dispose();
352
439
  await butlerFollowUpSessionLiveRuntimeService.dispose();
353
440
  await butlerSummarySessionLiveRuntimeService.dispose();
@@ -366,8 +453,14 @@ export function createServer(config) {
366
453
  modules: {
367
454
  bootstrapService,
368
455
  clientService,
456
+ debugTargetService,
457
+ debugRuntimeReconciliationScheduler,
369
458
  authService,
370
459
  workspaceService,
460
+ worktreeManager,
461
+ worktreeSyncService,
462
+ worktreeMergeService,
463
+ worktreeCleanupService,
371
464
  workbenchService,
372
465
  butlerProfileService,
373
466
  butlerSessionLiveRuntimeService,
@@ -390,6 +483,7 @@ export function createServer(config) {
390
483
  fileSearchService,
391
484
  fileContentService,
392
485
  filePreviewService,
486
+ filePreviewLinkService,
393
487
  fileContextService,
394
488
  recentFileService,
395
489
  gitReadService,
@@ -397,6 +491,7 @@ export function createServer(config) {
397
491
  commitOrchestrator,
398
492
  quickPhraseService,
399
493
  preferenceProfileService,
494
+ runtimeObservabilityService,
400
495
  sessionHistoryService,
401
496
  sessionChangedFileService,
402
497
  sessionMessageAttachmentService,