@opencorelabs/lucidity 0.3.0 → 0.7.0

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 (527) hide show
  1. package/README.md +18 -3
  2. package/dist/assets/speech/licenses/FluidAudio/LICENSE +201 -0
  3. package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/fastcluster-LICENSE.md +11 -0
  4. package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/vbx-LICENSE.md +201 -0
  5. package/dist/assets/speech/lucidity-speech +0 -0
  6. package/dist/automations/agent.d.ts +16 -0
  7. package/dist/automations/agent.d.ts.map +1 -0
  8. package/dist/automations/agent.js +196 -0
  9. package/dist/automations/cli.d.ts +4 -0
  10. package/dist/automations/cli.d.ts.map +1 -0
  11. package/dist/automations/cli.js +44 -0
  12. package/dist/automations/connections.d.ts +11 -0
  13. package/dist/automations/connections.d.ts.map +1 -0
  14. package/dist/automations/connections.js +74 -0
  15. package/dist/automations/designer.d.ts +39 -0
  16. package/dist/automations/designer.d.ts.map +1 -0
  17. package/dist/automations/designer.js +450 -0
  18. package/dist/automations/history.d.ts +4 -0
  19. package/dist/automations/history.d.ts.map +1 -0
  20. package/dist/automations/history.js +57 -0
  21. package/dist/automations/learning.d.ts +19 -0
  22. package/dist/automations/learning.d.ts.map +1 -0
  23. package/dist/automations/learning.js +121 -0
  24. package/dist/automations/pinterest.d.ts +21 -0
  25. package/dist/automations/pinterest.d.ts.map +1 -0
  26. package/dist/automations/pinterest.js +113 -0
  27. package/dist/automations/service.d.ts +42 -0
  28. package/dist/automations/service.d.ts.map +1 -0
  29. package/dist/automations/service.js +406 -0
  30. package/dist/automations/setup.d.ts +3 -0
  31. package/dist/automations/setup.d.ts.map +1 -0
  32. package/dist/automations/setup.js +48 -0
  33. package/dist/automations/skill.d.ts +3 -0
  34. package/dist/automations/skill.d.ts.map +1 -0
  35. package/dist/automations/skill.js +29 -0
  36. package/dist/automations/store.d.ts +13 -0
  37. package/dist/automations/store.d.ts.map +1 -0
  38. package/dist/automations/store.js +46 -0
  39. package/dist/chat/server.d.ts +2 -0
  40. package/dist/chat/server.d.ts.map +1 -1
  41. package/dist/chat/server.js +46 -2
  42. package/dist/coding/commandContext.d.ts +6 -0
  43. package/dist/coding/commandContext.d.ts.map +1 -0
  44. package/dist/coding/commandContext.js +20 -0
  45. package/dist/coding/runCodeTurn.d.ts +12 -2
  46. package/dist/coding/runCodeTurn.d.ts.map +1 -1
  47. package/dist/coding/runCodeTurn.js +49 -19
  48. package/dist/coding/worktree.d.ts +3 -4
  49. package/dist/coding/worktree.d.ts.map +1 -1
  50. package/dist/coding/worktree.js +3 -4
  51. package/dist/config.d.ts +4 -0
  52. package/dist/config.d.ts.map +1 -1
  53. package/dist/config.js +20 -3
  54. package/dist/decisions/cli.d.ts +2 -0
  55. package/dist/decisions/cli.d.ts.map +1 -0
  56. package/dist/decisions/cli.js +106 -0
  57. package/dist/decisions/client.d.ts +20 -0
  58. package/dist/decisions/client.d.ts.map +1 -0
  59. package/dist/decisions/client.js +41 -0
  60. package/dist/handoff.d.ts +11 -0
  61. package/dist/handoff.d.ts.map +1 -0
  62. package/dist/handoff.js +21 -0
  63. package/dist/index.js +185 -40
  64. package/dist/jobs/briefing.js +1 -1
  65. package/dist/jobs/extraction.d.ts.map +1 -1
  66. package/dist/jobs/extraction.js +112 -22
  67. package/dist/jobs/fastModeReview.d.ts +39 -0
  68. package/dist/jobs/fastModeReview.d.ts.map +1 -0
  69. package/dist/jobs/fastModeReview.js +192 -0
  70. package/dist/jobs/voiceReview.d.ts +24 -0
  71. package/dist/jobs/voiceReview.d.ts.map +1 -0
  72. package/dist/jobs/voiceReview.js +128 -0
  73. package/dist/mcp/clients.d.ts +5 -0
  74. package/dist/mcp/clients.d.ts.map +1 -1
  75. package/dist/mcp/clients.js +1 -1
  76. package/dist/mcp/config.d.ts +3 -1
  77. package/dist/mcp/config.d.ts.map +1 -1
  78. package/dist/mcp/config.js +48 -6
  79. package/dist/mcp/paired.js +1 -0
  80. package/dist/notesContext.d.ts.map +1 -1
  81. package/dist/notesContext.js +3 -2
  82. package/dist/room/client.d.ts +20 -7
  83. package/dist/room/client.d.ts.map +1 -1
  84. package/dist/room/client.js +266 -47
  85. package/dist/room/computer.d.ts.map +1 -1
  86. package/dist/room/computer.js +9 -0
  87. package/dist/room/context.d.ts +3 -2
  88. package/dist/room/context.d.ts.map +1 -1
  89. package/dist/room/context.js +10 -3
  90. package/dist/room/turnQueue.d.ts +40 -0
  91. package/dist/room/turnQueue.d.ts.map +1 -0
  92. package/dist/room/turnQueue.js +301 -0
  93. package/dist/skills/lucidity-automations/SKILL.md +54 -0
  94. package/dist/speech/captures.d.ts +30 -0
  95. package/dist/speech/captures.d.ts.map +1 -0
  96. package/dist/speech/captures.js +209 -0
  97. package/dist/speech/fluidAudio.d.ts +28 -0
  98. package/dist/speech/fluidAudio.d.ts.map +1 -0
  99. package/dist/speech/fluidAudio.js +182 -0
  100. package/dist/speech/service.d.ts +14 -0
  101. package/dist/speech/service.d.ts.map +1 -0
  102. package/dist/speech/service.js +88 -0
  103. package/dist/speech/types.d.ts +19 -0
  104. package/dist/speech/types.d.ts.map +1 -0
  105. package/dist/speech/types.js +1 -0
  106. package/dist/turnLog.d.ts +1 -0
  107. package/dist/turnLog.d.ts.map +1 -1
  108. package/dist/turnLog.js +3 -0
  109. package/native/speech/Package.resolved +15 -0
  110. package/native/speech/Package.swift +16 -0
  111. package/native/speech/Sources/lucidity-speech/Speech.swift +81 -0
  112. package/package.json +6 -2
  113. package/src/automations/agent.ts +239 -0
  114. package/src/automations/cli.ts +52 -0
  115. package/src/automations/connections.ts +83 -0
  116. package/src/automations/designer.ts +594 -0
  117. package/src/automations/history.ts +59 -0
  118. package/src/automations/learning.ts +180 -0
  119. package/src/automations/pinterest.ts +146 -0
  120. package/src/automations/service.ts +505 -0
  121. package/src/automations/setup.ts +71 -0
  122. package/src/automations/skill.ts +40 -0
  123. package/src/automations/store.ts +63 -0
  124. package/src/chat/server.ts +62 -3
  125. package/src/coding/commandContext.ts +29 -0
  126. package/src/coding/runCodeTurn.ts +65 -21
  127. package/src/coding/worktree.ts +3 -4
  128. package/src/config.ts +29 -2
  129. package/src/decisions/cli.ts +136 -0
  130. package/src/decisions/client.ts +62 -0
  131. package/src/handoff.ts +28 -0
  132. package/src/index.ts +202 -67
  133. package/src/jobs/briefing.ts +1 -1
  134. package/src/jobs/extraction.ts +157 -32
  135. package/src/jobs/fastModeReview.ts +221 -0
  136. package/src/jobs/voiceReview.ts +156 -0
  137. package/src/mcp/clients.ts +1 -1
  138. package/src/mcp/config.ts +56 -6
  139. package/src/mcp/paired.ts +1 -0
  140. package/src/notesContext.ts +3 -2
  141. package/src/room/client.ts +320 -54
  142. package/src/room/computer.ts +9 -0
  143. package/src/room/context.ts +12 -3
  144. package/src/room/turnQueue.ts +358 -0
  145. package/src/speech/captures.ts +265 -0
  146. package/src/speech/fluidAudio.ts +242 -0
  147. package/src/speech/service.ts +108 -0
  148. package/src/speech/types.ts +13 -0
  149. package/src/turnLog.ts +4 -0
  150. package/vendor/decisions/LICENSE +662 -0
  151. package/vendor/decisions/dist/capture.d.ts +79 -0
  152. package/vendor/decisions/dist/capture.js +183 -0
  153. package/vendor/decisions/dist/command.d.ts +202 -0
  154. package/vendor/decisions/dist/command.js +750 -0
  155. package/vendor/decisions/dist/dayPlan.d.ts +9 -0
  156. package/vendor/decisions/dist/dayPlan.js +82 -0
  157. package/vendor/decisions/dist/gate.d.ts +12 -0
  158. package/vendor/decisions/dist/gate.js +18 -0
  159. package/vendor/decisions/dist/index.d.ts +6 -0
  160. package/vendor/decisions/dist/index.js +6 -0
  161. package/vendor/decisions/dist/jev.d.ts +15 -0
  162. package/vendor/decisions/dist/jev.js +244 -0
  163. package/vendor/decisions/dist/types.d.ts +67 -0
  164. package/vendor/decisions/dist/types.js +1 -0
  165. package/vendor/decisions/package.json +22 -0
  166. package/vendor/decisions/src/capture.ts +199 -0
  167. package/vendor/decisions/src/command.ts +836 -0
  168. package/vendor/decisions/src/dayPlan.ts +80 -0
  169. package/vendor/decisions/src/gate.ts +32 -0
  170. package/vendor/decisions/src/index.ts +6 -0
  171. package/vendor/decisions/src/jev.ts +295 -0
  172. package/vendor/decisions/src/types.ts +79 -0
  173. package/vendor/mcp-server/README.md +6 -1
  174. package/vendor/mcp-server/dist/client.d.ts +1 -0
  175. package/vendor/mcp-server/dist/client.d.ts.map +1 -1
  176. package/vendor/mcp-server/dist/client.js +8 -0
  177. package/vendor/mcp-server/dist/commentProvider.d.ts +3 -0
  178. package/vendor/mcp-server/dist/commentProvider.d.ts.map +1 -0
  179. package/vendor/mcp-server/dist/commentProvider.js +10 -0
  180. package/vendor/mcp-server/dist/index.js +21 -6
  181. package/vendor/mcp-server/dist/tools/automations.d.ts +6 -0
  182. package/vendor/mcp-server/dist/tools/automations.d.ts.map +1 -0
  183. package/vendor/mcp-server/dist/tools/automations.js +163 -0
  184. package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts +52 -0
  185. package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts.map +1 -0
  186. package/vendor/mcp-server/dist/tools/commandEventFormat.js +83 -0
  187. package/vendor/mcp-server/dist/tools/commandEvents.d.ts +3 -0
  188. package/vendor/mcp-server/dist/tools/commandEvents.d.ts.map +1 -0
  189. package/vendor/mcp-server/dist/tools/commandEvents.js +21 -0
  190. package/vendor/mcp-server/dist/tools/comments.d.ts.map +1 -1
  191. package/vendor/mcp-server/dist/tools/comments.js +25 -4
  192. package/vendor/mcp-server/dist/tools/index.d.ts +2 -0
  193. package/vendor/mcp-server/dist/tools/index.d.ts.map +1 -1
  194. package/vendor/mcp-server/dist/tools/index.js +2 -0
  195. package/vendor/mcp-server/dist/tools/journal.d.ts +3 -0
  196. package/vendor/mcp-server/dist/tools/journal.d.ts.map +1 -0
  197. package/vendor/mcp-server/dist/tools/journal.js +131 -0
  198. package/vendor/mcp-server/dist/tools/taskActivity.d.ts +3 -0
  199. package/vendor/mcp-server/dist/tools/taskActivity.d.ts.map +1 -0
  200. package/vendor/mcp-server/dist/tools/taskActivity.js +32 -0
  201. package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts +3 -0
  202. package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts.map +1 -0
  203. package/vendor/mcp-server/dist/tools/taskOccurrences.js +12 -0
  204. package/vendor/mcp-server/dist/tools/taskTrash.d.ts +3 -0
  205. package/vendor/mcp-server/dist/tools/taskTrash.d.ts.map +1 -0
  206. package/vendor/mcp-server/dist/tools/taskTrash.js +21 -0
  207. package/vendor/mcp-server/dist/tools/tasks.d.ts.map +1 -1
  208. package/vendor/mcp-server/dist/tools/tasks.js +67 -27
  209. package/vendor/mcp-server/package.json +5 -1
  210. package/vendor/mcp-server/src/client.ts +10 -0
  211. package/vendor/mcp-server/src/commentProvider.ts +9 -0
  212. package/vendor/mcp-server/src/index.ts +20 -6
  213. package/vendor/mcp-server/src/tools/automations.ts +199 -0
  214. package/vendor/mcp-server/src/tools/commandEventFormat.ts +108 -0
  215. package/vendor/mcp-server/src/tools/commandEvents.ts +27 -0
  216. package/vendor/mcp-server/src/tools/comments.ts +24 -3
  217. package/vendor/mcp-server/src/tools/index.ts +2 -0
  218. package/vendor/mcp-server/src/tools/journal.ts +168 -0
  219. package/vendor/mcp-server/src/tools/taskActivity.ts +55 -0
  220. package/vendor/mcp-server/src/tools/taskOccurrences.ts +26 -0
  221. package/vendor/mcp-server/src/tools/taskTrash.ts +23 -0
  222. package/vendor/mcp-server/src/tools/tasks.ts +66 -30
  223. package/vendor/notes/dist/index.d.ts +2 -0
  224. package/vendor/notes/dist/index.d.ts.map +1 -1
  225. package/vendor/notes/dist/index.js +2 -0
  226. package/vendor/notes/dist/journal-backend.d.ts +4 -0
  227. package/vendor/notes/dist/journal-backend.d.ts.map +1 -0
  228. package/vendor/notes/dist/journal-backend.js +33 -0
  229. package/vendor/notes/dist/journal.d.ts +7 -0
  230. package/vendor/notes/dist/journal.d.ts.map +1 -0
  231. package/vendor/notes/dist/journal.js +173 -0
  232. package/vendor/notes/dist/vault.d.ts.map +1 -1
  233. package/vendor/notes/dist/vault.js +6 -1
  234. package/vendor/notes/src/index.ts +2 -0
  235. package/vendor/notes/src/journal-backend.ts +53 -0
  236. package/vendor/notes/src/journal.ts +194 -0
  237. package/vendor/notes/src/vault.ts +9 -1
  238. package/vendor/runtime/README.md +4 -0
  239. package/vendor/runtime/dist/executor/claudeAgent.d.ts +2 -0
  240. package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
  241. package/vendor/runtime/dist/executor/claudeAgent.js +117 -8
  242. package/vendor/runtime/dist/executor/claudeCode.d.ts.map +1 -1
  243. package/vendor/runtime/dist/executor/claudeCode.js +8 -4
  244. package/vendor/runtime/dist/executor/codex.d.ts +2 -0
  245. package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
  246. package/vendor/runtime/dist/executor/codex.js +214 -11
  247. package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts +2 -0
  248. package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts.map +1 -0
  249. package/vendor/runtime/dist/executor/codexProtocol/PlanType.js +2 -0
  250. package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.d.ts +6 -0
  251. package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.d.ts.map +1 -0
  252. package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.js +2 -0
  253. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts +26 -0
  254. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts.map +1 -0
  255. package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.js +2 -0
  256. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.d.ts +2 -0
  257. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.d.ts.map +1 -0
  258. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.js +2 -0
  259. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.d.ts +27 -0
  260. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.d.ts.map +1 -0
  261. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.js +2 -0
  262. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.d.ts +2 -0
  263. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.d.ts.map +1 -0
  264. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.js +2 -0
  265. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.d.ts +13 -0
  266. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.d.ts.map +1 -0
  267. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.js +2 -0
  268. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.d.ts +2 -0
  269. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.d.ts.map +1 -0
  270. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.js +2 -0
  271. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts +20 -0
  272. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts.map +1 -0
  273. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.js +2 -0
  274. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.d.ts +6 -0
  275. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.d.ts.map +1 -0
  276. package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.js +2 -0
  277. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.d.ts +2 -0
  278. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.d.ts.map +1 -0
  279. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.js +2 -0
  280. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts +12 -0
  281. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts.map +1 -0
  282. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.js +2 -0
  283. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.d.ts +17 -0
  284. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.d.ts.map +1 -0
  285. package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.js +2 -0
  286. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.d.ts +5 -0
  287. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.d.ts.map +1 -0
  288. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.js +2 -0
  289. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.d.ts +5 -0
  290. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.d.ts.map +1 -0
  291. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.js +2 -0
  292. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.d.ts +18 -0
  293. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.d.ts.map +1 -0
  294. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.js +2 -0
  295. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.d.ts +22 -0
  296. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.d.ts.map +1 -0
  297. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.js +2 -0
  298. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.d.ts +2 -0
  299. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.d.ts.map +1 -0
  300. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.js +2 -0
  301. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.d.ts +9 -0
  302. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.d.ts.map +1 -0
  303. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.js +2 -0
  304. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.d.ts +8 -0
  305. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.d.ts.map +1 -0
  306. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.js +2 -0
  307. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.d.ts +5 -0
  308. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.d.ts.map +1 -0
  309. package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.js +2 -0
  310. package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.d.ts +7 -0
  311. package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.d.ts.map +1 -0
  312. package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.js +2 -0
  313. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.d.ts +5 -0
  314. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.d.ts.map +1 -0
  315. package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.js +2 -0
  316. package/vendor/runtime/dist/executor/health.d.ts +1 -0
  317. package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
  318. package/vendor/runtime/dist/executor/health.js +3 -0
  319. package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
  320. package/vendor/runtime/dist/executor/liveTurns.js +3 -0
  321. package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
  322. package/vendor/runtime/dist/executor/providerRouter.js +2 -1
  323. package/vendor/runtime/dist/executor/types.d.ts +10 -0
  324. package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
  325. package/vendor/runtime/dist/harness/index.d.ts +2 -0
  326. package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
  327. package/vendor/runtime/dist/harness/index.js +46 -1
  328. package/vendor/runtime/dist/harness/types.d.ts +5 -1
  329. package/vendor/runtime/dist/harness/types.d.ts.map +1 -1
  330. package/vendor/runtime/dist/index.d.ts +2 -1
  331. package/vendor/runtime/dist/index.d.ts.map +1 -1
  332. package/vendor/runtime/dist/index.js +2 -0
  333. package/vendor/runtime/dist/journal/context.d.ts +18 -0
  334. package/vendor/runtime/dist/journal/context.d.ts.map +1 -1
  335. package/vendor/runtime/dist/journal/context.js +19 -5
  336. package/vendor/runtime/dist/prompts/briefing.d.ts +4 -7
  337. package/vendor/runtime/dist/prompts/briefing.d.ts.map +1 -1
  338. package/vendor/runtime/dist/prompts/briefing.js +61 -12
  339. package/vendor/runtime/dist/prompts/cardStatement.d.ts +7 -0
  340. package/vendor/runtime/dist/prompts/cardStatement.d.ts.map +1 -0
  341. package/vendor/runtime/dist/prompts/cardStatement.js +52 -0
  342. package/vendor/runtime/dist/prompts/chat.d.ts +1 -0
  343. package/vendor/runtime/dist/prompts/chat.d.ts.map +1 -1
  344. package/vendor/runtime/dist/prompts/chat.js +15 -1
  345. package/vendor/runtime/dist/prompts/dayPlanning.d.ts +44 -0
  346. package/vendor/runtime/dist/prompts/dayPlanning.d.ts.map +1 -0
  347. package/vendor/runtime/dist/prompts/dayPlanning.js +42 -0
  348. package/vendor/runtime/dist/prompts/projectCapture.d.ts +7 -0
  349. package/vendor/runtime/dist/prompts/projectCapture.d.ts.map +1 -0
  350. package/vendor/runtime/dist/prompts/projectCapture.js +31 -0
  351. package/vendor/runtime/src/executor/claudeAgent.ts +137 -7
  352. package/vendor/runtime/src/executor/claudeCode.ts +6 -4
  353. package/vendor/runtime/src/executor/codex.ts +281 -20
  354. package/vendor/runtime/src/executor/codexProtocol/PlanType.ts +5 -0
  355. package/vendor/runtime/src/executor/codexProtocol/v2/CreditsSnapshot.ts +5 -0
  356. package/vendor/runtime/src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts +25 -0
  357. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitReachedType.ts +5 -0
  358. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCredit.ts +27 -0
  359. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCreditStatus.ts +5 -0
  360. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCreditsSummary.ts +14 -0
  361. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetType.ts +5 -0
  362. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitSnapshot.ts +14 -0
  363. package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitWindow.ts +5 -0
  364. package/vendor/runtime/src/executor/codexProtocol/v2/ReviewDelivery.ts +5 -0
  365. package/vendor/runtime/src/executor/codexProtocol/v2/ReviewStartParams.ts +12 -0
  366. package/vendor/runtime/src/executor/codexProtocol/v2/ReviewTarget.ts +9 -0
  367. package/vendor/runtime/src/executor/codexProtocol/v2/SkillDependencies.ts +6 -0
  368. package/vendor/runtime/src/executor/codexProtocol/v2/SkillErrorInfo.ts +5 -0
  369. package/vendor/runtime/src/executor/codexProtocol/v2/SkillInterface.ts +14 -0
  370. package/vendor/runtime/src/executor/codexProtocol/v2/SkillMetadata.ts +17 -0
  371. package/vendor/runtime/src/executor/codexProtocol/v2/SkillScope.ts +5 -0
  372. package/vendor/runtime/src/executor/codexProtocol/v2/SkillToolDependency.ts +5 -0
  373. package/vendor/runtime/src/executor/codexProtocol/v2/SkillsListEntry.ts +7 -0
  374. package/vendor/runtime/src/executor/codexProtocol/v2/SkillsListResponse.ts +6 -0
  375. package/vendor/runtime/src/executor/codexProtocol/v2/SpendControlLimitSnapshot.ts +5 -0
  376. package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSetNameParams.ts +5 -0
  377. package/vendor/runtime/src/executor/health.ts +3 -0
  378. package/vendor/runtime/src/executor/liveTurns.ts +3 -0
  379. package/vendor/runtime/src/executor/providerRouter.ts +2 -1
  380. package/vendor/runtime/src/executor/types.ts +10 -0
  381. package/vendor/runtime/src/harness/index.ts +51 -6
  382. package/vendor/runtime/src/harness/types.ts +5 -1
  383. package/vendor/runtime/src/index.ts +4 -1
  384. package/vendor/runtime/src/journal/context.ts +40 -7
  385. package/vendor/runtime/src/prompts/briefing.ts +62 -17
  386. package/vendor/runtime/src/prompts/cardStatement.ts +64 -0
  387. package/vendor/runtime/src/prompts/chat.ts +25 -3
  388. package/vendor/runtime/src/prompts/dayPlanning.ts +46 -0
  389. package/vendor/runtime/src/prompts/projectCapture.ts +51 -0
  390. package/vendor/shared/dist/agentCommands.d.ts +22 -0
  391. package/vendor/shared/dist/agentCommands.d.ts.map +1 -0
  392. package/vendor/shared/dist/agentCommands.js +11 -0
  393. package/vendor/shared/dist/automationTemplates.d.ts +37 -0
  394. package/vendor/shared/dist/automationTemplates.d.ts.map +1 -0
  395. package/vendor/shared/dist/automationTemplates.js +48 -0
  396. package/vendor/shared/dist/automations.d.ts +1052 -0
  397. package/vendor/shared/dist/automations.d.ts.map +1 -0
  398. package/vendor/shared/dist/automations.js +300 -0
  399. package/vendor/shared/dist/cardStatement.d.ts +28 -0
  400. package/vendor/shared/dist/cardStatement.d.ts.map +1 -0
  401. package/vendor/shared/dist/cardStatement.js +37 -0
  402. package/vendor/shared/dist/cardStudio.d.ts +756 -0
  403. package/vendor/shared/dist/cardStudio.d.ts.map +1 -0
  404. package/vendor/shared/dist/cardStudio.js +297 -0
  405. package/vendor/shared/dist/commandLocal.d.ts +218 -0
  406. package/vendor/shared/dist/commandLocal.d.ts.map +1 -0
  407. package/vendor/shared/dist/commandLocal.js +664 -0
  408. package/vendor/shared/dist/commandText.d.ts +12 -0
  409. package/vendor/shared/dist/commandText.d.ts.map +1 -0
  410. package/vendor/shared/dist/commandText.js +21 -0
  411. package/vendor/shared/dist/commands.d.ts +1534 -0
  412. package/vendor/shared/dist/commands.d.ts.map +1 -0
  413. package/vendor/shared/dist/commands.js +233 -0
  414. package/vendor/shared/dist/computer.d.ts +9 -9
  415. package/vendor/shared/dist/computer.d.ts.map +1 -1
  416. package/vendor/shared/dist/computer.js +12 -2
  417. package/vendor/shared/dist/constants.d.ts +3 -3
  418. package/vendor/shared/dist/constants.d.ts.map +1 -1
  419. package/vendor/shared/dist/constants.js +9 -2
  420. package/vendor/shared/dist/dayPlan.d.ts +86 -0
  421. package/vendor/shared/dist/dayPlan.d.ts.map +1 -0
  422. package/vendor/shared/dist/dayPlan.js +46 -0
  423. package/vendor/shared/dist/dayPlanning.d.ts +139 -0
  424. package/vendor/shared/dist/dayPlanning.d.ts.map +1 -0
  425. package/vendor/shared/dist/dayPlanning.js +67 -0
  426. package/vendor/shared/dist/githubContributions.d.ts +93 -0
  427. package/vendor/shared/dist/githubContributions.d.ts.map +1 -0
  428. package/vendor/shared/dist/githubContributions.js +54 -0
  429. package/vendor/shared/dist/habitContributions.d.ts +26 -0
  430. package/vendor/shared/dist/habitContributions.d.ts.map +1 -0
  431. package/vendor/shared/dist/habitContributions.js +119 -0
  432. package/vendor/shared/dist/index.d.ts +28 -2
  433. package/vendor/shared/dist/index.d.ts.map +1 -1
  434. package/vendor/shared/dist/index.js +25 -2
  435. package/vendor/shared/dist/journal-migration.d.ts +29 -0
  436. package/vendor/shared/dist/journal-migration.d.ts.map +1 -0
  437. package/vendor/shared/dist/journal-migration.js +73 -0
  438. package/vendor/shared/dist/journal-vault.d.ts +414 -0
  439. package/vendor/shared/dist/journal-vault.d.ts.map +1 -0
  440. package/vendor/shared/dist/journal-vault.js +972 -0
  441. package/vendor/shared/dist/projectCapture.d.ts +73 -0
  442. package/vendor/shared/dist/projectCapture.d.ts.map +1 -0
  443. package/vendor/shared/dist/projectCapture.js +66 -0
  444. package/vendor/shared/dist/quickAdd.d.ts +90 -0
  445. package/vendor/shared/dist/quickAdd.d.ts.map +1 -0
  446. package/vendor/shared/dist/quickAdd.js +260 -0
  447. package/vendor/shared/dist/recurrence.d.ts +44 -0
  448. package/vendor/shared/dist/recurrence.d.ts.map +1 -0
  449. package/vendor/shared/dist/recurrence.js +37 -0
  450. package/vendor/shared/dist/reminderWords.d.ts +11 -0
  451. package/vendor/shared/dist/reminderWords.d.ts.map +1 -0
  452. package/vendor/shared/dist/reminderWords.js +63 -0
  453. package/vendor/shared/dist/schemas/comment.d.ts +13 -1
  454. package/vendor/shared/dist/schemas/comment.d.ts.map +1 -1
  455. package/vendor/shared/dist/schemas/comment.js +5 -0
  456. package/vendor/shared/dist/schemas/conversation.d.ts +3 -3
  457. package/vendor/shared/dist/schemas/harness.d.ts +976 -59
  458. package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
  459. package/vendor/shared/dist/schemas/harness.js +124 -3
  460. package/vendor/shared/dist/schemas/journal.d.ts +10 -0
  461. package/vendor/shared/dist/schemas/journal.d.ts.map +1 -1
  462. package/vendor/shared/dist/schemas/journal.js +10 -2
  463. package/vendor/shared/dist/schemas/notification.d.ts +1 -1
  464. package/vendor/shared/dist/schemas/organization.d.ts +3 -2
  465. package/vendor/shared/dist/schemas/organization.d.ts.map +1 -1
  466. package/vendor/shared/dist/schemas/organization.js +3 -2
  467. package/vendor/shared/dist/schemas/proposal.d.ts +7 -3
  468. package/vendor/shared/dist/schemas/proposal.d.ts.map +1 -1
  469. package/vendor/shared/dist/schemas/proposal.js +2 -1
  470. package/vendor/shared/dist/schemas/request.d.ts +44 -4
  471. package/vendor/shared/dist/schemas/request.d.ts.map +1 -1
  472. package/vendor/shared/dist/schemas/task.d.ts +83 -8
  473. package/vendor/shared/dist/schemas/task.d.ts.map +1 -1
  474. package/vendor/shared/dist/schemas/task.js +20 -2
  475. package/vendor/shared/dist/schemas/timeSession.d.ts +2 -2
  476. package/vendor/shared/dist/smartCapture.d.ts +60 -0
  477. package/vendor/shared/dist/smartCapture.d.ts.map +1 -0
  478. package/vendor/shared/dist/smartCapture.js +56 -0
  479. package/vendor/shared/dist/speech.d.ts +39 -0
  480. package/vendor/shared/dist/speech.d.ts.map +1 -0
  481. package/vendor/shared/dist/speech.js +36 -0
  482. package/vendor/shared/dist/spokenNames.d.ts +25 -0
  483. package/vendor/shared/dist/spokenNames.d.ts.map +1 -0
  484. package/vendor/shared/dist/spokenNames.js +120 -0
  485. package/vendor/shared/dist/taskActivity.d.ts +76 -0
  486. package/vendor/shared/dist/taskActivity.d.ts.map +1 -0
  487. package/vendor/shared/dist/taskActivity.js +27 -0
  488. package/vendor/shared/dist/vault-search.d.ts +50 -0
  489. package/vendor/shared/dist/vault-search.d.ts.map +1 -0
  490. package/vendor/shared/dist/vault-search.js +177 -0
  491. package/vendor/shared/dist/voiceCapture.d.ts +32 -0
  492. package/vendor/shared/dist/voiceCapture.d.ts.map +1 -0
  493. package/vendor/shared/dist/voiceCapture.js +29 -0
  494. package/vendor/shared/package.json +4 -0
  495. package/vendor/shared/src/agentCommands.ts +35 -0
  496. package/vendor/shared/src/automationTemplates.ts +54 -0
  497. package/vendor/shared/src/automations.ts +329 -0
  498. package/vendor/shared/src/cardStatement.ts +49 -0
  499. package/vendor/shared/src/cardStudio.ts +340 -0
  500. package/vendor/shared/src/commandLocal.ts +740 -0
  501. package/vendor/shared/src/commandText.ts +25 -0
  502. package/vendor/shared/src/commands.ts +255 -0
  503. package/vendor/shared/src/computer.ts +25 -6
  504. package/vendor/shared/src/constants.ts +9 -2
  505. package/vendor/shared/src/dayPlan.ts +81 -0
  506. package/vendor/shared/src/dayPlanning.ts +77 -0
  507. package/vendor/shared/src/githubContributions.ts +70 -0
  508. package/vendor/shared/src/habitContributions.ts +144 -0
  509. package/vendor/shared/src/index.ts +44 -1
  510. package/vendor/shared/src/journal-migration.ts +130 -0
  511. package/vendor/shared/src/journal-vault.ts +1240 -0
  512. package/vendor/shared/src/projectCapture.ts +86 -0
  513. package/vendor/shared/src/quickAdd.ts +310 -0
  514. package/vendor/shared/src/recurrence.ts +37 -0
  515. package/vendor/shared/src/reminderWords.ts +54 -0
  516. package/vendor/shared/src/schemas/comment.ts +5 -0
  517. package/vendor/shared/src/schemas/harness.ts +146 -7
  518. package/vendor/shared/src/schemas/journal.ts +15 -6
  519. package/vendor/shared/src/schemas/organization.ts +3 -2
  520. package/vendor/shared/src/schemas/proposal.ts +6 -1
  521. package/vendor/shared/src/schemas/task.ts +20 -2
  522. package/vendor/shared/src/smartCapture.ts +67 -0
  523. package/vendor/shared/src/speech.ts +44 -0
  524. package/vendor/shared/src/spokenNames.ts +128 -0
  525. package/vendor/shared/src/taskActivity.ts +34 -0
  526. package/vendor/shared/src/vault-search.ts +243 -0
  527. package/vendor/shared/src/voiceCapture.ts +34 -0
