hypercore-cli 1.1.2 → 1.3.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.
Files changed (158) hide show
  1. package/LICENSE +92 -21
  2. package/README.md +8 -1
  3. package/dist/App-YMX7FSXR.js +1 -0
  4. package/dist/api-Q2TX5JJL.js +1 -0
  5. package/dist/auth-X6CUT3DW.js +1 -0
  6. package/dist/background-ACODXSUG.js +1 -0
  7. package/dist/backlog-JD2IM336.js +1 -0
  8. package/dist/chunk-2QI2IU2V.js +1 -0
  9. package/dist/chunk-3KFRDIPQ.js +1 -0
  10. package/dist/chunk-42C5J7PN.js +1 -0
  11. package/dist/chunk-4D7XVJ7Q.js +1 -0
  12. package/dist/chunk-545IGTXV.js +1 -0
  13. package/dist/chunk-5KUSGQP2.js +1 -0
  14. package/dist/chunk-AUQ64BK2.js +1 -0
  15. package/dist/chunk-AV244H5C.js +1 -0
  16. package/dist/chunk-BQVBEFS4.js +1 -0
  17. package/dist/chunk-BYWQLFP2.js +1 -0
  18. package/dist/chunk-COITWWZJ.js +1 -0
  19. package/dist/chunk-CR7UUJVX.js +1 -0
  20. package/dist/chunk-E3MULLBX.js +1 -0
  21. package/dist/chunk-EWBV7YPP.js +1 -0
  22. package/dist/chunk-EZHYVJGQ.js +1 -0
  23. package/dist/chunk-FAKXBY7Q.js +1 -0
  24. package/dist/chunk-FHGATV5B.js +1 -0
  25. package/dist/chunk-I2G27Y5P.js +1 -0
  26. package/dist/chunk-IKF43TX2.js +1 -0
  27. package/dist/chunk-INSPHCBN.js +1 -0
  28. package/dist/chunk-LQMDUKIE.js +1 -0
  29. package/dist/chunk-M3MTKGA5.js +1 -0
  30. package/dist/chunk-MPO54FU3.js +1 -0
  31. package/dist/chunk-PVKCZI6A.js +1 -0
  32. package/dist/chunk-Q7KEPCYL.js +1 -0
  33. package/dist/chunk-R5XD3NT2.js +1 -0
  34. package/dist/chunk-ROBZ6PAL.js +1 -0
  35. package/dist/chunk-RXB5BS2N.js +1 -0
  36. package/dist/chunk-RZ3HNYMT.js +1 -0
  37. package/dist/chunk-UCGLRMTG.js +1 -0
  38. package/dist/chunk-UEHJVRKB.js +1 -0
  39. package/dist/chunk-UZYX5GGF.js +1 -0
  40. package/dist/chunk-XQJBB725.js +1 -0
  41. package/dist/chunk-ZB5ZQSXH.js +1 -0
  42. package/dist/claude-US2QPRBA.js +1 -0
  43. package/dist/commands-5TFN74MD.js +1 -0
  44. package/dist/commands-EKPWCB3T.js +1 -0
  45. package/dist/commands-QHJLREPM.js +1 -0
  46. package/dist/config-2OUL5FLS.js +1 -0
  47. package/dist/config-loader-N7IBWN2P.js +1 -0
  48. package/dist/diagnose-NLHN4SAJ.js +1 -0
  49. package/dist/display-TB5YACJV.js +1 -0
  50. package/dist/extractor-3KTM2IUL.js +1 -0
  51. package/dist/feature-flag-VVIF5FJG.js +1 -0
  52. package/dist/history-GVNDPXXQ.js +1 -0
  53. package/dist/index.js +1 -402
  54. package/dist/instance-registry-I5AIVJE2.js +1 -0
  55. package/dist/keybindings-RN3A7CRW.js +1 -0
  56. package/dist/loader-3IKPXP4R.js +1 -0
  57. package/dist/network-GI2F3IDE.js +1 -0
  58. package/dist/notify-O6FNVHC4.js +1 -0
  59. package/dist/openai-compat-IPCMINVF.js +1 -0
  60. package/dist/permissions-5O7KVAXU.js +1 -0
  61. package/dist/prompt-VWFPFM4N.js +1 -0
  62. package/dist/quality-GPQD25UL.js +1 -0
  63. package/dist/repl-YNXCDVU4.js +1 -0
  64. package/dist/roadmap-QRZODSNJ.js +1 -0
  65. package/dist/server-USQP4GC4.js +1 -0
  66. package/dist/session-5HDDQQP6.js +1 -0
  67. package/dist/skills-DXWSVJSU.js +1 -0
  68. package/dist/store-WXXTKTTL.js +1 -0
  69. package/dist/team-VTPJ3WRT.js +1 -0
  70. package/dist/telemetry-NT4UZLBS.js +1 -0
  71. package/dist/test-runner-F6B6RH3S.js +1 -0
  72. package/dist/theme-JJJ6ABR2.js +1 -0
  73. package/dist/upgrade-RUG3R7R5.js +1 -0
  74. package/dist/verify-6OGRY2PR.js +1 -0
  75. package/dist/version-DLROA5JN.js +1 -0
  76. package/dist/web/static/app.js +1 -562
  77. package/dist/web/static/index.html +114 -126
  78. package/dist/web/static/mirror.css +1 -1001
  79. package/dist/web/static/mirror.html +155 -178
  80. package/dist/web/static/mirror.js +1 -1125
  81. package/dist/web/static/onboard.css +1 -302
  82. package/dist/web/static/onboard.html +121 -145
  83. package/dist/web/static/onboard.js +1 -300
  84. package/dist/web/static/style.css +1 -602
  85. package/dist/web/static/utils.js +1 -0
  86. package/dist/web/static/workspace.css +1 -1568
  87. package/dist/web/static/workspace.html +369 -402
  88. package/dist/web/static/workspace.js +1 -1683
  89. package/dist/web-P5YUKEAU.js +1 -0
  90. package/package.json +25 -4
  91. package/dist/api-JHHOZTL6.js +0 -162
  92. package/dist/auth-5QFJLW7J.js +0 -21
  93. package/dist/background-2EGCAAQH.js +0 -14
  94. package/dist/backlog-Q2NZCLNY.js +0 -24
  95. package/dist/chunk-2CMSCWQW.js +0 -162
  96. package/dist/chunk-4DVYJAJL.js +0 -57
  97. package/dist/chunk-5GDYH676.js +0 -271
  98. package/dist/chunk-5NLVGLD7.js +0 -66
  99. package/dist/chunk-6XTEAFZQ.js +0 -575
  100. package/dist/chunk-AQBSMYLT.js +0 -2025
  101. package/dist/chunk-BE46C7JW.js +0 -46
  102. package/dist/chunk-CLKIMCXZ.js +0 -139
  103. package/dist/chunk-DN4ASQ26.js +0 -167
  104. package/dist/chunk-DUWREZXK.js +0 -173
  105. package/dist/chunk-FCW3K6F2.js +0 -263
  106. package/dist/chunk-GFORWAMW.js +0 -251
  107. package/dist/chunk-GH7E2OJE.js +0 -223
  108. package/dist/chunk-GU2FZQ6A.js +0 -69
  109. package/dist/chunk-I7WI3BMB.js +0 -161
  110. package/dist/chunk-IOPKN5GD.js +0 -190
  111. package/dist/chunk-LBVHDGZE.js +0 -133
  112. package/dist/chunk-MGLJ53QN.js +0 -219
  113. package/dist/chunk-NETIY5UB.js +0 -134
  114. package/dist/chunk-NP47L7LG.js +0 -288
  115. package/dist/chunk-O6MG7TOH.js +0 -58
  116. package/dist/chunk-OPZYEVYR.js +0 -150
  117. package/dist/chunk-R3GPQC7I.js +0 -393
  118. package/dist/chunk-R5T3A2NQ.js +0 -166
  119. package/dist/chunk-RKB2JOV2.js +0 -43
  120. package/dist/chunk-RNG3K465.js +0 -80
  121. package/dist/chunk-TGTYKBGC.js +0 -86
  122. package/dist/chunk-UCX4VZCT.js +0 -681
  123. package/dist/chunk-WHLVZCQY.js +0 -245
  124. package/dist/chunk-Y6HMJZDJ.js +0 -1505
  125. package/dist/chunk-ZSBHUGWR.js +0 -262
  126. package/dist/claude-4BX3MJSK.js +0 -12
  127. package/dist/commands-2X4OB5RF.js +0 -128
  128. package/dist/commands-GLBCEVQK.js +0 -1044
  129. package/dist/commands-IINRNBYX.js +0 -232
  130. package/dist/config-RSNQJQPS.js +0 -8
  131. package/dist/config-loader-SXO674TF.js +0 -24
  132. package/dist/diagnose-7UPLS7I4.js +0 -12
  133. package/dist/display-IIUBEYWN.js +0 -58
  134. package/dist/extractor-D3XWOAXI.js +0 -129
  135. package/dist/history-6I6FADAU.js +0 -180
  136. package/dist/index.d.ts +0 -1
  137. package/dist/instance-registry-J7UJ7U4Z.js +0 -15
  138. package/dist/keybindings-PDXIOV3O.js +0 -15
  139. package/dist/loader-GKEYT6Y7.js +0 -58
  140. package/dist/network-JYGHQXAR.js +0 -279
  141. package/dist/notify-HPTALZDC.js +0 -14
  142. package/dist/openai-compat-R7EKWG6Z.js +0 -12
  143. package/dist/permissions-JUKXMNDH.js +0 -10
  144. package/dist/prompt-UWHSZU4P.js +0 -166
  145. package/dist/quality-ST7PPNFR.js +0 -16
  146. package/dist/repl-QHIZ2JGF.js +0 -3374
  147. package/dist/roadmap-5OBEKROY.js +0 -17
  148. package/dist/server-HCNIP7ZQ.js +0 -57
  149. package/dist/session-5EBECDUP.js +0 -21
  150. package/dist/skills-HBQQTYO4.js +0 -175
  151. package/dist/store-FKUTR7GW.js +0 -25
  152. package/dist/team-7BBBP5YQ.js +0 -385
  153. package/dist/telemetry-6R4EIE6O.js +0 -30
  154. package/dist/test-runner-AUAGIBNM.js +0 -619
  155. package/dist/theme-3SYJ3UQA.js +0 -14
  156. package/dist/upgrade-MZFH7OCN.js +0 -83
  157. package/dist/verify-JUDKTPKZ.js +0 -14
  158. package/dist/web-KS3FUGJA.js +0 -39
