autohand-cli 0.9.0 → 0.9.2
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/README.md +118 -76
- package/dist/AgentRegistry-BBQRODQC.cjs +18 -0
- package/dist/AgentRegistry-JBXZUPML.js +18 -0
- package/dist/{CommunitySkillsCache-ZEQWP6YM.js → CommunitySkillsCache-CI7UN2DX.js} +2 -2
- package/dist/CommunitySkillsCache-XTQ6RMTA.cjs +8 -0
- package/dist/{HookManager-CWLTFKWO.js → HookManager-BELBPQQI.js} +1 -1
- package/dist/{HookManager-TMAJQU4S.cjs → HookManager-ZL2CLAJW.cjs} +2 -2
- package/dist/{ImportWizard-MQXEED2U.cjs → ImportWizard-U6CIJREW.cjs} +13 -13
- package/dist/{ImportWizard-QBKQEXDW.js → ImportWizard-VJFSWSUQ.js} +4 -4
- package/dist/LearnAdvisor-LAURA3IB.cjs +9 -0
- package/dist/LearnAdvisor-RFOBXFG7.js +9 -0
- package/dist/MemoryManager-3A2VRPF2.js +9 -0
- package/dist/MemoryManager-UOEQZIDC.cjs +9 -0
- package/dist/{NVIDIAProvider-2HR737UE.js → NVIDIAProvider-AFNJNWJM.js} +1 -1
- package/dist/NVIDIAProvider-L5GTYRCQ.cjs +14 -0
- package/dist/{PermissionManager-KMYILJ4Z.js → PermissionManager-N2LDSOYF.js} +3 -3
- package/dist/PermissionManager-ZNURIEYR.cjs +11 -0
- package/dist/ProviderFactory-3BFS65V7.cjs +13 -0
- package/dist/{ProviderFactory-HFPRVQ25.js → ProviderFactory-XUT6BSGB.js} +4 -2
- package/dist/SessionManager-LGPQIA57.cjs +10 -0
- package/dist/{SessionManager-PNBTJJTQ.js → SessionManager-OR4KDDDS.js} +2 -2
- package/dist/{SkillsRegistry-4RRD5GMX.js → SkillsRegistry-IL3GWROU.js} +2 -2
- package/dist/SkillsRegistry-PM34DQNA.cjs +9 -0
- package/dist/SubAgent-2WG4QQB5.cjs +13 -0
- package/dist/SubAgent-ICGN23TQ.js +13 -0
- package/dist/{SyncApiClient-LRPFNCKJ.js → SyncApiClient-G3FM65IV.js} +1 -1
- package/dist/SyncApiClient-ODBDECOG.cjs +11 -0
- package/dist/{about-BW3PDZUU.js → about-OYVGQMJJ.js} +5 -4
- package/dist/about-U2BH7HDR.cjs +15 -0
- package/dist/{acp-VHEL7BOW.js → acp-JWHGXZL5.js} +207 -102
- package/dist/{acp-EOETGAHC.cjs → acp-S37JOBCS.cjs} +226 -121
- package/dist/actionExecutor-2QEPMELQ.cjs +28 -0
- package/dist/actionExecutor-6NCCORRB.js +28 -0
- package/dist/add-dir-KFUHSIR2.cjs +11 -0
- package/dist/{add-dir-VFX7QT4E.js → add-dir-MM2BM2Z2.js} +2 -2
- package/dist/agent-DUIYLIVN.js +132 -0
- package/dist/agent-YYEHGDAK.cjs +132 -0
- package/dist/agents-GBGG4CW7.cjs +19 -0
- package/dist/agents-ZH34C72F.js +19 -0
- package/dist/agents-new-ERXLS7SB.cjs +17 -0
- package/dist/agents-new-EVTGPTA4.js +17 -0
- package/dist/{autoSkill-EFMK6WU6.js → autoSkill-HEWKJ5JV.js} +2 -2
- package/dist/autoSkill-YL6PN6AV.cjs +20 -0
- package/dist/automode-4BJ7FNPL.cjs +10 -0
- package/dist/{automode-BMYSRM34.js → automode-S4U7A7Q2.js} +2 -2
- package/dist/chrome-45ZXHL5N.cjs +22 -0
- package/dist/{chrome-NHJ44WUN.js → chrome-BBSRVG6S.js} +2 -2
- package/dist/chrome-IFVZRHAT.cjs +50 -0
- package/dist/chrome-MYE6DNA2.js +22 -0
- package/dist/chunk-24CEJYEG.cjs +579 -0
- package/dist/{chunk-47PHDKNW.cjs → chunk-255GIVM2.cjs} +6 -6
- package/dist/{chunk-DIZTWFVR.cjs → chunk-2BDSR2OW.cjs} +238 -61
- package/dist/{chunk-BL2UC7HC.js → chunk-2BPIR7LA.js} +121 -4
- package/dist/{chunk-BQ22N3TX.cjs → chunk-2NY7OHBF.cjs} +47 -27
- package/dist/chunk-2WUNHTXL.js +303 -0
- package/dist/{chunk-HQWQZML5.cjs → chunk-34B6ZO6W.cjs} +124 -7
- package/dist/{chunk-5JTTM5SC.js → chunk-3BJN7GAH.js} +1 -1
- package/dist/{chunk-4256YRCO.cjs → chunk-3CAXECWJ.cjs} +30 -17
- package/dist/{chunk-KNTUI4TZ.cjs → chunk-3CBYUBZC.cjs} +5 -5
- package/dist/chunk-3DF3GZQ7.js +277 -0
- package/dist/{chunk-E26KKI46.cjs → chunk-3JURXAL6.cjs} +61 -8
- package/dist/{chunk-MOJ7ADW4.cjs → chunk-3KWAP2Y3.cjs} +88 -9
- package/dist/{chunk-OHWMWKJQ.js → chunk-3MCK6UBL.js} +1 -1
- package/dist/{chunk-5VHP6HDQ.js → chunk-3TH7IK4M.js} +62 -9
- package/dist/{chunk-ACDQGA4Z.js → chunk-3V77OB3W.js} +7 -72
- package/dist/{chunk-HS4USDND.cjs → chunk-3Y5UEK7K.cjs} +4 -4
- package/dist/{chunk-XV2HXRHX.js → chunk-4GPPSBEZ.js} +3 -3
- package/dist/chunk-5CMBAJ6K.js +377 -0
- package/dist/{chunk-MO4KP6XS.cjs → chunk-5YRXFBYZ.cjs} +35 -6
- package/dist/chunk-5ZNYX4VH.cjs +71 -0
- package/dist/chunk-6AC2TT26.js +156 -0
- package/dist/{chunk-UGFVM77J.cjs → chunk-6EIQ6A6U.cjs} +2 -2
- package/dist/{chunk-SWCQM52V.js → chunk-6HSEDXVF.js} +4 -4
- package/dist/{chunk-QQ7PANOP.js → chunk-6NUXK62F.js} +1 -1
- package/dist/{chunk-5CMYEM3R.cjs → chunk-6TGCAPYH.cjs} +62 -9
- package/dist/{chunk-NMQ47RCG.js → chunk-6W3SZCSP.js} +1 -1
- package/dist/{chunk-VRMZO6TB.js → chunk-73LV3DDZ.js} +7 -6
- package/dist/{chunk-3GUEUCZK.js → chunk-7BGGLIQF.js} +85 -1
- package/dist/{chunk-RBHANOYY.js → chunk-7DJJGKM6.js} +47 -3
- package/dist/{chunk-LQBONA55.cjs → chunk-7EEK7CRR.cjs} +85 -1
- package/dist/chunk-7TO3PDMV.cjs +324 -0
- package/dist/chunk-7UU22RSH.cjs +277 -0
- package/dist/{chunk-E6GFD7VR.cjs → chunk-A3GAM6FM.cjs} +11 -11
- package/dist/{chunk-DEQVRSV5.cjs → chunk-A7DJU75T.cjs} +8 -8
- package/dist/{chunk-DPSIGY6L.cjs → chunk-AAAO4ERQ.cjs} +9 -9
- package/dist/{chunk-FQAVGSPW.js → chunk-AAJLMP57.js} +2 -2
- package/dist/chunk-ABR756QN.js +529 -0
- package/dist/{chunk-JYKPWK5O.js → chunk-APFGDIPD.js} +3 -1
- package/dist/{chunk-Y3M2DABP.js → chunk-APQYRMYL.js} +4 -4
- package/dist/{chunk-Q2IL4DDI.cjs → chunk-AZKOIF2G.cjs} +62 -19
- package/dist/{chunk-MXVIDIC6.cjs → chunk-AZLHUPNC.cjs} +2 -2
- package/dist/chunk-B55VCYSQ.cjs +30 -0
- package/dist/{chunk-WZV6UVPY.js → chunk-BLQUMSM3.js} +1 -1
- package/dist/{chunk-PHJO5YAL.cjs → chunk-BXKPX6K4.cjs} +9 -9
- package/dist/{chunk-3KLSNNRW.cjs → chunk-C66FN2LP.cjs} +4 -4
- package/dist/{chunk-OV3PVUYN.js → chunk-CH7KUFAS.js} +9 -9
- package/dist/{chunk-CWINVFRI.cjs → chunk-CILSXOPI.cjs} +17 -17
- package/dist/{chunk-3UT7R3XV.js → chunk-CM24K6ZT.js} +145 -12
- package/dist/chunk-CMEZ42F2.cjs +303 -0
- package/dist/{chunk-46C73ZKK.cjs → chunk-CNQKIWIS.cjs} +152 -19
- package/dist/{chunk-5JFTY3VU.js → chunk-CSTUTDTH.js} +2 -1
- package/dist/{chunk-REMGR23V.cjs → chunk-CSUGNNJY.cjs} +10 -4
- package/dist/{chunk-TBOLJDUG.js → chunk-D6HB3H3L.js} +31 -11
- package/dist/{chunk-OM24WXEE.js → chunk-D7AYKVKW.js} +2 -2
- package/dist/{chunk-6GUODJKM.cjs → chunk-DLCXWOWT.cjs} +23 -23
- package/dist/{chunk-CH2J4PVE.cjs → chunk-DMM2BKSV.cjs} +121 -28
- package/dist/{chunk-M4KNC5BQ.js → chunk-DW3DPV77.js} +1 -1
- package/dist/chunk-ECQD2QC3.cjs +33 -0
- package/dist/{chunk-UEIXJG45.js → chunk-EEYOS3UC.js} +116 -80
- package/dist/{chunk-7HPWMALN.js → chunk-EF2EN5CR.js} +2 -2
- package/dist/{chunk-7LWQCE4Y.cjs → chunk-EFXFURDY.cjs} +192 -58
- package/dist/chunk-EK34UZPB.cjs +40 -0
- package/dist/{chunk-7JLT2VNW.cjs → chunk-FJR6EZLO.cjs} +9666 -7201
- package/dist/{chunk-GZ6DV2UG.js → chunk-FPO7YNPQ.js} +1 -1
- package/dist/{chunk-O64I2GYI.js → chunk-FS4I6BNR.js} +1 -1
- package/dist/{chunk-MX75JYIY.js → chunk-FSJ2MNOC.js} +3 -3
- package/dist/{chunk-7RFJB75Y.js → chunk-GEHZMC4G.js} +11 -8
- package/dist/{chunk-UWFG2R2I.cjs → chunk-GO6C2RAR.cjs} +36 -9
- package/dist/{chunk-WGLBC5AY.cjs → chunk-GSMR6V36.cjs} +4 -4
- package/dist/{chunk-Z3XSSF7B.js → chunk-GSZWATME.js} +1 -1
- package/dist/{chunk-7MU7LWF3.cjs → chunk-GYLGCR6F.cjs} +5 -5
- package/dist/{chunk-O6TQP7U7.cjs → chunk-H3OOWNYQ.cjs} +3 -3
- package/dist/{chunk-2QL6MNXG.js → chunk-H65446XW.js} +115 -20
- package/dist/chunk-H7HXRRHK.js +324 -0
- package/dist/{chunk-ZZ63NW7A.cjs → chunk-HN2JTDN5.cjs} +17 -17
- package/dist/{chunk-AOKCI722.cjs → chunk-HNXUZ5OY.cjs} +2 -2
- package/dist/{chunk-AUYSIEVV.cjs → chunk-HOYT3E65.cjs} +3 -3
- package/dist/{chunk-DMRXF5DU.js → chunk-HTPY5ESD.js} +3 -3
- package/dist/chunk-HTU4W3GB.js +183 -0
- package/dist/{chunk-3DDL2E55.cjs → chunk-HVLWH2AF.cjs} +10 -10
- package/dist/{chunk-HSCUPEA4.cjs → chunk-HZTEU4W5.cjs} +74 -105
- package/dist/{chunk-XGMI6IYB.cjs → chunk-I5T7LPFP.cjs} +7 -7
- package/dist/{chunk-XIVFAD2L.js → chunk-IB5CJXE7.js} +173 -12
- package/dist/chunk-INNXFLDR.cjs +388 -0
- package/dist/{chunk-75EDROHL.cjs → chunk-JFLEP3T7.cjs} +10 -10
- package/dist/chunk-JJGDOBFL.js +40 -0
- package/dist/{chunk-VBOFPU5M.cjs → chunk-JM3ZTQUK.cjs} +13 -9
- package/dist/{chunk-HJIXWGQZ.js → chunk-JSU46T6K.js} +1 -1
- package/dist/{chunk-AT7OWLY5.js → chunk-K6WN6BT4.js} +1 -1
- package/dist/{chunk-LN7D3EJZ.js → chunk-KA2U6MY2.js} +4 -3
- package/dist/{chunk-3S563FNF.cjs → chunk-KIQH3SMT.cjs} +34 -31
- package/dist/{chunk-BWF4VDYE.js → chunk-KPRXHIE2.js} +54 -85
- package/dist/{chunk-Z4LIPMPM.js → chunk-L6OH44HL.js} +13 -9
- package/dist/{chunk-A7HHCIDQ.js → chunk-LIO3RX2Z.js} +2 -2
- package/dist/{chunk-DLP436GI.js → chunk-LOSXLH7P.js} +110 -17
- package/dist/{chunk-IEXKKKOF.cjs → chunk-LSOR72PB.cjs} +23 -23
- package/dist/{chunk-IAGCRVJ3.js → chunk-MA3AVDCC.js} +55 -12
- package/dist/{chunk-B5CGDNMR.js → chunk-ME3S2WIR.js} +3 -3
- package/dist/{chunk-HKYZSUQ5.js → chunk-NC2I2M4P.js} +4 -4
- package/dist/{chunk-GBMDFWJX.cjs → chunk-NC4A4LVC.cjs} +13 -13
- package/dist/{chunk-E46DJH5S.js → chunk-NGEK5FCJ.js} +176 -3
- package/dist/{chunk-TQ33WBY5.cjs → chunk-NHWHEW7M.cjs} +2 -1
- package/dist/{chunk-62RTC3XX.js → chunk-NKW6CHXQ.js} +1 -1
- package/dist/{chunk-3PXKRVCW.js → chunk-NOWCRKP2.js} +10 -4
- package/dist/{chunk-HXJEGMGB.js → chunk-NUB2LMB6.js} +2 -2
- package/dist/chunk-NVATU4V6.cjs +44 -0
- package/dist/chunk-O246MKIW.cjs +267 -0
- package/dist/{chunk-QCHIDZBA.js → chunk-OGFWL2PS.js} +1 -1
- package/dist/{chunk-JJ4KA7HK.cjs → chunk-ONNGAR6W.cjs} +415 -551
- package/dist/{chunk-TKKN34TV.js → chunk-OOFR6A62.js} +33 -4
- package/dist/{chunk-6NVAK6CK.js → chunk-OZ7FHO7J.js} +2 -2
- package/dist/{chunk-2CGE7ZV3.cjs → chunk-P5EWGUI2.cjs} +201 -28
- package/dist/{chunk-GGLKUENP.js → chunk-P6BQJPAI.js} +191 -14
- package/dist/{chunk-TWQDAUZU.js → chunk-PG2JIU5M.js} +60 -7
- package/dist/chunk-PI27G2ED.cjs +377 -0
- package/dist/{chunk-YV63VW4K.js → chunk-PI7LRPL6.js} +1 -1
- package/dist/{chunk-TXPSTCG7.cjs → chunk-PMPEC5HN.cjs} +18 -15
- package/dist/{chunk-ROLA6EFO.cjs → chunk-PYUP7AKY.cjs} +14 -14
- package/dist/{chunk-BFQDQRDE.js → chunk-QC5Z3ZT5.js} +2 -2
- package/dist/chunk-QDO4L2A7.cjs +156 -0
- package/dist/{chunk-LFDPTJYF.cjs → chunk-QDXRI5AM.cjs} +1 -1
- package/dist/{chunk-3LJJG5YY.cjs → chunk-QLZOMZO5.cjs} +4 -3
- package/dist/chunk-QVXMSQOG.js +430 -0
- package/dist/{chunk-ZHJ7JGME.cjs → chunk-R4UKBKDY.cjs} +11 -11
- package/dist/{chunk-IGMPWJ2I.cjs → chunk-R75AWII3.cjs} +118 -23
- package/dist/{chunk-VGEV44V2.cjs → chunk-RD5PLUIX.cjs} +191 -30
- package/dist/{chunk-I24CWKKK.js → chunk-RGB34CV5.js} +3 -3
- package/dist/{chunk-CHI52KFR.cjs → chunk-RJCZLFHE.cjs} +246 -39
- package/dist/{chunk-D2OSPLYC.cjs → chunk-RKWNM2BJ.cjs} +2 -2
- package/dist/{chunk-FGT6KK6T.js → chunk-RMVONICR.js} +3 -3
- package/dist/{chunk-Q6AC3PHY.cjs → chunk-RPSYRJL7.cjs} +10 -4
- package/dist/chunk-RS2E32YB.js +71 -0
- package/dist/chunk-RWKU2X7O.js +388 -0
- package/dist/chunk-RZLEGVMH.cjs +565 -0
- package/dist/{chunk-5F6ZKSHO.js → chunk-S2L3Y677.js} +1 -1
- package/dist/{chunk-ARBEHFCG.js → chunk-S7KVUIOS.js} +1 -1
- package/dist/{chunk-AC7DZ6SK.cjs → chunk-SACJJ6NO.cjs} +5 -3
- package/dist/{chunk-IKUMVBCW.cjs → chunk-SD3NTC7D.cjs} +48 -4
- package/dist/{chunk-CBFH2J3O.js → chunk-SJQU2ZFR.js} +246 -39
- package/dist/{chunk-GWO66KBI.js → chunk-SKAQKQFF.js} +12 -2
- package/dist/chunk-T4DXP5OP.js +30 -0
- package/dist/{chunk-CFFE4VA3.js → chunk-T6FTB6K2.js} +1 -1
- package/dist/{chunk-U4C3HW6P.js → chunk-T6N6GRFT.js} +13 -10
- package/dist/{chunk-D6GZBSOX.js → chunk-TJFKA6A7.js} +82 -3
- package/dist/{chunk-2HOLOHVK.js → chunk-TJZUPS4Z.js} +163 -299
- package/dist/{chunk-RBZ7AFX7.cjs → chunk-TLKHZ425.cjs} +2 -2
- package/dist/{chunk-J2K57QM7.cjs → chunk-TQ24NLXO.cjs} +6 -6
- package/dist/{chunk-LUMV3DB2.js → chunk-TWBAU46X.js} +1 -1
- package/dist/{chunk-OPNI6O7F.cjs → chunk-TZB5XADL.cjs} +4 -4
- package/dist/{chunk-6HH236FV.cjs → chunk-UAYXZXWU.cjs} +4 -4
- package/dist/{chunk-MPULXVC4.cjs → chunk-UKBFNBDO.cjs} +11 -11
- package/dist/chunk-UMJYX5KD.js +565 -0
- package/dist/chunk-USKYTHDL.cjs +235 -0
- package/dist/chunk-V4HGZSKQ.cjs +183 -0
- package/dist/{chunk-MQESBFBZ.cjs → chunk-VAJUSZMC.cjs} +21 -20
- package/dist/{chunk-PQLKJCIE.js → chunk-VGQG4NBJ.js} +2 -2
- package/dist/chunk-VLUIVJ3J.js +235 -0
- package/dist/chunk-VOBINVMV.cjs +430 -0
- package/dist/{chunk-L4F7SUYL.js → chunk-VSHKKCSH.js} +16 -5
- package/dist/{chunk-LDJQ5QHG.cjs → chunk-VSZU3MGA.cjs} +28 -17
- package/dist/{chunk-YFXTE422.cjs → chunk-VWHAUB77.cjs} +8 -3
- package/dist/{chunk-EZJHLOWP.js → chunk-VXGYFX45.js} +20 -7
- package/dist/{chunk-JIMSII7R.js → chunk-WH6YUQDB.js} +193 -59
- package/dist/{chunk-VKBIE6I6.js → chunk-WQ6TD55V.js} +2 -2
- package/dist/{chunk-ZR46OJNZ.js → chunk-WQWECXTY.js} +3 -3
- package/dist/{chunk-SOLBYSLY.cjs → chunk-WVDJUJH6.cjs} +2 -2
- package/dist/{chunk-QKP772OZ.js → chunk-X24VIVDZ.js} +963 -103
- package/dist/{chunk-37M5UM6I.js → chunk-X4NRTLXD.js} +7 -1
- package/dist/chunk-X53SHYCG.js +27 -0
- package/dist/{chunk-PUD76XQT.cjs → chunk-XB2Z4ZAK.cjs} +5 -5
- package/dist/chunk-Y47OJGLB.cjs +27 -0
- package/dist/{chunk-WRTXCQ3V.cjs → chunk-Y4MN27V3.cjs} +1080 -220
- package/dist/{chunk-ZK6HOR62.js → chunk-YEHFYZFU.js} +7 -2
- package/dist/{chunk-FFBDRUO5.cjs → chunk-YICIUY23.cjs} +1 -1
- package/dist/{chunk-PDHT7LQS.cjs → chunk-YMXYC777.cjs} +3 -3
- package/dist/{chunk-TJNBASFD.cjs → chunk-Z3GRWK6O.cjs} +8 -8
- package/dist/{chunk-JP3YHTQ2.cjs → chunk-Z5GG2KSL.cjs} +4 -4
- package/dist/{chunk-ZPD2AO3U.js → chunk-ZER7DYQK.js} +2 -2
- package/dist/{chunk-UXLW45ZE.cjs → chunk-ZFDXZEZJ.cjs} +25 -90
- package/dist/chunk-ZFV4HJA6.js +579 -0
- package/dist/chunk-ZHMYTI5D.cjs +529 -0
- package/dist/{chunk-CCVMREXI.js → chunk-ZLR2TFBC.js} +35 -8
- package/dist/{chunk-J5ADZN6V.cjs → chunk-ZTWNU5QZ.cjs} +20 -20
- package/dist/chunk-ZUYYHKQA.js +44 -0
- package/dist/{chunk-AUFNACED.js → chunk-ZVLVLDYN.js} +9086 -6621
- package/dist/clear-AJGXD2BB.cjs +12 -0
- package/dist/{clear-OFLFQ3MR.js → clear-HAHDSWKW.js} +3 -3
- package/dist/communityInstaller-IRR6M3N6.cjs +22 -0
- package/dist/{communityInstaller-COB2KTOW.js → communityInstaller-OLKEUGMX.js} +6 -6
- package/dist/completion-G7Z436TF.cjs +17 -0
- package/dist/{completion-PT4VM2H2.js → completion-ZS3AXJ6A.js} +5 -5
- package/dist/{config-R4O7GBTY.js → config-OWYAQPCX.js} +5 -3
- package/dist/config-W2BHT2QE.cjs +22 -0
- package/dist/{constants-HVCHVQAF.js → constants-AS6K67AA.js} +5 -3
- package/dist/constants-B4W5BT7F.cjs +23 -0
- package/dist/{export-3PK3VFCE.js → export-5HIU3KMD.js} +5 -5
- package/dist/export-GFD32UY2.cjs +15 -0
- package/dist/{extractSessionMemories-A2JX5WJ2.js → extractSessionMemories-K6ZVAW2F.js} +1 -1
- package/dist/{extractSessionMemories-XL3MS37F.cjs → extractSessionMemories-LLOIJR5U.cjs} +2 -2
- package/dist/feature-KP74CZ3F.cjs +14 -0
- package/dist/feature-OPNVMB2E.js +14 -0
- package/dist/features-LT55MURX.cjs +24 -0
- package/dist/features-ZDIU26WX.js +24 -0
- package/dist/feedback-7WTJFQ6S.js +18 -0
- package/dist/feedback-CEOJ3453.cjs +18 -0
- package/dist/go-2CY5SZNR.js +16 -0
- package/dist/go-O2CSQON4.cjs +16 -0
- package/dist/goal-DL2N2AWT.cjs +16 -0
- package/dist/goal-IJS7VZSG.js +16 -0
- package/dist/help-RNOGDEBA.cjs +12 -0
- package/dist/{help-X3OAZ3CY.js → help-TCWD2IRH.js} +2 -2
- package/dist/{history-YKFPHBJN.js → history-ATOR5OQV.js} +2 -2
- package/dist/history-UUSGX2AL.cjs +14 -0
- package/dist/{hooks-7TA4PIIB.js → hooks-R3Z5QKUP.js} +6 -6
- package/dist/hooks-RWM5UY67.cjs +18 -0
- package/dist/{i18n-2KBUU7XL.js → i18n-4QI4TD4I.js} +1 -1
- package/dist/i18n-MFAEU5RV.cjs +33 -0
- package/dist/ide-6PBTCCUQ.js +15 -0
- package/dist/ide-UE3G7NMQ.cjs +15 -0
- package/dist/{import-I7T4ZHYL.cjs → import-2IG76KAN.cjs} +6 -4
- package/dist/{import-JWPYKXCZ.js → import-E47QL4DW.js} +2 -2
- package/dist/import-NQDNBFUL.cjs +10 -0
- package/dist/{import-4CHYLS4K.js → import-VQIHGJWS.js} +6 -4
- package/dist/index.cjs +512 -305
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +402 -195
- package/dist/init-DX3RDGDT.cjs +10 -0
- package/dist/{init-262MWZV4.js → init-Q54OAAFZ.js} +2 -2
- package/dist/{inputPrompt-YGBHDUEP.js → inputPrompt-V2VBDRM7.js} +3 -3
- package/dist/inputPrompt-WVGVWAHS.cjs +90 -0
- package/dist/language-I6KXAOXD.js +23 -0
- package/dist/language-XMIVOH5E.cjs +23 -0
- package/dist/learn-JPVVGTKU.js +23 -0
- package/dist/learn-NLSHI2MZ.cjs +23 -0
- package/dist/login-NABQYLYC.cjs +28 -0
- package/dist/login-XPOVFSWN.js +28 -0
- package/dist/logout-HNHCGB4Q.js +25 -0
- package/dist/logout-SKGDXJSW.cjs +25 -0
- package/dist/{mcp-5O6PUL4G.js → mcp-EN73YFGZ.js} +8 -6
- package/dist/mcp-TADZCPJQ.cjs +22 -0
- package/dist/{mcp-install-P6DHES7V.cjs → mcp-install-2GKWWBAS.cjs} +15 -13
- package/dist/{mcp-install-6XWXLFVY.js → mcp-install-3TBTVSHW.js} +10 -8
- package/dist/memory-GRXFTDIN.cjs +10 -0
- package/dist/{memory-Q54CESNM.js → memory-K2P3CDCH.js} +2 -2
- package/dist/{model-6AJ77PJG.js → model-DEG22OWA.js} +2 -2
- package/dist/model-OSD74T7Z.cjs +10 -0
- package/dist/new-4NWBOATU.cjs +12 -0
- package/dist/{new-ZXHEWC2S.js → new-KJAP2MB6.js} +3 -3
- package/dist/onboarding-2U5WE2OA.js +39 -0
- package/dist/onboarding-5DZFCO5Q.cjs +39 -0
- package/dist/permissions-KY5I6YQ3.cjs +10 -0
- package/dist/{permissions-YHJMVA6L.js → permissions-TKYON7PP.js} +2 -2
- package/dist/{plan-YYUAXPTL.js → plan-DYHHLZSS.js} +1 -1
- package/dist/plan-PYKP652W.cjs +13 -0
- package/dist/quit-GSKJL42O.js +14 -0
- package/dist/quit-TQSRTBUT.cjs +14 -0
- package/dist/{registry-34GL6BNJ.js → registry-EZ4V4TUQ.js} +1339 -1
- package/dist/{registry-V24W7YK6.cjs → registry-LCWYI4IB.cjs} +1378 -40
- package/dist/resume-4VWJXARX.cjs +17 -0
- package/dist/resume-TLHWWWFN.js +17 -0
- package/dist/{review-QHP2KP4Q.js → review-CSK4IYTO.js} +1 -1
- package/dist/review-XLJEUH5K.cjs +9 -0
- package/dist/{rpc-S3DGW6KV.js → rpc-3DLQBDWU.js} +301 -130
- package/dist/{rpc-NPS3PU4O.cjs → rpc-O36WUU3L.cjs} +399 -228
- package/dist/search-DSX2CY4A.cjs +22 -0
- package/dist/search-I3QUDUQL.js +22 -0
- package/dist/sessionBranching-DVNOUWJT.cjs +19 -0
- package/dist/sessionBranching-FKV4CR36.js +19 -0
- package/dist/sessions-3JUOT3ED.cjs +10 -0
- package/dist/{sessions-IYAXMK23.js → sessions-VWMDIPOS.js} +2 -2
- package/dist/settings-FT2LZZUV.js +45 -0
- package/dist/settings-RL4KNWHB.cjs +45 -0
- package/dist/setup-HQEJVOYT.js +32 -0
- package/dist/setup-MN54LKOL.cjs +32 -0
- package/dist/share-BUAFZNBX.cjs +17 -0
- package/dist/share-CGB6MAVJ.js +17 -0
- package/dist/skills/builtin/code-reviewer/SKILL.md +64 -0
- package/dist/skills/builtin/goal-writer/SKILL.md +124 -0
- package/dist/{skills-VWOMV3CR.js → skills-7DKR3HRZ.js} +8 -8
- package/dist/{skills-MVIZNHT4.js → skills-BBBENOEY.js} +9 -9
- package/dist/skills-OQM7IHAF.cjs +29 -0
- package/dist/{skills-GGMZOVIE.cjs → skills-RA2PKL63.cjs} +10 -10
- package/dist/{skills-install-VTAMCNNY.cjs → skills-install-D7K476SL.cjs} +16 -16
- package/dist/{skills-install-QBA5RCV6.js → skills-install-T4SOKJSL.js} +9 -9
- package/dist/skills-new-S33NGEU3.js +18 -0
- package/dist/skills-new-UVYH53MD.cjs +18 -0
- package/dist/slashCommands-MWOUDSQP.js +111 -0
- package/dist/slashCommands-XASURUTV.cjs +111 -0
- package/dist/squad-PIIYDFVH.cjs +15 -0
- package/dist/squad-VHYOVEJP.js +15 -0
- package/dist/status-GHFTXQBL.js +25 -0
- package/dist/status-WXMIJIU3.cjs +25 -0
- package/dist/statusline-2K7AC6ZQ.js +21 -0
- package/dist/statusline-GROI4HOC.cjs +21 -0
- package/dist/sync-254WF6JI.cjs +42 -0
- package/dist/sync-2DIZN4EH.cjs +24 -0
- package/dist/{sync-7BILIQHP.js → sync-J6I2ZUKQ.js} +6 -4
- package/dist/{sync-7OKF6636.js → sync-Z3LVSEEV.js} +8 -5
- package/dist/{teammate-J6PHGL23.cjs → teammate-EXR76PEQ.cjs} +9 -8
- package/dist/{teammate-GZQSCIMS.js → teammate-K4DAOFEQ.js} +8 -7
- package/dist/templates-ARG2VRWW.cjs +11 -0
- package/dist/templates-UGVZV3KJ.js +11 -0
- package/dist/theme-MVQDSU47.js +23 -0
- package/dist/theme-QAKEYWJG.cjs +23 -0
- package/dist/ui/questionModal.cjs +6 -6
- package/dist/ui/questionModal.js +5 -5
- package/dist/{undo-SZEHLX7X.js → undo-5AU47JHF.js} +2 -2
- package/dist/undo-ME6WKUXZ.cjs +10 -0
- package/dist/usage-QTKO2YMD.js +25 -0
- package/dist/usage-TYNJKVER.cjs +25 -0
- package/package.json +10 -4
- package/dist/AgentRegistry-EGBDIUAK.cjs +0 -10
- package/dist/AgentRegistry-XPWSVO3Q.js +0 -10
- package/dist/CommunitySkillsCache-2OIUV227.cjs +0 -8
- package/dist/LearnAdvisor-46FG2XIP.js +0 -9
- package/dist/LearnAdvisor-XBRDNAGH.cjs +0 -9
- package/dist/MemoryManager-34L4YOKA.cjs +0 -8
- package/dist/MemoryManager-WJMLPWGU.js +0 -8
- package/dist/NVIDIAProvider-MVTL62PR.cjs +0 -14
- package/dist/PermissionManager-5OOJ7FAT.cjs +0 -11
- package/dist/ProviderFactory-C3YPXTDD.cjs +0 -11
- package/dist/SessionManager-WAPTFMDO.cjs +0 -10
- package/dist/SkillsRegistry-7AJP74GJ.cjs +0 -9
- package/dist/SubAgent-FDIH3DXB.js +0 -11
- package/dist/SubAgent-HVL2ICVZ.cjs +0 -11
- package/dist/SyncApiClient-VMBOLQ6H.cjs +0 -11
- package/dist/about-FCAX37YC.cjs +0 -14
- package/dist/actionExecutor-33I47NZS.js +0 -24
- package/dist/actionExecutor-4YBMR3YH.cjs +0 -24
- package/dist/add-dir-7SS6KSH5.cjs +0 -11
- package/dist/agent-DMRUFU4M.cjs +0 -116
- package/dist/agent-WCJEYQJT.js +0 -116
- package/dist/agents-CHROO3VU.cjs +0 -17
- package/dist/agents-UVDUL65K.js +0 -17
- package/dist/agents-new-AUBWSOXP.js +0 -17
- package/dist/agents-new-Y562WC47.cjs +0 -17
- package/dist/autoSkill-YOLLFTP2.cjs +0 -20
- package/dist/automode-DBLKTTKD.cjs +0 -10
- package/dist/chrome-ATC4OO5I.cjs +0 -20
- package/dist/chrome-O62WXV7F.js +0 -20
- package/dist/chrome-XHJLCO4M.cjs +0 -50
- package/dist/chunk-6XVVIY54.cjs +0 -256
- package/dist/chunk-AU6JAGZJ.cjs +0 -231
- package/dist/chunk-N6O3XUZ2.cjs +0 -23
- package/dist/chunk-VDWJMWDF.js +0 -256
- package/dist/clear-33TWQ2ES.cjs +0 -12
- package/dist/communityInstaller-TWMGPSYM.cjs +0 -22
- package/dist/completion-IIZMHXYP.cjs +0 -17
- package/dist/config-KL6WU7R2.cjs +0 -20
- package/dist/constants-RLMJ5D5P.cjs +0 -21
- package/dist/export-WLGNWEMJ.cjs +0 -15
- package/dist/feedback-G635NCLJ.js +0 -18
- package/dist/feedback-LLMK3TZH.cjs +0 -18
- package/dist/help-BAXLP2M2.cjs +0 -12
- package/dist/history-6HOJSEMT.cjs +0 -14
- package/dist/hooks-XVFU67T2.cjs +0 -18
- package/dist/i18n-MUJMKTFM.cjs +0 -33
- package/dist/ide-CCQ33PGC.cjs +0 -15
- package/dist/ide-VLVFBZ5F.js +0 -15
- package/dist/import-J46F54JY.cjs +0 -10
- package/dist/init-EE5Y7RBL.cjs +0 -10
- package/dist/inputPrompt-IIFKCX5Q.cjs +0 -90
- package/dist/language-CVLPB7OV.js +0 -21
- package/dist/language-ZTWFHUSV.cjs +0 -21
- package/dist/learn-PON7I5QS.js +0 -23
- package/dist/learn-XLRSVNA3.cjs +0 -23
- package/dist/login-223QTGBG.cjs +0 -26
- package/dist/login-6IKTBUBY.js +0 -26
- package/dist/logout-RN2AG6SI.js +0 -23
- package/dist/logout-U3M4FFX7.cjs +0 -23
- package/dist/mcp-NUQ76QQB.cjs +0 -20
- package/dist/memory-CYMDQ2YC.cjs +0 -10
- package/dist/model-IDRCKDML.cjs +0 -10
- package/dist/new-7LEWOUF2.cjs +0 -12
- package/dist/onboarding-FXX7YHSJ.cjs +0 -35
- package/dist/onboarding-JYNMK6NI.js +0 -35
- package/dist/permissions-YBNSANIA.cjs +0 -10
- package/dist/plan-XEJMOT55.cjs +0 -13
- package/dist/quit-B43SJ6E4.cjs +0 -10
- package/dist/quit-GWTNHQSP.js +0 -10
- package/dist/resume-DYVOQN5L.cjs +0 -16
- package/dist/resume-M25UQKOX.js +0 -16
- package/dist/review-UWHWQHCB.cjs +0 -9
- package/dist/search-CPX4PWHP.js +0 -20
- package/dist/search-VUF3M4N3.cjs +0 -20
- package/dist/sessions-JODKER5D.cjs +0 -10
- package/dist/settings-55BNW6BF.js +0 -33
- package/dist/settings-BKTS7OMC.cjs +0 -33
- package/dist/setup-IRC5HQG2.js +0 -29
- package/dist/setup-MMQ7TWOP.cjs +0 -29
- package/dist/share-6JRQECAH.cjs +0 -17
- package/dist/share-YM5MJKMO.js +0 -17
- package/dist/skills-LWSOKOSH.cjs +0 -29
- package/dist/skills-new-GPL46YV2.js +0 -18
- package/dist/skills-new-L5BEZN5V.cjs +0 -18
- package/dist/slashCommands-FBPCIWM5.cjs +0 -95
- package/dist/slashCommands-FCWY5DXW.js +0 -95
- package/dist/status-3B5SDZPL.js +0 -17
- package/dist/status-TTGRF6NC.cjs +0 -17
- package/dist/sync-77CXVVTK.cjs +0 -21
- package/dist/sync-EH4K5U3N.cjs +0 -40
- package/dist/theme-64BYGJ57.cjs +0 -21
- package/dist/theme-YJE6HEON.js +0 -21
- package/dist/undo-PRTEGL2J.cjs +0 -10
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/commands/sessionBranching.ts
|
|
2
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
3
|
+
var FORK_FLAG = "experimental_fork";
|
|
4
|
+
var CLONE_FLAG = "experimental_clone";
|
|
5
|
+
var forkMetadata = {
|
|
6
|
+
command: "/fork",
|
|
7
|
+
description: "branch a new session from the active session or an earlier user message",
|
|
8
|
+
implemented: true
|
|
9
|
+
};
|
|
10
|
+
var cloneMetadata = {
|
|
11
|
+
command: "/clone",
|
|
12
|
+
description: "duplicate the active session branch into a new session",
|
|
13
|
+
implemented: true
|
|
14
|
+
};
|
|
15
|
+
var treeMetadata = {
|
|
16
|
+
command: "/tree",
|
|
17
|
+
description: "show the fork and clone tree for this project",
|
|
18
|
+
implemented: true
|
|
19
|
+
};
|
|
20
|
+
async function forkSession(ctx, args = []) {
|
|
21
|
+
if (!isEnabled(ctx, FORK_FLAG)) {
|
|
22
|
+
return `The /fork command is behind ${FORK_FLAG}. Run /features enable ${FORK_FLAG}, then /fork again. No restart required.`;
|
|
23
|
+
}
|
|
24
|
+
await _optionalChain([ctx, 'access', _ => _.trackFeatureActivation, 'optionalCall', _2 => _2(FORK_FLAG, { surface: "slash_command" })]);
|
|
25
|
+
const target = parseForkArgs(args);
|
|
26
|
+
const sourceSessionId = target.sourceReference ? await ctx.sessionManager.resolveSessionReference(target.sourceReference) : requireCurrentSessionId(ctx, "/fork");
|
|
27
|
+
const forked = await ctx.sessionManager.branchSession(sourceSessionId, {
|
|
28
|
+
type: "fork",
|
|
29
|
+
userMessageOrdinal: target.userMessageOrdinal
|
|
30
|
+
});
|
|
31
|
+
await _optionalChain([ctx, 'access', _3 => _3.restoreSession, 'optionalCall', _4 => _4(forked.metadata.sessionId)]);
|
|
32
|
+
const point = target.userMessageOrdinal ? ` at user message ${target.userMessageOrdinal}` : "";
|
|
33
|
+
return _chalk2.default.green(`Forked session ${forked.metadata.sessionId}${point}. Continue typing to explore this branch.`);
|
|
34
|
+
}
|
|
35
|
+
async function cloneSession(ctx, args = []) {
|
|
36
|
+
if (!isEnabled(ctx, CLONE_FLAG)) {
|
|
37
|
+
return `The /clone command is behind ${CLONE_FLAG}. Run /features enable ${CLONE_FLAG}, then /clone again. No restart required.`;
|
|
38
|
+
}
|
|
39
|
+
await _optionalChain([ctx, 'access', _5 => _5.trackFeatureActivation, 'optionalCall', _6 => _6(CLONE_FLAG, { surface: "slash_command" })]);
|
|
40
|
+
const sourceReference = args[0] ? await ctx.sessionManager.resolveSessionReference(args[0]) : requireCurrentSessionId(ctx, "/clone");
|
|
41
|
+
const cloned = await ctx.sessionManager.branchSession(sourceReference, { type: "clone" });
|
|
42
|
+
await _optionalChain([ctx, 'access', _7 => _7.restoreSession, 'optionalCall', _8 => _8(cloned.metadata.sessionId)]);
|
|
43
|
+
return _chalk2.default.green(`Cloned session ${cloned.metadata.sessionId}. Continue typing in the duplicate branch.`);
|
|
44
|
+
}
|
|
45
|
+
async function sessionTree(ctx) {
|
|
46
|
+
if (!isEnabled(ctx, FORK_FLAG) && !isEnabled(ctx, CLONE_FLAG)) {
|
|
47
|
+
return `The /tree command is behind ${FORK_FLAG} or ${CLONE_FLAG}. Enable one of those features first.`;
|
|
48
|
+
}
|
|
49
|
+
const sessions = await ctx.sessionManager.listSessions(
|
|
50
|
+
ctx.workspaceRoot ? { project: ctx.workspaceRoot } : void 0
|
|
51
|
+
);
|
|
52
|
+
if (sessions.length === 0) {
|
|
53
|
+
return "No sessions found for this project.";
|
|
54
|
+
}
|
|
55
|
+
return formatSessionTree(sessions, _optionalChain([ctx, 'access', _9 => _9.currentSession, 'optionalAccess', _10 => _10.metadata, 'access', _11 => _11.sessionId]));
|
|
56
|
+
}
|
|
57
|
+
async function forkSessionReference(ctx, sourceReference) {
|
|
58
|
+
if (!isEnabled(ctx, FORK_FLAG)) {
|
|
59
|
+
return `The --fork flag is behind ${FORK_FLAG}. Run /features enable ${FORK_FLAG}, then try again.`;
|
|
60
|
+
}
|
|
61
|
+
await _optionalChain([ctx, 'access', _12 => _12.trackFeatureActivation, 'optionalCall', _13 => _13(FORK_FLAG, { surface: "cli_flag" })]);
|
|
62
|
+
const sourceSessionId = await ctx.sessionManager.resolveSessionReference(sourceReference);
|
|
63
|
+
const forked = await ctx.sessionManager.branchSession(sourceSessionId, { type: "fork" });
|
|
64
|
+
await _optionalChain([ctx, 'access', _14 => _14.restoreSession, 'optionalCall', _15 => _15(forked.metadata.sessionId)]);
|
|
65
|
+
return forked.metadata.sessionId;
|
|
66
|
+
}
|
|
67
|
+
function isEnabled(ctx, flag) {
|
|
68
|
+
const localDefault = flag === FORK_FLAG ? _optionalChain([ctx, 'access', _16 => _16.config, 'optionalAccess', _17 => _17.features, 'optionalAccess', _18 => _18.experimentalFork]) === true : _optionalChain([ctx, 'access', _19 => _19.config, 'optionalAccess', _20 => _20.features, 'optionalAccess', _21 => _21.experimentalClone]) === true;
|
|
69
|
+
return _nullishCoalesce(_optionalChain([ctx, 'access', _22 => _22.isFeatureEnabled, 'optionalCall', _23 => _23(flag, localDefault)]), () => ( localDefault));
|
|
70
|
+
}
|
|
71
|
+
function requireCurrentSessionId(ctx, command) {
|
|
72
|
+
const sessionId = _nullishCoalesce(_optionalChain([ctx, 'access', _24 => _24.currentSession, 'optionalAccess', _25 => _25.metadata, 'access', _26 => _26.sessionId]), () => ( _optionalChain([ctx, 'access', _27 => _27.sessionManager, 'access', _28 => _28.getCurrentSession, 'call', _29 => _29(), 'optionalAccess', _30 => _30.metadata, 'access', _31 => _31.sessionId])));
|
|
73
|
+
if (!sessionId) {
|
|
74
|
+
throw new Error(`${command} requires an active session.`);
|
|
75
|
+
}
|
|
76
|
+
return sessionId;
|
|
77
|
+
}
|
|
78
|
+
function parseForkArgs(args) {
|
|
79
|
+
const rest = [...args];
|
|
80
|
+
let userMessageOrdinal;
|
|
81
|
+
const messageFlagIndex = rest.findIndex((arg) => arg === "--message" || arg === "-m");
|
|
82
|
+
if (messageFlagIndex >= 0) {
|
|
83
|
+
const rawValue = rest[messageFlagIndex + 1];
|
|
84
|
+
if (!rawValue) {
|
|
85
|
+
throw new Error("Missing message number after --message.");
|
|
86
|
+
}
|
|
87
|
+
userMessageOrdinal = parseUserMessageOrdinal(rawValue);
|
|
88
|
+
rest.splice(messageFlagIndex, 2);
|
|
89
|
+
}
|
|
90
|
+
if (rest.length === 1 && /^\d+$/.test(rest[0])) {
|
|
91
|
+
userMessageOrdinal = parseUserMessageOrdinal(rest[0]);
|
|
92
|
+
rest.length = 0;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
sourceReference: rest[0],
|
|
96
|
+
userMessageOrdinal
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function parseUserMessageOrdinal(rawValue) {
|
|
100
|
+
const parsed = Number.parseInt(rawValue, 10);
|
|
101
|
+
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
102
|
+
throw new Error("Fork message must be a positive user-message number.");
|
|
103
|
+
}
|
|
104
|
+
return parsed;
|
|
105
|
+
}
|
|
106
|
+
function formatSessionTree(sessions, currentSessionId) {
|
|
107
|
+
const byParent = /* @__PURE__ */ new Map();
|
|
108
|
+
const roots = [];
|
|
109
|
+
const ids = new Set(sessions.map((session) => session.sessionId));
|
|
110
|
+
for (const session of sessions) {
|
|
111
|
+
const parentId = _optionalChain([session, 'access', _32 => _32.branch, 'optionalAccess', _33 => _33.sourceSessionId]);
|
|
112
|
+
if (parentId && ids.has(parentId)) {
|
|
113
|
+
const siblings = _nullishCoalesce(byParent.get(parentId), () => ( []));
|
|
114
|
+
siblings.push(session);
|
|
115
|
+
byParent.set(parentId, siblings);
|
|
116
|
+
} else {
|
|
117
|
+
roots.push(session);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const sortByCreated = (items) => [...items].sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
121
|
+
const lines = ["Session tree:"];
|
|
122
|
+
const visit = (session, depth) => {
|
|
123
|
+
const marker = session.sessionId === currentSessionId ? " *" : "";
|
|
124
|
+
const branch = formatBranchLabel(session);
|
|
125
|
+
lines.push(`${" ".repeat(depth)}- ${session.sessionId}${marker}${branch}`);
|
|
126
|
+
for (const child of sortByCreated(_nullishCoalesce(byParent.get(session.sessionId), () => ( [])))) {
|
|
127
|
+
visit(child, depth + 1);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
for (const root of sortByCreated(roots)) {
|
|
131
|
+
visit(root, 0);
|
|
132
|
+
}
|
|
133
|
+
return lines.join("\n");
|
|
134
|
+
}
|
|
135
|
+
function formatBranchLabel(session) {
|
|
136
|
+
if (!session.branch) return "";
|
|
137
|
+
if (session.branch.type === "fork" && session.branch.sourceUserMessageOrdinal) {
|
|
138
|
+
return ` (${session.branch.type} at user message ${session.branch.sourceUserMessageOrdinal})`;
|
|
139
|
+
}
|
|
140
|
+
return ` (${session.branch.type})`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
exports.forkMetadata = forkMetadata; exports.cloneMetadata = cloneMetadata; exports.treeMetadata = treeMetadata; exports.forkSession = forkSession; exports.cloneSession = cloneSession; exports.sessionTree = sessionTree; exports.forkSessionReference = forkSessionReference;
|
|
152
|
+
/**
|
|
153
|
+
* @license
|
|
154
|
+
* Copyright 2026 Autohand AI LLC
|
|
155
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
156
|
+
*/
|
|
@@ -219,7 +219,7 @@ var PlanModeManager = class extends _events.EventEmitter {
|
|
|
219
219
|
// src/commands/plan.ts
|
|
220
220
|
var metadata = {
|
|
221
221
|
command: "/plan",
|
|
222
|
-
description: "
|
|
222
|
+
description: "plan and break down a complex task",
|
|
223
223
|
implemented: true
|
|
224
224
|
};
|
|
225
225
|
var planModeManager = null;
|
|
@@ -9,6 +9,7 @@ var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
|
9
9
|
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
10
10
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
11
11
|
var GIT_COMMAND_TIMEOUT_MS = 5e3;
|
|
12
|
+
var GIT_INIT_TIMEOUT_MS = 15e3;
|
|
12
13
|
var toolCheckResultsPromise;
|
|
13
14
|
function getCurrentBunVersion() {
|
|
14
15
|
return process.versions.bun;
|
|
@@ -200,7 +201,7 @@ function isEmptyDirectory(dir) {
|
|
|
200
201
|
return false;
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
|
-
function runGitCommand(args, cwd) {
|
|
204
|
+
function runGitCommand(args, cwd, timeoutMs = GIT_COMMAND_TIMEOUT_MS) {
|
|
204
205
|
return new Promise((resolve) => {
|
|
205
206
|
try {
|
|
206
207
|
const proc = _child_process.spawn.call(void 0, "git", args, { cwd, stdio: ["pipe", "pipe", "pipe"] });
|
|
@@ -208,7 +209,7 @@ function runGitCommand(args, cwd) {
|
|
|
208
209
|
const timeout = setTimeout(() => {
|
|
209
210
|
proc.kill();
|
|
210
211
|
resolve(void 0);
|
|
211
|
-
},
|
|
212
|
+
}, timeoutMs);
|
|
212
213
|
_optionalChain([proc, 'access', _7 => _7.stdout, 'optionalAccess', _8 => _8.on, 'call', _9 => _9("data", (chunk) => {
|
|
213
214
|
stdout += chunk.toString();
|
|
214
215
|
})]);
|
|
@@ -258,7 +259,7 @@ async function checkGitRepo(workspaceRoot) {
|
|
|
258
259
|
};
|
|
259
260
|
}
|
|
260
261
|
if (isEmptyDirectory(workspaceRoot)) {
|
|
261
|
-
const initResult = await runGitCommand(["init"], workspaceRoot);
|
|
262
|
+
const initResult = await runGitCommand(["init"], workspaceRoot, GIT_INIT_TIMEOUT_MS);
|
|
262
263
|
if (initResult !== void 0 || _fsextra2.default.existsSync(`${workspaceRoot}/.git/HEAD`)) {
|
|
263
264
|
if (_os2.default.platform() === "darwin") {
|
|
264
265
|
try {
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import {
|
|
2
|
+
package_default
|
|
3
|
+
} from "./chunk-NOWCRKP2.js";
|
|
4
|
+
import {
|
|
5
|
+
showModal
|
|
6
|
+
} from "./chunk-LOSXLH7P.js";
|
|
7
|
+
import {
|
|
8
|
+
saveConfig
|
|
9
|
+
} from "./chunk-CM24K6ZT.js";
|
|
10
|
+
import {
|
|
11
|
+
formatFeatureList,
|
|
12
|
+
formatFeatureStatus,
|
|
13
|
+
getFeatureState,
|
|
14
|
+
isLocalFeatureId,
|
|
15
|
+
listFeatureStates,
|
|
16
|
+
setFeatureState
|
|
17
|
+
} from "./chunk-H7HXRRHK.js";
|
|
18
|
+
import {
|
|
19
|
+
AUTOHAND_FILES
|
|
20
|
+
} from "./chunk-PG2JIU5M.js";
|
|
21
|
+
|
|
22
|
+
// src/features/RemoteFeatureFlagManager.ts
|
|
23
|
+
import crypto from "crypto";
|
|
24
|
+
import os from "os";
|
|
25
|
+
import path from "path";
|
|
26
|
+
import fs from "fs-extra";
|
|
27
|
+
var FEATURE_FLAG_REQUEST_TIMEOUT_MS = 1500;
|
|
28
|
+
var CLI_CLIENT_TYPE = "cli";
|
|
29
|
+
function getApiBaseUrl(config) {
|
|
30
|
+
return (config.api?.baseUrl || config.telemetry?.apiBaseUrl || "https://api.autohand.ai").replace(/\/+$/, "");
|
|
31
|
+
}
|
|
32
|
+
function readDeviceId() {
|
|
33
|
+
try {
|
|
34
|
+
fs.ensureDirSync(path.dirname(AUTOHAND_FILES.deviceId));
|
|
35
|
+
if (fs.existsSync(AUTOHAND_FILES.deviceId)) {
|
|
36
|
+
const existing = fs.readFileSync(AUTOHAND_FILES.deviceId, "utf8").trim();
|
|
37
|
+
if (existing) return existing;
|
|
38
|
+
}
|
|
39
|
+
const next = crypto.randomUUID();
|
|
40
|
+
fs.writeFileSync(AUTOHAND_FILES.deviceId, next);
|
|
41
|
+
return next;
|
|
42
|
+
} catch {
|
|
43
|
+
return crypto.randomUUID();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function parseSnapshot(value) {
|
|
47
|
+
if (value.success !== true || !Array.isArray(value.flags)) return null;
|
|
48
|
+
const flags = [];
|
|
49
|
+
for (const flag of value.flags) {
|
|
50
|
+
if (!flag || typeof flag !== "object") continue;
|
|
51
|
+
const candidate = flag;
|
|
52
|
+
if (typeof candidate.key !== "string" || typeof candidate.enabled !== "boolean") continue;
|
|
53
|
+
const clientTypes = parseClientTypes(candidate);
|
|
54
|
+
if (!isCliFeatureFlag(candidate, clientTypes)) continue;
|
|
55
|
+
flags.push({
|
|
56
|
+
key: candidate.key,
|
|
57
|
+
enabled: candidate.enabled,
|
|
58
|
+
reason: typeof candidate.reason === "string" ? candidate.reason : "unknown",
|
|
59
|
+
userOverridable: candidate.userOverridable !== false,
|
|
60
|
+
...clientTypes.length > 0 ? { clientTypes } : {}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
success: true,
|
|
65
|
+
environment: typeof value.environment === "string" ? value.environment : "production",
|
|
66
|
+
flags,
|
|
67
|
+
evaluatedAt: typeof value.evaluatedAt === "string" ? value.evaluatedAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
68
|
+
ttlSeconds: typeof value.ttlSeconds === "number" ? value.ttlSeconds : 300
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function parseClientTypes(candidate) {
|
|
72
|
+
const values = [
|
|
73
|
+
candidate.clientType,
|
|
74
|
+
candidate.clientTypes,
|
|
75
|
+
candidate.client_type,
|
|
76
|
+
candidate.client_types,
|
|
77
|
+
candidate.clients,
|
|
78
|
+
candidate.targetClients,
|
|
79
|
+
candidate.target_clients
|
|
80
|
+
];
|
|
81
|
+
const clientTypes = /* @__PURE__ */ new Set();
|
|
82
|
+
for (const value of values) {
|
|
83
|
+
if (typeof value === "string") {
|
|
84
|
+
for (const item of value.split(",")) {
|
|
85
|
+
const clientType = item.trim();
|
|
86
|
+
if (clientType) clientTypes.add(clientType);
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (Array.isArray(value)) {
|
|
91
|
+
for (const item of value) {
|
|
92
|
+
if (typeof item === "string") {
|
|
93
|
+
clientTypes.add(item);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return [...clientTypes].map((clientType) => clientType.toLowerCase());
|
|
99
|
+
}
|
|
100
|
+
function isCliFeatureFlag(candidate, clientTypes) {
|
|
101
|
+
if (isArchivedFeatureFlag(candidate)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const reason = typeof candidate.reason === "string" ? candidate.reason.toLowerCase() : "";
|
|
105
|
+
if (reason.includes("client_type mismatch") || reason.includes("client type mismatch")) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
if (clientTypes.length > 0) {
|
|
109
|
+
return clientTypes.includes(CLI_CLIENT_TYPE);
|
|
110
|
+
}
|
|
111
|
+
const platforms = candidate.platforms ?? candidate.targetPlatforms;
|
|
112
|
+
if (Array.isArray(platforms)) {
|
|
113
|
+
const platformValues = platforms.filter((platform) => typeof platform === "string");
|
|
114
|
+
return platformValues.length === 0 || platformValues.includes(process.platform);
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
function isArchivedFeatureFlag(candidate) {
|
|
119
|
+
if (candidate.archived === true || candidate.deleted === true) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
const archivalFields = [
|
|
123
|
+
candidate.status,
|
|
124
|
+
candidate.state,
|
|
125
|
+
candidate.lifecycle,
|
|
126
|
+
candidate.reason
|
|
127
|
+
];
|
|
128
|
+
return archivalFields.some((value) => typeof value === "string" && value.toLowerCase().includes("archived"));
|
|
129
|
+
}
|
|
130
|
+
function isSnapshotFresh(snapshot) {
|
|
131
|
+
const evaluatedAt = Date.parse(snapshot.evaluatedAt);
|
|
132
|
+
if (Number.isNaN(evaluatedAt)) return false;
|
|
133
|
+
const ttlMs = Math.max(0, snapshot.ttlSeconds) * 1e3;
|
|
134
|
+
return Date.now() - evaluatedAt < ttlMs;
|
|
135
|
+
}
|
|
136
|
+
function createEvaluationUrl(config, deviceId, clientVersion) {
|
|
137
|
+
const environment = config.features?.environment || "production";
|
|
138
|
+
const url = new URL(`${getApiBaseUrl(config)}/v1/feature-flags/evaluate`);
|
|
139
|
+
url.searchParams.set("environment", environment);
|
|
140
|
+
url.searchParams.set("clientType", CLI_CLIENT_TYPE);
|
|
141
|
+
url.searchParams.set("deviceId", deviceId);
|
|
142
|
+
url.searchParams.set("cliVersion", clientVersion);
|
|
143
|
+
url.searchParams.set("platform", process.platform);
|
|
144
|
+
return url;
|
|
145
|
+
}
|
|
146
|
+
async function downloadRemoteFeatureFlags(config, deviceId, clientVersion) {
|
|
147
|
+
const controller = new AbortController();
|
|
148
|
+
const timeout = setTimeout(() => controller.abort(), FEATURE_FLAG_REQUEST_TIMEOUT_MS);
|
|
149
|
+
try {
|
|
150
|
+
const response = await fetch(createEvaluationUrl(config, deviceId, clientVersion), { signal: controller.signal });
|
|
151
|
+
if (!response.ok) return null;
|
|
152
|
+
return parseSnapshot(await response.json());
|
|
153
|
+
} catch {
|
|
154
|
+
return null;
|
|
155
|
+
} finally {
|
|
156
|
+
clearTimeout(timeout);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async function writeRemoteFeatureFlagCache(snapshot) {
|
|
160
|
+
await fs.ensureDir(path.dirname(AUTOHAND_FILES.featureFlagsCache));
|
|
161
|
+
await fs.writeJson(AUTOHAND_FILES.featureFlagsCache, snapshot, { spaces: 2 });
|
|
162
|
+
}
|
|
163
|
+
async function loadCachedRemoteFeatureFlags() {
|
|
164
|
+
try {
|
|
165
|
+
if (!await fs.pathExists(AUTOHAND_FILES.featureFlagsCache)) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
const data = await fs.readJson(AUTOHAND_FILES.featureFlagsCache);
|
|
169
|
+
return parseSnapshot(data);
|
|
170
|
+
} catch {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async function loadRemoteFeatureFlags(config, options = {}) {
|
|
175
|
+
const cached = await loadCachedRemoteFeatureFlags();
|
|
176
|
+
if (!options.forceRefresh && cached && isSnapshotFresh(cached)) {
|
|
177
|
+
return cached;
|
|
178
|
+
}
|
|
179
|
+
const downloaded = await downloadRemoteFeatureFlags(config, readDeviceId(), package_default.version);
|
|
180
|
+
if (downloaded) {
|
|
181
|
+
await writeRemoteFeatureFlagCache(downloaded);
|
|
182
|
+
return downloaded;
|
|
183
|
+
}
|
|
184
|
+
return options.allowCachedFallback === false ? null : cached;
|
|
185
|
+
}
|
|
186
|
+
var RemoteFeatureFlagManager = class {
|
|
187
|
+
constructor(config) {
|
|
188
|
+
this.config = config;
|
|
189
|
+
this.apiBaseUrl = getApiBaseUrl(config);
|
|
190
|
+
this.environment = config.features?.environment || "production";
|
|
191
|
+
this.clientVersion = package_default.version;
|
|
192
|
+
}
|
|
193
|
+
config;
|
|
194
|
+
snapshot = null;
|
|
195
|
+
deviceId = readDeviceId();
|
|
196
|
+
apiBaseUrl;
|
|
197
|
+
environment;
|
|
198
|
+
clientVersion;
|
|
199
|
+
async refreshFeatureFlags() {
|
|
200
|
+
const downloaded = await downloadRemoteFeatureFlags(this.config, this.deviceId, this.clientVersion);
|
|
201
|
+
if (downloaded) {
|
|
202
|
+
this.snapshot = downloaded;
|
|
203
|
+
await writeRemoteFeatureFlagCache(downloaded);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
this.snapshot = await loadCachedRemoteFeatureFlags();
|
|
207
|
+
}
|
|
208
|
+
getSnapshot() {
|
|
209
|
+
return this.snapshot;
|
|
210
|
+
}
|
|
211
|
+
isFeatureEnabled(key, localDefault = false) {
|
|
212
|
+
if (isLocalFeatureId(key)) {
|
|
213
|
+
return localDefault;
|
|
214
|
+
}
|
|
215
|
+
const flag = this.snapshot?.flags.find((item) => item.key === key);
|
|
216
|
+
if (!flag) return localDefault;
|
|
217
|
+
if (!flag.enabled) return false;
|
|
218
|
+
return this.config.features?.remoteOverrides?.[key] !== "off";
|
|
219
|
+
}
|
|
220
|
+
async trackFeatureActivation(key, metadata2) {
|
|
221
|
+
void metadata2;
|
|
222
|
+
const flag = this.snapshot?.flags.find((item) => item.key === key);
|
|
223
|
+
if (!flag || !this.isFeatureEnabled(key)) return;
|
|
224
|
+
try {
|
|
225
|
+
await fetch(`${this.apiBaseUrl}/v1/feature-flags/events`, {
|
|
226
|
+
method: "POST",
|
|
227
|
+
headers: { "Content-Type": "application/json" },
|
|
228
|
+
body: JSON.stringify({
|
|
229
|
+
events: [{
|
|
230
|
+
key,
|
|
231
|
+
environment: this.environment,
|
|
232
|
+
eventType: "activation",
|
|
233
|
+
enabled: true,
|
|
234
|
+
reason: flag.reason,
|
|
235
|
+
deviceId: this.deviceId,
|
|
236
|
+
clientType: "cli",
|
|
237
|
+
cliVersion: this.clientVersion,
|
|
238
|
+
platform: process.platform,
|
|
239
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
240
|
+
}]
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
} catch {
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
getStatus() {
|
|
247
|
+
return {
|
|
248
|
+
apiBaseUrl: this.apiBaseUrl,
|
|
249
|
+
environment: this.environment,
|
|
250
|
+
deviceId: this.deviceId,
|
|
251
|
+
platform: process.platform,
|
|
252
|
+
osVersion: os.release(),
|
|
253
|
+
evaluatedAt: this.snapshot?.evaluatedAt || null
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// src/commands/features.ts
|
|
259
|
+
function renderUsage() {
|
|
260
|
+
return [
|
|
261
|
+
"Usage: /experiments [list|status|enable|disable|refresh]",
|
|
262
|
+
"",
|
|
263
|
+
"Commands:",
|
|
264
|
+
" /experiments",
|
|
265
|
+
" /experiments list",
|
|
266
|
+
" /experiments status <feature>",
|
|
267
|
+
" /experiments enable <feature>",
|
|
268
|
+
" /experiments disable <feature>",
|
|
269
|
+
" /experiments refresh"
|
|
270
|
+
].join("\n");
|
|
271
|
+
}
|
|
272
|
+
function requireConfig(config) {
|
|
273
|
+
return config ?? "Config not available.";
|
|
274
|
+
}
|
|
275
|
+
async function setFeatureEnabled(config, featureId, enabled, remoteSnapshot) {
|
|
276
|
+
if (!featureId) {
|
|
277
|
+
return renderUsage();
|
|
278
|
+
}
|
|
279
|
+
const snapshot = remoteSnapshot === void 0 ? await loadRemoteFeatureFlags(config) : remoteSnapshot;
|
|
280
|
+
const result = setFeatureState(config, featureId, enabled, { remoteSnapshot: snapshot });
|
|
281
|
+
if (!result.ok || !result.feature) {
|
|
282
|
+
return result.error ?? `Unknown feature "${featureId}".`;
|
|
283
|
+
}
|
|
284
|
+
await saveConfig(config);
|
|
285
|
+
if (result.feature.source === "remote") {
|
|
286
|
+
if (enabled) {
|
|
287
|
+
return `Following remote state for ${result.feature.id} (currently ${result.feature.enabled ? "on" : "off"}).`;
|
|
288
|
+
}
|
|
289
|
+
return `Disabled ${result.feature.id} locally. Remote state remains ${result.feature.remoteEnabled ? "on" : "off"}.`;
|
|
290
|
+
}
|
|
291
|
+
const action = enabled ? "Enabled" : "Disabled";
|
|
292
|
+
const restartNote = result.feature.requiresRestart ? " Restart Autohand for this to fully apply." : "";
|
|
293
|
+
return `${action} ${result.feature.id}.${restartNote}`;
|
|
294
|
+
}
|
|
295
|
+
async function showInteractiveFeatures(config, remoteSnapshot) {
|
|
296
|
+
let toggleCount = 0;
|
|
297
|
+
const pendingSaves = [];
|
|
298
|
+
const states = listFeatureStates(config, { remoteSnapshot });
|
|
299
|
+
const initialStates = new Map(states.map((feature) => [feature.id, feature.enabled]));
|
|
300
|
+
const finalStates = new Map(initialStates);
|
|
301
|
+
const restartRequired = new Set(states.filter((feature) => feature.requiresRestart).map((feature) => feature.id));
|
|
302
|
+
const options = states.map((feature) => ({
|
|
303
|
+
label: `${feature.id.padEnd(26)} ${feature.source.padEnd(8)} ${feature.stage.padEnd(12)} ${feature.enabled ? "on" : "off"}`,
|
|
304
|
+
value: feature.id,
|
|
305
|
+
checked: feature.enabled,
|
|
306
|
+
description: feature.description
|
|
307
|
+
}));
|
|
308
|
+
await showModal({
|
|
309
|
+
title: "Experiments - space toggles, enter closes",
|
|
310
|
+
options,
|
|
311
|
+
multiSelect: true,
|
|
312
|
+
maxVisible: 12,
|
|
313
|
+
onToggle: (option, checked) => {
|
|
314
|
+
const result = setFeatureState(config, option.value, checked, { remoteSnapshot });
|
|
315
|
+
if (!result.ok) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
toggleCount += 1;
|
|
319
|
+
finalStates.set(option.value, result.feature?.enabled ?? checked);
|
|
320
|
+
pendingSaves.push(saveConfig(config));
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
await Promise.all(pendingSaves);
|
|
324
|
+
if (toggleCount === 0) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
const enabled = [];
|
|
328
|
+
const disabled = [];
|
|
329
|
+
for (const [featureId, initiallyEnabled] of initialStates) {
|
|
330
|
+
const finallyEnabled = finalStates.get(featureId);
|
|
331
|
+
if (finallyEnabled === initiallyEnabled || typeof finallyEnabled !== "boolean") {
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
if (finallyEnabled) {
|
|
335
|
+
enabled.push(featureId);
|
|
336
|
+
} else {
|
|
337
|
+
disabled.push(featureId);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return formatInteractiveFeatureSummary({
|
|
341
|
+
enabled,
|
|
342
|
+
disabled,
|
|
343
|
+
restartRequired: [...new Set([...enabled, ...disabled].filter((featureId) => restartRequired.has(featureId)))]
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function formatChangedFeatures(action, featureIds) {
|
|
347
|
+
if (featureIds.length === 0) {
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
if (featureIds.length === 1) {
|
|
351
|
+
return `${action} ${featureIds[0]}.`;
|
|
352
|
+
}
|
|
353
|
+
return `${action} ${featureIds.length} features: ${featureIds.join(", ")}.`;
|
|
354
|
+
}
|
|
355
|
+
function formatInteractiveFeatureSummary(changes) {
|
|
356
|
+
const parts = [
|
|
357
|
+
formatChangedFeatures("Enabled", changes.enabled),
|
|
358
|
+
formatChangedFeatures("Disabled", changes.disabled)
|
|
359
|
+
].filter((part) => Boolean(part));
|
|
360
|
+
if (changes.restartRequired.length > 0) {
|
|
361
|
+
parts.push(`Restart required for: ${changes.restartRequired.join(", ")}.`);
|
|
362
|
+
}
|
|
363
|
+
return parts.length > 0 ? parts.join(" ") : null;
|
|
364
|
+
}
|
|
365
|
+
async function features(ctx, args = []) {
|
|
366
|
+
const required = requireConfig(ctx.config);
|
|
367
|
+
if (typeof required === "string") {
|
|
368
|
+
return required;
|
|
369
|
+
}
|
|
370
|
+
const subcommand = (args[0] ?? "").toLowerCase();
|
|
371
|
+
const featureId = args[1];
|
|
372
|
+
const forceRefresh = subcommand === "refresh";
|
|
373
|
+
const remoteSnapshot = await loadRemoteFeatureFlags(required, {
|
|
374
|
+
forceRefresh,
|
|
375
|
+
allowCachedFallback: !forceRefresh
|
|
376
|
+
});
|
|
377
|
+
switch (subcommand) {
|
|
378
|
+
case "":
|
|
379
|
+
return showInteractiveFeatures(required, remoteSnapshot);
|
|
380
|
+
case "list":
|
|
381
|
+
case "ls":
|
|
382
|
+
if (ctx.interactive) {
|
|
383
|
+
return showInteractiveFeatures(required, remoteSnapshot);
|
|
384
|
+
}
|
|
385
|
+
return formatFeatureList(required, { remoteSnapshot });
|
|
386
|
+
case "status":
|
|
387
|
+
case "show":
|
|
388
|
+
return featureId ? formatFeatureStatus(required, featureId, { remoteSnapshot }) : renderUsage();
|
|
389
|
+
case "enable":
|
|
390
|
+
case "on":
|
|
391
|
+
return setFeatureEnabled(required, featureId, true, remoteSnapshot);
|
|
392
|
+
case "disable":
|
|
393
|
+
case "off":
|
|
394
|
+
return setFeatureEnabled(required, featureId, false, remoteSnapshot);
|
|
395
|
+
case "refresh":
|
|
396
|
+
if (!remoteSnapshot) {
|
|
397
|
+
return "No remote feature flags available. Using local feature switches only.";
|
|
398
|
+
}
|
|
399
|
+
return `Downloaded ${remoteSnapshot.flags.length} remote feature${remoteSnapshot.flags.length === 1 ? "" : "s"} from ${remoteSnapshot.environment}.`;
|
|
400
|
+
default:
|
|
401
|
+
if (getFeatureState(required, subcommand, { remoteSnapshot })) {
|
|
402
|
+
return formatFeatureStatus(required, subcommand, { remoteSnapshot });
|
|
403
|
+
}
|
|
404
|
+
return renderUsage();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
var metadata = {
|
|
408
|
+
command: "/experiments",
|
|
409
|
+
description: "list and toggle Autohand experiments",
|
|
410
|
+
implemented: true,
|
|
411
|
+
subcommands: [
|
|
412
|
+
{ name: "list", description: "List experiments and current state" },
|
|
413
|
+
{ name: "status", description: "Show one experiment" },
|
|
414
|
+
{ name: "enable", description: "Enable an experiment" },
|
|
415
|
+
{ name: "disable", description: "Disable an experiment" },
|
|
416
|
+
{ name: "refresh", description: "Download remote feature flags from the Autohand API" }
|
|
417
|
+
]
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
export {
|
|
421
|
+
RemoteFeatureFlagManager,
|
|
422
|
+
setFeatureEnabled,
|
|
423
|
+
features,
|
|
424
|
+
metadata
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* @license
|
|
428
|
+
* Copyright 2026 Autohand AI LLC
|
|
429
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
430
|
+
*/
|