very-happy-cli 0.2.181 → 0.2.183

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 (202) hide show
  1. package/dist/{AcpBackend-DZGCSuXF.mjs → AcpBackend-9c-Jeaxd.mjs} +3 -3
  2. package/dist/{AcpBackend-CgHb_ya5.cjs → AcpBackend-B-aMuEzO.cjs} +3 -3
  3. package/dist/{AcpSessionManager-CacC2EVn.cjs → AcpSessionManager-BxXe24AV.cjs} +10 -3
  4. package/dist/{AcpSessionManager-DwuPzWBh.mjs → AcpSessionManager-CS0FOSQk.mjs} +10 -3
  5. package/dist/{BasePermissionHandler-Uo-GUjbb.mjs → BasePermissionHandler-BJ1ID_Br.mjs} +1 -1
  6. package/dist/{BasePermissionHandler-DCP8ZEB4.cjs → BasePermissionHandler-BREjppjP.cjs} +1 -1
  7. package/dist/{acpSessionResume-9OLTD6kT.mjs → acpSessionResume-BKtI9Jq_.mjs} +1 -1
  8. package/dist/{acpSessionResume-BaVMD80f.cjs → acpSessionResume-mVoJ75vI.cjs} +1 -1
  9. package/dist/{agentHome-B1BsKeqD.mjs → agentHome-B8Ctr_Nu.mjs} +4 -4
  10. package/dist/{agentHome-BtUmGcPX.cjs → agentHome-rzjm56o4.cjs} +4 -4
  11. package/dist/{api-Dr3wXL_7.mjs → api-C29WLYkW.mjs} +79 -12
  12. package/dist/{api-COHFAkb_.cjs → api-xZiqVynF.cjs} +81 -11
  13. package/dist/{apiMachine-D8H7CXaz.cjs → apiMachine-B-FNBIYG.cjs} +19 -14
  14. package/dist/{apiMachine-CHEzPQdS.mjs → apiMachine-Dz6Yfk0m.mjs} +19 -14
  15. package/dist/{attachmentContent-mIhbtRKl.cjs → attachmentContent-COV4LF8k.cjs} +2 -2
  16. package/dist/{attachmentContent-1YwtKgWl.mjs → attachmentContent-DwY0uIg6.mjs} +2 -2
  17. package/dist/{auth-CgQP7d0q.cjs → auth-CYtk9_ga.cjs} +5 -5
  18. package/dist/{auth-Fg8fLadK.cjs → auth-D_qsnVr3.cjs} +8 -8
  19. package/dist/{auth-CbZkcMAb.mjs → auth-DvbSDalm.mjs} +8 -8
  20. package/dist/{auth-DZsthtSk.mjs → auth-xT70IYMx.mjs} +5 -5
  21. package/dist/{auto-BB7kqSh5.cjs → auto-DT_PfpCx.cjs} +32 -25
  22. package/dist/{auto-_T-Ud-z5.mjs → auto-IiPqvIsN.mjs} +32 -26
  23. package/dist/{bootstrap-CYtOtbi7.cjs → bootstrap-C50NkfPx.cjs} +2 -2
  24. package/dist/{bootstrap-B6EkZh4u.mjs → bootstrap-DS8Acdhm.mjs} +2 -2
  25. package/dist/{browser-C2qhUHSE.mjs → browser-1j9gdZoD.mjs} +1 -1
  26. package/dist/{browser-DjNNQQk2.cjs → browser-CxKZLd2T.cjs} +1 -1
  27. package/dist/{claudeLocal-O_w7-fBh.cjs → claudeLocal-CgNWpepB.cjs} +5 -5
  28. package/dist/{claudeLocal-BAFjWhZ8.mjs → claudeLocal-U1Fa9sJo.mjs} +5 -5
  29. package/dist/{claudeLocalLauncher-CWn30LZR.mjs → claudeLocalLauncher-BjCsfZUE.mjs} +10 -10
  30. package/dist/{claudeLocalLauncher-Df3zg1q0.cjs → claudeLocalLauncher-IyFm0D6a.cjs} +10 -10
  31. package/dist/{claudeSessionFork-2ZkSTOGn.mjs → claudeSessionFork-6-1vKISn.mjs} +1 -1
  32. package/dist/{claudeSessionFork-pwcKqB-e.cjs → claudeSessionFork-BUO1XdSm.cjs} +1 -1
  33. package/dist/{client-CUO3ItoB.cjs → client--vZueZYF.cjs} +14 -4
  34. package/dist/{client-BKyU66lg.mjs → client-5_zDNdOh.mjs} +2 -2
  35. package/dist/{client-CXOnzuOy.mjs → client-BgHvK7lo.mjs} +15 -7
  36. package/dist/{client-D_U2VjO3.cjs → client-DYGDBD0M.cjs} +15 -7
  37. package/dist/{client-DWs6k041.cjs → client-DcKJ0ul_.cjs} +2 -2
  38. package/dist/{client-DsQcxVUV.mjs → client-DfDyE322.mjs} +14 -4
  39. package/dist/codex/happyMcpStdioBridge.cjs +20 -19
  40. package/dist/codex/happyMcpStdioBridge.mjs +20 -19
  41. package/dist/{codexAppServerClient-BRX3JZ_5.cjs → codexAppServerClient-C3nrTfwY.cjs} +3 -3
  42. package/dist/{codexAppServerClient-C3JO3pwM.mjs → codexAppServerClient-DvBg4hGc.mjs} +3 -3
  43. package/dist/{codexCommand-BZIAAqKS.mjs → codexCommand-Bqp2--g_.mjs} +96 -61
  44. package/dist/{codexCommand-dKOc5iQl.cjs → codexCommand-DSiU6MNt.cjs} +96 -61
  45. package/dist/{codexTermination-BVR9HeVI.cjs → codexTermination-D9TRTglF.cjs} +1 -1
  46. package/dist/{codexTermination-ztFkwHrG.mjs → codexTermination-DsliWl_s.mjs} +1 -1
  47. package/dist/{config-cftYxLC7.cjs → config-CRhWiOwi.cjs} +3 -3
  48. package/dist/{config-NbHjx8ge.mjs → config-DeaqRn3o.mjs} +3 -3
  49. package/dist/{configuration-C8JgseHy.cjs → configuration-K3I6yOjZ.cjs} +1 -1
  50. package/dist/{configuration-BPrfb17M.mjs → configuration-elzht62L.mjs} +1 -1
  51. package/dist/{connect-Br8VMrK1.cjs → connect-B5UbfmO3.cjs} +13 -13
  52. package/dist/{connect-CLD1ai0k.mjs → connect-CT5cOlnC.mjs} +13 -13
  53. package/dist/{context-_YGq8xdH.mjs → context-CLj1_RYF.mjs} +1 -1
  54. package/dist/{context-D1lgQTJC.cjs → context-DNKNF8Yh.cjs} +1 -1
  55. package/dist/{controlClient-D68Zj7Q-.cjs → controlClient-ChqmxgbB.cjs} +3 -3
  56. package/dist/{controlClient-CkNpT5zS.mjs → controlClient-CuYQs2aZ.mjs} +3 -3
  57. package/dist/{createSessionMetadata-3WAj3_xl.mjs → createSessionMetadata-C1MbLQnh.mjs} +2 -2
  58. package/dist/{createSessionMetadata-DNIbKLHg.cjs → createSessionMetadata-QfiRx4Tf.cjs} +2 -2
  59. package/dist/daemonSupervisor-57JYYzMf.cjs +268 -0
  60. package/dist/daemonSupervisor-DfzrtNhM.mjs +245 -0
  61. package/dist/{defaultPermissionMode-BmvjP32v.cjs → defaultPermissionMode-DQmdZZIg.cjs} +2 -2
  62. package/dist/{defaultPermissionMode-DXMznl8v.mjs → defaultPermissionMode-U9LuUeQh.mjs} +2 -2
  63. package/dist/{deterministicJson-BS7D7URE.cjs → deterministicJson-BBRUcB8i.cjs} +569 -17
  64. package/dist/{deterministicJson-BcBIKKf1.mjs → deterministicJson-BixlyPWV.mjs} +572 -21
  65. package/dist/{doctor-Be7zC0AF.cjs → doctor-CKgHUV4W.cjs} +7 -7
  66. package/dist/{doctor-CoOaPq6w.mjs → doctor-Dban2oE2.mjs} +7 -7
  67. package/dist/{downloadTarget-LyOiucn_.cjs → downloadTarget-CmC11Y7E.cjs} +6 -6
  68. package/dist/{downloadTarget-CeaAXdJj.mjs → downloadTarget-VUTd9lEO.mjs} +6 -6
  69. package/dist/{ensureDaemonRunning-B8z37VKD.cjs → ensureDaemonRunning-L0fl0cLE.cjs} +5 -5
  70. package/dist/{ensureDaemonRunning--98j7-17.mjs → ensureDaemonRunning-khb8Nr1n.mjs} +5 -5
  71. package/dist/fsMkdir-0K3yENml.cjs +56 -0
  72. package/dist/fsMkdir-DumgLTzR.mjs +53 -0
  73. package/dist/{handleResumeCommand-gO8I4keP.mjs → handleResumeCommand-CLDGWpTJ.mjs} +5 -5
  74. package/dist/{handleResumeCommand-BFZlrFVH.cjs → handleResumeCommand-D9myBN2N.cjs} +5 -5
  75. package/dist/{index-WUj3954m.mjs → index-BMZx-699.mjs} +4 -4
  76. package/dist/{index-BRMq9gOe.cjs → index-BdJs0465.cjs} +3 -3
  77. package/dist/{index-CeRXrGnH.mjs → index-BptfFoXM.mjs} +283 -77
  78. package/dist/{index-jF2t3ACW.cjs → index-COSjJPIv.cjs} +4 -4
  79. package/dist/{index-hQ8LP1C2.mjs → index-CtwqBeH6.mjs} +3 -3
  80. package/dist/{index-B5PXbZjW.cjs → index-DgA79dVw.cjs} +41 -40
  81. package/dist/{index-Df2eHm3O.cjs → index-Fq-jxjsB.cjs} +294 -76
  82. package/dist/{index-CO0n9ue6.mjs → index-GkkbUZX-.mjs} +4 -4
  83. package/dist/{index-DneHoQXf.mjs → index-IRI8s8kz.mjs} +42 -41
  84. package/dist/{index-BkluinoS.cjs → index-y4JNyz9H.cjs} +4 -4
  85. package/dist/index.cjs +2 -2
  86. package/dist/index.mjs +2 -2
  87. package/dist/{install-D2NCbeJ-.cjs → install-BATFlr_l.cjs} +2 -2
  88. package/dist/{install-D0inLCv-.mjs → install-F3rP8tBU.mjs} +2 -2
  89. package/dist/{install-DkYFiVK4.mjs → install-JvCk2PJV.mjs} +3 -3
  90. package/dist/{install-FqkSUjPC.cjs → install-cn98bTCs.cjs} +3 -3
  91. package/dist/lib.cjs +12 -12
  92. package/dist/lib.d.cts +2 -1
  93. package/dist/lib.d.mts +2 -1
  94. package/dist/lib.mjs +12 -12
  95. package/dist/{lidState-x8cJ8J_9.cjs → lidState-Bcs5kRHi.cjs} +1 -1
  96. package/dist/{lidState-DghbfRbr.mjs → lidState-DXeYTsrm.mjs} +1 -1
  97. package/dist/{localHappyAgentAuth-IKmeRpuQ.mjs → localHappyAgentAuth-C1A4ChCR.mjs} +1 -1
  98. package/dist/{localHappyAgentAuth-DZ2kb9uq.cjs → localHappyAgentAuth-CypTSe42.cjs} +1 -1
  99. package/dist/{logger-DgBwUSgS.cjs → logger-Cgwz30rK.cjs} +2 -2
  100. package/dist/{logger-LFr8iPgl.mjs → logger-RMPh5aqe.mjs} +2 -2
  101. package/dist/{machineMetadata-DB03ez4K.cjs → machineMetadata-BSOGMNRi.cjs} +5 -3
  102. package/dist/{machineMetadata-BglCsfvf.mjs → machineMetadata-BTUtPRth.mjs} +5 -3
  103. package/dist/{main-YQ-Vkakw.cjs → main-4iiwYpCR.cjs} +61 -56
  104. package/dist/{main-_1LSzlLv.mjs → main-DNDL6t8z.mjs} +61 -56
  105. package/dist/{mcp-BIY80jSc.cjs → mcp-C7eEoGhz.cjs} +17 -15
  106. package/dist/{mcp-Csj-mT5Y.mjs → mcp-DXYDPOpJ.mjs} +17 -15
  107. package/dist/{mirrorProtocol-CAxOMBkb.mjs → mirrorProtocol-DQRy5PaT.mjs} +3 -3
  108. package/dist/{mirrorProtocol-BphKIAK9.cjs → mirrorProtocol-c5g5MgNc.cjs} +3 -3
  109. package/dist/{package-NoD8QOOM.cjs → package-3aPiSpZj.cjs} +7 -7
  110. package/dist/{package-DYGwlmXl.mjs → package-CTrz6U3C.mjs} +7 -7
  111. package/dist/{panels-B8zRm7_d.mjs → panels-B5sZ84vA.mjs} +5 -5
  112. package/dist/{panels-DYEc1NyQ.cjs → panels-BmsmKHbw.cjs} +5 -5
  113. package/dist/{peerTools-CK3JYu1k.mjs → peerTools-DIPOX033.mjs} +5 -5
  114. package/dist/{peerTools-CP-x-Peu.cjs → peerTools-Dxe7iCi_.cjs} +5 -5
  115. package/dist/{persistence-BY-D00wT.cjs → persistence-DZRMUZZS.cjs} +2 -2
  116. package/dist/{persistence-D2Djrf7t.mjs → persistence-zJo4r7YI.mjs} +2 -2
  117. package/dist/{piRunnerArgs-gxLYIZH4.cjs → piRunnerArgs-BSPiS6tZ.cjs} +1 -1
  118. package/dist/{piRunnerArgs-IZLoL7TG.mjs → piRunnerArgs-IVdoHUB6.mjs} +1 -1
  119. package/dist/{piRuntime-o5L8uX-W.cjs → piRuntime-BJzjlMcN.cjs} +2 -2
  120. package/dist/{piRuntime-D7Y4oHVL.mjs → piRuntime-BvHO3vgO.mjs} +2 -2
  121. package/dist/{piTerminal-C_-JDkLN.cjs → piTerminal-Cz4pW55d.cjs} +20 -18
  122. package/dist/{piTerminal-Kphx8Uhw.mjs → piTerminal-D7vBOpkE.mjs} +20 -18
  123. package/dist/{pushNotifications-DXGIhE-A.mjs → pushNotifications-C4R9-1hU.mjs} +5 -3
  124. package/dist/{pushNotifications-BXoOSq_G.cjs → pushNotifications-CgIrYml3.cjs} +5 -3
  125. package/dist/{query-CdCxzuaB.cjs → query-CZQG1PdU.cjs} +1 -1
  126. package/dist/{query-CcA6DVZK.mjs → query-DKPmDsHS.mjs} +1 -1
  127. package/dist/{rateLimitWindows-OpAmdOtC.cjs → rateLimitWindows-CPV0nLeq.cjs} +1 -1
  128. package/dist/{rateLimitWindows-ZtHZHe-l.mjs → rateLimitWindows-HlHATOQ0.mjs} +1 -1
  129. package/dist/{registerCommonHandlers-CRjBoJLK.cjs → registerCommonHandlers-D1pC83Op.cjs} +2 -2
  130. package/dist/{registerCommonHandlers-DF6bdDtd.mjs → registerCommonHandlers-a9lHojSV.mjs} +2 -2
  131. package/dist/{registerKillSessionHandler-DDCKL3wf.mjs → registerKillSessionHandler-Bp-fuH-w.mjs} +6 -6
  132. package/dist/{registerKillSessionHandler-7fOm6ooh.cjs → registerKillSessionHandler-nTi2vVJy.cjs} +6 -6
  133. package/dist/{remoteSessionClient-B2POSKFT.mjs → remoteSessionClient-Cwrddscy.mjs} +5 -5
  134. package/dist/{remoteSessionClient-CFCn42bs.cjs → remoteSessionClient-HQAKAvVd.cjs} +5 -5
  135. package/dist/{reportProgressTool-th4trcET.cjs → reportProgressTool-Be-8ADI4.cjs} +4 -4
  136. package/dist/{reportProgressTool-tPxEvh6x.mjs → reportProgressTool-CcZ32nrd.mjs} +4 -4
  137. package/dist/{resources-CH1iP6Cv.mjs → resources-CLdQfe3b.mjs} +1 -1
  138. package/dist/{resources-BPyN59Iv.cjs → resources-CqwHPhdK.cjs} +1 -1
  139. package/dist/{run-cKQBbVi4.mjs → run-BBU8GyxE.mjs} +63 -244
  140. package/dist/{run-C_FumCQk.cjs → run-CxRJk9qq.cjs} +73 -255
  141. package/dist/{runClaude-CYnM6krL.mjs → runClaude-DR6pEQwd.mjs} +23 -22
  142. package/dist/{runClaude-z_2YC_aa.cjs → runClaude-Dd5zJaUZ.cjs} +23 -22
  143. package/dist/{runClaudeDeps-duS06Pb4.mjs → runClaudeDeps-COgZaUZm.mjs} +50 -45
  144. package/dist/{runClaudeDeps-CLubzWnA.cjs → runClaudeDeps-CTtZ_1mC.cjs} +45 -40
  145. package/dist/{runGemini-C_Pc2EhH.mjs → runGemini-DVoVUfPp.mjs} +40 -37
  146. package/dist/{runGemini-vEoXV6qT.cjs → runGemini-DX72qB92.cjs} +40 -37
  147. package/dist/{runOpenClaw-Cxun1qLC.mjs → runOpenClaw-BHjzmzeC.mjs} +19 -18
  148. package/dist/{runOpenClaw-CXJCtMgB.cjs → runOpenClaw-BSg4hFVt.cjs} +19 -18
  149. package/dist/{sandbox-CsvPnTmz.mjs → sandbox-CWR9EqoN.mjs} +4 -4
  150. package/dist/{sandbox-CO46H2tK.cjs → sandbox-D1T_hmgZ.cjs} +4 -4
  151. package/dist/{selfCheck-DIr7Gc0i.cjs → selfCheck-CE7vlnNS.cjs} +36 -36
  152. package/dist/selfCheck-ZGgBtxFQ.mjs +85 -0
  153. package/dist/{send-DMoFg6F1.mjs → send-BDF0Zvxo.mjs} +8 -8
  154. package/dist/{send-X2mfVEyr.cjs → send-BxZqRCcG.cjs} +8 -8
  155. package/dist/{server-CkqQ0sRH.mjs → server-B4JtnDLF.mjs} +4 -4
  156. package/dist/{server-BwTEdbkr.cjs → server-DB7_70Mi.cjs} +6 -6
  157. package/dist/{sessionLock-CdIRJlHH.cjs → sessionLock-BXvFN6uw.cjs} +3 -3
  158. package/dist/{sessionLock-JIfwCqMk.mjs → sessionLock-CXOOX-VD.mjs} +3 -3
  159. package/dist/{sessionOps-DVA-00nR.cjs → sessionOps-BWlDlFYP.cjs} +4 -4
  160. package/dist/{sessionOps-DqlftXxe.mjs → sessionOps-ByVggB_q.mjs} +4 -4
  161. package/dist/{sessionScanner-BMwgGAhY.cjs → sessionScanner-DkxPB5VA.cjs} +3 -3
  162. package/dist/{sessionScanner-BI0Vo1xT.mjs → sessionScanner-r66RtF95.mjs} +3 -3
  163. package/dist/{sessions-DjgEcHaT.cjs → sessions-BiJTxFy9.cjs} +10 -10
  164. package/dist/{sessions-D6IimX7b.mjs → sessions-C1lLK_a9.mjs} +10 -10
  165. package/dist/{setupOfflineReconnection-DgJK_4m1.mjs → setupOfflineReconnection-Bl3DuakT.mjs} +2 -2
  166. package/dist/{setupOfflineReconnection-CjuCiKY3.cjs → setupOfflineReconnection-CecTiFZ-.cjs} +2 -2
  167. package/dist/{spawn-Dvzy-tzc.mjs → spawn-D-8MlEM6.mjs} +14 -14
  168. package/dist/{spawn-rhF28shY.cjs → spawn-D79mVa3h.cjs} +14 -14
  169. package/dist/{spawnAgents-CCnlq-FI.mjs → spawnAgents-DJHjq01u.mjs} +1 -1
  170. package/dist/{spawnAgents-iwuqrgR9.cjs → spawnAgents-Sfnf-4pN.cjs} +1 -1
  171. package/dist/{spawnHappyCLI-DnKmIsEt.cjs → spawnHappyCLI-CQwQs9G5.cjs} +1 -1
  172. package/dist/{spawnHappyCLI-Dq3LLXLb.mjs → spawnHappyCLI-v_bJwZ4Z.mjs} +1 -1
  173. package/dist/{specialCommands-Zwr2C6A2.cjs → specialCommands-CWMVfT5s.cjs} +3 -3
  174. package/dist/{specialCommands-CcyZ1hGA.mjs → specialCommands-yMnFvS-W.mjs} +3 -3
  175. package/dist/{startFileWatcher-4thXDK9d.mjs → startFileWatcher-BCDkT_tr.mjs} +1 -1
  176. package/dist/{startFileWatcher-K6hJSyiR.cjs → startFileWatcher-GW4_E7dV.cjs} +1 -1
  177. package/dist/{startupSessionCreate-BfByJ16A.mjs → startupSessionCreate-BcAGYo51.mjs} +1 -1
  178. package/dist/{startupSessionCreate-CKEbq0tL.cjs → startupSessionCreate-tBRa_ze8.cjs} +1 -1
  179. package/dist/{streamRelay-LcDvyEjK.mjs → streamRelay-BEDiy6_b.mjs} +1 -1
  180. package/dist/{streamRelay-Gy8Xfnon.cjs → streamRelay-BZ8drtof.cjs} +1 -1
  181. package/dist/{sync-DO-2PU45.mjs → sync--QUIOuf8.mjs} +1 -1
  182. package/dist/{sync-1hQ5KHpL.cjs → sync-BMDkyo75.cjs} +1 -1
  183. package/dist/{systemPrompt-Dj7pgkMK.cjs → systemPrompt-DoHSXrH0.cjs} +2 -2
  184. package/dist/{systemPrompt-BctLfMZs.mjs → systemPrompt-O0Kd6vbA.mjs} +2 -2
  185. package/dist/{teams-uQxUlyyz.cjs → teams-BkZop-sP.cjs} +13 -10
  186. package/dist/{teams-Bu8YeOoF.mjs → teams-CTF1gT48.mjs} +13 -10
  187. package/dist/{template-BaHAmH2K.cjs → template-CeC1dYe-.cjs} +32 -2
  188. package/dist/{template-CiOPa2rd.mjs → template-D1fm22em.mjs} +31 -3
  189. package/dist/{time-BcoJaG8E.mjs → time-B2KKdAym.mjs} +1 -1
  190. package/dist/{time-nqa9shu8.cjs → time-CdCotzKU.cjs} +1 -1
  191. package/dist/{titleGenerator-D5r06bhf.mjs → titleGenerator-BFDczskR.mjs} +1 -1
  192. package/dist/{titleGenerator-D09XyYYG.cjs → titleGenerator-DZH1XqAf.cjs} +2 -2
  193. package/dist/{todo-D1q8146q.mjs → todo-C2gyOUom.mjs} +6 -6
  194. package/dist/{todo-CCOnL7pT.cjs → todo-DnTFTHmV.cjs} +6 -6
  195. package/dist/{tools-DiCXnAC5.cjs → tools-C8rpwyIl.cjs} +1 -1
  196. package/dist/{tools-D2E--n1x.mjs → tools-DUjkqSQL.mjs} +1 -1
  197. package/dist/{uninstall-CtwXi1Rt.mjs → uninstall-B5Ew50mZ.mjs} +3 -3
  198. package/dist/{uninstall-BrNwwwSD.cjs → uninstall-CKMPWTMv.cjs} +3 -3
  199. package/package.json +7 -7
  200. package/dist/daemonSupervisor-B-SPSqhs.cjs +0 -13
  201. package/dist/daemonSupervisor-C6urv3_8.mjs +0 -10
  202. package/dist/selfCheck-NamtBHVB.mjs +0 -85
