very-happy-cli 0.2.199 → 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.
- package/dist/{AcpBackend-Bo6bOamG.mjs → AcpBackend-Cnp6WNn8.mjs} +3 -3
- package/dist/{AcpBackend-HhZ8nrIh.cjs → AcpBackend-CwSShYPI.cjs} +3 -3
- package/dist/{AcpSessionManager-C-pkJKO2.mjs → AcpSessionManager-C4O3jhT_.mjs} +2 -2
- package/dist/{AcpSessionManager--7nDgA9S.cjs → AcpSessionManager-DqW99tOL.cjs} +2 -2
- package/dist/{BasePermissionHandler-Ffp54Ntg.mjs → BasePermissionHandler-8Msj0Z8j.mjs} +1 -1
- package/dist/{BasePermissionHandler-al7UXWRq.cjs → BasePermissionHandler-CgqjIUyG.cjs} +1 -1
- package/dist/{account-Bnk1yyGS.mjs → account-BIxPuBEs.mjs} +11 -11
- package/dist/{account-DCIz-iyL.cjs → account-DcNh2_SN.cjs} +11 -11
- package/dist/{accountService-B59oKwa4.cjs → accountService-BDJo14mY.cjs} +4 -4
- package/dist/{accountService-WPnOpkvs.mjs → accountService-ELazcp3V.mjs} +4 -4
- package/dist/{acpSessionResume-CfogEHtT.cjs → acpSessionResume-B_W8uTI6.cjs} +1 -1
- package/dist/{acpSessionResume-BVroOlVN.mjs → acpSessionResume-De_sTG30.mjs} +1 -1
- package/dist/{agentHome-CHTzSiu4.mjs → agentHome-C-900jC1.mjs} +4 -4
- package/dist/{agentHome-Y3bMEtCp.cjs → agentHome-C-usjJwB.cjs} +4 -4
- package/dist/{api-CgzfmyYS.cjs → api-BPWRzeNF.cjs} +16 -10
- package/dist/{api-DibgCucH.mjs → api-DCUiAds-.mjs} +16 -10
- package/dist/{apiMachine-BUaFSi27.mjs → apiMachine-CJl4m3V3.mjs} +18 -18
- package/dist/{apiMachine-DSI5mKlh.cjs → apiMachine-DjhbA1rL.cjs} +18 -18
- package/dist/{attachmentContent-D9wq3bok.mjs → attachmentContent-BKIq6EXR.mjs} +2 -2
- package/dist/{attachmentContent-JWUS5uhH.cjs → attachmentContent-C2f1UEP9.cjs} +2 -2
- package/dist/{auth-BjWk9sHU.mjs → auth-8jKFCZOX.mjs} +5 -5
- package/dist/{auth-BXav16o0.cjs → auth-h6oU63Ni.cjs} +8 -8
- package/dist/{auth-B6H2wHTy.cjs → auth-oAnLi4Tl.cjs} +5 -5
- package/dist/{auth-DFMJQDNF.mjs → auth-uLRHXOGY.mjs} +8 -8
- package/dist/{auto-DOhQ2OU5.mjs → auto-A5arQ-bI.mjs} +17 -17
- package/dist/{auto-CMO-VQYN.cjs → auto-Bpa5iA1A.cjs} +17 -17
- package/dist/{bootstrap-CY7Db_VV.mjs → bootstrap-BkLFgEGF.mjs} +2 -2
- package/dist/{bootstrap-Brd_jnA2.cjs → bootstrap-DUKAKxrJ.cjs} +2 -2
- package/dist/{browser-BpwBEJDU.mjs → browser-BAlw0rns.mjs} +1 -1
- package/dist/{browser-BhncBLE4.cjs → browser-Ds-N-Dup.cjs} +1 -1
- package/dist/{claudeAccountEnv-CYwfvK1u.mjs → claudeAccountEnv-CI8RlIB9.mjs} +1 -1
- package/dist/{claudeAccountEnv-z_ecsJAP.cjs → claudeAccountEnv-D33xXRE7.cjs} +1 -1
- package/dist/{claudeLocal-Co_DyW-D.cjs → claudeLocal-BbsOT-EF.cjs} +5 -5
- package/dist/{claudeLocal-coKrsYmR.mjs → claudeLocal-X48n0RhP.mjs} +5 -5
- package/dist/{claudeLocalLauncher-BFnLc0R-.mjs → claudeLocalLauncher-D18gRtxz.mjs} +10 -10
- package/dist/{claudeLocalLauncher-CNDrO3b6.cjs → claudeLocalLauncher-D1jS3iK4.cjs} +10 -10
- package/dist/{claudeSessionFork-BuDN5SkN.cjs → claudeSessionFork-Bkxn40Y8.cjs} +1 -1
- package/dist/{claudeSessionFork-dOOc9hpA.mjs → claudeSessionFork-n1vMiFcP.mjs} +1 -1
- package/dist/client-1zIbVVX5.cjs +120 -0
- package/dist/{client-DKPLBLvx.mjs → client-BXwIqRha.mjs} +2 -2
- package/dist/client-BgxQ9aej.mjs +114 -0
- package/dist/{client-B5uvkdLn.mjs → client-Blpuk2Hr.mjs} +2 -2
- package/dist/{client-KbhVRYjy.cjs → client-BnoN4P4t.cjs} +2 -2
- package/dist/{client-Ng-oAhlX.mjs → client-C0qjAgZ_.mjs} +4 -4
- package/dist/{client-CBbUzTcm.cjs → client-C8BTmcrh.cjs} +4 -4
- package/dist/{client-BKyTA9Hf.cjs → client-D0_UOmC1.cjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +25 -16
- package/dist/codex/happyMcpStdioBridge.mjs +25 -16
- package/dist/{codexAccount-DeFAjaHW.mjs → codexAccount-BAezf1fY.mjs} +1 -1
- package/dist/{codexAccount-8Wv5enLR.cjs → codexAccount-DfeCHUOU.cjs} +1 -1
- package/dist/{codexAppServerClient-BAcU_XN8.mjs → codexAppServerClient-By4ntTIr.mjs} +3 -3
- package/dist/{codexAppServerClient-6QmZ2Tn5.cjs → codexAppServerClient-xBeqblCj.cjs} +3 -3
- package/dist/{codexCommand-CCeaWZ-1.mjs → codexCommand-C7BVsmPu.mjs} +50 -46
- package/dist/{codexCommand-hJYa82Af.cjs → codexCommand-CgzJe-Ti.cjs} +54 -50
- package/dist/{codexTermination-BX0sCNFy.mjs → codexTermination-BS0sLBKS.mjs} +1 -1
- package/dist/{codexTermination-DKjQcC3e.cjs → codexTermination-DVrdQx3Q.cjs} +1 -1
- package/dist/{config-171VOPLq.cjs → config-4R0rnthZ.cjs} +3 -3
- package/dist/{config-9iXYh_zS.mjs → config-D3jidXDu.mjs} +3 -3
- package/dist/{configuration-D9k5yIzV.mjs → configuration-4pG95tsq.mjs} +1 -1
- package/dist/{configuration-CAzuk0Xs.cjs → configuration-ClUt7pqs.cjs} +1 -1
- package/dist/{connect-MlXU2FE3.cjs → connect-Da2NQJ3K.cjs} +13 -13
- package/dist/{connect-BEhKtsEn.mjs → connect-Do5qcqmg.mjs} +13 -13
- package/dist/{context-WVEuAdf2.mjs → context-Cf05DtNM.mjs} +1 -1
- package/dist/{context-CI9LnDu1.cjs → context-wMsIGwBw.cjs} +1 -1
- package/dist/{controlClient-Bb188cU0.cjs → controlClient-SYDFcIkk.cjs} +3 -3
- package/dist/{controlClient-DhFAPGHz.mjs → controlClient-bqCKl9Nv.mjs} +3 -3
- package/dist/{createSessionMetadata-BIK0Xz31.mjs → createSessionMetadata-CQkxe_4T.mjs} +3 -2
- package/dist/{createSessionMetadata-C2EQi_od.cjs → createSessionMetadata-msQTEvvn.cjs} +3 -2
- package/dist/{daemonAccounts-DD5YBwku.mjs → daemonAccounts-B8xnkprW.mjs} +3 -3
- package/dist/{daemonAccounts-nLyHz8WB.cjs → daemonAccounts-Ch_rSTSX.cjs} +2 -2
- package/dist/{defaultPermissionMode-BA1fgIpW.cjs → defaultPermissionMode-BETWd5Lf.cjs} +1 -1
- package/dist/{defaultPermissionMode-Dmw3lpdN.mjs → defaultPermissionMode-Cl3OvdHp.mjs} +1 -1
- package/dist/{deterministicJson-BJ7LY5-S.mjs → deterministicJson-BRAeReBK.mjs} +67 -17
- package/dist/{deterministicJson-DCzFgRiT.cjs → deterministicJson-CQ8jkArF.cjs} +72 -22
- package/dist/{doctor-CH_pTY3Q.cjs → doctor-C9D-t20z.cjs} +7 -7
- package/dist/{doctor-jAPeyoi6.mjs → doctor-Dy7z3qvy.mjs} +7 -7
- package/dist/{downloadTarget-CZS0BVu2.cjs → downloadTarget-DfoOSrYi.cjs} +6 -6
- package/dist/{downloadTarget-BhMm1keb.mjs → downloadTarget-Diq-GBu4.mjs} +6 -6
- package/dist/{ensureDaemonRunning-CTKaWMED.cjs → ensureDaemonRunning-Df76EtKd.cjs} +5 -5
- package/dist/{ensureDaemonRunning-BjbC8PuJ.mjs → ensureDaemonRunning-LqrgqVG3.mjs} +5 -5
- package/dist/format-CbliQN8V.mjs +70 -0
- package/dist/format-P9_M_7ga.cjs +74 -0
- package/dist/{handleResumeCommand-DsaEUiax.cjs → handleResumeCommand-CjCtwrrm.cjs} +5 -5
- package/dist/{handleResumeCommand-DbFTdwoc.mjs → handleResumeCommand-Dz4Aw_aZ.mjs} +5 -5
- package/dist/{index-DpQ9OLYi.mjs → index-BNBXrqRE.mjs} +4 -4
- package/dist/{index-BnT8yvlF.cjs → index-BiutHOAO.cjs} +60 -1
- package/dist/{index-DdJRSpLB.cjs → index-ByBOdEvG.cjs} +48 -44
- package/dist/{index-qVJYCmRA.cjs → index-CbzettaI.cjs} +4 -4
- package/dist/{index-DuoMPw0y.cjs → index-CdOnhx2X.cjs} +4 -4
- package/dist/{index-BEKb2cxz.mjs → index-CjMA70-R.mjs} +47 -43
- package/dist/{index-DL6ONx6v.cjs → index-DUwOmhnq.cjs} +3 -3
- package/dist/{index-DcfbjaVL.mjs → index-Sdvy1Lsf.mjs} +3 -3
- package/dist/{index-BAjoMeJi.mjs → index-XP-qcJQ3.mjs} +4 -4
- package/dist/{index-BQvPYTNM.mjs → index-kwsivEs-.mjs} +48 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-5nblS8vW.cjs → install-C4dKrmxR.cjs} +3 -3
- package/dist/{install-CJcRTQVK.mjs → install-DMXd8Z4c.mjs} +3 -3
- package/dist/issue-BijeNKIT.cjs +237 -0
- package/dist/issue-COytLvGE.mjs +229 -0
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +6 -0
- package/dist/lib.d.mts +6 -0
- package/dist/lib.mjs +12 -12
- package/dist/{localHappyAgentAuth-Bsk_VyUN.cjs → localHappyAgentAuth-CjtNcaI0.cjs} +1 -1
- package/dist/{localHappyAgentAuth-CD896cy4.mjs → localHappyAgentAuth-DeDQjw24.mjs} +1 -1
- package/dist/{logger-n9NOzHhK.mjs → logger-BLMi8oJK.mjs} +2 -2
- package/dist/{logger-LsJ3Cl5o.cjs → logger-D28MY1Bv.cjs} +2 -2
- package/dist/{machineMetadata-CUU2NSYl.cjs → machineMetadata-BzjrIn_N.cjs} +3 -3
- package/dist/{machineMetadata-Bc7FwngX.mjs → machineMetadata-D8OWVD4l.mjs} +3 -3
- package/dist/{main-CEu9zJ4x.cjs → main-DoJIcSOh.cjs} +57 -47
- package/dist/{main-CzItRviV.mjs → main-c0fCuBON.mjs} +57 -47
- package/dist/{mcp-CPW1yQdX.cjs → mcp-CEtvR6tG.cjs} +18 -18
- package/dist/{mcp-yK3ynz_E.mjs → mcp-DKkBFGUa.mjs} +18 -18
- package/dist/{mirrorProtocol-5bgkr1Or.cjs → mirrorProtocol-CCl9dtzh.cjs} +3 -3
- package/dist/{mirrorProtocol-CoXxepvL.mjs → mirrorProtocol-DFQLXDBI.mjs} +3 -3
- package/dist/{package-D7V1BX2I.cjs → package-BFSsS_dl.cjs} +7 -7
- package/dist/{package-CCF6FHr2.mjs → package-DbGqY8Ej.mjs} +7 -7
- package/dist/{panels-CF5n641F.mjs → panels-2yIO9FxQ.mjs} +5 -5
- package/dist/{panels-9DdVhaxc.cjs → panels-BqLXIQif.cjs} +5 -5
- package/dist/{peerTools-gR_3dwdA.mjs → peerTools-4GYKxr8J.mjs} +5 -5
- package/dist/{peerTools-Dv6bgHkW.cjs → peerTools-Z8V2E0AF.cjs} +5 -5
- package/dist/{persistence-B5U9rC15.mjs → persistence-DbOKjdUD.mjs} +3 -3
- package/dist/{persistence-Dl3sBrCF.cjs → persistence-TpVFA5-I.cjs} +2 -2
- package/dist/{piRunnerArgs-DOV74xAt.mjs → piRunnerArgs-Bdj0sjAT.mjs} +1 -1
- package/dist/{piRunnerArgs-rygeUdRz.cjs → piRunnerArgs-DOEJJymf.cjs} +1 -1
- package/dist/{piRuntime-dtlRpOYa.mjs → piRuntime-B0QZykV7.mjs} +1 -1
- package/dist/{piRuntime-BvxCy9qQ.cjs → piRuntime-DiRayy91.cjs} +1 -1
- package/dist/{piTerminal-Bx6c5Jyd.mjs → piTerminal-DGF4X7C-.mjs} +20 -20
- package/dist/{piTerminal-ClaMS-57.cjs → piTerminal-DciFqPEi.cjs} +20 -20
- package/dist/{pushNotifications-IZaTtVDG.cjs → pushNotifications-C1i2W1GQ.cjs} +3 -3
- package/dist/{pushNotifications-pHkbUkqT.mjs → pushNotifications-CrCTpDiN.mjs} +3 -3
- package/dist/{query-BVqnfxlX.cjs → query-BkOpCpRo.cjs} +1 -1
- package/dist/{query-D_3rFFWe.mjs → query-CrSvcV32.mjs} +1 -1
- package/dist/{rateLimitWindows-C7xi99Eb.cjs → rateLimitWindows-BREA7OZj.cjs} +1 -1
- package/dist/{rateLimitWindows-DnLJ-gve.mjs → rateLimitWindows-DZVrafmm.mjs} +1 -1
- package/dist/{reconnectGate-DPDXEkOX.mjs → reconnectGate-COxAZTv8.mjs} +1 -1
- package/dist/{reconnectGate-CHI12y0Y.cjs → reconnectGate-YQ5jXJfY.cjs} +1 -1
- package/dist/{registerCommonHandlers-BrTglZnC.mjs → registerCommonHandlers-Cfl_dEWs.mjs} +2 -2
- package/dist/{registerCommonHandlers-CUCw-rad.cjs → registerCommonHandlers-D95IxqDN.cjs} +2 -2
- package/dist/{registerKillSessionHandler-Bo697Mt0.cjs → registerKillSessionHandler-DJJXtc_L.cjs} +6 -6
- package/dist/{registerKillSessionHandler-BJSVT1iq.mjs → registerKillSessionHandler-DoE6xgH3.mjs} +6 -6
- package/dist/{registerSideQuestionHandler-HNpsU_20.cjs → registerSideQuestionHandler-DsRz-aD9.cjs} +4 -4
- package/dist/{registerSideQuestionHandler-BFPCMrmC.mjs → registerSideQuestionHandler-Dv00rqcy.mjs} +4 -4
- package/dist/{remoteSessionClient-Blz-z9jM.mjs → remoteSessionClient-BFd_D9ka.mjs} +5 -5
- package/dist/{remoteSessionClient-9NzkfL13.cjs → remoteSessionClient-DleOeQlN.cjs} +5 -5
- package/dist/{reportProgressTool-B2-RFomn.mjs → reportProgressTool-D4xKY9Ur.mjs} +111 -4
- package/dist/{reportProgressTool-CW9rSnwQ.cjs → reportProgressTool-DtEpDqv3.cjs} +113 -3
- package/dist/{run-9aB7U4BF.cjs → run-CVAIFpsp.cjs} +391 -42
- package/dist/{run-BXyfDvCk.mjs → run-iDEMW4js.mjs} +391 -42
- package/dist/{runClaude-BKpWJdCX.mjs → runClaude-DvHdLJaV.mjs} +27 -25
- package/dist/{runClaude-B4ohp5Dk.cjs → runClaude-gucCQBma.cjs} +30 -28
- package/dist/{runClaudeDeps-gqSYeQkl.cjs → runClaudeDeps-CQ8vvqUQ.cjs} +42 -40
- package/dist/{runClaudeDeps-B0x5BCqC.mjs → runClaudeDeps-DkFWFwVc.mjs} +48 -46
- package/dist/{runGemini-BvV5k9b3.mjs → runGemini-B2lXQDru.mjs} +35 -33
- package/dist/{runGemini-BMzDy7hY.cjs → runGemini-C0vqJYtS.cjs} +35 -33
- package/dist/{runOpenClaw-3Cx3C2ww.cjs → runOpenClaw-DNV7GX73.cjs} +18 -18
- package/dist/{runOpenClaw-UcIDMHm7.mjs → runOpenClaw-Ddb6sOkY.mjs} +18 -18
- package/dist/{sandbox-BC-KbWe7.mjs → sandbox-Cw0cPDDh.mjs} +4 -4
- package/dist/{sandbox-QJdxjmxr.cjs → sandbox-FA0RlaZg.cjs} +4 -4
- package/dist/selfCheck-B-hKig8I.mjs +89 -0
- package/dist/{selfCheck-Be_M5coh.cjs → selfCheck-DFC8fzhF.cjs} +40 -39
- package/dist/{send-DhWp8M8B.cjs → send-BFd-5b_Q.cjs} +8 -8
- package/dist/{send-x789D5ci.mjs → send-CwgqPftE.mjs} +8 -8
- package/dist/{server-D-aSnlWI.mjs → server-C_4Fk45r.mjs} +4 -4
- package/dist/{server-kPDtS-DX.cjs → server-DwOdMGAP.cjs} +6 -6
- package/dist/{sessionLock-JWBEd8g_.mjs → sessionLock-CphKQyav.mjs} +3 -3
- package/dist/{sessionLock-CuPN9xfW.cjs → sessionLock-DglhFHzB.cjs} +3 -3
- package/dist/{startupSessionCreate-CxwJb5m9.cjs → sessionMetadata-DyTJ0Ki5.cjs} +14 -3
- package/dist/{startupSessionCreate-f1g6pp6E.mjs → sessionMetadata-V7Z7F-cj.mjs} +14 -4
- package/dist/{sessionOps-CYNOycqT.cjs → sessionOps-CIFvoFPA.cjs} +4 -4
- package/dist/{sessionOps-VS1baPz_.mjs → sessionOps-D-uFSTHk.mjs} +4 -4
- package/dist/{sessionProvider-DksA6icp.cjs → sessionProvider-B0daO-Ln.cjs} +10 -10
- package/dist/{sessionProvider-iRLKuR9V.mjs → sessionProvider-D8y7K8bK.mjs} +10 -10
- package/dist/{sessionScanner--X2Pzlra.cjs → sessionScanner-CWflbWoH.cjs} +3 -3
- package/dist/{sessionScanner-CAxiFc_3.mjs → sessionScanner-DQAOP6pU.mjs} +3 -3
- package/dist/{sessions-Dca1UgiF.mjs → sessions-CaO_-AI7.mjs} +10 -10
- package/dist/{sessions-BrnP53eO.cjs → sessions-CzpI76qj.cjs} +10 -10
- package/dist/{setupOfflineReconnection-Dwg6nHnP.cjs → setupOfflineReconnection-BZHRoKDx.cjs} +2 -2
- package/dist/{setupOfflineReconnection-nguxOn4s.mjs → setupOfflineReconnection-Ck-p0YPb.mjs} +2 -2
- package/dist/{spawn-BJMU9zbZ.mjs → spawn-BEJxfj60.mjs} +14 -14
- package/dist/{spawn-DDyMxQ7Z.cjs → spawn-DyjOa4nf.cjs} +14 -14
- package/dist/{spawnAgents-B8GT4JQX.cjs → spawnAgents-IiuqX0S5.cjs} +1 -1
- package/dist/{spawnAgents-SeUX5gIq.mjs → spawnAgents-XObVj6zN.mjs} +1 -1
- package/dist/{spawnHappyCLI-Cvk2ZMYj.cjs → spawnHappyCLI-C3XuIB2N.cjs} +1 -1
- package/dist/{spawnHappyCLI-DnT_QEdn.mjs → spawnHappyCLI-Cc9kKpcq.mjs} +1 -1
- package/dist/{startFileWatcher-DLfkP-IW.cjs → startFileWatcher-CeDJl9mN.cjs} +1 -1
- package/dist/{startFileWatcher-Djf0SdmK.mjs → startFileWatcher-t3K1y9kY.mjs} +1 -1
- package/dist/{store-DnaIrYLA.mjs → store-CqNAE-0v.mjs} +1 -1
- package/dist/{store-D41VdZcL.cjs → store-DOZAMV4W.cjs} +1 -1
- package/dist/{streamRelay-DEBIU6Ak.mjs → streamRelay-7D7v0hvk.mjs} +1 -1
- package/dist/{streamRelay-BT9ew0Mk.cjs → streamRelay-Dyp4x44P.cjs} +1 -1
- package/dist/{sync-B-B5mc8Z.cjs → sync-BvxhuW9R.cjs} +1 -1
- package/dist/{sync-Dfr1zgLx.mjs → sync-s1pUqWGm.mjs} +1 -1
- package/dist/{systemPrompt-pxNDR5u8.cjs → systemPrompt-CCdSrtn3.cjs} +2 -2
- package/dist/{systemPrompt-DAQq-bKB.mjs → systemPrompt-CLYTbBhV.mjs} +2 -2
- package/dist/{teams-BuXDbvzq.mjs → teams-BVp5F_xN.mjs} +7 -7
- package/dist/{teams-CBMB5SvT.cjs → teams-D2q1DQWz.cjs} +7 -7
- package/dist/{template-CB4gXtUX.cjs → template-M1YGFYUT.cjs} +1 -1
- package/dist/{template-DE9JMShn.mjs → template-oBrR0saD.mjs} +1 -1
- package/dist/{time-DTaj0RVK.cjs → time-D-v2Cd9e.cjs} +1 -1
- package/dist/{time-PqfO1O58.mjs → time-qd46L189.mjs} +1 -1
- package/dist/{titleGenerator-DVnEGxoB.mjs → titleGenerator-BdeHi3IY.mjs} +2 -2
- package/dist/{titleGenerator-BP5gqicG.cjs → titleGenerator-CSYqcorn.cjs} +3 -3
- package/dist/{todo-DaJPxDVT.mjs → todo-DiEhLgUZ.mjs} +95 -12
- package/dist/{todo-BXsQ5-iD.cjs → todo-Dq_YuJvj.cjs} +101 -18
- package/dist/{tools-G3_fMSjb.cjs → tools-CY2zrdd5.cjs} +1 -1
- package/dist/{tools-B4W8kWU8.mjs → tools-DR7GWBBV.mjs} +1 -1
- package/dist/{uninstall-C0pua8G4.cjs → uninstall-BHhHjbzE.cjs} +3 -3
- package/dist/{uninstall-ByWgUWHg.mjs → uninstall-BvwDZVU9.mjs} +3 -3
- package/dist/{wrapperAccount-BDeMsgbw.mjs → wrapperAccount-CpDsQL15.mjs} +2 -2
- package/dist/{wrapperAccount-CsxMfnCK.cjs → wrapperAccount-ejUjAQaM.cjs} +2 -2
- package/package.json +7 -7
- package/dist/selfCheck-NWjxjpSx.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-
|
|
4
|
-
import { r as readSettings } from './persistence-
|
|
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-
|
|
9
|
+
import './configuration-4pG95tsq.mjs';
|
|
10
10
|
import 'node:path';
|
|
11
|
-
import './package-
|
|
11
|
+
import './package-DbGqY8Ej.mjs';
|
|
12
12
|
import 'node:fs/promises';
|
|
13
13
|
import 'zod';
|
|
14
14
|
import './authRelay-DhQhkBvX.mjs';
|
|
@@ -1233,9 +1233,13 @@ For add, retry with the same UUID and identical title/note after a timeout; do n
|
|
|
1233
1233
|
|
|
1234
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.
|
|
1235
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
|
+
|
|
1236
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.
|
|
1237
1241
|
`;
|
|
1238
|
-
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.";
|
|
1239
1243
|
z$1.object({
|
|
1240
1244
|
source: z$1.literal("pi"),
|
|
1241
1245
|
tokens: z$1.number().finite().nonnegative().nullable(),
|
|
@@ -1802,6 +1806,12 @@ function ownerBoardPostToRest(sessionId, input, anchor) {
|
|
|
1802
1806
|
inferred: false
|
|
1803
1807
|
};
|
|
1804
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";
|
|
1805
1815
|
const ISSUE_LIMITS = {
|
|
1806
1816
|
titleChars: 300,
|
|
1807
1817
|
descriptionBytes: 32 * 1024,
|
|
@@ -1814,8 +1824,23 @@ const ISSUE_LIMITS = {
|
|
|
1814
1824
|
const ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "blocked", "done", "cancelled"];
|
|
1815
1825
|
const ISSUE_PRIORITIES = ["urgent", "high", "medium", "low", "none"];
|
|
1816
1826
|
const ISSUE_AGENT_STATUSES = ["in_progress", "in_review", "blocked"];
|
|
1827
|
+
const ISSUE_CLOSED_STATUSES = ["done", "cancelled"];
|
|
1817
1828
|
const ISSUE_ASSIGNABLE_AGENTS = ["claude", "codex", "pi"];
|
|
1818
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
|
+
}
|
|
1819
1844
|
const id = z$1.string().min(1).max(128);
|
|
1820
1845
|
const requestId = z$1.string().min(1).max(128);
|
|
1821
1846
|
const utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
@@ -1969,6 +1994,27 @@ z$1.object({
|
|
|
1969
1994
|
t: z$1.literal("issue-run"),
|
|
1970
1995
|
run: z$1.object({ id: z$1.string(), issueId: z$1.string(), status: z$1.string() }).passthrough()
|
|
1971
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
|
+
];
|
|
1972
2018
|
const SYNC_HELLO_MAX_REQUEST_SUBS = 64;
|
|
1973
2019
|
const sessionIdSchema = z.string().min(1).max(128);
|
|
1974
2020
|
const afterSeqSchema = z.number().int().min(0).nullable();
|
|
@@ -2066,4 +2112,4 @@ z.object({
|
|
|
2066
2112
|
reason: z.string()
|
|
2067
2113
|
});
|
|
2068
2114
|
|
|
2069
|
-
export {
|
|
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
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
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-
|
|
10
|
+
require('./configuration-ClUt7pqs.cjs');
|
|
11
11
|
require('node:fs');
|
|
12
12
|
require('node:os');
|
|
13
13
|
require('node:path');
|
|
14
|
-
require('./package-
|
|
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-
|
|
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-
|
|
8
|
+
import './configuration-4pG95tsq.mjs';
|
|
9
9
|
import 'node:fs';
|
|
10
10
|
import 'node:os';
|
|
11
11
|
import 'node:path';
|
|
12
|
-
import './package-
|
|
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;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { f as ISSUE_ASSIGNABLE_AGENTS, p as parseIssueRef, g as ISSUE_STATUSES, h as ISSUE_PRIORITIES } from './index-kwsivEs-.mjs';
|
|
3
|
+
import { c as configuration } from './configuration-4pG95tsq.mjs';
|
|
4
|
+
import { r as readSettings } from './persistence-DbOKjdUD.mjs';
|
|
5
|
+
import { r as readTeamScope, t as teamScopePath } from './context-Cf05DtNM.mjs';
|
|
6
|
+
import { s as sharedIssuesClient, i as importLegacyTodosOnce } from './client-BgxQ9aej.mjs';
|
|
7
|
+
import { d as describeIssueError, f as formatIssueLine, a as formatIssueDetail } from './format-CbliQN8V.mjs';
|
|
8
|
+
import 'zod';
|
|
9
|
+
import '@paralleldrive/cuid2';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import 'node:os';
|
|
12
|
+
import 'node:path';
|
|
13
|
+
import './package-DbGqY8Ej.mjs';
|
|
14
|
+
import 'node:fs/promises';
|
|
15
|
+
import './authRelay-DhQhkBvX.mjs';
|
|
16
|
+
import 'tweetnacl';
|
|
17
|
+
import './logger-BLMi8oJK.mjs';
|
|
18
|
+
import 'chalk';
|
|
19
|
+
import 'node:util';
|
|
20
|
+
|
|
21
|
+
const ISSUE_HELP = `very-happy issue \u2014 account Issues (spec 2026-11-issues)
|
|
22
|
+
very-happy issue list [--status todo,in_progress] [--project ID] [--mine] [--unassigned] [--all] [--limit N] [--json]
|
|
23
|
+
very-happy issue show VH-N [--json]
|
|
24
|
+
very-happy issue create --title TEXT [--desc TEXT] [--assign AGENT[@MACHINE_ID]|self|none] [--dir PATH] [--mode M] [--model ID]
|
|
25
|
+
[--project ID] [--priority P] [--label L]... [--status S] [--json]
|
|
26
|
+
very-happy issue update VH-N [--status S] [--assign \u2026] [--dir PATH] [--mode M] [--model ID] [--title TEXT] [--desc TEXT]
|
|
27
|
+
[--priority P] [--label L]... [--project ID|none] [--comment TEXT] [--json]
|
|
28
|
+
very-happy issue comment VH-N TEXT [--mention AGENT[@MACHINE_ID]]... [--json]
|
|
29
|
+
|
|
30
|
+
AGENT is ${ISSUE_ASSIGNABLE_AGENTS.join(" | ")}; without @MACHINE_ID it runs on this machine.
|
|
31
|
+
Assigning an agent on a runnable status (todo / in_progress / in_review / blocked)
|
|
32
|
+
starts a run; backlog only records the assignee. A comment starting with /note
|
|
33
|
+
never wakes an agent.
|
|
34
|
+
|
|
35
|
+
Inside a Very Happy session (HAPPY_SESSION_ID set) update and comment act as the
|
|
36
|
+
agent on the issue this session works on: status only in_progress / in_review /
|
|
37
|
+
blocked (in_review and blocked need --comment), never done or cancelled; create
|
|
38
|
+
is not available. Use --title=TEXT for values starting with --.`;
|
|
39
|
+
const MULTI = /* @__PURE__ */ new Set(["--label", "--mention"]);
|
|
40
|
+
const BOOL = /* @__PURE__ */ new Set(["--json", "--mine", "--unassigned", "--all"]);
|
|
41
|
+
const ALLOWED = {
|
|
42
|
+
list: ["--status", "--project", "--mine", "--unassigned", "--all", "--limit", "--json"],
|
|
43
|
+
show: ["--json"],
|
|
44
|
+
create: ["--title", "--desc", "--assign", "--dir", "--mode", "--model", "--project", "--priority", "--label", "--status", "--json"],
|
|
45
|
+
update: ["--status", "--assign", "--dir", "--mode", "--model", "--title", "--desc", "--priority", "--label", "--project", "--comment", "--json"],
|
|
46
|
+
comment: ["--mention", "--json"]
|
|
47
|
+
};
|
|
48
|
+
function parseIssueArgs(args) {
|
|
49
|
+
if (args.length === 0 || args[0] === "--help" || args[0] === "help") return { action: "help", positional: [], flags: {}, multi: {}, bools: /* @__PURE__ */ new Set() };
|
|
50
|
+
const action = args[0];
|
|
51
|
+
if (!(action in ALLOWED)) throw new Error("Unknown issue command; use issue --help");
|
|
52
|
+
const cmd = { action, positional: [], flags: {}, multi: {}, bools: /* @__PURE__ */ new Set() };
|
|
53
|
+
if (args.includes("--help")) return { ...cmd, action: "help" };
|
|
54
|
+
for (let i = 1; i < args.length; i++) {
|
|
55
|
+
const arg = args[i];
|
|
56
|
+
if (!arg.startsWith("--")) {
|
|
57
|
+
cmd.positional.push(arg);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const eq = arg.indexOf("=");
|
|
61
|
+
const flag = eq === -1 ? arg : arg.slice(0, eq);
|
|
62
|
+
if (!ALLOWED[action].includes(flag)) throw new Error(`${flag} is not supported for issue ${action}`);
|
|
63
|
+
if (BOOL.has(flag)) {
|
|
64
|
+
if (eq !== -1) throw new Error(`${flag} takes no value`);
|
|
65
|
+
cmd.bools.add(flag);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const value = eq === -1 ? args[++i] : arg.slice(eq + 1);
|
|
69
|
+
if (value === void 0 || eq === -1 && value.startsWith("--")) throw new Error(`Missing value for ${flag}`);
|
|
70
|
+
if (MULTI.has(flag)) (cmd.multi[flag] ??= []).push(value);
|
|
71
|
+
else {
|
|
72
|
+
if (Object.hasOwn(cmd.flags, flag)) throw new Error(`Duplicate option: ${flag}`);
|
|
73
|
+
cmd.flags[flag] = value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const wantRef = action === "show" || action === "update" || action === "comment";
|
|
77
|
+
if (wantRef && !cmd.positional[0]) throw new Error(`issue ${action} needs an issue (VH-N)`);
|
|
78
|
+
if (wantRef && !parseIssueRef(cmd.positional[0])) throw new Error(`Not an issue reference: ${cmd.positional[0]}`);
|
|
79
|
+
if (action === "comment" && cmd.positional.length !== 2) throw new Error("issue comment needs VH-N and one TEXT argument (quote it)");
|
|
80
|
+
if ((action === "show" || action === "update") && cmd.positional.length !== 1) throw new Error("Unexpected argument");
|
|
81
|
+
if ((action === "list" || action === "create") && cmd.positional.length) throw new Error("Unexpected argument");
|
|
82
|
+
if (action === "create" && !cmd.flags["--title"]?.trim()) throw new Error("create needs --title");
|
|
83
|
+
for (const f of ["--dir", "--mode", "--model"]) if (cmd.flags[f] !== void 0 && !cmd.flags["--assign"]) throw new Error(`${f} goes with --assign AGENT`);
|
|
84
|
+
for (const key of ["--status"]) if (cmd.flags[key] !== void 0 && action !== "list" && !ISSUE_STATUSES.includes(cmd.flags[key])) throw new Error(`Unknown status "${cmd.flags[key]}" (${ISSUE_STATUSES.join(", ")})`);
|
|
85
|
+
if (cmd.flags["--priority"] !== void 0 && !ISSUE_PRIORITIES.includes(cmd.flags["--priority"])) throw new Error(`Unknown priority (${ISSUE_PRIORITIES.join(", ")})`);
|
|
86
|
+
if (cmd.flags["--limit"] !== void 0 && !/^[1-9][0-9]{0,2}$/.test(cmd.flags["--limit"])) throw new Error("--limit must be 1\u2013500");
|
|
87
|
+
return cmd;
|
|
88
|
+
}
|
|
89
|
+
function parseAssign(value, localMachineId2, directory, run = {}) {
|
|
90
|
+
if (value === "self" || value === "none") return { kind: value };
|
|
91
|
+
const [agent, machine] = value.split("@", 2);
|
|
92
|
+
if (!ISSUE_ASSIGNABLE_AGENTS.includes(agent)) throw new Error(`Unknown agent "${agent}" (${ISSUE_ASSIGNABLE_AGENTS.join(", ")}, self, none)`);
|
|
93
|
+
const machineId = machine || localMachineId2;
|
|
94
|
+
if (!machineId) throw new Error("This machine has no id yet (start the daemon once), or pass AGENT@MACHINE_ID");
|
|
95
|
+
return {
|
|
96
|
+
kind: "agent",
|
|
97
|
+
agent,
|
|
98
|
+
machineId,
|
|
99
|
+
...directory ? { directory } : {},
|
|
100
|
+
...run.permissionMode ? { permissionMode: run.permissionMode } : {},
|
|
101
|
+
...run.model ? { model: run.model } : {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function parseMention(value, localMachineId2) {
|
|
105
|
+
const [agent, machine] = value.split("@", 2);
|
|
106
|
+
if (!ISSUE_ASSIGNABLE_AGENTS.includes(agent)) throw new Error(`Unknown agent "${agent}" for --mention`);
|
|
107
|
+
return { kind: "agent", agent, ...machine ? { machineId: machine } : {} };
|
|
108
|
+
}
|
|
109
|
+
async function localMachineId() {
|
|
110
|
+
try {
|
|
111
|
+
return (await readSettings())?.machineId ?? null;
|
|
112
|
+
} catch {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function agentSessionId(env = process.env) {
|
|
117
|
+
const sid = env.HAPPY_SESSION_ID;
|
|
118
|
+
return sid && /^[A-Za-z0-9_-]{1,128}$/.test(sid) ? sid : null;
|
|
119
|
+
}
|
|
120
|
+
async function scoped(sessionId) {
|
|
121
|
+
if (process.env.VH_TEAM_SCOPE_FILE !== void 0) return true;
|
|
122
|
+
return !!sessionId && !!await readTeamScope(teamScopePath(sessionId));
|
|
123
|
+
}
|
|
124
|
+
function print(json, value, text) {
|
|
125
|
+
console.log(json ? JSON.stringify({ serverUrl: configuration.serverUrl, result: value }) : text);
|
|
126
|
+
}
|
|
127
|
+
async function runIssueCommand(cmd, deps = {}) {
|
|
128
|
+
if (cmd.action === "help") {
|
|
129
|
+
console.log(ISSUE_HELP);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const client = deps.client ?? sharedIssuesClient();
|
|
133
|
+
const json = cmd.bools.has("--json");
|
|
134
|
+
const sessionId = agentSessionId(deps.env ?? process.env);
|
|
135
|
+
const isScoped = await scoped(sessionId);
|
|
136
|
+
if (cmd.action === "update" || cmd.action === "comment") {
|
|
137
|
+
if (sessionId) {
|
|
138
|
+
const ctx = await client.session(sessionId);
|
|
139
|
+
const ref = parseIssueRef(cmd.positional[0]);
|
|
140
|
+
if (!ctx.issue || ("number" in ref ? ref.number !== ctx.issue.number : ref.id !== ctx.issue.id)) {
|
|
141
|
+
throw new Error("issue_not_bound: Inside a session you can only update or comment on the issue this session works on.");
|
|
142
|
+
}
|
|
143
|
+
if (cmd.action === "comment") {
|
|
144
|
+
if (cmd.multi["--mention"]?.length) throw new Error("--mention is for the owner; an agent comment never wakes another agent");
|
|
145
|
+
const result2 = await client.agentComment({ sessionId, body: cmd.positional[1], requestId: randomUUID() });
|
|
146
|
+
print(json, result2, `commented on ${result2.issue.key}`);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const extra = Object.keys(cmd.flags).filter((f) => f !== "--status" && f !== "--comment");
|
|
150
|
+
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(", ")})`);
|
|
151
|
+
const result = await client.agentUpdate({ sessionId, requestId: randomUUID(), ...cmd.flags["--status"] ? { status: cmd.flags["--status"] } : {}, ...cmd.flags["--comment"] ? { comment: cmd.flags["--comment"] } : {} });
|
|
152
|
+
print(json, result, `${result.issue.key} is ${result.issue.status}`);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (isScoped && cmd.action !== "show") throw new Error("Scoped Teams sessions cannot access account Issues; ask the owner session.");
|
|
157
|
+
if (sessionId && cmd.action === "create") throw new Error("Agents cannot create issues; ask the owner.");
|
|
158
|
+
if (cmd.action === "list") {
|
|
159
|
+
if (!sessionId) await importLegacyTodosOnce(client);
|
|
160
|
+
const status = cmd.flags["--status"] ?? (cmd.bools.has("--all") ? void 0 : ISSUE_STATUSES.filter((s) => s !== "done" && s !== "cancelled").join(","));
|
|
161
|
+
const list = await client.list({
|
|
162
|
+
...status ? { status } : {},
|
|
163
|
+
...cmd.flags["--project"] ? { projectId: cmd.flags["--project"] } : {},
|
|
164
|
+
...cmd.bools.has("--mine") ? { assigneeKind: "self" } : cmd.bools.has("--unassigned") ? { assigneeKind: "none" } : {},
|
|
165
|
+
limit: cmd.flags["--limit"] ? Number(cmd.flags["--limit"]) : 100
|
|
166
|
+
});
|
|
167
|
+
print(json, list, list.issues.length ? list.issues.map(formatIssueLine).join("\n") : "no issues");
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (cmd.action === "show") {
|
|
171
|
+
if (isScoped) {
|
|
172
|
+
const ctx = sessionId ? await client.session(sessionId) : null;
|
|
173
|
+
const ref = parseIssueRef(cmd.positional[0]);
|
|
174
|
+
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.");
|
|
175
|
+
}
|
|
176
|
+
if (!sessionId) await importLegacyTodosOnce(client);
|
|
177
|
+
const detail = await client.get(cmd.positional[0]);
|
|
178
|
+
print(json, detail, formatIssueDetail({ issue: detail.issue, comments: detail.comments, runs: detail.runs }));
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const machine = await localMachineId();
|
|
182
|
+
if (cmd.action === "create") {
|
|
183
|
+
const input = {
|
|
184
|
+
title: cmd.flags["--title"].trim(),
|
|
185
|
+
requestId: randomUUID(),
|
|
186
|
+
...cmd.flags["--desc"] !== void 0 ? { description: cmd.flags["--desc"] } : {},
|
|
187
|
+
...cmd.flags["--assign"] ? { assignee: parseAssign(cmd.flags["--assign"], machine, cmd.flags["--dir"], { permissionMode: cmd.flags["--mode"], model: cmd.flags["--model"] }) } : {},
|
|
188
|
+
...cmd.flags["--project"] ? { projectId: cmd.flags["--project"] } : {},
|
|
189
|
+
...cmd.flags["--priority"] ? { priority: cmd.flags["--priority"] } : {},
|
|
190
|
+
...cmd.multi["--label"]?.length ? { labels: cmd.multi["--label"] } : {},
|
|
191
|
+
...cmd.flags["--status"] ? { status: cmd.flags["--status"] } : {}
|
|
192
|
+
};
|
|
193
|
+
const result = await client.create(input);
|
|
194
|
+
print(json, result, `created ${formatIssueLine(result.issue)}${result.runs?.length ? `
|
|
195
|
+
run #${result.runs[0].seq} queued on ${result.runs[0].agent}` : ""}`);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const target = (await client.get(cmd.positional[0])).issue;
|
|
199
|
+
if (cmd.action === "comment") {
|
|
200
|
+
const mentions = (cmd.multi["--mention"] ?? []).map((m) => parseMention(m));
|
|
201
|
+
const result = await client.comment(target.id, { body: cmd.positional[1], requestId: randomUUID(), ...mentions.length ? { mentions } : {} });
|
|
202
|
+
print(json, result, `commented on ${result.issue.key}${result.comment?.routedRunIds.length ? " (delivered to the agent)" : ""}`);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const patch = {
|
|
206
|
+
...cmd.flags["--status"] ? { status: cmd.flags["--status"] } : {},
|
|
207
|
+
...cmd.flags["--assign"] ? { assignee: parseAssign(cmd.flags["--assign"], machine, cmd.flags["--dir"], { permissionMode: cmd.flags["--mode"], model: cmd.flags["--model"] }) } : {},
|
|
208
|
+
...cmd.flags["--title"] !== void 0 ? { title: cmd.flags["--title"].trim() } : {},
|
|
209
|
+
...cmd.flags["--desc"] !== void 0 ? { description: cmd.flags["--desc"] } : {},
|
|
210
|
+
...cmd.flags["--priority"] ? { priority: cmd.flags["--priority"] } : {},
|
|
211
|
+
...cmd.multi["--label"] ? { labels: cmd.multi["--label"] } : {},
|
|
212
|
+
...cmd.flags["--project"] ? { projectId: cmd.flags["--project"] === "none" ? null : cmd.flags["--project"] } : {}
|
|
213
|
+
};
|
|
214
|
+
let issue = target;
|
|
215
|
+
if (Object.keys(patch).length) issue = (await client.update(target.id, patch)).issue;
|
|
216
|
+
if (cmd.flags["--comment"]) await client.comment(target.id, { body: cmd.flags["--comment"], requestId: randomUUID() });
|
|
217
|
+
if (!Object.keys(patch).length && !cmd.flags["--comment"]) throw new Error("Nothing to update");
|
|
218
|
+
print(json, issue, `updated ${formatIssueLine(issue)}`);
|
|
219
|
+
}
|
|
220
|
+
async function handleIssueCommand(args) {
|
|
221
|
+
const cmd = parseIssueArgs(args);
|
|
222
|
+
try {
|
|
223
|
+
await runIssueCommand(cmd);
|
|
224
|
+
} catch (error) {
|
|
225
|
+
throw new Error(describeIssueError(error));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export { ISSUE_HELP, agentSessionId, handleIssueCommand, parseAssign, parseIssueArgs, parseMention, runIssueCommand };
|