@av-pi-studio/server 0.0.1

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 (315) hide show
  1. package/README.md +411 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/agent/agent-manager.d.ts +107 -0
  4. package/dist/agent/agent-manager.d.ts.map +1 -0
  5. package/dist/agent/agent-manager.js +218 -0
  6. package/dist/agent/agent-manager.js.map +1 -0
  7. package/dist/agent/agent-service.d.ts +36 -0
  8. package/dist/agent/agent-service.d.ts.map +1 -0
  9. package/dist/agent/agent-service.js +195 -0
  10. package/dist/agent/agent-service.js.map +1 -0
  11. package/dist/agent/index.d.ts +17 -0
  12. package/dist/agent/index.d.ts.map +1 -0
  13. package/dist/agent/index.js +18 -0
  14. package/dist/agent/index.js.map +1 -0
  15. package/dist/agent/manifest.d.ts +7 -0
  16. package/dist/agent/manifest.d.ts.map +1 -0
  17. package/dist/agent/manifest.js +27 -0
  18. package/dist/agent/manifest.js.map +1 -0
  19. package/dist/agent/mcp-server.d.ts +100 -0
  20. package/dist/agent/mcp-server.d.ts.map +1 -0
  21. package/dist/agent/mcp-server.js +163 -0
  22. package/dist/agent/mcp-server.js.map +1 -0
  23. package/dist/agent/permissions.d.ts +71 -0
  24. package/dist/agent/permissions.d.ts.map +1 -0
  25. package/dist/agent/permissions.js +132 -0
  26. package/dist/agent/permissions.js.map +1 -0
  27. package/dist/agent/provider-contract.d.ts +134 -0
  28. package/dist/agent/provider-contract.d.ts.map +1 -0
  29. package/dist/agent/provider-contract.js +2 -0
  30. package/dist/agent/provider-contract.js.map +1 -0
  31. package/dist/agent/provider-registry.d.ts +37 -0
  32. package/dist/agent/provider-registry.d.ts.map +1 -0
  33. package/dist/agent/provider-registry.js +92 -0
  34. package/dist/agent/provider-registry.js.map +1 -0
  35. package/dist/agent/provider-snapshot.d.ts +52 -0
  36. package/dist/agent/provider-snapshot.d.ts.map +1 -0
  37. package/dist/agent/provider-snapshot.js +73 -0
  38. package/dist/agent/provider-snapshot.js.map +1 -0
  39. package/dist/agent/providers/mock/mock-provider.d.ts +44 -0
  40. package/dist/agent/providers/mock/mock-provider.d.ts.map +1 -0
  41. package/dist/agent/providers/mock/mock-provider.js +162 -0
  42. package/dist/agent/providers/mock/mock-provider.js.map +1 -0
  43. package/dist/agent/providers/pi/agent.d.ts +80 -0
  44. package/dist/agent/providers/pi/agent.d.ts.map +1 -0
  45. package/dist/agent/providers/pi/agent.js +322 -0
  46. package/dist/agent/providers/pi/agent.js.map +1 -0
  47. package/dist/agent/providers/pi/event-mapper.d.ts +17 -0
  48. package/dist/agent/providers/pi/event-mapper.d.ts.map +1 -0
  49. package/dist/agent/providers/pi/event-mapper.js +150 -0
  50. package/dist/agent/providers/pi/event-mapper.js.map +1 -0
  51. package/dist/agent/providers/pi/rpc-transport.d.ts +53 -0
  52. package/dist/agent/providers/pi/rpc-transport.d.ts.map +1 -0
  53. package/dist/agent/providers/pi/rpc-transport.js +190 -0
  54. package/dist/agent/providers/pi/rpc-transport.js.map +1 -0
  55. package/dist/agent/providers/pi/session-hydration.d.ts +11 -0
  56. package/dist/agent/providers/pi/session-hydration.d.ts.map +1 -0
  57. package/dist/agent/providers/pi/session-hydration.js +167 -0
  58. package/dist/agent/providers/pi/session-hydration.js.map +1 -0
  59. package/dist/agent/rewind-rpc.d.ts +15 -0
  60. package/dist/agent/rewind-rpc.d.ts.map +1 -0
  61. package/dist/agent/rewind-rpc.js +30 -0
  62. package/dist/agent/rewind-rpc.js.map +1 -0
  63. package/dist/agent/session-operations.d.ts +32 -0
  64. package/dist/agent/session-operations.d.ts.map +1 -0
  65. package/dist/agent/session-operations.js +130 -0
  66. package/dist/agent/session-operations.js.map +1 -0
  67. package/dist/agent/structured-generation.d.ts +39 -0
  68. package/dist/agent/structured-generation.d.ts.map +1 -0
  69. package/dist/agent/structured-generation.js +78 -0
  70. package/dist/agent/structured-generation.js.map +1 -0
  71. package/dist/agent/timeline-rpc.d.ts +21 -0
  72. package/dist/agent/timeline-rpc.d.ts.map +1 -0
  73. package/dist/agent/timeline-rpc.js +59 -0
  74. package/dist/agent/timeline-rpc.js.map +1 -0
  75. package/dist/agent/timeline-store.d.ts +100 -0
  76. package/dist/agent/timeline-store.d.ts.map +1 -0
  77. package/dist/agent/timeline-store.js +255 -0
  78. package/dist/agent/timeline-store.js.map +1 -0
  79. package/dist/auth/index.d.ts +2 -0
  80. package/dist/auth/index.d.ts.map +1 -0
  81. package/dist/auth/index.js +3 -0
  82. package/dist/auth/index.js.map +1 -0
  83. package/dist/auth/password-auth.d.ts +44 -0
  84. package/dist/auth/password-auth.d.ts.map +1 -0
  85. package/dist/auth/password-auth.js +78 -0
  86. package/dist/auth/password-auth.js.map +1 -0
  87. package/dist/config/daemon-config.d.ts +634 -0
  88. package/dist/config/daemon-config.d.ts.map +1 -0
  89. package/dist/config/daemon-config.js +258 -0
  90. package/dist/config/daemon-config.js.map +1 -0
  91. package/dist/config/index.d.ts +3 -0
  92. package/dist/config/index.d.ts.map +1 -0
  93. package/dist/config/index.js +4 -0
  94. package/dist/config/index.js.map +1 -0
  95. package/dist/config/project-config.d.ts +104 -0
  96. package/dist/config/project-config.d.ts.map +1 -0
  97. package/dist/config/project-config.js +106 -0
  98. package/dist/config/project-config.js.map +1 -0
  99. package/dist/daemon/bootstrap.d.ts +37 -0
  100. package/dist/daemon/bootstrap.d.ts.map +1 -0
  101. package/dist/daemon/bootstrap.js +448 -0
  102. package/dist/daemon/bootstrap.js.map +1 -0
  103. package/dist/daemon/dev-bootstrap.d.ts +14 -0
  104. package/dist/daemon/dev-bootstrap.d.ts.map +1 -0
  105. package/dist/daemon/dev-bootstrap.js +231 -0
  106. package/dist/daemon/dev-bootstrap.js.map +1 -0
  107. package/dist/daemon/dev-main.d.ts +3 -0
  108. package/dist/daemon/dev-main.d.ts.map +1 -0
  109. package/dist/daemon/dev-main.js +36 -0
  110. package/dist/daemon/dev-main.js.map +1 -0
  111. package/dist/daemon/index.d.ts +15 -0
  112. package/dist/daemon/index.d.ts.map +1 -0
  113. package/dist/daemon/index.js +21 -0
  114. package/dist/daemon/index.js.map +1 -0
  115. package/dist/daemon/main.d.ts +3 -0
  116. package/dist/daemon/main.d.ts.map +1 -0
  117. package/dist/daemon/main.js +29 -0
  118. package/dist/daemon/main.js.map +1 -0
  119. package/dist/daemon/orchestration-rpc.d.ts +19 -0
  120. package/dist/daemon/orchestration-rpc.d.ts.map +1 -0
  121. package/dist/daemon/orchestration-rpc.js +136 -0
  122. package/dist/daemon/orchestration-rpc.js.map +1 -0
  123. package/dist/files/download-token-store.d.ts +14 -0
  124. package/dist/files/download-token-store.d.ts.map +1 -0
  125. package/dist/files/download-token-store.js +33 -0
  126. package/dist/files/download-token-store.js.map +1 -0
  127. package/dist/files/file-explorer.d.ts +54 -0
  128. package/dist/files/file-explorer.d.ts.map +1 -0
  129. package/dist/files/file-explorer.js +182 -0
  130. package/dist/files/file-explorer.js.map +1 -0
  131. package/dist/files/file-transfer.d.ts +30 -0
  132. package/dist/files/file-transfer.d.ts.map +1 -0
  133. package/dist/files/file-transfer.js +132 -0
  134. package/dist/files/file-transfer.js.map +1 -0
  135. package/dist/files/index.d.ts +4 -0
  136. package/dist/files/index.d.ts.map +1 -0
  137. package/dist/files/index.js +5 -0
  138. package/dist/files/index.js.map +1 -0
  139. package/dist/http/host-allowlist.d.ts +15 -0
  140. package/dist/http/host-allowlist.d.ts.map +1 -0
  141. package/dist/http/host-allowlist.js +52 -0
  142. package/dist/http/host-allowlist.js.map +1 -0
  143. package/dist/http/http-server.d.ts +27 -0
  144. package/dist/http/http-server.d.ts.map +1 -0
  145. package/dist/http/http-server.js +76 -0
  146. package/dist/http/http-server.js.map +1 -0
  147. package/dist/http/index.d.ts +3 -0
  148. package/dist/http/index.d.ts.map +1 -0
  149. package/dist/http/index.js +4 -0
  150. package/dist/http/index.js.map +1 -0
  151. package/dist/index.d.ts +18 -0
  152. package/dist/index.d.ts.map +1 -0
  153. package/dist/index.js +35 -0
  154. package/dist/index.js.map +1 -0
  155. package/dist/logging/index.d.ts +2 -0
  156. package/dist/logging/index.d.ts.map +1 -0
  157. package/dist/logging/index.js +2 -0
  158. package/dist/logging/index.js.map +1 -0
  159. package/dist/logging/logger.d.ts +48 -0
  160. package/dist/logging/logger.d.ts.map +1 -0
  161. package/dist/logging/logger.js +53 -0
  162. package/dist/logging/logger.js.map +1 -0
  163. package/dist/orchestration/chat-service.d.ts +61 -0
  164. package/dist/orchestration/chat-service.d.ts.map +1 -0
  165. package/dist/orchestration/chat-service.js +156 -0
  166. package/dist/orchestration/chat-service.js.map +1 -0
  167. package/dist/orchestration/cron.d.ts +30 -0
  168. package/dist/orchestration/cron.d.ts.map +1 -0
  169. package/dist/orchestration/cron.js +136 -0
  170. package/dist/orchestration/cron.js.map +1 -0
  171. package/dist/orchestration/index.d.ts +5 -0
  172. package/dist/orchestration/index.d.ts.map +1 -0
  173. package/dist/orchestration/index.js +6 -0
  174. package/dist/orchestration/index.js.map +1 -0
  175. package/dist/orchestration/loop-service.d.ts +129 -0
  176. package/dist/orchestration/loop-service.d.ts.map +1 -0
  177. package/dist/orchestration/loop-service.js +234 -0
  178. package/dist/orchestration/loop-service.js.map +1 -0
  179. package/dist/orchestration/schedule-service.d.ts +65 -0
  180. package/dist/orchestration/schedule-service.d.ts.map +1 -0
  181. package/dist/orchestration/schedule-service.js +201 -0
  182. package/dist/orchestration/schedule-service.js.map +1 -0
  183. package/dist/persistence/atomic-store.d.ts +45 -0
  184. package/dist/persistence/atomic-store.d.ts.map +1 -0
  185. package/dist/persistence/atomic-store.js +92 -0
  186. package/dist/persistence/atomic-store.js.map +1 -0
  187. package/dist/persistence/entity-schemas.d.ts +1707 -0
  188. package/dist/persistence/entity-schemas.d.ts.map +1 -0
  189. package/dist/persistence/entity-schemas.js +250 -0
  190. package/dist/persistence/entity-schemas.js.map +1 -0
  191. package/dist/persistence/entity-stores.d.ts +46 -0
  192. package/dist/persistence/entity-stores.d.ts.map +1 -0
  193. package/dist/persistence/entity-stores.js +167 -0
  194. package/dist/persistence/entity-stores.js.map +1 -0
  195. package/dist/persistence/index.d.ts +4 -0
  196. package/dist/persistence/index.d.ts.map +1 -0
  197. package/dist/persistence/index.js +5 -0
  198. package/dist/persistence/index.js.map +1 -0
  199. package/dist/projects/checkout-diff-manager.d.ts +44 -0
  200. package/dist/projects/checkout-diff-manager.d.ts.map +1 -0
  201. package/dist/projects/checkout-diff-manager.js +82 -0
  202. package/dist/projects/checkout-diff-manager.js.map +1 -0
  203. package/dist/projects/git-checkout-rpc.d.ts +18 -0
  204. package/dist/projects/git-checkout-rpc.d.ts.map +1 -0
  205. package/dist/projects/git-checkout-rpc.js +57 -0
  206. package/dist/projects/git-checkout-rpc.js.map +1 -0
  207. package/dist/projects/git-detect.d.ts +21 -0
  208. package/dist/projects/git-detect.d.ts.map +1 -0
  209. package/dist/projects/git-detect.js +34 -0
  210. package/dist/projects/git-detect.js.map +1 -0
  211. package/dist/projects/git-operations.d.ts +67 -0
  212. package/dist/projects/git-operations.d.ts.map +1 -0
  213. package/dist/projects/git-operations.js +200 -0
  214. package/dist/projects/git-operations.js.map +1 -0
  215. package/dist/projects/github-service.d.ts +80 -0
  216. package/dist/projects/github-service.d.ts.map +1 -0
  217. package/dist/projects/github-service.js +172 -0
  218. package/dist/projects/github-service.js.map +1 -0
  219. package/dist/projects/index.d.ts +13 -0
  220. package/dist/projects/index.d.ts.map +1 -0
  221. package/dist/projects/index.js +19 -0
  222. package/dist/projects/index.js.map +1 -0
  223. package/dist/projects/open-project.d.ts +35 -0
  224. package/dist/projects/open-project.d.ts.map +1 -0
  225. package/dist/projects/open-project.js +106 -0
  226. package/dist/projects/open-project.js.map +1 -0
  227. package/dist/projects/reconciliation.d.ts +15 -0
  228. package/dist/projects/reconciliation.d.ts.map +1 -0
  229. package/dist/projects/reconciliation.js +63 -0
  230. package/dist/projects/reconciliation.js.map +1 -0
  231. package/dist/projects/status-projection.d.ts +33 -0
  232. package/dist/projects/status-projection.d.ts.map +1 -0
  233. package/dist/projects/status-projection.js +98 -0
  234. package/dist/projects/status-projection.js.map +1 -0
  235. package/dist/projects/workspace-activity.d.ts +28 -0
  236. package/dist/projects/workspace-activity.d.ts.map +1 -0
  237. package/dist/projects/workspace-activity.js +74 -0
  238. package/dist/projects/workspace-activity.js.map +1 -0
  239. package/dist/projects/workspace-git-service.d.ts +27 -0
  240. package/dist/projects/workspace-git-service.d.ts.map +1 -0
  241. package/dist/projects/workspace-git-service.js +60 -0
  242. package/dist/projects/workspace-git-service.js.map +1 -0
  243. package/dist/projects/workspace-registry.d.ts +59 -0
  244. package/dist/projects/workspace-registry.d.ts.map +1 -0
  245. package/dist/projects/workspace-registry.js +149 -0
  246. package/dist/projects/workspace-registry.js.map +1 -0
  247. package/dist/projects/worktree-service.d.ts +100 -0
  248. package/dist/projects/worktree-service.d.ts.map +1 -0
  249. package/dist/projects/worktree-service.js +216 -0
  250. package/dist/projects/worktree-service.js.map +1 -0
  251. package/dist/proxy/index.d.ts +4 -0
  252. package/dist/proxy/index.d.ts.map +1 -0
  253. package/dist/proxy/index.js +5 -0
  254. package/dist/proxy/index.js.map +1 -0
  255. package/dist/proxy/service-hostname.d.ts +21 -0
  256. package/dist/proxy/service-hostname.d.ts.map +1 -0
  257. package/dist/proxy/service-hostname.js +44 -0
  258. package/dist/proxy/service-hostname.js.map +1 -0
  259. package/dist/proxy/service-port-registry.d.ts +36 -0
  260. package/dist/proxy/service-port-registry.d.ts.map +1 -0
  261. package/dist/proxy/service-port-registry.js +55 -0
  262. package/dist/proxy/service-port-registry.js.map +1 -0
  263. package/dist/proxy/service-proxy.d.ts +34 -0
  264. package/dist/proxy/service-proxy.d.ts.map +1 -0
  265. package/dist/proxy/service-proxy.js +54 -0
  266. package/dist/proxy/service-proxy.js.map +1 -0
  267. package/dist/terminal/index.d.ts +4 -0
  268. package/dist/terminal/index.d.ts.map +1 -0
  269. package/dist/terminal/index.js +5 -0
  270. package/dist/terminal/index.js.map +1 -0
  271. package/dist/terminal/pty-backend.d.ts +44 -0
  272. package/dist/terminal/pty-backend.d.ts.map +1 -0
  273. package/dist/terminal/pty-backend.js +119 -0
  274. package/dist/terminal/pty-backend.js.map +1 -0
  275. package/dist/terminal/screen-buffer.d.ts +21 -0
  276. package/dist/terminal/screen-buffer.d.ts.map +1 -0
  277. package/dist/terminal/screen-buffer.js +55 -0
  278. package/dist/terminal/screen-buffer.js.map +1 -0
  279. package/dist/terminal/terminal-manager.d.ts +79 -0
  280. package/dist/terminal/terminal-manager.d.ts.map +1 -0
  281. package/dist/terminal/terminal-manager.js +174 -0
  282. package/dist/terminal/terminal-manager.js.map +1 -0
  283. package/dist/terminal/terminal-rpc.d.ts +20 -0
  284. package/dist/terminal/terminal-rpc.d.ts.map +1 -0
  285. package/dist/terminal/terminal-rpc.js +122 -0
  286. package/dist/terminal/terminal-rpc.js.map +1 -0
  287. package/dist/util/concurrency.d.ts +16 -0
  288. package/dist/util/concurrency.d.ts.map +1 -0
  289. package/dist/util/concurrency.js +23 -0
  290. package/dist/util/concurrency.js.map +1 -0
  291. package/dist/util/index.d.ts +2 -0
  292. package/dist/util/index.d.ts.map +1 -0
  293. package/dist/util/index.js +2 -0
  294. package/dist/util/index.js.map +1 -0
  295. package/dist/ws/capability-store.d.ts +11 -0
  296. package/dist/ws/capability-store.d.ts.map +1 -0
  297. package/dist/ws/capability-store.js +10 -0
  298. package/dist/ws/capability-store.js.map +1 -0
  299. package/dist/ws/index.d.ts +5 -0
  300. package/dist/ws/index.d.ts.map +1 -0
  301. package/dist/ws/index.js +6 -0
  302. package/dist/ws/index.js.map +1 -0
  303. package/dist/ws/router.d.ts +34 -0
  304. package/dist/ws/router.d.ts.map +1 -0
  305. package/dist/ws/router.js +97 -0
  306. package/dist/ws/router.js.map +1 -0
  307. package/dist/ws/session.d.ts +28 -0
  308. package/dist/ws/session.d.ts.map +1 -0
  309. package/dist/ws/session.js +36 -0
  310. package/dist/ws/session.js.map +1 -0
  311. package/dist/ws/ws-server.d.ts +41 -0
  312. package/dist/ws/ws-server.d.ts.map +1 -0
  313. package/dist/ws/ws-server.js +104 -0
  314. package/dist/ws/ws-server.js.map +1 -0
  315. package/package.json +48 -0