@@ -427,7 +427,7 @@ z$1.object({
427
427
  events: z$1.array(ConnectionDiagnosticEventSchema).min(1).max(32)
428
428
  }).strict();
429
429
  const TeamPermissionModeSchema = z$1.enum(["default", "bypassPermissions"]);
430
- const id$2 = z$1.string().min(1).max(128);
430
+ const id$3 = z$1.string().min(1).max(128);
431
431
  const text$1 = z$1.string().min(1).max(32e3);
432
432
  const TeamAssistantSchema = z$1.enum(["claude", "codex", "pi-acp"]);
433
433
  const TeamModelSchema = z$1.string().trim().min(1).max(256);
@@ -438,42 +438,57 @@ const TeamActionSchema = z$1.discriminatedUnion("type", [
438
438
  z$1.object({ type: z$1.literal("start"), launch: TeamLaunchSchema }),
439
439
  z$1.object({ type: z$1.literal("set-defaults"), defaults: TeamDefaultsSchema }),
440
440
  z$1.object({ type: z$1.literal("set-permission-mode"), permissionMode: TeamPermissionModeSchema }),
441
- z$1.object({ type: z$1.literal("schedule-create"), name: id$2, botId: id$2, body: text$1, runAt: z$1.number().int().positive().max(864e13), intervalMs: z$1.number().int().min(6e4).max(366 * 864e5).optional() }),
442
- z$1.object({ type: z$1.literal("schedule-pause"), scheduleId: id$2, version: z$1.number().int().positive() }),
443
- z$1.object({ type: z$1.literal("schedule-resume"), scheduleId: id$2, version: z$1.number().int().positive() }),
444
- z$1.object({ type: z$1.literal("schedule-cancel"), scheduleId: id$2, version: z$1.number().int().positive() }),
445
- z$1.object({ type: z$1.literal("reconcile-operation"), operationId: id$2, claimId: id$2, note: z$1.string().trim().min(1).max(4e3) }),
441
+ z$1.object({ type: z$1.literal("schedule-create"), name: id$3, botId: id$3, body: text$1, runAt: z$1.number().int().positive().max(864e13), intervalMs: z$1.number().int().min(6e4).max(366 * 864e5).optional() }),
442
+ z$1.object({ type: z$1.literal("schedule-pause"), scheduleId: id$3, version: z$1.number().int().positive() }),
443
+ z$1.object({ type: z$1.literal("schedule-resume"), scheduleId: id$3, version: z$1.number().int().positive() }),
444
+ z$1.object({ type: z$1.literal("schedule-cancel"), scheduleId: id$3, version: z$1.number().int().positive() }),
445
+ z$1.object({ type: z$1.literal("reconcile-operation"), operationId: id$3, claimId: id$3, note: z$1.string().trim().min(1).max(4e3) }),
446
446
  // B-689: owner asks the execution computer to run a failed/uncertain operation again.
447
- z$1.object({ type: z$1.literal("retry-operation"), operationId: id$2, claimId: id$2 }),
447
+ z$1.object({ type: z$1.literal("retry-operation"), operationId: id$3, claimId: id$3 }),
448
448
  /** B-730: `transfer` = the owner confirmed moving a session that is bound in another live team (Web adopt); without it the server answers `session_in_other_team`. An old server strips it. */
449
- z$1.object({ type: z$1.literal("join"), name: id$2, sessionId: id$2, botId: id$2.optional(), transfer: z$1.literal(true).optional() }),
450
- z$1.object({ type: z$1.literal("delegate"), goal: text$1, acceptance: z$1.array(text$1).min(1).max(32), parentTaskId: id$2.optional(), assigneeBotId: id$2.optional(), botName: id$2.optional(), directory: z$1.string().min(1).max(4096).optional(), assistant: TeamAssistantSchema.optional(), model: TeamModelSchema.optional() }),
451
- z$1.object({ type: z$1.literal("message"), taskId: id$2, body: text$1, recipientBotId: id$2.optional() }),
452
- z$1.object({ type: z$1.literal("submit"), taskId: id$2, attemptId: id$2, goalVersion: z$1.number().int().positive(), result: text$1 }),
453
- z$1.object({ type: z$1.literal("accept"), taskId: id$2, attemptId: id$2, goalVersion: z$1.number().int().positive() }),
454
- z$1.object({ type: z$1.literal("return"), taskId: id$2, attemptId: id$2, goalVersion: z$1.number().int().positive(), reason: text$1 }),
455
- z$1.object({ type: z$1.literal("cancel"), taskId: id$2, attemptId: id$2, goalVersion: z$1.number().int().positive(), reason: text$1 }),
456
- z$1.object({ type: z$1.literal("handoff"), taskId: id$2, attemptId: id$2, goalVersion: z$1.number().int().positive(), assigneeBotId: id$2 }),
457
- z$1.object({ type: z$1.literal("claim-operation"), operationId: id$2, machineId: id$2, teamLaunchVersion: z$1.literal(1).optional() }),
458
- z$1.object({ type: z$1.literal("complete-operation"), operationId: id$2, machineId: id$2, claimId: id$2, sessionId: id$2.optional(), workingDirectory: z$1.string().min(1).max(4096).optional() }),
459
- z$1.object({ type: z$1.literal("fail-operation"), operationId: id$2, machineId: id$2, claimId: id$2, error: text$1, unknown: z$1.boolean().optional() }),
460
- z$1.object({ type: z$1.literal("session-event"), sessionId: id$2, event: z$1.enum(["idle", "blocked", "exited"]) }),
461
- z$1.object({ type: z$1.literal("message-delivered"), messageId: id$2, recipientBotId: id$2, generation: z$1.number().int().positive(), sessionId: id$2 })
449
+ z$1.object({ type: z$1.literal("join"), name: id$3, sessionId: id$3, botId: id$3.optional(), transfer: z$1.literal(true).optional() }),
450
+ z$1.object({ type: z$1.literal("delegate"), goal: text$1, acceptance: z$1.array(text$1).min(1).max(32), parentTaskId: id$3.optional(), assigneeBotId: id$3.optional(), botName: id$3.optional(), directory: z$1.string().min(1).max(4096).optional(), assistant: TeamAssistantSchema.optional(), model: TeamModelSchema.optional() }),
451
+ z$1.object({ type: z$1.literal("message"), taskId: id$3, body: text$1, recipientBotId: id$3.optional() }),
452
+ z$1.object({ type: z$1.literal("submit"), taskId: id$3, attemptId: id$3, goalVersion: z$1.number().int().positive(), result: text$1 }),
453
+ z$1.object({ type: z$1.literal("accept"), taskId: id$3, attemptId: id$3, goalVersion: z$1.number().int().positive() }),
454
+ z$1.object({ type: z$1.literal("return"), taskId: id$3, attemptId: id$3, goalVersion: z$1.number().int().positive(), reason: text$1 }),
455
+ z$1.object({ type: z$1.literal("cancel"), taskId: id$3, attemptId: id$3, goalVersion: z$1.number().int().positive(), reason: text$1 }),
456
+ z$1.object({ type: z$1.literal("handoff"), taskId: id$3, attemptId: id$3, goalVersion: z$1.number().int().positive(), assigneeBotId: id$3 }),
457
+ z$1.object({ type: z$1.literal("claim-operation"), operationId: id$3, machineId: id$3, teamLaunchVersion: z$1.literal(1).optional() }),
458
+ z$1.object({ type: z$1.literal("complete-operation"), operationId: id$3, machineId: id$3, claimId: id$3, sessionId: id$3.optional(), workingDirectory: z$1.string().min(1).max(4096).optional() }),
459
+ z$1.object({ type: z$1.literal("fail-operation"), operationId: id$3, machineId: id$3, claimId: id$3, error: text$1, unknown: z$1.boolean().optional() }),
460
+ z$1.object({ type: z$1.literal("session-event"), sessionId: id$3, event: z$1.enum(["idle", "blocked", "exited"]) }),
461
+ z$1.object({ type: z$1.literal("message-delivered"), messageId: id$3, recipientBotId: id$3, generation: z$1.number().int().positive(), sessionId: id$3 })
462
462
  ]);
