@opencorelabs/lucidity 0.7.0 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/README.md +9 -2
  2. package/dist/assets/speech/lucidity-speech +0 -0
  3. package/dist/automations/agent.d.ts.map +1 -1
  4. package/dist/automations/agent.js +2 -0
  5. package/dist/automations/designer.d.ts +1 -1
  6. package/dist/automations/service.d.ts +4 -0
  7. package/dist/automations/service.d.ts.map +1 -1
  8. package/dist/automations/service.js +60 -22
  9. package/dist/automations/store.d.ts +9 -3
  10. package/dist/automations/store.d.ts.map +1 -1
  11. package/dist/automations/store.js +45 -32
  12. package/dist/automations/workflow.d.ts +14 -0
  13. package/dist/automations/workflow.d.ts.map +1 -0
  14. package/dist/automations/workflow.js +57 -0
  15. package/dist/chat/server.d.ts +1 -0
  16. package/dist/chat/server.d.ts.map +1 -1
  17. package/dist/chat/server.js +6 -1
  18. package/dist/coding/listPrs.d.ts +2 -0
  19. package/dist/coding/listPrs.d.ts.map +1 -1
  20. package/dist/coding/listPrs.js +10 -0
  21. package/dist/coding/runCodeTurn.d.ts +6 -30
  22. package/dist/coding/runCodeTurn.d.ts.map +1 -1
  23. package/dist/coding/runCodeTurn.js +145 -218
  24. package/dist/coding/runReview.d.ts +10 -0
  25. package/dist/coding/runReview.d.ts.map +1 -0
  26. package/dist/coding/runReview.js +87 -0
  27. package/dist/coding/workspaceRegistry.d.ts +72 -0
  28. package/dist/coding/workspaceRegistry.d.ts.map +1 -0
  29. package/dist/coding/workspaceRegistry.js +421 -0
  30. package/dist/coding/worktree.d.ts +72 -32
  31. package/dist/coding/worktree.d.ts.map +1 -1
  32. package/dist/coding/worktree.js +190 -38
  33. package/dist/coding/worktreeSetup.d.ts +7 -0
  34. package/dist/coding/worktreeSetup.d.ts.map +1 -0
  35. package/dist/coding/worktreeSetup.js +49 -0
  36. package/dist/config.d.ts +2 -0
  37. package/dist/config.d.ts.map +1 -1
  38. package/dist/daemonLease.d.ts +12 -0
  39. package/dist/daemonLease.d.ts.map +1 -0
  40. package/dist/daemonLease.js +32 -0
  41. package/dist/goals/assessment.d.ts +115 -0
  42. package/dist/goals/assessment.d.ts.map +1 -0
  43. package/dist/goals/assessment.js +67 -0
  44. package/dist/goals/notes.d.ts +18 -0
  45. package/dist/goals/notes.d.ts.map +1 -0
  46. package/dist/goals/notes.js +72 -0
  47. package/dist/index.js +75 -40
  48. package/dist/jobs/briefing.d.ts +2 -16
  49. package/dist/jobs/briefing.d.ts.map +1 -1
  50. package/dist/jobs/briefing.js +65 -93
  51. package/dist/jobs/goals.d.ts +15 -0
  52. package/dist/jobs/goals.d.ts.map +1 -0
  53. package/dist/jobs/goals.js +286 -0
  54. package/dist/jobs/weeklyReview.d.ts.map +1 -1
  55. package/dist/jobs/weeklyReview.js +3 -2
  56. package/dist/logTimestamps.d.ts +10 -0
  57. package/dist/logTimestamps.d.ts.map +1 -0
  58. package/dist/logTimestamps.js +12 -0
  59. package/dist/providerRecovery.d.ts +48 -0
  60. package/dist/providerRecovery.d.ts.map +1 -0
  61. package/dist/providerRecovery.js +100 -0
  62. package/dist/queue.d.ts +1 -0
  63. package/dist/queue.d.ts.map +1 -1
  64. package/dist/queue.js +4 -0
  65. package/dist/room/client.d.ts +6 -19
  66. package/dist/room/client.d.ts.map +1 -1
  67. package/dist/room/client.js +127 -123
  68. package/dist/room/computer.js +1 -1
  69. package/dist/room/durablePublish.d.ts +6 -0
  70. package/dist/room/durablePublish.d.ts.map +1 -0
  71. package/dist/room/durablePublish.js +19 -0
  72. package/dist/room/incidents.d.ts +4 -1
  73. package/dist/room/incidents.d.ts.map +1 -1
  74. package/dist/room/incidents.js +15 -7
  75. package/dist/room/turnQueue.d.ts.map +1 -1
  76. package/dist/room/turnQueue.js +55 -46
  77. package/dist/runtimeStore.d.ts +46 -0
  78. package/dist/runtimeStore.d.ts.map +1 -0
  79. package/dist/runtimeStore.js +205 -0
  80. package/dist/setup/server.js +1 -1
  81. package/dist/turnLog.d.ts +10 -40
  82. package/dist/turnLog.d.ts.map +1 -1
  83. package/dist/turnLog.js +33 -56
  84. package/dist/vault.d.ts +6 -3
  85. package/dist/vault.d.ts.map +1 -1
  86. package/dist/vault.js +18 -4
  87. package/package.json +4 -4
  88. package/src/automations/agent.ts +2 -0
  89. package/src/automations/service.ts +47 -21
  90. package/src/automations/store.ts +41 -50
  91. package/src/automations/workflow.ts +49 -0
  92. package/src/chat/server.ts +7 -1
  93. package/src/coding/listPrs.ts +14 -0
  94. package/src/coding/runCodeTurn.ts +51 -139
  95. package/src/coding/runReview.ts +83 -0
  96. package/src/coding/workspaceRegistry.ts +380 -0
  97. package/src/coding/worktree.ts +205 -40
  98. package/src/coding/worktreeSetup.ts +50 -0
  99. package/src/config.ts +2 -0
  100. package/src/daemonLease.ts +33 -0
  101. package/src/goals/assessment.ts +106 -0
  102. package/src/goals/notes.ts +88 -0
  103. package/src/index.ts +76 -46
  104. package/src/jobs/briefing.ts +62 -109
  105. package/src/jobs/goals.ts +384 -0
  106. package/src/jobs/weeklyReview.ts +4 -3
  107. package/src/logTimestamps.ts +14 -0
  108. package/src/providerRecovery.ts +99 -0
  109. package/src/queue.ts +4 -0
  110. package/src/room/client.ts +84 -116
  111. package/src/room/computer.ts +1 -1
  112. package/src/room/durablePublish.ts +25 -0
  113. package/src/room/incidents.ts +20 -8
  114. package/src/room/turnQueue.ts +53 -56
  115. package/src/runtimeStore.ts +207 -0
  116. package/src/setup/server.ts +1 -1
  117. package/src/turnLog.ts +32 -75
  118. package/src/vault.ts +16 -7
  119. package/vendor/mcp-server/dist/index.js +2 -0
  120. package/vendor/mcp-server/dist/tools/goals.d.ts +4 -0
  121. package/vendor/mcp-server/dist/tools/goals.d.ts.map +1 -0
  122. package/vendor/mcp-server/dist/tools/goals.js +38 -0
  123. package/vendor/mcp-server/package.json +1 -1
  124. package/vendor/mcp-server/src/index.ts +2 -0
  125. package/vendor/mcp-server/src/tools/goals.ts +62 -0
  126. package/vendor/runtime/README.md +36 -2
  127. package/vendor/runtime/dist/executor/asyncQueue.d.ts +1 -0
  128. package/vendor/runtime/dist/executor/asyncQueue.d.ts.map +1 -1
  129. package/vendor/runtime/dist/executor/asyncQueue.js +3 -0
  130. package/vendor/runtime/dist/executor/claudeAgent.d.ts +5 -1
  131. package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
  132. package/vendor/runtime/dist/executor/claudeAgent.js +77 -13
  133. package/vendor/runtime/dist/executor/codex.d.ts +8 -2
  134. package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
  135. package/vendor/runtime/dist/executor/codex.js +113 -38
  136. package/vendor/runtime/dist/executor/codexProtocol/AgentPath.d.ts +2 -0
  137. package/vendor/runtime/dist/executor/codexProtocol/AgentPath.d.ts.map +1 -0
  138. package/vendor/runtime/dist/executor/codexProtocol/AgentPath.js +2 -0
  139. package/vendor/runtime/dist/executor/codexProtocol/FunctionCallOutputContentItem.d.ts +4 -1
  140. package/vendor/runtime/dist/executor/codexProtocol/FunctionCallOutputContentItem.d.ts.map +1 -1
  141. package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationFailure.d.ts +6 -0
  142. package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationFailure.d.ts.map +1 -0
  143. package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationFailure.js +2 -0
  144. package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationItem.d.ts +12 -0
  145. package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationItem.d.ts.map +1 -0
  146. package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationItem.js +2 -0
  147. package/vendor/runtime/dist/executor/codexProtocol/LegacyAppPathString.d.ts +24 -0
  148. package/vendor/runtime/dist/executor/codexProtocol/LegacyAppPathString.d.ts.map +1 -0
  149. package/vendor/runtime/dist/executor/codexProtocol/LegacyAppPathString.js +2 -0
  150. package/vendor/runtime/dist/executor/codexProtocol/MessagePhase.d.ts +8 -0
  151. package/vendor/runtime/dist/executor/codexProtocol/MessagePhase.d.ts.map +1 -0
  152. package/vendor/runtime/dist/executor/codexProtocol/MessagePhase.js +2 -0
  153. package/vendor/runtime/dist/executor/codexProtocol/Personality.d.ts +3 -0
  154. package/vendor/runtime/dist/executor/codexProtocol/Personality.d.ts.map +1 -1
  155. package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts +1 -1
  156. package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts.map +1 -1
  157. package/vendor/runtime/dist/executor/codexProtocol/SleepItem.d.ts +8 -0
  158. package/vendor/runtime/dist/executor/codexProtocol/SleepItem.d.ts.map +1 -0
  159. package/vendor/runtime/dist/executor/codexProtocol/SleepItem.js +2 -0
  160. package/vendor/runtime/dist/executor/codexProtocol/SubAgentSource.d.ts +14 -0
  161. package/vendor/runtime/dist/executor/codexProtocol/SubAgentSource.d.ts.map +1 -0
  162. package/vendor/runtime/dist/executor/codexProtocol/SubAgentSource.js +2 -0
  163. package/vendor/runtime/dist/executor/codexProtocol/ThreadId.d.ts +7 -0
  164. package/vendor/runtime/dist/executor/codexProtocol/ThreadId.d.ts.map +1 -0
  165. package/vendor/runtime/dist/executor/codexProtocol/ThreadId.js +2 -0
  166. package/vendor/runtime/dist/executor/codexProtocol/WebSearchItem.d.ts +15 -0
  167. package/vendor/runtime/dist/executor/codexProtocol/WebSearchItem.d.ts.map +1 -0
  168. package/vendor/runtime/dist/executor/codexProtocol/WebSearchItem.js +2 -0
  169. package/vendor/runtime/dist/executor/codexProtocol/v2/AgentMessageDelivery.d.ts +2 -0
  170. package/vendor/runtime/dist/executor/codexProtocol/v2/AgentMessageDelivery.d.ts.map +1 -0
  171. package/vendor/runtime/dist/executor/codexProtocol/v2/AgentMessageDelivery.js +2 -0
  172. package/vendor/runtime/dist/executor/codexProtocol/v2/AsyncUserInputQuestion.d.ts +5 -0
  173. package/vendor/runtime/dist/executor/codexProtocol/v2/AsyncUserInputQuestion.d.ts.map +1 -0
  174. package/vendor/runtime/dist/executor/codexProtocol/v2/AsyncUserInputQuestion.js +2 -0
  175. package/vendor/runtime/dist/executor/codexProtocol/v2/CodexErrorInfo.d.ts +29 -0
  176. package/vendor/runtime/dist/executor/codexProtocol/v2/CodexErrorInfo.d.ts.map +1 -0
  177. package/vendor/runtime/dist/executor/codexProtocol/v2/CodexErrorInfo.js +2 -0
  178. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentState.d.ts +6 -0
  179. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentState.d.ts.map +1 -0
  180. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentState.js +2 -0
  181. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentStatus.d.ts +2 -0
  182. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentStatus.d.ts.map +1 -0
  183. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentStatus.js +2 -0
  184. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentTool.d.ts +2 -0
  185. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentTool.d.ts.map +1 -0
  186. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentTool.js +2 -0
  187. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentToolCallStatus.d.ts +2 -0
  188. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentToolCallStatus.d.ts.map +1 -0
  189. package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentToolCallStatus.js +2 -0
  190. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandAction.d.ts +20 -0
  191. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandAction.d.ts.map +1 -0
  192. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandAction.js +2 -0
  193. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionSource.d.ts +2 -0
  194. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionSource.d.ts.map +1 -0
  195. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionSource.js +2 -0
  196. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionStatus.d.ts +2 -0
  197. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionStatus.d.ts.map +1 -0
  198. package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionStatus.js +2 -0
  199. package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.d.ts +6 -0
  200. package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.d.ts.map +1 -0
  201. package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.js +2 -0
  202. package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.d.ts +11 -0
  203. package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.d.ts.map +1 -0
  204. package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.js +2 -0
  205. package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallStatus.d.ts +2 -0
  206. package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallStatus.d.ts.map +1 -0
  207. package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallStatus.js +2 -0
  208. package/vendor/runtime/dist/executor/codexProtocol/v2/FileUpdateChange.d.ts +7 -0
  209. package/vendor/runtime/dist/executor/codexProtocol/v2/FileUpdateChange.d.ts.map +1 -0
  210. package/vendor/runtime/dist/executor/codexProtocol/v2/FileUpdateChange.js +2 -0
  211. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts +5 -0
  212. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts.map +1 -1
  213. package/vendor/runtime/dist/executor/codexProtocol/v2/GitInfo.d.ts +6 -0
  214. package/vendor/runtime/dist/executor/codexProtocol/v2/GitInfo.d.ts.map +1 -0
  215. package/vendor/runtime/dist/executor/codexProtocol/v2/GitInfo.js +2 -0
  216. package/vendor/runtime/dist/executor/codexProtocol/v2/HookPromptFragment.d.ts +5 -0
  217. package/vendor/runtime/dist/executor/codexProtocol/v2/HookPromptFragment.d.ts.map +1 -0
  218. package/vendor/runtime/dist/executor/codexProtocol/v2/HookPromptFragment.js +2 -0
  219. package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppDisplayMode.d.ts +2 -0
  220. package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppDisplayMode.d.ts.map +1 -0
  221. package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppDisplayMode.js +2 -0
  222. package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppUi.d.ts +9 -0
  223. package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppUi.d.ts.map +1 -0
  224. package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppUi.js +2 -0
  225. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallAppContext.d.ts +8 -0
  226. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallAppContext.d.ts.map +1 -0
  227. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallAppContext.js +2 -0
  228. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallError.d.ts +4 -0
  229. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallError.d.ts.map +1 -0
  230. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallError.js +2 -0
  231. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallResult.d.ts +7 -0
  232. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallResult.d.ts.map +1 -0
  233. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallResult.js +2 -0
  234. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallStatus.d.ts +2 -0
  235. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallStatus.d.ts.map +1 -0
  236. package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallStatus.js +2 -0
  237. package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitation.d.ts +6 -0
  238. package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitation.d.ts.map +1 -0
  239. package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitation.js +2 -0
  240. package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitationEntry.d.ts +7 -0
  241. package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitationEntry.d.ts.map +1 -0
  242. package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitationEntry.js +2 -0
  243. package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentErrorDetails.d.ts +16 -0
  244. package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentErrorDetails.d.ts.map +1 -0
  245. package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentErrorDetails.js +2 -0
  246. package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentSteer.d.ts +4 -0
  247. package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentSteer.d.ts.map +1 -0
  248. package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentSteer.js +2 -0
  249. package/vendor/runtime/dist/executor/codexProtocol/v2/Model.d.ts +8 -0
  250. package/vendor/runtime/dist/executor/codexProtocol/v2/Model.d.ts.map +1 -1
  251. package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.d.ts +11 -0
  252. package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.d.ts.map +1 -0
  253. package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.js +2 -0
  254. package/vendor/runtime/dist/executor/codexProtocol/v2/NonSteerableTurnKind.d.ts +2 -0
  255. package/vendor/runtime/dist/executor/codexProtocol/v2/NonSteerableTurnKind.d.ts.map +1 -0
  256. package/vendor/runtime/dist/executor/codexProtocol/v2/NonSteerableTurnKind.js +2 -0
  257. package/vendor/runtime/dist/executor/codexProtocol/v2/PatchApplyStatus.d.ts +2 -0
  258. package/vendor/runtime/dist/executor/codexProtocol/v2/PatchApplyStatus.d.ts.map +1 -0
  259. package/vendor/runtime/dist/executor/codexProtocol/v2/PatchApplyStatus.js +2 -0
  260. package/vendor/runtime/dist/executor/codexProtocol/v2/PatchChangeKind.d.ts +9 -0
  261. package/vendor/runtime/dist/executor/codexProtocol/v2/PatchChangeKind.d.ts.map +1 -0
  262. package/vendor/runtime/dist/executor/codexProtocol/v2/PatchChangeKind.js +2 -0
  263. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts +4 -0
  264. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts.map +1 -1
  265. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts +2 -0
  266. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts.map +1 -1
  267. package/vendor/runtime/dist/executor/codexProtocol/v2/SessionSource.d.ts +7 -0
  268. package/vendor/runtime/dist/executor/codexProtocol/v2/SessionSource.d.ts.map +1 -0
  269. package/vendor/runtime/dist/executor/codexProtocol/v2/SessionSource.js +2 -0
  270. package/vendor/runtime/dist/executor/codexProtocol/v2/SubAgentActivityKind.d.ts +2 -0
  271. package/vendor/runtime/dist/executor/codexProtocol/v2/SubAgentActivityKind.d.ts.map +1 -0
  272. package/vendor/runtime/dist/executor/codexProtocol/v2/SubAgentActivityKind.js +2 -0
  273. package/vendor/runtime/dist/executor/codexProtocol/v2/Thread.d.ts +100 -0
  274. package/vendor/runtime/dist/executor/codexProtocol/v2/Thread.d.ts.map +1 -0
  275. package/vendor/runtime/dist/executor/codexProtocol/v2/Thread.js +2 -0
  276. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadActiveFlag.d.ts +2 -0
  277. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadActiveFlag.d.ts.map +1 -0
  278. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadActiveFlag.js +2 -0
  279. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadHistoryMode.d.ts +2 -0
  280. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadHistoryMode.d.ts.map +1 -0
  281. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadHistoryMode.js +2 -0
  282. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadItem.d.ts +216 -0
  283. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadItem.d.ts.map +1 -0
  284. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadItem.js +2 -0
  285. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadParams.d.ts +11 -0
  286. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadParams.d.ts.map +1 -0
  287. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadParams.js +2 -0
  288. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadResponse.d.ts +5 -0
  289. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadResponse.d.ts.map +1 -0
  290. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadResponse.js +2 -0
  291. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadResumeParams.d.ts +4 -1
  292. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadResumeParams.d.ts.map +1 -1
  293. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSection.d.ts +19 -0
  294. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSection.d.ts.map +1 -0
  295. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSection.js +2 -0
  296. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSectionAppearance.d.ts +8 -0
  297. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSectionAppearance.d.ts.map +1 -0
  298. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSectionAppearance.js +2 -0
  299. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStartParams.d.ts +3 -1
  300. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStartParams.d.ts.map +1 -1
  301. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStatus.d.ts +12 -0
  302. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStatus.d.ts.map +1 -0
  303. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStatus.js +2 -0
  304. package/vendor/runtime/dist/executor/codexProtocol/v2/Turn.d.ts +36 -0
  305. package/vendor/runtime/dist/executor/codexProtocol/v2/Turn.d.ts.map +1 -0
  306. package/vendor/runtime/dist/executor/codexProtocol/v2/Turn.js +2 -0
  307. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnError.d.ts +12 -0
  308. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnError.d.ts.map +1 -0
  309. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnError.js +2 -0
  310. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnItemsView.d.ts +2 -0
  311. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnItemsView.d.ts.map +1 -0
  312. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnItemsView.js +2 -0
  313. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStartParams.d.ts +7 -2
  314. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStartParams.d.ts.map +1 -1
  315. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStatus.d.ts +2 -0
  316. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStatus.d.ts.map +1 -0
  317. package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStatus.js +2 -0
  318. package/vendor/runtime/dist/executor/codexProtocol/v2/UserInput.d.ts +3 -0
  319. package/vendor/runtime/dist/executor/codexProtocol/v2/UserInput.d.ts.map +1 -1
  320. package/vendor/runtime/dist/executor/codexProtocol/v2/WebSearchAction.d.ts +15 -0
  321. package/vendor/runtime/dist/executor/codexProtocol/v2/WebSearchAction.d.ts.map +1 -0
  322. package/vendor/runtime/dist/executor/codexProtocol/v2/WebSearchAction.js +2 -0
  323. package/vendor/runtime/dist/executor/codexRpc.d.ts +13 -4
  324. package/vendor/runtime/dist/executor/codexRpc.d.ts.map +1 -1
  325. package/vendor/runtime/dist/executor/codexRpc.js +21 -5
  326. package/vendor/runtime/dist/executor/codexSessions.d.ts +30 -0
  327. package/vendor/runtime/dist/executor/codexSessions.d.ts.map +1 -0
  328. package/vendor/runtime/dist/executor/codexSessions.js +88 -0
  329. package/vendor/runtime/dist/executor/health.d.ts +8 -2
  330. package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
  331. package/vendor/runtime/dist/executor/health.js +21 -5
  332. package/vendor/runtime/dist/executor/liveTurns.d.ts +2 -1
  333. package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
  334. package/vendor/runtime/dist/executor/liveTurns.js +12 -5
  335. package/vendor/runtime/dist/executor/ownership.d.ts +40 -0
  336. package/vendor/runtime/dist/executor/ownership.d.ts.map +1 -0
  337. package/vendor/runtime/dist/executor/ownership.js +106 -0
  338. package/vendor/runtime/dist/executor/providerRouter.d.ts +1 -0
  339. package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
  340. package/vendor/runtime/dist/executor/providerRouter.js +5 -0
  341. package/vendor/runtime/dist/executor/types.d.ts +27 -0
  342. package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
  343. package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
  344. package/vendor/runtime/dist/harness/index.js +1 -0
  345. package/vendor/runtime/dist/index.d.ts +2 -1
  346. package/vendor/runtime/dist/index.d.ts.map +1 -1
  347. package/vendor/runtime/dist/index.js +1 -0
  348. package/vendor/runtime/src/executor/asyncQueue.ts +3 -0
  349. package/vendor/runtime/src/executor/claudeAgent.ts +66 -13
  350. package/vendor/runtime/src/executor/codex.ts +124 -47
  351. package/vendor/runtime/src/executor/codexProtocol/AgentPath.ts +5 -0
  352. package/vendor/runtime/src/executor/codexProtocol/FunctionCallOutputContentItem.ts +1 -1
  353. package/vendor/runtime/src/executor/codexProtocol/ImageGenerationFailure.ts +5 -0
  354. package/vendor/runtime/src/executor/codexProtocol/ImageGenerationItem.ts +7 -0
  355. package/vendor/runtime/src/executor/codexProtocol/LegacyAppPathString.ts +27 -0
  356. package/vendor/runtime/src/executor/codexProtocol/MessagePhase.ts +11 -0
  357. package/vendor/runtime/src/executor/codexProtocol/Personality.ts +3 -0
  358. package/vendor/runtime/src/executor/codexProtocol/PlanType.ts +1 -1
  359. package/vendor/runtime/src/executor/codexProtocol/README.md +2 -2
  360. package/vendor/runtime/src/executor/codexProtocol/SleepItem.ts +8 -0
  361. package/vendor/runtime/src/executor/codexProtocol/SubAgentSource.ts +7 -0
  362. package/vendor/runtime/src/executor/codexProtocol/ThreadId.ts +10 -0
  363. package/vendor/runtime/src/executor/codexProtocol/WebSearchItem.ts +14 -0
  364. package/vendor/runtime/src/executor/codexProtocol/v2/AgentMessageDelivery.ts +5 -0
  365. package/vendor/runtime/src/executor/codexProtocol/v2/AsyncUserInputQuestion.ts +5 -0
  366. package/vendor/runtime/src/executor/codexProtocol/v2/CodexErrorInfo.ts +12 -0
  367. package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentState.ts +6 -0
  368. package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentStatus.ts +5 -0
  369. package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentTool.ts +5 -0
  370. package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentToolCallStatus.ts +5 -0
  371. package/vendor/runtime/src/executor/codexProtocol/v2/CommandAction.ts +6 -0
  372. package/vendor/runtime/src/executor/codexProtocol/v2/CommandExecutionSource.ts +5 -0
  373. package/vendor/runtime/src/executor/codexProtocol/v2/CommandExecutionStatus.ts +5 -0
  374. package/vendor/runtime/src/executor/codexProtocol/v2/CyberAccessProgram.ts +9 -0
  375. package/vendor/runtime/src/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.ts +5 -0
  376. package/vendor/runtime/src/executor/codexProtocol/v2/DynamicToolCallStatus.ts +5 -0
  377. package/vendor/runtime/src/executor/codexProtocol/v2/FileUpdateChange.ts +6 -0
  378. package/vendor/runtime/src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts +5 -0
  379. package/vendor/runtime/src/executor/codexProtocol/v2/GitInfo.ts +5 -0
  380. package/vendor/runtime/src/executor/codexProtocol/v2/HookPromptFragment.ts +5 -0
  381. package/vendor/runtime/src/executor/codexProtocol/v2/McpAppDisplayMode.ts +5 -0
  382. package/vendor/runtime/src/executor/codexProtocol/v2/McpAppUi.ts +9 -0
  383. package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallAppContext.ts +5 -0
  384. package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallError.ts +5 -0
  385. package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallResult.ts +6 -0
  386. package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallStatus.ts +5 -0
  387. package/vendor/runtime/src/executor/codexProtocol/v2/MemoryCitation.ts +6 -0
  388. package/vendor/runtime/src/executor/codexProtocol/v2/MemoryCitationEntry.ts +5 -0
  389. package/vendor/runtime/src/executor/codexProtocol/v2/MisalignmentErrorDetails.ts +18 -0
  390. package/vendor/runtime/src/executor/codexProtocol/v2/MisalignmentSteer.ts +5 -0
  391. package/vendor/runtime/src/executor/codexProtocol/v2/Model.ts +11 -2
  392. package/vendor/runtime/src/executor/codexProtocol/v2/ModelAccessPrograms.ts +13 -0
  393. package/vendor/runtime/src/executor/codexProtocol/v2/NonSteerableTurnKind.ts +5 -0
  394. package/vendor/runtime/src/executor/codexProtocol/v2/PatchApplyStatus.ts +5 -0
  395. package/vendor/runtime/src/executor/codexProtocol/v2/PatchChangeKind.ts +5 -0
  396. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitSnapshot.ts +5 -1
  397. package/vendor/runtime/src/executor/codexProtocol/v2/ReviewStartParams.ts +2 -0
  398. package/vendor/runtime/src/executor/codexProtocol/v2/SessionSource.ts +6 -0
  399. package/vendor/runtime/src/executor/codexProtocol/v2/SubAgentActivityKind.ts +5 -0
  400. package/vendor/runtime/src/executor/codexProtocol/v2/Thread.ts +104 -0
  401. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadActiveFlag.ts +5 -0
  402. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadHistoryMode.ts +5 -0
  403. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadItem.ts +125 -0
  404. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadReadParams.ts +12 -0
  405. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadReadResponse.ts +6 -0
  406. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadResumeParams.ts +5 -1
  407. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSection.ts +21 -0
  408. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSectionAppearance.ts +8 -0
  409. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadStartParams.ts +4 -1
  410. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadStatus.ts +6 -0
  411. package/vendor/runtime/src/executor/codexProtocol/v2/Turn.ts +37 -0
  412. package/vendor/runtime/src/executor/codexProtocol/v2/TurnError.ts +11 -0
  413. package/vendor/runtime/src/executor/codexProtocol/v2/TurnItemsView.ts +5 -0
  414. package/vendor/runtime/src/executor/codexProtocol/v2/TurnStartParams.ts +7 -2
  415. package/vendor/runtime/src/executor/codexProtocol/v2/TurnStatus.ts +5 -0
  416. package/vendor/runtime/src/executor/codexProtocol/v2/UserInput.ts +1 -1
  417. package/vendor/runtime/src/executor/codexProtocol/v2/WebSearchAction.ts +5 -0
  418. package/vendor/runtime/src/executor/codexRpc.ts +26 -6
  419. package/vendor/runtime/src/executor/codexSessions.ts +108 -0
  420. package/vendor/runtime/src/executor/health.ts +21 -7
  421. package/vendor/runtime/src/executor/liveTurns.ts +12 -5
  422. package/vendor/runtime/src/executor/ownership.ts +83 -0
  423. package/vendor/runtime/src/executor/providerRouter.ts +6 -0
  424. package/vendor/runtime/src/executor/types.ts +20 -1
  425. package/vendor/runtime/src/harness/index.ts +1 -0
  426. package/vendor/runtime/src/index.ts +2 -1
  427. package/vendor/shared/dist/agentCommands.d.ts +1 -0
  428. package/vendor/shared/dist/agentCommands.d.ts.map +1 -1
  429. package/vendor/shared/dist/automations.d.ts +34 -0
  430. package/vendor/shared/dist/automations.d.ts.map +1 -1
  431. package/vendor/shared/dist/automations.js +12 -0
  432. package/vendor/shared/dist/cardStudio.d.ts +41 -0
  433. package/vendor/shared/dist/cardStudio.d.ts.map +1 -1
  434. package/vendor/shared/dist/cardStudio.js +13 -3
  435. package/vendor/shared/dist/computer.d.ts +7 -1
  436. package/vendor/shared/dist/computer.d.ts.map +1 -1
  437. package/vendor/shared/dist/computer.js +13 -4
  438. package/vendor/shared/dist/constants.d.ts +3 -3
  439. package/vendor/shared/dist/constants.d.ts.map +1 -1
  440. package/vendor/shared/dist/constants.js +8 -14
  441. package/vendor/shared/dist/goalNotes.d.ts +4 -0
  442. package/vendor/shared/dist/goalNotes.d.ts.map +1 -0
  443. package/vendor/shared/dist/goalNotes.js +23 -0
  444. package/vendor/shared/dist/goals.d.ts +835 -0
  445. package/vendor/shared/dist/goals.d.ts.map +1 -0
  446. package/vendor/shared/dist/goals.js +198 -0
  447. package/vendor/shared/dist/index.d.ts +7 -2
  448. package/vendor/shared/dist/index.d.ts.map +1 -1
  449. package/vendor/shared/dist/index.js +6 -1
  450. package/vendor/shared/dist/journal-vault.d.ts +1 -1
  451. package/vendor/shared/dist/messagingSafety.d.ts +21 -0
  452. package/vendor/shared/dist/messagingSafety.d.ts.map +1 -0
  453. package/vendor/shared/dist/messagingSafety.js +8 -0
  454. package/vendor/shared/dist/schemas/harness.d.ts +199 -169
  455. package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
  456. package/vendor/shared/dist/schemas/harness.js +25 -124
  457. package/vendor/shared/dist/smartCapture.d.ts +24 -0
  458. package/vendor/shared/dist/smartCapture.d.ts.map +1 -1
  459. package/vendor/shared/dist/smartCapture.js +15 -0
  460. package/vendor/shared/dist/taskSync.d.ts +342 -0
  461. package/vendor/shared/dist/taskSync.d.ts.map +1 -0
  462. package/vendor/shared/dist/taskSync.js +111 -0
  463. package/vendor/shared/dist/types.d.ts +1 -4
  464. package/vendor/shared/dist/types.d.ts.map +1 -1
  465. package/vendor/shared/dist/voiceCapture.d.ts +1 -1
  466. package/vendor/shared/dist/workspaces.d.ts +255 -0
  467. package/vendor/shared/dist/workspaces.d.ts.map +1 -0
  468. package/vendor/shared/dist/workspaces.js +89 -0
  469. package/vendor/shared/src/agentCommands.ts +1 -0
  470. package/vendor/shared/src/automations.ts +12 -0
  471. package/vendor/shared/src/cardStudio.ts +13 -3
  472. package/vendor/shared/src/computer.ts +19 -5
  473. package/vendor/shared/src/constants.ts +8 -14
  474. package/vendor/shared/src/goalNotes.ts +23 -0
  475. package/vendor/shared/src/goals.ts +237 -0
  476. package/vendor/shared/src/index.ts +7 -6
  477. package/vendor/shared/src/messagingSafety.ts +11 -0
  478. package/vendor/shared/src/schemas/harness.ts +24 -130
  479. package/vendor/shared/src/smartCapture.ts +27 -0
  480. package/vendor/shared/src/taskSync.ts +81 -0
  481. package/vendor/shared/src/types.ts +0 -6
  482. package/vendor/shared/src/workspaces.ts +103 -0
  483. package/dist/coding/conduct.d.ts +0 -69
  484. package/dist/coding/conduct.d.ts.map +0 -1
  485. package/dist/coding/conduct.js +0 -348
  486. package/dist/coding/fleetIntegrate.d.ts +0 -37
  487. package/dist/coding/fleetIntegrate.d.ts.map +0 -1
  488. package/dist/coding/fleetIntegrate.js +0 -64
  489. package/dist/coding/fleetPlan.d.ts +0 -20
  490. package/dist/coding/fleetPlan.d.ts.map +0 -1
  491. package/dist/coding/fleetPlan.js +0 -125
  492. package/dist/coding/fleetTasks.d.ts +0 -33
  493. package/dist/coding/fleetTasks.d.ts.map +0 -1
  494. package/dist/coding/fleetTasks.js +0 -75
  495. package/dist/coding/openFleetPr.d.ts +0 -41
  496. package/dist/coding/openFleetPr.d.ts.map +0 -1
  497. package/dist/coding/openFleetPr.js +0 -121
  498. package/src/coding/conduct.ts +0 -462
  499. package/src/coding/fleetIntegrate.ts +0 -95
  500. package/src/coding/fleetPlan.ts +0 -135
  501. package/src/coding/fleetTasks.ts +0 -109
  502. package/src/coding/openFleetPr.ts +0 -148
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { WorkspaceCommandSchema, WorkspaceSnapshotSchema } from '../workspaces.js';
2
3
  import {
3
4
  VoiceCaptureAudioSchema,
4
5
  VoiceCaptureReceiptSchema,
@@ -21,7 +22,6 @@ import {
21
22
  HARNESS_REQUEST_KINDS,
22
23
  APPROVAL_DECISIONS,
23
24
  WORKSPACE_MODES,
24
- WORKER_STATUSES,
25
25
  EFFORT_LEVELS,
26
26
  DELIVERY_CHANNELS,
27
27
  AGENT_MODES,
@@ -112,6 +112,8 @@ export const JournalRequestSchema = HarnessRequestBase.extend({
112
112
  // server-side through the daemon's allowlist to an absolute path — the phone
113
113
  // never sends a filesystem path.
114
114
  export const CodeRequestSchema = HarnessRequestBase.extend({
115
+ recoveryOf: z.uuidv7().optional(),
116
+ recoveryReviewId: z.uuidv7().optional(),
115
117
  kind: z.literal('code'),
116
118
  repoId: z.string().min(1),
117
119
  prompt: z.string().min(1).max(8000),
@@ -125,10 +127,8 @@ export const CodeRequestSchema = HarnessRequestBase.extend({
125
127
  handoff: ProviderHandoffSchema.optional(),
126
128
  queue: z.boolean().optional(),
127
129
  afterRequestId: z.uuidv7().optional(),
128
- /** Conductor worker id (a fleet subtask's id). Present when the phone drills into one
129
- * worker of a fan-out and sends it a follow-up turn: the daemon runs it in that worker's
130
- * isolated `fleet/<repoId>/<workerId>` worktree, on its own lane. Absent → the bare repo
131
- * session, exactly as before. */
130
+ /** The worktree this turn belongs to. The daemon runs it in that worktree's own folder and
131
+ * branch, on its own lane. Absent → the repository's main session. */
132
132
  workerId: z.uuidv7().optional(),
133
133
  /** Where to do the work (#121). Absent → 'worktree', so a daemon on this schema
134
134
  * still understands a phone that predates the mode picker. The daemon rejects
@@ -162,72 +162,6 @@ export const CloneRepoRequestSchema = HarnessRequestBase.extend({
162
162
  url: z.string().min(1).max(2000),
163
163
  });
164
164
 
165
- // ---- Conductor (a fleet of coding agents) ---------------------------------
166
-
167
- // One worker in a fan-out plan — a single coding lane. Its `workerId` is the fleet
168
- // subtask's uuid AND the stream id its code frames arrive under (both uuidv7), so a
169
- // worker reuses the whole existing code-turn pipeline: the phone routes any frame whose
170
- // `requestId` equals a known `workerId` into that worker's lane. `ownedPaths` is the
171
- // files/globs this worker may touch (the ownership map that prevents two lanes colliding);
172
- // `mergeOrder` (lower first) mirrors the subtask's priority and decides integration order.
173
- export const FleetWorkerSchema = z.object({
174
- workerId: z.uuidv7(),
175
- title: z.string().min(1).max(200),
176
- brief: z.string().min(1).max(8000),
177
- ownedPaths: z.array(z.string().max(400)).max(200),
178
- mergeOrder: z.number().int(),
179
- });
180
-
181
- // The lead's decomposition of a goal — what the phone renders as the Fan-out card, and
182
- // what it sends back (possibly edited) to execute. `overlaps` are the ⚠ pairs whose owned
183
- // paths intersect, so the card can warn and the runner can force those two to serialize.
184
- export const FleetPlanSchema = z.object({
185
- goal: z.string().min(1).max(500),
186
- /** The parent Lucidity task (the goal); each worker is a subtask of it. Set once the
187
- * daemon has created the task graph (dogfood); absent on a freshly-proposed plan. */
188
- parentTaskId: z.uuidv7().optional(),
189
- workers: z.array(FleetWorkerSchema).min(1).max(16),
190
- overlaps: z
191
- .array(
192
- z.object({
193
- a: z.uuidv7(),
194
- b: z.uuidv7(),
195
- paths: z.array(z.string().max(400)).max(200),
196
- }),
197
- )
198
- .max(120) // at most C(16,2) pairs for the 16-worker ceiling
199
- .optional(),
200
- /** How many workers may run at once (quota guard). Absent → the daemon's default cap. */
201
- maxParallel: z.number().int().positive().max(16).optional(),
202
- });
203
-
204
- // Phone → daemon. Four phases over one request kind:
205
- // - `plan`: decompose `prompt` (the goal) → one `fleet_plan` event. Nothing runs or is created,
206
- // so the user edits or discards freely.
207
- // - `setup`: materialize an approved plan for the DESIGN-FIRST flow — create the task graph and
208
- // announce the workers (`worker_status: queued`), but write NO code. The user then chats each
209
- // worker via a `code` turn carrying its `workerId`, and merges with `integrate` when ready.
210
- // - `run`: the AUTO flow — create the graph, dispatch every worker to code in merge order, then
211
- // integrate. One-tap "fan out & run".
212
- // - `integrate`: merge the plan's worker branches onto lucid/<repo> in order → `worker_status`
213
- // (merged) / `fleet_conflict` / `fleet_done`. Used by the design-first flow's "Merge fleet".
214
- // Splitting plan from the rest keeps fan-out a one-tap opt-in: no worker spawns until the phone
215
- // sends `setup`/`run` with a plan the user accepted.
216
- export const ConductRequestSchema = HarnessRequestBase.extend({
217
- kind: z.literal('conduct'),
218
- repoId: z.string().min(1),
219
- phase: z.enum(['plan', 'run', 'setup', 'integrate']),
220
- prompt: z.string().min(1).max(8000),
221
- images: harnessImagesField,
222
- /** The approved plan to execute — required on `run`, ignored on `plan`. */
223
- plan: FleetPlanSchema.optional(),
224
- /** Conductor (lead) session id to continue its planning conversation across turns. */
225
- resume: z.string().optional(),
226
- /** Skip the dogfood task graph (no parent/subtask on the board). Set for quick incremental
227
- * spawns so the board isn't spammed with a parent per task; the fleet UI tracks them anyway. */
228
- ephemeral: z.boolean().optional(),
229
- });
230
-
231
165
  // Stop an in-flight request (the phone's stop button). `targetId` is the original
232
166
  // request's `id`; the daemon aborts its executor run and replies with a
233
167
  // `cancelled` stream event correlated to that same id.
@@ -327,6 +261,8 @@ export const IncidentReportRequestSchema = HarnessRequestBase.extend({
327
261
  snapshot: IncidentSnapshotSchema.optional(),
328
262
  /** The tail of the phone's diag ring — feeds SUSPEND_GAP and enriches the timeline. */
329
263
  diag: z.array(IncidentDiagEventSchema).max(400).optional(),
264
+ /** The phone's stutter-meter reading (frame times, redraw counts, time in history work). */
265
+ perf: z.record(z.string(), z.unknown()).optional(),
330
266
  });
331
267
 
332
268
  // ---- Voice diagnostics (Kokoro TTS drop/pause capture) --------------------
@@ -506,6 +442,7 @@ export const AttentionRequestSchema = HarnessRequestBase.extend({
506
442
  });
507
443
 
508
444
  export const HarnessRequestSchema = z.discriminatedUnion('kind', [
445
+ HarnessRequestBase.extend({ kind: z.literal('workspaces'), command: WorkspaceCommandSchema }),
509
446
  HarnessRequestBase.extend({
510
447
  kind: z.literal('voice-capture'),
511
448
  credentialId: z.uuid(),
@@ -541,7 +478,6 @@ export const HarnessRequestSchema = z.discriminatedUnion('kind', [
541
478
  BriefingRequestSchema,
542
479
  JournalRequestSchema,
543
480
  CodeRequestSchema,
544
- ConductRequestSchema,
545
481
  RepoListRequestSchema,
546
482
  ListPrsRequestSchema,
547
483
  CloneRepoRequestSchema,
@@ -789,6 +725,7 @@ export const CommandsResponseSchema = HarnessResponseBase.extend({
789
725
  description: z.string(),
790
726
  argumentHint: z.string(),
791
727
  acceptsArguments: z.boolean().optional(),
728
+ startsConversation: z.boolean().optional(),
792
729
  aliases: z.array(z.string()).optional(),
793
730
  clearsContext: z.boolean().optional(),
794
731
  }),
@@ -796,6 +733,7 @@ export const CommandsResponseSchema = HarnessResponseBase.extend({
796
733
  });
797
734
 
798
735
  export const HarnessResponseSchema = z.discriminatedUnion('kind', [
736
+ HarnessResponseBase.extend({ kind: z.literal('workspaces'), snapshot: WorkspaceSnapshotSchema }),
799
737
  HarnessResponseBase.extend({
800
738
  kind: z.literal('voice-capture'),
801
739
  receipt: VoiceCaptureReceiptSchema.nullable(),
@@ -839,6 +777,8 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
839
777
  type: z.literal('queue_state'),
840
778
  requestId: z.uuidv7(),
841
779
  state: z.enum(['queued', 'running']),
780
+ blockedBy: z.uuidv7().optional(),
781
+ message: z.string().optional(),
842
782
  }),
843
783
  z.object({
844
784
  // Durable receipt written before execution; recovery only pulls saved output.
@@ -866,6 +806,8 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
866
806
  requestId: z.uuidv7(),
867
807
  name: z.string(),
868
808
  phase: z.enum(['start', 'end']),
809
+ itemId: z.string().optional(),
810
+ outcome: z.string().optional(),
869
811
  }),
870
812
  z.object({
871
813
  type: z.literal('done'),
@@ -878,6 +820,7 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
878
820
  // has no memory of earlier turns — the phone surfaces/counts this so a silent
879
821
  // conversation reset is never invisible again (the root cause behind the #107 wipe).
880
822
  freshStart: z.boolean().optional(),
823
+ recovered: z.boolean().optional(),
881
824
  }),
882
825
  z.object({
883
826
  // The result of a `code` turn (M7): the diff the turn produced, ready for the
@@ -888,6 +831,13 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
888
831
  requestId: z.uuidv7(),
889
832
  branch: z.string(),
890
833
  diff: z.string(),
834
+ /** What the turn changed in tracked files: line counts and paths. The phone shows this in
835
+ * place of a diff. Absent when nothing changed or the count could not be taken. */
836
+ changes: z.object({
837
+ added: z.number().int().nonnegative(),
838
+ removed: z.number().int().nonnegative(),
839
+ files: z.array(z.string()).max(40),
840
+ }).optional(),
891
841
  summary: z.string().optional(),
892
842
  mode: z.enum(WORKSPACE_MODES).optional(),
893
843
  // In-place only: the branch the phone expected this turn to land on, echoed back ONLY
@@ -895,6 +845,7 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
895
845
  // ran — on `branch` — so the phone shows a quiet "checkout moved" notice on the bubble
896
846
  // instead of the old dead-end rejection that made the user re-send.
897
847
  movedFrom: z.string().optional(),
848
+ checkpointWarning: z.string().optional(),
898
849
  }),
899
850
  z.object({
900
851
  // The result of a `clone` turn (#78): the new repo's id, once cloned into the
@@ -903,68 +854,11 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
903
854
  requestId: z.uuidv7(),
904
855
  repoId: z.string(),
905
856
  }),
906
- // ---- Conductor fleet events (stream under the CONDUCT turn's requestId) ----
907
- z.object({
908
- // The lead's decomposition, produced by a `conduct` `plan` turn — the phone renders it
909
- // as the Fan-out card. Nothing has run or been created yet; the user edits/accepts, then
910
- // sends `conduct` `run` with this (possibly edited) plan.
911
- type: z.literal('fleet_plan'),
912
- requestId: z.uuidv7(),
913
- plan: FleetPlanSchema,
914
- }),
915
- z.object({
916
- // A worker crossed into a new lifecycle state. The phone updates that lane's card on the
917
- // Fleet board. The worker's own delta/tool_call/code_result/done frames arrive separately,
918
- // UNDER `requestId === workerId`, so they flow through the existing code-turn rendering.
919
- type: z.literal('worker_status'),
920
- requestId: z.uuidv7(),
921
- workerId: z.uuidv7(),
922
- status: z.enum(WORKER_STATUSES),
923
- /** A short live line for the card ("editing serialTts.ts"). Optional. */
924
- detail: z.string().optional(),
925
- /** This worker's diff size once it has one, for the card's "+N −M". Optional. */
926
- diffStat: z
927
- .object({
928
- added: z.number().int(),
929
- removed: z.number().int(),
930
- files: z.number().int(),
931
- })
932
- .optional(),
933
- }),
934
- z.object({
935
- // Integration hit a conflict merging a worker onto the fleet branch. Surfaced in the
936
- // conductor feed (never silently) so the user can hand it back to a worker as a fresh turn.
937
- // (Legacy combined-integrate path; per-feature delivery opens independent PRs and never
938
- // merges workers together, so this doesn't fire there.)
939
- type: z.literal('fleet_conflict'),
940
- requestId: z.uuidv7(),
941
- workerId: z.uuidv7(),
942
- paths: z.array(z.string()),
943
- message: z.string(),
944
- }),
945
- z.object({
946
- // One worker was delivered as its OWN pull request (per-feature delivery): its branch was
947
- // pushed and a PR opened against the base. `url` is that worker's PR; `error` a short reason
948
- // it couldn't open (no remote / no gh / no auth) — the worker's commits still exist on its
949
- // branch. One of these fires per delivered worker.
950
- type: z.literal('worker_pr'),
951
- requestId: z.uuidv7(),
952
- workerId: z.uuidv7(),
953
- url: z.string().optional(),
954
- error: z.string().optional(),
955
- }),
956
- z.object({
957
- // The fan-out finished. Per-feature delivery: `delivered`/`total` count how many workers got
958
- // their own PR (each worker's URL arrives in its `worker_pr`). No single integration branch.
959
- type: z.literal('fleet_done'),
960
- requestId: z.uuidv7(),
961
- delivered: z.number().int(),
962
- total: z.number().int(),
963
- }),
964
857
  z.object({
965
858
  type: z.literal('error'),
966
859
  requestId: z.uuidv7(),
967
860
  message: z.string(),
861
+ code: z.string().optional(),
968
862
  }),
969
863
  // A `cancel` request successfully stopped this in-flight turn.
970
864
  z.object({
@@ -65,3 +65,30 @@ export type SmartCaptureReview = {
65
65
  message?: string;
66
66
  pollAfterMs?: number | null;
67
67
  };
68
+
69
+ /** Bump when the disclosure below changes in a way people should agree to again. */
70
+ export const AI_CONSENT_VERSION = '2026-10-12';
71
+
72
+ /**
73
+ * The one wording of what is sent and to whom, shown before anything is transmitted.
74
+ * It names the recipients on purpose: that is the point of asking.
75
+ */
76
+ export const AI_CONSENT_DISCLOSURE = {
77
+ title: 'Allow AI features?',
78
+ body: 'Lucidity can suggest a project and date for a new task, spot a duplicate, and carry out the quick actions you speak or type. To do that it sends the task or instruction text, your project and milestone names, and the titles, dates and status of related tasks to Vercel’s AI Gateway and TypeSafe’s Jev model. Lucidity keeps what you asked for 14 days to improve quick actions. Notes, journal entries and audio are never sent. You can turn this off at any time in Settings.',
79
+ allow: 'Allow',
80
+ decline: 'Not now',
81
+ } as const;
82
+
83
+ export const AiConsentInputSchema = z.object({ granted: z.boolean() }).strict();
84
+
85
+ export type AiConsent = {
86
+ /** The account has AI features to turn on. Nobody else is asked. */
87
+ available: boolean;
88
+ /** null until the person has answered. */
89
+ granted: boolean | null;
90
+ decidedAt: string | null;
91
+ };
92
+
93
+ /** The `code` on a 403 from an AI route when the only thing missing is consent. */
94
+ export const AI_CONSENT_REQUIRED = 'ai_consent_required';
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ import { CreateTaskSchema, UpdateTaskSchema } from './schemas/task.js';
3
+ import { CreateProjectSchema } from './schemas/project.js';
4
+ import { CreateMilestoneSchema } from './schemas/milestone.js';
5
+ import { UpdateOccurrenceSchema } from './recurrence.js';
6
+
7
+ export const TASK_SYNC_VERSION = '1';
8
+ export const TASK_SYNC_VERSION_HEADER = 'X-Lucidity-Sync-Version';
9
+ export const TASK_SYNC_OPERATION_HEADER = 'X-Lucidity-Operation-Id';
10
+
11
+ export const OccurrenceIdentitySchema = z.object({ version: z.number().int().min(1), ordinal: z.number().int().min(0).max(100000) }).strict();
12
+ const taskId = z.uuidv7();
13
+ export const TaskSyncActionSchema = z.discriminatedUnion('kind', [
14
+ z.object({ kind: z.literal('create_project'), data: CreateProjectSchema.extend({ id: taskId }).strict() }).strict(),
15
+ z.object({ kind: z.literal('create_milestone'), data: CreateMilestoneSchema.extend({ id: taskId }).strict() }).strict(),
16
+ z.object({ kind: z.literal('reorder'), taskIds: z.array(taskId).min(1).max(1000).refine(ids => new Set(ids).size === ids.length, 'Task IDs must be distinct') }).strict(),
17
+ z.object({ kind: z.literal('create'), data: CreateTaskSchema.extend({ id: taskId }).strict() }).strict(),
18
+ z.object({ kind: z.literal('update'), taskId, data: UpdateTaskSchema.strict() }).strict(),
19
+ z.object({ kind: z.literal('complete'), taskId, state: z.enum(['pending', 'completed']), occurrenceId: z.uuid().optional(), occurrenceIdentity: OccurrenceIdentitySchema.optional() }).strict(),
20
+ z.object({ kind: z.literal('occurrence'), taskId, occurrenceId: z.uuid(), occurrenceIdentity: OccurrenceIdentitySchema.optional(), data: UpdateOccurrenceSchema.strict() }).strict(),
21
+ z.object({ kind: z.literal('trash'), taskId }).strict(),
22
+ z.object({ kind: z.literal('restore'), taskId, deletionBatchId: z.uuid() }).strict(),
23
+ ]);
24
+ export type TaskSyncAction = z.infer<typeof TaskSyncActionSchema>;
25
+
26
+ export const TaskSyncCommandSchema = z.object({
27
+ version: z.literal(1),
28
+ operationId: z.uuid(),
29
+ action: TaskSyncActionSchema,
30
+ }).strict();
31
+ export type TaskSyncCommand = z.infer<typeof TaskSyncCommandSchema>;
32
+
33
+ export const TaskSyncAckSchema = z.object({ operationId: z.uuid(), accepted: z.literal(true) });
34
+
35
+ export function taskSyncRequest(command: TaskSyncCommand) {
36
+ const { action } = command;
37
+ const base = '/api/tasks';
38
+ let method: string, path: string, body: unknown;
39
+ switch (action.kind) {
40
+ case 'create_project': method = 'POST'; path = '/api/projects'; body = action.data; break;
41
+ case 'create_milestone': method = 'POST'; path = '/api/milestones'; body = action.data; break;
42
+ case 'reorder': method = 'PATCH'; path = `${base}/reorder`; body = { taskIds: action.taskIds }; break;
43
+ case 'create': method = 'POST'; path = base; body = action.data; break;
44
+ case 'update': method = 'PATCH'; path = `${base}/${action.taskId}`; body = action.data; break;
45
+ case 'complete':
46
+ method = 'PATCH'; path = `${base}/${action.taskId}/complete`;
47
+ body = { state: action.state, occurrenceId: action.occurrenceId, occurrenceIdentity: action.occurrenceIdentity }; break;
48
+ case 'occurrence': method = 'PATCH'; path = `${base}/${action.taskId}/occurrences/${action.occurrenceId}`; body = { ...action.data, occurrenceIdentity: action.occurrenceIdentity }; break;
49
+ case 'trash': method = 'DELETE'; path = `${base}/${action.taskId}`; break;
50
+ case 'restore': method = 'POST'; path = `${base}/${action.taskId}/restore`; body = { deletionBatchId: action.deletionBatchId }; break;
51
+ }
52
+ return { path, method, body: body === undefined ? undefined : JSON.stringify(body), headers: {
53
+ [TASK_SYNC_VERSION_HEADER]: TASK_SYNC_VERSION,
54
+ [TASK_SYNC_OPERATION_HEADER]: command.operationId,
55
+ } };
56
+ }
57
+
58
+ /** Restrict retryable uploads to the domain actions covered by this protocol. */
59
+ export function parseTaskSyncAction(method: string, path: string, body: unknown): TaskSyncAction {
60
+ const parts = path.split('/').filter(Boolean);
61
+ if (parts.length === 2 && parts[0] === 'api' && method === 'POST' && ['projects', 'milestones'].includes(parts[1]!)) {
62
+ return TaskSyncActionSchema.parse({ kind: parts[1] === 'projects' ? 'create_project' : 'create_milestone', data: body });
63
+ }
64
+ if (parts[0] !== 'api' || parts[1] !== 'tasks') throw new Error('Unsupported sync action');
65
+ let action: unknown;
66
+ if (parts.length === 2 && method === 'POST') action = { kind: 'create', data: body };
67
+ if (parts.length === 3 && method === 'PATCH') action = { kind: 'update', taskId: parts[2], data: body };
68
+ if (parts.length === 3 && parts[2] === 'reorder' && method === 'PATCH') action = { ...body as object, kind: 'reorder' };
69
+ if (parts.length === 3 && method === 'DELETE' && body === undefined) action = { kind: 'trash', taskId: parts[2] };
70
+ if (parts.length === 4 && parts[3] === 'complete' && method === 'PATCH') {
71
+ action = { ...body as object, kind: 'complete', taskId: parts[2] };
72
+ }
73
+ if (parts.length === 4 && parts[3] === 'restore' && method === 'POST') {
74
+ action = { ...body as object, kind: 'restore', taskId: parts[2] };
75
+ }
76
+ if (parts.length === 5 && parts[3] === 'occurrences' && method === 'PATCH') {
77
+ const { occurrenceIdentity, ...data } = (body ?? {}) as Record<string, unknown>;
78
+ action = { kind: 'occurrence', taskId: parts[2], occurrenceId: parts[4], occurrenceIdentity, data };
79
+ }
80
+ return TaskSyncActionSchema.parse(action);
81
+ }
@@ -130,9 +130,6 @@ import {
130
130
  BriefingRequestSchema,
131
131
  JournalRequestSchema,
132
132
  CodeRequestSchema,
133
- ConductRequestSchema,
134
- FleetPlanSchema,
135
- FleetWorkerSchema,
136
133
  RepoListRequestSchema,
137
134
  ListPrsRequestSchema,
138
135
  GetConfigRequestSchema,
@@ -276,9 +273,6 @@ export type AskRequest = z.input<typeof AskRequestSchema>;
276
273
  export type BriefingRequest = z.input<typeof BriefingRequestSchema>;
277
274
  export type JournalRequest = z.input<typeof JournalRequestSchema>;
278
275
  export type CodeRequest = z.input<typeof CodeRequestSchema>;
279
- export type ConductRequest = z.input<typeof ConductRequestSchema>;
280
- export type FleetPlan = z.infer<typeof FleetPlanSchema>;
281
- export type FleetWorker = z.infer<typeof FleetWorkerSchema>;
282
276
  export type RepoListRequest = z.input<typeof RepoListRequestSchema>;
283
277
  export type RepoListResponse = z.infer<typeof RepoListResponseSchema>;
284
278
  export type ListPrsRequest = z.input<typeof ListPrsRequestSchema>;
@@ -0,0 +1,103 @@
1
+ import { z } from 'zod';
2
+
3
+ export const SavedChatMessageSchema = z.object({
4
+ id: z.string().min(1), role: z.enum(['user', 'lucid', 'notice']), text: z.string(),
5
+ }).passthrough();
6
+
7
+ /** How one repository's worktrees are prepared. Stored on the computer and edited from the phone. */
8
+ export const RepoSettingsSchema = z.object({
9
+ /** Gitignored files copied from the main checkout into a new worktree. Wildcards in the file name only. */
10
+ copy: z.array(z.string().trim().min(1).max(300)).max(50).default([]),
11
+ /** Shell command run in a new worktree once those files are in place. */
12
+ setup: z.string().trim().max(2000).optional(),
13
+ /** Remote branch new worktrees start from, e.g. `origin/main`. Unset uses the remote default. */
14
+ baseRef: z.string().trim().max(200).optional(),
15
+ /** Shell command run in a worktree just before it is archived. A failure stops the archive. */
16
+ archiveScript: z.string().trim().max(2000).optional(),
17
+ /** Archive a worktree once the pull request for its branch has merged. */
18
+ archiveOnMerge: z.boolean().optional(),
19
+ /** Delete the local branch when a worktree is archived. Restore brings it back from the snapshot. */
20
+ deleteBranchOnArchive: z.boolean().optional(),
21
+ });
22
+ /** Where a repository lives on the computer, and what its copy list matches there right now. */
23
+ export const RepoPlacesSchema = z.object({
24
+ root: z.string(), worktrees: z.string(), copyMatches: z.array(z.string()),
25
+ });
26
+ export type RepoPlaces = z.infer<typeof RepoPlacesSchema>;
27
+ export type RepoSettings = z.infer<typeof RepoSettingsSchema>;
28
+
29
+ export const WorkerWorkspaceSchema = z.object({
30
+ workerId: z.uuidv7(), repoId: z.string().min(1), title: z.string().min(1).max(200),
31
+ brief: z.string().max(8000).default(''),
32
+ workspaceId: z.string(), conversationId: z.string(),
33
+ state: z.enum(['creating', 'ready', 'setup_failed', 'archived']),
34
+ branch: z.string().optional(), baseRef: z.string().optional(), baseSha: z.string().optional(),
35
+ resume: z.string().optional(), error: z.string().optional(),
36
+ /** The setup command's progress on a ready worktree. A failure's output is in `error`. */
37
+ setup: z.enum(['running', 'failed']).optional(),
38
+ /** First of the ten ports reserved for this worktree's servers. */
39
+ port: z.number().int().min(1024).max(65525).optional(),
40
+ createdAt: z.string(), updatedAt: z.string(),
41
+ });
42
+ export type WorkerWorkspace = z.infer<typeof WorkerWorkspaceSchema>;
43
+
44
+ export const WorkspaceCommandSchema = z.object({
45
+ action: z.enum(['list', 'create', 'history', 'archive', 'restore', 'import', 'clear-history', 'inspect-run', 'continue-run',
46
+ 'settings', 'save-settings', 'setup', 'delete']),
47
+ requestId: z.uuidv7().optional(), reviewId: z.uuidv7().optional(),
48
+ instruction: z.string().trim().min(1).max(8000).optional(),
49
+ repoId: z.string().min(1).optional(), workerId: z.uuidv7().optional(),
50
+ checkout: z.boolean().optional(), revision: z.string().optional(),
51
+ title: z.string().trim().min(1).max(200).optional(),
52
+ brief: z.string().max(8000).optional(), before: z.string().optional(),
53
+ settings: RepoSettingsSchema.optional(),
54
+ /** `delete` only: go ahead even though the worktree holds work that is not in the base branch. */
55
+ force: z.boolean().optional(),
56
+ legacy: z.object({
57
+ messages: z.array(SavedChatMessageSchema).max(10_000), resume: z.string().optional(),
58
+ sessionCheckout: z.boolean().optional(),
59
+ }).optional(),
60
+ });
61
+ export type WorkspaceCommand = z.infer<typeof WorkspaceCommandSchema>;
62
+
63
+ /** Work an archived worktree still holds that is neither in the repository's base branch nor pushed. */
64
+ export const UnmergedWorkSchema = z.object({
65
+ commits: z.number().int().min(0),
66
+ /** The archive snapshot holds files that were never committed. */
67
+ uncommitted: z.boolean(),
68
+ });
69
+ export type UnmergedWork = z.infer<typeof UnmergedWorkSchema>;
70
+
71
+ export const WorkspaceRunSchema = z.object({
72
+ requestId: z.string(), prompt: z.string(),
73
+ handoff: z.object({ from: z.enum(['claude', 'codex']), to: z.enum(['claude', 'codex']) }).optional(),
74
+ frames: z.array(z.record(z.string(), z.unknown())),
75
+ terminated: z.boolean(),
76
+ });
77
+ export type WorkspaceRun = z.infer<typeof WorkspaceRunSchema>;
78
+ export const RunReviewSchema = z.object({
79
+ requestId: z.uuidv7(), reviewId: z.uuidv7(), inspectedAt: z.string(),
80
+ prompt: z.string(), workspace: z.string().optional(), branch: z.string().optional(),
81
+ changes: z.string(), diff: z.string(), inspectionError: z.string().optional(),
82
+ progress: z.string(), answer: z.string().optional(), evidence: z.string(),
83
+ tools: z.array(z.object({ name: z.string(), phase: z.string(), itemId: z.string().optional(), outcome: z.string().optional() })),
84
+ unresolved: z.array(z.string()),
85
+ continuationId: z.uuidv7(), continuedAt: z.string().optional(), instruction: z.string().optional(),
86
+ });
87
+ export type RunReview = z.infer<typeof RunReviewSchema>;
88
+ export const WorkspaceSnapshotSchema = z.object({
89
+ workers: z.array(WorkerWorkspaceSchema),
90
+ review: RunReviewSchema.optional(),
91
+ checkout: z.object({
92
+ repoId: z.string(), conversationId: z.string(), revision: z.string(),
93
+ resume: z.string().optional(),
94
+ }).optional(),
95
+ runs: z.array(WorkspaceRunSchema).optional(),
96
+ legacyMessages: z.array(SavedChatMessageSchema).optional(),
97
+ nextBefore: z.string().optional(),
98
+ settings: RepoSettingsSchema.optional(),
99
+ places: RepoPlacesSchema.optional(),
100
+ /** A `delete` that was not carried out: what would be lost. Sending it again with `force` deletes. */
101
+ unmerged: UnmergedWorkSchema.optional(),
102
+ });
103
+ export type WorkspaceSnapshot = z.infer<typeof WorkspaceSnapshotSchema>;
@@ -1,69 +0,0 @@
1
- import type { AgentExecutor } from '@lucidity/runtime';
2
- import type { FleetPlan, HarnessImage } from '@lucidity/shared';
3
- import type { RepoEntry } from '../config.js';
4
- import { commitSubjects, commitsAhead } from './worktree.js';
5
- import { openFleetPr } from './openFleetPr.js';
6
- import { type CodeTurnRequest, type RunCodeTurnDeps } from './runCodeTurn.js';
7
- /**
8
- * The conductor: one Lucid "lead" that decomposes a goal, fans it out to isolated worker
9
- * worktrees, and integrates them back onto lucid/<repo> in order. Daemon-side authority — the
10
- * daemon owns every worker's resume handle and its lane; the phone is a thin client that sees
11
- * a plan, approves it, then watches the fleet.
12
- *
13
- * Two phases over one turn. `plan` runs a read-only lead turn to produce a FleetPlan (streamed
14
- * back as a fleet_plan event; nothing is created, so a discarded plan leaves no trace). `run`
15
- * takes the approved plan and: creates the task graph (worker = subtask), dispatches the workers
16
- * in parallel up to a cap (isolated worktrees make that safe), then integrates sequentially in
17
- * merge order — the one place overlap can bite. Each worker's own code frames stream under
18
- * `requestId === workerId`, so a worker reuses the entire existing code-turn pipeline; this
19
- * layer only adds the fleet-level events (plan, worker_status, conflict, done).
20
- */
21
- export interface ConductTurnRequest {
22
- id: string;
23
- repoId: string;
24
- phase: 'plan' | 'run' | 'setup' | 'integrate';
25
- prompt: string;
26
- images?: HarnessImage[];
27
- plan?: FleetPlan;
28
- resume?: string;
29
- /** Skip the dogfood task graph (quick incremental spawn — the fleet UI tracks it anyway). */
30
- ephemeral?: boolean;
31
- }
32
- type Api = {
33
- request<T>(endpoint: string, options?: RequestInit): Promise<T>;
34
- };
35
- export interface RunConductTurnDeps {
36
- repos: RepoEntry[];
37
- executor: AgentExecutor;
38
- onWorkerApproval?: (requestId: string, approval: import('@lucidity/runtime').ExecutorApproval) => Promise<boolean>;
39
- onEnd?: (requestId: string) => void;
40
- send: (obj: unknown) => void;
41
- signal?: AbortSignal;
42
- model?: string;
43
- effort?: string;
44
- /** Task API for the dogfood (goal + subtasks). Absent → tasks are skipped, fleet still runs. */
45
- api?: Api;
46
- /** Project the fleet's tasks land in. Absent → the Inbox (projectId null). */
47
- projectId?: string | null;
48
- /** Default parallel-worker cap when the plan doesn't set one (quota guard). */
49
- maxParallel?: number;
50
- /** Worktree base override (tests point it at a temp dir). */
51
- baseDir?: string;
52
- /** Seam: run one worker's coding turn. Defaults to {@link runCodeTurn}. */
53
- runWorker?: (req: CodeTurnRequest, deps: RunCodeTurnDeps) => Promise<void>;
54
- /** Seam: open one worker's PR (push its branch + open/reuse a PR). Defaults to {@link openFleetPr}. */
55
- openPr?: typeof openFleetPr;
56
- /** Seam: how many commits a worker's branch carries. Defaults to {@link commitsAhead}. */
57
- commitsAhead?: typeof commitsAhead;
58
- /** Seam: the subjects of those commits, for the PR title. Defaults to {@link commitSubjects}. */
59
- commitSubjects?: typeof commitSubjects;
60
- }
61
- /** Count +/- lines and files in a unified diff, for a worker card's "+N −M". */
62
- export declare function diffStat(diff: string): {
63
- added: number;
64
- removed: number;
65
- files: number;
66
- };
67
- export declare function runConductTurn(req: ConductTurnRequest, deps: RunConductTurnDeps): Promise<void>;
68
- export {};
69
- //# sourceMappingURL=conduct.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conduct.d.ts","sourceRoot":"","sources":["../../src/coding/conduct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAgB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EACL,cAAc,EACd,YAAY,EAKb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAuC,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAe,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE3F;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,GAAG,GAAG;IAAE,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAE/E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,QAAQ,EAAE,aAAa,CAAC;IACxB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,mBAAmB,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnH,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,uGAAuG;IACvG,MAAM,CAAC,EAAE,OAAO,WAAW,CAAC;IAC5B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC;IACnC,iGAAiG;IACjG,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;CACxC;AAQD,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAWxF;AAoBD,wBAAsB,cAAc,CAClC,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAuBf"}