@@ -1,4 +1,10 @@
1
+ import {
2
+ parseAgentCommand,
3
+ findAgentCommand,
4
+ type AgentCommandOption,
5
+ } from '@lucidity/shared';
1
6
  import { readFileSync } from 'node:fs';
7
+ import { randomUUID } from 'node:crypto';
2
8
  import {
3
9
  CodexRpc,
4
10
  initializeCodex,
@@ -19,6 +25,16 @@ import type { TurnStartParams } from './codexProtocol/v2/TurnStartParams.js';
19
25
  import type { TurnSteerParams } from './codexProtocol/v2/TurnSteerParams.js';
20
26
  import type { ModelListResponse } from './codexProtocol/v2/ModelListResponse.js';
21
27
  import type { UserInput } from './codexProtocol/v2/UserInput.js';
28
+ import type { ReviewStartParams } from './codexProtocol/v2/ReviewStartParams.js';
29
+ import type { ThreadSetNameParams } from './codexProtocol/v2/ThreadSetNameParams.js';
30
+ import type { GetAccountRateLimitsResponse } from './codexProtocol/v2/GetAccountRateLimitsResponse.js';
31
+ import type { SkillsListResponse } from './codexProtocol/v2/SkillsListResponse.js';
32
+
33
+ // App-server does not persist an empty thread until its first turn. Keep a durable
34
+ // reset marker in Lucidity's provider session envelope until that turn starts.
35
+ const EMPTY_SESSION_PREFIX = 'lucidity-codex-empty:';
36
+ const isEmptySession = (id?: string) =>
37
+ id?.startsWith(EMPTY_SESSION_PREFIX) ?? false;
22
38
 
23
39
  function userInput(
24
40
  input: Pick<ExecutorRunInput, 'userPrompt' | 'images'>,
@@ -38,7 +54,7 @@ export function codexRunConfig(
38
54
  inherited: Record<string, unknown>,
39
55
  ): NonNullable<ThreadStartParams['config']> {
40
56
  const config: NonNullable<ThreadStartParams['config']> = {
41
- 'features.shell_tool': !!input.permissionMode,
57
+ 'features.shell_tool': !!input.permissionMode && !input.noTools,
42
58
  'features.apps': false,
43
59
  'features.multi_agent': false,
44
60
  'features.multi_agent_v2': false,
@@ -55,7 +71,10 @@ export function codexRunConfig(
55
71
  'features.code_mode_only': false,
56
72
  'features.skill_mcp_dependency_install': false,
57
73
  'features.workspace_dependencies': false,
58
- 'features.hooks': !!input.permissionMode && input.permissionMode !== 'plan',
74
+ 'features.hooks':
75
+ !!input.permissionMode &&
76
+ input.permissionMode !== 'plan' &&
77
+ !input.noTools,
59
78
  model_provider: 'openai',
60
79
  };
61
80
  // config/read expands optional fields to null; those cannot round-trip to TOML.
@@ -81,17 +100,29 @@ export function codexRunConfig(
81
100
  };
82
101
  }
83
102
  config.mcp_servers = serversConfig;
103
+ if (input.readTools)
104
+ config.web_search = input.readTools.includes('WebSearch')
105
+ ? 'live'
106
+ : 'disabled';
84
107
  config.plugins = Object.fromEntries(
85
108
  Object.keys((inherited.plugins ?? {}) as object).map((name) => [
86
109
  name,
87
110
  { enabled: false },
88
111
  ]),
89
112
  );
90
- if (input.mcp) {
113
+ if (input.noTools) config.web_search = 'disabled';
114
+ if (input.mcp && !input.noTools) {
91
115
  const servers = JSON.parse(readFileSync(input.mcp.configPath, 'utf8'))
92
116
  .mcpServers as Record<
93
117
  string,
94
- { command: string; args?: string[]; env?: Record<string, string> }
118
+ {
119
+ command?: string;
120
+ args?: string[];
121
+ env?: Record<string, string>;
122
+ type?: string;
123
+ url?: string;
124
+ headers?: Record<string, string>;
125
+ }
95
126
  >;
96
127
  for (const [name, server] of Object.entries(servers)) {
97
128
  const prefix = `mcp__${name}__`;
@@ -102,7 +133,16 @@ export function codexRunConfig(
102
133
  if (allowed.some((tool) => tool.includes('*') && tool !== '*'))
103
134
  throw new Error('Unsupported MCP tool pattern for Codex.');
104
135
  serversConfig[name] = {
105
- ...server,
136
+ ...(server.url
137
+ ? {
138
+ url: server.url,
139
+ ...(server.headers ? { http_headers: server.headers } : {}),
140
+ }
141
+ : {
142
+ command: server.command!,
143
+ ...(server.args ? { args: server.args } : {}),
144
+ ...(server.env ? { env: server.env } : {}),
145
+ }),
106
146
  enabled: true,
107
147
  required: true,
108
148
  default_tools_approval_mode: 'approve',
@@ -170,6 +210,51 @@ export class CodexExecutor implements AgentExecutor {
170
210
  }
171
211
  }
172
212
 
213
+ async commands(
214
+ input: Pick<ExecutorRunInput, 'cwd' | 'permissionMode'> = {},
215
+ ): Promise<AgentCommandOption[]> {
216
+ return [
217
+ {
218
+ name: 'compact',
219
+ description: 'Summarize older messages to free up context.',
220
+ argumentHint: '',
221
+ },
222
+ {
223
+ name: 'new',
224
+ aliases: ['clear'],
225
+ description:
226
+ 'Start fresh context while keeping earlier messages visible.',
227
+ argumentHint: '',
228
+ clearsContext: true,
229
+ },
230
+ {
231
+ name: 'status',
232
+ description: 'Show the model, workspace and account limits.',
233
+ argumentHint: '',
234
+ },
235
+ {
236
+ name: 'rename',
237
+ description: 'Rename the provider conversation.',
238
+ argumentHint: '<name>',
239
+ },
240
+ ...(input.cwd && input.permissionMode
241
+ ? [
242
+ {
243
+ name: 'review',
244
+ description:
245
+ 'Review uncommitted changes or give review instructions.',
246
+ argumentHint: '[instructions]',
247
+ },
248
+ {
249
+ name: 'skills',
250
+ description: 'List skills available in this workspace.',
251
+ argumentHint: '',
252
+ },
253
+ ]
254
+ : []),
255
+ ];
256
+ }
257
+
173
258
  async run(input: ExecutorRunInput): Promise<ExecutorResult> {
174
259
  for await (const event of this.runStream(input))
175
260
  if (event.type === 'done') return event;
@@ -179,6 +264,52 @@ export class CodexExecutor implements AgentExecutor {
179
264
  async *runStream(
180
265
  input: ExecutorRunInput,
181
266
  ): AsyncIterable<ExecutorStreamEvent> {
267
+ if (input.signal?.aborted) throw abortError();
268
+ let command = parseAgentCommand(input.userPrompt);
269
+ if (command) {
270
+ const supported = findAgentCommand(
271
+ await this.commands(input),
272
+ command.name,
273
+ );
274
+ if (!supported)
275
+ throw new Error(
276
+ `/${command.name} is not supported by Codex in Lucidity.`,
277
+ );
278
+ if (!input.resume)
279
+ throw new Error('Start a conversation before using commands.');
280
+ if (
281
+ (!supported.argumentHint && command.arguments) ||
282
+ input.images?.length
283
+ )
284
+ throw new Error(
285
+ `/${supported.name} does not accept ${input.images?.length ? 'images' : 'arguments'} with Codex.`,
286
+ );
287
+ if (supported.name === 'rename' && !command.arguments)
288
+ throw new Error('Enter a name after /rename.');
289
+ command = { ...command, name: supported.name };
290
+ }
291
+ if (command?.name === 'new') {
292
+ const sessionId = `${EMPTY_SESSION_PREFIX}${randomUUID()}`;
293
+ yield { type: 'session', sessionId };
294
+ yield {
295
+ type: 'done',
296
+ text: 'Context cleared. Earlier messages remain visible here.',
297
+ sessionId,
298
+ };
299
+ return;
300
+ }
301
+ if (isEmptySession(input.resume) && command?.name === 'compact') {
302
+ yield {
303
+ type: 'done',
304
+ text: 'Not enough messages to compact.',
305
+ sessionId: input.resume,
306
+ };
307
+ return;
308
+ }
309
+ if (isEmptySession(input.resume) && command?.name === 'rename')
310
+ throw new Error(
311
+ 'Send a message in the new conversation before renaming it.',
312
+ );
182
313
  let threadId = '';
183
314
  let turnId = '';
184
315
  let ended = false;
@@ -186,6 +317,10 @@ export class CodexExecutor implements AgentExecutor {
186
317
  let owner: ReturnType<LiveTurns['open']>;
187
318
  try {
188
319
  owner = this.turns.open(input, async (text) => {
320
+ if (command)
321
+ throw new Error(
322
+ 'Wait for the command to finish before sending a message.',
323
+ );
189
324
  if (!turnId || ended)
190
325
  throw new Error('Codex has no active turn to steer.');
191
326
  const params: TurnSteerParams = {
@@ -268,7 +403,10 @@ export class CodexExecutor implements AgentExecutor {
268
403
  : input.permissionMode && input.permissionMode !== 'plan'
269
404
  ? 'on-request'
270
405
  : 'never',
271
- approvalsReviewer: 'user',
406
+ // Apply the daemon's Auto mode on both new and resumed threads instead
407
+ // of overriding it with a human reviewer on every turn.
408
+ approvalsReviewer:
409
+ input.permissionMode === 'auto' ? 'auto_review' : 'user',
272
410
  sandbox:
273
411
  input.permissionMode === 'bypassPermissions'
274
412
  ? 'danger-full-access'
@@ -278,32 +416,129 @@ export class CodexExecutor implements AgentExecutor {
278
416
  developerInstructions: input.systemPrompt,
279
417
  config: codexRunConfig(input, inherited.config),
280
418
  };
281
- const thread = input.resume
282
- ? await rpc.request<{ thread: { id: string } }>('thread/resume', {
283
- ...params,
284
- threadId: input.resume,
285
- } satisfies ThreadResumeParams)
286
- : await rpc.request<{ thread: { id: string } }>('thread/start', params);
419
+ type ThreadInfo = {
420
+ thread: { id: string };
421
+ model?: string;
422
+ reasoningEffort?: string | null;
423
+ cwd?: string;
424
+ };
425
+ const thread =
426
+ input.resume && !isEmptySession(input.resume)
427
+ ? await rpc.request<ThreadInfo>('thread/resume', {
428
+ ...params,
429
+ threadId: input.resume,
430
+ } satisfies ThreadResumeParams)
431
+ : await rpc.request<ThreadInfo>('thread/start', params);
287
432
  threadId = thread.thread.id;
433
+ const sessionId =
434
+ isEmptySession(input.resume) &&
435
+ command &&
436
+ ['status', 'skills'].includes(command.name)
437
+ ? input.resume!
438
+ : threadId;
288
439
  // Publish affinity before tools run, so an interrupted first turn can resume safely.
289
- yield { type: 'session', sessionId: threadId };
440
+ yield { type: 'session', sessionId };
441
+ // These controls finish with their RPC response and never start an inference turn.
442
+ if (command && ['status', 'rename', 'skills'].includes(command.name)) {
443
+ yield { type: 'tool_call', name: `/${command.name}`, phase: 'start' };
444
+ let text = '';
445
+ if (command.name === 'rename') {
446
+ await rpc.request('thread/name/set', {
447
+ threadId,
448
+ name: command.arguments,
449
+ } satisfies ThreadSetNameParams);
450
+ text = `Conversation renamed to ${command.arguments}.`;
451
+ }
452
+ if (command.name === 'status') {
453
+ const limits = await rpc.request<GetAccountRateLimitsResponse>(
454
+ 'account/rateLimits/read',
455
+ {},
456
+ );
457
+ const buckets = limits.rateLimitsByLimitId
458
+ ? Object.values(limits.rateLimitsByLimitId).filter(Boolean)
459
+ : [limits.rateLimits];
460
+ text = [
461
+ `Model: ${thread.model ?? input.model ?? 'Provider default'}`,
462
+ `Effort: ${input.effort ?? thread.reasoningEffort ?? 'Provider default'}`,
463
+ `Workspace: ${thread.cwd ?? input.cwd ?? 'Default'}`,
464
+ ...buckets.flatMap((bucket) =>
465
+ [bucket?.primary, bucket?.secondary].flatMap((window) =>
466
+ window
467
+ ? [
468
+ `${bucket?.limitName ?? 'Usage'} (${window.windowDurationMins ? `${window.windowDurationMins} min` : 'window'}): ${window.usedPercent}% used${window.resetsAt ? `; resets ${new Date(window.resetsAt * 1000).toISOString()}` : ''}`,
469
+ ]
470
+ : [],
471
+ ),
472
+ ),
473
+ ].join('\n');
474
+ }
475
+ if (command.name === 'skills') {
476
+ const result = await rpc.request<SkillsListResponse>('skills/list', {
477
+ cwds: [input.cwd!],
478
+ forceReload: true,
479
+ });
480
+ text =
481
+ result.data
482
+ .flatMap((entry) => [
483
+ ...entry.skills
484
+ .filter((skill) => skill.enabled)
485
+ .map((skill) => `- $${skill.name}: ${skill.description}`),
486
+ ...entry.errors.map(
487
+ (error) => `Could not load skill: ${error.message}`,
488
+ ),
489
+ ])
490
+ .join('\n') || 'No skills are available in this workspace.';
491
+ }
492
+ owner.check();
493
+ ended = true;
494
+ yield { type: 'tool_call', name: `/${command.name}`, phase: 'end' };
495
+ yield { type: 'done', text, sessionId };
496
+ return;
497
+ }
290
498
  const start: TurnStartParams = {
291
499
  threadId,
292
500
  input: userInput(input),
293
501
  model: input.model,
294
502
  effort: input.effort as TurnStartParams['effort'],
503
+ outputSchema: input.outputSchema as TurnStartParams['outputSchema'],
295
504
  };
296
- const turn = await rpc.request<{ turn: { id: string } }>(
297
- 'turn/start',
298
- start,
299
- );
300
- turnId = turn.turn.id;
505
+ if (command?.name === 'compact') {
506
+ yield {
507
+ type: 'tool_call',
508
+ name: 'Compact conversation',
509
+ phase: 'start',
510
+ };
511
+ await rpc.request('thread/compact/start', { threadId });
512
+ } else if (command?.name === 'review') {
513
+ yield { type: 'tool_call', name: '/review', phase: 'start' };
514
+ const review = await rpc.request<{ turn: { id: string } }>(
515
+ 'review/start',
516
+ {
517
+ threadId,
518
+ delivery: 'inline',
519
+ target: command.arguments
520
+ ? { type: 'custom', instructions: command.arguments }
521
+ : { type: 'uncommittedChanges' },
522
+ } satisfies ReviewStartParams,
523
+ );
524
+ turnId = review.turn.id;
525
+ } else {
526
+ const turn = await rpc.request<{ turn: { id: string } }>(
527
+ 'turn/start',
528
+ start,
529
+ );
530
+ turnId = turn.turn.id;
531
+ }
301
532
  let finalText = '';
302
533
  let streamedText = '';
303
534
  for await (const event of rpc.events) {
304
535
  owner.check();
305
536
  const p = event.params ?? {};
306
537
  if (p.threadId !== threadId) continue;
538
+ if (command && event.method === 'turn/started' && !turnId) {
539
+ turnId = (p.turn as { id: string }).id;
540
+ continue;
541
+ }
307
542
  if (p.turnId && p.turnId !== turnId) continue;
308
543
  if (
309
544
  event.method === 'item/agentMessage/delta' &&
@@ -321,7 +556,13 @@ export class CodexExecutor implements AgentExecutor {
321
556
  phase?: string;
322
557
  tool?: string;
323
558
  server?: string;
559
+ review?: string;
324
560
  };
561
+ if (
562
+ item.type === 'exitedReviewMode' &&
563
+ event.method === 'item/completed'
564
+ )
565
+ finalText = item.review ?? finalText;
325
566
  if (
326
567
  item.type === 'agentMessage' &&
327
568
  event.method === 'item/completed' &&
@@ -335,7 +576,15 @@ export class CodexExecutor implements AgentExecutor {
335
576
  ? 'Edit files'
336
577
  : item.type === 'mcpToolCall'
337
578
  ? `mcp__${item.server}__${item.tool}`
338
- : undefined;
579
+ : item.type === 'webSearch'
580
+ ? 'WebSearch'
581
+ : item.type === 'imageView'
582
+ ? 'View image'
583
+ : item.type === 'imageGeneration'
584
+ ? 'Generate image'
585
+ : item.type === 'dynamicToolCall'
586
+ ? (item.tool ?? 'Dynamic tool')
587
+ : undefined;
339
588
  if (name)
340
589
  yield {
341
590
  type: 'tool_call',
@@ -355,9 +604,21 @@ export class CodexExecutor implements AgentExecutor {
355
604
  throw new Error(
356
605
  completed.error?.message ?? `Codex turn ${completed.status}.`,
357
606
  );
607
+ if (command)
608
+ yield {
609
+ type: 'tool_call',
610
+ name:
611
+ command.name === 'compact'
612
+ ? 'Compact conversation'
613
+ : `/${command.name}`,
614
+ phase: 'end',
615
+ };
358
616
  yield {
359
617
  type: 'done',
360
- text: (finalText || streamedText).trim(),
618
+ text:
619
+ command?.name === 'compact'
620
+ ? 'Conversation compacted. You can continue here.'
621
+ : (finalText || streamedText).trim(),
361
622
  sessionId: threadId,
362
623
  };
363
624
  return;
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type CreditsSnapshot = { hasCredits: boolean, unlimited: boolean, balance: string | null, };
@@ -0,0 +1,25 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { JsonValue } from "../serde_json/JsonValue.js";
5
+ import type { RateLimitResetCreditsSummary } from "./RateLimitResetCreditsSummary.js";
6
+ import type { RateLimitSnapshot } from "./RateLimitSnapshot.js";
7
+
8
+ export type GetAccountRateLimitsResponse = {
9
+ /**
10
+ * Backward-compatible single-bucket view; mirrors the historical payload.
11
+ */
12
+ rateLimits: RateLimitSnapshot,
13
+ /**
14
+ * Multi-bucket view keyed by metered `limit_id` (for example, `codex`).
15
+ */
16
+ rateLimitsByLimitId: { [key in string]?: RateLimitSnapshot } | null, rateLimitResetCredits: RateLimitResetCreditsSummary | null,
17
+ /**
18
+ * Account associated with this usage snapshot, when supplied by the backend.
19
+ */
20
+ accountId: string | null,
21
+ /**
22
+ * Optional backend-owned banner from the same usage read. Its nested keys retain the
23
+ * backend's snake_case contract; an absent banner leaves the client's existing UI unchanged.
24
+ */
25
+ rateLimitUpsell: JsonValue | null, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type RateLimitReachedType = "rate_limit_reached" | "workspace_owner_credits_depleted" | "workspace_member_credits_depleted" | "workspace_owner_usage_limit_reached" | "workspace_member_usage_limit_reached";
@@ -0,0 +1,27 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { RateLimitResetCreditStatus } from "./RateLimitResetCreditStatus.js";
5
+ import type { RateLimitResetType } from "./RateLimitResetType.js";
6
+
7
+ export type RateLimitResetCredit = {
8
+ /**
9
+ * Opaque backend identifier for this reset credit.
10
+ */
11
+ id: string, resetType: RateLimitResetType, status: RateLimitResetCreditStatus,
12
+ /**
13
+ * Unix timestamp in seconds when the credit was granted.
14
+ */
15
+ grantedAt: number,
16
+ /**
17
+ * Unix timestamp in seconds when the credit expires, or `null` if it does not expire.
18
+ */
19
+ expiresAt: number | null,
20
+ /**
21
+ * Backend-provided display title for this credit, or `null` when unavailable.
22
+ */
23
+ title: string | null,
24
+ /**
25
+ * Backend-provided display description for this credit, or `null` when unavailable.
26
+ */
27
+ description: string | null, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type RateLimitResetCreditStatus = "available" | "redeeming" | "redeemed" | "unknown";
@@ -0,0 +1,14 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { RateLimitResetCredit } from "./RateLimitResetCredit.js";
5
+
6
+ export type RateLimitResetCreditsSummary = { availableCount: bigint,
7
+ /**
8
+ * Detail rows for available reset credits, when the backend provides them.
9
+ *
10
+ * `null` means only `availableCount` is known, while an empty array means details were fetched
11
+ * and no available credits were returned. The backend may cap this list, so its length can be
12
+ * less than `availableCount`.
13
+ */
14
+ credits: Array<RateLimitResetCredit> | null, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type RateLimitResetType = "codexRateLimits" | "unknown";
@@ -0,0 +1,14 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { PlanType } from "../PlanType.js";
5
+ import type { CreditsSnapshot } from "./CreditsSnapshot.js";
6
+ import type { RateLimitReachedType } from "./RateLimitReachedType.js";
7
+ import type { RateLimitWindow } from "./RateLimitWindow.js";
8
+ import type { SpendControlLimitSnapshot } from "./SpendControlLimitSnapshot.js";
9
+
10
+ export type RateLimitSnapshot = { limitId: string | null, limitName: string | null, primary: RateLimitWindow | null, secondary: RateLimitWindow | null, credits: CreditsSnapshot | null, individualLimit: SpendControlLimitSnapshot | null,
11
+ /**
12
+ * Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.
13
+ */
14
+ spendControlReached: boolean | null, planType: PlanType | null, rateLimitReachedType: RateLimitReachedType | null, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type RateLimitWindow = { usedPercent: number, windowDurationMins: number | null, resetsAt: number | null, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type ReviewDelivery = "inline" | "detached";
@@ -0,0 +1,12 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { ReviewDelivery } from "./ReviewDelivery.js";
5
+ import type { ReviewTarget } from "./ReviewTarget.js";
6
+
7
+ export type ReviewStartParams = { threadId: string, target: ReviewTarget,
8
+ /**
9
+ * Where to run the review: inline (default) on the current thread or
10
+ * detached on a new thread (returned in `reviewThreadId`).
11
+ */
12
+ delivery?: ReviewDelivery | null, };
@@ -0,0 +1,9 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type ReviewTarget = { "type": "uncommittedChanges" } | { "type": "baseBranch", branch: string, } | { "type": "commit", sha: string,
6
+ /**
7
+ * Optional human-readable label (e.g., commit subject) for UIs.
8
+ */
9
+ title: string | null, } | { "type": "custom", instructions: string, };
@@ -0,0 +1,6 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { SkillToolDependency } from "./SkillToolDependency.js";
5
+
6
+ export type SkillDependencies = { tools: Array<SkillToolDependency>, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type SkillErrorInfo = { path: string, message: string, };
@@ -0,0 +1,14 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { AbsolutePathBuf } from "../AbsolutePathBuf.js";
5
+
6
+ export type SkillInterface = { displayName?: string, shortDescription?: string, iconSmall?: AbsolutePathBuf, iconLarge?: AbsolutePathBuf,
7
+ /**
8
+ * Remote small icon URL from the plugin catalog.
9
+ */
10
+ iconSmallUrl: string | null,
11
+ /**
12
+ * Remote large icon URL from the plugin catalog.
13
+ */
14
+ iconLargeUrl: string | null, brandColor?: string, defaultPrompt?: string, };
@@ -0,0 +1,17 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { AbsolutePathBuf } from "../AbsolutePathBuf.js";
5
+ import type { SkillDependencies } from "./SkillDependencies.js";
6
+ import type { SkillInterface } from "./SkillInterface.js";
7
+ import type { SkillScope } from "./SkillScope.js";
8
+
9
+ export type SkillMetadata = { name: string, description: string,
10
+ /**
11
+ * Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.
12
+ */
13
+ shortDescription?: string, interface?: SkillInterface, dependencies?: SkillDependencies, path: AbsolutePathBuf, scope: SkillScope, enabled: boolean,
14
+ /**
15
+ * Owning plugin ID, matching `PluginSummary.id`, when known.
16
+ */
17
+ pluginId: string | null, };
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type SkillScope = "user" | "repo" | "system" | "admin";
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type SkillToolDependency = { type: string, value: string, description?: string, transport?: string, command?: string, url?: string, };
@@ -0,0 +1,7 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { SkillErrorInfo } from "./SkillErrorInfo.js";
5
+ import type { SkillMetadata } from "./SkillMetadata.js";
6
+
7
+ export type SkillsListEntry = { cwd: string, skills: Array<SkillMetadata>, errors: Array<SkillErrorInfo>, };
@@ -0,0 +1,6 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { SkillsListEntry } from "./SkillsListEntry.js";
5
+
6
+ export type SkillsListResponse = { data: Array<SkillsListEntry>, };