@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
@@ -5,7 +5,7 @@ import { AsyncQueue } from './asyncQueue.js';
5
5
  import { stripUnsafeEnv } from './claudeCode.js';
6
6
  const require = createRequire(import.meta.url);
7
7
  const { version: lucidityVersion } = require('../../package.json');
8
- export const CODEX_RUNTIME_VERSION = '0.153.4';
8
+ export const CODEX_RUNTIME_VERSION = '0.160.0';
9
9
  export function codexSubscriptionEnv() {
10
10
  const env = stripUnsafeEnv(process.env);
11
11
  for (const key of ['OPENAI_API_KEY', 'CODEX_API_KEY', 'OPENAI_BASE_URL'])
@@ -14,13 +14,19 @@ export function codexSubscriptionEnv() {
14
14
  }
15
15
  /** Bidirectional stdio JSON-RPC. Pending requests fail on timeout or child exit. */
16
16
  export class CodexRpc {
17
+ get pid() { return this.child.pid; }
17
18
  events = new AsyncQueue();
18
19
  onRequest;
19
20
  child;
21
+ exited;
20
22
  sequence = 0;
21
23
  closed = false;
24
+ idle = false;
25
+ get isConnected() {
26
+ return !this.closed;
27
+ }
22
28
  pending = new Map();
23
- constructor(command, cwd) {
29
+ constructor(command, cwd, env) {
24
30
  const prefix = command
25
31
  ? []
26
32
  : [require.resolve('@openai/codex/bin/codex.js')];
@@ -35,9 +41,13 @@ export class CodexRpc {
35
41
  'model_provider="openai"',
36
42
  ], {
37
43
  cwd,
38
- env: codexSubscriptionEnv(),
44
+ env: { ...codexSubscriptionEnv(), ...env },
39
45
  stdio: ['pipe', 'pipe', 'pipe'],
40
46
  });
47
+ this.exited = new Promise((resolve) => {
48
+ this.child.once('close', () => resolve());
49
+ this.child.once('error', () => resolve());
50
+ });
41
51
  // Drain stderr without retaining potentially sensitive prompt/config diagnostics.
42
52
  this.child.stderr.on('data', () => { });
43
53
  this.child.stdin.on('error', () => { });
@@ -74,7 +84,7 @@ export class CodexRpc {
74
84
  else
75
85
  pending.resolve(message.result);
76
86
  }
77
- else if (message.method && !this.closed)
87
+ else if (message.method && !this.closed && !this.idle)
78
88
  this.events.push(message);
79
89
  });
80
90
  }
@@ -83,6 +93,11 @@ export class CodexRpc {
83
93
  throw new Error('Codex is disconnected.');
84
94
  this.child.stdin.write(JSON.stringify(value) + '\n');
85
95
  }
96
+ setIdle(idle) {
97
+ this.idle = idle;
98
+ if (idle)
99
+ this.events.discardPending();
100
+ }
86
101
  notify(method, params) {
87
102
  this.write({ method, params });
88
103
  }
@@ -132,8 +147,9 @@ export class CodexRpc {
132
147
  kill.unref();
133
148
  this.child.once('close', () => clearTimeout(kill));
134
149
  }
135
- close() {
150
+ async close() {
136
151
  this.finish(new Error('Codex session closed.'));
152
+ await this.exited;
137
153
  }
138
154
  }
