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,362 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/commands/plan.ts
|
|
2
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
3
|
+
|
|
4
|
+
// src/modes/planMode/PlanModeManager.ts
|
|
5
|
+
var _events = require('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 _events.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 = _optionalChain([args, 'optionalAccess', _ => _.trim, 'call', _2 => _2(), 'access', _3 => _3.toLowerCase, 'call', _4 => _4()]);
|
|
230
|
+
switch (subcommand) {
|
|
231
|
+
case "on":
|
|
232
|
+
case "enable":
|
|
233
|
+
if (manager.isEnabled()) {
|
|
234
|
+
console.log(_chalk2.default.yellow("Plan mode is already enabled."));
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
manager.enable();
|
|
238
|
+
console.log(_chalk2.default.green("Plan mode enabled."));
|
|
239
|
+
console.log(_chalk2.default.gray("Tools are now read-only. Use /plan off to disable."));
|
|
240
|
+
console.log(_chalk2.default.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(_chalk2.default.yellow("Plan mode is not enabled."));
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
manager.disable();
|
|
249
|
+
console.log(_chalk2.default.green("Plan mode disabled."));
|
|
250
|
+
console.log(_chalk2.default.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(_chalk2.default.green("Plan mode disabled."));
|
|
259
|
+
console.log(_chalk2.default.gray("Full tool access restored."));
|
|
260
|
+
} else {
|
|
261
|
+
manager.enable();
|
|
262
|
+
console.log(_chalk2.default.green("Plan mode enabled."));
|
|
263
|
+
console.log(_chalk2.default.gray("Tools are now read-only."));
|
|
264
|
+
}
|
|
265
|
+
return null;
|
|
266
|
+
default:
|
|
267
|
+
console.log(_chalk2.default.yellow(`Unknown subcommand: ${subcommand}`));
|
|
268
|
+
console.log(_chalk2.default.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(_chalk2.default.bold.cyan("Plan Mode Status"));
|
|
289
|
+
console.log(_chalk2.default.gray("\u2500".repeat(40)));
|
|
290
|
+
console.log(`Status: ${enabled ? _chalk2.default.green("ENABLED") : _chalk2.default.gray("DISABLED")}`);
|
|
291
|
+
console.log(`Phase: ${_chalk2.default.cyan(phase)}`);
|
|
292
|
+
console.log(`Indicator: ${indicator || _chalk2.default.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(_chalk2.default.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(_chalk2.default.yellow(`Currently working on: Step ${inProgress.number}`));
|
|
308
|
+
}
|
|
309
|
+
} else {
|
|
310
|
+
console.log("");
|
|
311
|
+
console.log(_chalk2.default.gray("No plan created yet."));
|
|
312
|
+
console.log(_chalk2.default.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 _chalk2.default.green;
|
|
333
|
+
case "in_progress":
|
|
334
|
+
return _chalk2.default.yellow;
|
|
335
|
+
case "skipped":
|
|
336
|
+
return _chalk2.default.gray;
|
|
337
|
+
default:
|
|
338
|
+
return _chalk2.default.white;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
exports.metadata = metadata; exports.getPlanModeManager = getPlanModeManager; exports.plan = plan;
|
|
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
|
+
*/
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadConfig,
|
|
3
3
|
saveConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZBIBLOZL.js";
|
|
5
|
+
import {
|
|
6
|
+
t
|
|
7
|
+
} from "./chunk-UET7BDX2.js";
|
|
5
8
|
|
|
6
9
|
// src/commands/sync.ts
|
|
7
10
|
import chalk from "chalk";
|
|
8
11
|
import readline from "readline";
|
|
9
12
|
var metadata = {
|
|
10
13
|
command: "/sync",
|
|
11
|
-
description: "
|
|
14
|
+
description: t("commands.sync.description"),
|
|
12
15
|
implemented: true
|
|
13
16
|
};
|
|
14
17
|
var globalSyncService = null;
|
|
@@ -62,7 +65,6 @@ function renderSyncUI(data, ctx) {
|
|
|
62
65
|
return new Promise((resolve) => {
|
|
63
66
|
const tabs = ["Status", "Settings", "Activity"];
|
|
64
67
|
let currentTab = 0;
|
|
65
|
-
let needsRefresh = false;
|
|
66
68
|
const input = process.stdin;
|
|
67
69
|
const isTTY = input.isTTY;
|
|
68
70
|
const wasRaw = input.isRaw;
|
|
@@ -85,94 +87,67 @@ function renderSyncUI(data, ctx) {
|
|
|
85
87
|
renderTabContent(tabs[currentTab], data);
|
|
86
88
|
console.log(chalk.gray("\nEsc to exit | Tab to cycle | s: sync now | e: toggle enabled"));
|
|
87
89
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (first === "\x1B") {
|
|
95
|
-
if (buffer.length === 1) return false;
|
|
96
|
-
if (buffer[1] === "[") {
|
|
97
|
-
if (buffer.length < 3) return false;
|
|
98
|
-
const seq = buffer.slice(0, 3);
|
|
99
|
-
buffer = buffer.slice(3);
|
|
100
|
-
await handleSequence(seq);
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
buffer = buffer.slice(1);
|
|
104
|
-
await handleSequence("\x1B");
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
buffer = buffer.slice(1);
|
|
108
|
-
await handleSequence(first);
|
|
109
|
-
return true;
|
|
110
|
-
};
|
|
111
|
-
while (await processNext()) {
|
|
90
|
+
const handler = async (_str, key) => {
|
|
91
|
+
const char = (_str || "").toLowerCase();
|
|
92
|
+
if (key.name === "escape" || key.name === "c" && key.ctrl) {
|
|
93
|
+
cleanup();
|
|
94
|
+
resolve();
|
|
95
|
+
return;
|
|
112
96
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
currentTab = (currentTab - 1 + tabs.length) % tabs.length;
|
|
132
|
-
render();
|
|
133
|
-
return;
|
|
134
|
-
case "s":
|
|
135
|
-
case "S":
|
|
136
|
-
if (data.syncService) {
|
|
137
|
-
console.log(chalk.cyan("\nSyncing..."));
|
|
138
|
-
try {
|
|
139
|
-
const result = await data.syncService.sync();
|
|
140
|
-
if (result.success) {
|
|
141
|
-
console.log(chalk.green(`Sync complete! Uploaded: ${result.uploaded}, Downloaded: ${result.downloaded}`));
|
|
142
|
-
} else {
|
|
143
|
-
console.log(chalk.red(`Sync failed: ${result.error}`));
|
|
144
|
-
}
|
|
145
|
-
const config = await loadConfig();
|
|
146
|
-
Object.assign(data, await gatherSyncData(ctx, config));
|
|
147
|
-
} catch (err) {
|
|
148
|
-
console.log(chalk.red(`Sync error: ${err}`));
|
|
149
|
-
}
|
|
150
|
-
await sleep(1500);
|
|
151
|
-
render();
|
|
152
|
-
}
|
|
153
|
-
return;
|
|
154
|
-
case "e":
|
|
155
|
-
case "E":
|
|
97
|
+
if (key.name === "tab" && key.shift) {
|
|
98
|
+
currentTab = (currentTab - 1 + tabs.length) % tabs.length;
|
|
99
|
+
render();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (key.name === "tab" || key.name === "right") {
|
|
103
|
+
currentTab = (currentTab + 1) % tabs.length;
|
|
104
|
+
render();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (key.name === "left") {
|
|
108
|
+
currentTab = (currentTab - 1 + tabs.length) % tabs.length;
|
|
109
|
+
render();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (char === "s") {
|
|
113
|
+
if (data.syncService) {
|
|
114
|
+
console.log(chalk.cyan("\nSyncing..."));
|
|
156
115
|
try {
|
|
116
|
+
const result = await data.syncService.sync();
|
|
117
|
+
if (result.success) {
|
|
118
|
+
console.log(chalk.green(`Sync complete! Uploaded: ${result.uploaded}, Downloaded: ${result.downloaded}`));
|
|
119
|
+
} else {
|
|
120
|
+
console.log(chalk.red(`Sync failed: ${result.error}`));
|
|
121
|
+
}
|
|
157
122
|
const config = await loadConfig();
|
|
158
|
-
|
|
159
|
-
config.sync = { ...config.sync, enabled: newEnabled };
|
|
160
|
-
await saveConfig(config);
|
|
161
|
-
data.enabled = newEnabled;
|
|
162
|
-
console.log(chalk.cyan(`
|
|
163
|
-
Sync ${newEnabled ? "enabled" : "disabled"}`));
|
|
164
|
-
await sleep(1e3);
|
|
165
|
-
render();
|
|
123
|
+
Object.assign(data, await gatherSyncData(ctx, config));
|
|
166
124
|
} catch (err) {
|
|
167
|
-
console.log(chalk.red(`
|
|
125
|
+
console.log(chalk.red(`Sync error: ${err}`));
|
|
168
126
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
127
|
+
await sleep(1500);
|
|
128
|
+
render();
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (char === "e") {
|
|
133
|
+
try {
|
|
134
|
+
const config = await loadConfig();
|
|
135
|
+
const newEnabled = config.sync?.enabled === false;
|
|
136
|
+
config.sync = { ...config.sync, enabled: newEnabled };
|
|
137
|
+
await saveConfig(config);
|
|
138
|
+
data.enabled = newEnabled;
|
|
139
|
+
console.log(chalk.cyan(`
|
|
140
|
+
${newEnabled ? t("commands.sync.enabled") : t("commands.sync.disabled")}`));
|
|
141
|
+
await sleep(1e3);
|
|
142
|
+
render();
|
|
143
|
+
} catch (err) {
|
|
144
|
+
console.log(chalk.red(`Error toggling sync: ${err}`));
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
172
147
|
}
|
|
173
148
|
};
|
|
174
149
|
const cleanup = () => {
|
|
175
|
-
input.off("
|
|
150
|
+
input.off("keypress", handler);
|
|
176
151
|
if (isTTY && !wasRaw && typeof input.setRawMode === "function") {
|
|
177
152
|
input.setRawMode(false);
|
|
178
153
|
}
|
|
@@ -181,7 +156,7 @@ Sync ${newEnabled ? "enabled" : "disabled"}`));
|
|
|
181
156
|
}
|
|
182
157
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
183
158
|
};
|
|
184
|
-
input.on("
|
|
159
|
+
input.on("keypress", handler);
|
|
185
160
|
render();
|
|
186
161
|
});
|
|
187
162
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/commands/cc.ts
|
|
2
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
3
|
+
async function cc(ctx) {
|
|
4
|
+
if (!ctx.toggleContextCompaction || !ctx.isContextCompactionEnabled) {
|
|
5
|
+
console.log(_chalk2.default.yellow("Context compaction is not available in this mode."));
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
ctx.toggleContextCompaction();
|
|
9
|
+
const enabled = ctx.isContextCompactionEnabled();
|
|
10
|
+
const status = enabled ? "enabled" : "disabled";
|
|
11
|
+
const color = enabled ? _chalk2.default.green : _chalk2.default.yellow;
|
|
12
|
+
console.log(color(`Context compaction ${status}`));
|
|
13
|
+
if (!enabled) {
|
|
14
|
+
console.log(_chalk2.default.gray(' Note: Without compaction, you may see "context too long" errors.'));
|
|
15
|
+
console.log(_chalk2.default.gray(" Use /cc again to re-enable auto-compaction."));
|
|
16
|
+
} else {
|
|
17
|
+
console.log(_chalk2.default.gray(" Auto-compacting context at 70%/80%/90% thresholds."));
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
var metadata = {
|
|
22
|
+
command: "/cc",
|
|
23
|
+
description: "toggle context compaction on/off",
|
|
24
|
+
implemented: true
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
exports.cc = cc; exports.metadata = metadata;
|
|
31
|
+
/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2025 Autohand AI LLC
|
|
34
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
35
|
+
*/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
showConfirm,
|
|
3
|
+
showInput,
|
|
4
|
+
showModal,
|
|
5
|
+
showPassword
|
|
6
|
+
} from "./chunk-PNSRJT46.js";
|
|
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 showModal({
|
|
21
|
+
title: selectConfig.message,
|
|
22
|
+
options,
|
|
23
|
+
initialIndex: selectConfig.initial
|
|
24
|
+
});
|
|
25
|
+
value = result?.value;
|
|
26
|
+
} else if (question.type === "confirm") {
|
|
27
|
+
const confirmConfig = question;
|
|
28
|
+
value = await showConfirm({
|
|
29
|
+
title: confirmConfig.message,
|
|
30
|
+
defaultValue: confirmConfig.initial
|
|
31
|
+
});
|
|
32
|
+
} else if (question.type === "password") {
|
|
33
|
+
const inputConfig = question;
|
|
34
|
+
value = await showPassword({
|
|
35
|
+
title: inputConfig.message,
|
|
36
|
+
validate: inputConfig.validate
|
|
37
|
+
});
|
|
38
|
+
} else if (question.type === "input") {
|
|
39
|
+
const inputConfig = question;
|
|
40
|
+
value = await showInput({
|
|
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
|
+
export {
|
|
55
|
+
safePrompt
|
|
56
|
+
};
|
|
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
|
+
*/
|