autohand-cli 0.8.3 → 0.9.1
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 +191 -74
- package/dist/{AgentRegistry-ODDXPAFR.js → AgentRegistry-GOV7FN2O.js} +2 -2
- package/dist/AgentRegistry-J2C6JBZ3.cjs +10 -0
- package/dist/{AutomodeManager-EOVHGRPP.js → AutomodeManager-APLLPEYJ.js} +31 -17
- package/dist/{AutomodeManager-6ATBE7Q5.cjs → AutomodeManager-MPSXT2RH.cjs} +38 -24
- package/dist/CommunitySkillsCache-22BB3J6H.cjs +8 -0
- package/dist/{CommunitySkillsCache-QLE57BN5.js → CommunitySkillsCache-ZACDPD4J.js} +2 -2
- package/dist/GitHubRegistryFetcher-CYJLF2XL.cjs +7 -0
- package/dist/{GitHubRegistryFetcher-NT5GFZXS.js → GitHubRegistryFetcher-J2BWPXJF.js} +1 -1
- package/dist/{HookManager-B2F35M27.js → HookManager-2S6AHOC3.js} +1 -1
- package/dist/{HookManager-PFAFE3FK.cjs → HookManager-TVEQI5ZU.cjs} +2 -2
- package/dist/{ImportWizard-OHRKBANZ.js → ImportWizard-AEBMAKXE.js} +33 -9
- package/dist/{ImportWizard-CJRZPPHL.cjs → ImportWizard-AF2XL6DS.cjs} +37 -13
- package/dist/LearnAdvisor-KKEQ5QCV.js +9 -0
- package/dist/LearnAdvisor-Q7RAYLPF.cjs +9 -0
- package/dist/{McpClientManager-NQ3EW2IF.cjs → McpClientManager-BNSKLHIN.cjs} +2 -2
- package/dist/{McpClientManager-VBIMGKXU.js → McpClientManager-SL35BR24.js} +1 -1
- package/dist/MemoryManager-PMNAEZMB.cjs +8 -0
- package/dist/{MemoryManager-2LAT7IHS.js → MemoryManager-QZRLTUB5.js} +2 -2
- package/dist/NVIDIAProvider-C3FWQOBZ.cjs +14 -0
- package/dist/NVIDIAProvider-SJPY3ONR.js +14 -0
- package/dist/{PermissionManager-7NQHRCHY.js → PermissionManager-MT7KBNNR.js} +3 -3
- package/dist/PermissionManager-URCNP5EC.cjs +11 -0
- package/dist/{ProjectProfiler-UG42W6WD.cjs → ProjectProfiler-CDAE7ECW.cjs} +1 -0
- package/dist/{ProjectProfiler-P4QJQWWA.js → ProjectProfiler-NZTJDRHD.js} +1 -0
- package/dist/ProviderFactory-56N3ECE4.cjs +12 -0
- package/dist/{ProviderFactory-2IYJ5OPW.js → ProviderFactory-RB4RVAF6.js} +4 -1
- package/dist/SessionManager-2IZGWASQ.cjs +10 -0
- package/dist/{SessionManager-4U4JFQ3C.js → SessionManager-554PHVPC.js} +2 -2
- package/dist/SkillsRegistry-GMRVONOQ.cjs +9 -0
- package/dist/{SkillsRegistry-RFEINXRT.js → SkillsRegistry-NHHMIUYJ.js} +2 -2
- package/dist/SubAgent-4GOR2FIJ.js +13 -0
- package/dist/SubAgent-ZJMDH4FI.cjs +13 -0
- package/dist/{SyncApiClient-B5RT2ECG.js → SyncApiClient-G3FM65IV.js} +1 -1
- package/dist/SyncApiClient-ODBDECOG.cjs +11 -0
- package/dist/about-3USFSGOH.js +15 -0
- package/dist/about-QR52U5DD.cjs +15 -0
- package/dist/acp-5Y2W6OZP.js +1556 -0
- package/dist/acp-GSYE75OB.cjs +1556 -0
- package/dist/actionExecutor-KHUU3Z3Q.cjs +28 -0
- package/dist/actionExecutor-PLQJZLZV.js +28 -0
- package/dist/add-dir-BTAD5OZS.cjs +11 -0
- package/dist/{add-dir-TUJM3PG5.js → add-dir-HCERJDBR.js} +3 -2
- package/dist/agent-B3EVT7NN.cjs +126 -0
- package/dist/agent-SATQ3WZ3.js +126 -0
- package/dist/agents/builtin/code-cleaner.md +1 -1
- package/dist/agents/builtin/docs-writer.md +1 -1
- package/dist/agents/builtin/researcher.md +2 -2
- package/dist/agents/builtin/reviewer.md +1 -1
- package/dist/agents/builtin/tester.md +1 -1
- package/dist/agents/builtin/todo-resolver.md +1 -1
- package/dist/agents-44CRJGM7.cjs +18 -0
- package/dist/agents-NN4ZAJ7R.js +18 -0
- package/dist/agents-new-6D6G4QS6.cjs +17 -0
- package/dist/agents-new-7GAQ25EK.js +17 -0
- package/dist/{autoSkill-LQEVQFIH.js → autoSkill-66PKCYTW.js} +2 -2
- package/dist/autoSkill-VQLGBELN.cjs +20 -0
- package/dist/automode-45DWV4TN.cjs +10 -0
- package/dist/{automode-R6P3VHLS.js → automode-BUF3VGXU.js} +2 -2
- package/dist/browserToolBridge-BXRQB4B4.cjs +58 -0
- package/dist/browserToolBridge-F5N66PE7.js +58 -0
- package/dist/chrome-Q2U73HZB.cjs +50 -0
- package/dist/chrome-Q54OALOK.cjs +21 -0
- package/dist/chrome-Y3T7EIHG.js +50 -0
- package/dist/chrome-ZNJ46OYW.js +21 -0
- package/dist/chromeSkill-53TH55PM.js +105 -0
- package/dist/chromeSkill-THW7N4IY.cjs +105 -0
- package/dist/{chunk-HXGBSJL5.cjs → chunk-22SCR3EV.cjs} +2 -2
- package/dist/chunk-26G7YGOW.js +367 -0
- package/dist/{chunk-3L53OA4E.cjs → chunk-2ESQR35E.cjs} +10 -10
- package/dist/chunk-2H5O745H.js +63 -0
- package/dist/{chunk-ULDM2SNB.js → chunk-2IW5YFJ4.js} +48 -47
- package/dist/{chunk-U55TWFJI.cjs → chunk-2VHB43IX.cjs} +24 -6
- package/dist/chunk-3EDDDZS2.cjs +5 -0
- package/dist/{chunk-X5VSP65C.cjs → chunk-3ICORF7M.cjs} +4 -4
- package/dist/chunk-3OF56EMA.cjs +197 -0
- package/dist/chunk-3UC6DMFI.cjs +93 -0
- package/dist/{chunk-64H4FRM3.cjs → chunk-3UHRCHKB.cjs} +32 -34
- package/dist/{chunk-JCLYQ2JC.js → chunk-3ZOOH44N.js} +12 -6
- package/dist/{chunk-TUD3Z3BD.js → chunk-44ZWOBTI.js} +136 -55
- package/dist/chunk-4567QNRB.js +444 -0
- package/dist/chunk-45CHNQM6.cjs +517 -0
- package/dist/chunk-46MTALKD.js +44 -0
- package/dist/{chunk-WHE2SWHU.js → chunk-4E7SHPNQ.js} +2 -2
- package/dist/chunk-4LMUDS2K.js +124 -0
- package/dist/{chunk-W7RYQJLO.cjs → chunk-4XFHP2SN.cjs} +46 -15
- package/dist/chunk-4XVLNOFA.js +360 -0
- package/dist/{chunk-GBHDROGL.js → chunk-575PXZX7.js} +16 -4
- package/dist/chunk-5A7ZL64N.js +139 -0
- package/dist/chunk-5GCQ5UMV.cjs +85 -0
- package/dist/chunk-5JTTM5SC.js +59 -0
- package/dist/{chunk-IETRBBMP.cjs → chunk-5K3CDSWZ.cjs} +108 -31
- package/dist/{chunk-KLWJIPU2.cjs → chunk-5SFV2NCY.cjs} +20 -16
- package/dist/chunk-5ZNYX4VH.cjs +71 -0
- package/dist/{chunk-A4IJHHV7.cjs → chunk-63ANVAOJ.cjs} +52 -11
- package/dist/{chunk-MYISNQH4.js → chunk-65LRPW5W.js} +1 -1
- package/dist/chunk-6AYJCDTA.js +360 -0
- package/dist/{chunk-X2MSVKDV.js → chunk-6HF6XSCC.js} +2 -2
- package/dist/{chunk-AEJH23FO.cjs → chunk-6JWCGQJU.cjs} +6 -6
- package/dist/chunk-6OECOAK5.cjs +360 -0
- package/dist/chunk-6R25D2H5.js +121 -0
- package/dist/chunk-7DJJGKM6.js +77 -0
- package/dist/{chunk-VG34MG2U.js → chunk-7IRQ7JEH.js} +9 -6
- package/dist/chunk-7MY4JHER.js +27 -0
- package/dist/chunk-7PJKTSRN.js +152 -0
- package/dist/{chunk-SKYG33B2.cjs → chunk-7PT646AL.cjs} +3 -3
- package/dist/chunk-7WAUCLLQ.js +229 -0
- package/dist/{chunk-U46VYPLR.cjs → chunk-7XTUL7ZD.cjs} +9 -9
- package/dist/chunk-AE2ILW25.cjs +152 -0
- package/dist/{chunk-T2M64VHA.cjs → chunk-AOKXYGBQ.cjs} +61 -41
- package/dist/chunk-AQ5PVHOC.cjs +113 -0
- package/dist/{chunk-N2BLVUPM.cjs → chunk-AZ47LKD5.cjs} +3 -3
- package/dist/chunk-B4HSNOIH.cjs +354 -0
- package/dist/chunk-B76FJKEJ.cjs +184 -0
- package/dist/chunk-BP37FVBM.js +85 -0
- package/dist/chunk-BQU3HAE7.js +21 -0
- package/dist/chunk-BYE7RQFZ.cjs +121 -0
- package/dist/chunk-C46B72VK.js +1034 -0
- package/dist/{chunk-HIVRCQS2.js → chunk-C5QIQQ37.js} +56 -25
- package/dist/chunk-CCIDL4SA.js +19931 -0
- package/dist/{chunk-XVUHNWMX.js → chunk-CECH6QQP.js} +17 -19
- package/dist/chunk-CFAWTLSC.js +13 -0
- package/dist/{chunk-ZYQMLKOK.cjs → chunk-CK4HAHVY.cjs} +212 -70
- package/dist/chunk-CO2AADYU.cjs +360 -0
- package/dist/chunk-CRTCZ4WL.cjs +19931 -0
- package/dist/chunk-CSTUTDTH.js +75 -0
- package/dist/{chunk-K2C56QGS.cjs → chunk-D546G7DA.cjs} +1650 -479
- package/dist/{chunk-CNBKZEX5.cjs → chunk-DA7NBAJK.cjs} +49 -17
- package/dist/{chunk-G4CAKI3V.js → chunk-DGBPWODD.js} +7 -2
- package/dist/chunk-DHUQZ53B.cjs +29 -0
- package/dist/{chunk-RGR6ME5J.cjs → chunk-DI57A4BX.cjs} +25 -28
- package/dist/{chunk-5K6NGAVM.js → chunk-DNSD7DVJ.js} +67 -52
- package/dist/{chunk-RDF37HKB.cjs → chunk-DSSCERHI.cjs} +3 -2
- package/dist/{chunk-NAJ4IZKD.cjs → chunk-EA2MS25U.cjs} +8 -6
- package/dist/{chunk-SJAVBCOA.js → chunk-EEHWALXA.js} +94 -3
- package/dist/chunk-ES2HJQ4N.js +37 -0
- package/dist/{chunk-G27PQQFD.js → chunk-EYHKL4QC.js} +1 -1
- package/dist/{chunk-SV2WA57F.js → chunk-FBQJZKFX.js} +38 -15
- package/dist/chunk-FFBDRUO5.cjs +59 -0
- package/dist/{chunk-N7LI55V4.js → chunk-FFHSCM5M.js} +15 -8
- package/dist/{chunk-SAHBLB3E.js → chunk-FP46B4X3.js} +208 -3
- package/dist/chunk-FQVG6ZHF.js +197 -0
- package/dist/{chunk-J2GSFVUV.cjs → chunk-GAOPJ5S3.cjs} +74 -59
- package/dist/{chunk-S52YW5ZQ.js → chunk-GNBBIAMD.js} +16 -19
- package/dist/chunk-GSDV75A5.js +715 -0
- package/dist/chunk-GWY26SUD.cjs +63 -0
- package/dist/{chunk-TUAITHWL.js → chunk-H426KOGY.js} +2 -1
- package/dist/{chunk-EZMINVLU.js → chunk-H4D2Q2AL.js} +5 -2
- package/dist/chunk-HC2Q6A3E.cjs +4967 -0
- package/dist/{chunk-3WVJEL7K.cjs → chunk-HDK2EHVH.cjs} +3 -1
- package/dist/{chunk-5IXII4HX.cjs → chunk-HG3ZASBH.cjs} +23 -16
- package/dist/chunk-HK5A54AV.cjs +280 -0
- package/dist/{chunk-LQGVEP3E.js → chunk-HQUSEWT4.js} +45 -13
- package/dist/chunk-HSWWM6AM.js +2340 -0
- package/dist/chunk-HTU4W3GB.js +183 -0
- package/dist/{chunk-HLHTG5ZU.cjs → chunk-HVCIB4SW.cjs} +14 -12
- package/dist/chunk-HXHE2KAO.js +385 -0
- package/dist/{chunk-LJFUXC56.cjs → chunk-HXQREVTA.cjs} +9 -6
- package/dist/{chunk-SLQAYV3W.js → chunk-HZWU6IO3.js} +11 -2
- package/dist/chunk-I2ZK3AOD.js +866 -0
- package/dist/chunk-IEPLQ47J.js +719 -0
- package/dist/chunk-J5HE6CUM.cjs +124 -0
- package/dist/{chunk-LIEXWM2M.js → chunk-JAQO6XDB.js} +19 -1
- package/dist/chunk-JB3JCYBJ.js +113 -0
- package/dist/chunk-JCUHCH37.cjs +247 -0
- package/dist/{chunk-FPHU2ES6.cjs → chunk-JM3ZTQUK.cjs} +19 -9
- package/dist/{chunk-NDMIPTV4.js → chunk-JMJRFSNJ.js} +8 -3
- package/dist/{chunk-ZLSGXMGQ.js → chunk-JMN3GZU6.js} +2 -0
- package/dist/chunk-JPFRI4L4.js +4967 -0
- package/dist/{chunk-BVKXEQVG.cjs → chunk-JV5HVCHU.cjs} +22 -10
- package/dist/chunk-KA2U6MY2.js +388 -0
- package/dist/{chunk-SEKD5FH3.cjs → chunk-KASXKDF2.cjs} +8 -3
- package/dist/chunk-KJ26T7GM.cjs +367 -0
- package/dist/chunk-KM7R5YPS.cjs +385 -0
- package/dist/{chunk-MBBY4ZIK.js → chunk-KMP6Y3LJ.js} +4 -1
- package/dist/chunk-KWXGDSYT.js +184 -0
- package/dist/{chunk-C5IJIM2V.cjs → chunk-L46OUKW5.cjs} +68 -37
- package/dist/{chunk-6UJMCWRY.js → chunk-L6OH44HL.js} +19 -9
- package/dist/chunk-LANGD5CO.js +280 -0
- package/dist/{chunk-APIXPPMT.js → chunk-LEZEWKPA.js} +1004 -39
- package/dist/{chunk-ULQ6MDSJ.cjs → chunk-LFDPTJYF.cjs} +43 -35
- package/dist/chunk-LJD7KR3L.cjs +44 -0
- package/dist/{chunk-NCC6ETZS.js → chunk-LUMV3DB2.js} +41 -33
- package/dist/{chunk-QXH5RCFI.js → chunk-M5DK524Z.js} +2 -2
- package/dist/chunk-M7B7RRBK.cjs +1034 -0
- package/dist/chunk-MANJ67D3.js +3897 -0
- package/dist/{chunk-HPHJ73GU.cjs → chunk-MGNXABSU.cjs} +9 -9
- package/dist/{chunk-6ZCULLCA.js → chunk-MMKZSJUN.js} +1 -1
- package/dist/{chunk-DVUHHH3B.cjs → chunk-MQQH4XQH.cjs} +4 -4
- package/dist/chunk-MUNUUFU7.cjs +21 -0
- package/dist/{chunk-DVZOENQ7.cjs → chunk-MZN6JBRZ.cjs} +9 -4
- package/dist/{chunk-OOKY3HPZ.js → chunk-NB6M6ESM.js} +50 -9
- package/dist/{chunk-BYONM7UM.js → chunk-NBGOIFKP.js} +265 -18
- package/dist/chunk-NHWHEW7M.cjs +75 -0
- package/dist/chunk-NQZH5CR2.cjs +468 -0
- package/dist/{chunk-EGPXJERY.cjs → chunk-NV6LCD2I.cjs} +119 -28
- package/dist/chunk-NVATU4V6.cjs +44 -0
- package/dist/{chunk-YZXUDM5X.js → chunk-NZ3ZWLUW.js} +204 -62
- package/dist/chunk-NZ7GCK7Y.cjs +92 -0
- package/dist/{chunk-VEKDGU2Q.cjs → chunk-NZQFKXM3.cjs} +49 -25
- package/dist/chunk-O5GI6SR3.js +59 -0
- package/dist/{chunk-56SWIDEL.cjs → chunk-OCATAKXV.cjs} +57 -56
- package/dist/{chunk-SKV2F3NM.js → chunk-OIGYWOL6.js} +1 -1
- package/dist/{chunk-IFFXSTOM.cjs → chunk-ONVYXTUT.cjs} +3 -3
- package/dist/chunk-OR67YXQK.cjs +13 -0
- package/dist/chunk-OV3T5MUH.cjs +715 -0
- package/dist/{chunk-OHUZKDGX.js → chunk-P4FUTSVK.js} +3 -3
- package/dist/chunk-P6SLT2F4.cjs +139 -0
- package/dist/{chunk-TNZRZQ7Q.js → chunk-PB7W7R72.js} +3 -78
- package/dist/chunk-PCM3N3CL.cjs +37 -0
- package/dist/{chunk-2AA5MFES.js → chunk-PGFLPURU.js} +8 -5
- package/dist/{chunk-DJDE4DTT.cjs → chunk-PIXQ2AVM.cjs} +25 -19
- package/dist/chunk-PNIAIOMZ.cjs +229 -0
- package/dist/{chunk-HTLINWX6.cjs → chunk-PQBYFEBL.cjs} +16 -13
- package/dist/{chunk-22D2CNTP.cjs → chunk-PSAH4ZQB.cjs} +5 -2
- package/dist/{chunk-3VTAFAL2.js → chunk-PTTZI4QZ.js} +16 -12
- package/dist/{chunk-WPVWQSL7.cjs → chunk-PY73W5MQ.cjs} +16 -13
- package/dist/{chunk-EGMZDTSL.js → chunk-PZZMIYII.js} +10 -2
- package/dist/{chunk-HBZU3RBZ.js → chunk-Q3BS6FPM.js} +34 -10
- package/dist/chunk-QBYGMMDD.js +517 -0
- package/dist/chunk-QLZOMZO5.cjs +388 -0
- package/dist/{chunk-ADUFCS4Q.cjs → chunk-QQ64HEHP.cjs} +160 -79
- package/dist/{chunk-L3TWPROA.js → chunk-QRQF3556.js} +44 -24
- package/dist/{chunk-YHD6TUIR.cjs → chunk-QW2RW2GY.cjs} +2 -0
- package/dist/chunk-RAKO7UN7.js +114 -0
- package/dist/{chunk-7TQH3CL4.cjs → chunk-RBXBH6EB.cjs} +78 -35
- package/dist/chunk-RFUKZIJF.cjs +78 -0
- package/dist/chunk-RS2E32YB.js +71 -0
- package/dist/{chunk-OLSBBZW6.cjs → chunk-S5JNQIGL.cjs} +5 -5
- package/dist/{chunk-FTYY5JJD.js → chunk-S5QKRA2V.js} +2 -2
- package/dist/chunk-SD3NTC7D.cjs +77 -0
- package/dist/{chunk-KPELYZ6L.js → chunk-SDLY4X3G.js} +2 -2
- package/dist/{chunk-IDFF5J2E.js → chunk-SFFEKZGC.js} +38 -7
- package/dist/{chunk-EGFT4PGW.js → chunk-SHRLFX6F.js} +8 -3
- package/dist/{chunk-3WICOC33.js → chunk-SNDDZG5H.js} +124 -84
- package/dist/{chunk-CZXGCVTR.cjs → chunk-SOVR7S3T.cjs} +2 -2
- package/dist/chunk-SPQ7QIQ6.js +78 -0
- package/dist/{chunk-XRZEUWKF.js → chunk-SRMGWMQO.js} +1 -1
- package/dist/{chunk-R33VKSH5.cjs → chunk-SVVP4UUZ.cjs} +11 -11
- package/dist/{chunk-7BTSG4ME.cjs → chunk-SY2P3Z5W.cjs} +1004 -39
- package/dist/chunk-SZD45IDG.js +468 -0
- package/dist/{chunk-3O3MOK5C.cjs → chunk-TE4SYTWR.cjs} +1114 -142
- package/dist/chunk-TH26BQJG.js +101 -0
- package/dist/{chunk-QNGEW5TC.js → chunk-TR6NECEZ.js} +1 -1
- package/dist/{chunk-YGN4CQIP.js → chunk-TYBPTKFT.js} +1 -1
- package/dist/{chunk-GJH7XMSK.js → chunk-U2QUMKCB.js} +8 -6
- package/dist/{chunk-47CKWKEX.cjs → chunk-U6PLSPMD.cjs} +9 -4
- package/dist/chunk-UOQECODR.js +34 -0
- package/dist/chunk-UR27UDTB.js +354 -0
- package/dist/chunk-UWZ4G3SQ.js +93 -0
- package/dist/{chunk-Y72HH2TF.cjs → chunk-V3SZLWEQ.cjs} +33 -24
- package/dist/chunk-V4HGZSKQ.cjs +183 -0
- package/dist/{chunk-3PDTTAKJ.js → chunk-V5ELP2XE.js} +19 -12
- package/dist/{chunk-3K2ESU53.cjs → chunk-VKOXFT4L.cjs} +2 -2
- package/dist/{chunk-XTB6VJVQ.cjs → chunk-VLGGMQUN.cjs} +6 -6
- package/dist/chunk-VQHSYAPZ.cjs +3897 -0
- package/dist/chunk-VUGOOGHB.js +400 -0
- package/dist/chunk-W5QLA6WP.cjs +866 -0
- package/dist/chunk-WBU4Q4GS.cjs +400 -0
- package/dist/{chunk-KWXVKLQ5.cjs → chunk-WGNMOVMT.cjs} +7 -82
- package/dist/chunk-WJYFLQ7G.cjs +27 -0
- package/dist/{chunk-RKJTGGMU.cjs → chunk-WKRDBCP2.cjs} +221 -16
- package/dist/{chunk-ZSPXQYG2.js → chunk-WNJXIACY.js} +7 -5
- package/dist/{chunk-AYS2ASM7.js → chunk-WPE2XHVX.js} +1 -1
- package/dist/chunk-WTB7AFL6.cjs +101 -0
- package/dist/{chunk-JYTDYJVW.js → chunk-X3TI5TJJ.js} +1 -1
- package/dist/chunk-X5P6QQOB.cjs +719 -0
- package/dist/{chunk-245KJE5Y.cjs → chunk-X7XMITIL.cjs} +14 -6
- package/dist/chunk-XF2WIKHR.cjs +34 -0
- package/dist/{chunk-DV2ZHK7B.cjs → chunk-XNIMSVS6.cjs} +49 -26
- package/dist/chunk-XW3XCK4E.cjs +59 -0
- package/dist/{chunk-N23UAW4I.js → chunk-XZVDYC5U.js} +7 -2
- package/dist/chunk-Y5BDE24P.cjs +444 -0
- package/dist/{chunk-NAGQ2PDC.js → chunk-YC5OBZQU.js} +1604 -433
- package/dist/chunk-YISPVAXO.cjs +2340 -0
- package/dist/{chunk-KQGPTCQJ.js → chunk-YQDI753V.js} +68 -25
- package/dist/{chunk-UJ2JSM6H.js → chunk-YVQI26H4.js} +2 -0
- package/dist/{chunk-NNPAM4HC.cjs → chunk-YWH55BWK.cjs} +15 -6
- package/dist/{chunk-X2YOZQIP.cjs → chunk-YWTIXHU6.cjs} +266 -19
- package/dist/{chunk-XX2ZO7DS.js → chunk-YXM6SA7P.js} +25 -16
- package/dist/chunk-YZWE7XSM.js +5 -0
- package/dist/chunk-ZASDSY7P.cjs +114 -0
- package/dist/{chunk-2UC22DJU.js → chunk-ZNGRLCFQ.js} +30 -4
- package/dist/{chunk-KANW6OYC.cjs → chunk-ZNYZB7XY.cjs} +34 -8
- package/dist/{chunk-NA6WQDYW.js → chunk-ZPLCAXJW.js} +1088 -116
- package/dist/{chunk-7UOUW76C.js → chunk-ZQAT5VT5.js} +101 -24
- package/dist/chunk-ZUYYHKQA.js +44 -0
- package/dist/clear-QJXU25IF.cjs +12 -0
- package/dist/{clear-A3N4GK2S.js → clear-Y5TO3RZA.js} +3 -3
- package/dist/communityInstaller-LXMVKVAV.cjs +22 -0
- package/dist/{communityInstaller-LOP2EDH5.js → communityInstaller-RVL4STPS.js} +8 -5
- package/dist/completion-JX4T2ONW.cjs +17 -0
- package/dist/completion-SE3XYG74.js +17 -0
- package/dist/config-3224PRW4.cjs +21 -0
- package/dist/{config-HPJPKTO6.js → config-7KPHKFTP.js} +7 -4
- package/dist/{constants-LISJW3DD.js → constants-EJFAWJQI.js} +1 -1
- package/dist/constants-MCCGUU5F.cjs +21 -0
- package/dist/{defaultHooks-IHSJR2AX.cjs → defaultHooks-2V2CQL63.cjs} +25 -10
- package/dist/{defaultHooks-KUKHK3AG.js → defaultHooks-TMHDU3FS.js} +25 -10
- package/dist/export-BJVIDZC4.js +15 -0
- package/dist/export-KU4557HK.cjs +15 -0
- package/dist/feature-K3LG5IJP.cjs +14 -0
- package/dist/feature-V4JF5TNJ.js +14 -0
- package/dist/features-5OJTLKS7.js +23 -0
- package/dist/features-VCBJQXCX.cjs +23 -0
- package/dist/feedback-D4437VE4.js +18 -0
- package/dist/feedback-VZPEHGFY.cjs +18 -0
- package/dist/fffSearchProvider-2YCNKOYD.js +412 -0
- package/dist/fffSearchProvider-W6627E2V.cjs +412 -0
- package/dist/{filesystem-Z7BWAWMZ.js → filesystem-L6DQKGWK.js} +3 -2
- package/dist/filesystem-PGUPCMVK.cjs +11 -0
- package/dist/go-X4E6BCD6.js +12 -0
- package/dist/go-XREVFS5I.cjs +12 -0
- package/dist/goal-4M3J6JS2.cjs +16 -0
- package/dist/goal-EI66BV7W.js +16 -0
- package/dist/help-GGFS7WHY.cjs +12 -0
- package/dist/{help-GFQXNZOK.js → help-MLIROWKM.js} +2 -2
- package/dist/{history-E3N6BJP7.js → history-GQJ6RZD6.js} +2 -2
- package/dist/history-J4LUIOSI.cjs +14 -0
- package/dist/hooks-FSRIUS6A.cjs +18 -0
- package/dist/hooks-PPFHCF7T.js +18 -0
- package/dist/i18n-CI6VFXL5.cjs +33 -0
- package/dist/{i18n-SY7QRM22.js → i18n-Q7UZJRPL.js} +1 -1
- package/dist/ide-BUSVE54P.js +15 -0
- package/dist/ide-YR27BPGM.cjs +15 -0
- package/dist/immediateCommandRouter-MTEHZXQX.js +15 -0
- package/dist/immediateCommandRouter-ROXU3MWT.cjs +15 -0
- package/dist/{import-W7SVLSTC.js → import-3VBKI6BN.js} +3 -3
- package/dist/{import-ADI37ZUR.cjs → import-C7S6UJMW.cjs} +3 -3
- package/dist/import-DBK4OCDF.cjs +10 -0
- package/dist/{import-KGKKZ3B7.js → import-U47DXCA7.js} +2 -2
- package/dist/index.cjs +837 -23011
- package/dist/index.d.cts +95 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.js +864 -23038
- package/dist/init-OXTYS72D.cjs +10 -0
- package/dist/{init-7MFK626E.js → init-Q2O4R42R.js} +2 -2
- package/dist/inkMode-VUE6ZDLD.cjs +7 -0
- package/dist/inkMode-WBNFOSAT.js +7 -0
- package/dist/inputPrompt-3CFZDUBH.js +90 -0
- package/dist/inputPrompt-JMACL4EB.cjs +90 -0
- package/dist/language-EK3M6UBV.cjs +22 -0
- package/dist/language-Q3RUGGOW.js +22 -0
- package/dist/learn-3DSX7DYG.cjs +23 -0
- package/dist/learn-OPOH5L43.js +23 -0
- package/dist/login-GST7MWXJ.cjs +27 -0
- package/dist/login-Q7DZKAX4.js +27 -0
- package/dist/logout-2G7OUK7I.cjs +24 -0
- package/dist/logout-FNBBL2UI.js +24 -0
- package/dist/mcp-AH3MMUBU.js +21 -0
- package/dist/mcp-DW7R63IB.cjs +21 -0
- package/dist/{mcp-install-2FEROZTL.js → mcp-install-222PCKSW.js} +18 -10
- package/dist/{mcp-install-WM6BQRI5.cjs → mcp-install-IA4ZS2SV.cjs} +22 -14
- package/dist/memory-6NX3DAIY.cjs +10 -0
- package/dist/{memory-J73WZH2I.js → memory-VB46T5H3.js} +2 -2
- package/dist/model-64NAELFS.cjs +10 -0
- package/dist/{model-AES267IN.js → model-SJJG64AM.js} +2 -2
- package/dist/new-DU5SOOOY.cjs +12 -0
- package/dist/{new-5CLF3MKH.js → new-ERZ5C6CN.js} +3 -3
- package/dist/onboarding-2U2BV2KE.cjs +36 -0
- package/dist/onboarding-ZQXMPSMJ.js +36 -0
- package/dist/permissions-7ACNFK7A.js +10 -0
- package/dist/permissions-GSNNV7RJ.cjs +10 -0
- package/dist/plan-XEJMOT55.cjs +13 -0
- package/dist/{plan-65HMS5HQ.js → plan-YYUAXPTL.js} +3 -1
- package/dist/pr-review-CW6J7P62.cjs +9 -0
- package/dist/pr-review-YZSBQVT2.js +9 -0
- package/dist/{quit-XDZYRSPU.js → quit-WY6T267G.js} +2 -2
- package/dist/quit-XIRE2KRE.cjs +10 -0
- package/dist/rawMode-6W5AXAKI.cjs +7 -0
- package/dist/rawMode-GFNLXQPU.js +7 -0
- package/dist/{registry-PTHWERKC.js → registry-4DXUDKJN.js} +29 -44
- package/dist/{registry-IVT4G2RT.cjs → registry-UEO3ETZ7.cjs} +65 -80
- package/dist/repeat-P4FAPE3Y.cjs +17 -0
- package/dist/{repeat-EVCWUL6Z.js → repeat-RALE6AUO.js} +7 -3
- package/dist/resume-RQZ3WXBP.cjs +17 -0
- package/dist/resume-XSXZMDMD.js +17 -0
- package/dist/review-QHP2KP4Q.js +9 -0
- package/dist/review-UWHWQHCB.cjs +9 -0
- package/dist/ripgrep-67SCU2BA.cjs +9 -0
- package/dist/ripgrep-VHJQQ55W.js +9 -0
- package/dist/rpc-XH7QLN4H.js +3874 -0
- package/dist/rpc-YF54T7JU.cjs +3874 -0
- package/dist/search-VXXFGZWU.cjs +21 -0
- package/dist/search-YAWGX7P7.js +21 -0
- package/dist/{sessions-6GWEBMKS.js → sessions-NJYHJOEL.js} +2 -2
- package/dist/sessions-OSG3UJEZ.cjs +10 -0
- package/dist/settings-SO2UIGWV.cjs +42 -0
- package/dist/settings-ZXUQH3DO.js +42 -0
- package/dist/setup-KG7EGKF5.js +30 -0
- package/dist/setup-RSOPCQ57.cjs +30 -0
- package/dist/share-WFAGZ5PY.js +17 -0
- package/dist/share-ZU3SGACF.cjs +17 -0
- package/dist/skills-KBVAQAD2.cjs +29 -0
- package/dist/skills-NBTNDVAY.js +29 -0
- package/dist/{skills-ZZCIAS7C.js → skills-OB6RDW7D.js} +10 -7
- package/dist/{skills-PG542VEB.cjs → skills-ZROBG3RZ.cjs} +13 -10
- package/dist/{skills-install-SRC3Z2MS.js → skills-install-BHTIEMKH.js} +21 -70
- package/dist/{skills-install-67DOBPJC.cjs → skills-install-ILX6QVEF.cjs} +34 -83
- package/dist/skills-new-B45VQ2PP.cjs +18 -0
- package/dist/skills-new-YMRP2HNO.js +18 -0
- package/dist/slashCommands-53VYIBJU.js +105 -0
- package/dist/slashCommands-BG2RGGZ6.cjs +105 -0
- package/dist/status-CQ2IUOVK.cjs +24 -0
- package/dist/status-E7IGNVPC.js +24 -0
- package/dist/summarizer-DGPHE5IQ.js +17 -0
- package/dist/summarizer-JNXLUAQG.cjs +17 -0
- package/dist/sync-7C25MOT2.js +22 -0
- package/dist/{sync-VU2NSJ4O.js → sync-OCJN4ZSO.js} +3 -3
- package/dist/sync-XRP46IVG.cjs +40 -0
- package/dist/sync-ZMFVE7T4.cjs +22 -0
- package/dist/{teammate-SXRVXNQV.cjs → teammate-D77B6QRT.cjs} +31 -9
- package/dist/{teammate-SD26GR37.js → teammate-EZCMHOIL.js} +30 -8
- package/dist/templates-ARG2VRWW.cjs +11 -0
- package/dist/templates-UGVZV3KJ.js +11 -0
- package/dist/theme-KKRDE6P7.cjs +22 -0
- package/dist/theme-XF7XIWBQ.js +22 -0
- package/dist/tools-3PPTTKFV.js +9 -0
- package/dist/tools-THIQA7WC.cjs +9 -0
- package/dist/ui/questionModal.cjs +8 -5
- package/dist/ui/questionModal.js +7 -4
- package/dist/{undo-OL2EDBRY.js → undo-GNUTFXCW.js} +2 -2
- package/dist/undo-U4KN7QQM.cjs +10 -0
- package/dist/usage-QSTNSDAO.js +24 -0
- package/dist/usage-YDEMQBNQ.cjs +24 -0
- package/dist/web-3BA2WV37.cjs +37 -0
- package/dist/web-6FYGBX5K.js +37 -0
- package/dist/workspaceSafety-MDJGHK6D.cjs +9 -0
- package/dist/workspaceSafety-XOUMUBVB.js +9 -0
- package/dist/yolo-GF2YD7ZI.js +9 -0
- package/dist/yolo-OGDA7HNC.cjs +9 -0
- package/dist/yoloMode-3DJDA75U.cjs +17 -0
- package/dist/yoloMode-4JOOSU26.js +17 -0
- package/package.json +51 -49
- package/dist/AgentRegistry-HRPN6ZOF.cjs +0 -10
- package/dist/CommunitySkillsCache-KE435RAR.cjs +0 -8
- package/dist/GitHubRegistryFetcher-I45SESIL.cjs +0 -7
- package/dist/LearnAdvisor-FLBA6FDD.js +0 -9
- package/dist/LearnAdvisor-GG3CXQF3.cjs +0 -9
- package/dist/MemoryManager-2LQPIYVE.cjs +0 -8
- package/dist/PermissionManager-X57BXHJ6.cjs +0 -11
- package/dist/ProviderFactory-KPJOGQWF.cjs +0 -9
- package/dist/SessionManager-YBJAZXNO.cjs +0 -10
- package/dist/SkillsRegistry-7O72A6TZ.cjs +0 -9
- package/dist/SubAgent-JT4HZHN7.js +0 -11
- package/dist/SubAgent-VPNYDWAU.cjs +0 -11
- package/dist/SyncApiClient-HQXJL5BT.cjs +0 -11
- package/dist/about-4DB5KTHW.js +0 -12
- package/dist/about-LXAOXZFT.cjs +0 -12
- package/dist/actionExecutor-23JB2WUC.js +0 -19
- package/dist/actionExecutor-X5UEZSKH.cjs +0 -19
- package/dist/add-dir-YC37DMSF.cjs +0 -10
- package/dist/agents-YF3BSUU5.js +0 -12
- package/dist/agents-ZOUHPMYR.cjs +0 -12
- package/dist/agents-new-HSH4GQPG.js +0 -14
- package/dist/agents-new-VYUDOCE7.cjs +0 -14
- package/dist/autoSkill-X5W52WOE.cjs +0 -20
- package/dist/automode-SJGM7VEI.cjs +0 -10
- package/dist/chunk-ALYU6VTM.js +0 -105
- package/dist/chunk-B53A2NM2.js +0 -2030
- package/dist/chunk-BJXSNT46.js +0 -100
- package/dist/chunk-CB4E2T5N.cjs +0 -312
- package/dist/chunk-DNUOXBHL.js +0 -539
- package/dist/chunk-EFX2QSZX.cjs +0 -33
- package/dist/chunk-GCXYXLRA.cjs +0 -111
- package/dist/chunk-H2ZRHQQV.js +0 -33
- package/dist/chunk-HNRPK5MY.cjs +0 -85
- package/dist/chunk-HVKOZ2VP.cjs +0 -115
- package/dist/chunk-JJLYWH5Y.cjs +0 -100
- package/dist/chunk-LWUJFGOZ.js +0 -115
- package/dist/chunk-MERYP6AM.cjs +0 -539
- package/dist/chunk-MZAPWNAC.cjs +0 -207
- package/dist/chunk-NTSDP2WB.js +0 -226
- package/dist/chunk-OUZQXMHL.cjs +0 -226
- package/dist/chunk-PGESAU2W.cjs +0 -2030
- package/dist/chunk-SYVYLZZF.cjs +0 -24
- package/dist/chunk-SZOLA6FR.js +0 -111
- package/dist/chunk-VWDHR4HV.js +0 -168
- package/dist/chunk-Y45G6ZO5.cjs +0 -168
- package/dist/chunk-YRLYSQEQ.cjs +0 -105
- package/dist/chunk-ZYVS43MU.js +0 -312
- package/dist/clear-GK4IEUUS.cjs +0 -12
- package/dist/communityInstaller-XXC7RLE4.cjs +0 -19
- package/dist/completion-HWABSAEL.js +0 -14
- package/dist/completion-IUUVQG4D.cjs +0 -14
- package/dist/config-HF7WOLZF.cjs +0 -18
- package/dist/constants-PEO3P2SJ.cjs +0 -21
- package/dist/export-QJAV2FCZ.js +0 -12
- package/dist/export-XSRFXGWU.cjs +0 -12
- package/dist/feedback-4TCIL3ML.cjs +0 -15
- package/dist/feedback-SJ6VVEY3.js +0 -15
- package/dist/filesystem-W56QZUJF.cjs +0 -10
- package/dist/help-ISBVQL3S.cjs +0 -12
- package/dist/history-XQ4GTSFU.cjs +0 -14
- package/dist/hooks-CJNKJ5PF.js +0 -13
- package/dist/hooks-UTMBTAXT.cjs +0 -13
- package/dist/i18n-N7QQ7A5M.cjs +0 -33
- package/dist/ide-RTA4UJV4.js +0 -12
- package/dist/ide-VWVOLIFF.cjs +0 -12
- package/dist/immediateCommandRouter-BW34JNXL.js +0 -9
- package/dist/immediateCommandRouter-SHOVNB5X.cjs +0 -9
- package/dist/import-ZLJVONXH.cjs +0 -10
- package/dist/init-TBKAB4LZ.cjs +0 -10
- package/dist/language-MDSHEXHB.cjs +0 -18
- package/dist/language-PXTQSHIG.js +0 -18
- package/dist/learn-623TW5EK.cjs +0 -20
- package/dist/learn-BCPV7GM2.js +0 -20
- package/dist/localProjectPermissions-BHQXEWZJ.cjs +0 -18
- package/dist/localProjectPermissions-GMOUYQM6.js +0 -18
- package/dist/login-QMVEETWJ.js +0 -20
- package/dist/login-QYMXAL3K.cjs +0 -20
- package/dist/logout-2CMTDAOJ.js +0 -18
- package/dist/logout-ZOHVZAUK.cjs +0 -18
- package/dist/mcp-IUVKK65S.js +0 -18
- package/dist/mcp-TXC7PYG3.cjs +0 -18
- package/dist/memory-WRIHDEPK.cjs +0 -10
- package/dist/model-RLP75SF5.cjs +0 -10
- package/dist/new-HLSFL6A4.cjs +0 -12
- package/dist/permissions-GP6FTGZ2.js +0 -13
- package/dist/permissions-O6EKKPOG.cjs +0 -13
- package/dist/plan-MCAXDIM2.cjs +0 -11
- package/dist/quit-TQX6GXA5.cjs +0 -10
- package/dist/repeat-BSPS5TWD.cjs +0 -13
- package/dist/resume-2GOPDLL4.cjs +0 -13
- package/dist/resume-37IUVDA6.js +0 -13
- package/dist/search-7KUSHIBL.cjs +0 -17
- package/dist/search-OJGDRIMA.js +0 -17
- package/dist/sessions-CYYCHSQG.cjs +0 -10
- package/dist/settings-2D7CAO66.cjs +0 -30
- package/dist/settings-BXR6SBJP.js +0 -30
- package/dist/share-BXQY5IQU.js +0 -14
- package/dist/share-OSFXZBGS.cjs +0 -14
- package/dist/skills-FL6O6AOM.cjs +0 -26
- package/dist/skills-PNKQZRNK.js +0 -26
- package/dist/skills-new-XFMEHHIF.cjs +0 -15
- package/dist/skills-new-ZNZPHUKS.js +0 -15
- package/dist/slashCommands-LLCNPK3X.js +0 -76
- package/dist/slashCommands-RXZZS6RE.cjs +0 -76
- package/dist/status-BCECUJXT.cjs +0 -11
- package/dist/status-EFO7MQU3.js +0 -11
- package/dist/sync-IJYJ6KKM.js +0 -18
- package/dist/sync-LFT6SBPF.cjs +0 -18
- package/dist/sync-U7SDPBNZ.cjs +0 -40
- package/dist/theme-AWBHSG7J.cjs +0 -18
- package/dist/theme-TQLBPJ2E.js +0 -18
- package/dist/undo-IBBGP7A2.cjs +0 -10
|
@@ -0,0 +1,2340 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; }
|
|
2
|
+
|
|
3
|
+
var _chunkWTB7AFL6cjs = require('./chunk-WTB7AFL6.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunkHC2Q6A3Ecjs = require('./chunk-HC2Q6A3E.cjs');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunkCO2AADYUcjs = require('./chunk-CO2AADYU.cjs');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var _chunkSD3NTC7Dcjs = require('./chunk-SD3NTC7D.cjs');
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _chunkCK4HAHVYcjs = require('./chunk-CK4HAHVY.cjs');
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
var _chunkX5P6QQOBcjs = require('./chunk-X5P6QQOB.cjs');
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var _chunkYWTIXHU6cjs = require('./chunk-YWTIXHU6.cjs');
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var _chunkKASXKDF2cjs = require('./chunk-KASXKDF2.cjs');
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
var _chunkWGNMOVMTcjs = require('./chunk-WGNMOVMT.cjs');
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
var _chunkSY2P3Z5Wcjs = require('./chunk-SY2P3Z5W.cjs');
|
|
57
|
+
|
|
58
|
+
// src/onboarding/projectAnalyzer.ts
|
|
59
|
+
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
60
|
+
var _path = require('path');
|
|
61
|
+
var ProjectAnalyzer = class {
|
|
62
|
+
constructor(workspaceRoot) {
|
|
63
|
+
this.workspaceRoot = workspaceRoot;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Analyze the workspace and return project information
|
|
68
|
+
*/
|
|
69
|
+
async analyze() {
|
|
70
|
+
const info = {};
|
|
71
|
+
await this.analyzeNodeProject(info);
|
|
72
|
+
await this.analyzeRustProject(info);
|
|
73
|
+
await this.analyzeGoProject(info);
|
|
74
|
+
await this.analyzePythonProject(info);
|
|
75
|
+
return info;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Analyze Node.js/JavaScript/TypeScript project
|
|
79
|
+
*/
|
|
80
|
+
async analyzeNodeProject(info) {
|
|
81
|
+
const pkgPath = _path.join.call(void 0, this.workspaceRoot, "package.json");
|
|
82
|
+
if (!await _fsextra2.default.pathExists(pkgPath)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const pkg = await _fsextra2.default.readJson(pkgPath);
|
|
87
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
88
|
+
if (deps.typescript || _optionalChain([pkg, 'access', _ => _.devDependencies, 'optionalAccess', _2 => _2.typescript])) {
|
|
89
|
+
info.language = "TypeScript";
|
|
90
|
+
} else {
|
|
91
|
+
info.language = "JavaScript";
|
|
92
|
+
}
|
|
93
|
+
info.framework = this.detectNodeFramework(deps);
|
|
94
|
+
info.packageManager = await this.detectNodePackageManager();
|
|
95
|
+
info.testFramework = this.detectNodeTestFramework(deps);
|
|
96
|
+
info.linter = this.detectNodeLinter(deps);
|
|
97
|
+
info.formatter = this.detectNodeFormatter(deps);
|
|
98
|
+
info.buildTool = this.detectNodeBuildTool(deps);
|
|
99
|
+
} catch (e2) {
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Detect Node.js framework from dependencies
|
|
104
|
+
*/
|
|
105
|
+
detectNodeFramework(deps) {
|
|
106
|
+
if (deps.next) return "Next.js";
|
|
107
|
+
if (deps.nuxt) return "Nuxt";
|
|
108
|
+
if (deps["@remix-run/node"] || deps["@remix-run/react"]) return "Remix";
|
|
109
|
+
if (deps["@angular/core"]) return "Angular";
|
|
110
|
+
if (deps.svelte) return "Svelte";
|
|
111
|
+
if (deps.vue) return "Vue";
|
|
112
|
+
if (deps.react) return "React";
|
|
113
|
+
if (deps.solid) return "Solid";
|
|
114
|
+
if (deps["@nestjs/core"]) return "NestJS";
|
|
115
|
+
if (deps.fastify) return "Fastify";
|
|
116
|
+
if (deps.hono) return "Hono";
|
|
117
|
+
if (deps.koa) return "Koa";
|
|
118
|
+
if (deps.express) return "Express";
|
|
119
|
+
return void 0;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Detect Node.js package manager from lockfiles
|
|
123
|
+
*/
|
|
124
|
+
async detectNodePackageManager() {
|
|
125
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "bun.lockb")) || await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "bun.lock"))) {
|
|
126
|
+
return "bun";
|
|
127
|
+
}
|
|
128
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "pnpm-lock.yaml"))) {
|
|
129
|
+
return "pnpm";
|
|
130
|
+
}
|
|
131
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "yarn.lock"))) {
|
|
132
|
+
return "yarn";
|
|
133
|
+
}
|
|
134
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "package-lock.json"))) {
|
|
135
|
+
return "npm";
|
|
136
|
+
}
|
|
137
|
+
return "npm";
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Detect Node.js test framework
|
|
141
|
+
*/
|
|
142
|
+
detectNodeTestFramework(deps) {
|
|
143
|
+
if (deps.vitest) return "Vitest";
|
|
144
|
+
if (deps.jest) return "Jest";
|
|
145
|
+
if (deps.mocha) return "Mocha";
|
|
146
|
+
if (deps.ava) return "AVA";
|
|
147
|
+
if (deps["@playwright/test"]) return "Playwright";
|
|
148
|
+
if (deps.cypress) return "Cypress";
|
|
149
|
+
if (deps.puppeteer) return "Puppeteer";
|
|
150
|
+
return void 0;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Detect Node.js linter
|
|
154
|
+
*/
|
|
155
|
+
detectNodeLinter(deps) {
|
|
156
|
+
if (deps["@biomejs/biome"]) return "Biome";
|
|
157
|
+
if (deps.eslint) return "ESLint";
|
|
158
|
+
if (deps.oxlint) return "Oxlint";
|
|
159
|
+
return void 0;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Detect Node.js formatter
|
|
163
|
+
*/
|
|
164
|
+
detectNodeFormatter(deps) {
|
|
165
|
+
if (deps.prettier) return "Prettier";
|
|
166
|
+
if (deps["@biomejs/biome"]) return "Biome";
|
|
167
|
+
if (deps.dprint) return "dprint";
|
|
168
|
+
return void 0;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Detect Node.js build tool
|
|
172
|
+
*/
|
|
173
|
+
detectNodeBuildTool(deps) {
|
|
174
|
+
if (deps.vite) return "Vite";
|
|
175
|
+
if (deps.tsup) return "tsup";
|
|
176
|
+
if (deps.esbuild) return "esbuild";
|
|
177
|
+
if (deps.rollup) return "Rollup";
|
|
178
|
+
if (deps.webpack) return "Webpack";
|
|
179
|
+
if (deps.parcel) return "Parcel";
|
|
180
|
+
if (deps.turbopack || deps.turbo) return "Turbopack";
|
|
181
|
+
return void 0;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Analyze Rust project
|
|
185
|
+
*/
|
|
186
|
+
async analyzeRustProject(info) {
|
|
187
|
+
const cargoPath = _path.join.call(void 0, this.workspaceRoot, "Cargo.toml");
|
|
188
|
+
if (!await _fsextra2.default.pathExists(cargoPath)) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
info.language = "Rust";
|
|
192
|
+
info.packageManager = "cargo";
|
|
193
|
+
try {
|
|
194
|
+
const cargoContent = await _fsextra2.default.readFile(cargoPath, "utf-8");
|
|
195
|
+
if (cargoContent.includes("actix-web")) {
|
|
196
|
+
info.framework = "Actix";
|
|
197
|
+
} else if (cargoContent.includes("axum")) {
|
|
198
|
+
info.framework = "Axum";
|
|
199
|
+
} else if (cargoContent.includes("rocket")) {
|
|
200
|
+
info.framework = "Rocket";
|
|
201
|
+
} else if (cargoContent.includes("warp")) {
|
|
202
|
+
info.framework = "Warp";
|
|
203
|
+
} else if (cargoContent.includes("tauri")) {
|
|
204
|
+
info.framework = "Tauri";
|
|
205
|
+
}
|
|
206
|
+
} catch (e3) {
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Analyze Go project
|
|
211
|
+
*/
|
|
212
|
+
async analyzeGoProject(info) {
|
|
213
|
+
const goModPath = _path.join.call(void 0, this.workspaceRoot, "go.mod");
|
|
214
|
+
if (!await _fsextra2.default.pathExists(goModPath)) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
info.language = "Go";
|
|
218
|
+
info.packageManager = "go";
|
|
219
|
+
try {
|
|
220
|
+
const goModContent = await _fsextra2.default.readFile(goModPath, "utf-8");
|
|
221
|
+
if (goModContent.includes("github.com/gin-gonic/gin")) {
|
|
222
|
+
info.framework = "Gin";
|
|
223
|
+
} else if (goModContent.includes("github.com/gofiber/fiber")) {
|
|
224
|
+
info.framework = "Fiber";
|
|
225
|
+
} else if (goModContent.includes("github.com/labstack/echo")) {
|
|
226
|
+
info.framework = "Echo";
|
|
227
|
+
} else if (goModContent.includes("github.com/gorilla/mux")) {
|
|
228
|
+
info.framework = "Gorilla";
|
|
229
|
+
}
|
|
230
|
+
} catch (e4) {
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Analyze Python project
|
|
235
|
+
*/
|
|
236
|
+
async analyzePythonProject(info) {
|
|
237
|
+
const pyprojectPath = _path.join.call(void 0, this.workspaceRoot, "pyproject.toml");
|
|
238
|
+
const requirementsPath = _path.join.call(void 0, this.workspaceRoot, "requirements.txt");
|
|
239
|
+
const poetryLockPath = _path.join.call(void 0, this.workspaceRoot, "poetry.lock");
|
|
240
|
+
const pipfilePath = _path.join.call(void 0, this.workspaceRoot, "Pipfile");
|
|
241
|
+
const hasPyproject = await _fsextra2.default.pathExists(pyprojectPath);
|
|
242
|
+
const hasRequirements = await _fsextra2.default.pathExists(requirementsPath);
|
|
243
|
+
if (!hasPyproject && !hasRequirements) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
info.language = "Python";
|
|
247
|
+
if (await _fsextra2.default.pathExists(poetryLockPath)) {
|
|
248
|
+
info.packageManager = "poetry";
|
|
249
|
+
} else if (await _fsextra2.default.pathExists(pipfilePath)) {
|
|
250
|
+
info.packageManager = "pipenv";
|
|
251
|
+
} else if (hasPyproject) {
|
|
252
|
+
info.packageManager = "pip";
|
|
253
|
+
} else {
|
|
254
|
+
info.packageManager = "pip";
|
|
255
|
+
}
|
|
256
|
+
let depsContent = "";
|
|
257
|
+
try {
|
|
258
|
+
if (hasRequirements) {
|
|
259
|
+
depsContent = await _fsextra2.default.readFile(requirementsPath, "utf-8");
|
|
260
|
+
} else if (hasPyproject) {
|
|
261
|
+
depsContent = await _fsextra2.default.readFile(pyprojectPath, "utf-8");
|
|
262
|
+
}
|
|
263
|
+
if (depsContent.includes("django")) {
|
|
264
|
+
info.framework = "Django";
|
|
265
|
+
} else if (depsContent.includes("fastapi")) {
|
|
266
|
+
info.framework = "FastAPI";
|
|
267
|
+
} else if (depsContent.includes("flask")) {
|
|
268
|
+
info.framework = "Flask";
|
|
269
|
+
} else if (depsContent.includes("starlette")) {
|
|
270
|
+
info.framework = "Starlette";
|
|
271
|
+
} else if (depsContent.includes("tornado")) {
|
|
272
|
+
info.framework = "Tornado";
|
|
273
|
+
}
|
|
274
|
+
if (depsContent.includes("pytest")) {
|
|
275
|
+
info.testFramework = "pytest";
|
|
276
|
+
} else if (depsContent.includes("unittest")) {
|
|
277
|
+
info.testFramework = "unittest";
|
|
278
|
+
} else if (depsContent.includes("nose")) {
|
|
279
|
+
info.testFramework = "nose";
|
|
280
|
+
}
|
|
281
|
+
if (depsContent.includes("ruff")) {
|
|
282
|
+
info.linter = "Ruff";
|
|
283
|
+
} else if (depsContent.includes("flake8")) {
|
|
284
|
+
info.linter = "Flake8";
|
|
285
|
+
} else if (depsContent.includes("pylint")) {
|
|
286
|
+
info.linter = "Pylint";
|
|
287
|
+
}
|
|
288
|
+
if (depsContent.includes("black")) {
|
|
289
|
+
info.formatter = "Black";
|
|
290
|
+
} else if (depsContent.includes("ruff")) {
|
|
291
|
+
info.formatter = "Ruff";
|
|
292
|
+
} else if (depsContent.includes("autopep8")) {
|
|
293
|
+
info.formatter = "autopep8";
|
|
294
|
+
}
|
|
295
|
+
} catch (e5) {
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
// src/onboarding/agentsGenerator.ts
|
|
301
|
+
var AgentsGenerator = class {
|
|
302
|
+
/**
|
|
303
|
+
* Generate AGENTS.md content
|
|
304
|
+
*/
|
|
305
|
+
generateContent(info, options) {
|
|
306
|
+
const sections = [];
|
|
307
|
+
sections.push("# AGENTS.md");
|
|
308
|
+
sections.push("");
|
|
309
|
+
sections.push("This file helps Autohand understand how to work with this project.");
|
|
310
|
+
sections.push("");
|
|
311
|
+
sections.push(this.generateProjectOverview(info));
|
|
312
|
+
if (info.packageManager) {
|
|
313
|
+
sections.push(this.generateCommandsSection(info));
|
|
314
|
+
}
|
|
315
|
+
if (info.testFramework) {
|
|
316
|
+
sections.push(this.generateTestingSection(info));
|
|
317
|
+
}
|
|
318
|
+
if (info.framework) {
|
|
319
|
+
const frameworkSection = this.generateFrameworkSection(info);
|
|
320
|
+
if (frameworkSection) {
|
|
321
|
+
sections.push(frameworkSection);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
sections.push(this.generateCodeStyleSection(info));
|
|
325
|
+
sections.push(this.generateConstraintsSection());
|
|
326
|
+
if (_optionalChain([options, 'optionalAccess', _3 => _3.customSections])) {
|
|
327
|
+
for (const section of options.customSections) {
|
|
328
|
+
sections.push(`## ${section.title}`);
|
|
329
|
+
sections.push("");
|
|
330
|
+
sections.push(section.content);
|
|
331
|
+
sections.push("");
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return sections.join("\n");
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Generate project overview section
|
|
338
|
+
*/
|
|
339
|
+
generateProjectOverview(info) {
|
|
340
|
+
const lines = [];
|
|
341
|
+
lines.push("## Project Overview");
|
|
342
|
+
lines.push("");
|
|
343
|
+
if (info.language) {
|
|
344
|
+
lines.push(`- **Language**: ${info.language}`);
|
|
345
|
+
}
|
|
346
|
+
if (info.framework) {
|
|
347
|
+
lines.push(`- **Framework**: ${info.framework}`);
|
|
348
|
+
}
|
|
349
|
+
if (info.packageManager) {
|
|
350
|
+
lines.push(`- **Package Manager**: ${info.packageManager}`);
|
|
351
|
+
}
|
|
352
|
+
if (info.testFramework) {
|
|
353
|
+
lines.push(`- **Test Framework**: ${info.testFramework}`);
|
|
354
|
+
}
|
|
355
|
+
if (info.buildTool) {
|
|
356
|
+
lines.push(`- **Build Tool**: ${info.buildTool}`);
|
|
357
|
+
}
|
|
358
|
+
lines.push("");
|
|
359
|
+
return lines.join("\n");
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Generate commands section based on package manager
|
|
363
|
+
*/
|
|
364
|
+
generateCommandsSection(info) {
|
|
365
|
+
const lines = [];
|
|
366
|
+
lines.push("## Commands");
|
|
367
|
+
lines.push("");
|
|
368
|
+
const pm = info.packageManager;
|
|
369
|
+
if (info.language === "Rust") {
|
|
370
|
+
lines.push("- **Build**: `cargo build`");
|
|
371
|
+
lines.push("- **Build (release)**: `cargo build --release`");
|
|
372
|
+
lines.push("- **Run**: `cargo run`");
|
|
373
|
+
lines.push("- **Test**: `cargo test`");
|
|
374
|
+
lines.push("- **Check**: `cargo check`");
|
|
375
|
+
lines.push("- **Format**: `cargo fmt`");
|
|
376
|
+
lines.push("- **Lint**: `cargo clippy`");
|
|
377
|
+
} else if (info.language === "Go") {
|
|
378
|
+
lines.push("- **Build**: `go build`");
|
|
379
|
+
lines.push("- **Run**: `go run .`");
|
|
380
|
+
lines.push("- **Test**: `go test ./...`");
|
|
381
|
+
lines.push("- **Format**: `go fmt ./...`");
|
|
382
|
+
lines.push("- **Vet**: `go vet ./...`");
|
|
383
|
+
} else if (info.language === "Python") {
|
|
384
|
+
if (pm === "poetry") {
|
|
385
|
+
lines.push("- **Install**: `poetry install`");
|
|
386
|
+
lines.push("- **Run**: `poetry run python main.py`");
|
|
387
|
+
lines.push("- **Add dependency**: `poetry add <package>`");
|
|
388
|
+
if (info.testFramework) {
|
|
389
|
+
lines.push(`- **Test**: \`poetry run pytest\``);
|
|
390
|
+
}
|
|
391
|
+
} else if (pm === "pipenv") {
|
|
392
|
+
lines.push("- **Install**: `pipenv install`");
|
|
393
|
+
lines.push("- **Run**: `pipenv run python main.py`");
|
|
394
|
+
if (info.testFramework) {
|
|
395
|
+
lines.push(`- **Test**: \`pipenv run pytest\``);
|
|
396
|
+
}
|
|
397
|
+
} else {
|
|
398
|
+
lines.push("- **Install**: `pip install -r requirements.txt`");
|
|
399
|
+
lines.push("- **Run**: `python main.py`");
|
|
400
|
+
if (info.testFramework) {
|
|
401
|
+
lines.push(`- **Test**: \`pytest\``);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
} else {
|
|
405
|
+
const run = pm === "npm" ? "npm run" : pm;
|
|
406
|
+
const install = pm === "npm" ? "npm install" : `${pm} install`;
|
|
407
|
+
lines.push(`- **Install**: \`${install}\``);
|
|
408
|
+
lines.push(`- **Dev**: \`${run} dev\``);
|
|
409
|
+
lines.push(`- **Build**: \`${run} build\``);
|
|
410
|
+
if (info.testFramework) {
|
|
411
|
+
lines.push(`- **Test**: \`${run} test\``);
|
|
412
|
+
}
|
|
413
|
+
if (info.linter) {
|
|
414
|
+
lines.push(`- **Lint**: \`${run} lint\``);
|
|
415
|
+
}
|
|
416
|
+
if (info.formatter) {
|
|
417
|
+
lines.push(`- **Format**: \`${run} format\``);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
lines.push("");
|
|
421
|
+
return lines.join("\n");
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Generate testing section
|
|
425
|
+
*/
|
|
426
|
+
generateTestingSection(info) {
|
|
427
|
+
const lines = [];
|
|
428
|
+
lines.push("## Testing");
|
|
429
|
+
lines.push("");
|
|
430
|
+
lines.push(`This project uses **${info.testFramework}** for testing.`);
|
|
431
|
+
lines.push("");
|
|
432
|
+
lines.push("- Write tests for new features before implementation");
|
|
433
|
+
lines.push("- Run tests before committing changes");
|
|
434
|
+
lines.push("- Aim for good test coverage on critical paths");
|
|
435
|
+
if (info.testFramework === "Vitest" || info.testFramework === "Jest") {
|
|
436
|
+
lines.push("- Use `describe` and `it` blocks to organize tests");
|
|
437
|
+
lines.push("- Mock external dependencies when appropriate");
|
|
438
|
+
} else if (info.testFramework === "pytest") {
|
|
439
|
+
lines.push("- Use fixtures for shared test setup");
|
|
440
|
+
lines.push("- Use `pytest.mark` for test categorization");
|
|
441
|
+
} else if (info.testFramework === "Playwright" || info.testFramework === "Cypress") {
|
|
442
|
+
lines.push("- Write E2E tests for critical user flows");
|
|
443
|
+
lines.push("- Keep selectors stable and meaningful");
|
|
444
|
+
}
|
|
445
|
+
lines.push("");
|
|
446
|
+
return lines.join("\n");
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Generate framework-specific section
|
|
450
|
+
*/
|
|
451
|
+
generateFrameworkSection(info) {
|
|
452
|
+
const lines = [];
|
|
453
|
+
switch (info.framework) {
|
|
454
|
+
case "Next.js":
|
|
455
|
+
lines.push("## Next.js Guidelines");
|
|
456
|
+
lines.push("");
|
|
457
|
+
lines.push("- Use the App Router for new pages (`app/` directory)");
|
|
458
|
+
lines.push("- Prefer Server Components by default");
|
|
459
|
+
lines.push('- Use `"use client"` only when needed for interactivity');
|
|
460
|
+
lines.push("- Keep API routes in `app/api/`");
|
|
461
|
+
lines.push("- Use `next/image` for optimized images");
|
|
462
|
+
lines.push("- Use `next/link` for client-side navigation");
|
|
463
|
+
break;
|
|
464
|
+
case "React":
|
|
465
|
+
lines.push("## React Guidelines");
|
|
466
|
+
lines.push("");
|
|
467
|
+
lines.push("- Use functional components with hooks");
|
|
468
|
+
lines.push("- Keep components small and focused");
|
|
469
|
+
lines.push("- Use custom hooks to share logic");
|
|
470
|
+
lines.push("- Prefer composition over inheritance");
|
|
471
|
+
lines.push("- Use TypeScript interfaces for props");
|
|
472
|
+
break;
|
|
473
|
+
case "Vue":
|
|
474
|
+
lines.push("## Vue Guidelines");
|
|
475
|
+
lines.push("");
|
|
476
|
+
lines.push("- Use Composition API for new components");
|
|
477
|
+
lines.push("- Keep components in single-file format (.vue)");
|
|
478
|
+
lines.push("- Use composables to share logic");
|
|
479
|
+
break;
|
|
480
|
+
case "Express":
|
|
481
|
+
lines.push("## Express Guidelines");
|
|
482
|
+
lines.push("");
|
|
483
|
+
lines.push("- Use middleware for cross-cutting concerns");
|
|
484
|
+
lines.push("- Keep route handlers thin, delegate to services");
|
|
485
|
+
lines.push("- Use async/await with proper error handling");
|
|
486
|
+
lines.push("- Validate request input before processing");
|
|
487
|
+
break;
|
|
488
|
+
case "FastAPI":
|
|
489
|
+
lines.push("## FastAPI Guidelines");
|
|
490
|
+
lines.push("");
|
|
491
|
+
lines.push("- Use Pydantic models for request/response validation");
|
|
492
|
+
lines.push("- Use dependency injection for shared resources");
|
|
493
|
+
lines.push("- Keep endpoints in organized routers");
|
|
494
|
+
lines.push("- Use async functions for I/O operations");
|
|
495
|
+
break;
|
|
496
|
+
case "Django":
|
|
497
|
+
lines.push("## Django Guidelines");
|
|
498
|
+
lines.push("");
|
|
499
|
+
lines.push("- Follow Django project structure conventions");
|
|
500
|
+
lines.push("- Use class-based views where appropriate");
|
|
501
|
+
lines.push("- Keep business logic in models or services");
|
|
502
|
+
lines.push("- Use Django ORM for database operations");
|
|
503
|
+
break;
|
|
504
|
+
case "Flask":
|
|
505
|
+
lines.push("## Flask Guidelines");
|
|
506
|
+
lines.push("");
|
|
507
|
+
lines.push("- Use blueprints to organize routes");
|
|
508
|
+
lines.push("- Keep route handlers focused");
|
|
509
|
+
lines.push("- Use Flask extensions for common functionality");
|
|
510
|
+
break;
|
|
511
|
+
case "NestJS":
|
|
512
|
+
lines.push("## NestJS Guidelines");
|
|
513
|
+
lines.push("");
|
|
514
|
+
lines.push("- Follow module-based architecture");
|
|
515
|
+
lines.push("- Use dependency injection");
|
|
516
|
+
lines.push("- Use decorators for metadata");
|
|
517
|
+
lines.push("- Keep controllers thin, services fat");
|
|
518
|
+
break;
|
|
519
|
+
default:
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
lines.push("");
|
|
523
|
+
return lines.join("\n");
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Generate code style section
|
|
527
|
+
*/
|
|
528
|
+
generateCodeStyleSection(info) {
|
|
529
|
+
const lines = [];
|
|
530
|
+
lines.push("## Code Style");
|
|
531
|
+
lines.push("");
|
|
532
|
+
if (info.language === "TypeScript") {
|
|
533
|
+
lines.push("- Use strict TypeScript settings");
|
|
534
|
+
lines.push("- Define types/interfaces for data structures");
|
|
535
|
+
lines.push("- Avoid `any` type - use `unknown` if type is truly unknown");
|
|
536
|
+
lines.push("- Use type inference where obvious");
|
|
537
|
+
} else if (info.language === "Python") {
|
|
538
|
+
lines.push("- Follow PEP 8 style guidelines");
|
|
539
|
+
lines.push("- Use type hints for function signatures");
|
|
540
|
+
lines.push("- Use docstrings for public functions");
|
|
541
|
+
} else if (info.language === "Rust") {
|
|
542
|
+
lines.push("- Follow Rust naming conventions (snake_case for functions)");
|
|
543
|
+
lines.push("- Use descriptive error types");
|
|
544
|
+
lines.push("- Prefer `Result` over panicking");
|
|
545
|
+
} else if (info.language === "Go") {
|
|
546
|
+
lines.push("- Follow Go idioms and conventions");
|
|
547
|
+
lines.push("- Use short variable names in small scopes");
|
|
548
|
+
lines.push("- Handle errors explicitly");
|
|
549
|
+
}
|
|
550
|
+
lines.push("- Follow existing patterns in the codebase");
|
|
551
|
+
lines.push("- Use meaningful variable and function names");
|
|
552
|
+
lines.push("- Add comments for complex logic");
|
|
553
|
+
lines.push("- Keep functions focused and small");
|
|
554
|
+
if (info.linter) {
|
|
555
|
+
lines.push(`- Run **${info.linter}** before committing`);
|
|
556
|
+
}
|
|
557
|
+
if (info.formatter) {
|
|
558
|
+
lines.push(`- Format code with **${info.formatter}**`);
|
|
559
|
+
}
|
|
560
|
+
lines.push("");
|
|
561
|
+
return lines.join("\n");
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Generate constraints section
|
|
565
|
+
*/
|
|
566
|
+
generateConstraintsSection() {
|
|
567
|
+
const lines = [];
|
|
568
|
+
lines.push("## Constraints");
|
|
569
|
+
lines.push("");
|
|
570
|
+
lines.push("- Do not modify files outside the project directory");
|
|
571
|
+
lines.push("- Ask before making breaking changes");
|
|
572
|
+
lines.push("- Prefer editing existing files over creating new ones");
|
|
573
|
+
lines.push("- Do not delete files without confirmation");
|
|
574
|
+
lines.push("- Keep dependencies minimal - avoid adding new ones without good reason");
|
|
575
|
+
lines.push("- Do not commit sensitive data (API keys, secrets, credentials)");
|
|
576
|
+
lines.push("");
|
|
577
|
+
return lines.join("\n");
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
// src/onboarding/setupWizard.ts
|
|
582
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
// src/providers/llamaCppSetup.ts
|
|
587
|
+
function looksLikeLlamaCppProcess(commandLine, name = "") {
|
|
588
|
+
const haystack = `${name} ${commandLine}`.toLowerCase();
|
|
589
|
+
return haystack.includes("llama-server") || haystack.includes("llama.cpp");
|
|
590
|
+
}
|
|
591
|
+
function extractLlamaCppPort(commandLine) {
|
|
592
|
+
const match = commandLine.match(/(?:--port(?:=|\s+)|-p\s*)(\d{2,5})\b/i);
|
|
593
|
+
if (!match) return void 0;
|
|
594
|
+
const port = Number.parseInt(match[1], 10);
|
|
595
|
+
return Number.isFinite(port) ? port : void 0;
|
|
596
|
+
}
|
|
597
|
+
async function commandExists(command, cwd) {
|
|
598
|
+
const lookup = process.platform === "win32" ? { command: "where", args: [command] } : { command: "which", args: [command] };
|
|
599
|
+
try {
|
|
600
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0, lookup.command, lookup.args, cwd, { timeout: 5e3 });
|
|
601
|
+
return result.code === 0;
|
|
602
|
+
} catch (e6) {
|
|
603
|
+
try {
|
|
604
|
+
const fallback = await _chunkWTB7AFL6cjs.runCommand.call(void 0, command, ["--version"], cwd, { timeout: 5e3 });
|
|
605
|
+
return fallback.code === 0;
|
|
606
|
+
} catch (e7) {
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
function parseUnixProcesses(stdout) {
|
|
612
|
+
return stdout.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => {
|
|
613
|
+
const match = line.match(/^\d+\s+(.*)$/);
|
|
614
|
+
const commandLine = _nullishCoalesce(_optionalChain([match, 'optionalAccess', _4 => _4[1]]), () => ( line));
|
|
615
|
+
const name = _nullishCoalesce(commandLine.split(/\s+/)[0], () => ( ""));
|
|
616
|
+
return { name, commandLine };
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
function parseWindowsProcesses(stdout) {
|
|
620
|
+
const trimmed = stdout.trim();
|
|
621
|
+
if (!trimmed) return [];
|
|
622
|
+
try {
|
|
623
|
+
const parsed = JSON.parse(trimmed);
|
|
624
|
+
const items = Array.isArray(parsed) ? parsed : [parsed];
|
|
625
|
+
return items.map((item) => ({
|
|
626
|
+
name: _nullishCoalesce(item.Name, () => ( "")),
|
|
627
|
+
commandLine: _nullishCoalesce(item.CommandLine, () => ( ""))
|
|
628
|
+
}));
|
|
629
|
+
} catch (e8) {
|
|
630
|
+
return [];
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
async function listProcesses(cwd) {
|
|
634
|
+
if (process.platform === "win32") {
|
|
635
|
+
try {
|
|
636
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0,
|
|
637
|
+
"powershell",
|
|
638
|
+
[
|
|
639
|
+
"-NoProfile",
|
|
640
|
+
"-Command",
|
|
641
|
+
"Get-CimInstance Win32_Process | Select-Object Name,CommandLine | ConvertTo-Json -Compress"
|
|
642
|
+
],
|
|
643
|
+
cwd,
|
|
644
|
+
{ timeout: 8e3 }
|
|
645
|
+
);
|
|
646
|
+
return result.code === 0 ? parseWindowsProcesses(result.stdout) : [];
|
|
647
|
+
} catch (e9) {
|
|
648
|
+
return [];
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
try {
|
|
652
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0, "ps", ["-ax", "-o", "pid=,command="], cwd, { timeout: 5e3 });
|
|
653
|
+
return result.code === 0 ? parseUnixProcesses(result.stdout) : [];
|
|
654
|
+
} catch (e10) {
|
|
655
|
+
return [];
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
async function detectInstallPlan(cwd) {
|
|
659
|
+
if (process.platform === "win32") {
|
|
660
|
+
if (await commandExists("winget", cwd)) {
|
|
661
|
+
return { command: "winget", args: ["install", "llama.cpp"], label: "winget install llama.cpp" };
|
|
662
|
+
}
|
|
663
|
+
return void 0;
|
|
664
|
+
}
|
|
665
|
+
if (await commandExists("brew", cwd)) {
|
|
666
|
+
return { command: "brew", args: ["install", "llama.cpp"], label: "brew install llama.cpp" };
|
|
667
|
+
}
|
|
668
|
+
if (await commandExists("nix", cwd)) {
|
|
669
|
+
return { command: "nix", args: ["profile", "install", "nixpkgs#llama-cpp"], label: "nix profile install nixpkgs#llama-cpp" };
|
|
670
|
+
}
|
|
671
|
+
return void 0;
|
|
672
|
+
}
|
|
673
|
+
async function probeLlamaCppPorts(candidatePorts) {
|
|
674
|
+
for (const port of candidatePorts) {
|
|
675
|
+
try {
|
|
676
|
+
const response = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(3e3) });
|
|
677
|
+
if (response.ok) {
|
|
678
|
+
return {
|
|
679
|
+
port,
|
|
680
|
+
baseUrl: `http://127.0.0.1:${port}`
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
} catch (e11) {
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return {};
|
|
687
|
+
}
|
|
688
|
+
async function probeLlamaCppEnvironment(cwd) {
|
|
689
|
+
const processes = await listProcesses(cwd);
|
|
690
|
+
const llamaProcess = processes.find((proc) => looksLikeLlamaCppProcess(proc.commandLine, proc.name));
|
|
691
|
+
const installed = await commandExists("llama-server", cwd) || Boolean(llamaProcess);
|
|
692
|
+
const installPlan = installed ? void 0 : await detectInstallPlan(cwd);
|
|
693
|
+
const detectedPort = llamaProcess ? extractLlamaCppPort(llamaProcess.commandLine) : void 0;
|
|
694
|
+
const candidatePorts = [...new Set([detectedPort, 80, 8080].filter((port) => typeof port === "number"))];
|
|
695
|
+
const probe = await probeLlamaCppPorts(candidatePorts);
|
|
696
|
+
return {
|
|
697
|
+
installed,
|
|
698
|
+
running: Boolean(probe.baseUrl),
|
|
699
|
+
port: _nullishCoalesce(probe.port, () => ( detectedPort)),
|
|
700
|
+
baseUrl: probe.baseUrl,
|
|
701
|
+
installPlan
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
async function installLlamaCpp(plan, cwd) {
|
|
705
|
+
try {
|
|
706
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0, plan.command, plan.args, cwd, { timeout: 10 * 60 * 1e3 });
|
|
707
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
|
|
708
|
+
return {
|
|
709
|
+
ok: result.code === 0,
|
|
710
|
+
output
|
|
711
|
+
};
|
|
712
|
+
} catch (error) {
|
|
713
|
+
return {
|
|
714
|
+
ok: false,
|
|
715
|
+
output: error instanceof Error ? error.message : String(error)
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
// src/onboarding/setupWizard.ts
|
|
721
|
+
var SetupWizard = class {
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
constructor(workspaceRoot, existingConfig) {
|
|
726
|
+
this.workspaceRoot = workspaceRoot;
|
|
727
|
+
this.existingConfig = _nullishCoalesce(existingConfig, () => ( null));
|
|
728
|
+
this.state = {
|
|
729
|
+
currentStep: "welcome",
|
|
730
|
+
skipped: [],
|
|
731
|
+
completed: false
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Run the full onboarding wizard
|
|
736
|
+
*/
|
|
737
|
+
async run(options) {
|
|
738
|
+
if (!_optionalChain([options, 'optionalAccess', _5 => _5.force]) && this.isAlreadyConfigured()) {
|
|
739
|
+
return {
|
|
740
|
+
success: true,
|
|
741
|
+
config: {},
|
|
742
|
+
skippedSteps: ["welcome", "language", "workspaceSafety", "provider", "apiKey", "model", "permissions", "telemetry", "preferences", "advanced", "agentsFile", "registration", "reviewSummary"],
|
|
743
|
+
cancelled: false
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
try {
|
|
747
|
+
if (!_optionalChain([options, 'optionalAccess', _6 => _6.skipWelcome])) {
|
|
748
|
+
await this.showWelcome();
|
|
749
|
+
}
|
|
750
|
+
await this.promptLanguage();
|
|
751
|
+
const safeWorkspace = await this.checkWorkspaceStep();
|
|
752
|
+
if (!safeWorkspace) return this.cancelled();
|
|
753
|
+
const provider = await this.promptProvider();
|
|
754
|
+
if (!provider) return this.cancelled();
|
|
755
|
+
if (provider === "azure") {
|
|
756
|
+
const azureResult = await this.promptAzureConfig();
|
|
757
|
+
if (!azureResult) return this.cancelled();
|
|
758
|
+
} else if (provider === "vertexai") {
|
|
759
|
+
const vertexaiResult = await this.promptVertexAIConfig();
|
|
760
|
+
if (!vertexaiResult) return this.cancelled();
|
|
761
|
+
} else if (provider === "bedrock") {
|
|
762
|
+
const bedrockResult = await this.promptBedrockConfig();
|
|
763
|
+
if (!bedrockResult) return this.cancelled();
|
|
764
|
+
} else {
|
|
765
|
+
if (provider === "llamacpp") {
|
|
766
|
+
const ready = await this.prepareLlamaCpp();
|
|
767
|
+
if (!ready) return this.cancelled();
|
|
768
|
+
}
|
|
769
|
+
if (provider === "openai") {
|
|
770
|
+
const authMode = await this.promptOpenAIAuthMode();
|
|
771
|
+
if (!authMode) return this.cancelled();
|
|
772
|
+
this.state.openAIAuthMode = authMode;
|
|
773
|
+
if (authMode === "chatgpt") {
|
|
774
|
+
const chatgptAuth = await this.promptOpenAIChatGPTAuth();
|
|
775
|
+
if (!chatgptAuth) return this.cancelled();
|
|
776
|
+
this.state.openAIChatGPTAuth = chatgptAuth;
|
|
777
|
+
} else {
|
|
778
|
+
const apiKey = await this.promptApiKey(provider);
|
|
779
|
+
if (apiKey === null) return this.cancelled();
|
|
780
|
+
await this.validateApiKeyDuringSetup();
|
|
781
|
+
}
|
|
782
|
+
} else if (this.requiresApiKey(provider)) {
|
|
783
|
+
const apiKey = await this.promptApiKey(provider);
|
|
784
|
+
if (apiKey === null) return this.cancelled();
|
|
785
|
+
await this.validateApiKeyDuringSetup();
|
|
786
|
+
}
|
|
787
|
+
const model = await this.promptModel(provider);
|
|
788
|
+
if (!model) return this.cancelled();
|
|
789
|
+
if (provider === "openai") {
|
|
790
|
+
await this.promptReasoningEffort();
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
if (this.isLocalProvider(provider)) {
|
|
794
|
+
const connected = await this.testLocalProviderConnection();
|
|
795
|
+
if (!connected) return this.cancelled();
|
|
796
|
+
}
|
|
797
|
+
await this.promptPermissions();
|
|
798
|
+
await this.promptTelemetry();
|
|
799
|
+
await this.promptAutoReport();
|
|
800
|
+
if (!_optionalChain([options, 'optionalAccess', _7 => _7.quickSetup])) {
|
|
801
|
+
await this.promptPreferences();
|
|
802
|
+
} else {
|
|
803
|
+
this.state.skipped.push("preferences");
|
|
804
|
+
}
|
|
805
|
+
if (!_optionalChain([options, 'optionalAccess', _8 => _8.quickSetup])) {
|
|
806
|
+
const wantsAdvanced = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
807
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.advanced.prompt"),
|
|
808
|
+
defaultValue: false
|
|
809
|
+
});
|
|
810
|
+
if (wantsAdvanced) {
|
|
811
|
+
await this.promptNotifications();
|
|
812
|
+
await this.promptNetwork();
|
|
813
|
+
await this.promptSearch();
|
|
814
|
+
await this.promptMcp();
|
|
815
|
+
await this.promptAgentBehavior();
|
|
816
|
+
await this.promptCommunitySkills();
|
|
817
|
+
} else {
|
|
818
|
+
this.state.skipped.push("advanced", "notifications", "network", "search", "mcp", "agentBehavior", "communitySkills");
|
|
819
|
+
}
|
|
820
|
+
} else {
|
|
821
|
+
this.state.skipped.push("advanced", "notifications", "network", "search", "mcp", "agentBehavior", "communitySkills");
|
|
822
|
+
}
|
|
823
|
+
await this.promptAgentsFile();
|
|
824
|
+
if (!_optionalChain([options, 'optionalAccess', _9 => _9.quickSetup])) {
|
|
825
|
+
await this.promptRegistration();
|
|
826
|
+
} else {
|
|
827
|
+
this.state.skipped.push("registration");
|
|
828
|
+
}
|
|
829
|
+
if (!_optionalChain([options, 'optionalAccess', _10 => _10.quickSetup])) {
|
|
830
|
+
const confirmed = await this.promptReviewConfirm();
|
|
831
|
+
if (!confirmed) {
|
|
832
|
+
this.state = { currentStep: "welcome", skipped: [], completed: false };
|
|
833
|
+
return this.run({ ...options, force: true });
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
return this.complete();
|
|
837
|
+
} catch (error) {
|
|
838
|
+
if (this.isCancellation(error)) {
|
|
839
|
+
return this.cancelled();
|
|
840
|
+
}
|
|
841
|
+
throw error;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Check if configuration is already complete
|
|
846
|
+
* Requires both a provider and a valid API key (for providers that need one)
|
|
847
|
+
*/
|
|
848
|
+
isAlreadyConfigured() {
|
|
849
|
+
if (!this.existingConfig) return false;
|
|
850
|
+
const provider = this.existingConfig.provider;
|
|
851
|
+
if (!provider) return false;
|
|
852
|
+
const providerConfig = _chunkX5P6QQOBcjs.getProviderConfig.call(void 0, this.existingConfig, provider);
|
|
853
|
+
if (!providerConfig) return false;
|
|
854
|
+
if (provider === "openai") {
|
|
855
|
+
return this.isOpenAIConfigured(providerConfig);
|
|
856
|
+
}
|
|
857
|
+
if (provider === "vertexai") {
|
|
858
|
+
const vertexaiConfig = providerConfig;
|
|
859
|
+
return !!(vertexaiConfig.authToken && vertexaiConfig.authToken.length >= 10);
|
|
860
|
+
}
|
|
861
|
+
if (provider === "bedrock") {
|
|
862
|
+
return _chunkX5P6QQOBcjs.getProviderConfig.call(void 0, this.existingConfig, "bedrock") !== null;
|
|
863
|
+
}
|
|
864
|
+
if (this.requiresApiKey(provider)) {
|
|
865
|
+
const apiKey = providerConfig.apiKey;
|
|
866
|
+
if (!apiKey || apiKey === "replace-me" || apiKey.length < 10) {
|
|
867
|
+
return false;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
return true;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Show welcome screen
|
|
874
|
+
*/
|
|
875
|
+
async showWelcome() {
|
|
876
|
+
console.clear();
|
|
877
|
+
console.log(_chalk2.default.gray(_chunkSD3NTC7Dcjs.ASCII_FRIEND));
|
|
878
|
+
console.log();
|
|
879
|
+
console.log(_chalk2.default.cyan.bold(" Welcome to Autohand!"));
|
|
880
|
+
console.log(_chalk2.default.gray(" Your super fast self evolving coding agent"));
|
|
881
|
+
console.log();
|
|
882
|
+
console.log(_chalk2.default.white(" Let's get you set up in just a few steps."));
|
|
883
|
+
console.log();
|
|
884
|
+
await this.pressEnter();
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* Prompt for provider selection
|
|
888
|
+
*/
|
|
889
|
+
async promptProvider() {
|
|
890
|
+
this.state.currentStep = "provider";
|
|
891
|
+
const providers = _chunkHC2Q6A3Ecjs.ProviderFactory.getProviderNames(this.existingConfig);
|
|
892
|
+
const options = providers.map((p) => ({
|
|
893
|
+
label: this.getProviderDisplayName(p),
|
|
894
|
+
value: p,
|
|
895
|
+
description: this.getProviderHint(p)
|
|
896
|
+
}));
|
|
897
|
+
const hasValidExistingProvider = _optionalChain([this, 'access', _11 => _11.existingConfig, 'optionalAccess', _12 => _12.provider]) && this.isProviderConfigured(this.existingConfig.provider);
|
|
898
|
+
let initialIndex = 0;
|
|
899
|
+
if (hasValidExistingProvider) {
|
|
900
|
+
initialIndex = providers.indexOf(this.existingConfig.provider);
|
|
901
|
+
}
|
|
902
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
903
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.chooseProvider"),
|
|
904
|
+
options,
|
|
905
|
+
initialIndex: initialIndex >= 0 ? initialIndex : 0
|
|
906
|
+
});
|
|
907
|
+
if (!result) {
|
|
908
|
+
return null;
|
|
909
|
+
}
|
|
910
|
+
const selectedProvider = result.value;
|
|
911
|
+
if (!_chunkHC2Q6A3Ecjs.ProviderFactory.isValidProvider(selectedProvider, this.existingConfig)) {
|
|
912
|
+
return null;
|
|
913
|
+
}
|
|
914
|
+
this.state.provider = selectedProvider;
|
|
915
|
+
return selectedProvider;
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Check if a specific provider is fully configured (has API key if required)
|
|
919
|
+
*/
|
|
920
|
+
isProviderConfigured(provider) {
|
|
921
|
+
if (!this.existingConfig) return false;
|
|
922
|
+
const providerConfig = _chunkX5P6QQOBcjs.getProviderConfig.call(void 0, this.existingConfig, provider);
|
|
923
|
+
if (!providerConfig) return false;
|
|
924
|
+
if (provider === "openai") {
|
|
925
|
+
return this.isOpenAIConfigured(providerConfig);
|
|
926
|
+
}
|
|
927
|
+
if (provider === "vertexai") {
|
|
928
|
+
const vertexaiConfig = providerConfig;
|
|
929
|
+
return !!(vertexaiConfig.authToken && vertexaiConfig.authToken.length >= 10);
|
|
930
|
+
}
|
|
931
|
+
if (this.requiresApiKey(provider)) {
|
|
932
|
+
const apiKey = providerConfig.apiKey;
|
|
933
|
+
return apiKey && apiKey !== "replace-me" && apiKey.length >= 10;
|
|
934
|
+
}
|
|
935
|
+
return true;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Prompt for API key (cloud providers)
|
|
939
|
+
*/
|
|
940
|
+
async promptApiKey(provider) {
|
|
941
|
+
this.state.currentStep = "apiKey";
|
|
942
|
+
const existingKey = this.getExistingApiKey(provider);
|
|
943
|
+
if (existingKey && existingKey !== "replace-me") {
|
|
944
|
+
const useExisting = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
945
|
+
title: `Use existing ${this.getProviderDisplayName(provider)} API key? (ends with ...${existingKey.slice(-4)})`,
|
|
946
|
+
defaultValue: true
|
|
947
|
+
});
|
|
948
|
+
if (useExisting) {
|
|
949
|
+
this.state.apiKey = existingKey;
|
|
950
|
+
return existingKey;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
console.log(_chalk2.default.gray("\n " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.apiKeyUrl", { url: this.getApiKeyUrl(provider) }) + "\n"));
|
|
954
|
+
const apiKey = await _chunkCK4HAHVYcjs.showPassword.call(void 0, {
|
|
955
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.enterApiKey", { provider: this.getProviderDisplayName(provider) }),
|
|
956
|
+
placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder"),
|
|
957
|
+
validate: (val) => {
|
|
958
|
+
if (!_optionalChain([val, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()])) return _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.apiKeyRequired");
|
|
959
|
+
if (val.length < 10) return _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.apiKeyTooShort");
|
|
960
|
+
return true;
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
if (!apiKey) {
|
|
964
|
+
return null;
|
|
965
|
+
}
|
|
966
|
+
this.state.apiKey = apiKey.trim();
|
|
967
|
+
return this.state.apiKey;
|
|
968
|
+
}
|
|
969
|
+
async promptOpenAIAuthMode() {
|
|
970
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
971
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.chooseTitle"),
|
|
972
|
+
options: [
|
|
973
|
+
{
|
|
974
|
+
label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.apiKeyLabel"),
|
|
975
|
+
value: "api-key",
|
|
976
|
+
description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.apiKeyDescription")
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.chatgptLabel"),
|
|
980
|
+
value: "chatgpt",
|
|
981
|
+
description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.chatgptDescription")
|
|
982
|
+
}
|
|
983
|
+
],
|
|
984
|
+
initialIndex: this.getExistingOpenAIAuthMode() === "chatgpt" ? 1 : 0
|
|
985
|
+
});
|
|
986
|
+
return _nullishCoalesce(_optionalChain([result, 'optionalAccess', _15 => _15.value]), () => ( null));
|
|
987
|
+
}
|
|
988
|
+
async promptOpenAIChatGPTAuth() {
|
|
989
|
+
const existing = this.getExistingOpenAIChatGPTAuth();
|
|
990
|
+
if (existing && !_chunkHC2Q6A3Ecjs.isChatGPTAuthExpired.call(void 0, existing)) {
|
|
991
|
+
this.state.openAIChatGPTAuth = existing;
|
|
992
|
+
return existing;
|
|
993
|
+
}
|
|
994
|
+
try {
|
|
995
|
+
console.log(_chalk2.default.gray(`
|
|
996
|
+
${_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.starting")}`));
|
|
997
|
+
const auth = await _chunkHC2Q6A3Ecjs.authenticateOpenAIChatGPT.call(void 0, {
|
|
998
|
+
onPrompt: ({ authorizationUrl, browserOpened }) => {
|
|
999
|
+
console.log(_chalk2.default.gray(`
|
|
1000
|
+
${_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.browserPrompt")}`));
|
|
1001
|
+
console.log(_chalk2.default.white(` ${authorizationUrl}`));
|
|
1002
|
+
console.log(_chalk2.default.gray(` ${browserOpened ? _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.browserOpened") : _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.openManually")}`));
|
|
1003
|
+
console.log(_chalk2.default.gray(` ${_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.waiting")}
|
|
1004
|
+
`));
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
this.state.openAIChatGPTAuth = auth;
|
|
1008
|
+
return auth;
|
|
1009
|
+
} catch (error) {
|
|
1010
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1011
|
+
console.log(_chalk2.default.red(`
|
|
1012
|
+
${_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.openaiAuth.failed", { message })}`));
|
|
1013
|
+
throw error;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Prompt for model selection
|
|
1018
|
+
*/
|
|
1019
|
+
async promptModel(provider) {
|
|
1020
|
+
this.state.currentStep = "model";
|
|
1021
|
+
const defaultModel = this.getDefaultModel(provider);
|
|
1022
|
+
if (provider === "llamacpp") {
|
|
1023
|
+
this.state.model = defaultModel;
|
|
1024
|
+
return this.state.model;
|
|
1025
|
+
}
|
|
1026
|
+
if (provider === "zai") {
|
|
1027
|
+
const options = _chunkHC2Q6A3Ecjs.ZAI_MODELS.map((modelName) => ({
|
|
1028
|
+
label: modelName,
|
|
1029
|
+
value: modelName
|
|
1030
|
+
}));
|
|
1031
|
+
const defaultIndex = Math.max(0, _chunkHC2Q6A3Ecjs.ZAI_MODELS.indexOf(defaultModel));
|
|
1032
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1033
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1034
|
+
options,
|
|
1035
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1036
|
+
});
|
|
1037
|
+
if (!result) {
|
|
1038
|
+
return null;
|
|
1039
|
+
}
|
|
1040
|
+
this.state.model = result.value;
|
|
1041
|
+
return this.state.model;
|
|
1042
|
+
}
|
|
1043
|
+
if (provider === "cerebras") {
|
|
1044
|
+
const options = _chunkHC2Q6A3Ecjs.CEREBRAS_MODELS.map((modelName) => ({
|
|
1045
|
+
label: modelName,
|
|
1046
|
+
value: modelName
|
|
1047
|
+
}));
|
|
1048
|
+
const defaultIndex = Math.max(0, _chunkHC2Q6A3Ecjs.CEREBRAS_MODELS.indexOf(defaultModel));
|
|
1049
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1050
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1051
|
+
options,
|
|
1052
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1053
|
+
});
|
|
1054
|
+
if (!result) {
|
|
1055
|
+
return null;
|
|
1056
|
+
}
|
|
1057
|
+
this.state.model = result.value;
|
|
1058
|
+
return this.state.model;
|
|
1059
|
+
}
|
|
1060
|
+
if (provider === "deepseek") {
|
|
1061
|
+
const options = _chunkHC2Q6A3Ecjs.DEEPSEEK_MODELS.map((modelName) => ({
|
|
1062
|
+
label: modelName,
|
|
1063
|
+
value: modelName
|
|
1064
|
+
}));
|
|
1065
|
+
const defaultIndex = Math.max(0, _chunkHC2Q6A3Ecjs.DEEPSEEK_MODELS.indexOf(defaultModel));
|
|
1066
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1067
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1068
|
+
options,
|
|
1069
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1070
|
+
});
|
|
1071
|
+
if (!result) {
|
|
1072
|
+
return null;
|
|
1073
|
+
}
|
|
1074
|
+
this.state.model = result.value;
|
|
1075
|
+
return this.state.model;
|
|
1076
|
+
}
|
|
1077
|
+
if (provider === "bedrock") {
|
|
1078
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1079
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1080
|
+
options: _chunkHC2Q6A3Ecjs.BEDROCK_MODELS.map((modelName) => ({
|
|
1081
|
+
label: modelName,
|
|
1082
|
+
value: modelName
|
|
1083
|
+
})),
|
|
1084
|
+
allowCustomInput: true
|
|
1085
|
+
});
|
|
1086
|
+
if (!result) {
|
|
1087
|
+
return null;
|
|
1088
|
+
}
|
|
1089
|
+
this.state.model = result.value;
|
|
1090
|
+
return this.state.model;
|
|
1091
|
+
}
|
|
1092
|
+
if (provider === "nvidia") {
|
|
1093
|
+
const { NVIDIA_MODELS } = await Promise.resolve().then(() => _interopRequireWildcard(require("./NVIDIAProvider-C3FWQOBZ.cjs")));
|
|
1094
|
+
const options = [...NVIDIA_MODELS].map((modelName) => ({
|
|
1095
|
+
label: modelName,
|
|
1096
|
+
value: modelName
|
|
1097
|
+
}));
|
|
1098
|
+
const defaultIndex = Math.max(0, [...NVIDIA_MODELS].indexOf(defaultModel));
|
|
1099
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1100
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1101
|
+
options,
|
|
1102
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1103
|
+
});
|
|
1104
|
+
if (!result) {
|
|
1105
|
+
return null;
|
|
1106
|
+
}
|
|
1107
|
+
this.state.model = result.value;
|
|
1108
|
+
return this.state.model;
|
|
1109
|
+
}
|
|
1110
|
+
const model = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1111
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.enterModelId"),
|
|
1112
|
+
defaultValue: defaultModel,
|
|
1113
|
+
validate: (val) => {
|
|
1114
|
+
return _optionalChain([val, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()]) ? true : "Model is required";
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
if (!model) {
|
|
1118
|
+
return null;
|
|
1119
|
+
}
|
|
1120
|
+
this.state.model = model.trim();
|
|
1121
|
+
return this.state.model;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Prompt for reasoning effort level (OpenAI only)
|
|
1125
|
+
*/
|
|
1126
|
+
async promptReasoningEffort() {
|
|
1127
|
+
const options = [
|
|
1128
|
+
{ label: "none", value: "none", description: "No extended reasoning" },
|
|
1129
|
+
{ label: "low", value: "low", description: "Faster responses, minimal reasoning" },
|
|
1130
|
+
{ label: "medium", value: "medium", description: "Balanced speed and reasoning" },
|
|
1131
|
+
{ label: "high", value: "high", description: "Thorough reasoning (recommended)" },
|
|
1132
|
+
{ label: "xhigh", value: "xhigh", description: "Maximum reasoning depth" }
|
|
1133
|
+
];
|
|
1134
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1135
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectReasoningEffort"),
|
|
1136
|
+
options,
|
|
1137
|
+
initialIndex: 3
|
|
1138
|
+
// default to 'high'
|
|
1139
|
+
});
|
|
1140
|
+
if (result) {
|
|
1141
|
+
this.state.reasoningEffort = result.value;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Prompt for telemetry preference
|
|
1146
|
+
*/
|
|
1147
|
+
async promptTelemetry() {
|
|
1148
|
+
this.state.currentStep = "telemetry";
|
|
1149
|
+
console.log();
|
|
1150
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1151
|
+
console.log(_chalk2.default.white.bold(" Help us improve Autohand"));
|
|
1152
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1153
|
+
console.log();
|
|
1154
|
+
console.log(_chalk2.default.gray(" We collect anonymous usage data to understand how"));
|
|
1155
|
+
console.log(_chalk2.default.gray(" Autohand is used and where we can make it better."));
|
|
1156
|
+
console.log();
|
|
1157
|
+
console.log(_chalk2.default.gray(" What we collect:"));
|
|
1158
|
+
console.log(_chalk2.default.gray(" - Command usage (which features are popular)"));
|
|
1159
|
+
console.log(_chalk2.default.gray(" - Error rates (to fix bugs faster)"));
|
|
1160
|
+
console.log(_chalk2.default.gray(" - Performance metrics (to speed things up)"));
|
|
1161
|
+
console.log();
|
|
1162
|
+
console.log(_chalk2.default.gray(" What we never collect:"));
|
|
1163
|
+
console.log(_chalk2.default.gray(" - Your code or file contents"));
|
|
1164
|
+
console.log(_chalk2.default.gray(" - API keys or credentials"));
|
|
1165
|
+
console.log(_chalk2.default.gray(" - Personal information"));
|
|
1166
|
+
console.log();
|
|
1167
|
+
const telemetryEnabled = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1168
|
+
title: "Share anonymous usage data to help improve Autohand?",
|
|
1169
|
+
defaultValue: true
|
|
1170
|
+
});
|
|
1171
|
+
this.state.telemetryEnabled = telemetryEnabled;
|
|
1172
|
+
if (telemetryEnabled) {
|
|
1173
|
+
console.log(_chalk2.default.green(" Thanks for helping us improve Autohand!"));
|
|
1174
|
+
} else {
|
|
1175
|
+
console.log(_chalk2.default.gray(" No problem! You can change this anytime in config."));
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Prompt for auto report issues preference
|
|
1180
|
+
*/
|
|
1181
|
+
async promptAutoReport() {
|
|
1182
|
+
this.state.currentStep = "autoReport";
|
|
1183
|
+
console.log();
|
|
1184
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1185
|
+
console.log(_chalk2.default.white.bold(" Auto Report Issues"));
|
|
1186
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1187
|
+
console.log();
|
|
1188
|
+
console.log(_chalk2.default.gray(" When errors occur, Autohand can automatically report"));
|
|
1189
|
+
console.log(_chalk2.default.gray(" them as GitHub issues to help us fix bugs faster."));
|
|
1190
|
+
console.log();
|
|
1191
|
+
console.log(_chalk2.default.gray(" What gets reported:"));
|
|
1192
|
+
console.log(_chalk2.default.gray(" - Error type, message, and sanitized stack trace"));
|
|
1193
|
+
console.log(_chalk2.default.gray(" - CLI version, platform, and model info"));
|
|
1194
|
+
console.log();
|
|
1195
|
+
console.log(_chalk2.default.gray(" What we never report:"));
|
|
1196
|
+
console.log(_chalk2.default.gray(" - Your code or file contents"));
|
|
1197
|
+
console.log(_chalk2.default.gray(" - API keys or credentials"));
|
|
1198
|
+
console.log(_chalk2.default.gray(" - Personal information"));
|
|
1199
|
+
console.log();
|
|
1200
|
+
const autoReportEnabled = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1201
|
+
title: "Automatically report errors to help us fix bugs faster?",
|
|
1202
|
+
defaultValue: true
|
|
1203
|
+
});
|
|
1204
|
+
this.state.autoReportEnabled = autoReportEnabled;
|
|
1205
|
+
if (autoReportEnabled) {
|
|
1206
|
+
console.log(_chalk2.default.green(" Thanks! This helps us catch and fix issues quickly."));
|
|
1207
|
+
} else {
|
|
1208
|
+
console.log(_chalk2.default.gray(" No problem! You can enable this anytime in config."));
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Prompt for additional preferences
|
|
1213
|
+
*/
|
|
1214
|
+
async promptPreferences() {
|
|
1215
|
+
this.state.currentStep = "preferences";
|
|
1216
|
+
const configurePrefs = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1217
|
+
title: "Would you like to configure additional preferences? (theme, auto-confirm)",
|
|
1218
|
+
defaultValue: false
|
|
1219
|
+
});
|
|
1220
|
+
if (!configurePrefs) {
|
|
1221
|
+
this.state.skipped.push("preferences");
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
const themes = _chunkYWTIXHU6cjs.getBuiltInThemeNames.call(void 0, );
|
|
1225
|
+
const themeDescriptions = {
|
|
1226
|
+
dark: "Default dark theme",
|
|
1227
|
+
light: "Light theme for light backgrounds",
|
|
1228
|
+
dracula: "Popular Dracula color scheme",
|
|
1229
|
+
sandy: "Warm, earthy desert tones",
|
|
1230
|
+
tui: "New Zealand inspired colors",
|
|
1231
|
+
"github-dark": "GitHub Dark terminal palette",
|
|
1232
|
+
cappadocia: "Cappadocia-inspired rose valleys, dawn sky, and balloon colors",
|
|
1233
|
+
rio: "Rio-inspired blue macaw, rainforest, and beach-light palette",
|
|
1234
|
+
australia: "Australian coast, wattle, and eucalyptus palette"
|
|
1235
|
+
};
|
|
1236
|
+
const themeOptions = themes.map((themeName) => ({
|
|
1237
|
+
label: themeName,
|
|
1238
|
+
value: themeName,
|
|
1239
|
+
description: themeDescriptions[themeName]
|
|
1240
|
+
}));
|
|
1241
|
+
const themeResult = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1242
|
+
title: "Select a theme",
|
|
1243
|
+
options: themeOptions
|
|
1244
|
+
});
|
|
1245
|
+
const theme = _optionalChain([themeResult, 'optionalAccess', _18 => _18.value]) || "dark";
|
|
1246
|
+
const autoConfirm = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1247
|
+
title: "Auto-confirm non-destructive actions?",
|
|
1248
|
+
defaultValue: false
|
|
1249
|
+
});
|
|
1250
|
+
const checkForUpdates = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1251
|
+
title: "Check for updates on startup?",
|
|
1252
|
+
defaultValue: true
|
|
1253
|
+
});
|
|
1254
|
+
this.state.preferences = { theme, autoConfirm, checkForUpdates };
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Prompt for AGENTS.md creation
|
|
1258
|
+
*/
|
|
1259
|
+
async promptAgentsFile() {
|
|
1260
|
+
this.state.currentStep = "agentsFile";
|
|
1261
|
+
const agentsPath = _path.join.call(void 0, this.workspaceRoot, "AGENTS.md");
|
|
1262
|
+
const exists = await _fsextra2.default.pathExists(agentsPath);
|
|
1263
|
+
if (exists) {
|
|
1264
|
+
const overwrite = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1265
|
+
title: "AGENTS.md already exists. Would you like to regenerate it?",
|
|
1266
|
+
defaultValue: false
|
|
1267
|
+
});
|
|
1268
|
+
if (!overwrite) {
|
|
1269
|
+
this.state.skipped.push("agentsFile");
|
|
1270
|
+
console.log(_chalk2.default.gray(" Keeping existing AGENTS.md"));
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
} else {
|
|
1274
|
+
console.log();
|
|
1275
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1276
|
+
console.log(_chalk2.default.white.bold(" Project Configuration"));
|
|
1277
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1278
|
+
console.log();
|
|
1279
|
+
console.log(_chalk2.default.gray(" AGENTS.md helps Autohand understand your project better."));
|
|
1280
|
+
console.log(_chalk2.default.gray(" It contains instructions specific to your codebase."));
|
|
1281
|
+
console.log();
|
|
1282
|
+
const createAgents = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1283
|
+
title: "Generate AGENTS.md based on your project?",
|
|
1284
|
+
defaultValue: true
|
|
1285
|
+
});
|
|
1286
|
+
if (!createAgents) {
|
|
1287
|
+
this.state.skipped.push("agentsFile");
|
|
1288
|
+
console.log(_chalk2.default.gray(" You can create it later with /init"));
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
console.log();
|
|
1293
|
+
console.log(_chalk2.default.gray(" Analyzing your project..."));
|
|
1294
|
+
const analyzer = new ProjectAnalyzer(this.workspaceRoot);
|
|
1295
|
+
const projectInfo = await analyzer.analyze();
|
|
1296
|
+
if (Object.keys(projectInfo).length > 0) {
|
|
1297
|
+
console.log();
|
|
1298
|
+
console.log(_chalk2.default.gray(" Detected:"));
|
|
1299
|
+
if (projectInfo.language) {
|
|
1300
|
+
console.log(_chalk2.default.white(` - Language: ${projectInfo.language}`));
|
|
1301
|
+
}
|
|
1302
|
+
if (projectInfo.framework) {
|
|
1303
|
+
console.log(_chalk2.default.white(` - Framework: ${projectInfo.framework}`));
|
|
1304
|
+
}
|
|
1305
|
+
if (projectInfo.packageManager) {
|
|
1306
|
+
console.log(_chalk2.default.white(` - Package manager: ${projectInfo.packageManager}`));
|
|
1307
|
+
}
|
|
1308
|
+
if (projectInfo.testFramework) {
|
|
1309
|
+
console.log(_chalk2.default.white(` - Test framework: ${projectInfo.testFramework}`));
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
const generator = new AgentsGenerator();
|
|
1313
|
+
const content = generator.generateContent(projectInfo);
|
|
1314
|
+
await _fsextra2.default.writeFile(agentsPath, content);
|
|
1315
|
+
this.state.agentsFileCreated = true;
|
|
1316
|
+
console.log();
|
|
1317
|
+
console.log(_chalk2.default.green(" Created AGENTS.md"));
|
|
1318
|
+
console.log(_chalk2.default.gray(" You can customize it anytime to improve Autohand's understanding."));
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Prompt user to create an Autohand account using device-flow auth.
|
|
1322
|
+
* Account creation is now mandatory to use Autohand.
|
|
1323
|
+
* Reuses the same flow as /login command.
|
|
1324
|
+
*/
|
|
1325
|
+
async promptRegistration() {
|
|
1326
|
+
this.state.currentStep = "registration";
|
|
1327
|
+
console.log();
|
|
1328
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1329
|
+
console.log(_chalk2.default.white.bold(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.title")));
|
|
1330
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1331
|
+
console.log();
|
|
1332
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.descriptionMandatory")));
|
|
1333
|
+
console.log();
|
|
1334
|
+
const authClient = _chunkCO2AADYUcjs.getAuthClient.call(void 0, );
|
|
1335
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.initiating")));
|
|
1336
|
+
const initResult = await authClient.initiateDeviceAuth();
|
|
1337
|
+
if (!initResult.success || !initResult.deviceCode || !initResult.userCode) {
|
|
1338
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.failed", { error: initResult.error || "Unknown error" })));
|
|
1339
|
+
const retry2 = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1340
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.retryPrompt"),
|
|
1341
|
+
defaultValue: true
|
|
1342
|
+
});
|
|
1343
|
+
if (retry2) {
|
|
1344
|
+
return this.promptRegistration();
|
|
1345
|
+
}
|
|
1346
|
+
this.state.skipped.push("registration");
|
|
1347
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.tryLater")));
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
const authUrl = initResult.verificationUriComplete || `${_chunkKASXKDF2cjs.AUTH_CONFIG.authorizationUrl}?code=${initResult.userCode}`;
|
|
1351
|
+
console.log();
|
|
1352
|
+
console.log(_chalk2.default.white(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.visit")));
|
|
1353
|
+
console.log(_chalk2.default.cyan(" " + authUrl));
|
|
1354
|
+
console.log();
|
|
1355
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.code")));
|
|
1356
|
+
console.log(_chalk2.default.bold.yellow(` ${initResult.userCode}`));
|
|
1357
|
+
console.log();
|
|
1358
|
+
try {
|
|
1359
|
+
const open = await Promise.resolve().then(() => _interopRequireWildcard(require("open"))).then((m) => m.default).catch(() => null);
|
|
1360
|
+
if (open) {
|
|
1361
|
+
await open(authUrl);
|
|
1362
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.browserOpened")));
|
|
1363
|
+
} else {
|
|
1364
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.openManually")));
|
|
1365
|
+
}
|
|
1366
|
+
} catch (e12) {
|
|
1367
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.openManually")));
|
|
1368
|
+
}
|
|
1369
|
+
console.log();
|
|
1370
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.waiting")));
|
|
1371
|
+
const startTime = Date.now();
|
|
1372
|
+
const timeout = 3 * 60 * 1e3;
|
|
1373
|
+
const pollInterval = initResult.interval ? initResult.interval * 1e3 : _chunkKASXKDF2cjs.AUTH_CONFIG.pollInterval;
|
|
1374
|
+
let dots = 0;
|
|
1375
|
+
const maxDots = 3;
|
|
1376
|
+
while (Date.now() - startTime < timeout) {
|
|
1377
|
+
process.stdout.write(`\r ${_chalk2.default.gray("Waiting" + ".".repeat(dots + 1) + " ".repeat(maxDots - dots))}`);
|
|
1378
|
+
dots = (dots + 1) % (maxDots + 1);
|
|
1379
|
+
await this.sleep(pollInterval);
|
|
1380
|
+
const pollResult = await authClient.pollDeviceAuth(initResult.deviceCode);
|
|
1381
|
+
if (pollResult.status === "authorized" && pollResult.token && pollResult.user) {
|
|
1382
|
+
process.stdout.write("\r" + " ".repeat(20) + "\r");
|
|
1383
|
+
this.state.authToken = pollResult.token;
|
|
1384
|
+
this.state.authUser = pollResult.user;
|
|
1385
|
+
console.log();
|
|
1386
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.success", { name: pollResult.user.name || pollResult.user.email })));
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
if (pollResult.status === "expired") {
|
|
1390
|
+
process.stdout.write("\r" + " ".repeat(20) + "\r");
|
|
1391
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.expired")));
|
|
1392
|
+
const retry2 = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1393
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.retryPrompt"),
|
|
1394
|
+
defaultValue: true
|
|
1395
|
+
});
|
|
1396
|
+
if (retry2) {
|
|
1397
|
+
return this.promptRegistration();
|
|
1398
|
+
}
|
|
1399
|
+
this.state.skipped.push("registration");
|
|
1400
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.tryLater")));
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
process.stdout.write("\r" + " ".repeat(20) + "\r");
|
|
1405
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.timeout")));
|
|
1406
|
+
const retry = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1407
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.retryPrompt"),
|
|
1408
|
+
defaultValue: true
|
|
1409
|
+
});
|
|
1410
|
+
if (retry) {
|
|
1411
|
+
return this.promptRegistration();
|
|
1412
|
+
}
|
|
1413
|
+
this.state.skipped.push("registration");
|
|
1414
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.registration.tryLater")));
|
|
1415
|
+
}
|
|
1416
|
+
sleep(ms) {
|
|
1417
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Build final config and return success
|
|
1421
|
+
*/
|
|
1422
|
+
complete() {
|
|
1423
|
+
this.state.currentStep = "complete";
|
|
1424
|
+
this.state.completed = true;
|
|
1425
|
+
const config = {
|
|
1426
|
+
provider: this.state.provider
|
|
1427
|
+
};
|
|
1428
|
+
if (this.state.provider) {
|
|
1429
|
+
if (this.state.provider === "azure" && this.state.azureConfig) {
|
|
1430
|
+
config.azure = this.state.azureConfig;
|
|
1431
|
+
} else if (this.state.provider === "openai" && this.state.openAIAuthMode === "chatgpt") {
|
|
1432
|
+
config.openai = {
|
|
1433
|
+
authMode: "chatgpt",
|
|
1434
|
+
chatgptAuth: this.state.openAIChatGPTAuth,
|
|
1435
|
+
model: _nullishCoalesce(this.state.model, () => ( this.getDefaultModel("openai"))),
|
|
1436
|
+
baseUrl: "https://chatgpt.com/backend-api/codex",
|
|
1437
|
+
...this.state.reasoningEffort !== void 0 && { reasoningEffort: this.state.reasoningEffort }
|
|
1438
|
+
};
|
|
1439
|
+
} else if (this.state.provider === "openai") {
|
|
1440
|
+
config.openai = {
|
|
1441
|
+
authMode: "api-key",
|
|
1442
|
+
apiKey: this.state.apiKey,
|
|
1443
|
+
model: _nullishCoalesce(this.state.model, () => ( this.getDefaultModel("openai"))),
|
|
1444
|
+
baseUrl: this.getDefaultBaseUrl("openai"),
|
|
1445
|
+
...this.state.reasoningEffort !== void 0 && { reasoningEffort: this.state.reasoningEffort }
|
|
1446
|
+
};
|
|
1447
|
+
} else if (this.state.provider === "vertexai" && this.state.vertexaiConfig) {
|
|
1448
|
+
config.vertexai = this.state.vertexaiConfig;
|
|
1449
|
+
} else if (this.state.provider === "bedrock" && this.state.bedrockConfig) {
|
|
1450
|
+
config.bedrock = this.state.bedrockConfig;
|
|
1451
|
+
} else if (this.requiresApiKey(this.state.provider)) {
|
|
1452
|
+
config[this.state.provider] = {
|
|
1453
|
+
apiKey: this.state.apiKey,
|
|
1454
|
+
model: this.state.model,
|
|
1455
|
+
baseUrl: this.getDefaultBaseUrl(this.state.provider),
|
|
1456
|
+
...this.state.reasoningEffort !== void 0 && { reasoningEffort: this.state.reasoningEffort }
|
|
1457
|
+
};
|
|
1458
|
+
} else {
|
|
1459
|
+
config[this.state.provider] = {
|
|
1460
|
+
model: this.state.model,
|
|
1461
|
+
baseUrl: _nullishCoalesce(this.state.providerBaseUrl, () => ( this.getDefaultBaseUrl(this.state.provider)))
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
config.telemetry = {
|
|
1466
|
+
enabled: _nullishCoalesce(this.state.telemetryEnabled, () => ( true))
|
|
1467
|
+
};
|
|
1468
|
+
config.autoReport = {
|
|
1469
|
+
enabled: _nullishCoalesce(this.state.autoReportEnabled, () => ( true))
|
|
1470
|
+
};
|
|
1471
|
+
const uiConfig = {};
|
|
1472
|
+
if (this.state.locale) {
|
|
1473
|
+
uiConfig.locale = this.state.locale;
|
|
1474
|
+
}
|
|
1475
|
+
if (this.state.preferences) {
|
|
1476
|
+
uiConfig.theme = this.state.preferences.theme;
|
|
1477
|
+
uiConfig.autoConfirm = this.state.preferences.autoConfirm;
|
|
1478
|
+
uiConfig.checkForUpdates = this.state.preferences.checkForUpdates;
|
|
1479
|
+
}
|
|
1480
|
+
if (this.state.notifications) {
|
|
1481
|
+
uiConfig.notifications = this.state.notifications;
|
|
1482
|
+
}
|
|
1483
|
+
if (Object.keys(uiConfig).length > 0) {
|
|
1484
|
+
config.ui = uiConfig;
|
|
1485
|
+
}
|
|
1486
|
+
if (this.state.permissionMode) {
|
|
1487
|
+
config.permissions = {
|
|
1488
|
+
mode: this.state.permissionMode,
|
|
1489
|
+
rememberSession: _nullishCoalesce(this.state.rememberSession, () => ( true))
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
if (this.state.network) {
|
|
1493
|
+
config.network = this.state.network;
|
|
1494
|
+
}
|
|
1495
|
+
if (this.state.search) {
|
|
1496
|
+
config.search = this.state.search;
|
|
1497
|
+
}
|
|
1498
|
+
if (this.state.mcpEnabled !== void 0) {
|
|
1499
|
+
config.mcp = { enabled: this.state.mcpEnabled };
|
|
1500
|
+
}
|
|
1501
|
+
if (this.state.agentSettings) {
|
|
1502
|
+
config.agent = this.state.agentSettings;
|
|
1503
|
+
}
|
|
1504
|
+
if (this.state.communitySkillsEnabled !== void 0) {
|
|
1505
|
+
config.communitySkills = { enabled: this.state.communitySkillsEnabled };
|
|
1506
|
+
}
|
|
1507
|
+
if (this.state.authToken && this.state.authUser) {
|
|
1508
|
+
config.auth = {
|
|
1509
|
+
token: this.state.authToken,
|
|
1510
|
+
user: this.state.authUser
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
this.showCompletionMessage();
|
|
1514
|
+
return {
|
|
1515
|
+
success: true,
|
|
1516
|
+
config,
|
|
1517
|
+
skippedSteps: this.state.skipped,
|
|
1518
|
+
cancelled: false,
|
|
1519
|
+
agentsFileCreated: this.state.agentsFileCreated
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Show setup complete message
|
|
1524
|
+
*/
|
|
1525
|
+
showCompletionMessage() {
|
|
1526
|
+
console.log();
|
|
1527
|
+
console.log();
|
|
1528
|
+
console.log(_chalk2.default.green(" Setup complete!"));
|
|
1529
|
+
console.log();
|
|
1530
|
+
console.log(_chalk2.default.gray(" What was created:"));
|
|
1531
|
+
console.log(_chalk2.default.white(" - ~/.autohand/config.toml/yaml/json (your settings)"));
|
|
1532
|
+
if (this.state.agentsFileCreated) {
|
|
1533
|
+
console.log(_chalk2.default.white(" - AGENTS.md (project instructions for Autohand)"));
|
|
1534
|
+
}
|
|
1535
|
+
console.log();
|
|
1536
|
+
console.log(_chalk2.default.gray(" Quick tips:"));
|
|
1537
|
+
console.log(_chalk2.default.white(" - Type your request and press Enter to start"));
|
|
1538
|
+
console.log(_chalk2.default.white(" - Use @filename to mention files"));
|
|
1539
|
+
console.log(_chalk2.default.white(" - Type /help for all commands"));
|
|
1540
|
+
console.log(_chalk2.default.white(" - Press Ctrl+C twice to exit"));
|
|
1541
|
+
console.log();
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Return cancelled result
|
|
1545
|
+
*/
|
|
1546
|
+
cancelled() {
|
|
1547
|
+
return {
|
|
1548
|
+
success: false,
|
|
1549
|
+
config: {},
|
|
1550
|
+
skippedSteps: [],
|
|
1551
|
+
cancelled: true
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* Full Azure OpenAI configuration flow
|
|
1556
|
+
* Shows prerequisites, collects auth method, endpoint, deployment, and API version
|
|
1557
|
+
*/
|
|
1558
|
+
async promptAzureConfig() {
|
|
1559
|
+
this.state.currentStep = "apiKey";
|
|
1560
|
+
console.log(_chalk2.default.cyan("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.title")));
|
|
1561
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.getStarted") + "\n"));
|
|
1562
|
+
console.log(_chalk2.default.yellow(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.setupSteps.title")));
|
|
1563
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step1")));
|
|
1564
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step2")));
|
|
1565
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step3")));
|
|
1566
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step4")));
|
|
1567
|
+
console.log();
|
|
1568
|
+
const authChoices = [
|
|
1569
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.authApiKey"), value: "api-key" },
|
|
1570
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.authEntraId"), value: "entra-id" },
|
|
1571
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.authManagedIdentity"), value: "managed-identity" }
|
|
1572
|
+
];
|
|
1573
|
+
const authResult = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1574
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.selectAuthMethod"),
|
|
1575
|
+
options: authChoices
|
|
1576
|
+
});
|
|
1577
|
+
if (!authResult) return false;
|
|
1578
|
+
const authMethod = authResult.value;
|
|
1579
|
+
let apiKey;
|
|
1580
|
+
let tenantId;
|
|
1581
|
+
let clientId;
|
|
1582
|
+
let clientSecret;
|
|
1583
|
+
if (authMethod === "api-key") {
|
|
1584
|
+
console.log(_chalk2.default.gray("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.apiKeyLocation") + "\n"));
|
|
1585
|
+
apiKey = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showPassword.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterAzureApiKey"), placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder") }), async () => ( void 0));
|
|
1586
|
+
if (!apiKey) return false;
|
|
1587
|
+
} else if (authMethod === "entra-id") {
|
|
1588
|
+
console.log(_chalk2.default.gray("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.entraIdDescription")));
|
|
1589
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.entraIdDocs") + "\n"));
|
|
1590
|
+
tenantId = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showInput.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterTenantId") }), async () => ( void 0));
|
|
1591
|
+
if (!tenantId) return false;
|
|
1592
|
+
clientId = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showInput.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterClientId") }), async () => ( void 0));
|
|
1593
|
+
if (!clientId) return false;
|
|
1594
|
+
clientSecret = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showPassword.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterClientSecret") }), async () => ( void 0));
|
|
1595
|
+
if (!clientSecret) return false;
|
|
1596
|
+
} else {
|
|
1597
|
+
console.log(_chalk2.default.gray("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.managedIdentityDescription")));
|
|
1598
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.managedIdentityDocs") + "\n"));
|
|
1599
|
+
}
|
|
1600
|
+
const endpointChoice = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1601
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.endpointChoice"),
|
|
1602
|
+
options: [
|
|
1603
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.endpointStructured"), value: "structured" },
|
|
1604
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.endpointUrl"), value: "url" }
|
|
1605
|
+
]
|
|
1606
|
+
});
|
|
1607
|
+
if (!endpointChoice) return false;
|
|
1608
|
+
let resourceName;
|
|
1609
|
+
let deploymentName;
|
|
1610
|
+
let baseUrl;
|
|
1611
|
+
if (endpointChoice.value === "structured") {
|
|
1612
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.endpointUrlHint")));
|
|
1613
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.endpointUrlExample") + "\n"));
|
|
1614
|
+
resourceName = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showInput.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterEndpointOrResource") }), async () => ( void 0));
|
|
1615
|
+
if (!resourceName) return false;
|
|
1616
|
+
console.log(_chalk2.default.gray("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.deploymentHint")));
|
|
1617
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.deploymentNotUrl") + "\n"));
|
|
1618
|
+
deploymentName = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showInput.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterDeploymentName"), defaultValue: "gpt-5.3-codex" }), async () => ( void 0));
|
|
1619
|
+
if (!deploymentName) return false;
|
|
1620
|
+
if (deploymentName.startsWith("http://") || deploymentName.startsWith("https://")) {
|
|
1621
|
+
console.log(_chalk2.default.red("\n\u2717 " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.deploymentUrlError")));
|
|
1622
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.deploymentUrlErrorHint")));
|
|
1623
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.deploymentUrlErrorLocation") + "\n"));
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
} else {
|
|
1627
|
+
baseUrl = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1628
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.enterFullEndpointUrl"),
|
|
1629
|
+
defaultValue: "https://your-resource.openai.azure.com/openai/deployments/gpt-5.3-codex"
|
|
1630
|
+
}), async () => ( void 0));
|
|
1631
|
+
if (!baseUrl) return false;
|
|
1632
|
+
}
|
|
1633
|
+
const apiVersion = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showInput.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.apiVersion"), defaultValue: "2024-10-21" }), async () => ( void 0));
|
|
1634
|
+
if (!apiVersion) return false;
|
|
1635
|
+
const model = _nullishCoalesce(deploymentName, () => ( "gpt-5.3-codex"));
|
|
1636
|
+
const azureConfig = {
|
|
1637
|
+
model,
|
|
1638
|
+
authMethod,
|
|
1639
|
+
apiVersion,
|
|
1640
|
+
...apiKey && { apiKey },
|
|
1641
|
+
...tenantId && { tenantId },
|
|
1642
|
+
...clientId && { clientId },
|
|
1643
|
+
...clientSecret && { clientSecret },
|
|
1644
|
+
...resourceName && { resourceName },
|
|
1645
|
+
...deploymentName && { deploymentName },
|
|
1646
|
+
...baseUrl && { baseUrl }
|
|
1647
|
+
};
|
|
1648
|
+
this.state.azureConfig = azureConfig;
|
|
1649
|
+
this.state.model = model;
|
|
1650
|
+
console.log(_chalk2.default.green("\n\u2713 " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.configuredSuccessfully", { provider: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.azure") })));
|
|
1651
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.azure.authLabel", { method: authMethod })));
|
|
1652
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.modelLabel", { model })));
|
|
1653
|
+
console.log();
|
|
1654
|
+
return true;
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Full Google Cloud Vertex AI configuration flow
|
|
1658
|
+
* Shows prerequisites, collects endpoint, region, project ID, auth token, and model
|
|
1659
|
+
* Auto-detects gcloud CLI and uses it for automatic token management
|
|
1660
|
+
*/
|
|
1661
|
+
async promptVertexAIConfig() {
|
|
1662
|
+
this.state.currentStep = "apiKey";
|
|
1663
|
+
console.log(_chalk2.default.cyan("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.title")));
|
|
1664
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.getStarted") + "\n"));
|
|
1665
|
+
const gcloudInstalled = await _chunkHC2Q6A3Ecjs.isGcloudInstalled.call(void 0, );
|
|
1666
|
+
const gcloudAccount = gcloudInstalled ? await _chunkHC2Q6A3Ecjs.getGcloudAccount.call(void 0, ) : null;
|
|
1667
|
+
const gcloudProject = gcloudInstalled ? await _chunkHC2Q6A3Ecjs.getGcloudProject.call(void 0, ) : null;
|
|
1668
|
+
const existingConfig = _optionalChain([this, 'access', _19 => _19.existingConfig, 'optionalAccess', _20 => _20.vertexai]);
|
|
1669
|
+
const existingProjectId = _optionalChain([existingConfig, 'optionalAccess', _21 => _21.projectId]);
|
|
1670
|
+
const existingEndpoint = _optionalChain([existingConfig, 'optionalAccess', _22 => _22.endpoint]);
|
|
1671
|
+
const existingRegion = _optionalChain([existingConfig, 'optionalAccess', _23 => _23.region]);
|
|
1672
|
+
if (gcloudInstalled) {
|
|
1673
|
+
console.log(_chalk2.default.green(" \u2713 gcloud CLI detected"));
|
|
1674
|
+
if (gcloudAccount) {
|
|
1675
|
+
console.log(_chalk2.default.gray(` Account: ${gcloudAccount}`));
|
|
1676
|
+
}
|
|
1677
|
+
if (gcloudProject) {
|
|
1678
|
+
console.log(_chalk2.default.gray(` Project: ${gcloudProject}`));
|
|
1679
|
+
}
|
|
1680
|
+
console.log();
|
|
1681
|
+
} else {
|
|
1682
|
+
console.log(_chalk2.default.yellow(" \u26A0 gcloud CLI not detected"));
|
|
1683
|
+
console.log(_chalk2.default.gray(" Install it for automatic token management:"));
|
|
1684
|
+
console.log(_chalk2.default.gray(" https://cloud.google.com/sdk/docs/install"));
|
|
1685
|
+
console.log();
|
|
1686
|
+
}
|
|
1687
|
+
const endpoint = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1688
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.enterEndpoint"),
|
|
1689
|
+
defaultValue: existingEndpoint || "aiplatform.googleapis.com"
|
|
1690
|
+
});
|
|
1691
|
+
if (!endpoint) return false;
|
|
1692
|
+
const region = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1693
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.enterRegion"),
|
|
1694
|
+
defaultValue: existingRegion || "global"
|
|
1695
|
+
});
|
|
1696
|
+
if (!region) return false;
|
|
1697
|
+
const defaultProjectId = existingProjectId || gcloudProject || "";
|
|
1698
|
+
const projectId = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1699
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.enterProjectId"),
|
|
1700
|
+
defaultValue: defaultProjectId,
|
|
1701
|
+
placeholder: "YOUR_PROJECT_ID"
|
|
1702
|
+
});
|
|
1703
|
+
if (!projectId) return false;
|
|
1704
|
+
let authToken;
|
|
1705
|
+
if (gcloudInstalled) {
|
|
1706
|
+
console.log(_chalk2.default.gray("\n Fetching access token from gcloud..."));
|
|
1707
|
+
const tokenResult = await _chunkHC2Q6A3Ecjs.getGcloudAccessToken.call(void 0, );
|
|
1708
|
+
if (tokenResult.token) {
|
|
1709
|
+
console.log(_chalk2.default.green(" \u2713 Access token obtained (valid for ~25 minutes)"));
|
|
1710
|
+
console.log(_chalk2.default.gray(" Tokens are automatically refreshed when using gcloud."));
|
|
1711
|
+
authToken = tokenResult.token;
|
|
1712
|
+
} else {
|
|
1713
|
+
console.log(_chalk2.default.yellow(` \u26A0 ${tokenResult.error}`));
|
|
1714
|
+
console.log(_chalk2.default.gray(" Please enter token manually or run: gcloud auth login"));
|
|
1715
|
+
console.log();
|
|
1716
|
+
const manualToken = await _chunkCK4HAHVYcjs.showPassword.call(void 0, {
|
|
1717
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.enterAuthToken"),
|
|
1718
|
+
placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder")
|
|
1719
|
+
});
|
|
1720
|
+
if (!manualToken) return false;
|
|
1721
|
+
authToken = manualToken;
|
|
1722
|
+
}
|
|
1723
|
+
} else {
|
|
1724
|
+
console.log(_chalk2.default.gray("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.authTokenHint")));
|
|
1725
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.authTokenCommand")));
|
|
1726
|
+
console.log();
|
|
1727
|
+
const manualToken = await _chunkCK4HAHVYcjs.showPassword.call(void 0, {
|
|
1728
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.vertexai.enterAuthToken"),
|
|
1729
|
+
placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder")
|
|
1730
|
+
});
|
|
1731
|
+
if (!manualToken) return false;
|
|
1732
|
+
authToken = manualToken;
|
|
1733
|
+
}
|
|
1734
|
+
const modelOptions = _chunkHC2Q6A3Ecjs.VERTEX_AI_CODING_MODELS.map((name) => ({
|
|
1735
|
+
label: name,
|
|
1736
|
+
value: name
|
|
1737
|
+
}));
|
|
1738
|
+
const modelResult = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1739
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1740
|
+
options: modelOptions,
|
|
1741
|
+
allowCustomInput: true
|
|
1742
|
+
});
|
|
1743
|
+
if (!modelResult) return false;
|
|
1744
|
+
const model = modelResult.value;
|
|
1745
|
+
this.state.provider = "vertexai";
|
|
1746
|
+
this.state.apiKey = authToken;
|
|
1747
|
+
this.state.model = model;
|
|
1748
|
+
this.state.providerBaseUrl = `https://${endpoint}/v1/projects/${projectId}/locations/${region}/endpoints/openapi`;
|
|
1749
|
+
this.state.vertexaiConfig = {
|
|
1750
|
+
authToken,
|
|
1751
|
+
endpoint,
|
|
1752
|
+
region,
|
|
1753
|
+
projectId,
|
|
1754
|
+
model
|
|
1755
|
+
};
|
|
1756
|
+
console.log(_chalk2.default.green("\n\u2713 " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.configuredSuccessfully", { provider: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.vertexai") })));
|
|
1757
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.modelLabel", { model })));
|
|
1758
|
+
if (gcloudInstalled) {
|
|
1759
|
+
console.log(_chalk2.default.gray(" Token auto-refresh enabled via gcloud CLI"));
|
|
1760
|
+
}
|
|
1761
|
+
console.log();
|
|
1762
|
+
return true;
|
|
1763
|
+
}
|
|
1764
|
+
async promptBedrockConfig() {
|
|
1765
|
+
this.state.currentStep = "apiKey";
|
|
1766
|
+
console.log(_chalk2.default.cyan("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.title")));
|
|
1767
|
+
console.log(_chalk2.default.gray(_chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.getStarted") + "\n"));
|
|
1768
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.awsCredentialsHint")));
|
|
1769
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modelAccessHint") + "\n"));
|
|
1770
|
+
const existing = _optionalChain([this, 'access', _24 => _24.existingConfig, 'optionalAccess', _25 => _25.bedrock]);
|
|
1771
|
+
const apiMode = await this.promptBedrockApiMode(_optionalChain([existing, 'optionalAccess', _26 => _26.apiMode]));
|
|
1772
|
+
if (!apiMode) return false;
|
|
1773
|
+
const authMode = await this.promptBedrockAuthMode(apiMode, _optionalChain([existing, 'optionalAccess', _27 => _27.authMode]));
|
|
1774
|
+
if (!authMode) return false;
|
|
1775
|
+
let apiKey = _optionalChain([existing, 'optionalAccess', _28 => _28.apiKey]);
|
|
1776
|
+
if (authMode === "bedrock-api-key") {
|
|
1777
|
+
console.log(_chalk2.default.gray("\n" + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.apiKeyHint") + "\n"));
|
|
1778
|
+
apiKey = await _asyncNullishCoalesce(await _chunkCK4HAHVYcjs.showPassword.call(void 0, {
|
|
1779
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.enterApiKey", { provider: this.getProviderDisplayName("bedrock") }),
|
|
1780
|
+
placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder"),
|
|
1781
|
+
validate: (val) => {
|
|
1782
|
+
if (!_optionalChain([val, 'optionalAccess', _29 => _29.trim, 'call', _30 => _30()])) return _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.apiKeyRequired");
|
|
1783
|
+
if (val.length < 10) return _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.apiKeyTooShort");
|
|
1784
|
+
return true;
|
|
1785
|
+
}
|
|
1786
|
+
}), async () => ( void 0));
|
|
1787
|
+
if (!apiKey) return false;
|
|
1788
|
+
}
|
|
1789
|
+
const region = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1790
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.enterRegion"),
|
|
1791
|
+
defaultValue: _optionalChain([existing, 'optionalAccess', _31 => _31.region]) || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || _chunkHC2Q6A3Ecjs.BEDROCK_DEFAULT_REGION
|
|
1792
|
+
});
|
|
1793
|
+
if (!region) return false;
|
|
1794
|
+
const profile = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1795
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.enterProfile"),
|
|
1796
|
+
defaultValue: _optionalChain([existing, 'optionalAccess', _32 => _32.profile]) || "",
|
|
1797
|
+
placeholder: "enterprise-prod"
|
|
1798
|
+
});
|
|
1799
|
+
const endpoint = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1800
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.enterEndpoint"),
|
|
1801
|
+
defaultValue: _optionalChain([existing, 'optionalAccess', _33 => _33.endpoint]) || "",
|
|
1802
|
+
placeholder: _chunkHC2Q6A3Ecjs.resolveBedrockEndpoint.call(void 0, apiMode, region)
|
|
1803
|
+
});
|
|
1804
|
+
const modelResult = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1805
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1806
|
+
options: _chunkHC2Q6A3Ecjs.BEDROCK_MODELS.map((name) => ({ label: name, value: name })),
|
|
1807
|
+
allowCustomInput: true,
|
|
1808
|
+
initialIndex: Math.max(0, [..._chunkHC2Q6A3Ecjs.BEDROCK_MODELS].indexOf(_optionalChain([existing, 'optionalAccess', _34 => _34.model]) || _chunkHC2Q6A3Ecjs.BEDROCK_DEFAULT_MODEL))
|
|
1809
|
+
});
|
|
1810
|
+
if (!modelResult) return false;
|
|
1811
|
+
const model = String(modelResult.value).trim();
|
|
1812
|
+
this.state.provider = "bedrock";
|
|
1813
|
+
this.state.model = model;
|
|
1814
|
+
this.state.bedrockConfig = {
|
|
1815
|
+
model,
|
|
1816
|
+
region: region.trim(),
|
|
1817
|
+
apiMode,
|
|
1818
|
+
authMode,
|
|
1819
|
+
..._optionalChain([profile, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]) && { profile: profile.trim() },
|
|
1820
|
+
..._optionalChain([endpoint, 'optionalAccess', _37 => _37.trim, 'call', _38 => _38()]) && { endpoint: endpoint.trim() },
|
|
1821
|
+
...authMode === "bedrock-api-key" && apiKey ? { apiKey } : {}
|
|
1822
|
+
};
|
|
1823
|
+
console.log(_chalk2.default.green("\n\u2713 " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.configuredSuccessfully", { provider: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.bedrock") })));
|
|
1824
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.modelLabel", { model })));
|
|
1825
|
+
return true;
|
|
1826
|
+
}
|
|
1827
|
+
async promptBedrockApiMode(current) {
|
|
1828
|
+
const options = [
|
|
1829
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modeConverse"), value: "converse", description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modeConverseHint") },
|
|
1830
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modeOpenAIChat"), value: "openai-chat", description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modeOpenAIChatHint") },
|
|
1831
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modeOpenAIResponses"), value: "openai-responses", description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.modeOpenAIResponsesHint") }
|
|
1832
|
+
];
|
|
1833
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1834
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.chooseApiMode"),
|
|
1835
|
+
options,
|
|
1836
|
+
initialIndex: Math.max(0, options.findIndex((option) => option.value === (current || "converse")))
|
|
1837
|
+
});
|
|
1838
|
+
return _nullishCoalesce(_optionalChain([result, 'optionalAccess', _39 => _39.value]), () => ( null));
|
|
1839
|
+
}
|
|
1840
|
+
async promptBedrockAuthMode(apiMode, current) {
|
|
1841
|
+
const authMode = _chunkHC2Q6A3Ecjs.resolveBedrockAuthMode.call(void 0, apiMode, current);
|
|
1842
|
+
const options = apiMode === "converse" ? [{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.authAwsCredentials"), value: "aws-credentials", description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.authAwsCredentialsHint") }] : [{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.authBedrockApiKey"), value: "bedrock-api-key", description: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.authBedrockApiKeyHint") }];
|
|
1843
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1844
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.chooseAuthMode"),
|
|
1845
|
+
options,
|
|
1846
|
+
initialIndex: Math.max(0, options.findIndex((option) => option.value === authMode))
|
|
1847
|
+
});
|
|
1848
|
+
return _nullishCoalesce(_optionalChain([result, 'optionalAccess', _40 => _40.value]), () => ( null));
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Prompt for language selection
|
|
1852
|
+
*/
|
|
1853
|
+
async promptLanguage() {
|
|
1854
|
+
this.state.currentStep = "language";
|
|
1855
|
+
const detected = _chunkSY2P3Z5Wcjs.detectLocale.call(void 0, );
|
|
1856
|
+
console.log(_chalk2.default.gray("\n " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.language.detected", { language: _chunkSY2P3Z5Wcjs.LANGUAGE_DISPLAY_NAMES[detected.locale] })));
|
|
1857
|
+
const options = _chunkSY2P3Z5Wcjs.SUPPORTED_LOCALES.map((locale) => ({
|
|
1858
|
+
label: _chunkSY2P3Z5Wcjs.LANGUAGE_DISPLAY_NAMES[locale],
|
|
1859
|
+
value: locale
|
|
1860
|
+
}));
|
|
1861
|
+
const initialIndex = _chunkSY2P3Z5Wcjs.SUPPORTED_LOCALES.indexOf(detected.locale);
|
|
1862
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
1863
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.language.prompt"),
|
|
1864
|
+
options,
|
|
1865
|
+
initialIndex: initialIndex >= 0 ? initialIndex : 0
|
|
1866
|
+
});
|
|
1867
|
+
if (!result) {
|
|
1868
|
+
this.state.locale = detected.locale;
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
const selectedLocale = result.value;
|
|
1872
|
+
this.state.locale = selectedLocale;
|
|
1873
|
+
if (selectedLocale !== detected.locale) {
|
|
1874
|
+
await _chunkSY2P3Z5Wcjs.changeLanguage.call(void 0, selectedLocale);
|
|
1875
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.language.changed", { language: _chunkSY2P3Z5Wcjs.LANGUAGE_DISPLAY_NAMES[selectedLocale] })));
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Validate API key during setup by hitting GET /models
|
|
1880
|
+
*/
|
|
1881
|
+
async validateApiKeyDuringSetup() {
|
|
1882
|
+
if (!this.state.provider || !this.state.apiKey) return;
|
|
1883
|
+
if (!this.requiresApiKey(this.state.provider)) return;
|
|
1884
|
+
const baseUrl = this.getDefaultBaseUrl(this.state.provider);
|
|
1885
|
+
console.log(_chalk2.default.gray("\n " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.apiKeyValidation.validating")));
|
|
1886
|
+
try {
|
|
1887
|
+
const response = await fetch(`${baseUrl}/models`, {
|
|
1888
|
+
headers: { Authorization: `Bearer ${this.state.apiKey}` },
|
|
1889
|
+
signal: AbortSignal.timeout(1e4)
|
|
1890
|
+
});
|
|
1891
|
+
if (response.ok) {
|
|
1892
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.apiKeyValidation.success")));
|
|
1893
|
+
} else {
|
|
1894
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.apiKeyValidation.failed", { error: `HTTP ${response.status}` })));
|
|
1895
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.apiKeyValidation.hint")));
|
|
1896
|
+
}
|
|
1897
|
+
} catch (e13) {
|
|
1898
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.apiKeyValidation.skipped")));
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Test local provider connection (Ollama, llama.cpp, MLX)
|
|
1903
|
+
*/
|
|
1904
|
+
async testLocalProviderConnection() {
|
|
1905
|
+
if (!this.state.provider || !this.isLocalProvider(this.state.provider)) return true;
|
|
1906
|
+
this.state.currentStep = "connectionTest";
|
|
1907
|
+
const provider = this.state.provider;
|
|
1908
|
+
const baseUrl = _nullishCoalesce(this.state.providerBaseUrl, () => ( this.getDefaultBaseUrl(provider)));
|
|
1909
|
+
const endpoints = {
|
|
1910
|
+
ollama: `${baseUrl}/api/tags`,
|
|
1911
|
+
llamacpp: `${baseUrl}/health`,
|
|
1912
|
+
mlx: `${baseUrl}/v1/models`
|
|
1913
|
+
};
|
|
1914
|
+
const endpoint = endpoints[provider];
|
|
1915
|
+
if (!endpoint) return true;
|
|
1916
|
+
console.log(_chalk2.default.gray("\n " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.connectionTest.testing", { provider: this.getProviderDisplayName(provider) })));
|
|
1917
|
+
try {
|
|
1918
|
+
const response = await fetch(endpoint, { signal: AbortSignal.timeout(5e3) });
|
|
1919
|
+
if (response.ok) {
|
|
1920
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.connectionTest.success", { provider: this.getProviderDisplayName(provider) })));
|
|
1921
|
+
return true;
|
|
1922
|
+
}
|
|
1923
|
+
throw new Error(`HTTP ${response.status}`);
|
|
1924
|
+
} catch (error) {
|
|
1925
|
+
const errorMsg = error instanceof Error ? error.message : "Unknown error";
|
|
1926
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.connectionTest.failed", { provider: this.getProviderDisplayName(provider), error: errorMsg })));
|
|
1927
|
+
const hintKey = `setup.connectionTest.hint${provider.charAt(0).toUpperCase() + provider.slice(1)}`;
|
|
1928
|
+
const hint = _chunkSY2P3Z5Wcjs.t.call(void 0, hintKey);
|
|
1929
|
+
if (hint !== hintKey) {
|
|
1930
|
+
console.log(_chalk2.default.gray(" " + hint));
|
|
1931
|
+
}
|
|
1932
|
+
const continueAnyway = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1933
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.connectionTest.continueAnyway"),
|
|
1934
|
+
defaultValue: true
|
|
1935
|
+
});
|
|
1936
|
+
return continueAnyway;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
async prepareLlamaCpp() {
|
|
1940
|
+
const probe = await probeLlamaCppEnvironment(this.workspaceRoot);
|
|
1941
|
+
let detectedPort = probe.port;
|
|
1942
|
+
if (probe.baseUrl) {
|
|
1943
|
+
this.state.providerBaseUrl = probe.baseUrl;
|
|
1944
|
+
console.log(_chalk2.default.green(` Detected llama.cpp server at ${probe.baseUrl}`));
|
|
1945
|
+
} else if (probe.installed) {
|
|
1946
|
+
console.log(_chalk2.default.gray(" llama.cpp is installed but no running server was detected."));
|
|
1947
|
+
} else if (!probe.installPlan) {
|
|
1948
|
+
console.log(_chalk2.default.yellow(" llama.cpp is not installed and no supported package manager was detected."));
|
|
1949
|
+
} else {
|
|
1950
|
+
console.log(_chalk2.default.yellow(` llama.cpp is not installed. Autohand can install it with: ${probe.installPlan.label}`));
|
|
1951
|
+
const shouldInstall = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
1952
|
+
title: "Install llama.cpp now?",
|
|
1953
|
+
defaultValue: true
|
|
1954
|
+
});
|
|
1955
|
+
if (shouldInstall) {
|
|
1956
|
+
console.log(_chalk2.default.gray(` Installing llama.cpp with ${probe.installPlan.label}...`));
|
|
1957
|
+
const install = await installLlamaCpp(probe.installPlan, this.workspaceRoot);
|
|
1958
|
+
if (!install.ok) {
|
|
1959
|
+
console.log(_chalk2.default.red(" llama.cpp installation failed."));
|
|
1960
|
+
if (install.output) {
|
|
1961
|
+
console.log(_chalk2.default.gray(` ${install.output}`));
|
|
1962
|
+
}
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
console.log(_chalk2.default.green(" llama.cpp installation completed."));
|
|
1966
|
+
const refreshed = await probeLlamaCppEnvironment(this.workspaceRoot);
|
|
1967
|
+
detectedPort = refreshed.port;
|
|
1968
|
+
if (refreshed.baseUrl) {
|
|
1969
|
+
this.state.providerBaseUrl = refreshed.baseUrl;
|
|
1970
|
+
console.log(_chalk2.default.green(` Detected llama.cpp server at ${refreshed.baseUrl}`));
|
|
1971
|
+
} else {
|
|
1972
|
+
console.log(_chalk2.default.gray(" Start llama-server with your model, then Autohand will connect on the detected port."));
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
const port = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
1977
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.llamacpp.serverPort"),
|
|
1978
|
+
defaultValue: String(_nullishCoalesce(detectedPort, () => ( 80)))
|
|
1979
|
+
});
|
|
1980
|
+
if (!port) {
|
|
1981
|
+
return false;
|
|
1982
|
+
}
|
|
1983
|
+
this.state.providerBaseUrl = `http://localhost:${port}`;
|
|
1984
|
+
return true;
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Prompt for permission mode selection
|
|
1988
|
+
*/
|
|
1989
|
+
async promptPermissions() {
|
|
1990
|
+
this.state.currentStep = "permissions";
|
|
1991
|
+
console.log();
|
|
1992
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1993
|
+
console.log(_chalk2.default.white.bold(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.title")));
|
|
1994
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1995
|
+
console.log();
|
|
1996
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.description")));
|
|
1997
|
+
console.log();
|
|
1998
|
+
const options = [
|
|
1999
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.interactive"), value: "interactive" },
|
|
2000
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.unrestricted"), value: "unrestricted" },
|
|
2001
|
+
{ label: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.restricted"), value: "restricted" }
|
|
2002
|
+
];
|
|
2003
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
2004
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.title"),
|
|
2005
|
+
options
|
|
2006
|
+
});
|
|
2007
|
+
const mode = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _41 => _41.value]), () => ( "interactive"));
|
|
2008
|
+
this.state.permissionMode = mode;
|
|
2009
|
+
if (mode === "unrestricted") {
|
|
2010
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.warning")));
|
|
2011
|
+
}
|
|
2012
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.set", { mode })));
|
|
2013
|
+
const rememberSession = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2014
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.permissions.rememberPrompt"),
|
|
2015
|
+
defaultValue: true
|
|
2016
|
+
});
|
|
2017
|
+
this.state.rememberSession = rememberSession;
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* Check workspace safety
|
|
2021
|
+
*/
|
|
2022
|
+
async checkWorkspaceStep() {
|
|
2023
|
+
this.state.currentStep = "workspaceSafety";
|
|
2024
|
+
console.log(_chalk2.default.gray("\n " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.workspaceSafety.checking")));
|
|
2025
|
+
const result = _chunkWGNMOVMTcjs.checkWorkspaceSafety.call(void 0, this.workspaceRoot);
|
|
2026
|
+
if (result.safe) {
|
|
2027
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.workspaceSafety.safe")));
|
|
2028
|
+
return true;
|
|
2029
|
+
}
|
|
2030
|
+
_chunkWGNMOVMTcjs.printDangerousWorkspaceWarning.call(void 0, this.workspaceRoot, result);
|
|
2031
|
+
console.log(_chalk2.default.yellow(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.workspaceSafety.unsafe", { reason: result.reason || "" })));
|
|
2032
|
+
const continueUnsafe = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2033
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.workspaceSafety.continueUnsafe"),
|
|
2034
|
+
defaultValue: false
|
|
2035
|
+
});
|
|
2036
|
+
return continueUnsafe;
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* Prompt for notification preferences
|
|
2040
|
+
*/
|
|
2041
|
+
async promptNotifications() {
|
|
2042
|
+
this.state.currentStep = "notifications";
|
|
2043
|
+
console.log();
|
|
2044
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
2045
|
+
console.log(_chalk2.default.white.bold(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.notifications.title")));
|
|
2046
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
2047
|
+
console.log();
|
|
2048
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.notifications.description")));
|
|
2049
|
+
console.log();
|
|
2050
|
+
const enabled = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2051
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.notifications.enablePrompt"),
|
|
2052
|
+
defaultValue: true
|
|
2053
|
+
});
|
|
2054
|
+
let sound = true;
|
|
2055
|
+
if (enabled) {
|
|
2056
|
+
sound = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2057
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.notifications.soundPrompt"),
|
|
2058
|
+
defaultValue: true
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
this.state.notifications = { enabled, sound };
|
|
2062
|
+
}
|
|
2063
|
+
/**
|
|
2064
|
+
* Prompt for network settings
|
|
2065
|
+
*/
|
|
2066
|
+
async promptNetwork() {
|
|
2067
|
+
this.state.currentStep = "network";
|
|
2068
|
+
const needCustom = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2069
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.network.needCustom"),
|
|
2070
|
+
defaultValue: false
|
|
2071
|
+
});
|
|
2072
|
+
if (!needCustom) {
|
|
2073
|
+
this.state.skipped.push("network");
|
|
2074
|
+
return;
|
|
2075
|
+
}
|
|
2076
|
+
const maxRetriesStr = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
2077
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.network.maxRetries"),
|
|
2078
|
+
defaultValue: "3",
|
|
2079
|
+
validate: (val) => {
|
|
2080
|
+
const n = parseInt(val, 10);
|
|
2081
|
+
if (isNaN(n) || n < 1 || n > 5) return "Enter a number between 1 and 5";
|
|
2082
|
+
return true;
|
|
2083
|
+
}
|
|
2084
|
+
});
|
|
2085
|
+
const timeoutStr = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
2086
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.network.timeout"),
|
|
2087
|
+
defaultValue: "30000",
|
|
2088
|
+
validate: (val) => {
|
|
2089
|
+
const n = parseInt(val, 10);
|
|
2090
|
+
if (isNaN(n) || n < 5e3 || n > 12e4) return "Enter a number between 5000 and 120000";
|
|
2091
|
+
return true;
|
|
2092
|
+
}
|
|
2093
|
+
});
|
|
2094
|
+
this.state.network = {
|
|
2095
|
+
maxRetries: parseInt(maxRetriesStr || "3", 10),
|
|
2096
|
+
timeout: parseInt(timeoutStr || "30000", 10)
|
|
2097
|
+
};
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Prompt for web search provider
|
|
2101
|
+
*/
|
|
2102
|
+
async promptSearch() {
|
|
2103
|
+
this.state.currentStep = "search";
|
|
2104
|
+
const options = [
|
|
2105
|
+
{ label: "Google", value: "google", description: "Default web search" },
|
|
2106
|
+
{ label: "Brave Search", value: "brave", description: "Privacy-focused search (requires API key)" },
|
|
2107
|
+
{ label: "DuckDuckGo", value: "duckduckgo", description: "Privacy-focused, no API key needed" },
|
|
2108
|
+
{ label: "Parallel.ai", value: "parallel", description: "AI-optimized search (requires API key)" }
|
|
2109
|
+
];
|
|
2110
|
+
const result = await _chunkCK4HAHVYcjs.showModal.call(void 0, {
|
|
2111
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.search.prompt"),
|
|
2112
|
+
options
|
|
2113
|
+
});
|
|
2114
|
+
const provider = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _42 => _42.value]), () => ( "google"));
|
|
2115
|
+
const searchState = { provider };
|
|
2116
|
+
if (provider === "brave") {
|
|
2117
|
+
const key = await _chunkCK4HAHVYcjs.showPassword.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.search.braveKeyPrompt"), placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder") });
|
|
2118
|
+
if (key) searchState.braveApiKey = key;
|
|
2119
|
+
} else if (provider === "parallel") {
|
|
2120
|
+
const key = await _chunkCK4HAHVYcjs.showPassword.call(void 0, { title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.search.parallelKeyPrompt"), placeholder: _chunkSY2P3Z5Wcjs.t.call(void 0, "ui.apiKeyPlaceholder") });
|
|
2121
|
+
if (key) searchState.parallelApiKey = key;
|
|
2122
|
+
}
|
|
2123
|
+
this.state.search = searchState;
|
|
2124
|
+
}
|
|
2125
|
+
/**
|
|
2126
|
+
* Prompt for MCP support
|
|
2127
|
+
*/
|
|
2128
|
+
async promptMcp() {
|
|
2129
|
+
this.state.currentStep = "mcp";
|
|
2130
|
+
console.log();
|
|
2131
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.mcp.description")));
|
|
2132
|
+
console.log();
|
|
2133
|
+
const enabled = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2134
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.mcp.enablePrompt"),
|
|
2135
|
+
defaultValue: true
|
|
2136
|
+
});
|
|
2137
|
+
this.state.mcpEnabled = enabled;
|
|
2138
|
+
if (enabled) {
|
|
2139
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.mcp.enabled")));
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* Prompt for agent behavior settings
|
|
2144
|
+
*/
|
|
2145
|
+
async promptAgentBehavior() {
|
|
2146
|
+
this.state.currentStep = "agentBehavior";
|
|
2147
|
+
const maxIterStr = await _chunkCK4HAHVYcjs.showInput.call(void 0, {
|
|
2148
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.agent.maxIterationsPrompt"),
|
|
2149
|
+
defaultValue: "100",
|
|
2150
|
+
validate: (val) => {
|
|
2151
|
+
const n = parseInt(val, 10);
|
|
2152
|
+
if (isNaN(n) || n < 10 || n > 500) return "Enter a number between 10 and 500";
|
|
2153
|
+
return true;
|
|
2154
|
+
}
|
|
2155
|
+
});
|
|
2156
|
+
const debug = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2157
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.agent.debugPrompt"),
|
|
2158
|
+
defaultValue: false
|
|
2159
|
+
});
|
|
2160
|
+
this.state.agentSettings = {
|
|
2161
|
+
maxIterations: parseInt(maxIterStr || "100", 10),
|
|
2162
|
+
debug
|
|
2163
|
+
};
|
|
2164
|
+
console.log(_chalk2.default.green(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.agent.set")));
|
|
2165
|
+
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Prompt for community skills
|
|
2168
|
+
*/
|
|
2169
|
+
async promptCommunitySkills() {
|
|
2170
|
+
this.state.currentStep = "communitySkills";
|
|
2171
|
+
console.log();
|
|
2172
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.communitySkills.description")));
|
|
2173
|
+
console.log();
|
|
2174
|
+
const enabled = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2175
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.communitySkills.enablePrompt"),
|
|
2176
|
+
defaultValue: true
|
|
2177
|
+
});
|
|
2178
|
+
this.state.communitySkillsEnabled = enabled;
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* Show review summary and confirm settings
|
|
2182
|
+
*/
|
|
2183
|
+
async promptReviewConfirm() {
|
|
2184
|
+
this.state.currentStep = "reviewSummary";
|
|
2185
|
+
console.log();
|
|
2186
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
2187
|
+
console.log(_chalk2.default.white.bold(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.review.title")));
|
|
2188
|
+
console.log(_chalk2.default.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
2189
|
+
console.log();
|
|
2190
|
+
if (this.state.locale) {
|
|
2191
|
+
console.log(_chalk2.default.white(` Language: ${_chunkSY2P3Z5Wcjs.LANGUAGE_DISPLAY_NAMES[this.state.locale]}`));
|
|
2192
|
+
}
|
|
2193
|
+
if (this.state.provider) {
|
|
2194
|
+
console.log(_chalk2.default.white(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.review.provider", { provider: this.getProviderDisplayName(this.state.provider) })));
|
|
2195
|
+
}
|
|
2196
|
+
if (this.state.model) {
|
|
2197
|
+
console.log(_chalk2.default.white(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.review.model", { model: this.state.model })));
|
|
2198
|
+
}
|
|
2199
|
+
if (this.state.reasoningEffort) {
|
|
2200
|
+
console.log(_chalk2.default.white(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.config.reasoningEffortLabel", { level: this.state.reasoningEffort })));
|
|
2201
|
+
}
|
|
2202
|
+
if (this.state.permissionMode) {
|
|
2203
|
+
console.log(_chalk2.default.white(` Permissions: ${this.state.permissionMode}`));
|
|
2204
|
+
}
|
|
2205
|
+
console.log(_chalk2.default.white(` Telemetry: ${this.state.telemetryEnabled ? "enabled" : "disabled"}`));
|
|
2206
|
+
console.log(_chalk2.default.white(` Auto-report: ${this.state.autoReportEnabled ? "enabled" : "disabled"}`));
|
|
2207
|
+
if (this.state.notifications) {
|
|
2208
|
+
console.log(_chalk2.default.white(` Notifications: ${this.state.notifications.enabled ? "enabled" : "disabled"}`));
|
|
2209
|
+
}
|
|
2210
|
+
if (_optionalChain([this, 'access', _43 => _43.state, 'access', _44 => _44.search, 'optionalAccess', _45 => _45.provider])) {
|
|
2211
|
+
console.log(_chalk2.default.white(` Search: ${this.state.search.provider}`));
|
|
2212
|
+
}
|
|
2213
|
+
if (this.state.mcpEnabled !== void 0) {
|
|
2214
|
+
console.log(_chalk2.default.white(` MCP: ${this.state.mcpEnabled ? "enabled" : "disabled"}`));
|
|
2215
|
+
}
|
|
2216
|
+
if (this.state.authUser) {
|
|
2217
|
+
console.log(_chalk2.default.white(` Account: ${this.state.authUser.email}`));
|
|
2218
|
+
}
|
|
2219
|
+
console.log();
|
|
2220
|
+
const confirmed = await _chunkCK4HAHVYcjs.showConfirm.call(void 0, {
|
|
2221
|
+
title: _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.review.confirm"),
|
|
2222
|
+
defaultValue: true
|
|
2223
|
+
});
|
|
2224
|
+
if (!confirmed) {
|
|
2225
|
+
console.log(_chalk2.default.gray(" " + _chunkSY2P3Z5Wcjs.t.call(void 0, "setup.review.goBack")));
|
|
2226
|
+
}
|
|
2227
|
+
return confirmed;
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Check if a provider is local (no API key, has server to test)
|
|
2231
|
+
*/
|
|
2232
|
+
isLocalProvider(provider) {
|
|
2233
|
+
return provider === "ollama" || provider === "llamacpp" || provider === "mlx";
|
|
2234
|
+
}
|
|
2235
|
+
// Helper methods
|
|
2236
|
+
requiresApiKey(provider) {
|
|
2237
|
+
return provider === "openrouter" || provider === "llmgateway" || provider === "zai" || provider === "vertexai" || provider === "xai" || provider === "cerebras" || provider === "nvidia" || provider === "deepseek";
|
|
2238
|
+
}
|
|
2239
|
+
getProviderDisplayName(provider) {
|
|
2240
|
+
return _chunkSY2P3Z5Wcjs.t.call(void 0, `providers.${provider}`);
|
|
2241
|
+
}
|
|
2242
|
+
getProviderHint(provider) {
|
|
2243
|
+
return _chunkSY2P3Z5Wcjs.t.call(void 0, `providers.hints.${provider}`);
|
|
2244
|
+
}
|
|
2245
|
+
getApiKeyUrl(provider) {
|
|
2246
|
+
const urls = {
|
|
2247
|
+
openrouter: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.openrouter.apiKeyUrl"),
|
|
2248
|
+
openai: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.openai.apiKeyUrl"),
|
|
2249
|
+
llmgateway: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.llmgateway.apiKeyUrl"),
|
|
2250
|
+
zai: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.zai.apiKeyUrl"),
|
|
2251
|
+
nvidia: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.nvidia.apiKeyUrl"),
|
|
2252
|
+
deepseek: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.deepseek.apiKeyUrl"),
|
|
2253
|
+
bedrock: _chunkSY2P3Z5Wcjs.t.call(void 0, "providers.wizard.bedrock.apiKeyUrl")
|
|
2254
|
+
};
|
|
2255
|
+
return urls[provider] || "";
|
|
2256
|
+
}
|
|
2257
|
+
getDefaultModel(provider) {
|
|
2258
|
+
const defaults = {
|
|
2259
|
+
openrouter: "nvidia/nemotron-3-super-120b-a12b:free",
|
|
2260
|
+
openai: "gpt-5.4",
|
|
2261
|
+
ollama: "llama3.2:latest",
|
|
2262
|
+
llamacpp: "local",
|
|
2263
|
+
mlx: "mlx-community/Llama-3.2-3B-Instruct-4bit",
|
|
2264
|
+
llmgateway: "gpt-4o",
|
|
2265
|
+
azure: "gpt-5.3-codex",
|
|
2266
|
+
zai: "glm-4.5",
|
|
2267
|
+
vertexai: "zai-org/glm-5-maas",
|
|
2268
|
+
xai: "grok-4.20-reasoning",
|
|
2269
|
+
cerebras: "zai-glm-4.7",
|
|
2270
|
+
nvidia: "mistralai/mixtral-8x7b-instruct-v0.1",
|
|
2271
|
+
deepseek: "deepseek-v4-flash",
|
|
2272
|
+
bedrock: _chunkHC2Q6A3Ecjs.BEDROCK_DEFAULT_MODEL
|
|
2273
|
+
};
|
|
2274
|
+
return defaults[provider] || "";
|
|
2275
|
+
}
|
|
2276
|
+
getDefaultBaseUrl(provider) {
|
|
2277
|
+
const urls = {
|
|
2278
|
+
openrouter: "https://openrouter.ai/api/v1",
|
|
2279
|
+
openai: "https://api.openai.com/v1",
|
|
2280
|
+
ollama: "http://localhost:11434",
|
|
2281
|
+
llamacpp: "http://localhost:8080",
|
|
2282
|
+
mlx: "http://localhost:8080",
|
|
2283
|
+
llmgateway: "https://api.llmgateway.io/v1",
|
|
2284
|
+
azure: "https://{resourceName}.openai.azure.com",
|
|
2285
|
+
zai: _chunkHC2Q6A3Ecjs.ZAI_DEFAULT_BASE_URL,
|
|
2286
|
+
vertexai: "https://aiplatform.googleapis.com",
|
|
2287
|
+
xai: "https://api.x.ai/v1",
|
|
2288
|
+
cerebras: _chunkHC2Q6A3Ecjs.CEREBRAS_DEFAULT_BASE_URL,
|
|
2289
|
+
nvidia: "https://integrate.api.nvidia.com/v1",
|
|
2290
|
+
deepseek: _chunkHC2Q6A3Ecjs.DEEPSEEK_DEFAULT_BASE_URL,
|
|
2291
|
+
bedrock: `https://bedrock-runtime.${_chunkHC2Q6A3Ecjs.BEDROCK_DEFAULT_REGION}.amazonaws.com`
|
|
2292
|
+
};
|
|
2293
|
+
return urls[provider] || "";
|
|
2294
|
+
}
|
|
2295
|
+
getExistingApiKey(provider) {
|
|
2296
|
+
if (!this.existingConfig) return null;
|
|
2297
|
+
const config = this.existingConfig[provider];
|
|
2298
|
+
return _optionalChain([config, 'optionalAccess', _46 => _46.apiKey]) || null;
|
|
2299
|
+
}
|
|
2300
|
+
getExistingOpenAIAuthMode() {
|
|
2301
|
+
const config = _optionalChain([this, 'access', _47 => _47.existingConfig, 'optionalAccess', _48 => _48.openai]);
|
|
2302
|
+
return _optionalChain([config, 'optionalAccess', _49 => _49.authMode]) === "chatgpt" ? "chatgpt" : "api-key";
|
|
2303
|
+
}
|
|
2304
|
+
getExistingOpenAIChatGPTAuth() {
|
|
2305
|
+
const auth = _optionalChain([this, 'access', _50 => _50.existingConfig, 'optionalAccess', _51 => _51.openai, 'optionalAccess', _52 => _52.chatgptAuth]);
|
|
2306
|
+
return auth && auth.accessToken && auth.accountId ? auth : null;
|
|
2307
|
+
}
|
|
2308
|
+
isOpenAIConfigured(config) {
|
|
2309
|
+
if (config.authMode === "chatgpt") {
|
|
2310
|
+
return !!_optionalChain([config, 'access', _53 => _53.chatgptAuth, 'optionalAccess', _54 => _54.accessToken]) && !!_optionalChain([config, 'access', _55 => _55.chatgptAuth, 'optionalAccess', _56 => _56.accountId]);
|
|
2311
|
+
}
|
|
2312
|
+
return !!config.apiKey && config.apiKey !== "replace-me" && config.apiKey.length >= 10;
|
|
2313
|
+
}
|
|
2314
|
+
isCancellation(error) {
|
|
2315
|
+
if (error && typeof error === "object") {
|
|
2316
|
+
const e = error;
|
|
2317
|
+
return e.code === "ERR_USE_AFTER_CLOSE" || _optionalChain([e, 'access', _57 => _57.message, 'optionalAccess', _58 => _58.includes, 'call', _59 => _59("cancelled")]) || _optionalChain([e, 'access', _60 => _60.message, 'optionalAccess', _61 => _61.includes, 'call', _62 => _62("canceled")]);
|
|
2318
|
+
}
|
|
2319
|
+
return false;
|
|
2320
|
+
}
|
|
2321
|
+
async pressEnter() {
|
|
2322
|
+
console.log(_chalk2.default.gray(" Press Enter to continue..."));
|
|
2323
|
+
await new Promise((resolve) => {
|
|
2324
|
+
process.stdin.once("data", () => resolve());
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
exports.ProjectAnalyzer = ProjectAnalyzer; exports.AgentsGenerator = AgentsGenerator; exports.probeLlamaCppEnvironment = probeLlamaCppEnvironment; exports.installLlamaCpp = installLlamaCpp; exports.SetupWizard = SetupWizard;
|
|
2336
|
+
/**
|
|
2337
|
+
* @license
|
|
2338
|
+
* Copyright 2025 Autohand AI LLC
|
|
2339
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
2340
|
+
*/
|