autohand-cli 0.8.2 → 0.9.0
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 +173 -74
- package/dist/AgentRegistry-EGBDIUAK.cjs +10 -0
- package/dist/{AgentRegistry-7LDL5HJH.js → AgentRegistry-XPWSVO3Q.js} +3 -3
- package/dist/{AutomodeManager-MWLKGPZK.js → AutomodeManager-APLLPEYJ.js} +32 -18
- package/dist/{AutomodeManager-NYIZNODK.cjs → AutomodeManager-MPSXT2RH.cjs} +38 -24
- package/dist/CommunitySkillsCache-2OIUV227.cjs +8 -0
- package/dist/CommunitySkillsCache-ZEQWP6YM.js +8 -0
- package/dist/GitHubRegistryFetcher-CYJLF2XL.cjs +7 -0
- package/dist/{GitHubRegistryFetcher-6JQ5JEDZ.js → GitHubRegistryFetcher-J2BWPXJF.js} +2 -2
- package/dist/HookManager-CWLTFKWO.js +7 -0
- package/dist/HookManager-TMAJQU4S.cjs +7 -0
- package/dist/{ImportWizard-35YBJ4AM.cjs → ImportWizard-MQXEED2U.cjs} +41 -17
- package/dist/{ImportWizard-XH7CINCH.js → ImportWizard-QBKQEXDW.js} +35 -11
- package/dist/LearnAdvisor-46FG2XIP.js +9 -0
- package/dist/LearnAdvisor-XBRDNAGH.cjs +9 -0
- package/dist/McpClientManager-BNSKLHIN.cjs +8 -0
- package/dist/{McpClientManager-7RM6YT35.js → McpClientManager-SL35BR24.js} +2 -2
- package/dist/MemoryManager-34L4YOKA.cjs +8 -0
- package/dist/MemoryManager-WJMLPWGU.js +8 -0
- package/dist/NVIDIAProvider-2HR737UE.js +14 -0
- package/dist/NVIDIAProvider-MVTL62PR.cjs +14 -0
- package/dist/PermissionManager-5OOJ7FAT.cjs +11 -0
- package/dist/{PermissionManager-ATUV34LQ.js → PermissionManager-KMYILJ4Z.js} +4 -4
- package/dist/{ProjectProfiler-ZDWR2ODG.cjs → ProjectProfiler-CDAE7ECW.cjs} +2 -1
- package/dist/{ProjectProfiler-UMJJSOCE.js → ProjectProfiler-NZTJDRHD.js} +2 -1
- package/dist/ProviderFactory-C3YPXTDD.cjs +11 -0
- package/dist/ProviderFactory-HFPRVQ25.js +11 -0
- package/dist/SessionManager-PNBTJJTQ.js +10 -0
- package/dist/SessionManager-WAPTFMDO.cjs +10 -0
- package/dist/SkillsRegistry-4RRD5GMX.js +9 -0
- package/dist/SkillsRegistry-7AJP74GJ.cjs +9 -0
- package/dist/SubAgent-FDIH3DXB.js +11 -0
- package/dist/SubAgent-HVL2ICVZ.cjs +11 -0
- package/dist/{SyncApiClient-LVIO4C2S.js → SyncApiClient-LRPFNCKJ.js} +2 -2
- package/dist/SyncApiClient-VMBOLQ6H.cjs +11 -0
- package/dist/about-BW3PDZUU.js +14 -0
- package/dist/about-FCAX37YC.cjs +14 -0
- package/dist/acp-EOETGAHC.cjs +1517 -0
- package/dist/acp-VHEL7BOW.js +1517 -0
- package/dist/actionExecutor-33I47NZS.js +24 -0
- package/dist/actionExecutor-4YBMR3YH.cjs +24 -0
- package/dist/add-dir-7SS6KSH5.cjs +11 -0
- package/dist/add-dir-VFX7QT4E.js +11 -0
- package/dist/agent-DMRUFU4M.cjs +116 -0
- package/dist/agent-WCJEYQJT.js +116 -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-CHROO3VU.cjs +17 -0
- package/dist/agents-UVDUL65K.js +17 -0
- package/dist/agents-new-AUBWSOXP.js +17 -0
- package/dist/agents-new-Y562WC47.cjs +17 -0
- package/dist/{autoSkill-6TGBTEQD.js → autoSkill-EFMK6WU6.js} +3 -3
- package/dist/autoSkill-YOLLFTP2.cjs +20 -0
- package/dist/automode-BMYSRM34.js +10 -0
- package/dist/automode-DBLKTTKD.cjs +10 -0
- package/dist/browserToolBridge-BXRQB4B4.cjs +58 -0
- package/dist/browserToolBridge-F5N66PE7.js +58 -0
- package/dist/{cc-7LEIJ3KF.js → cc-AYEP2CA3.js} +1 -1
- package/dist/{cc-Q5MM4AWC.cjs → cc-S2QLQFBR.cjs} +1 -1
- package/dist/chrome-ATC4OO5I.cjs +20 -0
- package/dist/chrome-NHJ44WUN.js +50 -0
- package/dist/chrome-O62WXV7F.js +20 -0
- package/dist/chrome-XHJLCO4M.cjs +50 -0
- package/dist/chromeSkill-53TH55PM.js +105 -0
- package/dist/chromeSkill-THW7N4IY.cjs +105 -0
- package/dist/{chunk-HOAHWIQ5.cjs → chunk-2CGE7ZV3.cjs} +26 -26
- package/dist/chunk-2H5O745H.js +63 -0
- package/dist/chunk-2HOLOHVK.js +2219 -0
- package/dist/{chunk-3PDTTAKJ.js → chunk-2QL6MNXG.js} +15 -8
- package/dist/{chunk-PGRH5Q77.cjs → chunk-2VHB43IX.cjs} +35 -6
- package/dist/{chunk-VG34MG2U.js → chunk-37M5UM6I.js} +9 -6
- package/dist/{chunk-6HYLHBQG.cjs → chunk-3DDL2E55.cjs} +20 -16
- package/dist/chunk-3EDDDZS2.cjs +5 -0
- package/dist/{chunk-6OYHF6MF.js → chunk-3GUEUCZK.js} +28 -4
- package/dist/{chunk-N254NRHT.cjs → chunk-3HT76LNN.cjs} +9 -2
- package/dist/{chunk-DVUHHH3B.cjs → chunk-3KLSNNRW.cjs} +4 -4
- package/dist/chunk-3LJJG5YY.cjs +387 -0
- package/dist/chunk-3OF56EMA.cjs +197 -0
- package/dist/chunk-3PXKRVCW.js +108 -0
- package/dist/{chunk-IKGWDOGU.cjs → chunk-3S563FNF.cjs} +160 -79
- package/dist/chunk-3UT7R3XV.js +663 -0
- package/dist/chunk-4256YRCO.cjs +80 -0
- package/dist/chunk-46C73ZKK.cjs +663 -0
- package/dist/chunk-46MTALKD.js +44 -0
- package/dist/{chunk-AEJH23FO.cjs → chunk-47PHDKNW.cjs} +6 -6
- package/dist/chunk-4LMUDS2K.js +124 -0
- package/dist/{chunk-HLHTG5ZU.cjs → chunk-5CMYEM3R.cjs} +14 -12
- package/dist/{chunk-MBBY4ZIK.js → chunk-5F6ZKSHO.js} +4 -1
- package/dist/chunk-5JFTY3VU.js +74 -0
- package/dist/chunk-5JTTM5SC.js +59 -0
- package/dist/{chunk-IETRBBMP.cjs → chunk-5K3CDSWZ.cjs} +108 -31
- package/dist/{chunk-GJH7XMSK.js → chunk-5VHP6HDQ.js} +8 -6
- package/dist/{chunk-6ZCULLCA.js → chunk-62RTC3XX.js} +1 -1
- package/dist/{chunk-MSED7RH2.cjs → chunk-6GUODJKM.cjs} +112 -41
- package/dist/{chunk-47CKWKEX.cjs → chunk-6HH236FV.cjs} +9 -4
- package/dist/{chunk-WHE2SWHU.js → chunk-6NVAK6CK.js} +2 -2
- package/dist/chunk-6R25D2H5.js +121 -0
- package/dist/{chunk-3PCTTUNW.cjs → chunk-6XVVIY54.cjs} +55 -25
- package/dist/{chunk-3L53OA4E.cjs → chunk-75EDROHL.cjs} +10 -10
- package/dist/{chunk-G4CAKI3V.js → chunk-7HPWMALN.js} +7 -2
- package/dist/chunk-7JLT2VNW.cjs +18963 -0
- package/dist/chunk-7LWQCE4Y.cjs +987 -0
- package/dist/{chunk-OLSBBZW6.cjs → chunk-7MU7LWF3.cjs} +5 -5
- package/dist/{chunk-HLQV64Y5.js → chunk-7RFJB75Y.js} +140 -59
- package/dist/{chunk-X2MSVKDV.js → chunk-A7HHCIDQ.js} +2 -2
- package/dist/{chunk-SKYG33B2.cjs → chunk-AC7DZ6SK.cjs} +3 -3
- package/dist/{chunk-XX2ZO7DS.js → chunk-ACDQGA4Z.js} +90 -16
- package/dist/{chunk-CZXGCVTR.cjs → chunk-AOKCI722.cjs} +2 -2
- package/dist/chunk-ARBEHFCG.js +715 -0
- package/dist/{chunk-OOKY3HPZ.js → chunk-AT7OWLY5.js} +50 -9
- package/dist/chunk-AU6JAGZJ.cjs +231 -0
- package/dist/chunk-AUFNACED.js +18963 -0
- package/dist/{chunk-CDBPBM2K.cjs → chunk-AUYSIEVV.cjs} +3 -3
- package/dist/chunk-B4HSNOIH.cjs +354 -0
- package/dist/{chunk-EGMZDTSL.js → chunk-B5CGDNMR.js} +10 -2
- package/dist/{chunk-34M3HWLR.js → chunk-BFQDQRDE.js} +2 -2
- package/dist/{chunk-2AA5MFES.js → chunk-BL2UC7HC.js} +8 -5
- package/dist/{chunk-LNMYK2F5.cjs → chunk-BQ22N3TX.cjs} +56 -41
- package/dist/chunk-BQU3HAE7.js +21 -0
- package/dist/chunk-BWF4VDYE.js +3897 -0
- package/dist/chunk-BYE7RQFZ.cjs +121 -0
- package/dist/{chunk-APIXPPMT.js → chunk-CBFH2J3O.js} +855 -33
- package/dist/chunk-CCVMREXI.js +420 -0
- package/dist/chunk-CFAWTLSC.js +13 -0
- package/dist/{chunk-G27PQQFD.js → chunk-CFFE4VA3.js} +1 -1
- package/dist/{chunk-ZYQMLKOK.cjs → chunk-CH2J4PVE.cjs} +212 -70
- package/dist/{chunk-7BTSG4ME.cjs → chunk-CHI52KFR.cjs} +855 -33
- package/dist/{chunk-DJDE4DTT.cjs → chunk-CWINVFRI.cjs} +25 -19
- package/dist/{chunk-HXGBSJL5.cjs → chunk-D2OSPLYC.cjs} +2 -2
- package/dist/{chunk-GBHDROGL.js → chunk-D6GZBSOX.js} +16 -4
- package/dist/{chunk-CNBKZEX5.cjs → chunk-DA7NBAJK.cjs} +49 -17
- package/dist/chunk-DEQVRSV5.cjs +866 -0
- package/dist/{chunk-RGR6ME5J.cjs → chunk-DI57A4BX.cjs} +25 -28
- package/dist/{chunk-WM5PAOTQ.cjs → chunk-DIZTWFVR.cjs} +1649 -484
- package/dist/{chunk-YZXUDM5X.js → chunk-DLP436GI.js} +204 -62
- package/dist/{chunk-OHUZKDGX.js → chunk-DMRXF5DU.js} +3 -3
- package/dist/{chunk-U46VYPLR.cjs → chunk-DPSIGY6L.cjs} +9 -9
- package/dist/{chunk-DN573ME7.cjs → chunk-DRWDEHE5.cjs} +4 -4
- package/dist/{chunk-SEKD5FH3.cjs → chunk-E26KKI46.cjs} +5 -2
- package/dist/{chunk-J4Q7XR3G.js → chunk-E46DJH5S.js} +3 -3
- package/dist/{chunk-Q7XSCYND.cjs → chunk-E6GFD7VR.cjs} +49 -26
- package/dist/chunk-ES2HJQ4N.js +37 -0
- package/dist/chunk-EZJHLOWP.js +80 -0
- package/dist/chunk-FFBDRUO5.cjs +59 -0
- package/dist/{chunk-AYSFIUFW.js → chunk-FGT6KK6T.js} +38 -15
- package/dist/{chunk-SAHBLB3E.js → chunk-FP46B4X3.js} +208 -3
- package/dist/{chunk-DSPQEHDT.js → chunk-FQAVGSPW.js} +2 -2
- package/dist/chunk-FQVG6ZHF.js +197 -0
- package/dist/chunk-GBMDFWJX.cjs +152 -0
- package/dist/{chunk-DRE2RXBZ.js → chunk-GGLKUENP.js} +1605 -440
- package/dist/{chunk-S52YW5ZQ.js → chunk-GNBBIAMD.js} +16 -19
- package/dist/{chunk-MYISNQH4.js → chunk-GWO66KBI.js} +1 -1
- package/dist/chunk-GWY26SUD.cjs +63 -0
- package/dist/{chunk-YGN4CQIP.js → chunk-GZ6DV2UG.js} +1 -1
- package/dist/{chunk-EZMINVLU.js → chunk-H4D2Q2AL.js} +5 -2
- package/dist/chunk-HDK2EHVH.cjs +570 -0
- package/dist/chunk-HJIXWGQZ.js +139 -0
- package/dist/{chunk-6RF7UKUS.js → chunk-HKYZSUQ5.js} +48 -47
- package/dist/{chunk-LQGVEP3E.js → chunk-HQUSEWT4.js} +45 -13
- package/dist/{chunk-HTLINWX6.cjs → chunk-HQWQZML5.cjs} +16 -13
- package/dist/{chunk-DVZOENQ7.cjs → chunk-HS4USDND.cjs} +9 -4
- package/dist/chunk-HSCUPEA4.cjs +3897 -0
- package/dist/{chunk-JCLYQ2JC.js → chunk-HXJEGMGB.js} +12 -6
- package/dist/{chunk-LJFUXC56.cjs → chunk-HXQREVTA.cjs} +9 -6
- package/dist/{chunk-SCXX4LW5.js → chunk-I24CWKKK.js} +15 -8
- package/dist/chunk-IAGCRVJ3.js +355 -0
- package/dist/chunk-IEXKKKOF.cjs +92 -0
- package/dist/{chunk-5IXII4HX.cjs → chunk-IGMPWJ2I.cjs} +19 -12
- package/dist/chunk-IKUMVBCW.cjs +33 -0
- package/dist/{chunk-XTB6VJVQ.cjs → chunk-J2K57QM7.cjs} +6 -6
- package/dist/{chunk-O4IF4NJT.cjs → chunk-J5ADZN6V.cjs} +57 -56
- package/dist/chunk-J5HE6CUM.cjs +124 -0
- package/dist/{chunk-JS7IPR7P.js → chunk-JAQO6XDB.js} +31 -2
- package/dist/chunk-JIMSII7R.js +987 -0
- package/dist/chunk-JJ4KA7HK.cjs +2219 -0
- package/dist/chunk-JMN3GZU6.js +570 -0
- package/dist/{chunk-X5VSP65C.cjs → chunk-JP3YHTQ2.cjs} +4 -4
- package/dist/{chunk-SKV2F3NM.js → chunk-JYKPWK5O.js} +1 -1
- package/dist/{chunk-NNPAM4HC.cjs → chunk-KNTUI4TZ.cjs} +12 -6
- package/dist/{chunk-HIVRCQS2.js → chunk-L4F7SUYL.js} +56 -25
- package/dist/{chunk-C5IJIM2V.cjs → chunk-LDJQ5QHG.cjs} +68 -37
- package/dist/{chunk-ULQ6MDSJ.cjs → chunk-LFDPTJYF.cjs} +43 -35
- package/dist/chunk-LJD7KR3L.cjs +44 -0
- package/dist/chunk-LN7D3EJZ.js +387 -0
- package/dist/{chunk-643VRA5S.cjs → chunk-LQBONA55.cjs} +32 -8
- package/dist/{chunk-NCC6ETZS.js → chunk-LUMV3DB2.js} +41 -33
- package/dist/chunk-M4KNC5BQ.js +78 -0
- package/dist/chunk-MO4KP6XS.cjs +229 -0
- package/dist/{chunk-BVKXEQVG.cjs → chunk-MOJ7ADW4.cjs} +22 -10
- package/dist/chunk-MPULXVC4.cjs +715 -0
- package/dist/{chunk-X5YJ34FZ.cjs → chunk-MQESBFBZ.cjs} +46 -23
- package/dist/chunk-MUNUUFU7.cjs +21 -0
- package/dist/{chunk-X3WS5LDG.js → chunk-MX75JYIY.js} +7 -5
- package/dist/chunk-MXVIDIC6.cjs +139 -0
- package/dist/{chunk-3K2ESU53.cjs → chunk-N6O3XUZ2.cjs} +2 -2
- package/dist/{chunk-IVM5F2AE.js → chunk-NBGOIFKP.js} +265 -18
- package/dist/{chunk-SLQAYV3W.js → chunk-NMQ47RCG.js} +8 -2
- package/dist/{chunk-JYTDYJVW.js → chunk-O64I2GYI.js} +1 -1
- package/dist/{chunk-IFFXSTOM.cjs → chunk-O6TQP7U7.cjs} +3 -3
- package/dist/{chunk-AYS2ASM7.js → chunk-OHWMWKJQ.js} +1 -1
- package/dist/{chunk-N23UAW4I.js → chunk-OM24WXEE.js} +7 -2
- package/dist/{chunk-MAKMSQMQ.cjs → chunk-OPNI6O7F.cjs} +8 -6
- package/dist/chunk-OR67YXQK.cjs +13 -0
- package/dist/{chunk-QOXPOR5D.js → chunk-OV3PVUYN.js} +115 -44
- package/dist/{chunk-TNZRZQ7Q.js → chunk-PB7W7R72.js} +3 -78
- package/dist/chunk-PCM3N3CL.cjs +37 -0
- package/dist/{chunk-A4IJHHV7.cjs → chunk-PDHT7LQS.cjs} +52 -11
- package/dist/{chunk-LA7H35XM.cjs → chunk-PHJO5YAL.cjs} +9 -9
- package/dist/{chunk-KPELYZ6L.js → chunk-PQLKJCIE.js} +2 -2
- package/dist/chunk-PUD76XQT.cjs +78 -0
- package/dist/chunk-Q2IL4DDI.cjs +355 -0
- package/dist/{chunk-WPVWQSL7.cjs → chunk-Q6AC3PHY.cjs} +16 -13
- package/dist/{chunk-XRZEUWKF.js → chunk-QCHIDZBA.js} +1 -1
- package/dist/{chunk-IQ5RXU6O.js → chunk-QEGOB6QV.js} +1 -1
- package/dist/{chunk-JSBRDJBE.js → chunk-QGM4M3NI.js} +8 -1
- package/dist/chunk-QKP772OZ.js +4291 -0
- package/dist/chunk-QQ7PANOP.js +59 -0
- package/dist/{chunk-YHD6TUIR.cjs → chunk-QW2RW2GY.cjs} +2 -0
- package/dist/chunk-RAKO7UN7.js +114 -0
- package/dist/chunk-RBHANOYY.js +33 -0
- package/dist/chunk-RBZ7AFX7.cjs +29 -0
- package/dist/{chunk-TXSDBGKX.cjs → chunk-REMGR23V.cjs} +46 -49
- package/dist/chunk-ROLA6EFO.cjs +85 -0
- package/dist/{chunk-TBEGGJNC.cjs → chunk-SOLBYSLY.cjs} +33 -16
- package/dist/{chunk-FKSDEWDH.js → chunk-SWCQM52V.js} +68 -25
- package/dist/{chunk-H5SWOLG6.js → chunk-TBOLJDUG.js} +39 -24
- package/dist/chunk-TH26BQJG.js +101 -0
- package/dist/{chunk-245KJE5Y.cjs → chunk-TJNBASFD.cjs} +14 -6
- package/dist/chunk-TKKN34TV.js +229 -0
- package/dist/chunk-TQ33WBY5.cjs +74 -0
- package/dist/{chunk-EGFT4PGW.js → chunk-TWQDAUZU.js} +5 -2
- package/dist/{chunk-OGV4WJ5L.cjs → chunk-TXPSTCG7.cjs} +74 -59
- package/dist/{chunk-CAMZTXV6.js → chunk-U4C3HW6P.js} +67 -52
- package/dist/{chunk-5P2NXKP3.js → chunk-UEIXJG45.js} +104 -76
- package/dist/{chunk-22D2CNTP.cjs → chunk-UGFVM77J.cjs} +5 -2
- package/dist/chunk-UOQECODR.js +34 -0
- package/dist/chunk-UR27UDTB.js +354 -0
- package/dist/chunk-UWFG2R2I.cjs +420 -0
- package/dist/{chunk-Y72HH2TF.cjs → chunk-UXLW45ZE.cjs} +102 -28
- package/dist/{chunk-FPHU2ES6.cjs → chunk-VBOFPU5M.cjs} +6 -0
- package/dist/{chunk-JX3DFKBI.js → chunk-VDWJMWDF.js} +54 -24
- package/dist/{chunk-LENHP55G.cjs → chunk-VGEV44V2.cjs} +1076 -158
- package/dist/{chunk-33RSHBDH.js → chunk-VKBIE6I6.js} +38 -7
- package/dist/{chunk-CWMZKFTT.js → chunk-VRMZO6TB.js} +31 -8
- package/dist/chunk-VUGOOGHB.js +400 -0
- package/dist/chunk-WBU4Q4GS.cjs +400 -0
- package/dist/chunk-WGLBC5AY.cjs +59 -0
- package/dist/{chunk-KWXVKLQ5.cjs → chunk-WGNMOVMT.cjs} +7 -82
- package/dist/{chunk-RKJTGGMU.cjs → chunk-WKRDBCP2.cjs} +221 -16
- package/dist/chunk-WRTXCQ3V.cjs +4291 -0
- package/dist/chunk-WTB7AFL6.cjs +101 -0
- package/dist/{chunk-NDMIPTV4.js → chunk-WZV6UVPY.js} +8 -3
- package/dist/chunk-XF2WIKHR.cjs +34 -0
- package/dist/{chunk-L3WAH3EM.cjs → chunk-XGMI6IYB.cjs} +46 -15
- package/dist/{chunk-FW774QXH.js → chunk-XIVFAD2L.js} +1048 -130
- package/dist/chunk-XV2HXRHX.js +85 -0
- package/dist/{chunk-72FKPBT5.js → chunk-Y3M2DABP.js} +16 -12
- package/dist/{chunk-QNGEW5TC.js → chunk-YV63VW4K.js} +1 -1
- package/dist/{chunk-UJ2JSM6H.js → chunk-YVQI26H4.js} +2 -0
- package/dist/{chunk-RD5XAJR2.cjs → chunk-YWTIXHU6.cjs} +266 -19
- package/dist/chunk-YZWE7XSM.js +5 -0
- package/dist/{chunk-I5IW3T2Y.js → chunk-Z3XSSF7B.js} +32 -15
- package/dist/{chunk-6UJMCWRY.js → chunk-Z4LIPMPM.js} +6 -0
- package/dist/chunk-ZASDSY7P.cjs +114 -0
- package/dist/{chunk-R33VKSH5.cjs → chunk-ZHJ7JGME.cjs} +11 -11
- package/dist/chunk-ZPD2AO3U.js +866 -0
- package/dist/{chunk-7UOUW76C.js → chunk-ZQAT5VT5.js} +101 -24
- package/dist/chunk-ZR46OJNZ.js +152 -0
- package/dist/{chunk-G3V4SFET.cjs → chunk-ZZ63NW7A.cjs} +78 -35
- package/dist/clear-33TWQ2ES.cjs +12 -0
- package/dist/clear-OFLFQ3MR.js +12 -0
- package/dist/{communityInstaller-6KCFN7YZ.js → communityInstaller-COB2KTOW.js} +9 -6
- package/dist/communityInstaller-TWMGPSYM.cjs +22 -0
- package/dist/completion-IIZMHXYP.cjs +17 -0
- package/dist/completion-PT4VM2H2.js +17 -0
- package/dist/config-KL6WU7R2.cjs +20 -0
- package/dist/{config-ZN66VXPS.js → config-R4O7GBTY.js} +7 -5
- package/dist/{constants-UFM5B232.js → constants-HVCHVQAF.js} +2 -2
- package/dist/constants-RLMJ5D5P.cjs +21 -0
- package/dist/{defaultHooks-RCXPHF4M.cjs → defaultHooks-2V2CQL63.cjs} +26 -11
- package/dist/{defaultHooks-RDRMER3Z.js → defaultHooks-TMHDU3FS.js} +26 -11
- package/dist/export-3PK3VFCE.js +15 -0
- package/dist/export-WLGNWEMJ.cjs +15 -0
- package/dist/{extractSessionMemories-V7K42ZHW.js → extractSessionMemories-A2JX5WJ2.js} +1 -1
- package/dist/{extractSessionMemories-SDW2MVBQ.cjs → extractSessionMemories-XL3MS37F.cjs} +1 -1
- package/dist/feedback-G635NCLJ.js +18 -0
- package/dist/feedback-LLMK3TZH.cjs +18 -0
- package/dist/fffSearchProvider-2YCNKOYD.js +412 -0
- package/dist/fffSearchProvider-W6627E2V.cjs +412 -0
- package/dist/filesystem-L6DQKGWK.js +11 -0
- package/dist/filesystem-PGUPCMVK.cjs +11 -0
- package/dist/{formatters-6K7QVWQL.cjs → formatters-53XTCNGQ.cjs} +1 -1
- package/dist/{formatters-DQHO5I36.js → formatters-T6KV4BPP.js} +1 -1
- package/dist/help-BAXLP2M2.cjs +12 -0
- package/dist/{help-2BLR7L43.js → help-X3OAZ3CY.js} +3 -3
- package/dist/history-6HOJSEMT.cjs +14 -0
- package/dist/{history-5FZ3M2AK.js → history-YKFPHBJN.js} +3 -3
- package/dist/hooks-7TA4PIIB.js +18 -0
- package/dist/hooks-XVFU67T2.cjs +18 -0
- package/dist/{i18n-K7QOWIBH.js → i18n-2KBUU7XL.js} +2 -2
- package/dist/i18n-MUJMKTFM.cjs +33 -0
- package/dist/ide-CCQ33PGC.cjs +15 -0
- package/dist/ide-VLVFBZ5F.js +15 -0
- package/dist/immediateCommandRouter-MTEHZXQX.js +15 -0
- package/dist/immediateCommandRouter-ROXU3MWT.cjs +15 -0
- package/dist/{import-UXM3VK7B.js → import-4CHYLS4K.js} +4 -4
- package/dist/{import-QEME3E4T.cjs → import-I7T4ZHYL.cjs} +4 -4
- package/dist/import-J46F54JY.cjs +10 -0
- package/dist/import-JWPYKXCZ.js +10 -0
- package/dist/index.cjs +747 -22356
- package/dist/index.d.cts +93 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +786 -22395
- package/dist/init-262MWZV4.js +10 -0
- package/dist/init-EE5Y7RBL.cjs +10 -0
- package/dist/inkMode-VUE6ZDLD.cjs +7 -0
- package/dist/inkMode-WBNFOSAT.js +7 -0
- package/dist/inputPrompt-IIFKCX5Q.cjs +90 -0
- package/dist/inputPrompt-YGBHDUEP.js +90 -0
- package/dist/language-CVLPB7OV.js +21 -0
- package/dist/language-ZTWFHUSV.cjs +21 -0
- package/dist/learn-PON7I5QS.js +23 -0
- package/dist/learn-XLRSVNA3.cjs +23 -0
- package/dist/{lint-D5UOJWIK.cjs → lint-4NDGCSCL.cjs} +1 -1
- package/dist/{lint-NJPZWVN2.js → lint-FZ7ZJUB3.js} +1 -1
- package/dist/login-223QTGBG.cjs +26 -0
- package/dist/login-6IKTBUBY.js +26 -0
- package/dist/logout-RN2AG6SI.js +23 -0
- package/dist/logout-U3M4FFX7.cjs +23 -0
- package/dist/mcp-5O6PUL4G.js +20 -0
- package/dist/mcp-NUQ76QQB.cjs +20 -0
- package/dist/{mcp-install-VESN42PI.js → mcp-install-6XWXLFVY.js} +18 -11
- package/dist/{mcp-install-G27HSS3Z.cjs → mcp-install-P6DHES7V.cjs} +22 -15
- package/dist/memory-CYMDQ2YC.cjs +10 -0
- package/dist/memory-Q54CESNM.js +10 -0
- package/dist/{message-ZJ5AYAMT.cjs → message-4OKO775J.cjs} +1 -1
- package/dist/{message-JUBOK2VU.js → message-X3LOAAM7.js} +1 -1
- package/dist/model-6AJ77PJG.js +10 -0
- package/dist/model-IDRCKDML.cjs +10 -0
- package/dist/new-7LEWOUF2.cjs +12 -0
- package/dist/new-ZXHEWC2S.js +12 -0
- package/dist/onboarding-FXX7YHSJ.cjs +35 -0
- package/dist/onboarding-JYNMK6NI.js +35 -0
- package/dist/{patch-MOD7QC3D.cjs → patch-DJ2GPFST.cjs} +1 -1
- package/dist/{patch-5F6VBIT3.js → patch-NIJWIRHS.js} +1 -1
- package/dist/permissions-YBNSANIA.cjs +10 -0
- package/dist/permissions-YHJMVA6L.js +10 -0
- package/dist/plan-XEJMOT55.cjs +13 -0
- package/dist/plan-YYUAXPTL.js +13 -0
- package/dist/pr-review-CW6J7P62.cjs +9 -0
- package/dist/pr-review-YZSBQVT2.js +9 -0
- package/dist/quit-B43SJ6E4.cjs +10 -0
- package/dist/quit-GWTNHQSP.js +10 -0
- package/dist/rawMode-6W5AXAKI.cjs +7 -0
- package/dist/rawMode-GFNLXQPU.js +7 -0
- package/dist/{registry-KWZGYJC2.js → registry-34GL6BNJ.js} +30 -45
- package/dist/{registry-YN4FQPOO.cjs → registry-V24W7YK6.cjs} +66 -81
- package/dist/repeat-P4FAPE3Y.cjs +17 -0
- package/dist/repeat-RALE6AUO.js +17 -0
- package/dist/resume-DYVOQN5L.cjs +16 -0
- package/dist/resume-M25UQKOX.js +16 -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-NPS3PU4O.cjs +3730 -0
- package/dist/rpc-S3DGW6KV.js +3730 -0
- package/dist/search-CPX4PWHP.js +20 -0
- package/dist/search-VUF3M4N3.cjs +20 -0
- package/dist/{session-BSU2L5UI.cjs → session-LXKC4X5Q.cjs} +1 -1
- package/dist/{session-SZMRN5KG.js → session-NMMO4QOL.js} +1 -1
- package/dist/sessions-IYAXMK23.js +10 -0
- package/dist/sessions-JODKER5D.cjs +10 -0
- package/dist/settings-55BNW6BF.js +33 -0
- package/dist/settings-BKTS7OMC.cjs +33 -0
- package/dist/setup-IRC5HQG2.js +29 -0
- package/dist/setup-MMQ7TWOP.cjs +29 -0
- package/dist/share-6JRQECAH.cjs +17 -0
- package/dist/share-YM5MJKMO.js +17 -0
- package/dist/{skills-FYY6F2WV.cjs → skills-GGMZOVIE.cjs} +14 -11
- package/dist/skills-LWSOKOSH.cjs +29 -0
- package/dist/{skills-6OL4OSGA.js → skills-MVIZNHT4.js} +13 -10
- package/dist/skills-VWOMV3CR.js +29 -0
- package/dist/{skills-install-6CSWC24P.js → skills-install-QBA5RCV6.js} +22 -71
- package/dist/{skills-install-O3LZ2ETC.cjs → skills-install-VTAMCNNY.cjs} +35 -84
- package/dist/skills-new-GPL46YV2.js +18 -0
- package/dist/skills-new-L5BEZN5V.cjs +18 -0
- package/dist/slashCommands-FBPCIWM5.cjs +95 -0
- package/dist/slashCommands-FCWY5DXW.js +95 -0
- package/dist/status-3B5SDZPL.js +17 -0
- package/dist/status-TTGRF6NC.cjs +17 -0
- package/dist/summarizer-DGPHE5IQ.js +17 -0
- package/dist/summarizer-JNXLUAQG.cjs +17 -0
- package/dist/sync-77CXVVTK.cjs +21 -0
- package/dist/{sync-KWX67OUN.js → sync-7BILIQHP.js} +4 -4
- package/dist/sync-7OKF6636.js +21 -0
- package/dist/sync-EH4K5U3N.cjs +40 -0
- package/dist/{tasks-5FPBIFLC.js → tasks-R5MBGAQ6.js} +1 -1
- package/dist/{tasks-TXGKGNH6.cjs → tasks-V4WB3MFR.cjs} +1 -1
- package/dist/{team-5YXP3JGR.js → team-JESCHGWB.js} +1 -1
- package/dist/{team-IIWEZKNR.cjs → team-VQQKWGZB.cjs} +1 -1
- package/dist/{teammate-L6EZQ3I2.js → teammate-GZQSCIMS.js} +29 -8
- package/dist/{teammate-2KMKJXAM.cjs → teammate-J6PHGL23.cjs} +30 -9
- package/dist/theme-64BYGJ57.cjs +21 -0
- package/dist/theme-YJE6HEON.js +21 -0
- package/dist/tools-3PPTTKFV.js +9 -0
- package/dist/tools-THIQA7WC.cjs +9 -0
- package/dist/ui/questionModal.cjs +9 -6
- package/dist/ui/questionModal.js +8 -5
- package/dist/undo-PRTEGL2J.cjs +10 -0
- package/dist/undo-SZEHLX7X.js +10 -0
- package/dist/{update-TVAJMMBC.js → update-53WMKYVS.js} +1 -1
- package/dist/{update-Z6BIIQDC.cjs → update-NV6QRYY7.cjs} +1 -1
- 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 +46 -49
- package/dist/AgentRegistry-NQCLWABO.cjs +0 -10
- package/dist/CommunitySkillsCache-6QPRMTJO.js +0 -8
- package/dist/CommunitySkillsCache-GTQMOCCO.cjs +0 -8
- package/dist/GitHubRegistryFetcher-S7QFUEKV.cjs +0 -7
- package/dist/HookManager-Q2KYMCP4.cjs +0 -7
- package/dist/HookManager-TTP4Y6DC.js +0 -7
- package/dist/LearnAdvisor-A4Q5PPBI.js +0 -9
- package/dist/LearnAdvisor-GASQD7HT.cjs +0 -9
- package/dist/McpClientManager-RKD7C6OY.cjs +0 -8
- package/dist/MemoryManager-GUNLRP5S.js +0 -8
- package/dist/MemoryManager-TNSGKDKX.cjs +0 -8
- package/dist/PermissionManager-KMN53FJP.cjs +0 -11
- package/dist/ProviderFactory-MR5B23QJ.js +0 -9
- package/dist/ProviderFactory-VFGCJJX6.cjs +0 -9
- package/dist/SessionManager-FEUAU3ZJ.cjs +0 -10
- package/dist/SessionManager-IKWAK2PI.js +0 -10
- package/dist/SkillsRegistry-KPQFTRIT.cjs +0 -9
- package/dist/SkillsRegistry-XJSKPDF2.js +0 -9
- package/dist/SubAgent-NYH6GWQ3.js +0 -11
- package/dist/SubAgent-PZKBDUBA.cjs +0 -11
- package/dist/SyncApiClient-ZNYMT36M.cjs +0 -11
- package/dist/about-HHTF2YFL.js +0 -12
- package/dist/about-JGRVNNQC.cjs +0 -12
- package/dist/actionExecutor-U6IBN2TU.cjs +0 -19
- package/dist/actionExecutor-XT5FW3W6.js +0 -19
- package/dist/add-dir-247K3XRY.js +0 -10
- package/dist/add-dir-GS4DXKKH.cjs +0 -10
- package/dist/agents-R6ZEFTVR.cjs +0 -12
- package/dist/agents-WJPQWQF2.js +0 -12
- package/dist/agents-new-HKVEIBDJ.js +0 -14
- package/dist/agents-new-X6GTHIO6.cjs +0 -14
- package/dist/autoSkill-H4T6VVDA.cjs +0 -20
- package/dist/automode-BC6NVECO.js +0 -10
- package/dist/automode-WN2RSOGW.cjs +0 -10
- package/dist/chunk-33A755XB.cjs +0 -168
- package/dist/chunk-3OTU3RS3.cjs +0 -1607
- package/dist/chunk-4PKF7WPD.js +0 -100
- package/dist/chunk-ALYU6VTM.js +0 -105
- package/dist/chunk-AS6RTLN7.cjs +0 -203
- package/dist/chunk-BWN2CLLM.cjs +0 -298
- package/dist/chunk-HQ7YZKXE.js +0 -168
- package/dist/chunk-HVKOZ2VP.cjs +0 -115
- package/dist/chunk-J6QET7EF.cjs +0 -454
- package/dist/chunk-LWUJFGOZ.js +0 -115
- package/dist/chunk-P47WPOXN.js +0 -298
- package/dist/chunk-PRRCJFU3.cjs +0 -85
- package/dist/chunk-RO6WYEWH.js +0 -454
- package/dist/chunk-SYVYLZZF.cjs +0 -24
- package/dist/chunk-T73IDKDF.js +0 -111
- package/dist/chunk-YRLYSQEQ.cjs +0 -105
- package/dist/chunk-ZQE72E6W.cjs +0 -100
- package/dist/chunk-ZVY2XD6T.js +0 -1607
- package/dist/clear-UO4MNWZW.cjs +0 -12
- package/dist/clear-ZJ5NYP6E.js +0 -12
- package/dist/communityInstaller-PVSOFDZD.cjs +0 -19
- package/dist/completion-MMF2PN2H.js +0 -14
- package/dist/completion-UI5WKHXI.cjs +0 -14
- package/dist/config-E7RINK4R.cjs +0 -18
- package/dist/constants-6CPCJ3DY.cjs +0 -21
- package/dist/export-N4XIVDSL.cjs +0 -12
- package/dist/export-W22L4D5C.js +0 -12
- package/dist/feedback-DR6ADSNE.cjs +0 -15
- package/dist/feedback-FEEAP4QW.js +0 -15
- package/dist/filesystem-3SGCW2BF.js +0 -10
- package/dist/filesystem-MCFXJQ6R.cjs +0 -10
- package/dist/help-AQHGTS7P.cjs +0 -12
- package/dist/history-NIUDRMKA.cjs +0 -14
- package/dist/hooks-2EY4IPKV.js +0 -13
- package/dist/hooks-LJVORRIG.cjs +0 -13
- package/dist/i18n-ARDG2SMC.cjs +0 -33
- package/dist/ide-GFW6IJHD.js +0 -12
- package/dist/ide-N2ZNSSB3.cjs +0 -12
- package/dist/import-DFVN3KNZ.js +0 -10
- package/dist/import-ZS6DPGU5.cjs +0 -10
- package/dist/init-PY75HA3S.cjs +0 -10
- package/dist/init-QNMWLAVY.js +0 -10
- package/dist/language-5UE4G2BT.cjs +0 -18
- package/dist/language-UXMHEZUJ.js +0 -18
- package/dist/learn-HJ3FLNZC.cjs +0 -20
- package/dist/learn-MVYS3RU5.js +0 -20
- package/dist/localProjectPermissions-N77HA3XK.js +0 -18
- package/dist/localProjectPermissions-UFSMNTBJ.cjs +0 -18
- package/dist/login-DSE7H63A.js +0 -20
- package/dist/login-V3MEWPKN.cjs +0 -20
- package/dist/logout-BMVCLKKW.js +0 -18
- package/dist/logout-XEG7FHOZ.cjs +0 -18
- package/dist/mcp-PYUR4PHO.js +0 -18
- package/dist/mcp-SG6JFLGC.cjs +0 -18
- package/dist/memory-4ZMMEZ2Z.js +0 -10
- package/dist/memory-QSGMVVGH.cjs +0 -10
- package/dist/model-NANLBZ4Z.cjs +0 -10
- package/dist/model-ZXNV4AF7.js +0 -10
- package/dist/new-5QJY5JP2.js +0 -12
- package/dist/new-PMMG55UX.cjs +0 -12
- package/dist/permissions-LECTCJ4H.cjs +0 -13
- package/dist/permissions-VP5VGIBL.js +0 -13
- package/dist/plan-G5CEKJI4.js +0 -11
- package/dist/plan-QKOHE3LH.cjs +0 -11
- package/dist/quit-BKOOPHU5.cjs +0 -10
- package/dist/quit-FVFNYACP.js +0 -10
- package/dist/resume-EXFQSQPH.js +0 -13
- package/dist/resume-PP2IQM5S.cjs +0 -13
- package/dist/search-C56FBN67.cjs +0 -17
- package/dist/search-XGZDYBF4.js +0 -17
- package/dist/sessions-54KI3F2Q.js +0 -10
- package/dist/sessions-DDTSPNVW.cjs +0 -10
- package/dist/settings-BDO37TTO.cjs +0 -30
- package/dist/settings-FHRDFPLK.js +0 -30
- package/dist/share-IERCTBGN.cjs +0 -14
- package/dist/share-TGROUE6R.js +0 -14
- package/dist/skills-OM4IGBAA.cjs +0 -26
- package/dist/skills-S3GRN323.js +0 -26
- package/dist/skills-new-ALD2PTHN.js +0 -15
- package/dist/skills-new-PWLKK7GW.cjs +0 -15
- package/dist/slashCommands-L4ZD33LJ.js +0 -75
- package/dist/slashCommands-YY2VUUDF.cjs +0 -75
- package/dist/status-3PC5XWSS.cjs +0 -11
- package/dist/status-KCLVOYPD.js +0 -11
- package/dist/sync-6SDWG5RK.js +0 -18
- package/dist/sync-7JMZVEQD.cjs +0 -40
- package/dist/sync-WHURZL3U.cjs +0 -18
- package/dist/theme-BE5A4FPN.cjs +0 -18
- package/dist/theme-YMFCQP7J.js +0 -18
- package/dist/undo-KZHUUZTD.cjs +0 -10
- package/dist/undo-NEIEHQVX.js +0 -10
|
@@ -0,0 +1,2219 @@
|
|
|
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
|
+
var _chunkWRTXCQ3Vcjs = require('./chunk-WRTXCQ3V.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunkQ2IL4DDIcjs = require('./chunk-Q2IL4DDI.cjs');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunkIKUMVBCWcjs = require('./chunk-IKUMVBCW.cjs');
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var _chunkCH2J4PVEcjs = require('./chunk-CH2J4PVE.cjs');
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var _chunk46C73ZKKcjs = require('./chunk-46C73ZKK.cjs');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var _chunkYWTIXHU6cjs = require('./chunk-YWTIXHU6.cjs');
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var _chunkE26KKI46cjs = require('./chunk-E26KKI46.cjs');
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
var _chunkWGNMOVMTcjs = require('./chunk-WGNMOVMT.cjs');
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var _chunkCHI52KFRcjs = require('./chunk-CHI52KFR.cjs');
|
|
52
|
+
|
|
53
|
+
// src/onboarding/projectAnalyzer.ts
|
|
54
|
+
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
55
|
+
var _path = require('path');
|
|
56
|
+
var ProjectAnalyzer = class {
|
|
57
|
+
constructor(workspaceRoot) {
|
|
58
|
+
this.workspaceRoot = workspaceRoot;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Analyze the workspace and return project information
|
|
63
|
+
*/
|
|
64
|
+
async analyze() {
|
|
65
|
+
const info = {};
|
|
66
|
+
await this.analyzeNodeProject(info);
|
|
67
|
+
await this.analyzeRustProject(info);
|
|
68
|
+
await this.analyzeGoProject(info);
|
|
69
|
+
await this.analyzePythonProject(info);
|
|
70
|
+
return info;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Analyze Node.js/JavaScript/TypeScript project
|
|
74
|
+
*/
|
|
75
|
+
async analyzeNodeProject(info) {
|
|
76
|
+
const pkgPath = _path.join.call(void 0, this.workspaceRoot, "package.json");
|
|
77
|
+
if (!await _fsextra2.default.pathExists(pkgPath)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const pkg = await _fsextra2.default.readJson(pkgPath);
|
|
82
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
83
|
+
if (deps.typescript || _optionalChain([pkg, 'access', _ => _.devDependencies, 'optionalAccess', _2 => _2.typescript])) {
|
|
84
|
+
info.language = "TypeScript";
|
|
85
|
+
} else {
|
|
86
|
+
info.language = "JavaScript";
|
|
87
|
+
}
|
|
88
|
+
info.framework = this.detectNodeFramework(deps);
|
|
89
|
+
info.packageManager = await this.detectNodePackageManager();
|
|
90
|
+
info.testFramework = this.detectNodeTestFramework(deps);
|
|
91
|
+
info.linter = this.detectNodeLinter(deps);
|
|
92
|
+
info.formatter = this.detectNodeFormatter(deps);
|
|
93
|
+
info.buildTool = this.detectNodeBuildTool(deps);
|
|
94
|
+
} catch (e2) {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Detect Node.js framework from dependencies
|
|
99
|
+
*/
|
|
100
|
+
detectNodeFramework(deps) {
|
|
101
|
+
if (deps.next) return "Next.js";
|
|
102
|
+
if (deps.nuxt) return "Nuxt";
|
|
103
|
+
if (deps["@remix-run/node"] || deps["@remix-run/react"]) return "Remix";
|
|
104
|
+
if (deps["@angular/core"]) return "Angular";
|
|
105
|
+
if (deps.svelte) return "Svelte";
|
|
106
|
+
if (deps.vue) return "Vue";
|
|
107
|
+
if (deps.react) return "React";
|
|
108
|
+
if (deps.solid) return "Solid";
|
|
109
|
+
if (deps["@nestjs/core"]) return "NestJS";
|
|
110
|
+
if (deps.fastify) return "Fastify";
|
|
111
|
+
if (deps.hono) return "Hono";
|
|
112
|
+
if (deps.koa) return "Koa";
|
|
113
|
+
if (deps.express) return "Express";
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Detect Node.js package manager from lockfiles
|
|
118
|
+
*/
|
|
119
|
+
async detectNodePackageManager() {
|
|
120
|
+
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"))) {
|
|
121
|
+
return "bun";
|
|
122
|
+
}
|
|
123
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "pnpm-lock.yaml"))) {
|
|
124
|
+
return "pnpm";
|
|
125
|
+
}
|
|
126
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "yarn.lock"))) {
|
|
127
|
+
return "yarn";
|
|
128
|
+
}
|
|
129
|
+
if (await _fsextra2.default.pathExists(_path.join.call(void 0, this.workspaceRoot, "package-lock.json"))) {
|
|
130
|
+
return "npm";
|
|
131
|
+
}
|
|
132
|
+
return "npm";
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Detect Node.js test framework
|
|
136
|
+
*/
|
|
137
|
+
detectNodeTestFramework(deps) {
|
|
138
|
+
if (deps.vitest) return "Vitest";
|
|
139
|
+
if (deps.jest) return "Jest";
|
|
140
|
+
if (deps.mocha) return "Mocha";
|
|
141
|
+
if (deps.ava) return "AVA";
|
|
142
|
+
if (deps["@playwright/test"]) return "Playwright";
|
|
143
|
+
if (deps.cypress) return "Cypress";
|
|
144
|
+
if (deps.puppeteer) return "Puppeteer";
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Detect Node.js linter
|
|
149
|
+
*/
|
|
150
|
+
detectNodeLinter(deps) {
|
|
151
|
+
if (deps["@biomejs/biome"]) return "Biome";
|
|
152
|
+
if (deps.eslint) return "ESLint";
|
|
153
|
+
if (deps.oxlint) return "Oxlint";
|
|
154
|
+
return void 0;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Detect Node.js formatter
|
|
158
|
+
*/
|
|
159
|
+
detectNodeFormatter(deps) {
|
|
160
|
+
if (deps.prettier) return "Prettier";
|
|
161
|
+
if (deps["@biomejs/biome"]) return "Biome";
|
|
162
|
+
if (deps.dprint) return "dprint";
|
|
163
|
+
return void 0;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Detect Node.js build tool
|
|
167
|
+
*/
|
|
168
|
+
detectNodeBuildTool(deps) {
|
|
169
|
+
if (deps.vite) return "Vite";
|
|
170
|
+
if (deps.tsup) return "tsup";
|
|
171
|
+
if (deps.esbuild) return "esbuild";
|
|
172
|
+
if (deps.rollup) return "Rollup";
|
|
173
|
+
if (deps.webpack) return "Webpack";
|
|
174
|
+
if (deps.parcel) return "Parcel";
|
|
175
|
+
if (deps.turbopack || deps.turbo) return "Turbopack";
|
|
176
|
+
return void 0;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Analyze Rust project
|
|
180
|
+
*/
|
|
181
|
+
async analyzeRustProject(info) {
|
|
182
|
+
const cargoPath = _path.join.call(void 0, this.workspaceRoot, "Cargo.toml");
|
|
183
|
+
if (!await _fsextra2.default.pathExists(cargoPath)) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
info.language = "Rust";
|
|
187
|
+
info.packageManager = "cargo";
|
|
188
|
+
try {
|
|
189
|
+
const cargoContent = await _fsextra2.default.readFile(cargoPath, "utf-8");
|
|
190
|
+
if (cargoContent.includes("actix-web")) {
|
|
191
|
+
info.framework = "Actix";
|
|
192
|
+
} else if (cargoContent.includes("axum")) {
|
|
193
|
+
info.framework = "Axum";
|
|
194
|
+
} else if (cargoContent.includes("rocket")) {
|
|
195
|
+
info.framework = "Rocket";
|
|
196
|
+
} else if (cargoContent.includes("warp")) {
|
|
197
|
+
info.framework = "Warp";
|
|
198
|
+
} else if (cargoContent.includes("tauri")) {
|
|
199
|
+
info.framework = "Tauri";
|
|
200
|
+
}
|
|
201
|
+
} catch (e3) {
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Analyze Go project
|
|
206
|
+
*/
|
|
207
|
+
async analyzeGoProject(info) {
|
|
208
|
+
const goModPath = _path.join.call(void 0, this.workspaceRoot, "go.mod");
|
|
209
|
+
if (!await _fsextra2.default.pathExists(goModPath)) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
info.language = "Go";
|
|
213
|
+
info.packageManager = "go";
|
|
214
|
+
try {
|
|
215
|
+
const goModContent = await _fsextra2.default.readFile(goModPath, "utf-8");
|
|
216
|
+
if (goModContent.includes("github.com/gin-gonic/gin")) {
|
|
217
|
+
info.framework = "Gin";
|
|
218
|
+
} else if (goModContent.includes("github.com/gofiber/fiber")) {
|
|
219
|
+
info.framework = "Fiber";
|
|
220
|
+
} else if (goModContent.includes("github.com/labstack/echo")) {
|
|
221
|
+
info.framework = "Echo";
|
|
222
|
+
} else if (goModContent.includes("github.com/gorilla/mux")) {
|
|
223
|
+
info.framework = "Gorilla";
|
|
224
|
+
}
|
|
225
|
+
} catch (e4) {
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Analyze Python project
|
|
230
|
+
*/
|
|
231
|
+
async analyzePythonProject(info) {
|
|
232
|
+
const pyprojectPath = _path.join.call(void 0, this.workspaceRoot, "pyproject.toml");
|
|
233
|
+
const requirementsPath = _path.join.call(void 0, this.workspaceRoot, "requirements.txt");
|
|
234
|
+
const poetryLockPath = _path.join.call(void 0, this.workspaceRoot, "poetry.lock");
|
|
235
|
+
const pipfilePath = _path.join.call(void 0, this.workspaceRoot, "Pipfile");
|
|
236
|
+
const hasPyproject = await _fsextra2.default.pathExists(pyprojectPath);
|
|
237
|
+
const hasRequirements = await _fsextra2.default.pathExists(requirementsPath);
|
|
238
|
+
if (!hasPyproject && !hasRequirements) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
info.language = "Python";
|
|
242
|
+
if (await _fsextra2.default.pathExists(poetryLockPath)) {
|
|
243
|
+
info.packageManager = "poetry";
|
|
244
|
+
} else if (await _fsextra2.default.pathExists(pipfilePath)) {
|
|
245
|
+
info.packageManager = "pipenv";
|
|
246
|
+
} else if (hasPyproject) {
|
|
247
|
+
info.packageManager = "pip";
|
|
248
|
+
} else {
|
|
249
|
+
info.packageManager = "pip";
|
|
250
|
+
}
|
|
251
|
+
let depsContent = "";
|
|
252
|
+
try {
|
|
253
|
+
if (hasRequirements) {
|
|
254
|
+
depsContent = await _fsextra2.default.readFile(requirementsPath, "utf-8");
|
|
255
|
+
} else if (hasPyproject) {
|
|
256
|
+
depsContent = await _fsextra2.default.readFile(pyprojectPath, "utf-8");
|
|
257
|
+
}
|
|
258
|
+
if (depsContent.includes("django")) {
|
|
259
|
+
info.framework = "Django";
|
|
260
|
+
} else if (depsContent.includes("fastapi")) {
|
|
261
|
+
info.framework = "FastAPI";
|
|
262
|
+
} else if (depsContent.includes("flask")) {
|
|
263
|
+
info.framework = "Flask";
|
|
264
|
+
} else if (depsContent.includes("starlette")) {
|
|
265
|
+
info.framework = "Starlette";
|
|
266
|
+
} else if (depsContent.includes("tornado")) {
|
|
267
|
+
info.framework = "Tornado";
|
|
268
|
+
}
|
|
269
|
+
if (depsContent.includes("pytest")) {
|
|
270
|
+
info.testFramework = "pytest";
|
|
271
|
+
} else if (depsContent.includes("unittest")) {
|
|
272
|
+
info.testFramework = "unittest";
|
|
273
|
+
} else if (depsContent.includes("nose")) {
|
|
274
|
+
info.testFramework = "nose";
|
|
275
|
+
}
|
|
276
|
+
if (depsContent.includes("ruff")) {
|
|
277
|
+
info.linter = "Ruff";
|
|
278
|
+
} else if (depsContent.includes("flake8")) {
|
|
279
|
+
info.linter = "Flake8";
|
|
280
|
+
} else if (depsContent.includes("pylint")) {
|
|
281
|
+
info.linter = "Pylint";
|
|
282
|
+
}
|
|
283
|
+
if (depsContent.includes("black")) {
|
|
284
|
+
info.formatter = "Black";
|
|
285
|
+
} else if (depsContent.includes("ruff")) {
|
|
286
|
+
info.formatter = "Ruff";
|
|
287
|
+
} else if (depsContent.includes("autopep8")) {
|
|
288
|
+
info.formatter = "autopep8";
|
|
289
|
+
}
|
|
290
|
+
} catch (e5) {
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// src/onboarding/agentsGenerator.ts
|
|
296
|
+
var AgentsGenerator = class {
|
|
297
|
+
/**
|
|
298
|
+
* Generate AGENTS.md content
|
|
299
|
+
*/
|
|
300
|
+
generateContent(info, options) {
|
|
301
|
+
const sections = [];
|
|
302
|
+
sections.push("# AGENTS.md");
|
|
303
|
+
sections.push("");
|
|
304
|
+
sections.push("This file helps Autohand understand how to work with this project.");
|
|
305
|
+
sections.push("");
|
|
306
|
+
sections.push(this.generateProjectOverview(info));
|
|
307
|
+
if (info.packageManager) {
|
|
308
|
+
sections.push(this.generateCommandsSection(info));
|
|
309
|
+
}
|
|
310
|
+
if (info.testFramework) {
|
|
311
|
+
sections.push(this.generateTestingSection(info));
|
|
312
|
+
}
|
|
313
|
+
if (info.framework) {
|
|
314
|
+
const frameworkSection = this.generateFrameworkSection(info);
|
|
315
|
+
if (frameworkSection) {
|
|
316
|
+
sections.push(frameworkSection);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
sections.push(this.generateCodeStyleSection(info));
|
|
320
|
+
sections.push(this.generateConstraintsSection());
|
|
321
|
+
if (_optionalChain([options, 'optionalAccess', _3 => _3.customSections])) {
|
|
322
|
+
for (const section of options.customSections) {
|
|
323
|
+
sections.push(`## ${section.title}`);
|
|
324
|
+
sections.push("");
|
|
325
|
+
sections.push(section.content);
|
|
326
|
+
sections.push("");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return sections.join("\n");
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Generate project overview section
|
|
333
|
+
*/
|
|
334
|
+
generateProjectOverview(info) {
|
|
335
|
+
const lines = [];
|
|
336
|
+
lines.push("## Project Overview");
|
|
337
|
+
lines.push("");
|
|
338
|
+
if (info.language) {
|
|
339
|
+
lines.push(`- **Language**: ${info.language}`);
|
|
340
|
+
}
|
|
341
|
+
if (info.framework) {
|
|
342
|
+
lines.push(`- **Framework**: ${info.framework}`);
|
|
343
|
+
}
|
|
344
|
+
if (info.packageManager) {
|
|
345
|
+
lines.push(`- **Package Manager**: ${info.packageManager}`);
|
|
346
|
+
}
|
|
347
|
+
if (info.testFramework) {
|
|
348
|
+
lines.push(`- **Test Framework**: ${info.testFramework}`);
|
|
349
|
+
}
|
|
350
|
+
if (info.buildTool) {
|
|
351
|
+
lines.push(`- **Build Tool**: ${info.buildTool}`);
|
|
352
|
+
}
|
|
353
|
+
lines.push("");
|
|
354
|
+
return lines.join("\n");
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Generate commands section based on package manager
|
|
358
|
+
*/
|
|
359
|
+
generateCommandsSection(info) {
|
|
360
|
+
const lines = [];
|
|
361
|
+
lines.push("## Commands");
|
|
362
|
+
lines.push("");
|
|
363
|
+
const pm = info.packageManager;
|
|
364
|
+
if (info.language === "Rust") {
|
|
365
|
+
lines.push("- **Build**: `cargo build`");
|
|
366
|
+
lines.push("- **Build (release)**: `cargo build --release`");
|
|
367
|
+
lines.push("- **Run**: `cargo run`");
|
|
368
|
+
lines.push("- **Test**: `cargo test`");
|
|
369
|
+
lines.push("- **Check**: `cargo check`");
|
|
370
|
+
lines.push("- **Format**: `cargo fmt`");
|
|
371
|
+
lines.push("- **Lint**: `cargo clippy`");
|
|
372
|
+
} else if (info.language === "Go") {
|
|
373
|
+
lines.push("- **Build**: `go build`");
|
|
374
|
+
lines.push("- **Run**: `go run .`");
|
|
375
|
+
lines.push("- **Test**: `go test ./...`");
|
|
376
|
+
lines.push("- **Format**: `go fmt ./...`");
|
|
377
|
+
lines.push("- **Vet**: `go vet ./...`");
|
|
378
|
+
} else if (info.language === "Python") {
|
|
379
|
+
if (pm === "poetry") {
|
|
380
|
+
lines.push("- **Install**: `poetry install`");
|
|
381
|
+
lines.push("- **Run**: `poetry run python main.py`");
|
|
382
|
+
lines.push("- **Add dependency**: `poetry add <package>`");
|
|
383
|
+
if (info.testFramework) {
|
|
384
|
+
lines.push(`- **Test**: \`poetry run pytest\``);
|
|
385
|
+
}
|
|
386
|
+
} else if (pm === "pipenv") {
|
|
387
|
+
lines.push("- **Install**: `pipenv install`");
|
|
388
|
+
lines.push("- **Run**: `pipenv run python main.py`");
|
|
389
|
+
if (info.testFramework) {
|
|
390
|
+
lines.push(`- **Test**: \`pipenv run pytest\``);
|
|
391
|
+
}
|
|
392
|
+
} else {
|
|
393
|
+
lines.push("- **Install**: `pip install -r requirements.txt`");
|
|
394
|
+
lines.push("- **Run**: `python main.py`");
|
|
395
|
+
if (info.testFramework) {
|
|
396
|
+
lines.push(`- **Test**: \`pytest\``);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
const run = pm === "npm" ? "npm run" : pm;
|
|
401
|
+
const install = pm === "npm" ? "npm install" : `${pm} install`;
|
|
402
|
+
lines.push(`- **Install**: \`${install}\``);
|
|
403
|
+
lines.push(`- **Dev**: \`${run} dev\``);
|
|
404
|
+
lines.push(`- **Build**: \`${run} build\``);
|
|
405
|
+
if (info.testFramework) {
|
|
406
|
+
lines.push(`- **Test**: \`${run} test\``);
|
|
407
|
+
}
|
|
408
|
+
if (info.linter) {
|
|
409
|
+
lines.push(`- **Lint**: \`${run} lint\``);
|
|
410
|
+
}
|
|
411
|
+
if (info.formatter) {
|
|
412
|
+
lines.push(`- **Format**: \`${run} format\``);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
lines.push("");
|
|
416
|
+
return lines.join("\n");
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Generate testing section
|
|
420
|
+
*/
|
|
421
|
+
generateTestingSection(info) {
|
|
422
|
+
const lines = [];
|
|
423
|
+
lines.push("## Testing");
|
|
424
|
+
lines.push("");
|
|
425
|
+
lines.push(`This project uses **${info.testFramework}** for testing.`);
|
|
426
|
+
lines.push("");
|
|
427
|
+
lines.push("- Write tests for new features before implementation");
|
|
428
|
+
lines.push("- Run tests before committing changes");
|
|
429
|
+
lines.push("- Aim for good test coverage on critical paths");
|
|
430
|
+
if (info.testFramework === "Vitest" || info.testFramework === "Jest") {
|
|
431
|
+
lines.push("- Use `describe` and `it` blocks to organize tests");
|
|
432
|
+
lines.push("- Mock external dependencies when appropriate");
|
|
433
|
+
} else if (info.testFramework === "pytest") {
|
|
434
|
+
lines.push("- Use fixtures for shared test setup");
|
|
435
|
+
lines.push("- Use `pytest.mark` for test categorization");
|
|
436
|
+
} else if (info.testFramework === "Playwright" || info.testFramework === "Cypress") {
|
|
437
|
+
lines.push("- Write E2E tests for critical user flows");
|
|
438
|
+
lines.push("- Keep selectors stable and meaningful");
|
|
439
|
+
}
|
|
440
|
+
lines.push("");
|
|
441
|
+
return lines.join("\n");
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Generate framework-specific section
|
|
445
|
+
*/
|
|
446
|
+
generateFrameworkSection(info) {
|
|
447
|
+
const lines = [];
|
|
448
|
+
switch (info.framework) {
|
|
449
|
+
case "Next.js":
|
|
450
|
+
lines.push("## Next.js Guidelines");
|
|
451
|
+
lines.push("");
|
|
452
|
+
lines.push("- Use the App Router for new pages (`app/` directory)");
|
|
453
|
+
lines.push("- Prefer Server Components by default");
|
|
454
|
+
lines.push('- Use `"use client"` only when needed for interactivity');
|
|
455
|
+
lines.push("- Keep API routes in `app/api/`");
|
|
456
|
+
lines.push("- Use `next/image` for optimized images");
|
|
457
|
+
lines.push("- Use `next/link` for client-side navigation");
|
|
458
|
+
break;
|
|
459
|
+
case "React":
|
|
460
|
+
lines.push("## React Guidelines");
|
|
461
|
+
lines.push("");
|
|
462
|
+
lines.push("- Use functional components with hooks");
|
|
463
|
+
lines.push("- Keep components small and focused");
|
|
464
|
+
lines.push("- Use custom hooks to share logic");
|
|
465
|
+
lines.push("- Prefer composition over inheritance");
|
|
466
|
+
lines.push("- Use TypeScript interfaces for props");
|
|
467
|
+
break;
|
|
468
|
+
case "Vue":
|
|
469
|
+
lines.push("## Vue Guidelines");
|
|
470
|
+
lines.push("");
|
|
471
|
+
lines.push("- Use Composition API for new components");
|
|
472
|
+
lines.push("- Keep components in single-file format (.vue)");
|
|
473
|
+
lines.push("- Use composables to share logic");
|
|
474
|
+
break;
|
|
475
|
+
case "Express":
|
|
476
|
+
lines.push("## Express Guidelines");
|
|
477
|
+
lines.push("");
|
|
478
|
+
lines.push("- Use middleware for cross-cutting concerns");
|
|
479
|
+
lines.push("- Keep route handlers thin, delegate to services");
|
|
480
|
+
lines.push("- Use async/await with proper error handling");
|
|
481
|
+
lines.push("- Validate request input before processing");
|
|
482
|
+
break;
|
|
483
|
+
case "FastAPI":
|
|
484
|
+
lines.push("## FastAPI Guidelines");
|
|
485
|
+
lines.push("");
|
|
486
|
+
lines.push("- Use Pydantic models for request/response validation");
|
|
487
|
+
lines.push("- Use dependency injection for shared resources");
|
|
488
|
+
lines.push("- Keep endpoints in organized routers");
|
|
489
|
+
lines.push("- Use async functions for I/O operations");
|
|
490
|
+
break;
|
|
491
|
+
case "Django":
|
|
492
|
+
lines.push("## Django Guidelines");
|
|
493
|
+
lines.push("");
|
|
494
|
+
lines.push("- Follow Django project structure conventions");
|
|
495
|
+
lines.push("- Use class-based views where appropriate");
|
|
496
|
+
lines.push("- Keep business logic in models or services");
|
|
497
|
+
lines.push("- Use Django ORM for database operations");
|
|
498
|
+
break;
|
|
499
|
+
case "Flask":
|
|
500
|
+
lines.push("## Flask Guidelines");
|
|
501
|
+
lines.push("");
|
|
502
|
+
lines.push("- Use blueprints to organize routes");
|
|
503
|
+
lines.push("- Keep route handlers focused");
|
|
504
|
+
lines.push("- Use Flask extensions for common functionality");
|
|
505
|
+
break;
|
|
506
|
+
case "NestJS":
|
|
507
|
+
lines.push("## NestJS Guidelines");
|
|
508
|
+
lines.push("");
|
|
509
|
+
lines.push("- Follow module-based architecture");
|
|
510
|
+
lines.push("- Use dependency injection");
|
|
511
|
+
lines.push("- Use decorators for metadata");
|
|
512
|
+
lines.push("- Keep controllers thin, services fat");
|
|
513
|
+
break;
|
|
514
|
+
default:
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
lines.push("");
|
|
518
|
+
return lines.join("\n");
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Generate code style section
|
|
522
|
+
*/
|
|
523
|
+
generateCodeStyleSection(info) {
|
|
524
|
+
const lines = [];
|
|
525
|
+
lines.push("## Code Style");
|
|
526
|
+
lines.push("");
|
|
527
|
+
if (info.language === "TypeScript") {
|
|
528
|
+
lines.push("- Use strict TypeScript settings");
|
|
529
|
+
lines.push("- Define types/interfaces for data structures");
|
|
530
|
+
lines.push("- Avoid `any` type - use `unknown` if type is truly unknown");
|
|
531
|
+
lines.push("- Use type inference where obvious");
|
|
532
|
+
} else if (info.language === "Python") {
|
|
533
|
+
lines.push("- Follow PEP 8 style guidelines");
|
|
534
|
+
lines.push("- Use type hints for function signatures");
|
|
535
|
+
lines.push("- Use docstrings for public functions");
|
|
536
|
+
} else if (info.language === "Rust") {
|
|
537
|
+
lines.push("- Follow Rust naming conventions (snake_case for functions)");
|
|
538
|
+
lines.push("- Use descriptive error types");
|
|
539
|
+
lines.push("- Prefer `Result` over panicking");
|
|
540
|
+
} else if (info.language === "Go") {
|
|
541
|
+
lines.push("- Follow Go idioms and conventions");
|
|
542
|
+
lines.push("- Use short variable names in small scopes");
|
|
543
|
+
lines.push("- Handle errors explicitly");
|
|
544
|
+
}
|
|
545
|
+
lines.push("- Follow existing patterns in the codebase");
|
|
546
|
+
lines.push("- Use meaningful variable and function names");
|
|
547
|
+
lines.push("- Add comments for complex logic");
|
|
548
|
+
lines.push("- Keep functions focused and small");
|
|
549
|
+
if (info.linter) {
|
|
550
|
+
lines.push(`- Run **${info.linter}** before committing`);
|
|
551
|
+
}
|
|
552
|
+
if (info.formatter) {
|
|
553
|
+
lines.push(`- Format code with **${info.formatter}**`);
|
|
554
|
+
}
|
|
555
|
+
lines.push("");
|
|
556
|
+
return lines.join("\n");
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Generate constraints section
|
|
560
|
+
*/
|
|
561
|
+
generateConstraintsSection() {
|
|
562
|
+
const lines = [];
|
|
563
|
+
lines.push("## Constraints");
|
|
564
|
+
lines.push("");
|
|
565
|
+
lines.push("- Do not modify files outside the project directory");
|
|
566
|
+
lines.push("- Ask before making breaking changes");
|
|
567
|
+
lines.push("- Prefer editing existing files over creating new ones");
|
|
568
|
+
lines.push("- Do not delete files without confirmation");
|
|
569
|
+
lines.push("- Keep dependencies minimal - avoid adding new ones without good reason");
|
|
570
|
+
lines.push("- Do not commit sensitive data (API keys, secrets, credentials)");
|
|
571
|
+
lines.push("");
|
|
572
|
+
return lines.join("\n");
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
// src/onboarding/setupWizard.ts
|
|
577
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
// src/providers/llamaCppSetup.ts
|
|
582
|
+
function looksLikeLlamaCppProcess(commandLine, name = "") {
|
|
583
|
+
const haystack = `${name} ${commandLine}`.toLowerCase();
|
|
584
|
+
return haystack.includes("llama-server") || haystack.includes("llama.cpp");
|
|
585
|
+
}
|
|
586
|
+
function extractLlamaCppPort(commandLine) {
|
|
587
|
+
const match = commandLine.match(/(?:--port(?:=|\s+)|-p\s*)(\d{2,5})\b/i);
|
|
588
|
+
if (!match) return void 0;
|
|
589
|
+
const port = Number.parseInt(match[1], 10);
|
|
590
|
+
return Number.isFinite(port) ? port : void 0;
|
|
591
|
+
}
|
|
592
|
+
async function commandExists(command, cwd) {
|
|
593
|
+
const lookup = process.platform === "win32" ? { command: "where", args: [command] } : { command: "which", args: [command] };
|
|
594
|
+
try {
|
|
595
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0, lookup.command, lookup.args, cwd, { timeout: 5e3 });
|
|
596
|
+
return result.code === 0;
|
|
597
|
+
} catch (e6) {
|
|
598
|
+
try {
|
|
599
|
+
const fallback = await _chunkWTB7AFL6cjs.runCommand.call(void 0, command, ["--version"], cwd, { timeout: 5e3 });
|
|
600
|
+
return fallback.code === 0;
|
|
601
|
+
} catch (e7) {
|
|
602
|
+
return false;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function parseUnixProcesses(stdout) {
|
|
607
|
+
return stdout.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => {
|
|
608
|
+
const match = line.match(/^\d+\s+(.*)$/);
|
|
609
|
+
const commandLine = _nullishCoalesce(_optionalChain([match, 'optionalAccess', _4 => _4[1]]), () => ( line));
|
|
610
|
+
const name = _nullishCoalesce(commandLine.split(/\s+/)[0], () => ( ""));
|
|
611
|
+
return { name, commandLine };
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
function parseWindowsProcesses(stdout) {
|
|
615
|
+
const trimmed = stdout.trim();
|
|
616
|
+
if (!trimmed) return [];
|
|
617
|
+
try {
|
|
618
|
+
const parsed = JSON.parse(trimmed);
|
|
619
|
+
const items = Array.isArray(parsed) ? parsed : [parsed];
|
|
620
|
+
return items.map((item) => ({
|
|
621
|
+
name: _nullishCoalesce(item.Name, () => ( "")),
|
|
622
|
+
commandLine: _nullishCoalesce(item.CommandLine, () => ( ""))
|
|
623
|
+
}));
|
|
624
|
+
} catch (e8) {
|
|
625
|
+
return [];
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
async function listProcesses(cwd) {
|
|
629
|
+
if (process.platform === "win32") {
|
|
630
|
+
try {
|
|
631
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0,
|
|
632
|
+
"powershell",
|
|
633
|
+
[
|
|
634
|
+
"-NoProfile",
|
|
635
|
+
"-Command",
|
|
636
|
+
"Get-CimInstance Win32_Process | Select-Object Name,CommandLine | ConvertTo-Json -Compress"
|
|
637
|
+
],
|
|
638
|
+
cwd,
|
|
639
|
+
{ timeout: 8e3 }
|
|
640
|
+
);
|
|
641
|
+
return result.code === 0 ? parseWindowsProcesses(result.stdout) : [];
|
|
642
|
+
} catch (e9) {
|
|
643
|
+
return [];
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
try {
|
|
647
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0, "ps", ["-ax", "-o", "pid=,command="], cwd, { timeout: 5e3 });
|
|
648
|
+
return result.code === 0 ? parseUnixProcesses(result.stdout) : [];
|
|
649
|
+
} catch (e10) {
|
|
650
|
+
return [];
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
async function detectInstallPlan(cwd) {
|
|
654
|
+
if (process.platform === "win32") {
|
|
655
|
+
if (await commandExists("winget", cwd)) {
|
|
656
|
+
return { command: "winget", args: ["install", "llama.cpp"], label: "winget install llama.cpp" };
|
|
657
|
+
}
|
|
658
|
+
return void 0;
|
|
659
|
+
}
|
|
660
|
+
if (await commandExists("brew", cwd)) {
|
|
661
|
+
return { command: "brew", args: ["install", "llama.cpp"], label: "brew install llama.cpp" };
|
|
662
|
+
}
|
|
663
|
+
if (await commandExists("nix", cwd)) {
|
|
664
|
+
return { command: "nix", args: ["profile", "install", "nixpkgs#llama-cpp"], label: "nix profile install nixpkgs#llama-cpp" };
|
|
665
|
+
}
|
|
666
|
+
return void 0;
|
|
667
|
+
}
|
|
668
|
+
async function probeLlamaCppPorts(candidatePorts) {
|
|
669
|
+
for (const port of candidatePorts) {
|
|
670
|
+
try {
|
|
671
|
+
const response = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(3e3) });
|
|
672
|
+
if (response.ok) {
|
|
673
|
+
return {
|
|
674
|
+
port,
|
|
675
|
+
baseUrl: `http://127.0.0.1:${port}`
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
} catch (e11) {
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return {};
|
|
682
|
+
}
|
|
683
|
+
async function probeLlamaCppEnvironment(cwd) {
|
|
684
|
+
const processes = await listProcesses(cwd);
|
|
685
|
+
const llamaProcess = processes.find((proc) => looksLikeLlamaCppProcess(proc.commandLine, proc.name));
|
|
686
|
+
const installed = await commandExists("llama-server", cwd) || Boolean(llamaProcess);
|
|
687
|
+
const installPlan = installed ? void 0 : await detectInstallPlan(cwd);
|
|
688
|
+
const detectedPort = llamaProcess ? extractLlamaCppPort(llamaProcess.commandLine) : void 0;
|
|
689
|
+
const candidatePorts = [...new Set([detectedPort, 80, 8080].filter((port) => typeof port === "number"))];
|
|
690
|
+
const probe = await probeLlamaCppPorts(candidatePorts);
|
|
691
|
+
return {
|
|
692
|
+
installed,
|
|
693
|
+
running: Boolean(probe.baseUrl),
|
|
694
|
+
port: _nullishCoalesce(probe.port, () => ( detectedPort)),
|
|
695
|
+
baseUrl: probe.baseUrl,
|
|
696
|
+
installPlan
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
async function installLlamaCpp(plan, cwd) {
|
|
700
|
+
try {
|
|
701
|
+
const result = await _chunkWTB7AFL6cjs.runCommand.call(void 0, plan.command, plan.args, cwd, { timeout: 10 * 60 * 1e3 });
|
|
702
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
|
|
703
|
+
return {
|
|
704
|
+
ok: result.code === 0,
|
|
705
|
+
output
|
|
706
|
+
};
|
|
707
|
+
} catch (error) {
|
|
708
|
+
return {
|
|
709
|
+
ok: false,
|
|
710
|
+
output: error instanceof Error ? error.message : String(error)
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// src/onboarding/setupWizard.ts
|
|
716
|
+
var SetupWizard = class {
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
constructor(workspaceRoot, existingConfig) {
|
|
721
|
+
this.workspaceRoot = workspaceRoot;
|
|
722
|
+
this.existingConfig = _nullishCoalesce(existingConfig, () => ( null));
|
|
723
|
+
this.state = {
|
|
724
|
+
currentStep: "welcome",
|
|
725
|
+
skipped: [],
|
|
726
|
+
completed: false
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Run the full onboarding wizard
|
|
731
|
+
*/
|
|
732
|
+
async run(options) {
|
|
733
|
+
if (!_optionalChain([options, 'optionalAccess', _5 => _5.force]) && this.isAlreadyConfigured()) {
|
|
734
|
+
return {
|
|
735
|
+
success: true,
|
|
736
|
+
config: {},
|
|
737
|
+
skippedSteps: ["welcome", "language", "workspaceSafety", "provider", "apiKey", "model", "permissions", "telemetry", "preferences", "advanced", "agentsFile", "registration", "reviewSummary"],
|
|
738
|
+
cancelled: false
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
try {
|
|
742
|
+
if (!_optionalChain([options, 'optionalAccess', _6 => _6.skipWelcome])) {
|
|
743
|
+
await this.showWelcome();
|
|
744
|
+
}
|
|
745
|
+
await this.promptLanguage();
|
|
746
|
+
const safeWorkspace = await this.checkWorkspaceStep();
|
|
747
|
+
if (!safeWorkspace) return this.cancelled();
|
|
748
|
+
const provider = await this.promptProvider();
|
|
749
|
+
if (!provider) return this.cancelled();
|
|
750
|
+
if (provider === "azure") {
|
|
751
|
+
const azureResult = await this.promptAzureConfig();
|
|
752
|
+
if (!azureResult) return this.cancelled();
|
|
753
|
+
} else if (provider === "vertexai") {
|
|
754
|
+
const vertexaiResult = await this.promptVertexAIConfig();
|
|
755
|
+
if (!vertexaiResult) return this.cancelled();
|
|
756
|
+
} else {
|
|
757
|
+
if (provider === "llamacpp") {
|
|
758
|
+
const ready = await this.prepareLlamaCpp();
|
|
759
|
+
if (!ready) return this.cancelled();
|
|
760
|
+
}
|
|
761
|
+
if (provider === "openai") {
|
|
762
|
+
const authMode = await this.promptOpenAIAuthMode();
|
|
763
|
+
if (!authMode) return this.cancelled();
|
|
764
|
+
this.state.openAIAuthMode = authMode;
|
|
765
|
+
if (authMode === "chatgpt") {
|
|
766
|
+
const chatgptAuth = await this.promptOpenAIChatGPTAuth();
|
|
767
|
+
if (!chatgptAuth) return this.cancelled();
|
|
768
|
+
this.state.openAIChatGPTAuth = chatgptAuth;
|
|
769
|
+
} else {
|
|
770
|
+
const apiKey = await this.promptApiKey(provider);
|
|
771
|
+
if (apiKey === null) return this.cancelled();
|
|
772
|
+
await this.validateApiKeyDuringSetup();
|
|
773
|
+
}
|
|
774
|
+
} else if (this.requiresApiKey(provider)) {
|
|
775
|
+
const apiKey = await this.promptApiKey(provider);
|
|
776
|
+
if (apiKey === null) return this.cancelled();
|
|
777
|
+
await this.validateApiKeyDuringSetup();
|
|
778
|
+
}
|
|
779
|
+
const model = await this.promptModel(provider);
|
|
780
|
+
if (!model) return this.cancelled();
|
|
781
|
+
if (provider === "openai") {
|
|
782
|
+
await this.promptReasoningEffort();
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
if (this.isLocalProvider(provider)) {
|
|
786
|
+
const connected = await this.testLocalProviderConnection();
|
|
787
|
+
if (!connected) return this.cancelled();
|
|
788
|
+
}
|
|
789
|
+
await this.promptPermissions();
|
|
790
|
+
await this.promptTelemetry();
|
|
791
|
+
await this.promptAutoReport();
|
|
792
|
+
if (!_optionalChain([options, 'optionalAccess', _7 => _7.quickSetup])) {
|
|
793
|
+
await this.promptPreferences();
|
|
794
|
+
} else {
|
|
795
|
+
this.state.skipped.push("preferences");
|
|
796
|
+
}
|
|
797
|
+
if (!_optionalChain([options, 'optionalAccess', _8 => _8.quickSetup])) {
|
|
798
|
+
const wantsAdvanced = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
799
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.advanced.prompt"),
|
|
800
|
+
defaultValue: false
|
|
801
|
+
});
|
|
802
|
+
if (wantsAdvanced) {
|
|
803
|
+
await this.promptNotifications();
|
|
804
|
+
await this.promptNetwork();
|
|
805
|
+
await this.promptSearch();
|
|
806
|
+
await this.promptMcp();
|
|
807
|
+
await this.promptAgentBehavior();
|
|
808
|
+
await this.promptCommunitySkills();
|
|
809
|
+
} else {
|
|
810
|
+
this.state.skipped.push("advanced", "notifications", "network", "search", "mcp", "agentBehavior", "communitySkills");
|
|
811
|
+
}
|
|
812
|
+
} else {
|
|
813
|
+
this.state.skipped.push("advanced", "notifications", "network", "search", "mcp", "agentBehavior", "communitySkills");
|
|
814
|
+
}
|
|
815
|
+
await this.promptAgentsFile();
|
|
816
|
+
if (!_optionalChain([options, 'optionalAccess', _9 => _9.quickSetup])) {
|
|
817
|
+
await this.promptRegistration();
|
|
818
|
+
} else {
|
|
819
|
+
this.state.skipped.push("registration");
|
|
820
|
+
}
|
|
821
|
+
if (!_optionalChain([options, 'optionalAccess', _10 => _10.quickSetup])) {
|
|
822
|
+
const confirmed = await this.promptReviewConfirm();
|
|
823
|
+
if (!confirmed) {
|
|
824
|
+
this.state = { currentStep: "welcome", skipped: [], completed: false };
|
|
825
|
+
return this.run({ ...options, force: true });
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return this.complete();
|
|
829
|
+
} catch (error) {
|
|
830
|
+
if (this.isCancellation(error)) {
|
|
831
|
+
return this.cancelled();
|
|
832
|
+
}
|
|
833
|
+
throw error;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Check if configuration is already complete
|
|
838
|
+
* Requires both a provider and a valid API key (for providers that need one)
|
|
839
|
+
*/
|
|
840
|
+
isAlreadyConfigured() {
|
|
841
|
+
if (!this.existingConfig) return false;
|
|
842
|
+
const provider = this.existingConfig.provider;
|
|
843
|
+
if (!provider) return false;
|
|
844
|
+
const providerConfig = _chunk46C73ZKKcjs.getProviderConfig.call(void 0, this.existingConfig, provider);
|
|
845
|
+
if (!providerConfig) return false;
|
|
846
|
+
if (provider === "openai") {
|
|
847
|
+
return this.isOpenAIConfigured(providerConfig);
|
|
848
|
+
}
|
|
849
|
+
if (provider === "vertexai") {
|
|
850
|
+
const vertexaiConfig = providerConfig;
|
|
851
|
+
return !!(vertexaiConfig.authToken && vertexaiConfig.authToken.length >= 10);
|
|
852
|
+
}
|
|
853
|
+
if (this.requiresApiKey(provider)) {
|
|
854
|
+
const apiKey = providerConfig.apiKey;
|
|
855
|
+
if (!apiKey || apiKey === "replace-me" || apiKey.length < 10) {
|
|
856
|
+
return false;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return true;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Show welcome screen
|
|
863
|
+
*/
|
|
864
|
+
async showWelcome() {
|
|
865
|
+
console.clear();
|
|
866
|
+
console.log(_chalk2.default.gray(_chunkIKUMVBCWcjs.ASCII_FRIEND));
|
|
867
|
+
console.log();
|
|
868
|
+
console.log(_chalk2.default.cyan.bold(" Welcome to Autohand!"));
|
|
869
|
+
console.log(_chalk2.default.gray(" Your super fast self evolving coding agent"));
|
|
870
|
+
console.log();
|
|
871
|
+
console.log(_chalk2.default.white(" Let's get you set up in just a few steps."));
|
|
872
|
+
console.log();
|
|
873
|
+
await this.pressEnter();
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Prompt for provider selection
|
|
877
|
+
*/
|
|
878
|
+
async promptProvider() {
|
|
879
|
+
this.state.currentStep = "provider";
|
|
880
|
+
const providers = _chunkWRTXCQ3Vcjs.ProviderFactory.getProviderNames();
|
|
881
|
+
const options = providers.map((p) => ({
|
|
882
|
+
label: this.getProviderDisplayName(p),
|
|
883
|
+
value: p,
|
|
884
|
+
description: this.getProviderHint(p)
|
|
885
|
+
}));
|
|
886
|
+
const hasValidExistingProvider = _optionalChain([this, 'access', _11 => _11.existingConfig, 'optionalAccess', _12 => _12.provider]) && this.isProviderConfigured(this.existingConfig.provider);
|
|
887
|
+
let initialIndex = 0;
|
|
888
|
+
if (hasValidExistingProvider) {
|
|
889
|
+
initialIndex = providers.indexOf(this.existingConfig.provider);
|
|
890
|
+
}
|
|
891
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
892
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.chooseProvider"),
|
|
893
|
+
options,
|
|
894
|
+
initialIndex: initialIndex >= 0 ? initialIndex : 0
|
|
895
|
+
});
|
|
896
|
+
if (!result) {
|
|
897
|
+
return null;
|
|
898
|
+
}
|
|
899
|
+
this.state.provider = result.value;
|
|
900
|
+
return result.value;
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Check if a specific provider is fully configured (has API key if required)
|
|
904
|
+
*/
|
|
905
|
+
isProviderConfigured(provider) {
|
|
906
|
+
if (!this.existingConfig) return false;
|
|
907
|
+
const providerConfig = _chunk46C73ZKKcjs.getProviderConfig.call(void 0, this.existingConfig, provider);
|
|
908
|
+
if (!providerConfig) return false;
|
|
909
|
+
if (provider === "openai") {
|
|
910
|
+
return this.isOpenAIConfigured(providerConfig);
|
|
911
|
+
}
|
|
912
|
+
if (provider === "vertexai") {
|
|
913
|
+
const vertexaiConfig = providerConfig;
|
|
914
|
+
return !!(vertexaiConfig.authToken && vertexaiConfig.authToken.length >= 10);
|
|
915
|
+
}
|
|
916
|
+
if (this.requiresApiKey(provider)) {
|
|
917
|
+
const apiKey = providerConfig.apiKey;
|
|
918
|
+
return apiKey && apiKey !== "replace-me" && apiKey.length >= 10;
|
|
919
|
+
}
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Prompt for API key (cloud providers)
|
|
924
|
+
*/
|
|
925
|
+
async promptApiKey(provider) {
|
|
926
|
+
this.state.currentStep = "apiKey";
|
|
927
|
+
const existingKey = this.getExistingApiKey(provider);
|
|
928
|
+
if (existingKey && existingKey !== "replace-me") {
|
|
929
|
+
const useExisting = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
930
|
+
title: `Use existing ${this.getProviderDisplayName(provider)} API key? (ends with ...${existingKey.slice(-4)})`,
|
|
931
|
+
defaultValue: true
|
|
932
|
+
});
|
|
933
|
+
if (useExisting) {
|
|
934
|
+
this.state.apiKey = existingKey;
|
|
935
|
+
return existingKey;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
console.log(_chalk2.default.gray("\n " + _chunkCHI52KFRcjs.t.call(void 0, "providers.config.apiKeyUrl", { url: this.getApiKeyUrl(provider) }) + "\n"));
|
|
939
|
+
const apiKey = await _chunkCH2J4PVEcjs.showPassword.call(void 0, {
|
|
940
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.enterApiKey", { provider: this.getProviderDisplayName(provider) }),
|
|
941
|
+
placeholder: _chunkCHI52KFRcjs.t.call(void 0, "ui.apiKeyPlaceholder"),
|
|
942
|
+
validate: (val) => {
|
|
943
|
+
if (!_optionalChain([val, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()])) return _chunkCHI52KFRcjs.t.call(void 0, "providers.config.apiKeyRequired");
|
|
944
|
+
if (val.length < 10) return _chunkCHI52KFRcjs.t.call(void 0, "providers.config.apiKeyTooShort");
|
|
945
|
+
return true;
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
if (!apiKey) {
|
|
949
|
+
return null;
|
|
950
|
+
}
|
|
951
|
+
this.state.apiKey = apiKey.trim();
|
|
952
|
+
return this.state.apiKey;
|
|
953
|
+
}
|
|
954
|
+
async promptOpenAIAuthMode() {
|
|
955
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
956
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.chooseTitle"),
|
|
957
|
+
options: [
|
|
958
|
+
{
|
|
959
|
+
label: _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.apiKeyLabel"),
|
|
960
|
+
value: "api-key",
|
|
961
|
+
description: _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.apiKeyDescription")
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
label: _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.chatgptLabel"),
|
|
965
|
+
value: "chatgpt",
|
|
966
|
+
description: _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.chatgptDescription")
|
|
967
|
+
}
|
|
968
|
+
],
|
|
969
|
+
initialIndex: this.getExistingOpenAIAuthMode() === "chatgpt" ? 1 : 0
|
|
970
|
+
});
|
|
971
|
+
return _nullishCoalesce(_optionalChain([result, 'optionalAccess', _15 => _15.value]), () => ( null));
|
|
972
|
+
}
|
|
973
|
+
async promptOpenAIChatGPTAuth() {
|
|
974
|
+
const existing = this.getExistingOpenAIChatGPTAuth();
|
|
975
|
+
if (existing && !_chunkWRTXCQ3Vcjs.isChatGPTAuthExpired.call(void 0, existing)) {
|
|
976
|
+
this.state.openAIChatGPTAuth = existing;
|
|
977
|
+
return existing;
|
|
978
|
+
}
|
|
979
|
+
try {
|
|
980
|
+
console.log(_chalk2.default.gray(`
|
|
981
|
+
${_chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.starting")}`));
|
|
982
|
+
const auth = await _chunkWRTXCQ3Vcjs.authenticateOpenAIChatGPT.call(void 0, {
|
|
983
|
+
onPrompt: ({ authorizationUrl, browserOpened }) => {
|
|
984
|
+
console.log(_chalk2.default.gray(`
|
|
985
|
+
${_chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.browserPrompt")}`));
|
|
986
|
+
console.log(_chalk2.default.white(` ${authorizationUrl}`));
|
|
987
|
+
console.log(_chalk2.default.gray(` ${browserOpened ? _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.browserOpened") : _chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.openManually")}`));
|
|
988
|
+
console.log(_chalk2.default.gray(` ${_chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.waiting")}
|
|
989
|
+
`));
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
this.state.openAIChatGPTAuth = auth;
|
|
993
|
+
return auth;
|
|
994
|
+
} catch (error) {
|
|
995
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
996
|
+
console.log(_chalk2.default.red(`
|
|
997
|
+
${_chunkCHI52KFRcjs.t.call(void 0, "providers.openaiAuth.failed", { message })}`));
|
|
998
|
+
throw error;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Prompt for model selection
|
|
1003
|
+
*/
|
|
1004
|
+
async promptModel(provider) {
|
|
1005
|
+
this.state.currentStep = "model";
|
|
1006
|
+
const defaultModel = this.getDefaultModel(provider);
|
|
1007
|
+
if (provider === "llamacpp") {
|
|
1008
|
+
this.state.model = defaultModel;
|
|
1009
|
+
return this.state.model;
|
|
1010
|
+
}
|
|
1011
|
+
if (provider === "zai") {
|
|
1012
|
+
const options = _chunkWRTXCQ3Vcjs.ZAI_MODELS.map((modelName) => ({
|
|
1013
|
+
label: modelName,
|
|
1014
|
+
value: modelName
|
|
1015
|
+
}));
|
|
1016
|
+
const defaultIndex = Math.max(0, _chunkWRTXCQ3Vcjs.ZAI_MODELS.indexOf(defaultModel));
|
|
1017
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1018
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1019
|
+
options,
|
|
1020
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1021
|
+
});
|
|
1022
|
+
if (!result) {
|
|
1023
|
+
return null;
|
|
1024
|
+
}
|
|
1025
|
+
this.state.model = result.value;
|
|
1026
|
+
return this.state.model;
|
|
1027
|
+
}
|
|
1028
|
+
if (provider === "cerebras") {
|
|
1029
|
+
const options = _chunkWRTXCQ3Vcjs.CEREBRAS_MODELS.map((modelName) => ({
|
|
1030
|
+
label: modelName,
|
|
1031
|
+
value: modelName
|
|
1032
|
+
}));
|
|
1033
|
+
const defaultIndex = Math.max(0, _chunkWRTXCQ3Vcjs.CEREBRAS_MODELS.indexOf(defaultModel));
|
|
1034
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1035
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1036
|
+
options,
|
|
1037
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1038
|
+
});
|
|
1039
|
+
if (!result) {
|
|
1040
|
+
return null;
|
|
1041
|
+
}
|
|
1042
|
+
this.state.model = result.value;
|
|
1043
|
+
return this.state.model;
|
|
1044
|
+
}
|
|
1045
|
+
if (provider === "deepseek") {
|
|
1046
|
+
const options = _chunkWRTXCQ3Vcjs.DEEPSEEK_MODELS.map((modelName) => ({
|
|
1047
|
+
label: modelName,
|
|
1048
|
+
value: modelName
|
|
1049
|
+
}));
|
|
1050
|
+
const defaultIndex = Math.max(0, _chunkWRTXCQ3Vcjs.DEEPSEEK_MODELS.indexOf(defaultModel));
|
|
1051
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1052
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1053
|
+
options,
|
|
1054
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1055
|
+
});
|
|
1056
|
+
if (!result) {
|
|
1057
|
+
return null;
|
|
1058
|
+
}
|
|
1059
|
+
this.state.model = result.value;
|
|
1060
|
+
return this.state.model;
|
|
1061
|
+
}
|
|
1062
|
+
if (provider === "nvidia") {
|
|
1063
|
+
const { NVIDIA_MODELS } = await Promise.resolve().then(() => _interopRequireWildcard(require("./NVIDIAProvider-MVTL62PR.cjs")));
|
|
1064
|
+
const options = [...NVIDIA_MODELS].map((modelName) => ({
|
|
1065
|
+
label: modelName,
|
|
1066
|
+
value: modelName
|
|
1067
|
+
}));
|
|
1068
|
+
const defaultIndex = Math.max(0, [...NVIDIA_MODELS].indexOf(defaultModel));
|
|
1069
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1070
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1071
|
+
options,
|
|
1072
|
+
initialIndex: defaultIndex >= 0 ? defaultIndex : 0
|
|
1073
|
+
});
|
|
1074
|
+
if (!result) {
|
|
1075
|
+
return null;
|
|
1076
|
+
}
|
|
1077
|
+
this.state.model = result.value;
|
|
1078
|
+
return this.state.model;
|
|
1079
|
+
}
|
|
1080
|
+
const model = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1081
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.enterModelId"),
|
|
1082
|
+
defaultValue: defaultModel,
|
|
1083
|
+
validate: (val) => {
|
|
1084
|
+
return _optionalChain([val, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()]) ? true : "Model is required";
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
if (!model) {
|
|
1088
|
+
return null;
|
|
1089
|
+
}
|
|
1090
|
+
this.state.model = model.trim();
|
|
1091
|
+
return this.state.model;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Prompt for reasoning effort level (OpenAI only)
|
|
1095
|
+
*/
|
|
1096
|
+
async promptReasoningEffort() {
|
|
1097
|
+
const options = [
|
|
1098
|
+
{ label: "none", value: "none", description: "No extended reasoning" },
|
|
1099
|
+
{ label: "low", value: "low", description: "Faster responses, minimal reasoning" },
|
|
1100
|
+
{ label: "medium", value: "medium", description: "Balanced speed and reasoning" },
|
|
1101
|
+
{ label: "high", value: "high", description: "Thorough reasoning (recommended)" },
|
|
1102
|
+
{ label: "xhigh", value: "xhigh", description: "Maximum reasoning depth" }
|
|
1103
|
+
];
|
|
1104
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1105
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.selectReasoningEffort"),
|
|
1106
|
+
options,
|
|
1107
|
+
initialIndex: 3
|
|
1108
|
+
// default to 'high'
|
|
1109
|
+
});
|
|
1110
|
+
if (result) {
|
|
1111
|
+
this.state.reasoningEffort = result.value;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Prompt for telemetry preference
|
|
1116
|
+
*/
|
|
1117
|
+
async promptTelemetry() {
|
|
1118
|
+
this.state.currentStep = "telemetry";
|
|
1119
|
+
console.log();
|
|
1120
|
+
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"));
|
|
1121
|
+
console.log(_chalk2.default.white.bold(" Help us improve Autohand"));
|
|
1122
|
+
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"));
|
|
1123
|
+
console.log();
|
|
1124
|
+
console.log(_chalk2.default.gray(" We collect anonymous usage data to understand how"));
|
|
1125
|
+
console.log(_chalk2.default.gray(" Autohand is used and where we can make it better."));
|
|
1126
|
+
console.log();
|
|
1127
|
+
console.log(_chalk2.default.gray(" What we collect:"));
|
|
1128
|
+
console.log(_chalk2.default.gray(" - Command usage (which features are popular)"));
|
|
1129
|
+
console.log(_chalk2.default.gray(" - Error rates (to fix bugs faster)"));
|
|
1130
|
+
console.log(_chalk2.default.gray(" - Performance metrics (to speed things up)"));
|
|
1131
|
+
console.log();
|
|
1132
|
+
console.log(_chalk2.default.gray(" What we never collect:"));
|
|
1133
|
+
console.log(_chalk2.default.gray(" - Your code or file contents"));
|
|
1134
|
+
console.log(_chalk2.default.gray(" - API keys or credentials"));
|
|
1135
|
+
console.log(_chalk2.default.gray(" - Personal information"));
|
|
1136
|
+
console.log();
|
|
1137
|
+
const telemetryEnabled = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1138
|
+
title: "Share anonymous usage data to help improve Autohand?",
|
|
1139
|
+
defaultValue: true
|
|
1140
|
+
});
|
|
1141
|
+
this.state.telemetryEnabled = telemetryEnabled;
|
|
1142
|
+
if (telemetryEnabled) {
|
|
1143
|
+
console.log(_chalk2.default.green(" Thanks for helping us improve Autohand!"));
|
|
1144
|
+
} else {
|
|
1145
|
+
console.log(_chalk2.default.gray(" No problem! You can change this anytime in config."));
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Prompt for auto report issues preference
|
|
1150
|
+
*/
|
|
1151
|
+
async promptAutoReport() {
|
|
1152
|
+
this.state.currentStep = "autoReport";
|
|
1153
|
+
console.log();
|
|
1154
|
+
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"));
|
|
1155
|
+
console.log(_chalk2.default.white.bold(" Auto Report Issues"));
|
|
1156
|
+
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"));
|
|
1157
|
+
console.log();
|
|
1158
|
+
console.log(_chalk2.default.gray(" When errors occur, Autohand can automatically report"));
|
|
1159
|
+
console.log(_chalk2.default.gray(" them as GitHub issues to help us fix bugs faster."));
|
|
1160
|
+
console.log();
|
|
1161
|
+
console.log(_chalk2.default.gray(" What gets reported:"));
|
|
1162
|
+
console.log(_chalk2.default.gray(" - Error type, message, and sanitized stack trace"));
|
|
1163
|
+
console.log(_chalk2.default.gray(" - CLI version, platform, and model info"));
|
|
1164
|
+
console.log();
|
|
1165
|
+
console.log(_chalk2.default.gray(" What we never report:"));
|
|
1166
|
+
console.log(_chalk2.default.gray(" - Your code or file contents"));
|
|
1167
|
+
console.log(_chalk2.default.gray(" - API keys or credentials"));
|
|
1168
|
+
console.log(_chalk2.default.gray(" - Personal information"));
|
|
1169
|
+
console.log();
|
|
1170
|
+
const autoReportEnabled = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1171
|
+
title: "Automatically report errors to help us fix bugs faster?",
|
|
1172
|
+
defaultValue: true
|
|
1173
|
+
});
|
|
1174
|
+
this.state.autoReportEnabled = autoReportEnabled;
|
|
1175
|
+
if (autoReportEnabled) {
|
|
1176
|
+
console.log(_chalk2.default.green(" Thanks! This helps us catch and fix issues quickly."));
|
|
1177
|
+
} else {
|
|
1178
|
+
console.log(_chalk2.default.gray(" No problem! You can enable this anytime in config."));
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Prompt for additional preferences
|
|
1183
|
+
*/
|
|
1184
|
+
async promptPreferences() {
|
|
1185
|
+
this.state.currentStep = "preferences";
|
|
1186
|
+
const configurePrefs = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1187
|
+
title: "Would you like to configure additional preferences? (theme, auto-confirm)",
|
|
1188
|
+
defaultValue: false
|
|
1189
|
+
});
|
|
1190
|
+
if (!configurePrefs) {
|
|
1191
|
+
this.state.skipped.push("preferences");
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
const themes = _chunkYWTIXHU6cjs.getBuiltInThemeNames.call(void 0, );
|
|
1195
|
+
const themeDescriptions = {
|
|
1196
|
+
dark: "Default dark theme",
|
|
1197
|
+
light: "Light theme for light backgrounds",
|
|
1198
|
+
dracula: "Popular Dracula color scheme",
|
|
1199
|
+
sandy: "Warm, earthy desert tones",
|
|
1200
|
+
tui: "New Zealand inspired colors",
|
|
1201
|
+
"github-dark": "GitHub Dark terminal palette",
|
|
1202
|
+
cappadocia: "Cappadocia-inspired rose valleys, dawn sky, and balloon colors",
|
|
1203
|
+
rio: "Rio-inspired blue macaw, rainforest, and beach-light palette",
|
|
1204
|
+
australia: "Australian coast, wattle, and eucalyptus palette"
|
|
1205
|
+
};
|
|
1206
|
+
const themeOptions = themes.map((themeName) => ({
|
|
1207
|
+
label: themeName,
|
|
1208
|
+
value: themeName,
|
|
1209
|
+
description: themeDescriptions[themeName]
|
|
1210
|
+
}));
|
|
1211
|
+
const themeResult = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1212
|
+
title: "Select a theme",
|
|
1213
|
+
options: themeOptions
|
|
1214
|
+
});
|
|
1215
|
+
const theme = _optionalChain([themeResult, 'optionalAccess', _18 => _18.value]) || "dark";
|
|
1216
|
+
const autoConfirm = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1217
|
+
title: "Auto-confirm non-destructive actions?",
|
|
1218
|
+
defaultValue: false
|
|
1219
|
+
});
|
|
1220
|
+
const checkForUpdates = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1221
|
+
title: "Check for updates on startup?",
|
|
1222
|
+
defaultValue: true
|
|
1223
|
+
});
|
|
1224
|
+
this.state.preferences = { theme, autoConfirm, checkForUpdates };
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Prompt for AGENTS.md creation
|
|
1228
|
+
*/
|
|
1229
|
+
async promptAgentsFile() {
|
|
1230
|
+
this.state.currentStep = "agentsFile";
|
|
1231
|
+
const agentsPath = _path.join.call(void 0, this.workspaceRoot, "AGENTS.md");
|
|
1232
|
+
const exists = await _fsextra2.default.pathExists(agentsPath);
|
|
1233
|
+
if (exists) {
|
|
1234
|
+
const overwrite = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1235
|
+
title: "AGENTS.md already exists. Would you like to regenerate it?",
|
|
1236
|
+
defaultValue: false
|
|
1237
|
+
});
|
|
1238
|
+
if (!overwrite) {
|
|
1239
|
+
this.state.skipped.push("agentsFile");
|
|
1240
|
+
console.log(_chalk2.default.gray(" Keeping existing AGENTS.md"));
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
} else {
|
|
1244
|
+
console.log();
|
|
1245
|
+
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"));
|
|
1246
|
+
console.log(_chalk2.default.white.bold(" Project Configuration"));
|
|
1247
|
+
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"));
|
|
1248
|
+
console.log();
|
|
1249
|
+
console.log(_chalk2.default.gray(" AGENTS.md helps Autohand understand your project better."));
|
|
1250
|
+
console.log(_chalk2.default.gray(" It contains instructions specific to your codebase."));
|
|
1251
|
+
console.log();
|
|
1252
|
+
const createAgents = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1253
|
+
title: "Generate AGENTS.md based on your project?",
|
|
1254
|
+
defaultValue: true
|
|
1255
|
+
});
|
|
1256
|
+
if (!createAgents) {
|
|
1257
|
+
this.state.skipped.push("agentsFile");
|
|
1258
|
+
console.log(_chalk2.default.gray(" You can create it later with /init"));
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
console.log();
|
|
1263
|
+
console.log(_chalk2.default.gray(" Analyzing your project..."));
|
|
1264
|
+
const analyzer = new ProjectAnalyzer(this.workspaceRoot);
|
|
1265
|
+
const projectInfo = await analyzer.analyze();
|
|
1266
|
+
if (Object.keys(projectInfo).length > 0) {
|
|
1267
|
+
console.log();
|
|
1268
|
+
console.log(_chalk2.default.gray(" Detected:"));
|
|
1269
|
+
if (projectInfo.language) {
|
|
1270
|
+
console.log(_chalk2.default.white(` - Language: ${projectInfo.language}`));
|
|
1271
|
+
}
|
|
1272
|
+
if (projectInfo.framework) {
|
|
1273
|
+
console.log(_chalk2.default.white(` - Framework: ${projectInfo.framework}`));
|
|
1274
|
+
}
|
|
1275
|
+
if (projectInfo.packageManager) {
|
|
1276
|
+
console.log(_chalk2.default.white(` - Package manager: ${projectInfo.packageManager}`));
|
|
1277
|
+
}
|
|
1278
|
+
if (projectInfo.testFramework) {
|
|
1279
|
+
console.log(_chalk2.default.white(` - Test framework: ${projectInfo.testFramework}`));
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
const generator = new AgentsGenerator();
|
|
1283
|
+
const content = generator.generateContent(projectInfo);
|
|
1284
|
+
await _fsextra2.default.writeFile(agentsPath, content);
|
|
1285
|
+
this.state.agentsFileCreated = true;
|
|
1286
|
+
console.log();
|
|
1287
|
+
console.log(_chalk2.default.green(" Created AGENTS.md"));
|
|
1288
|
+
console.log(_chalk2.default.gray(" You can customize it anytime to improve Autohand's understanding."));
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Prompt user to create an Autohand account using device-flow auth.
|
|
1292
|
+
* Account creation is now mandatory to use Autohand.
|
|
1293
|
+
* Reuses the same flow as /login command.
|
|
1294
|
+
*/
|
|
1295
|
+
async promptRegistration() {
|
|
1296
|
+
this.state.currentStep = "registration";
|
|
1297
|
+
console.log();
|
|
1298
|
+
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"));
|
|
1299
|
+
console.log(_chalk2.default.white.bold(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.title")));
|
|
1300
|
+
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"));
|
|
1301
|
+
console.log();
|
|
1302
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.descriptionMandatory")));
|
|
1303
|
+
console.log();
|
|
1304
|
+
const authClient = _chunkQ2IL4DDIcjs.getAuthClient.call(void 0, );
|
|
1305
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.initiating")));
|
|
1306
|
+
const initResult = await authClient.initiateDeviceAuth();
|
|
1307
|
+
if (!initResult.success || !initResult.deviceCode || !initResult.userCode) {
|
|
1308
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.failed", { error: initResult.error || "Unknown error" })));
|
|
1309
|
+
const retry2 = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1310
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.retryPrompt"),
|
|
1311
|
+
defaultValue: true
|
|
1312
|
+
});
|
|
1313
|
+
if (retry2) {
|
|
1314
|
+
return this.promptRegistration();
|
|
1315
|
+
}
|
|
1316
|
+
this.state.skipped.push("registration");
|
|
1317
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.tryLater")));
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
const authUrl = initResult.verificationUriComplete || `${_chunkE26KKI46cjs.AUTH_CONFIG.authorizationUrl}?code=${initResult.userCode}`;
|
|
1321
|
+
console.log();
|
|
1322
|
+
console.log(_chalk2.default.white(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.visit")));
|
|
1323
|
+
console.log(_chalk2.default.cyan(" " + authUrl));
|
|
1324
|
+
console.log();
|
|
1325
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.code")));
|
|
1326
|
+
console.log(_chalk2.default.bold.yellow(` ${initResult.userCode}`));
|
|
1327
|
+
console.log();
|
|
1328
|
+
try {
|
|
1329
|
+
const open = await Promise.resolve().then(() => _interopRequireWildcard(require("open"))).then((m) => m.default).catch(() => null);
|
|
1330
|
+
if (open) {
|
|
1331
|
+
await open(authUrl);
|
|
1332
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.browserOpened")));
|
|
1333
|
+
} else {
|
|
1334
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.openManually")));
|
|
1335
|
+
}
|
|
1336
|
+
} catch (e12) {
|
|
1337
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.openManually")));
|
|
1338
|
+
}
|
|
1339
|
+
console.log();
|
|
1340
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.waiting")));
|
|
1341
|
+
const startTime = Date.now();
|
|
1342
|
+
const timeout = 3 * 60 * 1e3;
|
|
1343
|
+
const pollInterval = initResult.interval ? initResult.interval * 1e3 : _chunkE26KKI46cjs.AUTH_CONFIG.pollInterval;
|
|
1344
|
+
let dots = 0;
|
|
1345
|
+
const maxDots = 3;
|
|
1346
|
+
while (Date.now() - startTime < timeout) {
|
|
1347
|
+
process.stdout.write(`\r ${_chalk2.default.gray("Waiting" + ".".repeat(dots + 1) + " ".repeat(maxDots - dots))}`);
|
|
1348
|
+
dots = (dots + 1) % (maxDots + 1);
|
|
1349
|
+
await this.sleep(pollInterval);
|
|
1350
|
+
const pollResult = await authClient.pollDeviceAuth(initResult.deviceCode);
|
|
1351
|
+
if (pollResult.status === "authorized" && pollResult.token && pollResult.user) {
|
|
1352
|
+
process.stdout.write("\r" + " ".repeat(20) + "\r");
|
|
1353
|
+
this.state.authToken = pollResult.token;
|
|
1354
|
+
this.state.authUser = pollResult.user;
|
|
1355
|
+
console.log();
|
|
1356
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.success", { name: pollResult.user.name || pollResult.user.email })));
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1359
|
+
if (pollResult.status === "expired") {
|
|
1360
|
+
process.stdout.write("\r" + " ".repeat(20) + "\r");
|
|
1361
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.expired")));
|
|
1362
|
+
const retry2 = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1363
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.retryPrompt"),
|
|
1364
|
+
defaultValue: true
|
|
1365
|
+
});
|
|
1366
|
+
if (retry2) {
|
|
1367
|
+
return this.promptRegistration();
|
|
1368
|
+
}
|
|
1369
|
+
this.state.skipped.push("registration");
|
|
1370
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.tryLater")));
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
process.stdout.write("\r" + " ".repeat(20) + "\r");
|
|
1375
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.timeout")));
|
|
1376
|
+
const retry = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1377
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.retryPrompt"),
|
|
1378
|
+
defaultValue: true
|
|
1379
|
+
});
|
|
1380
|
+
if (retry) {
|
|
1381
|
+
return this.promptRegistration();
|
|
1382
|
+
}
|
|
1383
|
+
this.state.skipped.push("registration");
|
|
1384
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.registration.tryLater")));
|
|
1385
|
+
}
|
|
1386
|
+
sleep(ms) {
|
|
1387
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* Build final config and return success
|
|
1391
|
+
*/
|
|
1392
|
+
complete() {
|
|
1393
|
+
this.state.currentStep = "complete";
|
|
1394
|
+
this.state.completed = true;
|
|
1395
|
+
const config = {
|
|
1396
|
+
provider: this.state.provider
|
|
1397
|
+
};
|
|
1398
|
+
if (this.state.provider) {
|
|
1399
|
+
if (this.state.provider === "azure" && this.state.azureConfig) {
|
|
1400
|
+
config.azure = this.state.azureConfig;
|
|
1401
|
+
} else if (this.state.provider === "openai" && this.state.openAIAuthMode === "chatgpt") {
|
|
1402
|
+
config.openai = {
|
|
1403
|
+
authMode: "chatgpt",
|
|
1404
|
+
chatgptAuth: this.state.openAIChatGPTAuth,
|
|
1405
|
+
model: _nullishCoalesce(this.state.model, () => ( this.getDefaultModel("openai"))),
|
|
1406
|
+
baseUrl: "https://chatgpt.com/backend-api/codex",
|
|
1407
|
+
...this.state.reasoningEffort !== void 0 && { reasoningEffort: this.state.reasoningEffort }
|
|
1408
|
+
};
|
|
1409
|
+
} else if (this.state.provider === "openai") {
|
|
1410
|
+
config.openai = {
|
|
1411
|
+
authMode: "api-key",
|
|
1412
|
+
apiKey: this.state.apiKey,
|
|
1413
|
+
model: _nullishCoalesce(this.state.model, () => ( this.getDefaultModel("openai"))),
|
|
1414
|
+
baseUrl: this.getDefaultBaseUrl("openai"),
|
|
1415
|
+
...this.state.reasoningEffort !== void 0 && { reasoningEffort: this.state.reasoningEffort }
|
|
1416
|
+
};
|
|
1417
|
+
} else if (this.state.provider === "vertexai" && this.state.vertexaiConfig) {
|
|
1418
|
+
config.vertexai = this.state.vertexaiConfig;
|
|
1419
|
+
} else if (this.requiresApiKey(this.state.provider)) {
|
|
1420
|
+
config[this.state.provider] = {
|
|
1421
|
+
apiKey: this.state.apiKey,
|
|
1422
|
+
model: this.state.model,
|
|
1423
|
+
baseUrl: this.getDefaultBaseUrl(this.state.provider),
|
|
1424
|
+
...this.state.reasoningEffort !== void 0 && { reasoningEffort: this.state.reasoningEffort }
|
|
1425
|
+
};
|
|
1426
|
+
} else {
|
|
1427
|
+
config[this.state.provider] = {
|
|
1428
|
+
model: this.state.model,
|
|
1429
|
+
baseUrl: _nullishCoalesce(this.state.providerBaseUrl, () => ( this.getDefaultBaseUrl(this.state.provider)))
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
config.telemetry = {
|
|
1434
|
+
enabled: _nullishCoalesce(this.state.telemetryEnabled, () => ( true))
|
|
1435
|
+
};
|
|
1436
|
+
config.autoReport = {
|
|
1437
|
+
enabled: _nullishCoalesce(this.state.autoReportEnabled, () => ( true))
|
|
1438
|
+
};
|
|
1439
|
+
const uiConfig = {};
|
|
1440
|
+
if (this.state.locale) {
|
|
1441
|
+
uiConfig.locale = this.state.locale;
|
|
1442
|
+
}
|
|
1443
|
+
if (this.state.preferences) {
|
|
1444
|
+
uiConfig.theme = this.state.preferences.theme;
|
|
1445
|
+
uiConfig.autoConfirm = this.state.preferences.autoConfirm;
|
|
1446
|
+
uiConfig.checkForUpdates = this.state.preferences.checkForUpdates;
|
|
1447
|
+
}
|
|
1448
|
+
if (this.state.notifications) {
|
|
1449
|
+
uiConfig.notifications = this.state.notifications;
|
|
1450
|
+
}
|
|
1451
|
+
if (Object.keys(uiConfig).length > 0) {
|
|
1452
|
+
config.ui = uiConfig;
|
|
1453
|
+
}
|
|
1454
|
+
if (this.state.permissionMode) {
|
|
1455
|
+
config.permissions = {
|
|
1456
|
+
mode: this.state.permissionMode,
|
|
1457
|
+
rememberSession: _nullishCoalesce(this.state.rememberSession, () => ( true))
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
if (this.state.network) {
|
|
1461
|
+
config.network = this.state.network;
|
|
1462
|
+
}
|
|
1463
|
+
if (this.state.search) {
|
|
1464
|
+
config.search = this.state.search;
|
|
1465
|
+
}
|
|
1466
|
+
if (this.state.mcpEnabled !== void 0) {
|
|
1467
|
+
config.mcp = { enabled: this.state.mcpEnabled };
|
|
1468
|
+
}
|
|
1469
|
+
if (this.state.agentSettings) {
|
|
1470
|
+
config.agent = this.state.agentSettings;
|
|
1471
|
+
}
|
|
1472
|
+
if (this.state.communitySkillsEnabled !== void 0) {
|
|
1473
|
+
config.communitySkills = { enabled: this.state.communitySkillsEnabled };
|
|
1474
|
+
}
|
|
1475
|
+
if (this.state.authToken && this.state.authUser) {
|
|
1476
|
+
config.auth = {
|
|
1477
|
+
token: this.state.authToken,
|
|
1478
|
+
user: this.state.authUser
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
this.showCompletionMessage();
|
|
1482
|
+
return {
|
|
1483
|
+
success: true,
|
|
1484
|
+
config,
|
|
1485
|
+
skippedSteps: this.state.skipped,
|
|
1486
|
+
cancelled: false,
|
|
1487
|
+
agentsFileCreated: this.state.agentsFileCreated
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Show setup complete message
|
|
1492
|
+
*/
|
|
1493
|
+
showCompletionMessage() {
|
|
1494
|
+
console.log();
|
|
1495
|
+
console.log();
|
|
1496
|
+
console.log(_chalk2.default.green(" Setup complete!"));
|
|
1497
|
+
console.log();
|
|
1498
|
+
console.log(_chalk2.default.gray(" What was created:"));
|
|
1499
|
+
console.log(_chalk2.default.white(" - ~/.autohand/config.toml/yaml/json (your settings)"));
|
|
1500
|
+
if (this.state.agentsFileCreated) {
|
|
1501
|
+
console.log(_chalk2.default.white(" - AGENTS.md (project instructions for Autohand)"));
|
|
1502
|
+
}
|
|
1503
|
+
console.log();
|
|
1504
|
+
console.log(_chalk2.default.gray(" Quick tips:"));
|
|
1505
|
+
console.log(_chalk2.default.white(" - Type your request and press Enter to start"));
|
|
1506
|
+
console.log(_chalk2.default.white(" - Use @filename to mention files"));
|
|
1507
|
+
console.log(_chalk2.default.white(" - Type /help for all commands"));
|
|
1508
|
+
console.log(_chalk2.default.white(" - Press Ctrl+C twice to exit"));
|
|
1509
|
+
console.log();
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Return cancelled result
|
|
1513
|
+
*/
|
|
1514
|
+
cancelled() {
|
|
1515
|
+
return {
|
|
1516
|
+
success: false,
|
|
1517
|
+
config: {},
|
|
1518
|
+
skippedSteps: [],
|
|
1519
|
+
cancelled: true
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Full Azure OpenAI configuration flow
|
|
1524
|
+
* Shows prerequisites, collects auth method, endpoint, deployment, and API version
|
|
1525
|
+
*/
|
|
1526
|
+
async promptAzureConfig() {
|
|
1527
|
+
this.state.currentStep = "apiKey";
|
|
1528
|
+
console.log(_chalk2.default.cyan("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.title")));
|
|
1529
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.getStarted") + "\n"));
|
|
1530
|
+
console.log(_chalk2.default.yellow(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.setupSteps.title")));
|
|
1531
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step1")));
|
|
1532
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step2")));
|
|
1533
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step3")));
|
|
1534
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.setupSteps.step4")));
|
|
1535
|
+
console.log();
|
|
1536
|
+
const authChoices = [
|
|
1537
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.authApiKey"), value: "api-key" },
|
|
1538
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.authEntraId"), value: "entra-id" },
|
|
1539
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.authManagedIdentity"), value: "managed-identity" }
|
|
1540
|
+
];
|
|
1541
|
+
const authResult = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1542
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.selectAuthMethod"),
|
|
1543
|
+
options: authChoices
|
|
1544
|
+
});
|
|
1545
|
+
if (!authResult) return false;
|
|
1546
|
+
const authMethod = authResult.value;
|
|
1547
|
+
let apiKey;
|
|
1548
|
+
let tenantId;
|
|
1549
|
+
let clientId;
|
|
1550
|
+
let clientSecret;
|
|
1551
|
+
if (authMethod === "api-key") {
|
|
1552
|
+
console.log(_chalk2.default.gray("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.apiKeyLocation") + "\n"));
|
|
1553
|
+
apiKey = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showPassword.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterAzureApiKey"), placeholder: _chunkCHI52KFRcjs.t.call(void 0, "ui.apiKeyPlaceholder") }), async () => ( void 0));
|
|
1554
|
+
if (!apiKey) return false;
|
|
1555
|
+
} else if (authMethod === "entra-id") {
|
|
1556
|
+
console.log(_chalk2.default.gray("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.entraIdDescription")));
|
|
1557
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.entraIdDocs") + "\n"));
|
|
1558
|
+
tenantId = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showInput.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterTenantId") }), async () => ( void 0));
|
|
1559
|
+
if (!tenantId) return false;
|
|
1560
|
+
clientId = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showInput.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterClientId") }), async () => ( void 0));
|
|
1561
|
+
if (!clientId) return false;
|
|
1562
|
+
clientSecret = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showPassword.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterClientSecret") }), async () => ( void 0));
|
|
1563
|
+
if (!clientSecret) return false;
|
|
1564
|
+
} else {
|
|
1565
|
+
console.log(_chalk2.default.gray("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.managedIdentityDescription")));
|
|
1566
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.managedIdentityDocs") + "\n"));
|
|
1567
|
+
}
|
|
1568
|
+
const endpointChoice = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1569
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.endpointChoice"),
|
|
1570
|
+
options: [
|
|
1571
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.endpointStructured"), value: "structured" },
|
|
1572
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.endpointUrl"), value: "url" }
|
|
1573
|
+
]
|
|
1574
|
+
});
|
|
1575
|
+
if (!endpointChoice) return false;
|
|
1576
|
+
let resourceName;
|
|
1577
|
+
let deploymentName;
|
|
1578
|
+
let baseUrl;
|
|
1579
|
+
if (endpointChoice.value === "structured") {
|
|
1580
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.endpointUrlHint")));
|
|
1581
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.endpointUrlExample") + "\n"));
|
|
1582
|
+
resourceName = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showInput.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterEndpointOrResource") }), async () => ( void 0));
|
|
1583
|
+
if (!resourceName) return false;
|
|
1584
|
+
console.log(_chalk2.default.gray("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.deploymentHint")));
|
|
1585
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.deploymentNotUrl") + "\n"));
|
|
1586
|
+
deploymentName = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showInput.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterDeploymentName"), defaultValue: "gpt-5.3-codex" }), async () => ( void 0));
|
|
1587
|
+
if (!deploymentName) return false;
|
|
1588
|
+
if (deploymentName.startsWith("http://") || deploymentName.startsWith("https://")) {
|
|
1589
|
+
console.log(_chalk2.default.red("\n\u2717 " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.deploymentUrlError")));
|
|
1590
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.deploymentUrlErrorHint")));
|
|
1591
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.deploymentUrlErrorLocation") + "\n"));
|
|
1592
|
+
return false;
|
|
1593
|
+
}
|
|
1594
|
+
} else {
|
|
1595
|
+
baseUrl = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1596
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.enterFullEndpointUrl"),
|
|
1597
|
+
defaultValue: "https://your-resource.openai.azure.com/openai/deployments/gpt-5.3-codex"
|
|
1598
|
+
}), async () => ( void 0));
|
|
1599
|
+
if (!baseUrl) return false;
|
|
1600
|
+
}
|
|
1601
|
+
const apiVersion = await _asyncNullishCoalesce(await _chunkCH2J4PVEcjs.showInput.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.apiVersion"), defaultValue: "2024-10-21" }), async () => ( void 0));
|
|
1602
|
+
if (!apiVersion) return false;
|
|
1603
|
+
const model = _nullishCoalesce(deploymentName, () => ( "gpt-5.3-codex"));
|
|
1604
|
+
const azureConfig = {
|
|
1605
|
+
model,
|
|
1606
|
+
authMethod,
|
|
1607
|
+
apiVersion,
|
|
1608
|
+
...apiKey && { apiKey },
|
|
1609
|
+
...tenantId && { tenantId },
|
|
1610
|
+
...clientId && { clientId },
|
|
1611
|
+
...clientSecret && { clientSecret },
|
|
1612
|
+
...resourceName && { resourceName },
|
|
1613
|
+
...deploymentName && { deploymentName },
|
|
1614
|
+
...baseUrl && { baseUrl }
|
|
1615
|
+
};
|
|
1616
|
+
this.state.azureConfig = azureConfig;
|
|
1617
|
+
this.state.model = model;
|
|
1618
|
+
console.log(_chalk2.default.green("\n\u2713 " + _chunkCHI52KFRcjs.t.call(void 0, "providers.config.configuredSuccessfully", { provider: _chunkCHI52KFRcjs.t.call(void 0, "providers.azure") })));
|
|
1619
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.azure.authLabel", { method: authMethod })));
|
|
1620
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.config.modelLabel", { model })));
|
|
1621
|
+
console.log();
|
|
1622
|
+
return true;
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Full Google Cloud Vertex AI configuration flow
|
|
1626
|
+
* Shows prerequisites, collects endpoint, region, project ID, auth token, and model
|
|
1627
|
+
* Auto-detects gcloud CLI and uses it for automatic token management
|
|
1628
|
+
*/
|
|
1629
|
+
async promptVertexAIConfig() {
|
|
1630
|
+
this.state.currentStep = "apiKey";
|
|
1631
|
+
console.log(_chalk2.default.cyan("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.title")));
|
|
1632
|
+
console.log(_chalk2.default.gray(_chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.getStarted") + "\n"));
|
|
1633
|
+
const gcloudInstalled = await _chunkWRTXCQ3Vcjs.isGcloudInstalled.call(void 0, );
|
|
1634
|
+
const gcloudAccount = gcloudInstalled ? await _chunkWRTXCQ3Vcjs.getGcloudAccount.call(void 0, ) : null;
|
|
1635
|
+
const gcloudProject = gcloudInstalled ? await _chunkWRTXCQ3Vcjs.getGcloudProject.call(void 0, ) : null;
|
|
1636
|
+
const existingConfig = _optionalChain([this, 'access', _19 => _19.existingConfig, 'optionalAccess', _20 => _20.vertexai]);
|
|
1637
|
+
const existingProjectId = _optionalChain([existingConfig, 'optionalAccess', _21 => _21.projectId]);
|
|
1638
|
+
const existingEndpoint = _optionalChain([existingConfig, 'optionalAccess', _22 => _22.endpoint]);
|
|
1639
|
+
const existingRegion = _optionalChain([existingConfig, 'optionalAccess', _23 => _23.region]);
|
|
1640
|
+
if (gcloudInstalled) {
|
|
1641
|
+
console.log(_chalk2.default.green(" \u2713 gcloud CLI detected"));
|
|
1642
|
+
if (gcloudAccount) {
|
|
1643
|
+
console.log(_chalk2.default.gray(` Account: ${gcloudAccount}`));
|
|
1644
|
+
}
|
|
1645
|
+
if (gcloudProject) {
|
|
1646
|
+
console.log(_chalk2.default.gray(` Project: ${gcloudProject}`));
|
|
1647
|
+
}
|
|
1648
|
+
console.log();
|
|
1649
|
+
} else {
|
|
1650
|
+
console.log(_chalk2.default.yellow(" \u26A0 gcloud CLI not detected"));
|
|
1651
|
+
console.log(_chalk2.default.gray(" Install it for automatic token management:"));
|
|
1652
|
+
console.log(_chalk2.default.gray(" https://cloud.google.com/sdk/docs/install"));
|
|
1653
|
+
console.log();
|
|
1654
|
+
}
|
|
1655
|
+
const endpoint = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1656
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.enterEndpoint"),
|
|
1657
|
+
defaultValue: existingEndpoint || "aiplatform.googleapis.com"
|
|
1658
|
+
});
|
|
1659
|
+
if (!endpoint) return false;
|
|
1660
|
+
const region = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1661
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.enterRegion"),
|
|
1662
|
+
defaultValue: existingRegion || "global"
|
|
1663
|
+
});
|
|
1664
|
+
if (!region) return false;
|
|
1665
|
+
const defaultProjectId = existingProjectId || gcloudProject || "";
|
|
1666
|
+
const projectId = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1667
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.enterProjectId"),
|
|
1668
|
+
defaultValue: defaultProjectId,
|
|
1669
|
+
placeholder: "YOUR_PROJECT_ID"
|
|
1670
|
+
});
|
|
1671
|
+
if (!projectId) return false;
|
|
1672
|
+
let authToken;
|
|
1673
|
+
if (gcloudInstalled) {
|
|
1674
|
+
console.log(_chalk2.default.gray("\n Fetching access token from gcloud..."));
|
|
1675
|
+
const tokenResult = await _chunkWRTXCQ3Vcjs.getGcloudAccessToken.call(void 0, );
|
|
1676
|
+
if (tokenResult.token) {
|
|
1677
|
+
console.log(_chalk2.default.green(" \u2713 Access token obtained (valid for ~25 minutes)"));
|
|
1678
|
+
console.log(_chalk2.default.gray(" Tokens are automatically refreshed when using gcloud."));
|
|
1679
|
+
authToken = tokenResult.token;
|
|
1680
|
+
} else {
|
|
1681
|
+
console.log(_chalk2.default.yellow(` \u26A0 ${tokenResult.error}`));
|
|
1682
|
+
console.log(_chalk2.default.gray(" Please enter token manually or run: gcloud auth login"));
|
|
1683
|
+
console.log();
|
|
1684
|
+
const manualToken = await _chunkCH2J4PVEcjs.showPassword.call(void 0, {
|
|
1685
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.enterAuthToken"),
|
|
1686
|
+
placeholder: _chunkCHI52KFRcjs.t.call(void 0, "ui.apiKeyPlaceholder")
|
|
1687
|
+
});
|
|
1688
|
+
if (!manualToken) return false;
|
|
1689
|
+
authToken = manualToken;
|
|
1690
|
+
}
|
|
1691
|
+
} else {
|
|
1692
|
+
console.log(_chalk2.default.gray("\n" + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.authTokenHint")));
|
|
1693
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.authTokenCommand")));
|
|
1694
|
+
console.log();
|
|
1695
|
+
const manualToken = await _chunkCH2J4PVEcjs.showPassword.call(void 0, {
|
|
1696
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.vertexai.enterAuthToken"),
|
|
1697
|
+
placeholder: _chunkCHI52KFRcjs.t.call(void 0, "ui.apiKeyPlaceholder")
|
|
1698
|
+
});
|
|
1699
|
+
if (!manualToken) return false;
|
|
1700
|
+
authToken = manualToken;
|
|
1701
|
+
}
|
|
1702
|
+
const modelOptions = _chunkWRTXCQ3Vcjs.VERTEX_AI_CODING_MODELS.map((name) => ({
|
|
1703
|
+
label: name,
|
|
1704
|
+
value: name
|
|
1705
|
+
}));
|
|
1706
|
+
const modelResult = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1707
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.config.selectModel"),
|
|
1708
|
+
options: modelOptions,
|
|
1709
|
+
allowCustomInput: true
|
|
1710
|
+
});
|
|
1711
|
+
if (!modelResult) return false;
|
|
1712
|
+
const model = modelResult.value;
|
|
1713
|
+
this.state.provider = "vertexai";
|
|
1714
|
+
this.state.apiKey = authToken;
|
|
1715
|
+
this.state.model = model;
|
|
1716
|
+
this.state.providerBaseUrl = `https://${endpoint}/v1/projects/${projectId}/locations/${region}/endpoints/openapi`;
|
|
1717
|
+
this.state.vertexaiConfig = {
|
|
1718
|
+
authToken,
|
|
1719
|
+
endpoint,
|
|
1720
|
+
region,
|
|
1721
|
+
projectId,
|
|
1722
|
+
model
|
|
1723
|
+
};
|
|
1724
|
+
console.log(_chalk2.default.green("\n\u2713 " + _chunkCHI52KFRcjs.t.call(void 0, "providers.config.configuredSuccessfully", { provider: _chunkCHI52KFRcjs.t.call(void 0, "providers.vertexai") })));
|
|
1725
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.config.modelLabel", { model })));
|
|
1726
|
+
if (gcloudInstalled) {
|
|
1727
|
+
console.log(_chalk2.default.gray(" Token auto-refresh enabled via gcloud CLI"));
|
|
1728
|
+
}
|
|
1729
|
+
console.log();
|
|
1730
|
+
return true;
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* Prompt for language selection
|
|
1734
|
+
*/
|
|
1735
|
+
async promptLanguage() {
|
|
1736
|
+
this.state.currentStep = "language";
|
|
1737
|
+
const detected = _chunkCHI52KFRcjs.detectLocale.call(void 0, );
|
|
1738
|
+
console.log(_chalk2.default.gray("\n " + _chunkCHI52KFRcjs.t.call(void 0, "setup.language.detected", { language: _chunkCHI52KFRcjs.LANGUAGE_DISPLAY_NAMES[detected.locale] })));
|
|
1739
|
+
const options = _chunkCHI52KFRcjs.SUPPORTED_LOCALES.map((locale) => ({
|
|
1740
|
+
label: _chunkCHI52KFRcjs.LANGUAGE_DISPLAY_NAMES[locale],
|
|
1741
|
+
value: locale
|
|
1742
|
+
}));
|
|
1743
|
+
const initialIndex = _chunkCHI52KFRcjs.SUPPORTED_LOCALES.indexOf(detected.locale);
|
|
1744
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1745
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.language.prompt"),
|
|
1746
|
+
options,
|
|
1747
|
+
initialIndex: initialIndex >= 0 ? initialIndex : 0
|
|
1748
|
+
});
|
|
1749
|
+
if (!result) {
|
|
1750
|
+
this.state.locale = detected.locale;
|
|
1751
|
+
return;
|
|
1752
|
+
}
|
|
1753
|
+
const selectedLocale = result.value;
|
|
1754
|
+
this.state.locale = selectedLocale;
|
|
1755
|
+
if (selectedLocale !== detected.locale) {
|
|
1756
|
+
await _chunkCHI52KFRcjs.changeLanguage.call(void 0, selectedLocale);
|
|
1757
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.language.changed", { language: _chunkCHI52KFRcjs.LANGUAGE_DISPLAY_NAMES[selectedLocale] })));
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Validate API key during setup by hitting GET /models
|
|
1762
|
+
*/
|
|
1763
|
+
async validateApiKeyDuringSetup() {
|
|
1764
|
+
if (!this.state.provider || !this.state.apiKey) return;
|
|
1765
|
+
if (!this.requiresApiKey(this.state.provider)) return;
|
|
1766
|
+
const baseUrl = this.getDefaultBaseUrl(this.state.provider);
|
|
1767
|
+
console.log(_chalk2.default.gray("\n " + _chunkCHI52KFRcjs.t.call(void 0, "setup.apiKeyValidation.validating")));
|
|
1768
|
+
try {
|
|
1769
|
+
const response = await fetch(`${baseUrl}/models`, {
|
|
1770
|
+
headers: { Authorization: `Bearer ${this.state.apiKey}` },
|
|
1771
|
+
signal: AbortSignal.timeout(1e4)
|
|
1772
|
+
});
|
|
1773
|
+
if (response.ok) {
|
|
1774
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.apiKeyValidation.success")));
|
|
1775
|
+
} else {
|
|
1776
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.apiKeyValidation.failed", { error: `HTTP ${response.status}` })));
|
|
1777
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.apiKeyValidation.hint")));
|
|
1778
|
+
}
|
|
1779
|
+
} catch (e13) {
|
|
1780
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.apiKeyValidation.skipped")));
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Test local provider connection (Ollama, llama.cpp, MLX)
|
|
1785
|
+
*/
|
|
1786
|
+
async testLocalProviderConnection() {
|
|
1787
|
+
if (!this.state.provider || !this.isLocalProvider(this.state.provider)) return true;
|
|
1788
|
+
this.state.currentStep = "connectionTest";
|
|
1789
|
+
const provider = this.state.provider;
|
|
1790
|
+
const baseUrl = _nullishCoalesce(this.state.providerBaseUrl, () => ( this.getDefaultBaseUrl(provider)));
|
|
1791
|
+
const endpoints = {
|
|
1792
|
+
ollama: `${baseUrl}/api/tags`,
|
|
1793
|
+
llamacpp: `${baseUrl}/health`,
|
|
1794
|
+
mlx: `${baseUrl}/v1/models`
|
|
1795
|
+
};
|
|
1796
|
+
const endpoint = endpoints[provider];
|
|
1797
|
+
if (!endpoint) return true;
|
|
1798
|
+
console.log(_chalk2.default.gray("\n " + _chunkCHI52KFRcjs.t.call(void 0, "setup.connectionTest.testing", { provider: this.getProviderDisplayName(provider) })));
|
|
1799
|
+
try {
|
|
1800
|
+
const response = await fetch(endpoint, { signal: AbortSignal.timeout(5e3) });
|
|
1801
|
+
if (response.ok) {
|
|
1802
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.connectionTest.success", { provider: this.getProviderDisplayName(provider) })));
|
|
1803
|
+
return true;
|
|
1804
|
+
}
|
|
1805
|
+
throw new Error(`HTTP ${response.status}`);
|
|
1806
|
+
} catch (error) {
|
|
1807
|
+
const errorMsg = error instanceof Error ? error.message : "Unknown error";
|
|
1808
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.connectionTest.failed", { provider: this.getProviderDisplayName(provider), error: errorMsg })));
|
|
1809
|
+
const hintKey = `setup.connectionTest.hint${provider.charAt(0).toUpperCase() + provider.slice(1)}`;
|
|
1810
|
+
const hint = _chunkCHI52KFRcjs.t.call(void 0, hintKey);
|
|
1811
|
+
if (hint !== hintKey) {
|
|
1812
|
+
console.log(_chalk2.default.gray(" " + hint));
|
|
1813
|
+
}
|
|
1814
|
+
const continueAnyway = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1815
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.connectionTest.continueAnyway"),
|
|
1816
|
+
defaultValue: true
|
|
1817
|
+
});
|
|
1818
|
+
return continueAnyway;
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
async prepareLlamaCpp() {
|
|
1822
|
+
const probe = await probeLlamaCppEnvironment(this.workspaceRoot);
|
|
1823
|
+
let detectedPort = probe.port;
|
|
1824
|
+
if (probe.baseUrl) {
|
|
1825
|
+
this.state.providerBaseUrl = probe.baseUrl;
|
|
1826
|
+
console.log(_chalk2.default.green(` Detected llama.cpp server at ${probe.baseUrl}`));
|
|
1827
|
+
} else if (probe.installed) {
|
|
1828
|
+
console.log(_chalk2.default.gray(" llama.cpp is installed but no running server was detected."));
|
|
1829
|
+
} else if (!probe.installPlan) {
|
|
1830
|
+
console.log(_chalk2.default.yellow(" llama.cpp is not installed and no supported package manager was detected."));
|
|
1831
|
+
} else {
|
|
1832
|
+
console.log(_chalk2.default.yellow(` llama.cpp is not installed. Autohand can install it with: ${probe.installPlan.label}`));
|
|
1833
|
+
const shouldInstall = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1834
|
+
title: "Install llama.cpp now?",
|
|
1835
|
+
defaultValue: true
|
|
1836
|
+
});
|
|
1837
|
+
if (shouldInstall) {
|
|
1838
|
+
console.log(_chalk2.default.gray(` Installing llama.cpp with ${probe.installPlan.label}...`));
|
|
1839
|
+
const install = await installLlamaCpp(probe.installPlan, this.workspaceRoot);
|
|
1840
|
+
if (!install.ok) {
|
|
1841
|
+
console.log(_chalk2.default.red(" llama.cpp installation failed."));
|
|
1842
|
+
if (install.output) {
|
|
1843
|
+
console.log(_chalk2.default.gray(` ${install.output}`));
|
|
1844
|
+
}
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
console.log(_chalk2.default.green(" llama.cpp installation completed."));
|
|
1848
|
+
const refreshed = await probeLlamaCppEnvironment(this.workspaceRoot);
|
|
1849
|
+
detectedPort = refreshed.port;
|
|
1850
|
+
if (refreshed.baseUrl) {
|
|
1851
|
+
this.state.providerBaseUrl = refreshed.baseUrl;
|
|
1852
|
+
console.log(_chalk2.default.green(` Detected llama.cpp server at ${refreshed.baseUrl}`));
|
|
1853
|
+
} else {
|
|
1854
|
+
console.log(_chalk2.default.gray(" Start llama-server with your model, then Autohand will connect on the detected port."));
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
const port = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1859
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.llamacpp.serverPort"),
|
|
1860
|
+
defaultValue: String(_nullishCoalesce(detectedPort, () => ( 80)))
|
|
1861
|
+
});
|
|
1862
|
+
if (!port) {
|
|
1863
|
+
return false;
|
|
1864
|
+
}
|
|
1865
|
+
this.state.providerBaseUrl = `http://localhost:${port}`;
|
|
1866
|
+
return true;
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* Prompt for permission mode selection
|
|
1870
|
+
*/
|
|
1871
|
+
async promptPermissions() {
|
|
1872
|
+
this.state.currentStep = "permissions";
|
|
1873
|
+
console.log();
|
|
1874
|
+
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"));
|
|
1875
|
+
console.log(_chalk2.default.white.bold(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.title")));
|
|
1876
|
+
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"));
|
|
1877
|
+
console.log();
|
|
1878
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.description")));
|
|
1879
|
+
console.log();
|
|
1880
|
+
const options = [
|
|
1881
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.interactive"), value: "interactive" },
|
|
1882
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.unrestricted"), value: "unrestricted" },
|
|
1883
|
+
{ label: _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.restricted"), value: "restricted" }
|
|
1884
|
+
];
|
|
1885
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1886
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.title"),
|
|
1887
|
+
options
|
|
1888
|
+
});
|
|
1889
|
+
const mode = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _24 => _24.value]), () => ( "interactive"));
|
|
1890
|
+
this.state.permissionMode = mode;
|
|
1891
|
+
if (mode === "unrestricted") {
|
|
1892
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.warning")));
|
|
1893
|
+
}
|
|
1894
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.set", { mode })));
|
|
1895
|
+
const rememberSession = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1896
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.permissions.rememberPrompt"),
|
|
1897
|
+
defaultValue: true
|
|
1898
|
+
});
|
|
1899
|
+
this.state.rememberSession = rememberSession;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Check workspace safety
|
|
1903
|
+
*/
|
|
1904
|
+
async checkWorkspaceStep() {
|
|
1905
|
+
this.state.currentStep = "workspaceSafety";
|
|
1906
|
+
console.log(_chalk2.default.gray("\n " + _chunkCHI52KFRcjs.t.call(void 0, "setup.workspaceSafety.checking")));
|
|
1907
|
+
const result = _chunkWGNMOVMTcjs.checkWorkspaceSafety.call(void 0, this.workspaceRoot);
|
|
1908
|
+
if (result.safe) {
|
|
1909
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.workspaceSafety.safe")));
|
|
1910
|
+
return true;
|
|
1911
|
+
}
|
|
1912
|
+
_chunkWGNMOVMTcjs.printDangerousWorkspaceWarning.call(void 0, this.workspaceRoot, result);
|
|
1913
|
+
console.log(_chalk2.default.yellow(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.workspaceSafety.unsafe", { reason: result.reason || "" })));
|
|
1914
|
+
const continueUnsafe = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1915
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.workspaceSafety.continueUnsafe"),
|
|
1916
|
+
defaultValue: false
|
|
1917
|
+
});
|
|
1918
|
+
return continueUnsafe;
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Prompt for notification preferences
|
|
1922
|
+
*/
|
|
1923
|
+
async promptNotifications() {
|
|
1924
|
+
this.state.currentStep = "notifications";
|
|
1925
|
+
console.log();
|
|
1926
|
+
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"));
|
|
1927
|
+
console.log(_chalk2.default.white.bold(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.notifications.title")));
|
|
1928
|
+
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"));
|
|
1929
|
+
console.log();
|
|
1930
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.notifications.description")));
|
|
1931
|
+
console.log();
|
|
1932
|
+
const enabled = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1933
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.notifications.enablePrompt"),
|
|
1934
|
+
defaultValue: true
|
|
1935
|
+
});
|
|
1936
|
+
let sound = true;
|
|
1937
|
+
if (enabled) {
|
|
1938
|
+
sound = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1939
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.notifications.soundPrompt"),
|
|
1940
|
+
defaultValue: true
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
this.state.notifications = { enabled, sound };
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Prompt for network settings
|
|
1947
|
+
*/
|
|
1948
|
+
async promptNetwork() {
|
|
1949
|
+
this.state.currentStep = "network";
|
|
1950
|
+
const needCustom = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
1951
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.network.needCustom"),
|
|
1952
|
+
defaultValue: false
|
|
1953
|
+
});
|
|
1954
|
+
if (!needCustom) {
|
|
1955
|
+
this.state.skipped.push("network");
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
const maxRetriesStr = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1959
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.network.maxRetries"),
|
|
1960
|
+
defaultValue: "3",
|
|
1961
|
+
validate: (val) => {
|
|
1962
|
+
const n = parseInt(val, 10);
|
|
1963
|
+
if (isNaN(n) || n < 1 || n > 5) return "Enter a number between 1 and 5";
|
|
1964
|
+
return true;
|
|
1965
|
+
}
|
|
1966
|
+
});
|
|
1967
|
+
const timeoutStr = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
1968
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.network.timeout"),
|
|
1969
|
+
defaultValue: "30000",
|
|
1970
|
+
validate: (val) => {
|
|
1971
|
+
const n = parseInt(val, 10);
|
|
1972
|
+
if (isNaN(n) || n < 5e3 || n > 12e4) return "Enter a number between 5000 and 120000";
|
|
1973
|
+
return true;
|
|
1974
|
+
}
|
|
1975
|
+
});
|
|
1976
|
+
this.state.network = {
|
|
1977
|
+
maxRetries: parseInt(maxRetriesStr || "3", 10),
|
|
1978
|
+
timeout: parseInt(timeoutStr || "30000", 10)
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* Prompt for web search provider
|
|
1983
|
+
*/
|
|
1984
|
+
async promptSearch() {
|
|
1985
|
+
this.state.currentStep = "search";
|
|
1986
|
+
const options = [
|
|
1987
|
+
{ label: "Google", value: "google", description: "Default web search" },
|
|
1988
|
+
{ label: "Brave Search", value: "brave", description: "Privacy-focused search (requires API key)" },
|
|
1989
|
+
{ label: "DuckDuckGo", value: "duckduckgo", description: "Privacy-focused, no API key needed" },
|
|
1990
|
+
{ label: "Parallel.ai", value: "parallel", description: "AI-optimized search (requires API key)" }
|
|
1991
|
+
];
|
|
1992
|
+
const result = await _chunkCH2J4PVEcjs.showModal.call(void 0, {
|
|
1993
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.search.prompt"),
|
|
1994
|
+
options
|
|
1995
|
+
});
|
|
1996
|
+
const provider = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _25 => _25.value]), () => ( "google"));
|
|
1997
|
+
const searchState = { provider };
|
|
1998
|
+
if (provider === "brave") {
|
|
1999
|
+
const key = await _chunkCH2J4PVEcjs.showPassword.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "setup.search.braveKeyPrompt"), placeholder: _chunkCHI52KFRcjs.t.call(void 0, "ui.apiKeyPlaceholder") });
|
|
2000
|
+
if (key) searchState.braveApiKey = key;
|
|
2001
|
+
} else if (provider === "parallel") {
|
|
2002
|
+
const key = await _chunkCH2J4PVEcjs.showPassword.call(void 0, { title: _chunkCHI52KFRcjs.t.call(void 0, "setup.search.parallelKeyPrompt"), placeholder: _chunkCHI52KFRcjs.t.call(void 0, "ui.apiKeyPlaceholder") });
|
|
2003
|
+
if (key) searchState.parallelApiKey = key;
|
|
2004
|
+
}
|
|
2005
|
+
this.state.search = searchState;
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Prompt for MCP support
|
|
2009
|
+
*/
|
|
2010
|
+
async promptMcp() {
|
|
2011
|
+
this.state.currentStep = "mcp";
|
|
2012
|
+
console.log();
|
|
2013
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.mcp.description")));
|
|
2014
|
+
console.log();
|
|
2015
|
+
const enabled = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
2016
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.mcp.enablePrompt"),
|
|
2017
|
+
defaultValue: true
|
|
2018
|
+
});
|
|
2019
|
+
this.state.mcpEnabled = enabled;
|
|
2020
|
+
if (enabled) {
|
|
2021
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.mcp.enabled")));
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* Prompt for agent behavior settings
|
|
2026
|
+
*/
|
|
2027
|
+
async promptAgentBehavior() {
|
|
2028
|
+
this.state.currentStep = "agentBehavior";
|
|
2029
|
+
const maxIterStr = await _chunkCH2J4PVEcjs.showInput.call(void 0, {
|
|
2030
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.agent.maxIterationsPrompt"),
|
|
2031
|
+
defaultValue: "100",
|
|
2032
|
+
validate: (val) => {
|
|
2033
|
+
const n = parseInt(val, 10);
|
|
2034
|
+
if (isNaN(n) || n < 10 || n > 500) return "Enter a number between 10 and 500";
|
|
2035
|
+
return true;
|
|
2036
|
+
}
|
|
2037
|
+
});
|
|
2038
|
+
const debug = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
2039
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.agent.debugPrompt"),
|
|
2040
|
+
defaultValue: false
|
|
2041
|
+
});
|
|
2042
|
+
this.state.agentSettings = {
|
|
2043
|
+
maxIterations: parseInt(maxIterStr || "100", 10),
|
|
2044
|
+
debug
|
|
2045
|
+
};
|
|
2046
|
+
console.log(_chalk2.default.green(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.agent.set")));
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* Prompt for community skills
|
|
2050
|
+
*/
|
|
2051
|
+
async promptCommunitySkills() {
|
|
2052
|
+
this.state.currentStep = "communitySkills";
|
|
2053
|
+
console.log();
|
|
2054
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.communitySkills.description")));
|
|
2055
|
+
console.log();
|
|
2056
|
+
const enabled = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
2057
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.communitySkills.enablePrompt"),
|
|
2058
|
+
defaultValue: true
|
|
2059
|
+
});
|
|
2060
|
+
this.state.communitySkillsEnabled = enabled;
|
|
2061
|
+
}
|
|
2062
|
+
/**
|
|
2063
|
+
* Show review summary and confirm settings
|
|
2064
|
+
*/
|
|
2065
|
+
async promptReviewConfirm() {
|
|
2066
|
+
this.state.currentStep = "reviewSummary";
|
|
2067
|
+
console.log();
|
|
2068
|
+
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"));
|
|
2069
|
+
console.log(_chalk2.default.white.bold(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.review.title")));
|
|
2070
|
+
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"));
|
|
2071
|
+
console.log();
|
|
2072
|
+
if (this.state.locale) {
|
|
2073
|
+
console.log(_chalk2.default.white(` Language: ${_chunkCHI52KFRcjs.LANGUAGE_DISPLAY_NAMES[this.state.locale]}`));
|
|
2074
|
+
}
|
|
2075
|
+
if (this.state.provider) {
|
|
2076
|
+
console.log(_chalk2.default.white(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.review.provider", { provider: this.getProviderDisplayName(this.state.provider) })));
|
|
2077
|
+
}
|
|
2078
|
+
if (this.state.model) {
|
|
2079
|
+
console.log(_chalk2.default.white(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.review.model", { model: this.state.model })));
|
|
2080
|
+
}
|
|
2081
|
+
if (this.state.reasoningEffort) {
|
|
2082
|
+
console.log(_chalk2.default.white(" " + _chunkCHI52KFRcjs.t.call(void 0, "providers.config.reasoningEffortLabel", { level: this.state.reasoningEffort })));
|
|
2083
|
+
}
|
|
2084
|
+
if (this.state.permissionMode) {
|
|
2085
|
+
console.log(_chalk2.default.white(` Permissions: ${this.state.permissionMode}`));
|
|
2086
|
+
}
|
|
2087
|
+
console.log(_chalk2.default.white(` Telemetry: ${this.state.telemetryEnabled ? "enabled" : "disabled"}`));
|
|
2088
|
+
console.log(_chalk2.default.white(` Auto-report: ${this.state.autoReportEnabled ? "enabled" : "disabled"}`));
|
|
2089
|
+
if (this.state.notifications) {
|
|
2090
|
+
console.log(_chalk2.default.white(` Notifications: ${this.state.notifications.enabled ? "enabled" : "disabled"}`));
|
|
2091
|
+
}
|
|
2092
|
+
if (_optionalChain([this, 'access', _26 => _26.state, 'access', _27 => _27.search, 'optionalAccess', _28 => _28.provider])) {
|
|
2093
|
+
console.log(_chalk2.default.white(` Search: ${this.state.search.provider}`));
|
|
2094
|
+
}
|
|
2095
|
+
if (this.state.mcpEnabled !== void 0) {
|
|
2096
|
+
console.log(_chalk2.default.white(` MCP: ${this.state.mcpEnabled ? "enabled" : "disabled"}`));
|
|
2097
|
+
}
|
|
2098
|
+
if (this.state.authUser) {
|
|
2099
|
+
console.log(_chalk2.default.white(` Account: ${this.state.authUser.email}`));
|
|
2100
|
+
}
|
|
2101
|
+
console.log();
|
|
2102
|
+
const confirmed = await _chunkCH2J4PVEcjs.showConfirm.call(void 0, {
|
|
2103
|
+
title: _chunkCHI52KFRcjs.t.call(void 0, "setup.review.confirm"),
|
|
2104
|
+
defaultValue: true
|
|
2105
|
+
});
|
|
2106
|
+
if (!confirmed) {
|
|
2107
|
+
console.log(_chalk2.default.gray(" " + _chunkCHI52KFRcjs.t.call(void 0, "setup.review.goBack")));
|
|
2108
|
+
}
|
|
2109
|
+
return confirmed;
|
|
2110
|
+
}
|
|
2111
|
+
/**
|
|
2112
|
+
* Check if a provider is local (no API key, has server to test)
|
|
2113
|
+
*/
|
|
2114
|
+
isLocalProvider(provider) {
|
|
2115
|
+
return provider === "ollama" || provider === "llamacpp" || provider === "mlx";
|
|
2116
|
+
}
|
|
2117
|
+
// Helper methods
|
|
2118
|
+
requiresApiKey(provider) {
|
|
2119
|
+
return provider === "openrouter" || provider === "llmgateway" || provider === "zai" || provider === "vertexai" || provider === "xai" || provider === "cerebras" || provider === "nvidia" || provider === "deepseek";
|
|
2120
|
+
}
|
|
2121
|
+
getProviderDisplayName(provider) {
|
|
2122
|
+
return _chunkCHI52KFRcjs.t.call(void 0, `providers.${provider}`);
|
|
2123
|
+
}
|
|
2124
|
+
getProviderHint(provider) {
|
|
2125
|
+
return _chunkCHI52KFRcjs.t.call(void 0, `providers.hints.${provider}`);
|
|
2126
|
+
}
|
|
2127
|
+
getApiKeyUrl(provider) {
|
|
2128
|
+
const urls = {
|
|
2129
|
+
openrouter: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.openrouter.apiKeyUrl"),
|
|
2130
|
+
openai: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.openai.apiKeyUrl"),
|
|
2131
|
+
llmgateway: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.llmgateway.apiKeyUrl"),
|
|
2132
|
+
zai: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.zai.apiKeyUrl"),
|
|
2133
|
+
nvidia: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.nvidia.apiKeyUrl"),
|
|
2134
|
+
deepseek: _chunkCHI52KFRcjs.t.call(void 0, "providers.wizard.deepseek.apiKeyUrl")
|
|
2135
|
+
};
|
|
2136
|
+
return urls[provider] || "";
|
|
2137
|
+
}
|
|
2138
|
+
getDefaultModel(provider) {
|
|
2139
|
+
const defaults = {
|
|
2140
|
+
openrouter: "nvidia/nemotron-3-super-120b-a12b:free",
|
|
2141
|
+
openai: "gpt-5.4",
|
|
2142
|
+
ollama: "llama3.2:latest",
|
|
2143
|
+
llamacpp: "local",
|
|
2144
|
+
mlx: "mlx-community/Llama-3.2-3B-Instruct-4bit",
|
|
2145
|
+
llmgateway: "gpt-4o",
|
|
2146
|
+
azure: "gpt-5.3-codex",
|
|
2147
|
+
zai: "glm-4.5",
|
|
2148
|
+
vertexai: "zai-org/glm-5-maas",
|
|
2149
|
+
xai: "grok-4.20-reasoning",
|
|
2150
|
+
cerebras: "zai-glm-4.7",
|
|
2151
|
+
nvidia: "mistralai/mixtral-8x7b-instruct-v0.1",
|
|
2152
|
+
deepseek: "deepseek-v4-flash"
|
|
2153
|
+
};
|
|
2154
|
+
return defaults[provider] || "";
|
|
2155
|
+
}
|
|
2156
|
+
getDefaultBaseUrl(provider) {
|
|
2157
|
+
const urls = {
|
|
2158
|
+
openrouter: "https://openrouter.ai/api/v1",
|
|
2159
|
+
openai: "https://api.openai.com/v1",
|
|
2160
|
+
ollama: "http://localhost:11434",
|
|
2161
|
+
llamacpp: "http://localhost:8080",
|
|
2162
|
+
mlx: "http://localhost:8080",
|
|
2163
|
+
llmgateway: "https://api.llmgateway.io/v1",
|
|
2164
|
+
azure: "https://{resourceName}.openai.azure.com",
|
|
2165
|
+
zai: _chunkWRTXCQ3Vcjs.ZAI_DEFAULT_BASE_URL,
|
|
2166
|
+
vertexai: "https://aiplatform.googleapis.com",
|
|
2167
|
+
xai: "https://api.x.ai/v1",
|
|
2168
|
+
cerebras: _chunkWRTXCQ3Vcjs.CEREBRAS_DEFAULT_BASE_URL,
|
|
2169
|
+
nvidia: "https://integrate.api.nvidia.com/v1",
|
|
2170
|
+
deepseek: _chunkWRTXCQ3Vcjs.DEEPSEEK_DEFAULT_BASE_URL
|
|
2171
|
+
};
|
|
2172
|
+
return urls[provider] || "";
|
|
2173
|
+
}
|
|
2174
|
+
getExistingApiKey(provider) {
|
|
2175
|
+
if (!this.existingConfig) return null;
|
|
2176
|
+
const config = this.existingConfig[provider];
|
|
2177
|
+
return _optionalChain([config, 'optionalAccess', _29 => _29.apiKey]) || null;
|
|
2178
|
+
}
|
|
2179
|
+
getExistingOpenAIAuthMode() {
|
|
2180
|
+
const config = _optionalChain([this, 'access', _30 => _30.existingConfig, 'optionalAccess', _31 => _31.openai]);
|
|
2181
|
+
return _optionalChain([config, 'optionalAccess', _32 => _32.authMode]) === "chatgpt" ? "chatgpt" : "api-key";
|
|
2182
|
+
}
|
|
2183
|
+
getExistingOpenAIChatGPTAuth() {
|
|
2184
|
+
const auth = _optionalChain([this, 'access', _33 => _33.existingConfig, 'optionalAccess', _34 => _34.openai, 'optionalAccess', _35 => _35.chatgptAuth]);
|
|
2185
|
+
return auth && auth.accessToken && auth.accountId ? auth : null;
|
|
2186
|
+
}
|
|
2187
|
+
isOpenAIConfigured(config) {
|
|
2188
|
+
if (config.authMode === "chatgpt") {
|
|
2189
|
+
return !!_optionalChain([config, 'access', _36 => _36.chatgptAuth, 'optionalAccess', _37 => _37.accessToken]) && !!_optionalChain([config, 'access', _38 => _38.chatgptAuth, 'optionalAccess', _39 => _39.accountId]);
|
|
2190
|
+
}
|
|
2191
|
+
return !!config.apiKey && config.apiKey !== "replace-me" && config.apiKey.length >= 10;
|
|
2192
|
+
}
|
|
2193
|
+
isCancellation(error) {
|
|
2194
|
+
if (error && typeof error === "object") {
|
|
2195
|
+
const e = error;
|
|
2196
|
+
return e.code === "ERR_USE_AFTER_CLOSE" || _optionalChain([e, 'access', _40 => _40.message, 'optionalAccess', _41 => _41.includes, 'call', _42 => _42("cancelled")]) || _optionalChain([e, 'access', _43 => _43.message, 'optionalAccess', _44 => _44.includes, 'call', _45 => _45("canceled")]);
|
|
2197
|
+
}
|
|
2198
|
+
return false;
|
|
2199
|
+
}
|
|
2200
|
+
async pressEnter() {
|
|
2201
|
+
console.log(_chalk2.default.gray(" Press Enter to continue..."));
|
|
2202
|
+
await new Promise((resolve) => {
|
|
2203
|
+
process.stdin.once("data", () => resolve());
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
};
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
exports.ProjectAnalyzer = ProjectAnalyzer; exports.AgentsGenerator = AgentsGenerator; exports.probeLlamaCppEnvironment = probeLlamaCppEnvironment; exports.installLlamaCpp = installLlamaCpp; exports.SetupWizard = SetupWizard;
|
|
2215
|
+
/**
|
|
2216
|
+
* @license
|
|
2217
|
+
* Copyright 2025 Autohand AI LLC
|
|
2218
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
2219
|
+
*/
|