@@ -0,0 +1,82 @@
1
+ import { defaultGitRunner } from "./git-detect.js";
2
+ const DEFAULT_CHUNK = 64 * 1024;
3
+ export class CheckoutDiffManager {
4
+ gitRunner;
5
+ subscriptions = new Map();
6
+ nextId = 0;
7
+ constructor(gitRunner = defaultGitRunner) {
8
+ this.gitRunner = gitRunner;
9
+ }
10
+ /** Subscribe to a diff. Streams the current diff immediately. Returns the subscription id. */
11
+ async subscribe(request, emit) {
12
+ const subscriptionId = `diff-${++this.nextId}`;
13
+ this.subscriptions.set(subscriptionId, { request, emit });
14
+ await this.stream(subscriptionId);
15
+ return subscriptionId;
16
+ }
17
+ /** Stop a diff subscription. Returns true when an active subscription was removed. */
18
+ unsubscribe(subscriptionId) {
19
+ return this.subscriptions.delete(subscriptionId);
20
+ }
21
+ hasSubscription(subscriptionId) {
22
+ return this.subscriptions.has(subscriptionId);
23
+ }
24
+ /** Recompute + re-stream a live subscription (e.g. on a status change). No-op if unsubscribed. */
25
+ async refresh(subscriptionId) {
26
+ if (!this.subscriptions.has(subscriptionId))
27
+ return false;
28
+ await this.stream(subscriptionId);
29
+ return true;
30
+ }
31
+ async stream(subscriptionId) {
32
+ const sub = this.subscriptions.get(subscriptionId);
33
+ if (!sub)
34
+ return;
35
+ const { request, emit } = sub;
36
+ const args = ["diff"];
37
+ if (request.staged)
38
+ args.push("--staged");
39
+ if (request.path)
40
+ args.push("--", request.path);
41
+ const result = await this.gitRunner(args, request.cwd);
42
+ const patch = result.code === 0 ? result.stdout : "";
43
+ const chunkSize = request.chunkSize ?? DEFAULT_CHUNK;
44
+ const chunks = chunkString(patch, chunkSize);
45
+ const totalChunks = chunks.length === 0 ? 1 : chunks.length;
46
+ if (chunks.length === 0) {
47
+ emit({
48
+ type: "checkout_diff_update",
49
+ subscriptionId,
50
+ cwd: request.cwd,
51
+ chunk: 0,
52
+ totalChunks: 1,
53
+ patch: "",
54
+ done: true,
55
+ });
56
+ return;
57
+ }
58
+ for (let i = 0; i < chunks.length; i++) {
59
+ // A subscription cancelled mid-stream stops emitting.
60
+ if (!this.subscriptions.has(subscriptionId))
61
+ return;
62
+ emit({
63
+ type: "checkout_diff_update",
64
+ subscriptionId,
65
+ cwd: request.cwd,
66
+ chunk: i,
67
+ totalChunks,
68
+ patch: chunks[i],
69
+ done: i === chunks.length - 1,
70
+ });
71
+ }
72
+ }
73
+ }
74
+ function chunkString(text, size) {
75
+ if (text.length === 0)
76
+ return [];
77
+ const chunks = [];
78
+ for (let i = 0; i < text.length; i += size)
79
+ chunks.push(text.slice(i, i + size));
80
+ return chunks;
81
+ }
82
+ //# sourceMappingURL=checkout-diff-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-diff-manager.js","sourceRoot":"","sources":["../../src/projects/checkout-diff-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkB,MAAM,iBAAiB,CAAC;AAkCnE,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhC,MAAM,OAAO,mBAAmB;IAID;IAHZ,aAAa,GAAG,IAAI,GAAG,EAAuD,CAAC;IACxF,MAAM,GAAG,CAAC,CAAC;IAEnB,YAA6B,YAAuB,gBAAgB;QAAvC,cAAS,GAAT,SAAS,CAA8B;IAAG,CAAC;IAExE,8FAA8F;IAC9F,KAAK,CAAC,SAAS,CAAC,OAAoB,EAAE,IAAiB;QACrD,MAAM,cAAc,GAAG,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAC/C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAClC,OAAO,cAAc,CAAC;IACxB,CAAC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C;IACjF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { HandlerRegistry } from "../ws/router.js";
2
+ import { CheckoutDiffManager } from "./checkout-diff-manager.js";
3
+ import { WorkspaceGitService } from "./workspace-git-service.js";
4
+ /**
5
+ * Wire the checkout status/diff streaming RPCs (features/git-checkout.md § Status & diff;
6
+ * architecture/websocket-protocol.md § checkout_* families).
7
+ *
8
+ * Status/diff updates are pushed to the requesting session. `checkout_refresh_request` is only
9
+ * registered when `features.checkoutRefresh` is advertised by the daemon.
10
+ */
11
+ export interface GitCheckoutRpcDeps {
12
+ gitService: WorkspaceGitService;
13
+ diffManager: CheckoutDiffManager;
14
+ /** Whether the daemon advertises `features.checkoutRefresh`. */
15
+ checkoutRefreshEnabled: boolean;
16
+ }
17
+ export declare function registerGitCheckoutHandlers(registry: HandlerRegistry, deps: GitCheckoutRpcDeps): void;
18
+ //# sourceMappingURL=git-checkout-rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-checkout-rpc.d.ts","sourceRoot":"","sources":["../../src/projects/git-checkout-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAoB,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,mBAAmB,CAAC;IAChC,WAAW,EAAE,mBAAmB,CAAC;IACjC,gEAAgE;IAChE,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,kBAAkB,GACvB,IAAI,CAuDN"}
@@ -0,0 +1,57 @@
1
+ import { CheckoutDiffManager } from "./checkout-diff-manager.js";
2
+ import { WorkspaceGitService } from "./workspace-git-service.js";
3
+ export function registerGitCheckoutHandlers(registry, deps) {
4
+ const { gitService, diffManager } = deps;
5
+ // Track per-session status unsubscribers so a session can stop watching.
6
+ const statusUnsubs = new Map();
7
+ registry.register("checkout_status_subscribe", (ctx) => {
8
+ const cwd = String(ctx.message.cwd ?? "");
9
+ const session = ctx.session;
10
+ const key = `${sessionKey(session)}:${cwd}`;
11
+ statusUnsubs.get(key)?.(); // replace an existing subscription for the same cwd
12
+ const unsub = gitService.subscribe(cwd, (projection) => {
13
+ session.send({
14
+ type: "session",
15
+ message: { type: "checkout_status_update", cwd, projection },
16
+ });
17
+ });
18
+ statusUnsubs.set(key, unsub);
19
+ return { type: "checkout_status_subscribe_response", cwd, ok: true };
20
+ });
21
+ registry.register("checkout_status_unsubscribe", (ctx) => {
22
+ const cwd = String(ctx.message.cwd ?? "");
23
+ const key = `${sessionKey(ctx.session)}:${cwd}`;
24
+ statusUnsubs.get(key)?.();
25
+ statusUnsubs.delete(key);
26
+ return { type: "checkout_status_unsubscribe_response", cwd, ok: true };
27
+ });
28
+ registry.register("checkout_diff_subscribe", async (ctx) => {
29
+ const request = {
30
+ cwd: String(ctx.message.cwd ?? ""),
31
+ staged: Boolean(ctx.message.staged),
32
+ path: ctx.message.path,
33
+ };
34
+ const session = ctx.session;
35
+ const subscriptionId = await diffManager.subscribe(request, (update) => {
36
+ session.send({ type: "session", message: update });
37
+ });
38
+ return { type: "checkout_diff_subscribe_response", subscriptionId };
39
+ });
40
+ registry.register("checkout_diff_unsubscribe", (ctx) => {
41
+ const subscriptionId = String(ctx.message.subscriptionId ?? "");
42
+ const ok = diffManager.unsubscribe(subscriptionId);
43
+ return { type: "checkout_diff_unsubscribe_response", subscriptionId, ok };
44
+ });
45
+ // Feature-gated: only available when the daemon advertises checkoutRefresh.
46
+ if (deps.checkoutRefreshEnabled) {
47
+ registry.register("checkout_refresh_request", async (ctx) => {
48
+ const cwd = String(ctx.message.cwd ?? "");
49
+ const changed = await gitService.refresh(cwd);
50
+ return { type: "checkout_refresh_response", cwd, changed };
51
+ });
52
+ }
53
+ }
54
+ function sessionKey(session) {
55
+ return session.id ?? String(session);
56
+ }
57
+ //# sourceMappingURL=git-checkout-rpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-checkout-rpc.js","sourceRoot":"","sources":["../../src/projects/git-checkout-rpc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAiBjE,MAAM,UAAU,2BAA2B,CACzC,QAAyB,EACzB,IAAwB;IAExB,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACzC,yEAAyE;IACzE,MAAM,YAAY,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEnD,QAAQ,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC,GAAG,EAAE,EAAE;QACrD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,MAAM,GAAG,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC;QAC5C,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,oDAAoD;QAC/E,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;YACrD,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,UAAU,EAAE;aAC7D,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,oCAAoC,EAAE,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B,EAAE,CAAC,GAAG,EAAE,EAAE;QACrD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,EAAE,GAAG,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACnD,OAAO,EAAE,IAAI,EAAE,oCAAoC,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,4EAA4E;IAC5E,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChC,QAAQ,CAAC,QAAQ,CAAC,0BAA0B,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC9C,OAAO,EAAE,IAAI,EAAE,2BAA2B,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,OAAgB;IAClC,OAAQ,OAAsC,CAAC,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Git detection for the open-project flow (features/projects-workspaces.md § Open project).
3
+ * The git invocation is injectable so tests can run against a real temp repo or a fake runner.
4
+ */
5
+ export interface GitRunResult {
6
+ stdout: string;
7
+ stderr: string;
8
+ code: number;
9
+ }
10
+ export type GitRunner = (args: string[], cwd: string) => Promise<GitRunResult>;
11
+ /** Default runner: invoke the `git` CLI, never throwing (non-zero exit → `code`). */
12
+ export declare const defaultGitRunner: GitRunner;
13
+ export interface GitDetection {
14
+ isGit: boolean;
15
+ /** Repo top-level (git rev-parse --show-toplevel), or the input path when not a repo. */
16
+ rootPath: string;
17
+ remote: string | null;
18
+ branch: string | null;
19
+ }
20
+ export declare function detectGit(path: string, runner?: GitRunner): Promise<GitDetection>;
21
+ //# sourceMappingURL=git-detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-detect.d.ts","sourceRoot":"","sources":["../../src/projects/git-detect.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE/E,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,EAAE,SAW3B,CAAC;AAEL,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,SAA4B,GACnC,OAAO,CAAC,YAAY,CAAC,CAuBvB"}
@@ -0,0 +1,34 @@
1
+ import { execFile } from "node:child_process";
2
+ /** Default runner: invoke the `git` CLI, never throwing (non-zero exit → `code`). */
3
+ export const defaultGitRunner = (args, cwd) => new Promise((resolve) => {
4
+ execFile("git", args, { cwd, windowsHide: true }, (error, stdout, stderr) => {
5
+ const code = error && typeof error.code === "number"
6
+ ? error.code
7
+ : error
8
+ ? 1
9
+ : 0;
10
+ resolve({ stdout: stdout?.toString() ?? "", stderr: stderr?.toString() ?? "", code });
11
+ });
12
+ });
13
+ export async function detectGit(path, runner = defaultGitRunner) {
14
+ const top = await runner(["rev-parse", "--show-toplevel"], path);
15
+ if (top.code !== 0) {
16
+ return { isGit: false, rootPath: path, remote: null, branch: null };
17
+ }
18
+ const rootPath = top.stdout.trim() || path;
19
+ // `symbolic-ref --short HEAD` works on an unborn branch (fresh repo, no commits); fall back to
20
+ // `rev-parse --abbrev-ref HEAD` for detached HEAD.
21
+ const [remoteRes, symbolicRes] = await Promise.all([
22
+ runner(["remote", "get-url", "origin"], rootPath),
23
+ runner(["symbolic-ref", "--short", "HEAD"], rootPath),
24
+ ]);
25
+ const remote = remoteRes.code === 0 && remoteRes.stdout.trim() ? remoteRes.stdout.trim() : null;
26
+ let branch = symbolicRes.code === 0 && symbolicRes.stdout.trim() ? symbolicRes.stdout.trim() : null;
27
+ if (!branch) {
28
+ const abbrev = await runner(["rev-parse", "--abbrev-ref", "HEAD"], rootPath);
29
+ const value = abbrev.stdout.trim();
30
+ branch = abbrev.code === 0 && value && value !== "HEAD" ? value : null;
31
+ }
32
+ return { isGit: true, rootPath, remote, branch };
33
+ }
34
+ //# sourceMappingURL=git-detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-detect.js","sourceRoot":"","sources":["../../src/projects/git-detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAe9C,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CACvD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QAC1E,MAAM,IAAI,GACR,KAAK,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ;YAC7D,CAAC,CAAE,KAA0B,CAAC,IAAI;YAClC,CAAC,CAAC,KAAK;gBACL,CAAC,CAAC,CAAC;gBACH,CAAC,CAAC,CAAC,CAAC;QACV,OAAO,CAAC,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AAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACzF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC7E,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACzE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACnD,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { type GenerateOpts, type GenerationTask } from "../agent/structured-generation.js";
2
+ import type { HandlerRegistry } from "../ws/router.js";
3
+ import { type GitRunner } from "./git-detect.js";
4
+ import type { WorkspaceGitService } from "./workspace-git-service.js";
5
+ /**
6
+ * Provider-neutral git mutation operations (features/git-checkout.md § Git operations, § Behavior
7
+ * (commit), § Error Handling). Commit messages and branch names use the daemon's structured
8
+ * generation. Git failures (merge conflict, non-fast-forward push) surface as `{ ok:false, error }`.
9
+ */
10
+ export type GitOpResult = {
11
+ ok: true;
12
+ [key: string]: unknown;
13
+ } | {
14
+ ok: false;
15
+ error: string;
16
+ };
17
+ export interface GitOperationsDeps {
18
+ gitRunner?: GitRunner;
19
+ /** Used to refresh the status projection after a successful mutation. */
20
+ gitService?: WorkspaceGitService;
21
+ /** Structured generation entrypoint (commit message / branch name). */
22
+ generate?: (task: GenerationTask, opts?: GenerateOpts) => Promise<string>;
23
+ }
24
+ export interface CommitRequest {
25
+ cwd: string;
26
+ message?: string;
27
+ /** Stage all changes (`git add -A`) before committing. */
28
+ all?: boolean;
29
+ /** Stage specific paths before committing. */
30
+ paths?: string[];
31
+ }
32
+ /** Validate a branch name via `git check-ref-format --branch`, plus basic sanity checks. */
33
+ export declare function validateBranchName(cwd: string, name: string, runner: GitRunner): Promise<{
34
+ valid: boolean;
35
+ reason?: string;
36
+ }>;
37
+ export declare class GitOperationsService {
38
+ private readonly deps;
39
+ private readonly git;
40
+ private readonly generate;
41
+ constructor(deps?: GitOperationsDeps);
42
+ registerHandlers(registry: HandlerRegistry): void;
43
+ private respond;
44
+ commit(req: CommitRequest): Promise<GitOpResult>;
45
+ switchBranch(cwd: string, opts: {
46
+ branch: string;
47
+ create?: boolean;
48
+ }): Promise<GitOpResult>;
49
+ renameBranch(cwd: string, opts: {
50
+ to: string;
51
+ from?: string;
52
+ }): Promise<GitOpResult>;
53
+ merge(cwd: string, ref: string): Promise<GitOpResult>;
54
+ pull(cwd: string): Promise<GitOpResult>;
55
+ push(cwd: string, opts?: {
56
+ remote?: string;
57
+ branch?: string;
58
+ setUpstream?: boolean;
59
+ }): Promise<GitOpResult>;
60
+ stashSave(cwd: string, message?: string): Promise<GitOpResult>;
61
+ stashPop(cwd: string): Promise<GitOpResult>;
62
+ stashList(cwd: string): Promise<GitOpResult>;
63
+ /** Generate slug-safe branch-name suggestions from a prompt. */
64
+ branchSuggestions(prompt: string): Promise<string[]>;
65
+ private refresh;
66
+ }
67
+ //# sourceMappingURL=git-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-operations.d.ts","sourceRoot":"","sources":["../../src/projects/git-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;GAIG;AAEH,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE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AC,EAAE,OAAO,CAAA;KAAE,GACzC,OAAO,CAAC,WAAW,CAAC;IAgBjB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAWpF,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAUrD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOvC,IAAI,CACR,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO,GACrE,OAAO,CAAC,WAAW,CAAC;IAUjB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ9D,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAO3C,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOlD,gEAAgE;IAC1D,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAM5C,OAAO;CAGtB"}
@@ -0,0 +1,200 @@
1
+ import { generate as defaultGenerate, } from "../agent/structured-generation.js";
2
+ import { defaultGitRunner } from "./git-detect.js";
3
+ import { slugBranchName } from "./worktree-service.js";
4
+ /** Validate a branch name via `git check-ref-format --branch`, plus basic sanity checks. */
5
+ export async function validateBranchName(cwd, name, runner) {
6
+ const trimmed = name.trim();
7
+ if (!trimmed)
8
+ return { valid: false, reason: "empty" };
9
+ if (/\s/.test(trimmed))
10
+ return { valid: false, reason: "whitespace" };
11
+ const result = await runner(["check-ref-format", "--branch", trimmed], cwd);
12
+ if (result.code !== 0)
13
+ return { valid: false, reason: "invalid_ref_format" };
14
+ return { valid: true };
15
+ }
16
+ export class GitOperationsService {
17
+ deps;
18
+ git;
19
+ generate;
20
+ constructor(deps = {}) {
21
+ this.deps = deps;
22
+ this.git = deps.gitRunner ?? defaultGitRunner;
23
+ this.generate = deps.generate ?? defaultGenerate;
24
+ }
25
+ registerHandlers(registry) {
26
+ registry.register("checkout_commit_request", (ctx) => this.respond("checkout_commit_response", this.commit(toCommitRequest(ctx.message))));
27
+ registry.register("checkout_switch_branch_request", (ctx) => this.respond("checkout_switch_branch_response", this.switchBranch(String(ctx.message.cwd ?? ""), {
28
+ branch: String(ctx.message.branch ?? ""),
29
+ create: Boolean(ctx.message.create),
30
+ })));
31
+ registry.register("checkout_rename_branch_request", (ctx) => this.respond("checkout_rename_branch_response", this.renameBranch(String(ctx.message.cwd ?? ""), {
32
+ to: String(ctx.message.to ?? ""),
33
+ from: ctx.message.from,
34
+ })));
35
+ registry.register("checkout_merge_request", (ctx) => this.respond("checkout_merge_response", this.merge(String(ctx.message.cwd ?? ""), String(ctx.message.branch ?? ""))));
36
+ registry.register("checkout_merge_from_base_request", (ctx) => this.respond("checkout_merge_from_base_response", this.merge(String(ctx.message.cwd ?? ""), String(ctx.message.base ?? ""))));
37
+ registry.register("checkout_pull_request", (ctx) => this.respond("checkout_pull_response", this.pull(String(ctx.message.cwd ?? ""))));
38
+ registry.register("checkout_push_request", (ctx) => this.respond("checkout_push_response", this.push(String(ctx.message.cwd ?? ""), {
39
+ remote: ctx.message.remote,
40
+ branch: ctx.message.branch,
41
+ setUpstream: Boolean(ctx.message.setUpstream),
42
+ })));
43
+ registry.register("stash_save_request", (ctx) => this.respond("stash_save_response", this.stashSave(String(ctx.message.cwd ?? ""), ctx.message.message)));
44
+ registry.register("stash_pop_request", (ctx) => this.respond("stash_pop_response", this.stashPop(String(ctx.message.cwd ?? ""))));
45
+ registry.register("stash_list_request", (ctx) => this.respond("stash_list_response", this.stashList(String(ctx.message.cwd ?? ""))));
46
+ registry.register("validate_branch_request", async (ctx) => {
47
+ const result = await validateBranchName(String(ctx.message.cwd ?? ""), String(ctx.message.name ?? ""), this.git);
48
+ return { type: "validate_branch_response", ...result };
49
+ });
50
+ registry.register("branch_suggestions_request", async (ctx) => ({
51
+ type: "branch_suggestions_response",
52
+ suggestions: await this.branchSuggestions(String(ctx.message.prompt ?? "")),
53
+ }));
54
+ }
55
+ async respond(type, op) {
56
+ return { type, ...(await op) };
57
+ }
58
+ // ─── Operations ──────────────────────────────────────────────────────────
59
+ async commit(req) {
60
+ if (req.all) {
61
+ const add = await this.git(["add", "-A"], req.cwd);
62
+ if (add.code !== 0)
63
+ return fail(add);
64
+ }
65
+ else if (req.paths && req.paths.length > 0) {
66
+ const add = await this.git(["add", "--", ...req.paths], req.cwd);
67
+ if (add.code !== 0)
68
+ return fail(add);
69
+ }
70
+ let message = req.message?.trim();
71
+ let generated = false;
72
+ if (!message) {
73
+ const diff = await this.git(["diff", "--staged", "--stat"], req.cwd);
74
+ message = await this.generate("commit_message", {
75
+ context: { prompt: diff.stdout.trim() || "Update" },
76
+ });
77
+ generated = true;
78
+ }
79
+ const commit = await this.git(["commit", "-m", message], req.cwd);
80
+ if (commit.code !== 0)
81
+ return fail(commit);
82
+ await this.refresh(req.cwd);
83
+ return { ok: true, message, generated };
84
+ }
85
+ async switchBranch(cwd, opts) {
86
+ if (opts.create) {
87
+ const slug = slugBranchName(opts.branch);
88
+ const valid = await validateBranchName(cwd, slug, this.git);
89
+ if (!valid.valid)
90
+ return { ok: false, error: `invalid_branch_name:${valid.reason}` };
91
+ const res = await this.git(["switch", "-c", slug], cwd);
92
+ if (res.code !== 0)
93
+ return fail(res);
94
+ await this.refresh(cwd);
95
+ return { ok: true, branch: slug };
96
+ }
97
+ const res = await this.git(["switch", opts.branch], cwd);
98
+ if (res.code !== 0)
99
+ return fail(res);
100
+ await this.refresh(cwd);
101
+ return { ok: true, branch: opts.branch };
102
+ }
103
+ async renameBranch(cwd, opts) {
104
+ const slug = slugBranchName(opts.to);
105
+ const valid = await validateBranchName(cwd, slug, this.git);
106
+ if (!valid.valid)
107
+ return { ok: false, error: `invalid_branch_name:${valid.reason}` };
108
+ const args = opts.from ? ["branch", "-m", opts.from, slug] : ["branch", "-m", slug];
109
+ const res = await this.git(args, cwd);
110
+ if (res.code !== 0)
111
+ return fail(res);
112
+ await this.refresh(cwd);
113
+ return { ok: true, branch: slug };
114
+ }
115
+ async merge(cwd, ref) {
116
+ const res = await this.git(["merge", ref], cwd);
117
+ if (res.code !== 0) {
118
+ await this.refresh(cwd); // conflicts now show in the status projection
119
+ return { ok: false, error: mergeErrorReason(res) };
120
+ }
121
+ await this.refresh(cwd);
122
+ return { ok: true };
123
+ }
124
+ async pull(cwd) {
125
+ const res = await this.git(["pull"], cwd);
126
+ if (res.code !== 0)
127
+ return fail(res);
128
+ await this.refresh(cwd);
129
+ return { ok: true };
130
+ }
131
+ async push(cwd, opts = {}) {
132
+ const args = ["push"];
133
+ if (opts.setUpstream)
134
+ args.push("--set-upstream");
135
+ if (opts.remote)
136
+ args.push(opts.remote);
137
+ if (opts.branch)
138
+ args.push(opts.branch);
139
+ const res = await this.git(args, cwd);
140
+ if (res.code !== 0)
141
+ return { ok: false, error: pushErrorReason(res) };
142
+ return { ok: true };
143
+ }
144
+ async stashSave(cwd, message) {
145
+ const args = message ? ["stash", "push", "-m", message] : ["stash", "push"];
146
+ const res = await this.git(args, cwd);
147
+ if (res.code !== 0)
148
+ return fail(res);
149
+ await this.refresh(cwd);
150
+ return { ok: true };
151
+ }
152
+ async stashPop(cwd) {
153
+ const res = await this.git(["stash", "pop"], cwd);
154
+ if (res.code !== 0)
155
+ return fail(res);
156
+ await this.refresh(cwd);
157
+ return { ok: true };
158
+ }
159
+ async stashList(cwd) {
160
+ const res = await this.git(["stash", "list"], cwd);
161
+ if (res.code !== 0)
162
+ return fail(res);
163
+ const entries = res.stdout.split("\n").filter((l) => l.trim().length > 0);
164
+ return { ok: true, entries };
165
+ }
166
+ /** Generate slug-safe branch-name suggestions from a prompt. */
167
+ async branchSuggestions(prompt) {
168
+ const generated = await this.generate("branch_name", { context: { prompt } });
169
+ const base = slugBranchName(generated);
170
+ return [base, `${base}-1`, `feature/${base}`];
171
+ }
172
+ async refresh(cwd) {
173
+ await this.deps.gitService?.refresh(cwd);
174
+ }
175
+ }
176
+ function toCommitRequest(message) {
177
+ return {
178
+ cwd: String(message.cwd ?? ""),
179
+ message: message.message,
180
+ all: Boolean(message.all),
181
+ paths: Array.isArray(message.paths) ? message.paths : undefined,
182
+ };
183
+ }
184
+ function fail(result) {
185
+ const error = (result.stderr || result.stdout).trim().split("\n")[0] ?? "git_error";
186
+ return { ok: false, error: error || "git_error" };
187
+ }
188
+ function mergeErrorReason(result) {
189
+ const text = `${result.stdout}\n${result.stderr}`;
190
+ if (/conflict/i.test(text))
191
+ return "merge_conflict";
192
+ return fail(result).error;
193
+ }
194
+ function pushErrorReason(result) {
195
+ const text = `${result.stdout}\n${result.stderr}`;
196
+ if (/non-fast-forward|\[rejected\]|fetch first/i.test(text))
197
+ return "non_fast_forward";
198
+ return fail(result).error;
199
+ }
200
+ //# sourceMappingURL=git-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-operations.js","sourceRoot":"","sources":["../../src/projects/git-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,IAAI,eAAe,GAC5B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAkB,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA4BvD,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAW,EACX,IAAY,EACZ,MAAiB;IAEjB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAO,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
+ import type { HandlerRegistry } from "../ws/router.js";
3
+ import { type GitRunner } from "./git-detect.js";
4
+ /**
5
+ * GitHub PR operations via the `gh` CLI (features/git-checkout.md § GitHub operations, § Auto-merge
6
+ * request shape, § Auto-archive on merge). New GitHub RPCs are namespaced `checkout.github.*`.
7
+ * `checkout.github.set_auto_merge` is feature-gated by `features.checkoutGithubSetAutoMerge`.
8
+ */
9
+ export interface GhRunResult {
10
+ stdout: string;
11
+ stderr: string;
12
+ code: number;
13
+ }
14
+ export type GhRunner = (args: string[], cwd: string) => Promise<GhRunResult>;
15
+ /** Default `gh` CLI runner (never throws; non-zero exit → `code`). */
16
+ export declare const defaultGhRunner: GhRunner;
17
+ export type MergeMethod = "merge" | "squash" | "rebase";
18
+ export interface GitHubServiceDeps {
19
+ ghRunner?: GhRunner;
20
+ gitRunner?: GitRunner;
21
+ generate?: (task: GenerationTask, opts?: GenerateOpts) => Promise<string>;
22
+ /** Whether the daemon advertises `features.checkoutGithubSetAutoMerge`. */
23
+ setAutoMergeEnabled: boolean;
24
+ /** Archive a workspace (auto-archive-on-merge coupling). */
25
+ archiveWorkspace?: (workspaceId: string) => Promise<void>;
26
+ }
27
+ export declare class GitHubService {
28
+ private readonly deps;
29
+ private readonly gh;
30
+ private readonly git;
31
+ private readonly generate;
32
+ constructor(deps: GitHubServiceDeps);
33
+ registerHandlers(registry: HandlerRegistry): void;
34
+ /** True when `gh` reports an authenticated session. */
35
+ private isAuthenticated;
36
+ createPr(opts: {
37
+ cwd: string;
38
+ title?: string;
39
+ body?: string;
40
+ base?: string;
41
+ draft?: boolean;
42
+ }): Promise<{
43
+ ok: boolean;
44
+ pr?: {
45
+ number: number | null;
46
+ url: string;
47
+ };
48
+ error?: string;
49
+ }>;
50
+ mergePr(cwd: string, method?: MergeMethod): Promise<{
51
+ ok: boolean;
52
+ error?: string;
53
+ }>;
54
+ setAutoMerge(cwd: string, enabled: boolean, method?: MergeMethod): Promise<{
55
+ success: boolean;
56
+ error: string | null;
57
+ }>;
58
+ prStatus(cwd: string): Promise<{
59
+ ok: boolean;
60
+ state?: string;
61
+ merged?: boolean;
62
+ error?: string;
63
+ }>;
64
+ prTimeline(cwd: string): Promise<{
65
+ ok: boolean;
66
+ events?: unknown;
67
+ error?: string;
68
+ }>;
69
+ search(query: string, cwd: string): Promise<{
70
+ ok: boolean;
71
+ results?: unknown;
72
+ error?: string;
73
+ }>;
74
+ /**
75
+ * Auto-archive-on-merge: if the PR for `cwd` is safely merged, archive its workspace. Returns true
76
+ * when an archive was triggered.
77
+ */
78
+ autoArchiveOnMerge(cwd: string, workspaceId: string): Promise<boolean>;
79
+ }
80
+ //# sourceMappingURL=github-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-service.d.ts","sourceRoot":"","sources":["../../src/projects/github-service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAE7E,sEAAsE;AACtE,eAAO,MAAM,eAAe,EAAE,QAW1B,CAAC;AAEL,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,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