autohand-cli 0.7.8 → 0.7.10
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 +19 -0
- package/dist/{AutomodeManager-YVCJXOMQ.js → AutomodeManager-NGRAO2MH.js} +35 -8
- package/dist/{AutomodeManager-HV6M7EAX.cjs → AutomodeManager-ZKQMBM4T.cjs} +35 -8
- package/dist/{CommunitySkillsCache-Q22FUAR5.js → CommunitySkillsCache-ILWHWE5P.js} +2 -2
- package/dist/CommunitySkillsCache-KHC6RUJW.cjs +7 -0
- package/dist/MemoryManager-6ZT7IDO5.cjs +7 -0
- package/dist/MemoryManager-AJGS5AKB.js +7 -0
- package/dist/PermissionManager-HG6W2DGU.cjs +10 -0
- package/dist/{PermissionManager-HATZKTRC.js → PermissionManager-U5OMGR3L.js} +3 -3
- package/dist/SessionManager-BJ2G6VV4.cjs +9 -0
- package/dist/{SessionManager-S5R6O3NU.js → SessionManager-ENPGYK5J.js} +2 -2
- package/dist/SkillsRegistry-6ZFOCT25.cjs +8 -0
- package/dist/{SkillsRegistry-R5WDM6T3.js → SkillsRegistry-C2SHOZ5D.js} +2 -2
- package/dist/{SyncApiClient-FAOMIZAP.js → SyncApiClient-AYXYSOJM.js} +1 -1
- package/dist/SyncApiClient-ID3KXEMA.cjs +10 -0
- package/dist/about-RGUM5QQ4.cjs +11 -0
- package/dist/about-VDR3SIHS.js +11 -0
- package/dist/add-dir-3BMVJ5H3.cjs +9 -0
- package/dist/{add-dir-PNU7AGKO.js → add-dir-RP2BL3JW.js} +2 -1
- package/dist/agents-JQ2PHCQB.js +10 -0
- package/dist/agents-RGSZ2BM3.cjs +10 -0
- package/dist/agents-new-LSJN2L2T.cjs +13 -0
- package/dist/agents-new-MZUEVKSK.js +13 -0
- package/dist/automode-DP3BMYJB.cjs +9 -0
- package/dist/{automode-QCRJSBRT.js → automode-XOF3U3OB.js} +2 -1
- package/dist/cc-2W6M7J45.cjs +8 -0
- package/dist/cc-UTTLESTY.js +8 -0
- package/dist/{chunk-B4ZPNXZE.cjs → chunk-34OGUMRO.cjs} +9 -5
- package/dist/chunk-3652ROFD.js +589 -0
- package/dist/{chunk-KNLBEUAV.cjs → chunk-3DQSBW4B.cjs} +10 -6
- package/dist/{chunk-XFPITUFJ.cjs → chunk-3S4DEIJP.cjs} +50 -8
- package/dist/{chunk-5MDDOGTD.cjs → chunk-3UNX56GC.cjs} +30 -37
- package/dist/chunk-46WX5IO2.cjs +499 -0
- package/dist/{chunk-OC5YDNFC.js → chunk-4ULBAYME.js} +42 -57
- package/dist/{chunk-VEDIYPWY.cjs → chunk-5BQ57AZC.cjs} +9 -9
- package/dist/{chunk-B5N5UAMO.cjs → chunk-5FZM7KLB.cjs} +13 -10
- package/dist/{chunk-JBKP2CLA.cjs → chunk-5NZA4UB4.cjs} +47 -47
- package/dist/{chunk-VPAN5H7Q.js → chunk-5Q3W4DEU.js} +43 -36
- package/dist/{chunk-VMMGT42E.cjs → chunk-65GTO4QM.cjs} +7 -3
- package/dist/{chunk-CXZEPTRI.js → chunk-6P3K4YUW.js} +6 -2
- package/dist/{chunk-MDWULS57.js → chunk-6UJMCWRY.js} +56 -33
- package/dist/chunk-73XIKTZL.js +124 -0
- package/dist/{chunk-23JQSCTO.js → chunk-7QNW24ZT.js} +8 -4
- package/dist/{chunk-XT4OSHSB.cjs → chunk-AEYOIPHD.cjs} +6 -2
- package/dist/chunk-ANUQFV43.cjs +589 -0
- package/dist/chunk-ATR3RORT.js +499 -0
- package/dist/{chunk-A6QBABQ7.js → chunk-B72CC4O6.js} +2 -2
- package/dist/{chunk-TAZJSKFD.js → chunk-BBIKQW66.js} +9 -5
- package/dist/{chunk-FFA4LDAO.cjs → chunk-BDIZGBDA.cjs} +8 -3
- package/dist/{chunk-3YEDXG6S.js → chunk-BG4OQUKP.js} +1 -1
- package/dist/{chunk-WIUGUR5T.js → chunk-BODVOW7B.js} +67 -16
- package/dist/{chunk-A552JHUJ.cjs → chunk-BZ73ZQTE.cjs} +34 -25
- package/dist/{chunk-YDOR2OCA.cjs → chunk-C22G4UE4.cjs} +27 -19
- package/dist/{chunk-GFJ6AETU.cjs → chunk-C2E3GJEE.cjs} +12 -9
- package/dist/{chunk-UL7YPRCU.js → chunk-C5SVIQG3.js} +10 -5
- package/dist/{chunk-6KMAJTU3.js → chunk-CUBYCLNL.js} +3 -2
- package/dist/{chunk-52MLYK5P.js → chunk-D2XFTCRP.js} +1 -1
- package/dist/{chunk-OBV3UUIL.js → chunk-DEAEO7RI.js} +1 -1
- package/dist/chunk-DMPVI3YK.cjs +400 -0
- package/dist/{chunk-C26EN22G.cjs → chunk-DUDDZRCS.cjs} +9 -5
- package/dist/{chunk-4RWTUT2Z.js → chunk-E7YL3AHT.js} +32 -23
- package/dist/{chunk-54GVL2SE.cjs → chunk-EAOEAQGF.cjs} +3 -2
- package/dist/{chunk-PU534KPO.cjs → chunk-EV53SLSB.cjs} +4 -4
- package/dist/{chunk-EDGV5BNH.js → chunk-F3EIOVSQ.js} +26 -33
- package/dist/{chunk-SFGJQPGC.cjs → chunk-FPHU2ES6.cjs} +56 -33
- package/dist/{chunk-G77ZY4QG.js → chunk-GD4AFYJ3.js} +1 -1
- package/dist/{chunk-PMMSDR44.cjs → chunk-GIZL57FE.cjs} +5 -1
- package/dist/{chunk-I4HVBWYF.js → chunk-GLAE5K5W.js} +7 -2
- package/dist/{chunk-4AMTDSQ3.cjs → chunk-HDSEJMWI.cjs} +6 -3
- package/dist/chunk-HLFZPN65.js +94 -0
- package/dist/{chunk-ZWS3KSMK.js → chunk-HQQ4NKER.js} +5 -2
- package/dist/{chunk-WBDPILKI.cjs → chunk-HVOBMOZ2.cjs} +6 -2
- package/dist/{chunk-MJFBVQHB.js → chunk-IPI3JXKP.js} +10 -7
- package/dist/chunk-IXFOH4OC.cjs +222 -0
- package/dist/chunk-JS7IPR7P.js +249 -0
- package/dist/{chunk-7TOHYAUF.cjs → chunk-KC5FPUOF.cjs} +2 -2
- package/dist/{chunk-7VW3A7DO.cjs → chunk-L42HTMMR.cjs} +2 -2
- package/dist/chunk-LGGZQTLM.cjs +209 -0
- package/dist/chunk-LOXOD4IS.cjs +8630 -0
- package/dist/chunk-MNCWB5F7.cjs +63 -0
- package/dist/{chunk-AVL4DKQO.js → chunk-MYNHJHDZ.js} +1 -1
- package/dist/{chunk-GDTZQSJ6.cjs → chunk-N4ZSG6JJ.cjs} +2 -2
- package/dist/chunk-NCC6ETZS.js +362 -0
- package/dist/chunk-NF7RIHJK.js +45 -0
- package/dist/{chunk-SYJLMBLP.cjs → chunk-NGBN2NGH.cjs} +77 -26
- package/dist/{chunk-SLISYSP4.cjs → chunk-NRORJRD4.cjs} +4 -4
- package/dist/{chunk-OTS4YFSZ.cjs → chunk-OKABWSWA.cjs} +7 -3
- package/dist/{chunk-KH7BCZJN.js → chunk-OLG7LZBD.js} +1 -1
- package/dist/{chunk-KZ7VMQTC.js → chunk-OMEH2EVE.js} +5 -1
- package/dist/{chunk-U5WIP4HS.js → chunk-P5VDZ6PV.js} +47 -5
- package/dist/{chunk-V5MTBGM4.cjs → chunk-PA2H2263.cjs} +6 -2
- package/dist/chunk-PGRH5Q77.cjs +249 -0
- package/dist/{chunk-DPJ3IIBB.js → chunk-PM62ZYXA.js} +18 -10
- package/dist/chunk-PNSRJT46.js +380 -0
- package/dist/{chunk-C3IFF3EH.cjs → chunk-PSED4Z4X.cjs} +43 -58
- package/dist/{chunk-EKY5PKQI.js → chunk-PWLLLJHU.js} +5 -1
- package/dist/{chunk-DOTAX65F.js → chunk-PYLR4J2D.js} +8 -4
- package/dist/{chunk-YWKZF2SA.js → chunk-QC6IUDDJ.js} +46 -46
- package/dist/{chunk-4M2GX7RH.cjs → chunk-QM7HZCQW.cjs} +11 -6
- package/dist/chunk-QRQ5EX7I.cjs +380 -0
- package/dist/{chunk-YDH2BMEN.js → chunk-QU64XI5X.js} +9 -6
- package/dist/{chunk-3L76MLO5.cjs → chunk-R7SDL3DJ.cjs} +27 -31
- package/dist/{chunk-WQSWU2QA.cjs → chunk-RJP3SZ7Q.cjs} +46 -255
- package/dist/{chunk-BAFJQUWR.js → chunk-RJXNNIFW.js} +18 -22
- package/dist/{chunk-YAGD43KA.cjs → chunk-S5G7OEN2.cjs} +47 -40
- package/dist/{chunk-2JPUEN44.cjs → chunk-SA4JOV4F.cjs} +61 -86
- package/dist/chunk-SAG6IY5Z.cjs +94 -0
- package/dist/chunk-TSV4LVHK.js +35 -0
- package/dist/{chunk-JHFH3N4U.cjs → chunk-TSY7JHIV.cjs} +2 -2
- package/dist/chunk-U23U52ZN.cjs +124 -0
- package/dist/chunk-UET7BDX2.js +8630 -0
- package/dist/chunk-ULQ6MDSJ.cjs +362 -0
- package/dist/{chunk-WH3D42BQ.js → chunk-UM4QEO36.js} +59 -84
- package/dist/chunk-VXCMGBXY.cjs +35 -0
- package/dist/chunk-WD5ZF6HE.js +63 -0
- package/dist/chunk-WH5RW7DV.cjs +85 -0
- package/dist/{chunk-GSOEIEOU.js → chunk-WJ276BIP.js} +5 -1
- package/dist/{chunk-P2Z6GDEN.js → chunk-WLTVF77A.js} +1 -1
- package/dist/{chunk-53BR4MUW.cjs → chunk-WOGJXDBU.cjs} +3 -3
- package/dist/{chunk-QJ53OSGF.js → chunk-WRJLBHWB.js} +6 -2
- package/dist/chunk-WYLFLZ42.js +222 -0
- package/dist/{chunk-B7EUETGY.cjs → chunk-XL77XYI2.cjs} +4 -4
- package/dist/{chunk-NI3BQXKU.js → chunk-XLI7SHCH.js} +2 -2
- package/dist/chunk-Y27LG4BQ.cjs +45 -0
- package/dist/chunk-Y6OWFIUF.js +209 -0
- package/dist/chunk-YKSSNFDZ.js +400 -0
- package/dist/{chunk-VRI7EXV6.js → chunk-YMDLUTF2.js} +5 -1
- package/dist/chunk-YVY27BJT.js +85 -0
- package/dist/{chunk-GWIAMKKF.js → chunk-ZBIBLOZL.js} +40 -249
- package/dist/completion-HVSWU5GR.cjs +13 -0
- package/dist/completion-WJ2MVNDH.js +13 -0
- package/dist/constants-RBQTR32A.cjs +20 -0
- package/dist/{constants-ZLG6M5SI.js → constants-V6J54N3X.js} +1 -1
- package/dist/export-NN7F5ANA.js +11 -0
- package/dist/export-UPS3AK2P.cjs +11 -0
- package/dist/feedback-ARI7CLVQ.js +14 -0
- package/dist/feedback-OZTPYHKJ.cjs +14 -0
- package/dist/help-4674IV4D.cjs +58 -0
- package/dist/help-ENG5KV2M.js +58 -0
- package/dist/history-2KUM6GN4.cjs +13 -0
- package/dist/history-RZFT34Q7.js +13 -0
- package/dist/hooks-7QSUBHBM.cjs +12 -0
- package/dist/hooks-S4MD4QSR.js +12 -0
- package/dist/i18n-6NKENUIV.js +32 -0
- package/dist/i18n-MXQXQOVE.cjs +32 -0
- package/dist/ide-5STDV43A.cjs +11 -0
- package/dist/ide-W2NYXOWQ.js +11 -0
- package/dist/index.cjs +18002 -13864
- package/dist/index.js +18252 -14114
- package/dist/init-FG5KEJCZ.cjs +9 -0
- package/dist/init-TV4MJDYK.js +9 -0
- package/dist/language-52Q7CSAY.cjs +16 -0
- package/dist/language-FXFDGOBF.js +16 -0
- package/dist/localProjectPermissions-2EATUDZM.cjs +17 -0
- package/dist/{localProjectPermissions-YFFAKLUZ.js → localProjectPermissions-WQYMGI42.js} +2 -2
- package/dist/login-AN42IOBK.js +18 -0
- package/dist/login-I65V4TGU.cjs +18 -0
- package/dist/logout-KK5UWGNG.js +16 -0
- package/dist/logout-VYYNWBHZ.cjs +16 -0
- package/dist/mcp-4SKTDECJ.js +15 -0
- package/dist/mcp-AGWPTMAX.cjs +15 -0
- package/dist/mcp-install-3NN2HAYR.cjs +473 -0
- package/dist/mcp-install-KTV52DQK.js +473 -0
- package/dist/memory-LG4K6XV6.cjs +9 -0
- package/dist/{memory-4GSP7NKV.js → memory-LRDK2SYC.js} +2 -1
- package/dist/model-P5D7ATE7.cjs +9 -0
- package/dist/{model-HKEFSH5E.js → model-WBFJIGUN.js} +2 -1
- package/dist/{new-EEZC4XXV.js → new-5A7RQEKI.js} +2 -1
- package/dist/new-EAATWI2G.cjs +9 -0
- package/dist/permissions-5URK6C44.js +12 -0
- package/dist/permissions-CJUDVG63.cjs +12 -0
- package/dist/plan-B3CW5DXJ.cjs +10 -0
- package/dist/plan-JFGNRL2S.js +10 -0
- package/dist/quit-A33JHDG7.cjs +9 -0
- package/dist/quit-IYBLN3DB.js +9 -0
- package/dist/resume-OPSJTCH7.cjs +12 -0
- package/dist/resume-TOWEEN5D.js +12 -0
- package/dist/search-GOLIE5BA.js +14 -0
- package/dist/search-H42HGUK5.cjs +14 -0
- package/dist/{sessions-4KXIT76T.js → sessions-B5NENDKY.js} +2 -1
- package/dist/sessions-YHAVEMWY.cjs +9 -0
- package/dist/share-2JD2AKKX.cjs +13 -0
- package/dist/share-MYGDOTQE.js +13 -0
- package/dist/{skills-3YEEODHK.js → skills-ICEQ2TNC.js} +2 -1
- package/dist/skills-LFVNZOMF.cjs +13 -0
- package/dist/{skills-install-KAXAQSN6.js → skills-install-6RN7FVCP.js} +9 -7
- package/dist/{skills-install-FTGOHOZ4.cjs → skills-install-LU6GA2WF.cjs} +14 -12
- package/dist/skills-new-5BM5PDFX.cjs +14 -0
- package/dist/skills-new-KWBWOX74.js +14 -0
- package/dist/status-M3XHJELG.cjs +10 -0
- package/dist/status-ZQDUYMKQ.js +10 -0
- package/dist/sync-6M3WRKMH.cjs +39 -0
- package/dist/sync-73D2MP65.cjs +16 -0
- package/dist/{sync-H4UHHLKU.js → sync-EXYX7HXW.js} +3 -3
- package/dist/sync-LL6M67CN.js +16 -0
- package/dist/theme-IFEI2IBJ.cjs +16 -0
- package/dist/theme-U3SKEULY.js +16 -0
- package/dist/ui/questionModal.cjs +28 -0
- package/dist/ui/questionModal.d.cts +11 -0
- package/dist/ui/questionModal.d.ts +11 -0
- package/dist/ui/questionModal.js +28 -0
- package/dist/undo-4DS67OAW.cjs +9 -0
- package/dist/undo-YMALVAPN.js +9 -0
- package/package.json +3 -2
- package/dist/CommunitySkillsCache-2BITCEAA.cjs +0 -7
- package/dist/MemoryManager-2ATHG7BH.js +0 -7
- package/dist/MemoryManager-AENCGCEW.cjs +0 -7
- package/dist/PermissionManager-6HZGTK2N.cjs +0 -10
- package/dist/SessionManager-AG4WT3DP.cjs +0 -9
- package/dist/SkillsRegistry-ZXU6YDRP.cjs +0 -8
- package/dist/SyncApiClient-UOA4VLLD.cjs +0 -10
- package/dist/add-dir-OMK3Y4DM.cjs +0 -8
- package/dist/agents-ICAC3KD3.js +0 -9
- package/dist/agents-YONWPKFS.cjs +0 -9
- package/dist/agents-new-NV557UVG.cjs +0 -10
- package/dist/agents-new-QHM3CO4B.js +0 -10
- package/dist/automode-BRHUHGXU.cjs +0 -8
- package/dist/chunk-3HPUOQJN.cjs +0 -23
- package/dist/chunk-5DN5KNXU.js +0 -81
- package/dist/chunk-7BYSXAKS.js +0 -23
- package/dist/chunk-ARVFUZOB.js +0 -736
- package/dist/chunk-BEIG7V7Q.cjs +0 -51
- package/dist/chunk-GWXXFQ3F.cjs +0 -81
- package/dist/chunk-XFQS2VGT.cjs +0 -736
- package/dist/chunk-Z3Q2AFDS.js +0 -51
- package/dist/completion-WVFWX7XQ.cjs +0 -10
- package/dist/completion-Y42FKDT3.js +0 -10
- package/dist/constants-G2PLP5HH.cjs +0 -20
- package/dist/export-BKBJ7PB2.cjs +0 -8
- package/dist/export-WJ5P6E5Z.js +0 -8
- package/dist/feedback-HZBCTSFG.js +0 -10
- package/dist/feedback-JBQ3UPGZ.cjs +0 -10
- package/dist/help-PKC6QCNG.js +0 -10
- package/dist/help-UEELQRHP.cjs +0 -10
- package/dist/hooks-G4VLYMLX.cjs +0 -9
- package/dist/hooks-LN4A6NQL.js +0 -9
- package/dist/init-DML7AOII.js +0 -8
- package/dist/init-SLLSDDJN.cjs +0 -8
- package/dist/language-KODBDE5R.js +0 -12
- package/dist/language-SJT475NW.cjs +0 -12
- package/dist/localProjectPermissions-AYQYGTOE.cjs +0 -17
- package/dist/login-TC2KROQI.js +0 -14
- package/dist/login-TYMR2ZD3.cjs +0 -14
- package/dist/logout-2ECV365P.js +0 -12
- package/dist/logout-CO3CPYZJ.cjs +0 -12
- package/dist/memory-CFNC7RJH.cjs +0 -8
- package/dist/model-TKVEJ5BC.cjs +0 -8
- package/dist/new-EB2MBQXA.cjs +0 -8
- package/dist/permissions-5MTH22EF.js +0 -9
- package/dist/permissions-IP5SITPI.cjs +0 -9
- package/dist/quit-2RYFGIJP.cjs +0 -8
- package/dist/quit-RSYIERO5.js +0 -8
- package/dist/resume-EPOEF3WV.cjs +0 -9
- package/dist/resume-LOYD5MMP.js +0 -9
- package/dist/sessions-7RTCPVNE.cjs +0 -8
- package/dist/share-APR5S2CS.cjs +0 -10
- package/dist/share-VLJFDZKR.js +0 -10
- package/dist/skills-CRM55MKM.cjs +0 -12
- package/dist/skills-new-JF4FKNUT.cjs +0 -11
- package/dist/skills-new-JYX2GBKM.js +0 -11
- package/dist/status-DAEFE7ZC.cjs +0 -9
- package/dist/status-PBFFUC4Q.js +0 -9
- package/dist/sync-3B7SNBYC.js +0 -14
- package/dist/sync-4RARBQIH.cjs +0 -39
- package/dist/sync-YZ6YZ42H.cjs +0 -14
- package/dist/theme-3XV5BWUB.js +0 -12
- package/dist/theme-Z2WS5XWZ.cjs +0 -12
- package/dist/undo-2WR2ZIEC.cjs +0 -8
- package/dist/undo-7QJBXARS.js +0 -8
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkQRQ5EX7Icjs = require('./chunk-QRQ5EX7I.cjs');
|
|
7
|
+
|
|
8
|
+
// src/utils/prompt.ts
|
|
9
|
+
async function safePrompt(questions) {
|
|
10
|
+
const questionArray = Array.isArray(questions) ? questions : [questions];
|
|
11
|
+
const results = {};
|
|
12
|
+
for (const question of questionArray) {
|
|
13
|
+
let value;
|
|
14
|
+
if (question.type === "select") {
|
|
15
|
+
const selectConfig = question;
|
|
16
|
+
const options = selectConfig.choices.map((choice) => ({
|
|
17
|
+
label: choice.message,
|
|
18
|
+
value: choice.name
|
|
19
|
+
}));
|
|
20
|
+
const result = await _chunkQRQ5EX7Icjs.showModal.call(void 0, {
|
|
21
|
+
title: selectConfig.message,
|
|
22
|
+
options,
|
|
23
|
+
initialIndex: selectConfig.initial
|
|
24
|
+
});
|
|
25
|
+
value = _optionalChain([result, 'optionalAccess', _ => _.value]);
|
|
26
|
+
} else if (question.type === "confirm") {
|
|
27
|
+
const confirmConfig = question;
|
|
28
|
+
value = await _chunkQRQ5EX7Icjs.showConfirm.call(void 0, {
|
|
29
|
+
title: confirmConfig.message,
|
|
30
|
+
defaultValue: confirmConfig.initial
|
|
31
|
+
});
|
|
32
|
+
} else if (question.type === "password") {
|
|
33
|
+
const inputConfig = question;
|
|
34
|
+
value = await _chunkQRQ5EX7Icjs.showPassword.call(void 0, {
|
|
35
|
+
title: inputConfig.message,
|
|
36
|
+
validate: inputConfig.validate
|
|
37
|
+
});
|
|
38
|
+
} else if (question.type === "input") {
|
|
39
|
+
const inputConfig = question;
|
|
40
|
+
value = await _chunkQRQ5EX7Icjs.showInput.call(void 0, {
|
|
41
|
+
title: inputConfig.message,
|
|
42
|
+
defaultValue: inputConfig.initial,
|
|
43
|
+
validate: inputConfig.validate
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (value === null || value === void 0) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
results[question.name] = value;
|
|
50
|
+
}
|
|
51
|
+
return results;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
exports.safePrompt = safePrompt;
|
|
57
|
+
/**
|
|
58
|
+
* @license
|
|
59
|
+
* Copyright 2025 Autohand AI LLC
|
|
60
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
61
|
+
*
|
|
62
|
+
* Safe prompt utilities using Ink Modal components
|
|
63
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGIZL57FEcjs = require('./chunk-GIZL57FE.cjs');
|
|
4
4
|
|
|
5
5
|
// src/skills/CommunitySkillsCache.ts
|
|
6
6
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
@@ -9,7 +9,7 @@ var DEFAULT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
|
9
9
|
var DEFAULT_MAX_SKILLS_CACHE = 50;
|
|
10
10
|
var CommunitySkillsCache = class {
|
|
11
11
|
constructor(config = {}) {
|
|
12
|
-
this.cacheDir = config.cacheDir || _path2.default.join(
|
|
12
|
+
this.cacheDir = config.cacheDir || _path2.default.join(_chunkGIZL57FEcjs.AUTOHAND_HOME, "community-skills", "cache");
|
|
13
13
|
this.ttlMs = _nullishCoalesce(config.ttlMs, () => ( DEFAULT_TTL_MS));
|
|
14
14
|
this.maxSkillsCache = _nullishCoalesce(config.maxSkillsCache, () => ( DEFAULT_MAX_SKILLS_CACHE));
|
|
15
15
|
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// src/commands/plan.ts
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
|
|
4
|
+
// src/modes/planMode/PlanModeManager.ts
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
var READ_ONLY_TOOLS = [
|
|
7
|
+
// File reading
|
|
8
|
+
"read_file",
|
|
9
|
+
"search",
|
|
10
|
+
"search_with_context",
|
|
11
|
+
"semantic_search",
|
|
12
|
+
"list_tree",
|
|
13
|
+
"file_stats",
|
|
14
|
+
"checksum",
|
|
15
|
+
// Git read operations
|
|
16
|
+
"git_status",
|
|
17
|
+
"git_diff",
|
|
18
|
+
"git_diff_range",
|
|
19
|
+
"git_log",
|
|
20
|
+
"git_branch",
|
|
21
|
+
"git_stash_list",
|
|
22
|
+
"git_worktree_list",
|
|
23
|
+
"git_worktree_status_all",
|
|
24
|
+
// Web/Research
|
|
25
|
+
"web_search",
|
|
26
|
+
"fetch_url",
|
|
27
|
+
"package_info",
|
|
28
|
+
"web_repo",
|
|
29
|
+
// Memory
|
|
30
|
+
"recall_memory",
|
|
31
|
+
// Meta
|
|
32
|
+
"tools_registry",
|
|
33
|
+
"plan",
|
|
34
|
+
"ask_followup_question"
|
|
35
|
+
];
|
|
36
|
+
var PlanModeManager = class extends EventEmitter {
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
this.state = {
|
|
40
|
+
enabled: false,
|
|
41
|
+
phase: "planning",
|
|
42
|
+
plan: null,
|
|
43
|
+
startedAt: 0
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check if plan mode is enabled
|
|
48
|
+
*/
|
|
49
|
+
isEnabled() {
|
|
50
|
+
return this.state.enabled;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get current phase
|
|
54
|
+
*/
|
|
55
|
+
getPhase() {
|
|
56
|
+
return this.state.phase;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get current plan
|
|
60
|
+
*/
|
|
61
|
+
getPlan() {
|
|
62
|
+
return this.state.plan;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Enable plan mode
|
|
66
|
+
*/
|
|
67
|
+
enable() {
|
|
68
|
+
if (this.state.enabled) return;
|
|
69
|
+
this.state.enabled = true;
|
|
70
|
+
this.state.phase = "planning";
|
|
71
|
+
this.state.startedAt = Date.now();
|
|
72
|
+
this.emit("enabled");
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Disable plan mode
|
|
76
|
+
*/
|
|
77
|
+
disable() {
|
|
78
|
+
if (!this.state.enabled) return;
|
|
79
|
+
this.state.enabled = false;
|
|
80
|
+
this.emit("disabled");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Toggle plan mode on/off
|
|
84
|
+
*/
|
|
85
|
+
toggle() {
|
|
86
|
+
if (this.state.enabled) {
|
|
87
|
+
this.disable();
|
|
88
|
+
} else {
|
|
89
|
+
this.enable();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Handle Shift+Tab keypress - simple toggle on/off
|
|
94
|
+
*/
|
|
95
|
+
handleShiftTab() {
|
|
96
|
+
this.toggle();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get prompt indicator based on current state
|
|
100
|
+
*/
|
|
101
|
+
getPromptIndicator() {
|
|
102
|
+
if (!this.state.enabled) {
|
|
103
|
+
return "";
|
|
104
|
+
}
|
|
105
|
+
if (this.state.phase === "executing") {
|
|
106
|
+
return "[EXEC]";
|
|
107
|
+
}
|
|
108
|
+
return "[PLAN]";
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get i18n key for status description based on current phase
|
|
112
|
+
*/
|
|
113
|
+
getStatusDescriptionKey() {
|
|
114
|
+
if (!this.state.enabled) {
|
|
115
|
+
return "";
|
|
116
|
+
}
|
|
117
|
+
if (this.state.phase === "executing") {
|
|
118
|
+
return "ui.planModeExecuting";
|
|
119
|
+
}
|
|
120
|
+
return "ui.planModeActive";
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Set the current plan
|
|
124
|
+
*/
|
|
125
|
+
setPlan(plan2) {
|
|
126
|
+
this.state.plan = plan2;
|
|
127
|
+
this.emit("plan:set", plan2);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Start plan execution
|
|
131
|
+
* Transitions from planning to executing phase
|
|
132
|
+
*/
|
|
133
|
+
startExecution() {
|
|
134
|
+
if (!this.state.plan) {
|
|
135
|
+
throw new Error("No plan to execute");
|
|
136
|
+
}
|
|
137
|
+
this.state.phase = "executing";
|
|
138
|
+
this.state.executionStartedAt = Date.now();
|
|
139
|
+
this.emit("execution:started", this.state.plan);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get list of read-only tools allowed in plan mode
|
|
143
|
+
*/
|
|
144
|
+
getReadOnlyTools() {
|
|
145
|
+
return [...READ_ONLY_TOOLS];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get current state (for persistence/debugging)
|
|
149
|
+
*/
|
|
150
|
+
getState() {
|
|
151
|
+
return { ...this.state };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Restore state from persistence
|
|
155
|
+
*/
|
|
156
|
+
restore(state) {
|
|
157
|
+
this.state = {
|
|
158
|
+
...this.state,
|
|
159
|
+
...state
|
|
160
|
+
};
|
|
161
|
+
if (this.state.enabled) {
|
|
162
|
+
this.emit("restored", this.state);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Accept the plan with specified option
|
|
167
|
+
* This starts execution with the given configuration
|
|
168
|
+
*
|
|
169
|
+
* Options:
|
|
170
|
+
* - clear_context_auto_accept: Clear context and auto-accept edits (best for plan adherence)
|
|
171
|
+
* - manual_approve: Manually approve each edit
|
|
172
|
+
* - auto_accept: Auto-accept edits without clearing context
|
|
173
|
+
*/
|
|
174
|
+
acceptPlan(option) {
|
|
175
|
+
if (!this.state.plan) {
|
|
176
|
+
throw new Error("No plan to accept");
|
|
177
|
+
}
|
|
178
|
+
const config = {
|
|
179
|
+
option,
|
|
180
|
+
clearContext: option === "clear_context_auto_accept",
|
|
181
|
+
autoAcceptEdits: option !== "manual_approve"
|
|
182
|
+
};
|
|
183
|
+
this.state.phase = "executing";
|
|
184
|
+
this.state.executionStartedAt = Date.now();
|
|
185
|
+
this.emit("plan:accepted", config);
|
|
186
|
+
this.emit("execution:started", this.state.plan);
|
|
187
|
+
return config;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Get available plan acceptance options for UI display
|
|
191
|
+
*/
|
|
192
|
+
getAcceptOptions() {
|
|
193
|
+
return [
|
|
194
|
+
{
|
|
195
|
+
id: "clear_context_auto_accept",
|
|
196
|
+
label: "Yes, clear context and auto-accept edits",
|
|
197
|
+
description: "Clears context for fresh start, improves plan adherence. Auto-accepts all edits.",
|
|
198
|
+
shortcut: "shift+tab"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "manual_approve",
|
|
202
|
+
label: "Yes, and manually approve edits",
|
|
203
|
+
description: "Keep context, review and approve each edit individually."
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: "auto_accept",
|
|
207
|
+
label: "Yes, auto-accept edits",
|
|
208
|
+
description: "Keep context, auto-accept all edits without review."
|
|
209
|
+
}
|
|
210
|
+
];
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// src/commands/plan.ts
|
|
215
|
+
var metadata = {
|
|
216
|
+
command: "/plan",
|
|
217
|
+
description: "toggle plan mode for safe code exploration",
|
|
218
|
+
implemented: true
|
|
219
|
+
};
|
|
220
|
+
var planModeManager = null;
|
|
221
|
+
function getPlanModeManager() {
|
|
222
|
+
if (!planModeManager) {
|
|
223
|
+
planModeManager = new PlanModeManager();
|
|
224
|
+
}
|
|
225
|
+
return planModeManager;
|
|
226
|
+
}
|
|
227
|
+
async function plan(_ctx, args) {
|
|
228
|
+
const manager = getPlanModeManager();
|
|
229
|
+
const subcommand = args?.trim().toLowerCase();
|
|
230
|
+
switch (subcommand) {
|
|
231
|
+
case "on":
|
|
232
|
+
case "enable":
|
|
233
|
+
if (manager.isEnabled()) {
|
|
234
|
+
console.log(chalk.yellow("Plan mode is already enabled."));
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
manager.enable();
|
|
238
|
+
console.log(chalk.green("Plan mode enabled."));
|
|
239
|
+
console.log(chalk.gray("Tools are now read-only. Use /plan off to disable."));
|
|
240
|
+
console.log(chalk.gray("Tip: Press Shift+Tab twice to quickly toggle plan mode."));
|
|
241
|
+
return null;
|
|
242
|
+
case "off":
|
|
243
|
+
case "disable":
|
|
244
|
+
if (!manager.isEnabled()) {
|
|
245
|
+
console.log(chalk.yellow("Plan mode is not enabled."));
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
manager.disable();
|
|
249
|
+
console.log(chalk.green("Plan mode disabled."));
|
|
250
|
+
console.log(chalk.gray("Full tool access restored."));
|
|
251
|
+
return null;
|
|
252
|
+
case "status":
|
|
253
|
+
return showPlanStatus(manager);
|
|
254
|
+
case "":
|
|
255
|
+
case void 0:
|
|
256
|
+
if (manager.isEnabled()) {
|
|
257
|
+
manager.disable();
|
|
258
|
+
console.log(chalk.green("Plan mode disabled."));
|
|
259
|
+
console.log(chalk.gray("Full tool access restored."));
|
|
260
|
+
} else {
|
|
261
|
+
manager.enable();
|
|
262
|
+
console.log(chalk.green("Plan mode enabled."));
|
|
263
|
+
console.log(chalk.gray("Tools are now read-only."));
|
|
264
|
+
}
|
|
265
|
+
return null;
|
|
266
|
+
default:
|
|
267
|
+
console.log(chalk.yellow(`Unknown subcommand: ${subcommand}`));
|
|
268
|
+
console.log(chalk.gray(`
|
|
269
|
+
Usage:
|
|
270
|
+
/plan - Toggle plan mode
|
|
271
|
+
/plan on - Enable plan mode
|
|
272
|
+
/plan off - Disable plan mode
|
|
273
|
+
/plan status - Show current plan state
|
|
274
|
+
|
|
275
|
+
Keyboard shortcut:
|
|
276
|
+
Shift+Tab (twice) - Enter plan mode
|
|
277
|
+
Shift+Tab (once) - Exit plan mode (when in plan mode)
|
|
278
|
+
`));
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function showPlanStatus(manager) {
|
|
283
|
+
const enabled = manager.isEnabled();
|
|
284
|
+
const phase = manager.getPhase();
|
|
285
|
+
const plan2 = manager.getPlan();
|
|
286
|
+
const indicator = manager.getPromptIndicator();
|
|
287
|
+
console.log("");
|
|
288
|
+
console.log(chalk.bold.cyan("Plan Mode Status"));
|
|
289
|
+
console.log(chalk.gray("\u2500".repeat(40)));
|
|
290
|
+
console.log(`Status: ${enabled ? chalk.green("ENABLED") : chalk.gray("DISABLED")}`);
|
|
291
|
+
console.log(`Phase: ${chalk.cyan(phase)}`);
|
|
292
|
+
console.log(`Indicator: ${indicator || chalk.gray("(none)")}`);
|
|
293
|
+
if (plan2) {
|
|
294
|
+
const completed = plan2.steps.filter((s) => s.status === "completed").length;
|
|
295
|
+
const inProgress = plan2.steps.find((s) => s.status === "in_progress");
|
|
296
|
+
console.log("");
|
|
297
|
+
console.log(chalk.bold(`Plan: ${plan2.id}`));
|
|
298
|
+
console.log(`Progress: ${completed}/${plan2.steps.length} steps`);
|
|
299
|
+
console.log("");
|
|
300
|
+
for (const step of plan2.steps) {
|
|
301
|
+
const icon = getStepIcon(step.status);
|
|
302
|
+
const color = getStepColor(step.status);
|
|
303
|
+
console.log(color(` ${icon} ${step.number}. ${step.description}`));
|
|
304
|
+
}
|
|
305
|
+
if (inProgress) {
|
|
306
|
+
console.log("");
|
|
307
|
+
console.log(chalk.yellow(`Currently working on: Step ${inProgress.number}`));
|
|
308
|
+
}
|
|
309
|
+
} else {
|
|
310
|
+
console.log("");
|
|
311
|
+
console.log(chalk.gray("No plan created yet."));
|
|
312
|
+
console.log(chalk.gray("Ask the agent to create a plan for your task."));
|
|
313
|
+
}
|
|
314
|
+
console.log("");
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
function getStepIcon(status) {
|
|
318
|
+
switch (status) {
|
|
319
|
+
case "completed":
|
|
320
|
+
return "\u2713";
|
|
321
|
+
case "in_progress":
|
|
322
|
+
return "\u2192";
|
|
323
|
+
case "skipped":
|
|
324
|
+
return "\u2298";
|
|
325
|
+
default:
|
|
326
|
+
return "\u25CB";
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function getStepColor(status) {
|
|
330
|
+
switch (status) {
|
|
331
|
+
case "completed":
|
|
332
|
+
return chalk.green;
|
|
333
|
+
case "in_progress":
|
|
334
|
+
return chalk.yellow;
|
|
335
|
+
case "skipped":
|
|
336
|
+
return chalk.gray;
|
|
337
|
+
default:
|
|
338
|
+
return chalk.white;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export {
|
|
343
|
+
metadata,
|
|
344
|
+
getPlanModeManager,
|
|
345
|
+
plan
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* @license
|
|
349
|
+
* Copyright 2025 Autohand AI LLC
|
|
350
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
351
|
+
*
|
|
352
|
+
* Plan Mode Manager
|
|
353
|
+
* Central coordinator for plan mode state and operations
|
|
354
|
+
*/
|
|
355
|
+
/**
|
|
356
|
+
* @license
|
|
357
|
+
* Copyright 2025 Autohand AI LLC
|
|
358
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
359
|
+
*
|
|
360
|
+
* Plan Mode Command
|
|
361
|
+
* Toggle plan mode for safe code exploration before execution
|
|
362
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCurrentLocale,
|
|
3
|
+
onLanguageChange,
|
|
4
|
+
t
|
|
5
|
+
} from "./chunk-UET7BDX2.js";
|
|
6
|
+
|
|
7
|
+
// src/ui/i18n/I18nContext.tsx
|
|
8
|
+
import { createContext, useContext, useState, useEffect, useMemo } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var defaultContextValue = {
|
|
11
|
+
t,
|
|
12
|
+
locale: "en"
|
|
13
|
+
};
|
|
14
|
+
var I18nContext = createContext(defaultContextValue);
|
|
15
|
+
var I18nProvider = ({ children }) => {
|
|
16
|
+
const [locale, setLocale] = useState(getCurrentLocale());
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const unsubscribe = onLanguageChange((newLocale) => {
|
|
19
|
+
setLocale(newLocale);
|
|
20
|
+
});
|
|
21
|
+
return unsubscribe;
|
|
22
|
+
}, []);
|
|
23
|
+
const value = useMemo(
|
|
24
|
+
() => ({
|
|
25
|
+
t,
|
|
26
|
+
locale
|
|
27
|
+
}),
|
|
28
|
+
[locale]
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ jsx(I18nContext.Provider, { value, children });
|
|
31
|
+
};
|
|
32
|
+
function useTranslation() {
|
|
33
|
+
const context = useContext(I18nContext);
|
|
34
|
+
return context;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
I18nProvider,
|
|
39
|
+
useTranslation
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @license
|
|
43
|
+
* Copyright 2025 Autohand AI LLC
|
|
44
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45
|
+
*/
|