@telora/daemon 0.15.2 → 0.15.4

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 (401) hide show
  1. package/README.md +11 -11
  2. package/build-info.json +2 -2
  3. package/dist/assembly-engine.d.ts +1 -1
  4. package/dist/assembly-engine.d.ts.map +1 -1
  5. package/dist/assembly-resolvers.js +41 -41
  6. package/dist/assembly-resolvers.js.map +1 -1
  7. package/dist/branch-status.d.ts +4 -4
  8. package/dist/branch-status.d.ts.map +1 -1
  9. package/dist/branch-status.js +23 -23
  10. package/dist/branch-status.js.map +1 -1
  11. package/dist/cli/connect.js +1 -1
  12. package/dist/cli/connect.js.map +1 -1
  13. package/dist/completion-detector.d.ts +1 -1
  14. package/dist/completion-detector.js +1 -1
  15. package/dist/completion-handler.d.ts +1 -1
  16. package/dist/completion-handler.js +4 -4
  17. package/dist/completion-handler.js.map +1 -1
  18. package/dist/condition-evaluators.js +4 -4
  19. package/dist/condition-evaluators.js.map +1 -1
  20. package/dist/control-state.d.ts +6 -6
  21. package/dist/control-state.d.ts.map +1 -1
  22. package/dist/control-state.js +43 -43
  23. package/dist/control-state.js.map +1 -1
  24. package/dist/crash-recovery-scan.d.ts +1 -1
  25. package/dist/crash-recovery-scan.js +20 -20
  26. package/dist/crash-recovery-scan.js.map +1 -1
  27. package/dist/crash-recovery-types.d.ts +3 -3
  28. package/dist/crash-recovery-types.d.ts.map +1 -1
  29. package/dist/crash-recovery-types.js +2 -2
  30. package/dist/crash-recovery-types.js.map +1 -1
  31. package/dist/crash-recovery.d.ts +3 -3
  32. package/dist/crash-recovery.d.ts.map +1 -1
  33. package/dist/crash-recovery.js +21 -21
  34. package/dist/crash-recovery.js.map +1 -1
  35. package/dist/daemon-process.d.ts +1 -1
  36. package/dist/daemon-process.d.ts.map +1 -1
  37. package/dist/dag-validator.d.ts +6 -6
  38. package/dist/dag-validator.d.ts.map +1 -1
  39. package/dist/dag-validator.js +2 -2
  40. package/dist/dag-validator.js.map +1 -1
  41. package/dist/delivery-guards.d.ts +1 -1
  42. package/dist/delivery-guards.js +1 -1
  43. package/dist/delivery-lifecycle.d.ts +5 -5
  44. package/dist/delivery-lifecycle.d.ts.map +1 -1
  45. package/dist/delivery-lifecycle.js +12 -12
  46. package/dist/delivery-lifecycle.js.map +1 -1
  47. package/dist/delivery-merge.js +1 -1
  48. package/dist/delivery-merge.js.map +1 -1
  49. package/dist/dependency-resolver.d.ts +7 -7
  50. package/dist/dependency-resolver.d.ts.map +1 -1
  51. package/dist/dependency-resolver.js.map +1 -1
  52. package/dist/directive-executor.d.ts +32 -17
  53. package/dist/directive-executor.d.ts.map +1 -1
  54. package/dist/directive-executor.js +119 -78
  55. package/dist/directive-executor.js.map +1 -1
  56. package/dist/evaluation-context.d.ts +2 -2
  57. package/dist/evaluation-context.d.ts.map +1 -1
  58. package/dist/evaluation-context.js +4 -4
  59. package/dist/evaluation-context.js.map +1 -1
  60. package/dist/focus-completion-event.d.ts +97 -0
  61. package/dist/focus-completion-event.d.ts.map +1 -0
  62. package/dist/focus-completion-event.js +257 -0
  63. package/dist/focus-completion-event.js.map +1 -0
  64. package/dist/{strategy-completion.d.ts → focus-completion.d.ts} +11 -11
  65. package/dist/focus-completion.d.ts.map +1 -0
  66. package/dist/{strategy-completion.js → focus-completion.js} +68 -68
  67. package/dist/focus-completion.js.map +1 -0
  68. package/dist/{strategy-engine.d.ts → focus-engine.d.ts} +5 -5
  69. package/dist/focus-engine.d.ts.map +1 -0
  70. package/dist/{strategy-engine.js → focus-engine.js} +35 -35
  71. package/dist/focus-engine.js.map +1 -0
  72. package/dist/focus-executor.d.ts +55 -0
  73. package/dist/focus-executor.d.ts.map +1 -0
  74. package/dist/{strategy-executor.js → focus-executor.js} +167 -120
  75. package/dist/focus-executor.js.map +1 -0
  76. package/dist/focus-lifecycle.d.ts +61 -0
  77. package/dist/focus-lifecycle.d.ts.map +1 -0
  78. package/dist/{strategy-lifecycle.js → focus-lifecycle.js} +164 -164
  79. package/dist/focus-lifecycle.js.map +1 -0
  80. package/dist/{strategy-merge.d.ts → focus-merge.d.ts} +10 -10
  81. package/dist/focus-merge.d.ts.map +1 -0
  82. package/dist/{strategy-merge.js → focus-merge.js} +51 -51
  83. package/dist/focus-merge.js.map +1 -0
  84. package/dist/focus-phase.d.ts +22 -0
  85. package/dist/focus-phase.d.ts.map +1 -0
  86. package/dist/focus-phase.js +54 -0
  87. package/dist/focus-phase.js.map +1 -0
  88. package/dist/focus-prompt-builder.d.ts +35 -0
  89. package/dist/focus-prompt-builder.d.ts.map +1 -0
  90. package/dist/{strategy-prompt-builder.js → focus-prompt-builder.js} +55 -4
  91. package/dist/focus-prompt-builder.js.map +1 -0
  92. package/dist/focus-provisioning.d.ts +16 -0
  93. package/dist/focus-provisioning.d.ts.map +1 -0
  94. package/dist/focus-provisioning.js +119 -0
  95. package/dist/focus-provisioning.js.map +1 -0
  96. package/dist/{strategy-spawn-helpers.d.ts → focus-spawn-helpers.d.ts} +15 -15
  97. package/dist/focus-spawn-helpers.d.ts.map +1 -0
  98. package/dist/{strategy-spawn-helpers.js → focus-spawn-helpers.js} +28 -28
  99. package/dist/focus-spawn-helpers.js.map +1 -0
  100. package/dist/{strategy-team-lifecycle.d.ts → focus-team-lifecycle.d.ts} +13 -13
  101. package/dist/focus-team-lifecycle.d.ts.map +1 -0
  102. package/dist/{strategy-team-lifecycle.js → focus-team-lifecycle.js} +57 -57
  103. package/dist/focus-team-lifecycle.js.map +1 -0
  104. package/dist/focus-team-state.d.ts +24 -0
  105. package/dist/focus-team-state.d.ts.map +1 -0
  106. package/dist/{strategy-team-state.js → focus-team-state.js} +9 -9
  107. package/dist/focus-team-state.js.map +1 -0
  108. package/dist/focus-worktree-state.d.ts +47 -0
  109. package/dist/focus-worktree-state.d.ts.map +1 -0
  110. package/dist/{strategy-worktree-state.js → focus-worktree-state.js} +29 -29
  111. package/dist/focus-worktree-state.js.map +1 -0
  112. package/dist/git-merge.d.ts +5 -5
  113. package/dist/git-merge.d.ts.map +1 -1
  114. package/dist/git-merge.js +5 -5
  115. package/dist/git-merge.js.map +1 -1
  116. package/dist/git-state-detector.d.ts +1 -1
  117. package/dist/git-state-detector.js +9 -9
  118. package/dist/git-state-detector.js.map +1 -1
  119. package/dist/git-utils.d.ts +1 -1
  120. package/dist/git-utils.js +1 -1
  121. package/dist/git.d.ts +2 -2
  122. package/dist/git.d.ts.map +1 -1
  123. package/dist/git.js +3 -3
  124. package/dist/git.js.map +1 -1
  125. package/dist/heartbeat.d.ts +4 -4
  126. package/dist/heartbeat.d.ts.map +1 -1
  127. package/dist/heartbeat.js +7 -7
  128. package/dist/heartbeat.js.map +1 -1
  129. package/dist/index.d.ts +1 -1
  130. package/dist/index.js +10 -10
  131. package/dist/index.js.map +1 -1
  132. package/dist/listener-auto-advance.d.ts +2 -2
  133. package/dist/listener-auto-advance.js +21 -21
  134. package/dist/listener-auto-advance.js.map +1 -1
  135. package/dist/listener.d.ts +12 -12
  136. package/dist/listener.d.ts.map +1 -1
  137. package/dist/listener.js +80 -75
  138. package/dist/listener.js.map +1 -1
  139. package/dist/loop-engine.d.ts +20 -20
  140. package/dist/loop-engine.d.ts.map +1 -1
  141. package/dist/loop-engine.js +82 -82
  142. package/dist/loop-engine.js.map +1 -1
  143. package/dist/loop-event-bus.d.ts +5 -5
  144. package/dist/loop-event-bus.d.ts.map +1 -1
  145. package/dist/loop-event-bus.js +3 -3
  146. package/dist/loop-llm-client.d.ts +1 -1
  147. package/dist/loop-llm-client.js +1 -1
  148. package/dist/loop-variance.d.ts +1 -1
  149. package/dist/loop-variance.js +1 -1
  150. package/dist/merge-detector.d.ts +6 -6
  151. package/dist/merge-detector.d.ts.map +1 -1
  152. package/dist/merge-detector.js +47 -47
  153. package/dist/merge-detector.js.map +1 -1
  154. package/dist/otlp-log-parser.js +2 -2
  155. package/dist/otlp-log-parser.js.map +1 -1
  156. package/dist/otlp-metric-parser.js +1 -1
  157. package/dist/otlp-metric-parser.js.map +1 -1
  158. package/dist/otlp-receiver.d.ts +1 -1
  159. package/dist/otlp-receiver.js +7 -7
  160. package/dist/otlp-receiver.js.map +1 -1
  161. package/dist/otlp-types.d.ts +1 -1
  162. package/dist/otlp-types.d.ts.map +1 -1
  163. package/dist/otlp-types.js +3 -3
  164. package/dist/otlp-types.js.map +1 -1
  165. package/dist/output-monitor.d.ts +6 -6
  166. package/dist/output-monitor.d.ts.map +1 -1
  167. package/dist/output-monitor.js +11 -11
  168. package/dist/output-monitor.js.map +1 -1
  169. package/dist/planning-prompt-builder.d.ts +11 -11
  170. package/dist/planning-prompt-builder.d.ts.map +1 -1
  171. package/dist/planning-prompt-builder.js +28 -28
  172. package/dist/planning-prompt-builder.js.map +1 -1
  173. package/dist/pm/mitigation-correlator.d.ts +7 -7
  174. package/dist/pm/mitigation-correlator.d.ts.map +1 -1
  175. package/dist/pm/mitigation-correlator.js +33 -33
  176. package/dist/pm/mitigation-correlator.js.map +1 -1
  177. package/dist/pm-engine.js +1 -1
  178. package/dist/pm-engine.js.map +1 -1
  179. package/dist/prompt-builder.d.ts +1 -1
  180. package/dist/prompt-builder.js +9 -9
  181. package/dist/prompt-builder.js.map +1 -1
  182. package/dist/prompts/starter-prompt.d.ts +2 -2
  183. package/dist/prompts/starter-prompt.d.ts.map +1 -1
  184. package/dist/prompts/starter-prompt.js +6 -6
  185. package/dist/qa-crash-recovery.d.ts +10 -10
  186. package/dist/qa-crash-recovery.d.ts.map +1 -1
  187. package/dist/qa-crash-recovery.js +32 -32
  188. package/dist/qa-crash-recovery.js.map +1 -1
  189. package/dist/qa-dev-server.d.ts +3 -3
  190. package/dist/qa-dev-server.d.ts.map +1 -1
  191. package/dist/qa-dev-server.js +3 -3
  192. package/dist/qa-dev-server.js.map +1 -1
  193. package/dist/qa-orchestrator.d.ts +18 -18
  194. package/dist/qa-orchestrator.d.ts.map +1 -1
  195. package/dist/qa-orchestrator.js +47 -47
  196. package/dist/qa-orchestrator.js.map +1 -1
  197. package/dist/qa-provisioner.d.ts +3 -3
  198. package/dist/qa-provisioner.d.ts.map +1 -1
  199. package/dist/qa-provisioner.js +14 -14
  200. package/dist/qa-provisioner.js.map +1 -1
  201. package/dist/qa-state.d.ts +10 -10
  202. package/dist/qa-state.d.ts.map +1 -1
  203. package/dist/qa-state.js +11 -11
  204. package/dist/qa-state.js.map +1 -1
  205. package/dist/queries/control-state.d.ts +5 -5
  206. package/dist/queries/control-state.d.ts.map +1 -1
  207. package/dist/queries/control-state.js +4 -4
  208. package/dist/queries/control-state.js.map +1 -1
  209. package/dist/queries/deliveries.d.ts +24 -23
  210. package/dist/queries/deliveries.d.ts.map +1 -1
  211. package/dist/queries/deliveries.js +30 -29
  212. package/dist/queries/deliveries.js.map +1 -1
  213. package/dist/queries/{strategies.d.ts → focuses.d.ts} +24 -21
  214. package/dist/queries/focuses.d.ts.map +1 -0
  215. package/dist/queries/{strategies.js → focuses.js} +39 -31
  216. package/dist/queries/focuses.js.map +1 -0
  217. package/dist/queries/index.d.ts +3 -3
  218. package/dist/queries/index.d.ts.map +1 -1
  219. package/dist/queries/index.js +2 -2
  220. package/dist/queries/index.js.map +1 -1
  221. package/dist/queries/qa.d.ts +16 -16
  222. package/dist/queries/qa.d.ts.map +1 -1
  223. package/dist/queries/qa.js +22 -22
  224. package/dist/queries/qa.js.map +1 -1
  225. package/dist/queries/schemas.d.ts +36 -30
  226. package/dist/queries/schemas.d.ts.map +1 -1
  227. package/dist/queries/schemas.js +28 -25
  228. package/dist/queries/schemas.js.map +1 -1
  229. package/dist/queries/sessions.d.ts +1 -1
  230. package/dist/queries/sessions.d.ts.map +1 -1
  231. package/dist/queries/sessions.js +2 -2
  232. package/dist/queries/sessions.js.map +1 -1
  233. package/dist/queries/shared.js +10 -10
  234. package/dist/queries/shared.js.map +1 -1
  235. package/dist/queries/workflows.d.ts +1 -1
  236. package/dist/queries/workflows.js +1 -1
  237. package/dist/queries/worktrees.d.ts +7 -7
  238. package/dist/queries/worktrees.d.ts.map +1 -1
  239. package/dist/queries/worktrees.js +7 -7
  240. package/dist/queries/worktrees.js.map +1 -1
  241. package/dist/review-defect-detector.d.ts +125 -0
  242. package/dist/review-defect-detector.d.ts.map +1 -0
  243. package/dist/review-defect-detector.js +289 -0
  244. package/dist/review-defect-detector.js.map +1 -0
  245. package/dist/session-lifecycle.d.ts +17 -17
  246. package/dist/session-lifecycle.d.ts.map +1 -1
  247. package/dist/session-lifecycle.js +82 -82
  248. package/dist/session-lifecycle.js.map +1 -1
  249. package/dist/spawn-cooldown.d.ts +8 -8
  250. package/dist/spawn-cooldown.d.ts.map +1 -1
  251. package/dist/spawn-cooldown.js +15 -15
  252. package/dist/spawn-cooldown.js.map +1 -1
  253. package/dist/spawn-environment.d.ts +2 -2
  254. package/dist/spawn-environment.d.ts.map +1 -1
  255. package/dist/spawn-environment.js +3 -3
  256. package/dist/spawn-environment.js.map +1 -1
  257. package/dist/spawner-lifecycle.d.ts +2 -2
  258. package/dist/spawner-lifecycle.d.ts.map +1 -1
  259. package/dist/spawner-lifecycle.js +3 -3
  260. package/dist/spawner-lifecycle.js.map +1 -1
  261. package/dist/spawner-resolution.d.ts +3 -3
  262. package/dist/spawner-resolution.d.ts.map +1 -1
  263. package/dist/spawner-resolution.js +4 -4
  264. package/dist/spawner-resolution.js.map +1 -1
  265. package/dist/spawner-stream-handlers.js +2 -2
  266. package/dist/spawner-stream-handlers.js.map +1 -1
  267. package/dist/spawner.d.ts +1 -1
  268. package/dist/spawner.d.ts.map +1 -1
  269. package/dist/spawner.js +6 -6
  270. package/dist/spawner.js.map +1 -1
  271. package/dist/stage-classifier.d.ts +1 -1
  272. package/dist/stage-classifier.js +1 -1
  273. package/dist/state-cascade.d.ts +25 -25
  274. package/dist/state-cascade.d.ts.map +1 -1
  275. package/dist/state-cascade.js +89 -89
  276. package/dist/state-cascade.js.map +1 -1
  277. package/dist/supabase.d.ts +4 -4
  278. package/dist/supabase.d.ts.map +1 -1
  279. package/dist/supabase.js +5 -5
  280. package/dist/supabase.js.map +1 -1
  281. package/dist/task-converter.d.ts +4 -4
  282. package/dist/task-converter.d.ts.map +1 -1
  283. package/dist/task-converter.js +1 -1
  284. package/dist/task-converter.js.map +1 -1
  285. package/dist/team-prompt-base.d.ts +49 -22
  286. package/dist/team-prompt-base.d.ts.map +1 -1
  287. package/dist/team-prompt-base.js +96 -32
  288. package/dist/team-prompt-base.js.map +1 -1
  289. package/dist/team-spawner.d.ts +9 -9
  290. package/dist/team-spawner.d.ts.map +1 -1
  291. package/dist/team-spawner.js +84 -82
  292. package/dist/team-spawner.js.map +1 -1
  293. package/dist/telemetry-writer.d.ts +2 -2
  294. package/dist/telemetry-writer.d.ts.map +1 -1
  295. package/dist/templates/claude-md.js +8 -8
  296. package/dist/templates/claude-settings.d.ts +1 -1
  297. package/dist/templates/claude-settings.js +2 -2
  298. package/dist/templates/claude-settings.js.map +1 -1
  299. package/dist/trigger-executor.d.ts +4 -4
  300. package/dist/trigger-executor.d.ts.map +1 -1
  301. package/dist/trigger-executor.js +11 -11
  302. package/dist/trigger-executor.js.map +1 -1
  303. package/dist/types/dag.d.ts +1 -1
  304. package/dist/types/delivery.d.ts +3 -3
  305. package/dist/types/delivery.d.ts.map +1 -1
  306. package/dist/types/{strategy.d.ts → focus.d.ts} +65 -31
  307. package/dist/types/focus.d.ts.map +1 -0
  308. package/dist/types/focus.js +5 -0
  309. package/dist/types/focus.js.map +1 -0
  310. package/dist/types/index.d.ts +1 -1
  311. package/dist/types/index.d.ts.map +1 -1
  312. package/dist/types/index.js +1 -1
  313. package/dist/types/index.js.map +1 -1
  314. package/dist/types/merge.d.ts +1 -1
  315. package/dist/types/session.d.ts +2 -2
  316. package/dist/types/session.d.ts.map +1 -1
  317. package/dist/unified-engine-lifecycle.js +11 -11
  318. package/dist/unified-engine-lifecycle.js.map +1 -1
  319. package/dist/unified-init.d.ts +1 -1
  320. package/dist/unified-init.js +9 -9
  321. package/dist/unified-init.js.map +1 -1
  322. package/dist/unified-shell-config.d.ts +4 -4
  323. package/dist/unified-shell-config.d.ts.map +1 -1
  324. package/dist/unified-shell-config.js +5 -5
  325. package/dist/unified-shell-config.js.map +1 -1
  326. package/dist/unified-shell-status.js +3 -3
  327. package/dist/unified-shell-status.js.map +1 -1
  328. package/dist/unified-shell.d.ts +1 -1
  329. package/dist/unified-shell.js +4 -4
  330. package/dist/unified-shell.js.map +1 -1
  331. package/dist/workflow-engine.d.ts +1 -1
  332. package/dist/workflow-engine.d.ts.map +1 -1
  333. package/dist/{worktree-strategy.d.ts → worktree-focus.d.ts} +15 -15
  334. package/dist/worktree-focus.d.ts.map +1 -0
  335. package/dist/{worktree-strategy.js → worktree-focus.js} +37 -37
  336. package/dist/worktree-focus.js.map +1 -0
  337. package/dist/worktree.d.ts +10 -10
  338. package/dist/worktree.d.ts.map +1 -1
  339. package/dist/worktree.js +39 -39
  340. package/dist/worktree.js.map +1 -1
  341. package/package.json +3 -3
  342. package/dist/listener-review.d.ts +0 -37
  343. package/dist/listener-review.d.ts.map +0 -1
  344. package/dist/listener-review.js +0 -217
  345. package/dist/listener-review.js.map +0 -1
  346. package/dist/queries/strategies.d.ts.map +0 -1
  347. package/dist/queries/strategies.js.map +0 -1
  348. package/dist/review-spawner.d.ts +0 -32
  349. package/dist/review-spawner.d.ts.map +0 -1
  350. package/dist/review-spawner.js +0 -170
  351. package/dist/review-spawner.js.map +0 -1
  352. package/dist/strategy-completion-event.d.ts +0 -63
  353. package/dist/strategy-completion-event.d.ts.map +0 -1
  354. package/dist/strategy-completion-event.js +0 -138
  355. package/dist/strategy-completion-event.js.map +0 -1
  356. package/dist/strategy-completion.d.ts.map +0 -1
  357. package/dist/strategy-completion.js.map +0 -1
  358. package/dist/strategy-engine.d.ts.map +0 -1
  359. package/dist/strategy-engine.js.map +0 -1
  360. package/dist/strategy-executor.d.ts +0 -55
  361. package/dist/strategy-executor.d.ts.map +0 -1
  362. package/dist/strategy-executor.js.map +0 -1
  363. package/dist/strategy-lifecycle.d.ts +0 -61
  364. package/dist/strategy-lifecycle.d.ts.map +0 -1
  365. package/dist/strategy-lifecycle.js.map +0 -1
  366. package/dist/strategy-merge.d.ts.map +0 -1
  367. package/dist/strategy-merge.js.map +0 -1
  368. package/dist/strategy-prompt-builder.d.ts +0 -24
  369. package/dist/strategy-prompt-builder.d.ts.map +0 -1
  370. package/dist/strategy-prompt-builder.js.map +0 -1
  371. package/dist/strategy-provisioning.d.ts +0 -16
  372. package/dist/strategy-provisioning.d.ts.map +0 -1
  373. package/dist/strategy-provisioning.js +0 -119
  374. package/dist/strategy-provisioning.js.map +0 -1
  375. package/dist/strategy-spawn-helpers.d.ts.map +0 -1
  376. package/dist/strategy-spawn-helpers.js.map +0 -1
  377. package/dist/strategy-team-lifecycle.d.ts.map +0 -1
  378. package/dist/strategy-team-lifecycle.js.map +0 -1
  379. package/dist/strategy-team-state.d.ts +0 -24
  380. package/dist/strategy-team-state.d.ts.map +0 -1
  381. package/dist/strategy-team-state.js.map +0 -1
  382. package/dist/strategy-teardown.d.ts +0 -24
  383. package/dist/strategy-teardown.d.ts.map +0 -1
  384. package/dist/strategy-teardown.js +0 -158
  385. package/dist/strategy-teardown.js.map +0 -1
  386. package/dist/strategy-worktree-state.d.ts +0 -47
  387. package/dist/strategy-worktree-state.d.ts.map +0 -1
  388. package/dist/strategy-worktree-state.js.map +0 -1
  389. package/dist/team-prompt-variants.d.ts +0 -17
  390. package/dist/team-prompt-variants.d.ts.map +0 -1
  391. package/dist/team-prompt-variants.js +0 -79
  392. package/dist/team-prompt-variants.js.map +0 -1
  393. package/dist/types/strategy.d.ts.map +0 -1
  394. package/dist/types/strategy.js +0 -5
  395. package/dist/types/strategy.js.map +0 -1
  396. package/dist/worktree-merge.d.ts +0 -23
  397. package/dist/worktree-merge.d.ts.map +0 -1
  398. package/dist/worktree-merge.js +0 -57
  399. package/dist/worktree-merge.js.map +0 -1
  400. package/dist/worktree-strategy.d.ts.map +0 -1
  401. package/dist/worktree-strategy.js.map +0 -1
