very-happy-cli 0.2.198 → 0.2.200

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 (214) hide show
  1. package/dist/{AcpBackend-Bm3EodAb.mjs → AcpBackend-Cnp6WNn8.mjs} +3 -3
  2. package/dist/{AcpBackend-DOuWeCAx.cjs → AcpBackend-CwSShYPI.cjs} +3 -3
  3. package/dist/{AcpSessionManager-BiwuXpbx.mjs → AcpSessionManager-C4O3jhT_.mjs} +2 -2
  4. package/dist/{AcpSessionManager-DvsZWTXp.cjs → AcpSessionManager-DqW99tOL.cjs} +2 -2
  5. package/dist/{BasePermissionHandler-1QcavYFn.mjs → BasePermissionHandler-8Msj0Z8j.mjs} +1 -1
  6. package/dist/{BasePermissionHandler-25RmI4dK.cjs → BasePermissionHandler-CgqjIUyG.cjs} +1 -1
  7. package/dist/{account-DA4mbX3-.mjs → account-BIxPuBEs.mjs} +11 -11
  8. package/dist/{account-ChUtFYld.cjs → account-DcNh2_SN.cjs} +11 -11
  9. package/dist/{accountService-BWUjgHl0.cjs → accountService-BDJo14mY.cjs} +4 -4
  10. package/dist/{accountService-D7NZrnQd.mjs → accountService-ELazcp3V.mjs} +4 -4
  11. package/dist/{acpSessionResume-CeQu84Ol.cjs → acpSessionResume-B_W8uTI6.cjs} +1 -1
  12. package/dist/{acpSessionResume-D6YgeofW.mjs → acpSessionResume-De_sTG30.mjs} +1 -1
  13. package/dist/{agentHome-DM6mC64c.mjs → agentHome-C-900jC1.mjs} +4 -4
  14. package/dist/{agentHome-DevJCRG9.cjs → agentHome-C-usjJwB.cjs} +4 -4
  15. package/dist/{api-te19Pzi3.cjs → api-BPWRzeNF.cjs} +16 -10
  16. package/dist/{api-oceym3w6.mjs → api-DCUiAds-.mjs} +16 -10
  17. package/dist/{apiMachine-DCHsqtFQ.mjs → apiMachine-CJl4m3V3.mjs} +18 -18
  18. package/dist/{apiMachine-BjhCXg6C.cjs → apiMachine-DjhbA1rL.cjs} +18 -18
  19. package/dist/{attachmentContent-Dl29U1v1.mjs → attachmentContent-BKIq6EXR.mjs} +2 -2
  20. package/dist/{attachmentContent-BfCEgPTP.cjs → attachmentContent-C2f1UEP9.cjs} +2 -2
  21. package/dist/{auth-BIkCWkRV.mjs → auth-8jKFCZOX.mjs} +5 -5
  22. package/dist/{auth-SshU0tNW.cjs → auth-h6oU63Ni.cjs} +8 -8
  23. package/dist/{auth-SH0o7ue7.cjs → auth-oAnLi4Tl.cjs} +5 -5
  24. package/dist/{auth-BJ8Tej9L.mjs → auth-uLRHXOGY.mjs} +8 -8
  25. package/dist/{auto-Bdr4sSJk.mjs → auto-A5arQ-bI.mjs} +17 -17
  26. package/dist/{auto-t1B1Yzb3.cjs → auto-Bpa5iA1A.cjs} +17 -17
  27. package/dist/{bootstrap-D8DYLUId.mjs → bootstrap-BkLFgEGF.mjs} +2 -2
  28. package/dist/{bootstrap-GZDknvPy.cjs → bootstrap-DUKAKxrJ.cjs} +2 -2
  29. package/dist/{browser-C-H3QYV2.mjs → browser-BAlw0rns.mjs} +1 -1
  30. package/dist/{browser-DwCi-9Ya.cjs → browser-Ds-N-Dup.cjs} +1 -1
  31. package/dist/{claudeAccountEnv-DmVbGhZb.mjs → claudeAccountEnv-CI8RlIB9.mjs} +1 -1
  32. package/dist/{claudeAccountEnv-DSaFKajJ.cjs → claudeAccountEnv-D33xXRE7.cjs} +1 -1
  33. package/dist/{claudeLocal-Ck1jTve1.cjs → claudeLocal-BbsOT-EF.cjs} +5 -5
  34. package/dist/{claudeLocal-BiM2x9DJ.mjs → claudeLocal-X48n0RhP.mjs} +5 -5
  35. package/dist/{claudeLocalLauncher-DzvM0jBo.mjs → claudeLocalLauncher-D18gRtxz.mjs} +10 -10
  36. package/dist/{claudeLocalLauncher-Jsupvl4V.cjs → claudeLocalLauncher-D1jS3iK4.cjs} +10 -10
  37. package/dist/{claudeSessionFork-CDTbQmYi.cjs → claudeSessionFork-Bkxn40Y8.cjs} +1 -1
  38. package/dist/{claudeSessionFork-D-BhXkRa.mjs → claudeSessionFork-n1vMiFcP.mjs} +1 -1
  39. package/dist/client-1zIbVVX5.cjs +120 -0
  40. package/dist/{client-BRuFIwki.mjs → client-BXwIqRha.mjs} +2 -2
  41. package/dist/client-BgxQ9aej.mjs +114 -0
  42. package/dist/{client-CISkP897.mjs → client-Blpuk2Hr.mjs} +2 -2
  43. package/dist/{client-D-HEr922.cjs → client-BnoN4P4t.cjs} +2 -2
  44. package/dist/{client-E4kW5qjR.mjs → client-C0qjAgZ_.mjs} +4 -4
  45. package/dist/{client-v6rdLsBH.cjs → client-C8BTmcrh.cjs} +4 -4
  46. package/dist/{client-oqSAKwmy.cjs → client-D0_UOmC1.cjs} +2 -2
  47. package/dist/codex/happyMcpStdioBridge.cjs +25 -16
  48. package/dist/codex/happyMcpStdioBridge.mjs +25 -16
  49. package/dist/{codexAccount-CnbDfCOM.mjs → codexAccount-BAezf1fY.mjs} +1 -1
  50. package/dist/{codexAccount-CQ4W1Ax8.cjs → codexAccount-DfeCHUOU.cjs} +1 -1
  51. package/dist/{codexAppServerClient-BLasFGTm.mjs → codexAppServerClient-By4ntTIr.mjs} +3 -3
  52. package/dist/{codexAppServerClient--K-ILfqM.cjs → codexAppServerClient-xBeqblCj.cjs} +3 -3
  53. package/dist/{codexCommand-Wv1WVNtM.mjs → codexCommand-C7BVsmPu.mjs} +58 -47
  54. package/dist/{codexCommand-M1uNblJx.cjs → codexCommand-CgzJe-Ti.cjs} +62 -51
  55. package/dist/{codexTermination-DigTBSJE.mjs → codexTermination-BS0sLBKS.mjs} +1 -1
  56. package/dist/{codexTermination-BumRIUqm.cjs → codexTermination-DVrdQx3Q.cjs} +1 -1
  57. package/dist/{config-Czs0Tucv.cjs → config-4R0rnthZ.cjs} +3 -3
  58. package/dist/{config-Br2fCFwB.mjs → config-D3jidXDu.mjs} +3 -3
  59. package/dist/{configuration-JBFF7432.mjs → configuration-4pG95tsq.mjs} +1 -1
  60. package/dist/{configuration-DfRs3WLd.cjs → configuration-ClUt7pqs.cjs} +1 -1
  61. package/dist/{connect-Cr--b0yl.cjs → connect-Da2NQJ3K.cjs} +13 -13
  62. package/dist/{connect-CbCqv-MV.mjs → connect-Do5qcqmg.mjs} +13 -13
  63. package/dist/{context-DLIjT5qU.mjs → context-Cf05DtNM.mjs} +1 -1
  64. package/dist/{context-C5WWlHOl.cjs → context-wMsIGwBw.cjs} +1 -1
  65. package/dist/{controlClient-B61crTpk.cjs → controlClient-SYDFcIkk.cjs} +3 -3
  66. package/dist/{controlClient-D5BYm3PU.mjs → controlClient-bqCKl9Nv.mjs} +3 -3
  67. package/dist/{createSessionMetadata-OMKj3e48.mjs → createSessionMetadata-CQkxe_4T.mjs} +3 -2
  68. package/dist/{createSessionMetadata-BwYysMTH.cjs → createSessionMetadata-msQTEvvn.cjs} +3 -2
  69. package/dist/{daemonAccounts-asWvoPKG.mjs → daemonAccounts-B8xnkprW.mjs} +3 -3
  70. package/dist/{daemonAccounts-CqAnPXDJ.cjs → daemonAccounts-Ch_rSTSX.cjs} +2 -2
  71. package/dist/{defaultPermissionMode-BItpIZML.cjs → defaultPermissionMode-BETWd5Lf.cjs} +1 -1
  72. package/dist/{defaultPermissionMode-4KYZA4WF.mjs → defaultPermissionMode-Cl3OvdHp.mjs} +1 -1
  73. package/dist/{deterministicJson-DnTSkEgb.mjs → deterministicJson-BRAeReBK.mjs} +67 -17
  74. package/dist/{deterministicJson-DIzyb1dQ.cjs → deterministicJson-CQ8jkArF.cjs} +72 -22
  75. package/dist/{doctor-Dn1G6QhF.cjs → doctor-C9D-t20z.cjs} +7 -7
  76. package/dist/{doctor-jrvm-tl3.mjs → doctor-Dy7z3qvy.mjs} +7 -7
  77. package/dist/{downloadTarget-DGnCGrDZ.cjs → downloadTarget-DfoOSrYi.cjs} +6 -6
  78. package/dist/{downloadTarget-BtsN_-LN.mjs → downloadTarget-Diq-GBu4.mjs} +6 -6
  79. package/dist/{ensureDaemonRunning-DsvcjXb4.cjs → ensureDaemonRunning-Df76EtKd.cjs} +5 -5
  80. package/dist/{ensureDaemonRunning-DCmXUwNi.mjs → ensureDaemonRunning-LqrgqVG3.mjs} +5 -5
  81. package/dist/format-CbliQN8V.mjs +70 -0
  82. package/dist/format-P9_M_7ga.cjs +74 -0
  83. package/dist/{handleResumeCommand-hzho-lp7.cjs → handleResumeCommand-CjCtwrrm.cjs} +5 -5
  84. package/dist/{handleResumeCommand-CFupxyHT.mjs → handleResumeCommand-Dz4Aw_aZ.mjs} +5 -5
  85. package/dist/{index-BMFLwBCd.mjs → index-BNBXrqRE.mjs} +4 -4
  86. package/dist/{index-BknTkVnR.cjs → index-BiutHOAO.cjs} +62 -1
  87. package/dist/{index-CRI-_-YH.cjs → index-ByBOdEvG.cjs} +48 -44
  88. package/dist/{index-DCfEzudP.cjs → index-CbzettaI.cjs} +4 -4
  89. package/dist/{index-5TDKOvkU.cjs → index-CdOnhx2X.cjs} +4 -4
  90. package/dist/{index-CHk8F9OY.mjs → index-CjMA70-R.mjs} +47 -43
  91. package/dist/{index-EGwuuFdL.cjs → index-DUwOmhnq.cjs} +3 -3
  92. package/dist/{index-CZpFhEmE.mjs → index-Sdvy1Lsf.mjs} +3 -3
  93. package/dist/{index-CofTgtQ3.mjs → index-XP-qcJQ3.mjs} +4 -4
  94. package/dist/{index-CxiisoO1.mjs → index-kwsivEs-.mjs} +49 -2
  95. package/dist/index.cjs +2 -2
  96. package/dist/index.mjs +2 -2
  97. package/dist/{install-CB5eTmzm.cjs → install-C4dKrmxR.cjs} +3 -3
  98. package/dist/{install-CeDqNGxI.mjs → install-DMXd8Z4c.mjs} +3 -3
  99. package/dist/issue-BijeNKIT.cjs +237 -0
  100. package/dist/issue-COytLvGE.mjs +229 -0
  101. package/dist/lib.cjs +12 -12
  102. package/dist/lib.d.cts +6 -0
  103. package/dist/lib.d.mts +6 -0
  104. package/dist/lib.mjs +12 -12
  105. package/dist/{localHappyAgentAuth-B6xdH-Fr.cjs → localHappyAgentAuth-CjtNcaI0.cjs} +1 -1
  106. package/dist/{localHappyAgentAuth-BiIyMoiG.mjs → localHappyAgentAuth-DeDQjw24.mjs} +1 -1
  107. package/dist/{logger-BHfBDOsy.mjs → logger-BLMi8oJK.mjs} +2 -2
  108. package/dist/{logger-BrAF4iuT.cjs → logger-D28MY1Bv.cjs} +2 -2
  109. package/dist/{machineMetadata-D5PO2ylb.cjs → machineMetadata-BzjrIn_N.cjs} +3 -3
  110. package/dist/{machineMetadata-Ekniv5o4.mjs → machineMetadata-D8OWVD4l.mjs} +3 -3
  111. package/dist/{main-C8lsRSYS.cjs → main-DoJIcSOh.cjs} +57 -47
  112. package/dist/{main-HXdcnexS.mjs → main-c0fCuBON.mjs} +57 -47
  113. package/dist/{mcp-D9sglL02.cjs → mcp-CEtvR6tG.cjs} +18 -18
  114. package/dist/{mcp-C2YD6mq4.mjs → mcp-DKkBFGUa.mjs} +18 -18
  115. package/dist/{mirrorProtocol-CNF1eHsm.cjs → mirrorProtocol-CCl9dtzh.cjs} +3 -3
  116. package/dist/{mirrorProtocol-BLhArCS9.mjs → mirrorProtocol-DFQLXDBI.mjs} +3 -3
  117. package/dist/{package-CStJrLG3.cjs → package-BFSsS_dl.cjs} +7 -7
  118. package/dist/{package-BGZo2vAj.mjs → package-DbGqY8Ej.mjs} +7 -7
  119. package/dist/{panels-GVnnEsow.mjs → panels-2yIO9FxQ.mjs} +5 -5
  120. package/dist/{panels-D4_yGw4n.cjs → panels-BqLXIQif.cjs} +5 -5
  121. package/dist/{peerTools-BO-H0wNj.mjs → peerTools-4GYKxr8J.mjs} +5 -5
  122. package/dist/{peerTools-Drow2-P4.cjs → peerTools-Z8V2E0AF.cjs} +5 -5
  123. package/dist/{persistence-DvD-irLh.mjs → persistence-DbOKjdUD.mjs} +3 -3
  124. package/dist/{persistence-DGfEdbA5.cjs → persistence-TpVFA5-I.cjs} +2 -2
  125. package/dist/{piRunnerArgs-DwcAwwzm.mjs → piRunnerArgs-Bdj0sjAT.mjs} +1 -1
  126. package/dist/{piRunnerArgs-C1dLsoXF.cjs → piRunnerArgs-DOEJJymf.cjs} +1 -1
  127. package/dist/{piRuntime-_yRSPgnR.mjs → piRuntime-B0QZykV7.mjs} +1 -1
  128. package/dist/{piRuntime-d2h0Cska.cjs → piRuntime-DiRayy91.cjs} +1 -1
  129. package/dist/{piTerminal-WN0AMv9u.mjs → piTerminal-DGF4X7C-.mjs} +20 -20
  130. package/dist/{piTerminal-CVB4fa5R.cjs → piTerminal-DciFqPEi.cjs} +20 -20
  131. package/dist/{pushNotifications-3YsyCEfY.cjs → pushNotifications-C1i2W1GQ.cjs} +3 -3
  132. package/dist/{pushNotifications-D2UZnoTB.mjs → pushNotifications-CrCTpDiN.mjs} +3 -3
  133. package/dist/{query-Ba7UXc_y.cjs → query-BkOpCpRo.cjs} +1 -1
  134. package/dist/{query-_sw0hG6A.mjs → query-CrSvcV32.mjs} +1 -1
  135. package/dist/{rateLimitWindows-DiiGHS9r.cjs → rateLimitWindows-BREA7OZj.cjs} +1 -1
  136. package/dist/{rateLimitWindows-DzXv6p_W.mjs → rateLimitWindows-DZVrafmm.mjs} +1 -1
  137. package/dist/{reconnectGate-CxLgZCBh.mjs → reconnectGate-COxAZTv8.mjs} +1 -1
  138. package/dist/{reconnectGate-BpePVLPu.cjs → reconnectGate-YQ5jXJfY.cjs} +1 -1
  139. package/dist/{registerCommonHandlers-ChdVwZW6.mjs → registerCommonHandlers-Cfl_dEWs.mjs} +2 -2
  140. package/dist/{registerCommonHandlers-6iKpECuR.cjs → registerCommonHandlers-D95IxqDN.cjs} +2 -2
  141. package/dist/{registerKillSessionHandler-BDTgrstx.cjs → registerKillSessionHandler-DJJXtc_L.cjs} +6 -6
  142. package/dist/{registerKillSessionHandler-D6wYbAIt.mjs → registerKillSessionHandler-DoE6xgH3.mjs} +6 -6
  143. package/dist/{registerSideQuestionHandler-U4LGga_Z.cjs → registerSideQuestionHandler-DsRz-aD9.cjs} +4 -4
  144. package/dist/{registerSideQuestionHandler-C3K_qKwA.mjs → registerSideQuestionHandler-Dv00rqcy.mjs} +4 -4
  145. package/dist/{remoteSessionClient-CFNM8UEh.mjs → remoteSessionClient-BFd_D9ka.mjs} +5 -5
  146. package/dist/{remoteSessionClient-DSC5Cj21.cjs → remoteSessionClient-DleOeQlN.cjs} +5 -5
  147. package/dist/{reportProgressTool-CFmDK8ag.mjs → reportProgressTool-D4xKY9Ur.mjs} +111 -4
  148. package/dist/{reportProgressTool-Cr25LWeW.cjs → reportProgressTool-DtEpDqv3.cjs} +113 -3
  149. package/dist/{run-Be0yicft.cjs → run-CVAIFpsp.cjs} +391 -42
  150. package/dist/{run-D0D73Dam.mjs → run-iDEMW4js.mjs} +391 -42
  151. package/dist/{runClaude-1NP467UM.mjs → runClaude-DvHdLJaV.mjs} +27 -25
  152. package/dist/{runClaude-BOxvKK4H.cjs → runClaude-gucCQBma.cjs} +30 -28
  153. package/dist/{runClaudeDeps-CkRlQx2Y.cjs → runClaudeDeps-CQ8vvqUQ.cjs} +42 -40
  154. package/dist/{runClaudeDeps-BPzLoWyT.mjs → runClaudeDeps-DkFWFwVc.mjs} +48 -46
  155. package/dist/{runGemini-j2n5ZlOL.mjs → runGemini-B2lXQDru.mjs} +35 -33
  156. package/dist/{runGemini-BowXJRXb.cjs → runGemini-C0vqJYtS.cjs} +35 -33
  157. package/dist/{runOpenClaw-DLsnZnFM.cjs → runOpenClaw-DNV7GX73.cjs} +18 -18
  158. package/dist/{runOpenClaw-6zrT8dPO.mjs → runOpenClaw-Ddb6sOkY.mjs} +18 -18
  159. package/dist/{sandbox-BFbT6HDl.mjs → sandbox-Cw0cPDDh.mjs} +4 -4
  160. package/dist/{sandbox-DLijcRKk.cjs → sandbox-FA0RlaZg.cjs} +4 -4
  161. package/dist/selfCheck-B-hKig8I.mjs +89 -0
  162. package/dist/{selfCheck-U-A1DCi9.cjs → selfCheck-DFC8fzhF.cjs} +40 -39
  163. package/dist/{send-CGxo_QUR.cjs → send-BFd-5b_Q.cjs} +8 -8
  164. package/dist/{send-CQGKb3Kb.mjs → send-CwgqPftE.mjs} +8 -8
  165. package/dist/{server-DR5bQzTq.mjs → server-C_4Fk45r.mjs} +4 -4
  166. package/dist/{server-CWbcDBjV.cjs → server-DwOdMGAP.cjs} +6 -6
  167. package/dist/{sessionLock-DqFKSW8u.mjs → sessionLock-CphKQyav.mjs} +3 -3
  168. package/dist/{sessionLock-CJiayMcZ.cjs → sessionLock-DglhFHzB.cjs} +3 -3
  169. package/dist/{startupSessionCreate-s1ekIs2Z.cjs → sessionMetadata-DyTJ0Ki5.cjs} +14 -3
  170. package/dist/{startupSessionCreate-CfBajt2k.mjs → sessionMetadata-V7Z7F-cj.mjs} +14 -4
  171. package/dist/{sessionOps-Cw_JivR2.cjs → sessionOps-CIFvoFPA.cjs} +4 -4
  172. package/dist/{sessionOps-D-SDNs-D.mjs → sessionOps-D-uFSTHk.mjs} +4 -4
  173. package/dist/{sessionProvider-JEAWxBF6.cjs → sessionProvider-B0daO-Ln.cjs} +10 -10
  174. package/dist/{sessionProvider-Cb-LtbFQ.mjs → sessionProvider-D8y7K8bK.mjs} +10 -10
  175. package/dist/{sessionScanner-zJrc_Oe0.cjs → sessionScanner-CWflbWoH.cjs} +3 -3
  176. package/dist/{sessionScanner-C2M697xz.mjs → sessionScanner-DQAOP6pU.mjs} +3 -3
  177. package/dist/{sessions-CIxnjpCM.mjs → sessions-CaO_-AI7.mjs} +10 -10
  178. package/dist/{sessions-D2yLkE5R.cjs → sessions-CzpI76qj.cjs} +10 -10
  179. package/dist/{setupOfflineReconnection-Uu3tqISz.cjs → setupOfflineReconnection-BZHRoKDx.cjs} +2 -2
  180. package/dist/{setupOfflineReconnection-DzV1wB4y.mjs → setupOfflineReconnection-Ck-p0YPb.mjs} +2 -2
  181. package/dist/{spawn-CeeM-Piz.mjs → spawn-BEJxfj60.mjs} +14 -14
  182. package/dist/{spawn-DD1Sv8Ri.cjs → spawn-DyjOa4nf.cjs} +14 -14
  183. package/dist/{spawnAgents-CrHgpAzU.cjs → spawnAgents-IiuqX0S5.cjs} +1 -1
  184. package/dist/{spawnAgents-DEBfpoPZ.mjs → spawnAgents-XObVj6zN.mjs} +1 -1
  185. package/dist/{spawnHappyCLI-CYzlz9Sl.cjs → spawnHappyCLI-C3XuIB2N.cjs} +1 -1
  186. package/dist/{spawnHappyCLI-CUfe8n_m.mjs → spawnHappyCLI-Cc9kKpcq.mjs} +1 -1
  187. package/dist/{startFileWatcher-C0u3J6Bj.cjs → startFileWatcher-CeDJl9mN.cjs} +1 -1
  188. package/dist/{startFileWatcher-JdO3v65I.mjs → startFileWatcher-t3K1y9kY.mjs} +1 -1
  189. package/dist/{store-DEhdblkI.mjs → store-CqNAE-0v.mjs} +1 -1
  190. package/dist/{store-QBBJB5Ox.cjs → store-DOZAMV4W.cjs} +1 -1
  191. package/dist/{streamRelay-DymKR1Rk.mjs → streamRelay-7D7v0hvk.mjs} +1 -1
  192. package/dist/{streamRelay-BVrCYh2G.cjs → streamRelay-Dyp4x44P.cjs} +1 -1
  193. package/dist/{sync-BO4DRSub.cjs → sync-BvxhuW9R.cjs} +1 -1
  194. package/dist/{sync-BLGrIKN9.mjs → sync-s1pUqWGm.mjs} +1 -1
  195. package/dist/{systemPrompt-DTUJZOn6.cjs → systemPrompt-CCdSrtn3.cjs} +2 -2
  196. package/dist/{systemPrompt-YylizkJs.mjs → systemPrompt-CLYTbBhV.mjs} +2 -2
  197. package/dist/{teams-zkGFcwsG.mjs → teams-BVp5F_xN.mjs} +7 -7
  198. package/dist/{teams-DnLPBPKx.cjs → teams-D2q1DQWz.cjs} +7 -7
  199. package/dist/{template-uSKZ53Sv.cjs → template-M1YGFYUT.cjs} +1 -1
  200. package/dist/{template-BGlDAjbM.mjs → template-oBrR0saD.mjs} +1 -1
  201. package/dist/{time-Cv4hbCLT.cjs → time-D-v2Cd9e.cjs} +1 -1
  202. package/dist/{time-DZE0879N.mjs → time-qd46L189.mjs} +1 -1
  203. package/dist/{titleGenerator-B2BbmJuc.mjs → titleGenerator-BdeHi3IY.mjs} +2 -2
  204. package/dist/{titleGenerator-D2ehxbvK.cjs → titleGenerator-CSYqcorn.cjs} +3 -3
  205. package/dist/{todo-DUpW9d8p.mjs → todo-DiEhLgUZ.mjs} +95 -12
  206. package/dist/{todo-9kn_9N-H.cjs → todo-Dq_YuJvj.cjs} +101 -18
  207. package/dist/{tools-rMr-wPIc.cjs → tools-CY2zrdd5.cjs} +1 -1
  208. package/dist/{tools-gIDXwAzk.mjs → tools-DR7GWBBV.mjs} +1 -1
  209. package/dist/{uninstall-CHx5TOHi.cjs → uninstall-BHhHjbzE.cjs} +3 -3
  210. package/dist/{uninstall-CBlRzvNa.mjs → uninstall-BvwDZVU9.mjs} +3 -3
  211. package/dist/{wrapperAccount-Ce78kKMo.mjs → wrapperAccount-CpDsQL15.mjs} +2 -2
  212. package/dist/{wrapperAccount-EkmR4V-v.cjs → wrapperAccount-ejUjAQaM.cjs} +2 -2
  213. package/package.json +7 -7
  214. package/dist/selfCheck-DCIqaiMu.mjs +0 -88