463
- z$1.object({ requestId: id$2, action: TeamActionSchema });
463
+ z$1.object({ requestId: id$3, action: TeamActionSchema });
464
464
  const TeamProjectChoiceSchema = z$1.object({
465
- projectId: id$2.optional(),
466
- inheritFromSessionId: id$2.optional(),
465
+ projectId: id$3.optional(),
466
+ inheritFromSessionId: id$3.optional(),
467
467
  create: z$1.boolean().optional(),
468
468
  directory: z$1.string().min(1).max(4096).optional()
469
469
  });
470
- z$1.object({ name: id$2, machineId: id$2, requestId: id$2.optional(), launch: TeamLaunchSchema.optional(), project: TeamProjectChoiceSchema.optional(), sessionId: id$2.optional(), transfer: z$1.literal(true).optional() });
470
+ z$1.object({ name: id$3, machineId: id$3, requestId: id$3.optional(), launch: TeamLaunchSchema.optional(), project: TeamProjectChoiceSchema.optional(), sessionId: id$3.optional(), transfer: z$1.literal(true).optional() });
471
471
  z$1.object({
472
- projectId: id$2.nullable().optional(),
472
+ projectId: id$3.nullable().optional(),
473
473
  create: z$1.boolean().optional(),
474
- requestId: id$2.optional()
474
+ requestId: id$3.optional()
475
475
  }).refine((v) => v.projectId !== void 0 !== (v.create === true), "exactly one of projectId / create");