@@ -1,38 +1,38 @@
1
1
  /**
2
- * Strategy team lifecycle management - terminate, wait, detect deactivated.
2
+ * Focus team lifecycle management - terminate, wait, detect deactivated.
3
3
  *
4
- * Extracted from strategy-executor.ts. These functions manage the lifecycle
5
- * of running strategy teams (shutdown, deactivation detection, merge checks).
4
+ * Extracted from focus-executor.ts. These functions manage the lifecycle
5
+ * of running focus teams (shutdown, deactivation detection, merge checks).
6
6
  */
7
- import { getReadyStrategies, } from './supabase.js';
7
+ import { getReadyFocuses, } from './supabase.js';
8
8
  import { sendMessage } from '@telora/daemon-core';
9
9
  import { clearNarration } from './heartbeat.js';
10
- import { getActiveTeams } from './strategy-team-state.js';
11
- import { mergeStrategyBranch, escalateMergeConflict } from './strategy-merge.js';
10
+ import { getActiveTeams } from './focus-team-state.js';
11
+ import { mergeFocusBranch, escalateMergeConflict } from './focus-merge.js';
12
12
  import { mergeIntegrationToMain } from './git-merge.js';
13
13
  import { reportGitState } from './supabase.js';
14
14
  import { isStatusAgentActionable, isStatusBlocking, isStatusExcludedFromCascade } from './stage-classifier.js';