139
155
  export async function initializeCodex(rpc) {
@@ -0,0 +1,30 @@
1
+ import type { CodexConnection } from './codexRpc.js';
2
+ /** Rust maps may arrive in a different order; credentials never become a stored key. */
3
+ export declare function codexBindingFingerprint(value: unknown): string;
4
+ export interface CodexThread {
5
+ thread: {
6
+ id: string;
7
+ };
8
+ model?: string;
9
+ reasoningEffort?: string | null;
10
+ cwd?: string;
11
+ }
12
+ export interface CodexSession {
13
+ rpc: CodexConnection;
14
+ thread: CodexThread;
15
+ fingerprint: string;
16
+ }
17
+ /** Completed threads retain one transport; idle eviction still awaits the native exit. */
18
+ export declare class CodexSessions {
19
+ private readonly limit;
20
+ private readonly idleMs;
21
+ private idle;
22
+ private closing;
23
+ private disposed;
24
+ constructor(limit?: number, idleMs?: number);
25
+ take(id?: string): Promise<CodexSession | undefined>;
26
+ private evict;
27
+ keep(session: CodexSession): Promise<void>;
28
+ dispose(): Promise<void>;
29
+ }
30
+ //# sourceMappingURL=codexSessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codexSessions.d.ts","sourceRoot":"","sources":["../../src/executor/codexSessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAc9D;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,eAAe,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,0FAA0F;AAC1F,qBAAa,aAAa;IAQtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IARzB,OAAO,CAAC,IAAI,CAGR;IACJ,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAEN,KAAK,SAAI,EACT,MAAM,SAAa;IAGhC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAgB1D,OAAO,CAAC,KAAK;IAcP,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/B"}
@@ -0,0 +1,88 @@
1
+ import { createHash } from 'node:crypto';
2
+ /** Rust maps may arrive in a different order; credentials never become a stored key. */
3
+ export function codexBindingFingerprint(value) {
4
+ const ordered = (value) => Array.isArray(value)
5
+ ? value.map(ordered)
6
+ : value && typeof value === 'object'
7
+ ? Object.fromEntries(Object.entries(value)
8
+ .sort(([a], [b]) => a.localeCompare(b))
9
+ .map(([key, item]) => [key, ordered(item)]))
10
+ : value;
11
+ return createHash('sha256')
12
+ .update(JSON.stringify(ordered(value)))
13
+ .digest('hex');
14
+ }
15
+ /** Completed threads retain one transport; idle eviction still awaits the native exit. */
16
+ export class CodexSessions {
17
+ limit;
18
+ idleMs;
19
+ idle = new Map();
20
+ closing = new Map();
21
+ disposed = false;
22
+ constructor(limit = 2, idleMs = 3 * 60_000) {
23
+ this.limit = limit;
24
+ this.idleMs = idleMs;
25
+ }
26
+ async take(id) {
27
+ if (!id)
28
+ return;
29
+ await this.closing.get(id);
30
+ if (this.disposed)
31
+ throw new Error('Codex is shutting down.');
32
+ const session = this.idle.get(id);
33
+ if (!session)
34
+ return;
35
+ clearTimeout(session.timer);
36
+ this.idle.delete(id);
37
+ if (session.rpc.isConnected === false) {
38
+ await session.rpc.close();
39
+ return;
40
+ }
41
+ session.rpc.setIdle?.(false);
42
+ return session;
43
+ }
44
+ evict(id) {
45
+ const session = this.idle.get(id);
46
+ if (!session)
47
+ return this.closing.get(id) ?? Promise.resolve();
48
+ clearTimeout(session.timer);
49
+ this.idle.delete(id);
50
+ const closing = Promise.resolve()
51
+ .then(() => session.rpc.close())
52
+ .finally(() => {
53
+ if (this.closing.get(id) === closing)
54
+ this.closing.delete(id);
55
+ });
56
+ this.closing.set(id, closing);
57
+ return closing;
58
+ }
59
+ async keep(session) {
60
+ const id = session.thread.thread.id;
61
+ if (this.disposed ||
62
+ session.rpc.isConnected === false ||
63
+ !session.rpc.setIdle ||
64
+ this.limit <= 0) {
65
+ await session.rpc.close();
66
+ return;
67
+ }
68
+ await this.evict(id);
69
+ if (this.disposed) {
70
+ await session.rpc.close();
71
+ return;
72
+ }
73
+ session.rpc.onRequest = undefined;
74
+ session.rpc.setIdle(true);
75
+ const timer = setTimeout(() => {
76
+ void this.evict(id).catch(() => { });
77
+ }, this.idleMs);
78
+ timer.unref();
79
+ this.idle.set(id, { ...session, timer });
80
+ while (this.idle.size > this.limit)
81
+ await this.evict(this.idle.keys().next().value);
82
+ }
83
+ async dispose() {
84
+ this.disposed = true;
85
+ await Promise.all([...this.idle.keys()].map((id) => this.evict(id)));
86
+ await Promise.all(this.closing.values());
87
+ }
88
+ }
@@ -1,6 +1,6 @@
1
1
  import type { ProviderHealth } from '@lucidity/shared';
2
- import type { AgentExecutor, ExecutorRunInput } from './types.js';
3
- export declare function providerFailure(error: unknown): Pick<ProviderHealth, 'auth' | 'allowance' | 'problem'>;
2
+ import type { AgentExecutor, ExecutorRunInput, ProviderRunRef, ProviderInspection } from './types.js';
3
+ export declare function providerFailure(error: unknown): Pick<ProviderHealth, 'auth' | 'allowance' | 'problem'> | undefined;
4
4
  /** Observes the same adapter used by interactive and scheduled work. No probe inference. */
5
5
  export declare class HealthAwareExecutor implements AgentExecutor {
6
6
  private readonly executor;
@@ -10,6 +10,11 @@ export declare class HealthAwareExecutor implements AgentExecutor {
10
10
  private check;
11
11
  constructor(executor: AgentExecutor);
12
12
  get name(): string;
13
+ get recoveryCapability(): "native-turn" | "completion-receipt" | undefined;
14
+ inspect(ref: ProviderRunRef, options?: {
15
+ cwd?: string;
16
+ timeoutMs?: number;
17
+ }): Promise<ProviderInspection>;
13
18
  health(): ProviderHealth;
14
19
  subscribe(listener: () => void): () => void;
15
20
  private update;
@@ -25,6 +30,7 @@ export declare class HealthAwareExecutor implements AgentExecutor {
25
30
  upgrade?: string | undefined;
26
31
  }[]>;
27
32
  commands(input?: Pick<ExecutorRunInput, 'cwd' | 'permissionMode' | 'mcp'>): Promise<import("@lucidity/shared").AgentCommandOption[]>;
33
+ withOwnership<T>(input: ExecutorRunInput, action: () => Promise<T>): Promise<T>;
28
34
  run(input: ExecutorRunInput): Promise<import("./types.js").ExecutorResult>;
29
35
  runStream(input: ExecutorRunInput): AsyncGenerator<import("./types.js").ExecutorStreamEvent, void, unknown>;
30
36
  steer(requestId: string, text: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/executor/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;A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GAAG,SAAS,CAoBpE;AAED,4FAA4F;AAC5F,qBAAa,mBAAoB,YAAW,aAAa;IAK3C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJrC,QAAQ,CAAC,YAAY,QAAQ;IAC7B,OAAO,CAAC,KAAK,CAA6D;IAC1E,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,KAAK,CAA4D;gBAC5C,QAAQ,EAAE,aAAa;IACpD,IAAI,IAAI,WAEP;IACD,IAAI,kBAAkB,qDAA+C;IACrE,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAGzG,MAAM,IAAI,cAAc;IAGxB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI;IAM9B,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,MAAM;IASR,MAAM;;;;;;;;;;IAyBN,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,gBAAgB,GAAG,KAAK,CAAC;IAG/E,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAGzE,GAAG,CAAC,KAAK,EAAE,gBAAgB;IAU1B,SAAS,CAAC,KAAK,EAAE,gBAAgB;IAcxC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAK/B,SAAS,CAAC,SAAS,EAAE,MAAM;IAG3B,OAAO;CAGd"}
@@ -8,7 +8,8 @@ export function providerFailure(error) {
8
8
  };
9
9
  if (/login|sign.?in|authenticat|oauth|unauthorized|token.*expir|subscription.*auth/i.test(message))
10
10
  return { auth: 'login_required', allowance: 'unknown', problem: 'login' };
11
- return { auth: 'unknown', allowance: 'unknown', problem: 'unavailable' };
11
+ // A failed thread, command, model, or workspace says nothing about account readiness.
12
+ return undefined;
12
13
  }
13
14
  /** Observes the same adapter used by interactive and scheduled work. No probe inference. */
14
15
  export class HealthAwareExecutor {
@@ -23,6 +24,10 @@ export class HealthAwareExecutor {
23
24
  get name() {
24
25
  return this.executor.name;
25
26
  }
27
+ get recoveryCapability() { return this.executor.recoveryCapability; }
28
+ inspect(ref, options) {
29
+ return this.executor.inspect?.(ref, options) ?? Promise.resolve({ status: 'unsupported', reason: 'Provider history inspection is unavailable.' });
30
+ }
26
31
  health() {
27
32
  return { ...this.state };
28
33
  }
@@ -39,13 +44,17 @@ export class HealthAwareExecutor {
39
44
  }
40
45
  failed(error, signal) {
41
46
  if (!signal?.aborted &&
42
- !(error instanceof Error && error.name === 'AbortError'))
43
- this.update(providerFailure(error));
47
+ !(error instanceof Error && error.name === 'AbortError')) {
48
+ const failure = providerFailure(error);
49
+ if (failure)
50
+ this.update(failure);
51
+ }
44
52
  }
45
53
  async models() {
46
54
  if (this.check)
47
55
  return this.check;
48
- this.update({ ...this.state, auth: 'checking' });
56
+ if (this.state.auth !== 'authenticated')
57
+ this.update({ ...this.state, auth: 'checking' });
49
58
  this.check = (async () => {
50
59
  try {
51
60
  if (!this.executor.models)
@@ -57,7 +66,11 @@ export class HealthAwareExecutor {
57
66
  return models;
58
67
  }
59
68
  catch (error) {
60
- this.failed(error);
69
+ const failure = providerFailure(error);
70
+ if (failure)
71
+ this.update(failure);
72
+ else if (this.state.auth !== 'authenticated')
73
+ this.update({ auth: 'unknown', allowance: 'unknown', problem: 'unavailable' });
61
74
  throw error;
62
75
  }
63
76
  finally {
@@ -69,6 +82,9 @@ export class HealthAwareExecutor {
69
82
  async commands(input) {
70
83
  return (await this.executor.commands?.(input)) ?? [];
71
84
  }
85
+ withOwnership(input, action) {
86
+ return this.executor.withOwnership ? this.executor.withOwnership(input, action) : action();
87
+ }
72
88
  async run(input) {
73
89
  try {
74
90
  const result = await this.executor.run(input);
@@ -2,6 +2,7 @@ import type { ExecutorRunInput } from './types.js';
2
2
  export declare function abortError(): Error;
3
3
  /** Request-scoped ownership. Control calls never wait behind the work queue. */
4
4
  export declare class LiveTurns {
5
+ private disposed;
5
6
  private turns;
6
7
  open(input: ExecutorRunInput, steer: (text: string) => Promise<void>): {
7
8
  controller: AbortController;
@@ -10,6 +11,6 @@ export declare class LiveTurns {
10
11
  };
11
12
  steer(id: string, text: string): Promise<void>;
12
13
  interrupt(id: string): boolean;
13
- dispose(): void;
14
+ dispose(): Promise<void>;
14
15
  }
15
16
  //# sourceMappingURL=liveTurns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"liveTurns.d.ts","sourceRoot":"","sources":["../../src/executor/liveTurns.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,UAAU,IAAI,KAAK,CAIlC;AAED,gFAAgF;AAChF,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAGT;IAEJ,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;;;;;IA6B9D,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYpD,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAO9B,OAAO,IAAI,IAAI;CAIhB"}
1
+ {"version":3,"file":"liveTurns.d.ts","sourceRoot":"","sources":["../../src/executor/liveTurns.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,UAAU,IAAI,KAAK,CAIlC;AAED,gFAAgF;AAChF,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAGT;IAEJ,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;;;;;IAiC9D,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYpD,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAOxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAM/B"}
@@ -7,8 +7,11 @@ export function abortError() {
7
7
  }
8
8
  /** Request-scoped ownership. Control calls never wait behind the work queue. */
9
9
  export class LiveTurns {
10
+ disposed = false;
10
11
  turns = new Map();
11
12
  open(input, steer) {
13
+ if (this.disposed)
14
+ throw new Error('The provider is shutting down.');
12
15
  const id = input.requestId ?? randomUUID();
13
16
  if (id && this.turns.has(id))
14
17
  throw new Error('This request is already running.');
@@ -23,8 +26,9 @@ export class LiveTurns {
23
26
  timedOut = true;
24
27
  abort();
25
28
  }, input.timeoutMs ?? 120_000);
26
- if (id)
27
- this.turns.set(id, { abort, steer });
29
+ let settle;
30
+ const settled = new Promise((resolve) => { settle = resolve; });
31
+ this.turns.set(id, { abort, steer, settled });
28
32
  return {
29
33
  controller,
30
34
  check: () => {
@@ -39,6 +43,7 @@ export class LiveTurns {
39
43
  if (id)
40
44
  this.turns.delete(id);
41
45
  abort();
46
+ settle();
42
47
  },
43
48
  };
44
49
  }
@@ -59,9 +64,11 @@ export class LiveTurns {
59
64
  turn.abort();
60
65
  return true;
61
66
  }
62
- dispose() {
63
- for (const turn of this.turns.values())
67
+ async dispose() {
68
+ this.disposed = true;
69
+ const active = [...this.turns.values()];
70
+ for (const turn of active)
64
71
  turn.abort();
65
- this.turns.clear();
72
+ await Promise.all(active.map((turn) => turn.settled));
66
73
  }
67
74
  }
@@ -0,0 +1,40 @@
1
+ import type { AgentExecutor, ExecutorRunInput, ProviderRunRef, ProviderInspection } from './types.js';
2
+ /** Shared across providers and callers, including scheduled and local chat work. */
3
+ export declare class ExecutionOwnership {
4
+ private context;
5
+ run<T>(keys: string[], action: () => Promise<T>, signal?: AbortSignal): Promise<T>;
6
+ private owners;
7
+ acquire(keys: string[], signal?: AbortSignal): Promise<() => void>;
8
+ }
9
+ export declare class OwnedExecutor implements AgentExecutor {
10
+ private readonly executor;
11
+ private readonly provider;
12
+ private readonly ownership;
13
+ constructor(executor: AgentExecutor, provider: string, ownership: ExecutionOwnership);
14
+ get name(): string;
15
+ get strictResume(): boolean | undefined;
16
+ get recoveryCapability(): "native-turn" | "completion-receipt" | undefined;
17
+ inspect(ref: ProviderRunRef, options?: {
18
+ cwd?: string;
19
+ timeoutMs?: number;
20
+ }): Promise<ProviderInspection>;
21
+ private keys;
22
+ withOwnership<T>(input: ExecutorRunInput, action: () => Promise<T>): Promise<T>;
23
+ run(input: ExecutorRunInput): Promise<import("./types.js").ExecutorResult>;
24
+ runStream(input: ExecutorRunInput): AsyncGenerator<import("./types.js").ExecutorStreamEvent, void, any>;
25
+ models(): Promise<{
26
+ id: string;
27
+ label: string;
28
+ efforts: string[];
29
+ resolvedId?: string | undefined;
30
+ description?: string | undefined;
31
+ isDefault?: boolean | undefined;
32
+ defaultEffort?: string | undefined;
33
+ upgrade?: string | undefined;
34
+ }[]>;
35
+ commands(input?: Pick<ExecutorRunInput, 'cwd' | 'permissionMode' | 'mcp'>): Promise<import("@lucidity/shared").AgentCommandOption[]>;
36
+ steer(id: string, text: string): Promise<void>;
37
+ interrupt(id: string): Promise<boolean>;
38
+ dispose(): Promise<void>;
39
+ }
40
+ //# sourceMappingURL=ownership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/executor/ownership.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGtG,oFAAoF;AACpF,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,C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,EAAE,EAAE,MAAM;IACd,OAAO;CACd"}
@@ -0,0 +1,106 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ import { realpathSync } from 'node:fs';
3
+ import { resolve } from 'node:path';
4
+ import { abortError } from './liveTurns.js';
5
+ /** Shared across providers and callers, including scheduled and local chat work. */
6
+ export class ExecutionOwnership {
7
+ context = new AsyncLocalStorage();
8
+ async run(keys, action, signal) {
9
+ const held = this.context.getStore() ?? new Set();
10
+ const release = await this.acquire(keys, signal);
11
+ try {
12
+ return await this.context.run(new Set([...held, ...keys]), action);
13
+ }
14
+ finally {
15
+ release();
16
+ }
17
+ }
18
+ owners = new Map();
19
+ async acquire(keys, signal) {
20
+ keys = [...new Set(keys)].filter((key) => !this.context.getStore()?.has(key));
21
+ for (;;) {
22
+ if (signal?.aborted)
23
+ throw abortError();
24
+ const blocked = keys.flatMap((key) => this.owners.get(key) ?? []);
25
+ if (!blocked.length)
26
+ break;
27
+ await new Promise((resolve, reject) => {
28
+ const abort = () => reject(abortError());
29
+ signal?.addEventListener('abort', abort, { once: true });
30
+ Promise.race(blocked).then(resolve, reject).finally(() => signal?.removeEventListener('abort', abort));
31
+ });
32
+ }
33
+ let release;
34
+ const settled = new Promise((resolve) => { release = resolve; });
35
+ for (const key of keys)
36
+ this.owners.set(key, settled);
37
+ return () => {
38
+ for (const key of keys)
39
+ if (this.owners.get(key) === settled)
40
+ this.owners.delete(key);
41
+ release();
42
+ };
43
+ }
44
+ }
45
+ function workspaceKey(path) {
46
+ try {
47
+ return realpathSync(path);
48
+ }
49
+ catch {
50
+ return resolve(path);
51
+ }
52
+ }
53
+ export class OwnedExecutor {
54
+ executor;
55
+ provider;
56
+ ownership;
57
+ constructor(executor, provider, ownership) {
58
+ this.executor = executor;
59
+ this.provider = provider;
60
+ this.ownership = ownership;
61
+ }
62
+ get name() { return this.executor.name; }
63
+ get strictResume() { return this.executor.strictResume; }
64
+ get recoveryCapability() { return this.executor.recoveryCapability; }
65
+ inspect(ref, options = {}) {
66
+ return this.ownership.run([
67
+ ...(ref.sessionId ? [`session:${this.provider}:${ref.sessionId}`] : []),
68
+ ...(options.cwd ? [`workspace:${workspaceKey(options.cwd)}`] : []),
69
+ ], () => this.executor.inspect?.(ref, options) ?? Promise.resolve({ status: 'unsupported', reason: 'Provider history inspection is unavailable.' }));
70
+ }
71
+ keys(input) {
72
+ const session = input.resume ?? input.sessionId;
73
+ return [
74
+ ...(session ? [`session:${this.provider}:${session}`] : []),
75
+ ...(input.cwd && input.permissionMode && !input.noTools ? [`workspace:${workspaceKey(input.cwd)}`] : []),
76
+ ];
77
+ }
78
+ withOwnership(input, action) {
79
+ return this.ownership.run(this.keys(input), action, input.signal);
80
+ }
81
+ async run(input) {
82
+ const release = await this.ownership.acquire(this.keys(input), input.signal);
83
+ try {
84
+ return await this.executor.run(input);
85
+ }
86
+ finally {
87
+ release();
88
+ }
89
+ }
90
+ async *runStream(input) {
91
+ const release = await this.ownership.acquire(this.keys(input), input.signal);
92
+ try {
93
+ if (!this.executor.runStream)
94
+ throw new Error('This provider cannot stream.');
95
+ yield* this.executor.runStream(input);
96
+ }
97
+ finally {
98
+ release();
99
+ }
100
+ }
101
+ models() { return this.executor.models?.() ?? Promise.resolve([]); }
102
+ commands(input) { return this.executor.commands?.(input) ?? Promise.resolve([]); }
103
+ steer(id, text) { return this.executor.steer?.(id, text) ?? Promise.reject(new Error('Steering is unavailable.')); }
104
+ interrupt(id) { return this.executor.interrupt?.(id) ?? Promise.resolve(false); }
105
+ async dispose() { await this.executor.dispose?.(); }
106
+ }
@@ -19,6 +19,7 @@ export declare class ProviderRouter implements AgentExecutor {
19
19
  effort?: string;
20
20
  });
21
21
  private resolve;
22
+ withOwnership<T>(input: ExecutorRunInput, action: () => Promise<T>): Promise<T>;
22
23
  run(input: ExecutorRunInput): Promise<{
23
24
  sessionId: string | undefined;
24
25
  text: string;
@@ -1 +1 @@
1
- {"version":3,"file":"providerRouter.d.ts","sourceRoot":"","sources":["../../src/executor/providerRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAGpB,UAAU,UAAU;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAkBvD;AAED,sFAAsF;AACtF,qBAAa,cAAe,YAAW,aAAa;IAIhD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,YAAY,QAAQ;gBAEV,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,EAC/C,QAAQ,EAAE,MAAM;QAC/B,QAAQ,EAAE,aAAa,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAGH,OAAO,CAAC,OAAO;IA0BT,GAAG,CAAC,KAAK,EAAE,gBAAgB;;;;;IAgB1B,SAAS,CACd,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAAC,mBAAmB,CAAC;CAmBtC"}
1
+ {"version":3,"file":"providerRouter.d.ts","sourceRoot":"","sources":["../../src/executor/providerRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAGpB,UAAU,UAAU;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAkBvD;AAED,sFAAsF;AACtF,qBAAa,cAAe,YAAW,aAAa;IAIhD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,YAAY,QAAQ;gBAEV,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,EAC/C,QAAQ,EAAE,MAAM;QAC/B,QAAQ,EAAE,aAAa,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAGH,OAAO,CAAC,OAAO;IA0Bf,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAMzE,GAAG,CAAC,KAAK,EAAE,gBAAgB;;;;;IAgB1B,SAAS,CACd,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAAC,mBAAmB,CAAC;CAmBtC"}
@@ -54,6 +54,11 @@ export class ProviderRouter {
54
54
  },
55
55
  };
56
56
  }
57
+ withOwnership(input, action) {
58
+ const r = this.resolve(input);
59
+ const executor = this.providers[r.provider];
60
+ return executor.withOwnership ? executor.withOwnership(r.input, action) : action();
61
+ }
57
62
  async run(input) {
58
63
  const r = this.resolve(input);
59
64
  const result = await this.providers[r.provider].run(r.input);
@@ -13,9 +13,25 @@ export interface ExecutorApproval {
13
13
  cwd?: string;
14
14
  }
15
15
  export type ExecutorModel = import('@lucidity/shared').AgentModelOption;
16
+ export interface ProviderRunRef {
17
+ sessionId?: string;
18
+ turnId?: string;
19
+ pid?: number;
20
+ /** Commands do not necessarily have a native inference turn. */
21
+ inspectionDisabled?: boolean;
22
+ }
23
+ export type ProviderInspection = {
24
+ status: 'completed';
25
+ result: ExecutorResult;
26
+ } | {
27
+ status: 'unknown' | 'unsupported';
28
+ reason: string;
29
+ };
16
30
  export interface ExecutorRunInput {
17
31
  /** Lucidity request identity, used for live controls; unrelated to provider session IDs. */
18
32
  requestId?: string;
33
+ /** Synchronous durable write. A failure must prevent further provider work. */
34
+ onRecovery?: (ref: ProviderRunRef) => void;
19
35
  /** Interactive callers can provide a permission surface. Absent means deny. */
20
36
  onApproval?: (approval: ExecutorApproval) => Promise<boolean>;
21
37
  /** The main user prompt. */
@@ -57,6 +73,8 @@ export interface ExecutorRunInput {
57
73
  provider?: AgentProvider;
58
74
  /** Working directory for the run (the target repo for a coding turn, M7). */
59
75
  cwd?: string;
76
+ /** Extra variables for the agent's process, on top of the sanitised daemon environment. */
77
+ env?: Record<string, string>;
60
78
  /** Compatibility policy names; each adapter maps them to native permissions. */
61
79
  permissionMode?: 'default' | 'acceptEdits' | 'plan' | 'auto' | 'bypassPermissions';
62
80
  /** Tools to pre-approve (`--allowedTools`), the static first filter before auto mode. */
@@ -75,6 +93,8 @@ export type ExecutorStreamEvent = {
75
93
  type: 'tool_call';
76
94
  name: string;
77
95
  phase: 'start' | 'end';
96
+ itemId?: string;
97
+ outcome?: string;
78
98
  } | {
79
99
  type: 'done';
80
100
  text: string;
@@ -95,6 +115,11 @@ export interface AgentExecutor {
95
115
  readonly name: string;
96
116
  /** Strict providers report resume failures instead of silently starting memoryless. */
97
117
  readonly strictResume?: boolean;
118
+ readonly recoveryCapability?: 'native-turn' | 'completion-receipt';
119
+ inspect?(ref: ProviderRunRef, options?: {
120
+ cwd?: string;
121
+ timeoutMs?: number;
122
+ }): Promise<ProviderInspection>;
98
123
  /** Resolves once input is accepted by the provider transport. */
99
124
  steer?(requestId: string, text: string): Promise<void>;
100
125
  /** Interrupt a turn owned by this adapter, including conductor workers. */
@@ -103,6 +128,8 @@ export interface AgentExecutor {
103
128
  /** Commands implemented by this adapter and available in the provider runtime. */
104
129
  commands?(input?: Pick<ExecutorRunInput, 'cwd' | 'permissionMode' | 'mcp'>): Promise<import('@lucidity/shared').AgentCommandOption[]>;
105
130
  dispose?(): Promise<void>;
131
+ /** Hold the same session and workspace through preparation and result collection. */
132
+ withOwnership?<T>(input: ExecutorRunInput, action: () => Promise<T>): Promise<T>;
106
133
  run(input: ExecutorRunInput): Promise<ExecutorResult>;
107
134
  /** Optional token-streaming variant for interactive chat. */
108
135
  runStream?(input: ExecutorRunInput): AsyncIterable<ExecutorStreamEvent>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,MAAM,aAAa,GAAG,OAAO,kBAAkB,EAAE,gBAAgB,CAAC;AAExE,MAAM,WAAW,gBAAgB;IAC/B,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9D,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,MAAM,CAAC,EAAE,aAAa,EAAE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AAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC1E;;;;;;OAMG;IACH,KAAK,CAAC,EAAE;QAAE,cAAc,EAAE,MAAM,GAAG,mBAAmB,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACvE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CA6LvE"}
@@ -49,6 +49,7 @@ export function createLucidHarness(deps) {
49
49
  const result = await deps.planningExecutor.run({
50
50
  ...buildDayPlanningPrompt(input.prompt, input.dayPlan),
51
51
  requestId: input.requestId, noTools: true, effort: 'high',
52
+ provider: input.provider,
52
53
  timeoutMs: 120_000, signal: input.signal,
53
54
  });
54
55
  return { text: JSON.stringify(parseDayPlanningResult(result.text, input.prompt, input.dayPlan)), costUsd: result.costUsd };