476
- const id$1 = z$1.string().min(1).max(128);
476
+ const TEAM_WORKTREE = /\/teams\/worktrees\/([^/]+)(?:\/|$)/;
477
+ function teamWorktreeId(path) {
478
+ if (!path) return null;
479
+ return path.replace(/\\/g, "/").match(TEAM_WORKTREE)?.[1] ?? null;
480
+ }
481
+ function isInsideTeamWorktree(path) {
482
+ return teamWorktreeId(path) !== null;
483
+ }
484
+ function rebaseTeamWorktreePath(path, repository) {
485
+ const normalized = path.replace(/\\/g, "/");
486
+ const match = normalized.match(TEAM_WORKTREE);
487
+ if (!match || match.index === void 0) return path;
488
+ const rest = normalized.slice(match.index + match[0].length).replace(/\/+$/, "");
489
+ return rest ? `${repository.replace(/\/+$/, "")}/${rest}` : repository;
490
+ }
491
+ const id$2 = z$1.string().min(1).max(128);
477
492
  const text = z$1.string().min(1).max(32e3);
478
493
  const AUTOMATION_NAME_PATTERN = /^[a-z0-9][a-z0-9-_.]{0,63}$/;
479
494
  const AutomationNameSchema = z$1.string().regex(AUTOMATION_NAME_PATTERN, "automation name must match [a-z0-9][a-z0-9-_.]{0,63}");