15
- import { getStrategyDeliveries } from './queries/strategies.js';
15
+ import { getFocusDeliveries } from './queries/focuses.js';
16
16
  import { configForProduct, findProduct } from './config.js';
17
17
  // ── Team lifecycle ──────────────────────────────────────────────────────
18
18
  /**
19
- * Terminate a strategy team.
19
+ * Terminate a focus team.
20
20
  *
21
21
  * Sends a deactivation message via stdin (if open) before SIGTERM
22
22
  * to allow the team lead to process the shutdown gracefully.
23
23
  */
24
- export function terminateTeam(strategyId) {
24
+ export function terminateTeam(focusId) {
25
25
  const activeTeams = getActiveTeams();
26
- const team = activeTeams.get(strategyId);
26
+ const team = activeTeams.get(focusId);
27
27
  if (!team || !team.leadPid)
28
28
  return false;
29
29
  // Warn if terminating while conflict resolution is in progress
30
30
  if (team.resolvingMergeConflict) {
31
- console.warn(`[strategy-executor] Terminating team "${team.strategyName}" while merge conflict resolution is in progress`);
31
+ console.warn(`[focus-executor] Terminating team "${team.focusName}" while merge conflict resolution is in progress`);
32
32
  }
33
- console.log(`[strategy-executor] Terminating team for strategy "${team.strategyName}" (phase: ${team.phase})`);
33
+ console.log(`[focus-executor] Terminating team for focus "${team.focusName}" (phase: ${team.phase})`);
34
34
  team.phase = 'shutting_down';
35
- clearNarration(strategyId);
35
+ clearNarration(focusId);
36
36
  try {
37
37
  // Send a deactivation message first to let the team lead process it
38
38
  if (team.leadStdin) {
@@ -43,7 +43,7 @@ export function terminateTeam(strategyId) {
43
43
  team.leadStdin?.end();
44
44
  }
45
45
  catch (e) {
46
- console.debug('[strategy-executor] stdin.end() failed (may already be closed):', e.message);
46
+ console.debug('[focus-executor] stdin.end() failed (may already be closed):', e.message);
47
47
  }
48
48
  }, 5000);
49
49
  }
@@ -51,48 +51,48 @@ export function terminateTeam(strategyId) {
51
51
  process.kill(team.leadPid, 'SIGTERM');
52
52
  // Escalate to SIGKILL after timeout
53
53
  setTimeout(() => {
54
- if (activeTeams.has(strategyId) && team.leadPid) {
54
+ if (activeTeams.has(focusId) && team.leadPid) {
55
55
  try {
56
56
  process.kill(team.leadPid, 'SIGKILL');
57
57
  }
58
58
  catch (e) {
59
- console.debug('[strategy-executor] SIGKILL failed (process may have exited):', e.message);
59
+ console.debug('[focus-executor] SIGKILL failed (process may have exited):', e.message);
60
60
  }
61
61
  }
62
62
  }, 30000);
63
63
  return true;
64
64
  }
65
65
  catch (e) {
66
- console.debug(`[strategy-executor] terminateTeam: process may have already exited:`, e.message);
66
+ console.debug(`[focus-executor] terminateTeam: process may have already exited:`, e.message);
67
67
  return false;
68
68
  }
69
69
  }
70
70
  /**
71
71
  * Wait for a team's process to exit (leave activeTeams).
72
72
  *
73
- * Polls activeTeams until the strategy is no longer present,
73
+ * Polls activeTeams until the focus is no longer present,
74
74
  * which happens when handleTeamCompletion runs on the 'close' event.
75
75
  * If the timeout expires, sends SIGKILL and waits briefly.
76
76
  *
77
- * @param strategyId - Strategy to wait for
77
+ * @param focusId - Focus to wait for
78
78
  * @param timeoutMs - Max wait time in ms (default 30s)
79
79
  * @returns true if team exited within timeout, false if forced
80
80
  */
81
- export async function waitForTeamExit(strategyId, timeoutMs = 30000) {
81
+ export async function waitForTeamExit(focusId, timeoutMs = 30000) {
82
82
  const activeTeams = getActiveTeams();
83
- const team = activeTeams.get(strategyId);
83
+ const team = activeTeams.get(focusId);
84
84
  if (!team)
85
85
  return true; // Already gone
86
86
  const deadline = Date.now() + timeoutMs;
87
87
  const pollMs = 500;
88
88
  while (Date.now() < deadline) {
89
- if (!activeTeams.has(strategyId))
89
+ if (!activeTeams.has(focusId))
90
90
  return true;
91
91
  await new Promise(resolve => setTimeout(resolve, pollMs));
92
92
  }
93
93
  // Timeout expired — escalate to SIGKILL
94
94
  if (team.leadPid) {
95
- console.warn(`[strategy-executor] Team "${team.strategyName}" did not exit within ${timeoutMs}ms, sending SIGKILL`);
95
+ console.warn(`[focus-executor] Team "${team.focusName}" did not exit within ${timeoutMs}ms, sending SIGKILL`);
96
96
  try {
97
97
  process.kill(team.leadPid, 'SIGKILL');
98
98
  }
@@ -100,50 +100,50 @@ export async function waitForTeamExit(strategyId, timeoutMs = 30000) {
100
100
  // Brief wait for SIGKILL to take effect
101
101
  await new Promise(resolve => setTimeout(resolve, 2000));
102
102
  }
103
- return !activeTeams.has(strategyId);
103
+ return !activeTeams.has(focusId);
104
104
  }
105
105
  /**
106
106
  * Terminate all active teams.
107
107
  */
108
108
  export function terminateAllTeams() {
109
109
  const activeTeams = getActiveTeams();
110
- for (const strategyId of activeTeams.keys()) {
111
- terminateTeam(strategyId);
110
+ for (const focusId of activeTeams.keys()) {
111
+ terminateTeam(focusId);
112
112
  }
113
113
  }
114
114
  /**
115
- * Detect strategies that have been deactivated (agent role removed)
115
+ * Detect focuses that have been deactivated (agent role removed)
116
116
  * and shut down their active teams.
117
117
  */
118
- export async function detectDeactivatedStrategies(config) {
118
+ export async function detectDeactivatedFocuses(config) {
119
119
  const activeTeams = getActiveTeams();
120
120
  if (activeTeams.size === 0)
121
121
  return;
122
122
  try {
123
- // Aggregate ready strategies across all configured products
124
- const allReadyStrategies = [];
123
+ // Aggregate ready focuses across all configured products
124
+ const allReadyFocuses = [];
125
125
  for (const product of config.products) {
126
- const strategies = await getReadyStrategies(config.organizationId, product.id);
127
- allReadyStrategies.push(...strategies);
126
+ const focuses = await getReadyFocuses(config.organizationId, product.id);
127
+ allReadyFocuses.push(...focuses);
128
128
  }
129
- const activeStrategyIds = new Set(allReadyStrategies.map(s => s.strategy_id));
130
- for (const [strategyId, team] of activeTeams) {
131
- if (!activeStrategyIds.has(strategyId) && team.phase !== 'shutting_down' && team.phase !== 'terminated') {
132
- console.log(`[strategy-executor] Strategy "${team.strategyName}" deactivated -- shutting down team`);
129
+ const activeFocusIds = new Set(allReadyFocuses.map(s => s.focus_id));
130
+ for (const [focusId, team] of activeTeams) {
131
+ if (!activeFocusIds.has(focusId) && team.phase !== 'shutting_down' && team.phase !== 'terminated') {
132
+ console.log(`[focus-executor] Focus "${team.focusName}" deactivated -- shutting down team`);
133
133
  // Mark the shutdown reason so handleTeamCompletion can skip the merge
134
134
  // attempt cleanly when a planning team is cancelled mid-flight.
135
135
  team.shutdownReason = 'deactivated';
136
- terminateTeam(strategyId);
136
+ terminateTeam(focusId);
137
137
  }
138
138
  }
139
139
  }
140
140
  catch (err) {
141
- console.warn(`[strategy-executor] Failed to check for deactivated strategies:`, err.message);
141
+ console.warn(`[focus-executor] Failed to check for deactivated focuses:`, err.message);
142
142
  }
143
143
  }
144
144
  /**
145
145
  * Check active teams for newly completed deliveries and merge
146
- * the strategy branch to integration incrementally.
146
+ * the focus branch to integration incrementally.
147
147
  *
148
148
  * Called from the poll loop. For each active team, queries delivery
149
149
  * statuses and triggers a merge when any delivery reaches verify/done
@@ -151,39 +151,39 @@ export async function detectDeactivatedStrategies(config) {
151
151
  *
152
152
  * After processing merges, checks if ALL active deliveries are terminal
153
153
  * and merged. If so, terminates the team proactively since no more work
154
- * remains. The strategy stays active in the DB -- if new deliveries
154
+ * remains. The focus stays active in the DB -- if new deliveries
155
155
  * arrive later, the next poll cycle spawns a fresh team.
156
156
  */
157
157
  export async function checkAndMergeCompletedDeliveries(config) {
158
158
  const activeTeams = getActiveTeams();
159
159
  if (activeTeams.size === 0)
160
160
  return;
161
- for (const [strategyId, team] of activeTeams) {
161
+ for (const [focusId, team] of activeTeams) {
162
162
  // Only check teams that are actively executing
163
163
  if (team.phase !== 'executing')
164
164
  continue;
165
165
  // Skip merge attempts while team lead is resolving a merge conflict
166
166
  if (team.resolvingMergeConflict) {
167
- console.log(`[strategy-executor] Skipping merge check for "${team.strategyName}" -- conflict resolution in progress`);
167
+ console.log(`[focus-executor] Skipping merge check for "${team.focusName}" -- conflict resolution in progress`);
168
168
  continue;
169
169
  }
170
170
  // Use product-scoped config for this team's merge operations
171
171
  const teamProduct = findProduct(config, team.productId);
172
172
  const teamConfig = teamProduct ? configForProduct(config, teamProduct) : config;
173
173
  try {
174
- const deliveries = await getStrategyDeliveries(strategyId);
174
+ const deliveries = await getFocusDeliveries(focusId);
175
175
  // Find deliveries in verify/done that we haven't merged for yet
176
176
  const newlyCompleted = deliveries.filter(d => !isStatusAgentActionable(d.executionStatus ?? '') && !isStatusBlocking(d.executionStatus ?? '')
177
177
  && !team.mergedDeliveryIds.has(d.id));
178
178
  if (newlyCompleted.length > 0) {
179
179
  const completedNames = newlyCompleted.map(d => d.name).join(', ');
180
- console.log(`[strategy-executor] ${newlyCompleted.length} delivery(ies) completed mid-flight for "${team.strategyName}": ${completedNames} -- merging to integration`);
180
+ console.log(`[focus-executor] ${newlyCompleted.length} delivery(ies) completed mid-flight for "${team.focusName}": ${completedNames} -- merging to integration`);
181
181
  // One merge covers all completed deliveries (same branch).
182
182
  // Pass the newly-completed IDs so git state is recorded only for
183
183
  // these — never for queued/planning deliveries on the same branch.
184
- const mergeResult = await mergeStrategyBranch(teamConfig, team, team.leadSessionId ?? '', team.branchName, newlyCompleted.map(d => d.id));
184
+ const mergeResult = await mergeFocusBranch(teamConfig, team, team.leadSessionId ?? '', team.branchName, newlyCompleted.map(d => d.id));
185
185
  if (mergeResult.mergeSucceeded) {
186
- // Track merged deliveries (git state already reported by mergeStrategyBranch)
186
+ // Track merged deliveries (git state already reported by mergeFocusBranch)
187
187
  for (const d of newlyCompleted) {
188
188
  team.mergedDeliveryIds.add(d.id);
189
189
  }
@@ -195,32 +195,32 @@ export async function checkAndMergeCompletedDeliveries(config) {
195
195
  if (allMerged) {
196
196
  const pushToRemote = team.pipelineConfig?.cd?.enabled ?? false;
197
197
  const ciLabel = pushToRemote ? 'CI+CD' : 'CI';
198
- console.log(`[${ciLabel}] All deliveries merged for "${team.strategyName}" -- merging integration to main${pushToRemote ? ' (will push to remote)' : ''}`);
198
+ console.log(`[${ciLabel}] All deliveries merged for "${team.focusName}" -- merging integration to main${pushToRemote ? ' (will push to remote)' : ''}`);
199
199
  try {
200
200
  const ciResult = await mergeIntegrationToMain({
201
201
  config: teamConfig,
202
- strategyName: team.strategyName,
202
+ focusName: team.focusName,
203
203
  pushToRemote,
204
204
  });
205
205
  if (ciResult.success) {
206
- console.log(`[${ciLabel}] Successfully merged integration to main for "${team.strategyName}"`);
206
+ console.log(`[${ciLabel}] Successfully merged integration to main for "${team.focusName}"`);
207
207
  for (const d of activeDeliveries) {
208
208
  const newState = pushToRemote ? 'pushed_to_remote' : 'merged_to_main';
209
209
  reportGitState(d.id, newState).catch(err => console.warn(`[${ciLabel}] reportGitState ${newState} failed for ${d.id}:`, err.message));
210
210
  }
211
211
  }
212
212
  else {
213
- console.error(`[${ciLabel}] Failed to merge integration to main for "${team.strategyName}": ${ciResult.error}`);
213
+ console.error(`[${ciLabel}] Failed to merge integration to main for "${team.focusName}": ${ciResult.error}`);
214
214
  }
215
215
  }
216
216
  catch (err) {
217
- console.error(`[${ciLabel}] Error merging integration to main for "${team.strategyName}":`, err.message);
217
+ console.error(`[${ciLabel}] Error merging integration to main for "${team.focusName}":`, err.message);
218
218
  }
219
219
  }
220
220
  }
221
221
  }
222
222
  else {
223
- console.warn(`[strategy-executor] Mid-flight merge failed for "${team.strategyName}": ${mergeResult.exitReason}`);
223
+ console.warn(`[focus-executor] Mid-flight merge failed for "${team.focusName}": ${mergeResult.exitReason}`);
224
224
  // Escalate merge conflict for each unmerged delivery
225
225
  for (const d of newlyCompleted) {
226
226
  escalateMergeConflict({
@@ -231,7 +231,7 @@ export async function checkAndMergeCompletedDeliveries(config) {
231
231
  branchName: team.branchName,
232
232
  integrationBranch: config.integrationBranch,
233
233
  mergeError: mergeResult.exitReason,
234
- }).catch(err => console.warn(`[strategy-executor] escalateMergeConflict failed for ${d.id}:`, err.message));
234
+ }).catch(err => console.warn(`[focus-executor] escalateMergeConflict failed for ${d.id}:`, err.message));
235
235
  }
236
236
  // Don't mark as merged -- will retry next poll. Team continues working.
237
237
  }
@@ -241,16 +241,16 @@ export async function checkAndMergeCompletedDeliveries(config) {
241
241
  // Otherwise the team is idle, waiting for the daemon to push new work.
242
242
  const teamWork = deliveries.filter(d => isStatusAgentActionable(d.executionStatus ?? ''));
243
243
  if (teamWork.length > 0) {
244
- console.log(`[strategy-executor] ${teamWork.length} delivery(ies) still queued/running for "${team.strategyName}" -- team continues`);
244
+ console.log(`[focus-executor] ${teamWork.length} delivery(ies) still queued/running for "${team.focusName}" -- team continues`);
245
245
  continue;
246
246
  }
247
247
  // No queued/running deliveries -- team is idle, completion detector
248
248
  // handles the actual idle transition. Log for observability.
249
- console.log(`[strategy-executor] All deliveries complete for "${team.strategyName}" -- team is idle`);
249
+ console.log(`[focus-executor] All deliveries complete for "${team.focusName}" -- team is idle`);
250
250
  }
251
251
  catch (err) {
252
- console.warn(`[strategy-executor] Failed to check completed deliveries for "${team.strategyName}":`, err.message);
252
+ console.warn(`[focus-executor] Failed to check completed deliveries for "${team.focusName}":`, err.message);
253
253
  }
254
254
  }
255
255
  }
256
- //# sourceMappingURL=strategy-team-lifecycle.js.map
256
+ //# sourceMappingURL=focus-team-lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"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ks active focus teams in memory and provides
5
+ * query/mutation helpers for the active teams map.
6
+ */
7
+ import type { FocusTeamState, FocusExecutionConfig, PipelineConfig } from './types.js';
8
+ /**
9
+ * Get all active focus teams.
10
+ */
11
+ export declare function getActiveTeams(): Map<string, FocusTeamState>;
12
+ /**
13
+ * Check if a focus already has an active team.
14
+ */
15
+ export declare function hasActiveTeam(focusId: string): boolean;
16
+ /**
17
+ * Get count of active teams.
18
+ */
19
+ export declare function getActiveTeamCount(): number;
20
+ /**
21
+ * Derive execution config from focus pipeline config.
22
+ */
23
+ export declare function deriveExecutionConfig(_pipelineConfig: PipelineConfig | null): FocusExecutionConfig;
24
+ //# sourceMappingURL=focus-team-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-team-state.d.ts","sourceRoot":"","sources":["../src/focus-team-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,cAAc,EACf,MAAM,YAAY,CAAC;AAOpB;;GAEG;AACH,wBAAgB,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAE5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAUD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,cAAc,GAAG,IAAI,GAAG,oBAAoB,CAKlG"}
@@ -1,23 +1,23 @@
1
1
  /**
2
- * Strategy team state management.
2
+ * Focus team state management.
3
3
  *
4
- * Tracks active strategy teams in memory and provides
4
+ * Tracks active focus teams in memory and provides
5
5
  * query/mutation helpers for the active teams map.
6
6
  */
7
7
  // ── Active teams tracking ────────────────────────────────────────────
8
- /** Active strategy teams: strategyId -> StrategyTeamState */
8
+ /** Active focus teams: focusId -> FocusTeamState */
9
9
  const activeTeams = new Map();
10
10
  /**
11
- * Get all active strategy teams.
11
+ * Get all active focus teams.
12
12
  */
13
13
  export function getActiveTeams() {
14
14
  return activeTeams;
15
15
  }
16
16
  /**
17
- * Check if a strategy already has an active team.
17
+ * Check if a focus already has an active team.
18
18
  */
19
- export function hasActiveTeam(strategyId) {
20
- return activeTeams.has(strategyId);
19
+ export function hasActiveTeam(focusId) {
20
+ return activeTeams.has(focusId);
21
21
  }
22
22
  /**
23
23
  * Get count of active teams.
@@ -32,7 +32,7 @@ const DEFAULT_EXECUTION_CONFIG = {
32
32
  activePollIntervalMs: 60000,
33
33
  };
34
34
  /**
35
- * Derive execution config from strategy pipeline config.
35
+ * Derive execution config from focus pipeline config.
36
36
  */
37
37
  export function deriveExecutionConfig(_pipelineConfig) {
38
38
  // For now, use defaults. The teams.enabled flag in pipelineConfig
@@ -40,4 +40,4 @@ export function deriveExecutionConfig(_pipelineConfig) {
40
40
  // Future: pipelineConfig could specify maxWorkers or parallelism level.
41
41
  return { ...DEFAULT_EXECUTION_CONFIG };
42
42
  }
43
- //# sourceMappingURL=strategy-team-state.js.map
43
+ //# sourceMappingURL=focus-team-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-team-state.js","sourceRoot":"","sources":["../src/focus-team-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,wEAAwE;AAExE,oDAAoD;AACpD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEtD;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED,wEAAwE;AAExE,MAAM,wBAAwB,GAAyB;IACrD,UAAU,EAAE,CAAC;IACb,kBAAkB,EAAE,KAAK;IACzB,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,eAAsC;IAC1E,kEAAkE;IAClE,wDAAwD;IACxD,wEAAwE;IACxE,OAAO,EAAE,GAAG,wBAAwB,EAAE,CAAC;AACzC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Focus worktree state management — write-through cache.
3
+ *
4
+ * Tracks persistent focus worktrees using a local Map as the
5
+ * synchronous read cache, backed by the focus_worktrees DB table.
6
+ *
7
+ * Read path: all get/has/getAll calls are synchronous (Map lookup).
8
+ * Write path: update Map immediately, then fire async DB write.
9
+ * Startup: hydrateFromDb() loads all records from DB into the Map.
10
+ *
11
+ * The Map is authoritative during runtime. The DB is authoritative
12
+ * across restarts. Async DB writes are fire-and-forget with logging.
13
+ */
14
+ import type { FocusWorktreeInfo } from './types.js';
15
+ /**
16
+ * Hydrate the in-memory cache from the database.
17
+ *
18
+ * Call once during daemon startup, BEFORE rebuildFocusWorktreeState.
19
+ * Stores the productId for subsequent write-through operations.
20
+ */
21
+ export declare function hydrateFromDb(productId: string): Promise<void>;
22
+ /**
23
+ * Get a single focus worktree by focus ID.
24
+ */
25
+ export declare function getFocusWorktree(focusId: string): FocusWorktreeInfo | undefined;
26
+ /**
27
+ * Add or update a focus worktree entry.
28
+ *
29
+ * Updates the Map synchronously, then fires an async DB upsert.
30
+ */
31
+ export declare function setFocusWorktree(focusId: string, info: FocusWorktreeInfo): void;
32
+ /**
33
+ * Remove a focus worktree entry.
34
+ * Returns whether the entry existed.
35
+ *
36
+ * Deletes from Map synchronously, then fires an async DB remove.
37
+ */
38
+ export declare function removeFocusWorktree(focusId: string): boolean;
39
+ /**
40
+ * Get all focus worktrees.
41
+ */
42
+ export declare function getAllFocusWorktrees(): Map<string, FocusWorktreeInfo>;
43
+ /**
44
+ * Check if a focus has a persistent worktree.
45
+ */
46
+ export declare function hasFocusWorktree(focusId: string): boolean;
47
+ //# sourceMappingURL=focus-worktree-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-worktree-state.d.ts","sourceRoot":"","sources":["../src/focus-worktree-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAgBpD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BpE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAE/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAgB/E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAc5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAErE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Strategy worktree state management — write-through cache.
2
+ * Focus worktree state management — write-through cache.
3
3
  *
4
- * Tracks persistent strategy worktrees using a local Map as the
5
- * synchronous read cache, backed by the strategy_worktrees DB table.
4
+ * Tracks persistent focus worktrees using a local Map as the
5
+ * synchronous read cache, backed by the focus_worktrees DB table.
6
6
  *
7
7
  * Read path: all get/has/getAll calls are synchronous (Map lookup).
8
8
  * Write path: update Map immediately, then fire async DB write.
@@ -15,12 +15,12 @@ import { upsertWorktreeRecord, removeWorktreeRecord, listWorktreeRecords, } from
15
15
  // ── Module-level config ──────────────────────────────────────────────
16
16
  let configuredProductId = null;
17
17
  // ── Persistent worktree tracking ─────────────────────────────────────
18
- /** Persistent strategy worktrees: strategyId -> StrategyWorktreeInfo */
19
- const strategyWorktrees = new Map();
18
+ /** Persistent focus worktrees: focusId -> FocusWorktreeInfo */
19
+ const focusWorktrees = new Map();
20
20
  /**
21
21
  * Hydrate the in-memory cache from the database.
22
22
  *
23
- * Call once during daemon startup, BEFORE rebuildStrategyWorktreeState.
23
+ * Call once during daemon startup, BEFORE rebuildFocusWorktreeState.
24
24
  * Stores the productId for subsequent write-through operations.
25
25
  */
26
26
  export async function hydrateFromDb(productId) {
@@ -35,9 +35,9 @@ export async function hydrateFromDb(productId) {
35
35
  }
36
36
  let hydrated = 0;
37
37
  for (const record of records) {
38
- strategyWorktrees.set(record.strategyId, {
39
- strategyId: record.strategyId,
40
- strategyName: '', // Not stored in DB — rebuilt by callers
38
+ focusWorktrees.set(record.focusId, {
39
+ focusId: record.focusId,
40
+ focusName: '', // Not stored in DB — rebuilt by callers
41
41
  worktreePath: record.worktreePath,
42
42
  branchName: record.branchName,
43
43
  createdAt: new Date(record.createdAt),
@@ -50,55 +50,55 @@ export async function hydrateFromDb(productId) {
50
50
  }
51
51
  }
52
52
  /**
53
- * Get a single strategy worktree by strategy ID.
53
+ * Get a single focus worktree by focus ID.
54
54
  */
55
- export function getStrategyWorktree(strategyId) {
56
- return strategyWorktrees.get(strategyId);
55
+ export function getFocusWorktree(focusId) {
56
+ return focusWorktrees.get(focusId);
57
57
  }
58
58
  /**
59
- * Add or update a strategy worktree entry.
59
+ * Add or update a focus worktree entry.
60
60
  *
61
61
  * Updates the Map synchronously, then fires an async DB upsert.
62
62
  */
63
- export function setStrategyWorktree(strategyId, info) {
64
- strategyWorktrees.set(strategyId, info);
63
+ export function setFocusWorktree(focusId, info) {
64
+ focusWorktrees.set(focusId, info);
65
65
  // Write-through: async DB upsert (fire-and-forget)
66
66
  upsertWorktreeRecord({
67
- strategyId,
67
+ focusId,
68
68
  productId: configuredProductId,
69
69
  worktreePath: info.worktreePath,
70
70
  branchName: info.branchName,
71
71
  status: 'active',
72
72
  }).catch((err) => {
73
- console.warn(`[worktree-state] DB upsert failed for strategy ${strategyId}:`, err.message);
73
+ console.warn(`[worktree-state] DB upsert failed for focus ${focusId}:`, err.message);
74
74
  });
75
75
  }
76
76
  /**
77
- * Remove a strategy worktree entry.
77
+ * Remove a focus worktree entry.
78
78
  * Returns whether the entry existed.
79
79
  *
80
80
  * Deletes from Map synchronously, then fires an async DB remove.
81
81
  */
82
- export function removeStrategyWorktree(strategyId) {
83
- const existed = strategyWorktrees.delete(strategyId);
82
+ export function removeFocusWorktree(focusId) {
83
+ const existed = focusWorktrees.delete(focusId);
84
84
  if (existed) {
85
85
  // Write-through: async DB remove (fire-and-forget)
86
- removeWorktreeRecord(strategyId).catch((err) => {
87
- console.warn(`[worktree-state] DB remove failed for strategy ${strategyId}:`, err.message);
86
+ removeWorktreeRecord(focusId).catch((err) => {
87
+ console.warn(`[worktree-state] DB remove failed for focus ${focusId}:`, err.message);
88
88
  });
89
89
  }
90
90
  return existed;
91
91
  }
92
92
  /**
93
- * Get all strategy worktrees.
93
+ * Get all focus worktrees.
94
94
  */
95
- export function getAllStrategyWorktrees() {
96
- return strategyWorktrees;
95
+ export function getAllFocusWorktrees() {
96
+ return focusWorktrees;
97
97
  }
98
98
  /**
99
- * Check if a strategy has a persistent worktree.
99
+ * Check if a focus has a persistent worktree.
100
100
  */
101
- export function hasStrategyWorktree(strategyId) {
102
- return strategyWorktrees.has(strategyId);
101
+ export function hasFocusWorktree(focusId) {
102
+ return focusWorktrees.has(focusId);
103
103
  }
104
- //# sourceMappingURL=strategy-worktree-state.js.map
104
+ //# sourceMappingURL=focus-worktree-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-worktree-state.js","sourceRoot":"","sources":["../src/focus-worktree-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,wEAAwE;AAExE,IAAI,mBAAmB,GAAkB,IAAI,C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;IAElC,mDAAmD;IACnD,oBAAoB,CAAC;QACnB,OAAO;QACP,SAAS,EAAE,mBAAmB;QAC9B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACf,OAAO,CAAC,IAAI,CACV,+CAA+C,OAAO,GAAG,EACxD,GAAa,CAAC,OAAO,CACvB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,OAAO,EAAE,CAAC;QACZ,mDAAmD;QACnD,oBAAoB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,CACV,+CAA+C,OAAO,GAAG,EACxD,GAAa,CAAC,OAAO,CACvB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
@@ -60,15 +60,15 @@ export interface MergeToIntegrationParams {
60
60
  export declare function mergeToIntegration(params: MergeToIntegrationParams): Promise<MergeResult>;
61
61
  export interface MergeIntegrationToMainParams {
62
62
  config: DaemonConfig;
63
- /** Strategy name for logging/commit messages. */
64
- strategyName: string;
63
+ /** Focus name for logging/commit messages. */
64
+ focusName: string;
65
65
  /** Whether to also push main to remote (CD). */
66
66
  pushToRemote: boolean;
67
67
  }
68
68
  /**
69
69
  * Merge the integration branch into the default (main) branch.
70
70
  *
71
- * Called when a strategy completes with CI enabled. Optionally pushes
71
+ * Called when a focus completes with CI enabled. Optionally pushes
72
72
  * to remote when CD is also enabled.
73
73
  *
74
74
  * Uses the merge worktree and merge lock (same as mergeToIntegration)
@@ -76,7 +76,7 @@ export interface MergeIntegrationToMainParams {
76
76
  */
77
77
  export declare function mergeIntegrationToMain(params: MergeIntegrationToMainParams): Promise<MergeResult>;
78
78
  export interface MergeBackFromIntegrationParams {
79
- /** Path to the strategy/delivery worktree. */
79
+ /** Path to the focus/delivery worktree. */
80
80
  worktreePath: string;
81
81
  /** Name of the integration branch (e.g., 'integration'). */
82
82
  integrationBranch: string;
@@ -85,7 +85,7 @@ export interface MergeBackFromIntegrationParams {
85
85
  * Merge the latest integration HEAD into the current branch of a worktree.
86
86
  *
87
87
  * This is the "prevent conflicts" layer: by syncing integration changes into
88
- * the strategy branch before merging to integration, we guarantee the final
88
+ * the focus branch before merging to integration, we guarantee the final
89
89
  * merge will be conflict-free (or surface conflicts early for agent resolution).
90
90
  *
91
91
  * On conflict: does NOT abort -- leaves conflict markers in the worktree
@@ -1 +1 @@
1
- {"version":3,"file":"git-merge.d.ts","sourceRoot":"","sources":["../src/git-merge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAmCpG,UAAU,yBAAyB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,O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