@@ -1,14 +1,14 @@
1
1
  import { statSync, readdirSync } from 'node:fs';
2
2
  import { homedir } from 'node:os';
3
- import { l as logger } from './logger-BHfBDOsy.mjs';
4
- import { r as readSettings } from './persistence-DvD-irLh.mjs';
3
+ import { l as logger } from './logger-BLMi8oJK.mjs';
4
+ import { r as readSettings } from './persistence-DbOKjdUD.mjs';
5
5
  import { d as describeAgentHome, C as CLAUDE_CONFIG_DIR_ENV, a as CODEX_HOME_ENV, f as findClaudeConversation, b as agentHomeCandidates, c as findCodexThread, r as resolveAgentHomes, A as AGENT_HOME_ENV_NAMES, g as agentHomeEnv, p as probeLoginShellEnv } from './loginShellEnv-Dw8M7tkI.mjs';
6
6
  export { h as claudeConversationPath, i as claudeProjectDirName, j as codexRolloutFileMatches, e as expandHomePath } from './loginShellEnv-Dw8M7tkI.mjs';
7
7
  import 'chalk';
8
8
  import 'node:util';
9
- import './configuration-JBFF7432.mjs';
9
+ import './configuration-4pG95tsq.mjs';
10
10
  import 'node:path';