@@ -482,6 +497,7 @@ const AUTOMATION_MAX_INTERVAL_MS = 366 * 864e5;
482
497
  const AUTOMATION_MAX_TIMESTAMP = 864e13;
483
498
  const AUTOMATION_PAYLOAD_MAX_BYTES = 65536;
484
499
  const AUTOMATION_SUMMARY_MAX_CHARS = 4096;
500
+ const AUTOMATION_ATTENTION_REASON_MAX_CHARS = 512;
485
501
  const AUTOMATION_DEFAULT_LEASE_MS = 6e4;
486
502
  const AUTOMATION_CLAIM_MAX_RUNS = 8;
487
503
  const AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS = 6e4;
@@ -512,7 +528,7 @@ const AutomationActionSchema = z$1.discriminatedUnion("kind", [
512
528
  worktree: z$1.boolean().optional(),
513
529
  sticky: AutomationStickySchema.optional()
514
530
  }),
515
- z$1.object({ kind: z$1.literal("send"), sessionId: id$1, prompt: text }),
531
+ z$1.object({ kind: z$1.literal("send"), sessionId: id$2, prompt: text }),
516
532
  z$1.object({
517
533
  kind: z$1.literal("script"),
518
534
  command: z$1.array(z$1.string().min(1).max(4096)).min(1).max(256),
@@ -538,7 +554,7 @@ const maxRuntimeMs = z$1.number().int().min(6e4).max(7 * 864e5);
538
554
  z$1.object({
539
555
  name: AutomationNameSchema,
540
556
  description: z$1.string().max(4e3).nullable().optional(),
541
- machineId: id$1,
557
+ machineId: id$2,
542
558
  trigger: AutomationTriggerSchema,
543
559
  action: AutomationActionSchema,
544
560
  concurrency: AutomationConcurrencySchema.optional(),
@@ -547,13 +563,13 @@ z$1.object({
547
563
  /** B-548. Older servers strip it silently — clients must check the response echoes `precheck`. */
548
564
  precheck: AutomationPrecheckSchema.nullable().optional(),
549
565
  /** B-644: sessions this automation spawns join this project (quiet variant). Older servers strip it — check the echo. */
550
- projectId: id$1.nullable().optional()
566
+ projectId: id$2.nullable().optional()
551
567
  });
552
568
  z$1.object({
553
569
  version: z$1.number().int().positive(),
554
570
  name: AutomationNameSchema.optional(),
555
571
  description: z$1.string().max(4e3).nullable().optional(),
556
- machineId: id$1.optional(),
572
+ machineId: id$2.optional(),
557
573
  trigger: AutomationTriggerSchema.optional(),
558
574
  action: AutomationActionSchema.optional(),
559
575
  concurrency: AutomationConcurrencySchema.optional(),
@@ -561,41 +577,41 @@ z$1.object({
561
577
  /** B-548: omitted keeps the current precheck, `null` removes it. Changing `action` alone keeps it too. */
562
578
  precheck: AutomationPrecheckSchema.nullable().optional(),
563
579
  /** B-644: omitted keeps the current project, `null` detaches. */
564
- projectId: id$1.nullable().optional()
580
+ projectId: id$2.nullable().optional()
565
581
  });
566
582
  const payload = z$1.string().max(AUTOMATION_PAYLOAD_MAX_BYTES).refine((v) => new TextEncoder().encode(v).length <= AUTOMATION_PAYLOAD_MAX_BYTES, "payload exceeds 64KB");
567
583
  z$1.object({ payload: payload.optional(), dedupeKey: z$1.string().min(1).max(256).optional() });
568
584
  z$1.object({ payload: payload.optional() });
569
585
  z$1.object({
570
- machineId: id$1,
586
+ machineId: id$2,
571
587
  limit: z$1.number().int().min(1).max(AUTOMATION_CLAIM_MAX_RUNS).optional(),
572
588
  leaseMs: z$1.number().int().min(5e3).max(36e5).optional(),
573
589
  /** B-548: what this daemon can execute (e.g. `precheck`). Older daemons send nothing; older servers strip it. */
574
590
  capabilities: z$1.array(z$1.string().min(1).max(64)).max(32).optional()
575
591
  });
576
592
  z$1.object({
577
- claimId: id$1.optional(),
593
+ claimId: id$2.optional(),
578
594
  status: z$1.enum(["running", "done", "failed", "skipped"]).optional(),
579
- sessionId: id$1.nullable().optional(),
595
+ sessionId: id$2.nullable().optional(),
580
596
  stickyKey: z$1.string().min(1).max(512).optional(),
581
597
  summary: z$1.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
582
598
  error: z$1.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
583
599
  exitCode: z$1.number().int().nullable().optional(),
584
600
  needsAttention: z$1.boolean().optional(),
585
- attentionReason: z$1.string().max(512).nullable().optional(),
601
+ attentionReason: z$1.string().max(AUTOMATION_ATTENTION_REASON_MAX_CHARS).nullable().optional(),
586
602
  leaseMs: z$1.number().int().min(5e3).max(36e5).optional()
587
603
  });
588
604
  z$1.object({ by: z$1.string().min(1).max(64).optional() });
589
- z$1.object({ key: z$1.string().min(1).max(512), sessionId: id$1 });
605
+ z$1.object({ key: z$1.string().min(1).max(512), sessionId: id$2 });
590
606
  z$1.object({ key: z$1.string().min(1).max(512) });
591
607
  z$1.object({
592
- automationId: id$1.optional(),
608
+ automationId: id$2.optional(),
593
609
  name: AutomationNameSchema.optional(),
594
610
  status: z$1.string().min(1).max(64).optional(),
595
611
  attention: z$1.enum(["1", "true", "0", "false"]).optional(),
596
612
  limit: z$1.coerce.number().int().min(1).max(200).optional()
597
613
  });
598
- z$1.object({ machineId: id$1.optional() });
614
+ z$1.object({ machineId: id$2.optional() });
599
615
  const PROJECT_SESSION_CAPABILITY = "project-v1";
600
616
  const PROJECT_LIMITS = {
601
617
  nameChars: 120,
@@ -607,11 +623,11 @@ const PROJECT_LIMITS = {
607
623
  messageBytes: 64 * 1024,
608
624
  presenceBatch: 200,
609
625
  memberBatch: 200};
610
- const id = z$1.string().min(1).max(128);
626
+ const id$1 = z$1.string().min(1).max(128);
611
627
  const utf8Bytes = (value) => new TextEncoder().encode(value).length;
612
628
  const boundedText = (maxBytes) => z$1.string().max(maxBytes).refine((v) => utf8Bytes(v) <= maxBytes, `exceeds ${maxBytes} bytes`);
613
629
  const ProjectFolderSchema = z$1.object({
614
- machineId: id,
630
+ machineId: id$1,
615
631
  path: z$1.string().min(1).max(4096),
616
632
  primary: z$1.boolean().optional()
617
633
  });
@@ -631,9 +647,9 @@ z$1.object({
631
647
  folders: z$1.array(ProjectFolderSchema).max(PROJECT_LIMITS.folders).optional(),
632
648
  defaults: ProjectDefaultsSchema.optional(),
633
649
  /** Idempotency: the same requestId returns the project it created. */
634
- requestId: id.optional(),
650
+ requestId: id$1.optional(),
635
651
  /** Optional initial members (e.g. "设为项目" moves a folder's sessions in one step). */
636
- sessionIds: z$1.array(id).max(PROJECT_LIMITS.memberBatch).optional()
652
+ sessionIds: z$1.array(id$1).max(PROJECT_LIMITS.memberBatch).optional()
637
653
  });
638
654
  z$1.object({
639
655
  name: z$1.string().trim().min(1).max(PROJECT_LIMITS.nameChars).optional(),
@@ -649,7 +665,7 @@ z$1.object({
649
665
  summary: z$1.string().max(200).optional()
650
666
  });
651
667
  z$1.object({
652
- sessionIds: z$1.array(id).min(1).max(PROJECT_LIMITS.memberBatch),
668
+ sessionIds: z$1.array(id$1).min(1).max(PROJECT_LIMITS.memberBatch),
653
669
  via: ProjectMemberViaInputSchema.optional()
654
670
  });
655
671
  z$1.object({
@@ -659,15 +675,15 @@ z$1.object({
659
675
  /** Entry id (or `#seq`) this entry replaces. */
660
676
  supersedes: z$1.string().min(1).max(128).optional(),
661
677
  /** Stamped by the wrapper (the agent cannot fill it). Absent = written by the user. */
662
- authorSessionId: id.optional()
678
+ authorSessionId: id$1.optional()
663
679
  });
664
680
  z$1.object({
665
681
  /** When set, only entries this session authored may be revoked. Absent = the owner. */
666
- bySessionId: id.optional()
682
+ bySessionId: id$1.optional()
667
683
  });
668
- z$1.object({ teamId: id });
684
+ z$1.object({ teamId: id$1 });
669
685
  const ProjectPresenceEntrySchema = z$1.object({
670
- sessionId: id,
686
+ sessionId: id$1,
671
687
  title: z$1.string().max(200).nullable().optional(),
672
688
  agent: z$1.string().max(64).nullable().optional(),
673
689
  machine: z$1.string().max(200).nullable().optional(),
@@ -679,19 +695,19 @@ const ProjectPresenceEntrySchema = z$1.object({
679
695
  capabilities: z$1.array(z$1.string().max(64)).max(32).optional()
680
696
  });
681
697
  z$1.object({
682
- machineId: id,
698
+ machineId: id$1,
683
699
  sessions: z$1.array(ProjectPresenceEntrySchema).max(PROJECT_LIMITS.presenceBatch),
684
700
  /** Sessions of this machine that stopped; their presence rows are marked `offline`. */
685
- gone: z$1.array(id).max(PROJECT_LIMITS.presenceBatch).optional()
701
+ gone: z$1.array(id$1).max(PROJECT_LIMITS.presenceBatch).optional()
686
702
  });
687
703
  z$1.object({
688
- fromSessionId: id,
689
- toSessionId: id,
704
+ fromSessionId: id$1,
705
+ toSessionId: id$1,
690
706
  body: boundedText(PROJECT_LIMITS.messageBytes).pipe(z$1.string().min(1))
691
707
  });
692
708
  z$1.object({
693
- sessionId: id,
694
- messageIds: z$1.array(id).min(1).max(100)
709
+ sessionId: id$1,
710
+ messageIds: z$1.array(id$1).min(1).max(100)
695
711
  });
696
712
  z$1.object({
697
713
  full: z$1.enum(["0", "1", "true", "false"]).optional(),
@@ -730,9 +746,9 @@ function object(value) {
730
746
  function stamp(value) {
731
747
  return typeof value === "number" && Number.isFinite(value) && value >= 0;
732
748
  }
733
- function parseBuiltinTodo(raw, key) {
749
+ function parseBuiltinTodo(raw, key2) {
734
750
  if (!object(raw) || raw.schemaVersion !== 1 || typeof raw.id !== "string" || !UUID.test(raw.id)) return null;
735
- if (key !== void 0 && key !== BUILTIN_TODO_PREFIX + raw.id) return null;
751
+ if (key2 !== void 0 && key2 !== BUILTIN_TODO_PREFIX + raw.id) return null;
736
752
  if (typeof raw.title !== "string" || !raw.title.trim() || raw.title.length > TITLE_MAX_LENGTH) return null;
737
753
  if (typeof raw.note !== "string" || raw.note.length > NOTE_MAX_LENGTH) return null;
738
754
  if (raw.status !== "open" && raw.status !== "done") return null;
@@ -757,11 +773,11 @@ function encodeBuiltinTodo(todo) {
757
773
  for (const byte of bytes) binary += String.fromCharCode(byte);
758
774
  return btoa(binary);
759
775
  }
760
- function decodeBuiltinTodo(value, key) {
776
+ function decodeBuiltinTodo(value, key2) {
761
777
  try {
762
778
  const binary = atob(value);
763
779
  const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
764
- return parseBuiltinTodo(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)), key);
780
+ return parseBuiltinTodo(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)), key2);
765
781
  } catch {
766
782
  return null;
767
783
  }
@@ -769,12 +785,12 @@ function decodeBuiltinTodo(value, key) {
769
785
  function sortBuiltinTodos(records) {
770
786
  return [...records].sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
771
787
  }
772
- function createBuiltinTodoClient(credentials, options) {
773
- const serverUrl = options.serverUrl.replace(/\/$/, "");
788
+ function createBuiltinTodoClient(credentials, options2) {
789
+ const serverUrl = options2.serverUrl.replace(/\/$/, "");
774
790
  const token = credentials.token;
775
- const clientId = options.clientId;
776
- const fetcher = options.fetch ?? globalThis.fetch.bind(globalThis);
777
- const timeoutMs = options.timeoutMs ?? 15e3;
791
+ const clientId = options2.clientId;
792
+ const fetcher = options2.fetch ?? globalThis.fetch.bind(globalThis);
793
+ const timeoutMs = options2.timeoutMs ?? 15e3;
778
794
  async function request(path, mutations, allowNotFound = false) {
779
795
  const controller = new AbortController();
780
796
  const timer = setTimeout(() => controller.abort(), timeoutMs);
@@ -853,19 +869,19 @@ function createBuiltinTodoClient(credentials, options) {
853
869
  const pendingCreates = /* @__PURE__ */ new Map();
854
870
  async function get(id2) {
855
871
  if (!UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
856
- const key = BUILTIN_TODO_PREFIX + id2;
857
- const raw = await request(`/v1/kv/${encodeURIComponent(key)}`, void 0, true);
872
+ const key2 = BUILTIN_TODO_PREFIX + id2;
873
+ const raw = await request(`/v1/kv/${encodeURIComponent(key2)}`, void 0, true);
858
874
  if (raw === void 0) return null;
859
- const todo = object(raw) && typeof raw.value === "string" ? decodeBuiltinTodo(raw.value, key) : null;
860
- if (!todo || !object(raw) || raw.key !== key || !Number.isSafeInteger(raw.version) || raw.version < 0) {
875
+ const todo = object(raw) && typeof raw.value === "string" ? decodeBuiltinTodo(raw.value, key2) : null;
876
+ if (!todo || !object(raw) || raw.key !== key2 || !Number.isSafeInteger(raw.version) || raw.version < 0) {
861
877
  throw new BuiltinTodoError("invalid-response", "Invalid Todo read response");
862
878
  }
863
879
  return { ...todo, version: raw.version };
864
880
  }
865
- async function create(title, note = "", id2) {
866
- const cleanTitle = title.trim();
881
+ async function create(title2, note2 = "", id2) {
882
+ const cleanTitle = title2.trim();
867
883
  if (id2 !== void 0 && !UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
868
- const payloadKey = JSON.stringify([cleanTitle, note, id2]);
884
+ const payloadKey = JSON.stringify([cleanTitle, note2, id2]);
869
885
  let pending = pendingCreates.get(payloadKey);
870
886
  if (pending?.operation) return pending.operation;
871
887
  if (!pending) {
@@ -874,7 +890,7 @@ function createBuiltinTodoClient(credentials, options) {
874
890
  schemaVersion: 1,
875
891
  id: id2 ?? crypto.randomUUID(),
876
892
  title: cleanTitle,
877
- note,
893
+ note: note2,
878
894
  status: "open",
879
895
  order: 0,
880
896
  createdAt: now,
@@ -887,14 +903,14 @@ function createBuiltinTodoClient(credentials, options) {
887
903
  const entry = pending;
888
904
  const operation = (async () => {
889
905
  if (entry.attempted) {
890
- const key = BUILTIN_TODO_PREFIX + entry.draft.id;
891
- const existing = await request(`/v1/kv/${encodeURIComponent(key)}`, void 0, true);
906
+ const key2 = BUILTIN_TODO_PREFIX + entry.draft.id;
907
+ const existing = await request(`/v1/kv/${encodeURIComponent(key2)}`, void 0, true);
892
908
  if (existing !== void 0) {
893
- const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value, key) : null;
894
- if (!todo || !object(existing) || existing.key !== key || !Number.isSafeInteger(existing.version) || existing.version < 0) {
909
+ const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value, key2) : null;
910
+ if (!todo || !object(existing) || existing.key !== key2 || !Number.isSafeInteger(existing.version) || existing.version < 0) {
895
911
  throw new BuiltinTodoError("invalid-response", "Cannot confirm the previous Todo creation");
896
912
  }
897
- if (id2 && (todo.title !== cleanTitle || todo.note !== note)) throw new BuiltinTodoError("conflict", "This Todo ID already has different content; read it before deciding");
913
+ if (id2 && (todo.title !== cleanTitle || todo.note !== note2)) throw new BuiltinTodoError("conflict", "This Todo ID already has different content; read it before deciding");
898
914
  return { ...todo, version: existing.version };
899
915
  }
900
916
  }
@@ -1137,5 +1153,195 @@ const ServerMigrateNoticeSchema = z$1.object({
1137
1153
  handoff: z$1.string().regex(/^vh1\.[A-Za-z0-9_-]{16,2048}\.[A-Za-z0-9_-]{43}$/),
1138
1154
  issuedAt: z$1.number().int().positive()
1139
1155
  });
1156
+ const ATTENTION_SESSION_CAPABILITY = "owner-board-v1";
1157
+ const ATTENTION_DISABLED_ERROR = "owner_board_disabled";
1158
+ const ATTENTION_LIMITS = {
1159
+ titleChars: 120,
1160
+ bodyBytes: 8 * 1024,
1161
+ keyChars: 256,
1162
+ options: { min: 2, max: 4 },
1163
+ optionIdChars: 16,
1164
+ optionLabelChars: 120,
1165
+ optionDetailChars: 1e3,
1166
+ links: 16,
1167
+ linkRefChars: 2048,
1168
+ linkLabelChars: 120,
1169
+ snippetChars: 200,
1170
+ noteChars: 2e3,
1171
+ listMax: 200,
1172
+ /** Open `needsOwner` items per session before the playbook asks the lead to merge or drop stale ones (§5.1 rule 6). */
1173
+ openPerSessionSoftCap: 5
1174
+ };
1175
+ const ATTENTION_SOURCES = ["lead", "agent", "owner", "automation", "team"];
1176
+ const ATTENTION_KINDS = ["decision", "todo", "blocked", "report", "answer", "question", "request", "pin"];
1177
+ const OWNER_BOARD_POST_KINDS = ["decision", "todo", "report", "answer"];
1178
+ const OWNER_BOARD_RESOLVE_OUTCOMES = ["done", "answered", "dropped", "superseded"];
1179
+ const ATTENTION_BOARD_LOCAL_ID_PREFIX = "board-";
1180
+ function isAttentionBoardLocalId(localId) {
1181
+ return typeof localId === "string" && localId.startsWith(ATTENTION_BOARD_LOCAL_ID_PREFIX);
1182
+ }
1183
+ const id = z$1.string().min(1).max(128);
1184
+ const title = z$1.string().trim().min(1).max(ATTENTION_LIMITS.titleChars);
1185
+ const bodyMd = z$1.string().max(ATTENTION_LIMITS.bodyBytes * 4).refine((v) => new TextEncoder().encode(v).length <= ATTENTION_LIMITS.bodyBytes, "body exceeds 8KB");
1186
+ const note = z$1.string().max(ATTENTION_LIMITS.noteChars);
1187
+ const requestId = z$1.string().min(1).max(128);
1188
+ const key = z$1.string().min(1).max(ATTENTION_LIMITS.keyChars);
1189
+ const AttentionOptionSchema = z$1.object({
1190
+ id: z$1.string().trim().min(1).max(ATTENTION_LIMITS.optionIdChars),
1191
+ label: z$1.string().trim().min(1).max(ATTENTION_LIMITS.optionLabelChars),
1192
+ detail: z$1.string().max(ATTENTION_LIMITS.optionDetailChars).optional(),
1193
+ recommended: z$1.boolean().optional()
1194
+ });
1195
+ const options = z$1.array(AttentionOptionSchema).min(ATTENTION_LIMITS.options.min).max(ATTENTION_LIMITS.options.max).refine((o) => new Set(o.map((x) => x.id)).size === o.length, "option ids must be unique");
1196
+ const ATTENTION_LINK_TYPES = ["task", "pr", "commit", "url", "panel"];
1197
+ const AttentionLinkSchema = z$1.object({
1198
+ type: z$1.enum(ATTENTION_LINK_TYPES),
1199
+ ref: z$1.string().trim().min(1).max(ATTENTION_LIMITS.linkRefChars),
1200
+ label: z$1.string().max(ATTENTION_LIMITS.linkLabelChars).optional()
1201
+ });
1202
+ const links = z$1.array(AttentionLinkSchema).max(ATTENTION_LIMITS.links);
1203
+ const AttentionAnchorSchema = z$1.object({
1204
+ localId: z$1.string().min(1).max(256).optional(),
1205
+ messageId: z$1.string().min(1).max(128).optional(),
1206
+ snippet: z$1.string().max(ATTENTION_LIMITS.snippetChars).optional()
1207
+ }).refine((a) => a.localId !== void 0 || a.messageId !== void 0, "anchor needs localId or messageId");
1208
+ const AttentionItemSchema = z$1.object({
1209
+ id: z$1.string(),
1210
+ sessionId: z$1.string(),
1211
+ teamId: z$1.string().nullable(),
1212
+ projectId: z$1.string().nullable(),
1213
+ source: z$1.string(),
1214
+ kind: z$1.string(),
1215
+ key: z$1.string().nullable(),
1216
+ title: z$1.string(),
1217
+ bodyMd: z$1.string().nullable(),
1218
+ options: z$1.array(AttentionOptionSchema.passthrough()).nullable(),
1219
+ links: z$1.array(z$1.object({ type: z$1.string(), ref: z$1.string(), label: z$1.string().optional() }).passthrough()).nullable(),
1220
+ anchor: z$1.object({ localId: z$1.string().optional(), messageId: z$1.string().optional(), snippet: z$1.string().optional() }).nullable(),
1221
+ /** The lead's first in-stream reply to an owner question (auto-attached by the CLI, §4.4). */
1222
+ firstReply: z$1.object({ localId: z$1.string().optional(), messageId: z$1.string().optional(), snippet: z$1.string().optional() }).nullable(),
1223
+ replyToId: z$1.string().nullable(),
1224
+ /** D5: drafted by the CLI from the lead's text (「自动识别」), not posted by the lead. No push until the lead confirms it. */
1225
+ inferred: z$1.boolean().default(false),
1226
+ needsOwner: z$1.boolean(),
1227
+ state: z$1.string(),
1228
+ ownerChoice: z$1.string().nullable(),
1229
+ ownerNote: z$1.string().nullable(),
1230
+ resolvedBy: z$1.string().nullable(),
1231
+ /** The lead's `owner_board_resolve` note. */
1232
+ resolveNote: z$1.string().nullable(),
1233
+ /** Times the same `(sessionId, key)` was posted again and folded into this item. */
1234
+ repostCount: z$1.number(),
1235
+ createdAt: z$1.number(),
1236
+ updatedAt: z$1.number(),
1237
+ resolvedAt: z$1.number().nullable(),
1238
+ pushedAt: z$1.number().nullable(),
1239
+ /** Bumped on every mutation; clients keep the highest version per id. */
1240
+ version: z$1.number()
1241
+ });
1242
+ z$1.object({
1243
+ t: z$1.literal("attention-item"),
1244
+ item: AttentionItemSchema
1245
+ });
1246
+ z$1.object({
1247
+ sessionId: id,
1248
+ source: z$1.enum(ATTENTION_SOURCES),
1249
+ kind: z$1.enum(ATTENTION_KINDS),
1250
+ title,
1251
+ bodyMd: bodyMd.optional(),
1252
+ options: options.optional(),
1253
+ links: links.optional(),
1254
+ anchor: AttentionAnchorSchema.optional(),
1255
+ replyToId: id.optional(),
1256
+ key: key.optional(),
1257
+ requestId: requestId.optional(),
1258
+ /**
1259
+ * D5 draft: only the CLI's auto-detect path sets it (`owner_board_post` does
1260
+ * not expose it). A repost of the key with `false` confirms the draft (and
1261
+ * pushes once); a draft never downgrades a confirmed item.
1262
+ */
1263
+ inferred: z$1.boolean().default(false)
1264
+ }).refine((p) => p.kind !== "decision" || p.options !== void 0, { message: "decision needs 2-4 options", path: ["options"] });
1265
+ z$1.object({
1266
+ title: title.optional(),
1267
+ bodyMd: bodyMd.nullable().optional(),
1268
+ appendMd: bodyMd.optional(),
1269
+ options: options.nullable().optional(),
1270
+ links: links.nullable().optional(),
1271
+ /** Only `question` → `request` (the lead reclassifies an owner message, §4.4). */
1272
+ kind: z$1.literal("request").optional(),
1273
+ state: z$1.enum(["open", "in_progress", "answered"]).optional(),
1274
+ firstReply: AttentionAnchorSchema.optional(),
1275
+ requestId: requestId.optional()
1276
+ }).refine((p) => !(p.bodyMd !== void 0 && p.appendMd !== void 0), "use bodyMd or appendMd, not both");
1277
+ z$1.object({
1278
+ outcome: z$1.enum(OWNER_BOARD_RESOLVE_OUTCOMES),
1279
+ note: note.optional(),
1280
+ /** Defaults to `lead`. */
1281
+ by: z$1.enum(["lead", "auto-first-reply"]).optional(),
1282
+ requestId: requestId.optional()
1283
+ });
1284
+ z$1.discriminatedUnion("action", [
1285
+ z$1.object({ action: z$1.literal("choose"), choice: z$1.string().trim().min(1).max(ATTENTION_LIMITS.optionIdChars), note: note.optional() }),
1286
+ z$1.object({ action: z$1.literal("resolve"), note: note.optional() }),
1287
+ z$1.object({ action: z$1.literal("reopen"), note: note.optional() })
1288
+ ]);
1289
+ z$1.object({
1290
+ sessionId: id.optional(),
1291
+ /** `open` (default) = open + in_progress; `active` adds the latest `answered`; `all` = everything. */
1292
+ state: z$1.enum(["open", "active", "all"]).optional(),
1293
+ needsOwner: z$1.enum(["1", "true", "0", "false"]).optional(),
1294
+ /** Epoch ms; only items updated after it. */
1295
+ since: z$1.coerce.number().int().nonnegative().optional(),
1296
+ limit: z$1.coerce.number().int().min(1).max(ATTENTION_LIMITS.listMax).optional()
1297
+ });
1298
+ const OwnerBoardPostInputSchema = z$1.object({
1299
+ kind: z$1.enum(OWNER_BOARD_POST_KINDS),
1300
+ title,
1301
+ body_md: bodyMd.optional(),
1302
+ options: options.optional(),
1303
+ links: links.optional(),
1304
+ reply_to: id.optional(),
1305
+ key: key.optional(),
1306
+ anchor: z$1.union([z$1.literal("this_turn"), z$1.object({ localId: z$1.string().min(1).max(256) })]).optional(),
1307
+ request_id: requestId
1308
+ }).refine((p) => p.kind !== "decision" || p.options !== void 0, { message: "decision needs 2-4 options", path: ["options"] });
1309
+ const OwnerBoardUpdateInputSchema = z$1.object({
1310
+ id,
1311
+ title: title.optional(),
1312
+ body_md: bodyMd.optional(),
1313
+ append_md: bodyMd.optional(),
1314
+ options: options.optional(),
1315
+ links: links.optional(),
1316
+ state: z$1.enum(["open", "in_progress"]).optional(),
1317
+ request_id: requestId
1318
+ }).refine((p) => !(p.body_md !== void 0 && p.append_md !== void 0), "use body_md or append_md, not both");
1319
+ const OwnerBoardResolveInputSchema = z$1.object({
1320
+ id,
1321
+ outcome: z$1.enum(OWNER_BOARD_RESOLVE_OUTCOMES),
1322
+ note: note.optional(),
1323
+ request_id: requestId
1324
+ });
1325
+ const OwnerBoardListInputSchema = z$1.object({
1326
+ state: z$1.enum(["open", "all"]).optional(),
1327
+ /** ISO-8601 or epoch ms. */
1328
+ since: z$1.string().min(1).max(64).optional()
1329
+ });
1330
+ function ownerBoardPostToRest(sessionId, input, anchor) {
1331
+ return {
1332
+ sessionId,
1333
+ source: "lead",
1334
+ kind: input.kind,
1335
+ title: input.title,
1336
+ ...input.body_md !== void 0 ? { bodyMd: input.body_md } : {},
1337
+ ...input.options ? { options: input.options } : {},
1338
+ ...input.links ? { links: input.links } : {},
1339
+ ...anchor ? { anchor } : {},
1340
+ ...input.reply_to ? { replyToId: input.reply_to } : {},
1341
+ ...input.key ? { key: input.key } : {},
1342
+ requestId: input.request_id,
1343
+ inferred: false
1344
+ };
1345
+ }
1140
1346
 
1141
- export { AUTOMATION_NAME_PATTERN as A, BUILTIN_TODO_SKILL as B, CODEX_STEER_CAPABILITY as C, AUTOMATION_CLAIM_MAX_RUNS as D, AUTOMATION_DAEMON_CAPABILITY_PRECHECK as E, AUTOMATION_DEFAULT_LEASE_MS as F, HARNESS_INSTALL_CAPABILITY_VERSION as H, PROMPT_QUEUE_CAPABILITY as P, ReleaseDrainNoticeSchema as R, STREAM_DELTA_MAX_CHARS as S, PROJECT_SESSION_CAPABILITY as a, AUTOMATION_PRECHECK_MAX_TIMEOUT_MS as b, AutomationPrecheckSchema as c, createEnvelope as d, createBuiltinTodoClient as e, BUILTIN_TODO_DISCOVERY as f, getAgentCodeDefaults as g, isClaudeOpus55Model as h, isAutomationRunTerminal as i, supportsClaudeOpus55 as j, AutomationNameSchema as k, AutomationConcurrencySchema as l, AutomationActionSchema as m, normalizeAgentKey as n, AutomationTriggerSchema as o, AgentVersionsSchema as p, PI_STEER_CAPABILITY as q, AGENT_VERSION_SOURCES as r, streamKeyOf as s, RelayAssignmentResponseSchema as t, RelayCandidatesResponseSchema as u, ServerMigrateNoticeSchema as v, isHarnessInstallId as w, AUTOMATION_SUMMARY_MAX_CHARS as x, AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS as y, AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS as z };
1347
+ export { AUTOMATION_NAME_PATTERN as A, BUILTIN_TODO_SKILL as B, isAttentionBoardLocalId as C, OwnerBoardUpdateInputSchema as D, OwnerBoardResolveInputSchema as E, OwnerBoardListInputSchema as F, ATTENTION_SESSION_CAPABILITY as G, RelayAssignmentResponseSchema as H, CODEX_STEER_CAPABILITY as I, RelayCandidatesResponseSchema as J, ServerMigrateNoticeSchema as K, isHarnessInstallId as L, AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS as M, AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS as N, OwnerBoardPostInputSchema as O, PROMPT_QUEUE_CAPABILITY as P, AUTOMATION_CLAIM_MAX_RUNS as Q, ReleaseDrainNoticeSchema as R, STREAM_DELTA_MAX_CHARS as S, AUTOMATION_DAEMON_CAPABILITY_PRECHECK as T, AUTOMATION_DEFAULT_LEASE_MS as U, HARNESS_INSTALL_CAPABILITY_VERSION as V, PROJECT_SESSION_CAPABILITY as a, AUTOMATION_PRECHECK_MAX_TIMEOUT_MS as b, AutomationPrecheckSchema as c, AUTOMATION_ATTENTION_REASON_MAX_CHARS as d, AUTOMATION_SUMMARY_MAX_CHARS as e, isInsideTeamWorktree as f, createEnvelope as g, createBuiltinTodoClient as h, isAutomationRunTerminal as i, BUILTIN_TODO_DISCOVERY as j, getAgentCodeDefaults as k, isClaudeOpus55Model as l, supportsClaudeOpus55 as m, normalizeAgentKey as n, AutomationNameSchema as o, AutomationConcurrencySchema as p, AutomationActionSchema as q, rebaseTeamWorktreePath as r, streamKeyOf as s, AutomationTriggerSchema as t, AgentVersionsSchema as u, PI_STEER_CAPABILITY as v, AGENT_VERSION_SOURCES as w, ATTENTION_DISABLED_ERROR as x, ATTENTION_LIMITS as y, ownerBoardPostToRest as z };
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var query = require('./query-CdCxzuaB.cjs');
3
+ var query = require('./query-CZQG1PdU.cjs');
4
4
  var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
5
5
  require('./smallFastModel-D_uxGMo3.cjs');
6
- require('./logger-DgBwUSgS.cjs');
6
+ require('./logger-Cgwz30rK.cjs');
7
7
  require('chalk');
8
8
  require('node:util');
9
- require('./configuration-C8JgseHy.cjs');
9
+ require('./configuration-K3I6yOjZ.cjs');
10
10
  require('node:fs');
11
11
  require('node:os');
12
12
  require('node:path');
13
- require('./package-NoD8QOOM.cjs');
13
+ require('./package-3aPiSpZj.cjs');
14
14
  require('node:fs/promises');
15
15
  require('./processTreeSnapshot-mDbnuojn.cjs');
16
16
  require('node:child_process');
@@ -1,4 +1,4 @@
1
- import { p as packageJson } from './package-DYGwlmXl.mjs';
1
+ import { p as packageJson } from './package-CTrz6U3C.mjs';
2
2
  import module$1 from 'node:module';
3
3
  import { existsSync } from 'node:fs';
4
4
  import { readdir, rm } from 'node:fs/promises';
@@ -57,10 +57,10 @@ async function pruneStaleCompileCaches(happyHomeDir, cliVersion) {
57
57
  async function run(args) {
58
58
  enableCompileCacheIfPossible(packageJson.version);
59
59
  if (isStandaloneVersionRequest(args) || isSelfCheckRequest(args)) {
60
- const { selfCheckMain } = await import('./selfCheck-NamtBHVB.mjs');
60
+ const { selfCheckMain } = await import('./selfCheck-ZGgBtxFQ.mjs');
61
61
  process.exit(await selfCheckMain({ verbose: isSelfCheckRequest(args) }));
62
62
  }
63
- const { main } = await import('./main-_1LSzlLv.mjs');
63
+ const { main } = await import('./main-DNDL6t8z.mjs');
64
64
  await main();
65
65
  }
66
66
  void run(process.argv.slice(2));