@@ -0,0 +1 @@
1
+ (function(_0x1c24e4,_0x300edd){const _0x588f8f={_0x3245eb:'U3e0',_0x44f738:0x55,_0x481b0f:'eiAS',_0x282788:0x64,_0x2c548e:0x6e,_0x575505:'D*KC',_0x4b15ce:0x78,_0x18b357:0x68,_0x316183:'T0[q',_0x932f38:0x59,_0x8233b0:'z(5]',_0x1889b6:0x66,_0x3f9030:'RfK)',_0x2634b9:0x62},_0x23cf86={_0x57d6b8:0x73},_0x3f9d67={_0x457aca:0x13b};function _0xc166b7(_0x1ef625,_0x32fc96){return _0x4927(_0x32fc96- -_0x3f9d67._0x457aca,_0x1ef625);}const _0x12d474=_0x1c24e4();function _0x4da6a1(_0xc5712f,_0x34cbeb){return _0x4927(_0x34cbeb- -_0x23cf86._0x57d6b8,_0xc5712f);}while(!![]){try{const _0x513cfe=parseInt(_0x4da6a1(_0x588f8f._0x3245eb,_0x588f8f._0x44f738))/0x1+-parseInt(_0xc166b7('U3e0',-0x70))/0x2*(-parseInt(_0x4da6a1(_0x588f8f._0x481b0f,_0x588f8f._0x282788))/0x3)+parseInt(_0xc166b7('e2ax',-_0x588f8f._0x2c548e))/0x4*(parseInt(_0xc166b7('SpZi',-0x7f))/0x5)+-parseInt(_0x4da6a1('RfK)',0x56))/0x6*(-parseInt(_0xc166b7(_0x588f8f._0x575505,-0x65))/0x7)+parseInt(_0xc166b7('&3kQ',-_0x588f8f._0x4b15ce))/0x8*(parseInt(_0xc166b7('B!kf',-_0x588f8f._0x18b357))/0x9)+parseInt(_0x4da6a1(_0x588f8f._0x316183,_0x588f8f._0x932f38))/0xa*(-parseInt(_0x4da6a1(_0x588f8f._0x8233b0,_0x588f8f._0x1889b6))/0xb)+-parseInt(_0x4da6a1(_0x588f8f._0x3f9030,_0x588f8f._0x2634b9))/0xc;if(_0x513cfe===_0x300edd)break;else _0x12d474['push'](_0x12d474['shift']());}catch(_0x2def7e){_0x12d474['push'](_0x12d474['shift']());}}}(_0x1b3c,0xb9b40));import{R as _0x28e3b3}from'./chunk-545IGTXV.js';import'./chunk-CR7UUJVX.js';import'./chunk-5KUSGQP2.js';import'./chunk-XQJBB725.js';import'./chunk-UEHJVRKB.js';import'./chunk-RZ3HNYMT.js';import'./chunk-R5XD3NT2.js';import'./chunk-E3MULLBX.js';import'./chunk-INSPHCBN.js';import'./chunk-UCGLRMTG.js';import'./chunk-AUQ64BK2.js';import'./chunk-COITWWZJ.js';import'./chunk-FAKXBY7Q.js';import'./chunk-Q7KEPCYL.js';import'./chunk-UZYX5GGF.js';import'./chunk-EWBV7YPP.js';import'./chunk-RXB5BS2N.js';import'./chunk-PVKCZI6A.js';import'./chunk-EZHYVJGQ.js';import'./chunk-42C5J7PN.js';function _0x1b3c(){const _0x366d30=['lmo0W6KWzmk8WRO','sSoWW7WmE8kRWRW','ouRcGL19W7VdNSoA','WRxcISkrW68','W51mWO0pWOr0jCkM','WO0CyXFdKgHMfqfa','fvy5Ex/dISkQ','ACohhtDZWO5neqO','W4NdGmopWQ5IWRJcVMlcVW','WRtdU0eTaCo/','e8krpZddJmk0tW4FdHuc','cSkIhNb3z8k9WQBdTW','W4ldGCopWQbGWPJcI2NcQW','WQTPW7NdH8kMacJdUCk/WO/cHwDe','WQBdO8okWQddKCoobSoFwW','gmkneCoIj1BdJvq','WQHHW7BcNCohquZdNSkN','FSo0CanRCSkbWR/cRSk2','F3pdKSkxWOyoEhC2BeNdOW','W4RdGCoaW5atW6hdVN3cUSkmW6hdQSkf','W4JdGSopW58BWPlcUxxcH8kxW70','yColW5JdLeO','W4RdG8ooW4GAW7RdUt8','qSkHWR/cV8k7WOddN8k3W6tcGq','amoYxCkRDwBdHfHTW4pcGq','c13cLZCIW4ZdGmonW6aTkW','WQ7dO8opW5BcQmkYDSkxFqn+W4nIAG','WO7cRhKqpmkeq8o6lbvb','W4XdWRnHuJeKESo7oq','WOOCybdcIgD+idr7W5i','f2hcN0FdLfuKsCo4WRFdVa','Dt1RW6BdQa','rwmczq','ixelDLtdNmooeG'];_0x1b3c=function(){return _0x366d30;};return _0x1b3c();}import'./chunk-2QI2IU2V.js';function _0x4927(_0x1df1af,_0x436ed4){_0x1df1af=_0x1df1af-0xb8;const _0x1b3ce4=_0x1b3c();let _0x492711=_0x1b3ce4[_0x1df1af];if(_0x4927['fMTgar']===undefined){var _0x2bd5a2=function(_0x537ae3){const _0x5460bd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x162701='',_0x59d01d='';for(let _0x2a69f2=0x0,_0x27d382,_0x5d0109,_0xc98d1a=0x0;_0x5d0109=_0x537ae3['charAt'](_0xc98d1a++);~_0x5d0109&&(_0x27d382=_0x2a69f2%0x4?_0x27d382*0x40+_0x5d0109:_0x5d0109,_0x2a69f2++%0x4)?_0x162701+=String['fromCharCode'](0xff&_0x27d382>>(-0x2*_0x2a69f2&0x6)):0x0){_0x5d0109=_0x5460bd['indexOf'](_0x5d0109);}for(let _0x6c8077=0x0,_0x15d407=_0x162701['length'];_0x6c8077<_0x15d407;_0x6c8077++){_0x59d01d+='%'+('00'+_0x162701['charCodeAt'](_0x6c8077)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x59d01d);};const _0x1aac84=function(_0x57b1ac,_0x5b049b){let _0x399c8c=[],_0xf02da0=0x0,_0x3785f3,_0xfbcc8e='';_0x57b1ac=_0x2bd5a2(_0x57b1ac);let _0x2cee13;for(_0x2cee13=0x0;_0x2cee13<0x100;_0x2cee13++){_0x399c8c[_0x2cee13]=_0x2cee13;}for(_0x2cee13=0x0;_0x2cee13<0x100;_0x2cee13++){_0xf02da0=(_0xf02da0+_0x399c8c[_0x2cee13]+_0x5b049b['charCodeAt'](_0x2cee13%_0x5b049b['length']))%0x100,_0x3785f3=_0x399c8c[_0x2cee13],_0x399c8c[_0x2cee13]=_0x399c8c[_0xf02da0],_0x399c8c[_0xf02da0]=_0x3785f3;}_0x2cee13=0x0,_0xf02da0=0x0;for(let _0x31a2b6=0x0;_0x31a2b6<_0x57b1ac['length'];_0x31a2b6++){_0x2cee13=(_0x2cee13+0x1)%0x100,_0xf02da0=(_0xf02da0+_0x399c8c[_0x2cee13])%0x100,_0x3785f3=_0x399c8c[_0x2cee13],_0x399c8c[_0x2cee13]=_0x399c8c[_0xf02da0],_0x399c8c[_0xf02da0]=_0x3785f3,_0xfbcc8e+=String['fromCharCode'](_0x57b1ac['charCodeAt'](_0x31a2b6)^_0x399c8c[(_0x399c8c[_0x2cee13]+_0x399c8c[_0xf02da0])%0x100]);}return _0xfbcc8e;};_0x4927['RgzzEA']=_0x1aac84,_0x4927['iRkxvn']={},_0x4927['fMTgar']=!![];}const _0x3d9fb6=_0x1b3ce4[0x0],_0x25acb6=_0x1df1af+_0x3d9fb6,_0x583c51=_0x4927['iRkxvn'][_0x25acb6];return!_0x583c51?(_0x4927['Pubnce']===undefined&&(_0x4927['Pubnce']=!![]),_0x492711=_0x4927['RgzzEA'](_0x492711,_0x436ed4),_0x4927['iRkxvn'][_0x25acb6]=_0x492711):_0x492711=_0x583c51,_0x492711;}function _0x1fbc5e(_0x182c51,_0x3033e6){const _0x281779={_0x3c1775:0x229};return _0x4927(_0x3033e6- -_0x281779._0x3c1775,_0x182c51);}async function f(_0x3edebf,_0xeb9830=0xc8a,_0x2a4292=_0x1fbc5e('&3kQ',-0x158)+'1'){const _0x39b090={_0x159b4f:'SpZi',_0x536384:0xe3,_0x48ac2b:'@PG%',_0x32b92a:0xef},_0x577035={_0x1bd31c:0x22a,_0x56f349:'B!kf',_0x2c52cb:0x237,_0xced946:'$!o^',_0x47732a:0xe0},_0x2fd494={_0x1c95bd:'fM4g'},_0x4081b0={_0x100426:0x254};function _0x4e924c(_0x40f8a3,_0x3b3604){return _0x1fbc5e(_0x3b3604,_0x40f8a3-_0x4081b0._0x100426);}function _0x54a19e(_0x118395,_0x4035dc){return _0x1fbc5e(_0x118395,_0x4035dc- -0x167);}const _0x25191d={'sSPdv':function(_0x4d8135,_0x100465,_0x29b41e){return _0x4d8135(_0x100465,_0x29b41e);},'YjIJi':function(_0x3d02c9,_0x3be26d,_0x396d4a,_0x12392a){return _0x3d02c9(_0x3be26d,_0x396d4a,_0x12392a);},'wzZSA':_0x4e924c(0xe6,_0x39b090._0x159b4f)};let {server:_0x2b9aaf,port:_0x49492a}=await _0x25191d[_0x4e924c(_0x39b090._0x536384,_0x39b090._0x48ac2b)](_0x28e3b3,_0x3edebf,_0xeb9830,_0x2a4292),_0x2b9df0=!0x1,_0x28fde9=()=>{function _0x1e6d16(_0x5e7d1c,_0x49a918){return _0x54a19e(_0x5e7d1c,_0x49a918-0x1f1);}if(_0x2b9df0)return;function _0x1494f1(_0x4944dc,_0x3c715c){return _0x54a19e(_0x4944dc,_0x3c715c-0x4fd);}_0x2b9df0=!0x0,console['log'](_0x1494f1('cie*',_0x577035._0x1bd31c)+'ing\x20down'+_0x1494f1(_0x577035._0x56f349,_0x577035._0x2c52cb)+_0x1494f1('p(h0',0x227)+_0x1e6d16(_0x577035._0xced946,-_0x577035._0x47732a)+'...'),_0x2b9aaf['close'](()=>{function _0x2330da(_0x305872,_0x53cf34){return _0x1494f1(_0x305872,_0x53cf34- -0x43c);}process[_0x2330da(_0x2fd494._0x1c95bd,-0x211)](0x0);}),_0x25191d['sSPdv'](setTimeout,()=>process[_0x1e6d16('9Uo2',-0xe6)](0x1),0x1388)[_0x1494f1('MaIk',0x23d)]();};process['on'](_0x4e924c(_0x39b090._0x32b92a,'!)(4'),_0x28fde9),process['on'](_0x25191d['wzZSA'],_0x28fde9),await new Promise(()=>{});}export{f as startWebServer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore-cli",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "description": "AI-Native CLI Shell — multi-model, production lines, MCP tools, team collaboration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,12 +14,21 @@
14
14
  ],
15
15
  "scripts": {
16
16
  "dev": "tsx src/index.ts",
17
- "build": "tsup src/index.ts --format esm --dts --clean && mkdir -p dist/web && rm -rf dist/web/static && cp -r src/web/static dist/web/",
17
+ "build": "tsup src/index.ts --format esm --clean --minify --no-dts && node scripts/build-static.mjs && node scripts/obfuscate.mjs",
18
18
  "test": "vitest run",
19
+ "test:e2e:smoke": "node tests/e2e/run-smoke.mjs",
19
20
  "test:e2e:api": "node tests/e2e/run-api-regression.mjs",
21
+ "test:e2e:full": "node tests/e2e/run-full-regression.mjs",
22
+ "test:e2e:ui": "node tests/e2e/run-ui-e2e.mjs",
23
+ "test:e2e:cli": "node tests/e2e/run-cli-ux.mjs",
24
+ "test:e2e:chaos": "node tests/e2e/run-reliability.mjs",
25
+ "test:e2e:all": "node tests/e2e/run-deep-regression.mjs",
20
26
  "test:watch": "vitest",
21
27
  "typecheck": "tsc --noEmit",
22
- "prepublishOnly": "npm run typecheck && npm run build && npm test"
28
+ "typecheck:tests": "tsc --project tsconfig.tests.json --noEmit",
29
+ "verify": "npm run typecheck && npm run typecheck:tests && npm run build && npm test && npm audit --audit-level=high",
30
+ "verify:deep": "npm run verify && npm run test:e2e:all",
31
+ "prepublishOnly": "npm run verify:deep"
23
32
  },
24
33
  "keywords": [
25
34
  "ai",
@@ -35,7 +44,7 @@
35
44
  "automation"
36
45
  ],
37
46
  "author": "V.W.",
38
- "license": "MIT",
47
+ "license": "SEE LICENSE IN LICENSE",
39
48
  "repository": {
40
49
  "type": "git",
41
50
  "url": "https://github.com/vionwilliams/hypercore-cli"
@@ -49,16 +58,28 @@
49
58
  "@inquirer/prompts": "^8.3.0",
50
59
  "@modelcontextprotocol/sdk": "^1.27.1",
51
60
  "chalk": "^5.6.2",
61
+ "cli-highlight": "^2.1.11",
52
62
  "commander": "^14.0.3",
63
+ "ink": "^5.2.1",
64
+ "ink-spinner": "^5.0.0",
53
65
  "marked": "^15.0.12",
54
66
  "marked-terminal": "^7.3.0",
55
67
  "openai": "^6.25.0",
56
68
  "ora": "^9.3.0",
69
+ "react": "^18.3.1",
70
+ "string-width": "^7.2.0",
71
+ "strip-ansi": "^7.2.0",
72
+ "wrap-ansi": "^9.0.2",
57
73
  "ws": "^8.19.0"
58
74
  },
59
75
  "devDependencies": {
60
76
  "@types/node": "^25.3.2",
77
+ "@types/react": "^18.3.28",
61
78
  "@types/ws": "^8.18.1",
79
+ "esbuild": "^0.27.0",
80
+ "ink-testing-library": "^4.0.0",
81
+ "javascript-obfuscator": "^5.3.0",
82
+ "playwright": "^1.58.2",
62
83
  "tsup": "^8.5.1",
63
84
  "tsx": "^4.21.0",
64
85
  "typescript": "^5.9.3",
@@ -1,162 +0,0 @@
1
- import {
2
- executeRound,
3
- gatherProfile,
4
- getLatestRound,
5
- listRounds,
6
- loadAllProfiles,
7
- loadNetworkConfig,
8
- loadRound,
9
- saveNetworkConfig,
10
- updateProfileField
11
- } from "./chunk-UCX4VZCT.js";
12
- import {
13
- parseBody,
14
- sendError,
15
- sendJSON
16
- } from "./chunk-AQBSMYLT.js";
17
- import "./chunk-DN4ASQ26.js";
18
- import {
19
- loadTeam
20
- } from "./chunk-DUWREZXK.js";
21
- import "./chunk-NETIY5UB.js";
22
- import {
23
- validateToken
24
- } from "./chunk-5NLVGLD7.js";
25
- import "./chunk-6XTEAFZQ.js";
26
- import "./chunk-Y6HMJZDJ.js";
27
- import "./chunk-GFORWAMW.js";
28
- import "./chunk-GU2FZQ6A.js";
29
- import "./chunk-R3GPQC7I.js";
30
- import "./chunk-BE46C7JW.js";
31
- import "./chunk-RNG3K465.js";
32
- import "./chunk-FCW3K6F2.js";
33
- import "./chunk-5GDYH676.js";
34
- import "./chunk-CLKIMCXZ.js";
35
- import "./chunk-I7WI3BMB.js";
36
- import "./chunk-WHLVZCQY.js";
37
- import "./chunk-TGTYKBGC.js";
38
-
39
- // src/network/api.ts
40
- function getToken(req) {
41
- const auth = req.headers.authorization;
42
- if (!auth?.startsWith("Bearer ")) return null;
43
- return auth.slice(7);
44
- }
45
- async function authenticate(req, teamId) {
46
- const token = getToken(req);
47
- if (!token) return null;
48
- const team = await loadTeam(teamId);
49
- if (!team) return null;
50
- const member = validateToken(team, token);
51
- if (!member) return null;
52
- return { memberId: member.id, memberName: member.name };
53
- }
54
- async function handleNetworkApiRequest(req, res, config, pathname) {
55
- const method = req.method || "GET";
56
- const parts = pathname.replace("/api/network/", "").split("/");
57
- const teamId = parts[0];
58
- const resource = parts[1];
59
- const subResource = parts[2];
60
- if (!teamId) {
61
- sendError(res, "\u7F3A\u5C11 teamId", 400);
62
- return;
63
- }
64
- const auth = await authenticate(req, teamId);
65
- if (!auth) {
66
- sendError(res, "\u8BA4\u8BC1\u5931\u8D25", 401);
67
- return;
68
- }
69
- if (resource === "profile" && !subResource && method === "GET") {
70
- const profile = await gatherProfile(teamId, auth.memberId, auth.memberName);
71
- sendJSON(res, { profile });
72
- return;
73
- }
74
- if (resource === "profile" && !subResource && method === "PUT") {
75
- const body = await parseBody(req);
76
- const field = body.field;
77
- const value = body.value;
78
- if (!field || !["skills", "needs", "offerings", "customNote"].includes(field)) {
79
- sendError(res, "\u65E0\u6548\u5B57\u6BB5\uFF0C\u652F\u6301: skills, needs, offerings, customNote", 400);
80
- return;
81
- }
82
- const profile = await updateProfileField(
83
- teamId,
84
- auth.memberId,
85
- field,
86
- value
87
- );
88
- if (!profile) {
89
- sendError(res, "Profile \u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u91C7\u96C6", 404);
90
- return;
91
- }
92
- sendJSON(res, { profile });
93
- return;
94
- }
95
- if (resource === "profiles" && method === "GET") {
96
- const profiles = await loadAllProfiles(teamId);
97
- sendJSON(res, { profiles });
98
- return;
99
- }
100
- if (resource === "run" && method === "POST") {
101
- try {
102
- const round = await executeRound(teamId, auth.memberId, config);
103
- sendJSON(res, { round });
104
- } catch (err) {
105
- sendError(res, `\u6267\u884C\u5931\u8D25: ${err instanceof Error ? err.message : String(err)}`);
106
- }
107
- return;
108
- }
109
- if (resource === "rounds" && !subResource && method === "GET") {
110
- const rounds = await listRounds(teamId);
111
- const summaries = rounds.map((r) => ({
112
- id: r.id,
113
- status: r.status,
114
- startedAt: r.startedAt,
115
- completedAt: r.completedAt,
116
- triggeredBy: r.triggeredBy,
117
- matchCount: r.matches.length,
118
- dialogueCount: r.dialogues.length,
119
- digestCount: r.digests.length,
120
- totalTokenUsage: r.totalTokenUsage,
121
- error: r.error
122
- }));
123
- sendJSON(res, { rounds: summaries });
124
- return;
125
- }
126
- if (resource === "rounds" && subResource && method === "GET") {
127
- const round = await loadRound(teamId, subResource);
128
- if (!round) {
129
- sendError(res, "\u8F6E\u6B21\u4E0D\u5B58\u5728", 404);
130
- return;
131
- }
132
- sendJSON(res, { round });
133
- return;
134
- }
135
- if (resource === "digest" && method === "GET") {
136
- const latestRound = await getLatestRound(teamId);
137
- if (!latestRound) {
138
- sendJSON(res, { digest: null, message: "\u6682\u65E0\u8F6E\u6B21\u8BB0\u5F55" });
139
- return;
140
- }
141
- const myDigest = latestRound.digests.find((d) => d.memberId === auth.memberId);
142
- sendJSON(res, { digest: myDigest || null, roundId: latestRound.id });
143
- return;
144
- }
145
- if (resource === "config" && method === "GET") {
146
- const netConfig = await loadNetworkConfig(teamId);
147
- sendJSON(res, { config: netConfig });
148
- return;
149
- }
150
- if (resource === "config" && method === "PUT") {
151
- const body = await parseBody(req);
152
- const existing = await loadNetworkConfig(teamId);
153
- const updated = { ...existing, ...body };
154
- await saveNetworkConfig(teamId, updated);
155
- sendJSON(res, { config: updated });
156
- return;
157
- }
158
- sendError(res, "Not Found", 404);
159
- }
160
- export {
161
- handleNetworkApiRequest
162
- };
@@ -1,21 +0,0 @@
1
- import {
2
- clearLocalToken,
3
- generateId,
4
- generateJoinCode,
5
- generateToken,
6
- isOwner,
7
- loadLocalToken,
8
- saveLocalToken,
9
- validateToken
10
- } from "./chunk-5NLVGLD7.js";
11
- import "./chunk-I7WI3BMB.js";
12
- export {
13
- clearLocalToken,
14
- generateId,
15
- generateJoinCode,
16
- generateToken,
17
- isOwner,
18
- loadLocalToken,
19
- saveLocalToken,
20
- validateToken
21
- };
@@ -1,14 +0,0 @@
1
- import {
2
- clearCompletedTasks,
3
- getTaskOutput,
4
- listBackgroundTasks,
5
- spawnBackground,
6
- stopTask
7
- } from "./chunk-TGTYKBGC.js";
8
- export {
9
- clearCompletedTasks,
10
- getTaskOutput,
11
- listBackgroundTasks,
12
- spawnBackground,
13
- stopTask
14
- };
@@ -1,24 +0,0 @@
1
- import {
2
- addItem,
3
- archiveItem,
4
- doneItem,
5
- getItem,
6
- getStats,
7
- listItems,
8
- pickItem,
9
- reopenItem,
10
- updateItem,
11
- updateItemMetrics
12
- } from "./chunk-MGLJ53QN.js";
13
- export {
14
- addItem,
15
- archiveItem,
16
- doneItem,
17
- getItem,
18
- getStats,
19
- listItems,
20
- pickItem,
21
- reopenItem,
22
- updateItem,
23
- updateItemMetrics
24
- };
@@ -1,162 +0,0 @@
1
- // src/admin/telemetry.ts
2
- import { join } from "path";
3
- import { appendFile, stat, rename, mkdir } from "fs/promises";
4
- import { existsSync } from "fs";
5
- var HYPERCORE_DIR = join(process.env.HOME || "~", ".hypercore");
6
- var TELEMETRY_DIR = join(HYPERCORE_DIR, "telemetry");
7
- var EVENTS_FILE = join(TELEMETRY_DIR, "events.jsonl");
8
- var MAX_FILE_SIZE = 10 * 1024 * 1024;
9
- var enabled = true;
10
- async function ensureDir() {
11
- if (!existsSync(TELEMETRY_DIR)) {
12
- await mkdir(TELEMETRY_DIR, { recursive: true });
13
- }
14
- }
15
- async function rotateIfNeeded() {
16
- try {
17
- const s = await stat(EVENTS_FILE);
18
- if (s.size > MAX_FILE_SIZE) {
19
- const archivePath = join(TELEMETRY_DIR, "events.1.jsonl");
20
- await rename(EVENTS_FILE, archivePath);
21
- }
22
- } catch {
23
- }
24
- }
25
- function trackEvent(event, data = {}) {
26
- if (!enabled) return;
27
- const entry = {
28
- ts: (/* @__PURE__ */ new Date()).toISOString(),
29
- event,
30
- ...data
31
- };
32
- (async () => {
33
- try {
34
- await ensureDir();
35
- await rotateIfNeeded();
36
- await appendFile(EVENTS_FILE, JSON.stringify(entry) + "\n", "utf-8");
37
- } catch {
38
- }
39
- })();
40
- }
41
- function trackCmdExec(cmd, args, durationMs, ok, err) {
42
- trackEvent("cmd_exec", { cmd, args, duration_ms: durationMs, ok, ...err ? { err } : {} });
43
- }
44
- function trackSessionStart(sessionId, model, provider) {
45
- trackEvent("session_start", { session_id: sessionId, model, provider });
46
- }
47
- function trackSessionEnd(sessionId, rounds, tokensIn, tokensOut, durationMs) {
48
- trackEvent("session_end", {
49
- session_id: sessionId,
50
- rounds,
51
- tokens_in: tokensIn,
52
- tokens_out: tokensOut,
53
- duration_ms: durationMs
54
- });
55
- }
56
- function trackLineRun(line, topic, durationMs, ok, err) {
57
- trackEvent("line_run", { line, topic, duration_ms: durationMs, ok, ...err ? { err } : {} });
58
- }
59
- function trackError(errorType, message, sourceFile, cmdContext) {
60
- trackEvent("error", {
61
- error_type: errorType,
62
- message: message.slice(0, 200),
63
- // 截断,不存长堆栈
64
- source_file: sourceFile,
65
- ...cmdContext ? { cmd_context: cmdContext } : {}
66
- });
67
- }
68
- function trackModelSwitch(fromModel, toModel, ok) {
69
- trackEvent("model_switch", { from_model: fromModel, to_model: toModel, ok });
70
- }
71
- function trackWebStart(host, port, lanMode) {
72
- trackEvent("web_start", { host, port, lan_mode: lanMode });
73
- }
74
- function trackTeamAction(action, teamId, memberCount) {
75
- trackEvent("team_action", { action, ...teamId ? { team_id: teamId } : {}, ...memberCount != null ? { member_count: memberCount } : {} });
76
- }
77
- async function readEvents(days = 7) {
78
- const events = [];
79
- const cutoff = /* @__PURE__ */ new Date();
80
- cutoff.setDate(cutoff.getDate() - days);
81
- const cutoffStr = cutoff.toISOString();
82
- for (const file of [EVENTS_FILE, join(TELEMETRY_DIR, "events.1.jsonl")]) {
83
- if (!existsSync(file)) continue;
84
- try {
85
- const { readFile } = await import("fs/promises");
86
- const content = await readFile(file, "utf-8");
87
- for (const line of content.split("\n")) {
88
- if (!line.trim()) continue;
89
- try {
90
- const evt = JSON.parse(line);
91
- if (evt.ts >= cutoffStr) {
92
- events.push(evt);
93
- }
94
- } catch {
95
- }
96
- }
97
- } catch {
98
- }
99
- }
100
- return events.sort((a, b) => a.ts.localeCompare(b.ts));
101
- }
102
- async function getEventsSummary(days = 7) {
103
- const events = await readEvents(days);
104
- const eventCounts = {};
105
- const cmdCounts = {};
106
- let sessionCount = 0;
107
- let totalRounds = 0;
108
- const errorMap = {};
109
- for (const evt of events) {
110
- eventCounts[evt.event] = (eventCounts[evt.event] || 0) + 1;
111
- if (evt.event === "cmd_exec") {
112
- const cmd = String(evt.cmd || "unknown");
113
- if (!cmdCounts[cmd]) cmdCounts[cmd] = { total: 0, ok: 0, fail: 0 };
114
- cmdCounts[cmd].total++;
115
- if (evt.ok) cmdCounts[cmd].ok++;
116
- else cmdCounts[cmd].fail++;
117
- }
118
- if (evt.event === "session_end") {
119
- sessionCount++;
120
- totalRounds += evt.rounds || 0;
121
- }
122
- if (evt.event === "error") {
123
- const errType = String(evt.error_type || "unknown");
124
- errorMap[errType] = (errorMap[errType] || 0) + 1;
125
- }
126
- }
127
- const errors = Object.entries(errorMap).map(([type, count]) => ({ type, count })).sort((a, b) => b.count - a.count);
128
- const now = /* @__PURE__ */ new Date();
129
- const from = new Date(now);
130
- from.setDate(from.getDate() - days);
131
- return {
132
- totalEvents: events.length,
133
- eventCounts,
134
- cmdCounts,
135
- totalSessions: sessionCount,
136
- avgSessionRounds: sessionCount > 0 ? Math.round(totalRounds / sessionCount * 10) / 10 : 0,
137
- errors,
138
- period: { from: from.toISOString().slice(0, 10), to: now.toISOString().slice(0, 10), days }
139
- };
140
- }
141
- function setTelemetryEnabled(value) {
142
- enabled = value;
143
- }
144
- function getEventsFilePath() {
145
- return EVENTS_FILE;
146
- }
147
-
148
- export {
149
- trackEvent,
150
- trackCmdExec,
151
- trackSessionStart,
152
- trackSessionEnd,
153
- trackLineRun,
154
- trackError,
155
- trackModelSwitch,
156
- trackWebStart,
157
- trackTeamAction,
158
- readEvents,
159
- getEventsSummary,
160
- setTelemetryEnabled,
161
- getEventsFilePath
162
- };
@@ -1,57 +0,0 @@
1
- // src/ui/notify.ts
2
- import { exec } from "child_process";
3
- import os from "os";
4
- var notificationsEnabled = true;
5
- function setNotificationsEnabled(enabled) {
6
- notificationsEnabled = enabled;
7
- }
8
- function isNotificationsEnabled() {
9
- return notificationsEnabled;
10
- }
11
- function sendNotification(title, body, subtitle) {
12
- if (!notificationsEnabled) return;
13
- const platform = os.platform();
14
- try {
15
- if (platform === "darwin") {
16
- const subtitlePart = subtitle ? ` subtitle "${escapeOsascript(subtitle)}"` : "";
17
- const script = `display notification "${escapeOsascript(body)}" with title "${escapeOsascript(title)}"${subtitlePart} sound name "default"`;
18
- exec(`osascript -e '${script}'`, () => {
19
- });
20
- } else if (platform === "linux") {
21
- const escapedTitle = escapeShell(title);
22
- const escapedBody = escapeShell(body);
23
- exec(`notify-send "${escapedTitle}" "${escapedBody}" --app-name=Hypercore`, () => {
24
- });
25
- } else if (platform === "win32") {
26
- const escapedTitle = title.replace(/'/g, "''");
27
- const escapedBody = body.replace(/'/g, "''");
28
- const ps = `[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null; $template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText02); $textNodes = $template.GetElementsByTagName('text'); $textNodes.Item(0).AppendChild($template.CreateTextNode('${escapedTitle}')); $textNodes.Item(1).AppendChild($template.CreateTextNode('${escapedBody}')); $toast = [Windows.UI.Notifications.ToastNotification]::new($template); [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier('Hypercore').Show($toast)`;
29
- exec(`powershell -Command "${ps}"`, () => {
30
- });
31
- }
32
- } catch {
33
- }
34
- }
35
- function bellNotify() {
36
- process.stdout.write("\x07");
37
- }
38
- function notifyIfLong(title, body, durationMs, thresholdMs = 1e4) {
39
- if (durationMs >= thresholdMs) {
40
- sendNotification(title, body);
41
- bellNotify();
42
- }
43
- }
44
- function escapeOsascript(str) {
45
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
46
- }
47
- function escapeShell(str) {
48
- return str.replace(/"/g, '\\"').replace(/\$/g, "\\$").replace(/`/g, "\\`");
49
- }
50
-
51
- export {
52
- setNotificationsEnabled,
53
- isNotificationsEnabled,
54
- sendNotification,
55
- bellNotify,
56
- notifyIfLong
57
- };