11
- import './package-BGZo2vAj.mjs';
11
+ import './package-DbGqY8Ej.mjs';
12
12
  import 'node:fs/promises';
13
13
  import 'zod';
14
14
  import './authRelay-DhQhkBvX.mjs';
@@ -5,6 +5,7 @@ import { isCuid, createId } from '@paralleldrive/cuid2';
5
5
  const CODEX_STEER_CAPABILITY = "codex-steer-v1";
6
6
  const CODEX_COMPACT_CAPABILITY = "codex-compact-v1";
7
7
  const CODEX_BTW_CAPABILITY = "codex-btw-v1";
8
+ const CODEX_LIVE_PERMISSION_CAPABILITY = "codex-live-permission-v1";
8
9
  const PI_STEER_CAPABILITY = "pi-steer-v1";
9
10
  const sessionRoleSchema = z.enum(["user", "agent"]);
10
11
  const sessionTextEventSchema = z.object({
@@ -1232,9 +1233,13 @@ For add, retry with the same UUID and identical title/note after a timeout; do n
1232
1233
 
1233
1234
  For edit/status/delete, a conflict means the version changed. Read the task and compare the new state with the user's request before deciding what to do; never automatically overwrite with a freshly fetched version. A timeout may have committed: read to reconcile, then report the confirmed result. Do not claim a delete succeeded merely because a request was sent.
1234
1235
 
1236
+ ## Issues
1237
+
1238
+ On a server with Issues, My todos are issues without an assignee: the todo commands keep working on them (list shows open ones, \`--all\` adds completed; an ID may also be an issue key such as VH-12). Run \`very-happy issue --help\` for the full Issues interface (assign to an agent, comments). Without Issues the todo commands use the classic store; their output is the same.
1239
+
1235
1240
  Restricted team workers cannot use account-wide Todo credentials. Ask the user or supervising session to perform the account operation; do not clear scope variables or seek another credential to bypass that boundary.
1236
1241
  `;
1237
- const BUILTIN_TODO_DISCOVERY = "For the user\u2019s Very Happy My todos, run `very-happy todo skill` to read the official skill, then use its CLI commands. Do not confuse account todos with your execution plan; restricted team workers must not bypass their scope.";
1242
+ const BUILTIN_TODO_DISCOVERY = "For the user\u2019s Very Happy My todos (and Issues: `very-happy issue --help`), run `very-happy todo skill` to read the official skill, then use its CLI commands. Do not confuse account todos with your execution plan; restricted team workers must not bypass their scope.";
1238
1243
  z$1.object({
1239
1244
  source: z$1.literal("pi"),
1240
1245
  tokens: z$1.number().finite().nonnegative().nullable(),
@@ -1801,6 +1806,12 @@ function ownerBoardPostToRest(sessionId, input, anchor) {
1801
1806
  inferred: false
1802
1807
  };
1803
1808
  }
1809
+ const ISSUE_SESSION_CAPABILITY = "issue-v1";
1810
+ const ISSUES_DISABLED_ERROR = "issues_disabled";
1811
+ const ISSUE_WORKER_VERSION = 1;
1812
+ const ISSUE_KEY_PREFIX = "VH";
1813
+ const ISSUE_DISPATCH_LOCAL_ID_PREFIX = "issue-";
1814
+ const ISSUE_SENT_FROM = "issue";
1804
1815
  const ISSUE_LIMITS = {
1805
1816
  titleChars: 300,
1806
1817
  descriptionBytes: 32 * 1024,
@@ -1813,8 +1824,23 @@ const ISSUE_LIMITS = {
1813
1824
  const ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "blocked", "done", "cancelled"];
1814
1825
  const ISSUE_PRIORITIES = ["urgent", "high", "medium", "low", "none"];
1815
1826
  const ISSUE_AGENT_STATUSES = ["in_progress", "in_review", "blocked"];
1827
+ const ISSUE_CLOSED_STATUSES = ["done", "cancelled"];
1816
1828
  const ISSUE_ASSIGNABLE_AGENTS = ["claude", "codex", "pi"];
1817
1829
  const ISSUE_ASSIGNEE_KINDS = ["none", "self", "agent", "team"];
1830
+ function isIssueClosed(status) {
1831
+ return ISSUE_CLOSED_STATUSES.includes(status);
1832
+ }
1833
+ const ISSUE_KEY_PATTERN = new RegExp(`^${ISSUE_KEY_PREFIX}-(\\d{1,9})$`, "i");
1834
+ const UUIDISH = /^[A-Za-z0-9_-]{8,128}$/;
1835
+ function parseIssueRef(input) {
1836
+ const value = input.trim();
1837
+ const key2 = ISSUE_KEY_PATTERN.exec(value) ?? /^#?(\d{1,9})$/.exec(value);
1838
+ if (key2) {
1839
+ const n = Number(key2[1]);
1840
+ return n > 0 ? { number: n } : null;
1841
+ }
1842
+ return UUIDISH.test(value) ? { id: value } : null;
1843
+ }
1818
1844
  const id = z$1.string().min(1).max(128);
1819
1845
  const requestId = z$1.string().min(1).max(128);
1820
1846
  const utf8Bytes = (value) => new TextEncoder().encode(value).length;
@@ -1968,6 +1994,27 @@ z$1.object({
1968
1994
  t: z$1.literal("issue-run"),
1969
1995
  run: z$1.object({ id: z$1.string(), issueId: z$1.string(), status: z$1.string() }).passthrough()
1970
1996
  });
1997
+ const ISSUE_ERROR_CODES = [
1998
+ "issues_disabled",
1999
+ "issue_not_found",
2000
+ "issue_version_conflict",
2001
+ "issue_count_quota_exceeded",
2002
+ "issue_status_forbidden",
2003
+ "issue_closed",
2004
+ "issue_comment_required",
2005
+ "issue_not_bound",
2006
+ "issue_run_not_current",
2007
+ "issue_assignee_unsupported",
2008
+ "issue_agent_unsupported",
2009
+ "issue_no_directory",
2010
+ "issue_machine_not_found",
2011
+ "issue_parent_cycle",
2012
+ "issue_project_not_found",
2013
+ "issue_comment_quota_exceeded",
2014
+ "issue_run_not_found",
2015
+ "issue_dispatch_claim_mismatch",
2016
+ "transaction_conflict"
2017
+ ];
1971
2018
  const SYNC_HELLO_MAX_REQUEST_SUBS = 64;
1972
2019
  const sessionIdSchema = z.string().min(1).max(128);
1973
2020
  const afterSeqSchema = z.number().int().min(0).nullable();
@@ -2065,4 +2112,4 @@ z.object({
2065
2112
  reason: z.string()
2066
2113
  });
2067
2114
 
2068
- export { OwnerBoardResolveInputSchema as $, AGENT_PROFILE_SESSION_CAPABILITY as A, BUILTIN_TODO_SKILL as B, CLAUDE_CONFIG_MODEL_CAPABILITY as C, AutomationTriggerSchema as D, AGENT_PROFILE_FEATURE_LAUNCH as E, AgentProfileAddRequestSchema as F, AgentProfileLoginStartRequestSchema as G, AgentProfileLoginSubmitRequestSchema as H, AgentProfileBindRequestSchema as I, getAgentCodeDefaults as J, isLatestModelMode as K, resolveLatestModel as L, LATEST_MODEL_MODE as M, EFFORT_INTENT_AUTO as N, normalizeAgentKey as O, PROMPT_QUEUE_CAPABILITY as P, AgentProfilesStateSchema as Q, RUN_INTENT_CAPABILITY as R, STREAM_DELTA_MAX_CHARS as S, AgentVersionsSchema as T, AGENT_VERSION_SOURCES as U, ATTENTION_DISABLED_ERROR as V, ATTENTION_LIMITS as W, ownerBoardPostToRest as X, isAttentionBoardLocalId as Y, OwnerBoardPostInputSchema as Z, OwnerBoardUpdateInputSchema as _, PROJECT_SESSION_CAPABILITY as a, OwnerBoardListInputSchema as a0, ATTENTION_SESSION_CAPABILITY as a1, PI_STEER_CAPABILITY as a2, ReleaseDrainNoticeSchema as a3, RelayAssignmentResponseSchema as a4, CODEX_STEER_CAPABILITY as a5, CODEX_COMPACT_CAPABILITY as a6, CODEX_BTW_CAPABILITY as a7, AGENT_PROFILE_RPC as a8, RelayCandidatesResponseSchema as a9, ServerMigrateNoticeSchema as aa, isHarnessInstallId as ab, agentProfileUnavailableReason as ac, MODEL_INTENT_CONFIG as ad, AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS as ae, AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS as af, AUTOMATION_CLAIM_MAX_RUNS as ag, AUTOMATION_DAEMON_CAPABILITY_PRECHECK as ah, AUTOMATION_DEFAULT_LEASE_MS as ai, HARNESS_INSTALL_CAPABILITY_VERSION as aj, restoredModel as b, AUTOMATION_NAME_PATTERN as c, AUTOMATION_PRECHECK_MAX_TIMEOUT_MS as d, AutomationPrecheckSchema as e, isInsideTeamWorktree as f, rebaseTeamWorktreePath as g, AUTOMATION_ATTENTION_REASON_MAX_CHARS as h, isAutomationRunTerminal as i, AUTOMATION_SUMMARY_MAX_CHARS as j, createEnvelope as k, RUN_INTENT_RPC as l, RunIntentRequestSchema as m, nextRunIntents as n, readEffortIntent as o, readModelIntent as p, createBuiltinTodoClient as q, restoredEffort as r, streamKeyOf as s, AGENT_PROFILE_KINDS as t, parseLatestModelTable as u, resolveLaunchAgentProfile as v, BUILTIN_TODO_DISCOVERY as w, AutomationNameSchema as x, AutomationConcurrencySchema as y, AutomationActionSchema as z };
2115
+ export { AutomationTriggerSchema as $, AGENT_PROFILE_SESSION_CAPABILITY as A, parseLatestModelTable as B, CLAUDE_CONFIG_MODEL_CAPABILITY as C, resolveLaunchAgentProfile as D, createBuiltinTodoClient as E, ISSUE_LIMITS as F, isIssueClosed as G, BUILTIN_TODO_SKILL as H, ISSUE_SESSION_CAPABILITY as I, BUILTIN_TODO_DISCOVERY as J, AGENT_PROFILE_FEATURE_LAUNCH as K, AgentProfileAddRequestSchema as L, AgentProfileLoginStartRequestSchema as M, AgentProfileLoginSubmitRequestSchema as N, AgentProfileBindRequestSchema as O, PROMPT_QUEUE_CAPABILITY as P, getAgentCodeDefaults as Q, RUN_INTENT_CAPABILITY as R, STREAM_DELTA_MAX_CHARS as S, isLatestModelMode as T, resolveLatestModel as U, LATEST_MODEL_MODE as V, EFFORT_INTENT_AUTO as W, normalizeAgentKey as X, AutomationNameSchema as Y, AutomationConcurrencySchema as Z, AutomationActionSchema as _, PROJECT_SESSION_CAPABILITY as a, ISSUE_AGENT_STATUSES as a0, AgentProfilesStateSchema as a1, AgentVersionsSchema as a2, AGENT_VERSION_SOURCES as a3, PI_STEER_CAPABILITY as a4, ATTENTION_DISABLED_ERROR as a5, ATTENTION_LIMITS as a6, ownerBoardPostToRest as a7, isAttentionBoardLocalId as a8, OwnerBoardPostInputSchema as a9, OwnerBoardUpdateInputSchema as aa, OwnerBoardResolveInputSchema as ab, OwnerBoardListInputSchema as ac, ATTENTION_SESSION_CAPABILITY as ad, ReleaseDrainNoticeSchema as ae, RelayAssignmentResponseSchema as af, CODEX_STEER_CAPABILITY as ag, CODEX_COMPACT_CAPABILITY as ah, CODEX_BTW_CAPABILITY as ai, CODEX_LIVE_PERMISSION_CAPABILITY as aj, AGENT_PROFILE_RPC as ak, RelayCandidatesResponseSchema as al, ServerMigrateNoticeSchema as am, isHarnessInstallId as an, agentProfileUnavailableReason as ao, MODEL_INTENT_CONFIG as ap, AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS as aq, AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS as ar, AUTOMATION_CLAIM_MAX_RUNS as as, AUTOMATION_DAEMON_CAPABILITY_PRECHECK as at, AUTOMATION_DEFAULT_LEASE_MS as au, ISSUE_SENT_FROM as av, ISSUE_DISPATCH_LOCAL_ID_PREFIX as aw, HARNESS_INSTALL_CAPABILITY_VERSION as ax, restoredModel as b, AUTOMATION_NAME_PATTERN as c, AUTOMATION_PRECHECK_MAX_TIMEOUT_MS as d, AutomationPrecheckSchema as e, ISSUE_ASSIGNABLE_AGENTS as f, ISSUE_STATUSES as g, ISSUE_PRIORITIES as h, isAutomationRunTerminal as i, isInsideTeamWorktree as j, rebaseTeamWorktreePath as k, ISSUE_ERROR_CODES as l, ISSUES_DISABLED_ERROR as m, ISSUE_WORKER_VERSION as n, AUTOMATION_ATTENTION_REASON_MAX_CHARS as o, parseIssueRef as p, AUTOMATION_SUMMARY_MAX_CHARS as q, restoredEffort as r, streamKeyOf as s, createEnvelope as t, RUN_INTENT_RPC as u, RunIntentRequestSchema as v, nextRunIntents as w, readEffortIntent as x, readModelIntent as y, AGENT_PROFILE_KINDS as z };
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- require('./package-CStJrLG3.cjs');
4
- require('./index-EGwuuFdL.cjs');
3
+ require('./package-BFSsS_dl.cjs');
4
+ require('./index-DUwOmhnq.cjs');
5
5
  require('node:module');
6
6
  require('node:fs');
7
7
  require('node:fs/promises');
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import './package-BGZo2vAj.mjs';
2
- import './index-CZpFhEmE.mjs';
1
+ import './package-DbGqY8Ej.mjs';
2
+ import './index-Sdvy1Lsf.mjs';
3
3
  import 'node:module';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-BrAF4iuT.cjs');
3
+ var logger = require('./logger-D28MY1Bv.cjs');
4
4
  var require$$0 = require('fs');
5
5
  var child_process = require('child_process');
6
6
  var trimIdent = require('./trimIdent-4gvk9Wk6.cjs');
7
7
  var os = require('os');
8
8
  require('chalk');
9
9
  require('node:util');
10
- require('./configuration-DfRs3WLd.cjs');
10
+ require('./configuration-ClUt7pqs.cjs');
11
11
  require('node:fs');
12
12
  require('node:os');
13
13
  require('node:path');
14
- require('./package-CStJrLG3.cjs');
14
+ require('./package-BFSsS_dl.cjs');
15
15
  require('node:fs/promises');
16
16
 
17
17
  const PLIST_LABEL = "com.happy-cli.daemon";
@@ -1,15 +1,15 @@
1
- import { l as logger } from './logger-BHfBDOsy.mjs';
1
+ import { l as logger } from './logger-BLMi8oJK.mjs';
2
2
  import { existsSync, writeFileSync, chmodSync } from 'fs';
3
3
  import { execSync } from 'child_process';
4
4
  import { t as trimIdent } from './trimIdent-BAjmv_TG.mjs';
5
5
  import os from 'os';
6
6
  import 'chalk';
7
7
  import 'node:util';
8
- import './configuration-JBFF7432.mjs';
8
+ import './configuration-4pG95tsq.mjs';
9
9
  import 'node:fs';
10
10
  import 'node:os';
11
11
  import 'node:path';
12
- import './package-BGZo2vAj.mjs';
12
+ import './package-DbGqY8Ej.mjs';
13
13
  import 'node:fs/promises';
14
14
 
15
15
  const PLIST_LABEL = "com.happy-cli.daemon";
@@ -0,0 +1,237 @@
1
+ 'use strict';
2
+
3
+ var node_crypto = require('node:crypto');
4
+ var index = require('./index-BiutHOAO.cjs');
5
+ var configuration = require('./configuration-ClUt7pqs.cjs');
6
+ var persistence = require('./persistence-TpVFA5-I.cjs');
7
+ var context = require('./context-wMsIGwBw.cjs');
8
+ var client = require('./client-1zIbVVX5.cjs');
9
+ var format = require('./format-P9_M_7ga.cjs');
10
+ require('zod');
11
+ require('@paralleldrive/cuid2');
12
+ require('node:fs');
13
+ require('node:os');
14
+ require('node:path');
15
+ require('./package-BFSsS_dl.cjs');
16
+ require('node:fs/promises');
17
+ require('./authRelay-Dy1qU9td.cjs');
18
+ require('tweetnacl');
19
+ require('./logger-D28MY1Bv.cjs');
20
+ require('chalk');
21
+ require('node:util');
22
+
23
+ const ISSUE_HELP = `very-happy issue \u2014 account Issues (spec 2026-11-issues)
24
+ very-happy issue list [--status todo,in_progress] [--project ID] [--mine] [--unassigned] [--all] [--limit N] [--json]
25
+ very-happy issue show VH-N [--json]
26
+ very-happy issue create --title TEXT [--desc TEXT] [--assign AGENT[@MACHINE_ID]|self|none] [--dir PATH] [--mode M] [--model ID]
27
+ [--project ID] [--priority P] [--label L]... [--status S] [--json]
28
+ very-happy issue update VH-N [--status S] [--assign \u2026] [--dir PATH] [--mode M] [--model ID] [--title TEXT] [--desc TEXT]
29
+ [--priority P] [--label L]... [--project ID|none] [--comment TEXT] [--json]
30
+ very-happy issue comment VH-N TEXT [--mention AGENT[@MACHINE_ID]]... [--json]
31
+
32
+ AGENT is ${index.ISSUE_ASSIGNABLE_AGENTS.join(" | ")}; without @MACHINE_ID it runs on this machine.
33
+ Assigning an agent on a runnable status (todo / in_progress / in_review / blocked)
34
+ starts a run; backlog only records the assignee. A comment starting with /note
35
+ never wakes an agent.
36
+
37
+ Inside a Very Happy session (HAPPY_SESSION_ID set) update and comment act as the
38
+ agent on the issue this session works on: status only in_progress / in_review /
39
+ blocked (in_review and blocked need --comment), never done or cancelled; create
40
+ is not available. Use --title=TEXT for values starting with --.`;
41
+ const MULTI = /* @__PURE__ */ new Set(["--label", "--mention"]);
42
+ const BOOL = /* @__PURE__ */ new Set(["--json", "--mine", "--unassigned", "--all"]);
43
+ const ALLOWED = {
44
+ list: ["--status", "--project", "--mine", "--unassigned", "--all", "--limit", "--json"],
45
+ show: ["--json"],
46
+ create: ["--title", "--desc", "--assign", "--dir", "--mode", "--model", "--project", "--priority", "--label", "--status", "--json"],
47
+ update: ["--status", "--assign", "--dir", "--mode", "--model", "--title", "--desc", "--priority", "--label", "--project", "--comment", "--json"],
48
+ comment: ["--mention", "--json"]
49
+ };
50
+ function parseIssueArgs(args) {
51
+ if (args.length === 0 || args[0] === "--help" || args[0] === "help") return { action: "help", positional: [], flags: {}, multi: {}, bools: /* @__PURE__ */ new Set() };
52
+ const action = args[0];
53
+ if (!(action in ALLOWED)) throw new Error("Unknown issue command; use issue --help");
54
+ const cmd = { action, positional: [], flags: {}, multi: {}, bools: /* @__PURE__ */ new Set() };
55
+ if (args.includes("--help")) return { ...cmd, action: "help" };
56
+ for (let i = 1; i < args.length; i++) {
57
+ const arg = args[i];
58
+ if (!arg.startsWith("--")) {
59
+ cmd.positional.push(arg);
60
+ continue;
61
+ }
62
+ const eq = arg.indexOf("=");
63
+ const flag = eq === -1 ? arg : arg.slice(0, eq);
64
+ if (!ALLOWED[action].includes(flag)) throw new Error(`${flag} is not supported for issue ${action}`);
65
+ if (BOOL.has(flag)) {
66
+ if (eq !== -1) throw new Error(`${flag} takes no value`);
67
+ cmd.bools.add(flag);
68
+ continue;
69
+ }
70
+ const value = eq === -1 ? args[++i] : arg.slice(eq + 1);
71
+ if (value === void 0 || eq === -1 && value.startsWith("--")) throw new Error(`Missing value for ${flag}`);
72
+ if (MULTI.has(flag)) (cmd.multi[flag] ??= []).push(value);
73
+ else {
74
+ if (Object.hasOwn(cmd.flags, flag)) throw new Error(`Duplicate option: ${flag}`);
75
+ cmd.flags[flag] = value;
76
+ }
77
+ }
78
+ const wantRef = action === "show" || action === "update" || action === "comment";
79
+ if (wantRef && !cmd.positional[0]) throw new Error(`issue ${action} needs an issue (VH-N)`);
80
+ if (wantRef && !index.parseIssueRef(cmd.positional[0])) throw new Error(`Not an issue reference: ${cmd.positional[0]}`);
81
+ if (action === "comment" && cmd.positional.length !== 2) throw new Error("issue comment needs VH-N and one TEXT argument (quote it)");
82
+ if ((action === "show" || action === "update") && cmd.positional.length !== 1) throw new Error("Unexpected argument");
83
+ if ((action === "list" || action === "create") && cmd.positional.length) throw new Error("Unexpected argument");
84
+ if (action === "create" && !cmd.flags["--title"]?.trim()) throw new Error("create needs --title");
85
+ for (const f of ["--dir", "--mode", "--model"]) if (cmd.flags[f] !== void 0 && !cmd.flags["--assign"]) throw new Error(`${f} goes with --assign AGENT`);
86
+ for (const key of ["--status"]) if (cmd.flags[key] !== void 0 && action !== "list" && !index.ISSUE_STATUSES.includes(cmd.flags[key])) throw new Error(`Unknown status "${cmd.flags[key]}" (${index.ISSUE_STATUSES.join(", ")})`);
87
+ if (cmd.flags["--priority"] !== void 0 && !index.ISSUE_PRIORITIES.includes(cmd.flags["--priority"])) throw new Error(`Unknown priority (${index.ISSUE_PRIORITIES.join(", ")})`);
88
+ if (cmd.flags["--limit"] !== void 0 && !/^[1-9][0-9]{0,2}$/.test(cmd.flags["--limit"])) throw new Error("--limit must be 1\u2013500");
89
+ return cmd;
90
+ }
91
+ function parseAssign(value, localMachineId2, directory, run = {}) {
92
+ if (value === "self" || value === "none") return { kind: value };
93
+ const [agent, machine] = value.split("@", 2);
94
+ if (!index.ISSUE_ASSIGNABLE_AGENTS.includes(agent)) throw new Error(`Unknown agent "${agent}" (${index.ISSUE_ASSIGNABLE_AGENTS.join(", ")}, self, none)`);
95
+ const machineId = machine || localMachineId2;
96
+ if (!machineId) throw new Error("This machine has no id yet (start the daemon once), or pass AGENT@MACHINE_ID");
97
+ return {
98
+ kind: "agent",
99
+ agent,
100
+ machineId,
101
+ ...directory ? { directory } : {},
102
+ ...run.permissionMode ? { permissionMode: run.permissionMode } : {},
103
+ ...run.model ? { model: run.model } : {}
104
+ };
105
+ }
106
+ function parseMention(value, localMachineId2) {
107
+ const [agent, machine] = value.split("@", 2);
108
+ if (!index.ISSUE_ASSIGNABLE_AGENTS.includes(agent)) throw new Error(`Unknown agent "${agent}" for --mention`);
109
+ return { kind: "agent", agent, ...machine ? { machineId: machine } : {} };
110
+ }
111
+ async function localMachineId() {
112
+ try {
113
+ return (await persistence.readSettings())?.machineId ?? null;
114
+ } catch {
115
+ return null;
116
+ }
117
+ }
118
+ function agentSessionId(env = process.env) {
119
+ const sid = env.HAPPY_SESSION_ID;
120
+ return sid && /^[A-Za-z0-9_-]{1,128}$/.test(sid) ? sid : null;
121
+ }
122
+ async function scoped(sessionId) {
123
+ if (process.env.VH_TEAM_SCOPE_FILE !== void 0) return true;
124
+ return !!sessionId && !!await context.readTeamScope(context.teamScopePath(sessionId));
125
+ }
126
+ function print(json, value, text) {
127
+ console.log(json ? JSON.stringify({ serverUrl: configuration.configuration.serverUrl, result: value }) : text);
128
+ }
129
+ async function runIssueCommand(cmd, deps = {}) {
130
+ if (cmd.action === "help") {
131
+ console.log(ISSUE_HELP);
132
+ return;
133
+ }
134
+ const client$1 = deps.client ?? client.sharedIssuesClient();
135
+ const json = cmd.bools.has("--json");
136
+ const sessionId = agentSessionId(deps.env ?? process.env);
137
+ const isScoped = await scoped(sessionId);
138
+ if (cmd.action === "update" || cmd.action === "comment") {
139
+ if (sessionId) {
140
+ const ctx = await client$1.session(sessionId);
141
+ const ref = index.parseIssueRef(cmd.positional[0]);
142
+ if (!ctx.issue || ("number" in ref ? ref.number !== ctx.issue.number : ref.id !== ctx.issue.id)) {
143
+ throw new Error("issue_not_bound: Inside a session you can only update or comment on the issue this session works on.");
144
+ }
145
+ if (cmd.action === "comment") {
146
+ if (cmd.multi["--mention"]?.length) throw new Error("--mention is for the owner; an agent comment never wakes another agent");
147
+ const result2 = await client$1.agentComment({ sessionId, body: cmd.positional[1], requestId: node_crypto.randomUUID() });
148
+ print(json, result2, `commented on ${result2.issue.key}`);
149
+ return;
150
+ }
151
+ const extra = Object.keys(cmd.flags).filter((f) => f !== "--status" && f !== "--comment");
152
+ if (extra.length || cmd.multi["--label"]?.length) throw new Error(`Inside a session only --status and --comment can be changed (not ${[...extra, ...cmd.multi["--label"]?.length ? ["--label"] : []].join(", ")})`);
153
+ const result = await client$1.agentUpdate({ sessionId, requestId: node_crypto.randomUUID(), ...cmd.flags["--status"] ? { status: cmd.flags["--status"] } : {}, ...cmd.flags["--comment"] ? { comment: cmd.flags["--comment"] } : {} });
154
+ print(json, result, `${result.issue.key} is ${result.issue.status}`);
155
+ return;
156
+ }
157
+ }
158
+ if (isScoped && cmd.action !== "show") throw new Error("Scoped Teams sessions cannot access account Issues; ask the owner session.");
159
+ if (sessionId && cmd.action === "create") throw new Error("Agents cannot create issues; ask the owner.");
160
+ if (cmd.action === "list") {
161
+ if (!sessionId) await client.importLegacyTodosOnce(client$1);
162
+ const status = cmd.flags["--status"] ?? (cmd.bools.has("--all") ? void 0 : index.ISSUE_STATUSES.filter((s) => s !== "done" && s !== "cancelled").join(","));
163
+ const list = await client$1.list({
164
+ ...status ? { status } : {},
165
+ ...cmd.flags["--project"] ? { projectId: cmd.flags["--project"] } : {},
166
+ ...cmd.bools.has("--mine") ? { assigneeKind: "self" } : cmd.bools.has("--unassigned") ? { assigneeKind: "none" } : {},
167
+ limit: cmd.flags["--limit"] ? Number(cmd.flags["--limit"]) : 100
168
+ });
169
+ print(json, list, list.issues.length ? list.issues.map(format.formatIssueLine).join("\n") : "no issues");
170
+ return;
171
+ }
172
+ if (cmd.action === "show") {
173
+ if (isScoped) {
174
+ const ctx = sessionId ? await client$1.session(sessionId) : null;
175
+ const ref = index.parseIssueRef(cmd.positional[0]);
176
+ if (!ctx?.issue || ("number" in ref ? ref.number !== ctx.issue.number : ref.id !== ctx.issue.id)) throw new Error("Scoped Teams sessions can read only the issue they are working on.");
177
+ }
178
+ if (!sessionId) await client.importLegacyTodosOnce(client$1);
179
+ const detail = await client$1.get(cmd.positional[0]);
180
+ print(json, detail, format.formatIssueDetail({ issue: detail.issue, comments: detail.comments, runs: detail.runs }));
181
+ return;
182
+ }
183
+ const machine = await localMachineId();
184
+ if (cmd.action === "create") {
185
+ const input = {
186
+ title: cmd.flags["--title"].trim(),
187
+ requestId: node_crypto.randomUUID(),
188
+ ...cmd.flags["--desc"] !== void 0 ? { description: cmd.flags["--desc"] } : {},
189
+ ...cmd.flags["--assign"] ? { assignee: parseAssign(cmd.flags["--assign"], machine, cmd.flags["--dir"], { permissionMode: cmd.flags["--mode"], model: cmd.flags["--model"] }) } : {},
190
+ ...cmd.flags["--project"] ? { projectId: cmd.flags["--project"] } : {},
191
+ ...cmd.flags["--priority"] ? { priority: cmd.flags["--priority"] } : {},
192
+ ...cmd.multi["--label"]?.length ? { labels: cmd.multi["--label"] } : {},
193
+ ...cmd.flags["--status"] ? { status: cmd.flags["--status"] } : {}
194
+ };
195
+ const result = await client$1.create(input);
196
+ print(json, result, `created ${format.formatIssueLine(result.issue)}${result.runs?.length ? `
197
+ run #${result.runs[0].seq} queued on ${result.runs[0].agent}` : ""}`);
198
+ return;
199
+ }
200
+ const target = (await client$1.get(cmd.positional[0])).issue;
201
+ if (cmd.action === "comment") {
202
+ const mentions = (cmd.multi["--mention"] ?? []).map((m) => parseMention(m));
203
+ const result = await client$1.comment(target.id, { body: cmd.positional[1], requestId: node_crypto.randomUUID(), ...mentions.length ? { mentions } : {} });
204
+ print(json, result, `commented on ${result.issue.key}${result.comment?.routedRunIds.length ? " (delivered to the agent)" : ""}`);
205
+ return;
206
+ }
207
+ const patch = {
208
+ ...cmd.flags["--status"] ? { status: cmd.flags["--status"] } : {},
209
+ ...cmd.flags["--assign"] ? { assignee: parseAssign(cmd.flags["--assign"], machine, cmd.flags["--dir"], { permissionMode: cmd.flags["--mode"], model: cmd.flags["--model"] }) } : {},
210
+ ...cmd.flags["--title"] !== void 0 ? { title: cmd.flags["--title"].trim() } : {},
211
+ ...cmd.flags["--desc"] !== void 0 ? { description: cmd.flags["--desc"] } : {},
212
+ ...cmd.flags["--priority"] ? { priority: cmd.flags["--priority"] } : {},
213
+ ...cmd.multi["--label"] ? { labels: cmd.multi["--label"] } : {},
214
+ ...cmd.flags["--project"] ? { projectId: cmd.flags["--project"] === "none" ? null : cmd.flags["--project"] } : {}
215
+ };
216
+ let issue = target;
217
+ if (Object.keys(patch).length) issue = (await client$1.update(target.id, patch)).issue;
218
+ if (cmd.flags["--comment"]) await client$1.comment(target.id, { body: cmd.flags["--comment"], requestId: node_crypto.randomUUID() });
219
+ if (!Object.keys(patch).length && !cmd.flags["--comment"]) throw new Error("Nothing to update");
220
+ print(json, issue, `updated ${format.formatIssueLine(issue)}`);
221
+ }
222
+ async function handleIssueCommand(args) {
223
+ const cmd = parseIssueArgs(args);
224
+ try {
225
+ await runIssueCommand(cmd);
226
+ } catch (error) {
227
+ throw new Error(format.describeIssueError(error));
228
+ }
229
+ }
230
+
231
+ exports.ISSUE_HELP = ISSUE_HELP;
232
+ exports.agentSessionId = agentSessionId;
233
+ exports.handleIssueCommand = handleIssueCommand;
234
+ exports.parseAssign = parseAssign;
235
+ exports.parseIssueArgs = parseIssueArgs;
236
+ exports.parseMention = parseMention;
237
+ exports.runIssueCommand = runIssueCommand;