@shareai-lab/kode 2.0.1 → 2.0.3

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 (343) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +649 -25
  3. package/README.zh-CN.md +579 -0
  4. package/cli-acp.js +3 -17
  5. package/cli.js +5 -7
  6. package/dist/chunks/Doctor-M3J7GRTJ.js +12 -0
  7. package/dist/chunks/LogList-ISWZ6DDD.js +121 -0
  8. package/dist/chunks/LogList-ISWZ6DDD.js.map +7 -0
  9. package/dist/chunks/REPL-RQ6LO6S7.js +56 -0
  10. package/dist/chunks/ResumeConversation-6DMVBEGH.js +56 -0
  11. package/dist/chunks/agentLoader-FCRG3TFJ.js +31 -0
  12. package/dist/{agentsValidate-7LH4HTNR.js → chunks/agentsValidate-PEWMYN4Q.js} +97 -69
  13. package/dist/chunks/agentsValidate-PEWMYN4Q.js.map +7 -0
  14. package/dist/{ask-3NHFFUQG.js → chunks/ask-D7SOHJ6Z.js} +36 -44
  15. package/dist/chunks/ask-D7SOHJ6Z.js.map +7 -0
  16. package/dist/chunks/autoUpdater-CNESBOKO.js +19 -0
  17. package/dist/{chunk-AFFSCMYS.js → chunks/chunk-2JN5MY67.js} +12 -14
  18. package/dist/chunks/chunk-2JN5MY67.js.map +7 -0
  19. package/dist/chunks/chunk-2QONJ5MG.js +14 -0
  20. package/dist/chunks/chunk-2QONJ5MG.js.map +7 -0
  21. package/dist/chunks/chunk-2WEXPKHH.js +903 -0
  22. package/dist/chunks/chunk-2WEXPKHH.js.map +7 -0
  23. package/dist/{chunk-ARZSBOAO.js → chunks/chunk-3BYE3ME6.js} +717 -792
  24. package/dist/chunks/chunk-3BYE3ME6.js.map +7 -0
  25. package/dist/chunks/chunk-3JDNWX7W.js +1264 -0
  26. package/dist/chunks/chunk-3JDNWX7W.js.map +7 -0
  27. package/dist/chunks/chunk-3OEJVB5A.js +906 -0
  28. package/dist/chunks/chunk-3OEJVB5A.js.map +7 -0
  29. package/dist/chunks/chunk-3TNIOEBO.js +369 -0
  30. package/dist/chunks/chunk-3TNIOEBO.js.map +7 -0
  31. package/dist/chunks/chunk-4A46ZXMJ.js +67 -0
  32. package/dist/chunks/chunk-4A46ZXMJ.js.map +7 -0
  33. package/dist/{chunk-UHYRLID6.js → chunks/chunk-4ATBQOFO.js} +107 -55
  34. package/dist/chunks/chunk-4ATBQOFO.js.map +7 -0
  35. package/dist/chunks/chunk-4CRUCZR4.js +0 -0
  36. package/dist/{chunk-YC6LJCDE.js → chunks/chunk-4EO6SIQY.js} +32 -75
  37. package/dist/chunks/chunk-4EO6SIQY.js.map +7 -0
  38. package/dist/chunks/chunk-53M46S5I.js +64 -0
  39. package/dist/chunks/chunk-53M46S5I.js.map +7 -0
  40. package/dist/{chunk-JC6NCUG5.js → chunks/chunk-54KOYG5C.js} +0 -2
  41. package/dist/{chunk-EZXMVTDU.js → chunks/chunk-6BAS4WY6.js} +29 -45
  42. package/dist/chunks/chunk-6BAS4WY6.js.map +7 -0
  43. package/dist/{chunk-3IN27HA5.js → chunks/chunk-6KRRFSDN.js} +4 -6
  44. package/dist/chunks/chunk-6KRRFSDN.js.map +7 -0
  45. package/dist/chunks/chunk-6LJNZK4K.js +39 -0
  46. package/dist/chunks/chunk-6LJNZK4K.js.map +7 -0
  47. package/dist/chunks/chunk-6ZWEOSEI.js +666 -0
  48. package/dist/chunks/chunk-6ZWEOSEI.js.map +7 -0
  49. package/dist/chunks/chunk-77XDJMBP.js +3326 -0
  50. package/dist/chunks/chunk-77XDJMBP.js.map +7 -0
  51. package/dist/chunks/chunk-7RRW4NTB.js +6454 -0
  52. package/dist/chunks/chunk-7RRW4NTB.js.map +7 -0
  53. package/dist/chunks/chunk-7X3TW4JB.js +4520 -0
  54. package/dist/chunks/chunk-7X3TW4JB.js.map +7 -0
  55. package/dist/chunks/chunk-B3MW3YGY.js +1409 -0
  56. package/dist/chunks/chunk-B3MW3YGY.js.map +7 -0
  57. package/dist/chunks/chunk-BBJFHTBC.js +28 -0
  58. package/dist/chunks/chunk-BBJFHTBC.js.map +7 -0
  59. package/dist/chunks/chunk-BHDHXOXB.js +24 -0
  60. package/dist/chunks/chunk-BHDHXOXB.js.map +7 -0
  61. package/dist/{chunk-73WGVYLQ.js → chunks/chunk-BTA7SZ26.js} +152 -223
  62. package/dist/chunks/chunk-BTA7SZ26.js.map +7 -0
  63. package/dist/chunks/chunk-CDGRYGPZ.js +103 -0
  64. package/dist/chunks/chunk-CDGRYGPZ.js.map +7 -0
  65. package/dist/{chunk-S6HRABTA.js → chunks/chunk-CP6E5UG6.js} +1 -4
  66. package/dist/chunks/chunk-CP6E5UG6.js.map +7 -0
  67. package/dist/{chunk-QVLYOPO5.js → chunks/chunk-DQ4JHXMT.js} +462 -424
  68. package/dist/chunks/chunk-DQ4JHXMT.js.map +7 -0
  69. package/dist/chunks/chunk-DXD76CMV.js +208 -0
  70. package/dist/chunks/chunk-DXD76CMV.js.map +7 -0
  71. package/dist/chunks/chunk-GCQCAXJZ.js +0 -0
  72. package/dist/chunks/chunk-GELCZWMB.js +42 -0
  73. package/dist/chunks/chunk-GELCZWMB.js.map +7 -0
  74. package/dist/{chunk-K2CWOTI2.js → chunks/chunk-HJYOH4HC.js} +23 -18
  75. package/dist/chunks/chunk-HJYOH4HC.js.map +7 -0
  76. package/dist/chunks/chunk-HPYNW6TT.js +744 -0
  77. package/dist/chunks/chunk-HPYNW6TT.js.map +7 -0
  78. package/dist/{chunk-RZWOUA25.js → chunks/chunk-HRJ3ICQK.js} +59 -55
  79. package/dist/chunks/chunk-HRJ3ICQK.js.map +7 -0
  80. package/dist/{chunk-DZE5YA7L.js → chunks/chunk-IFCIADS3.js} +571 -573
  81. package/dist/chunks/chunk-IFCIADS3.js.map +7 -0
  82. package/dist/chunks/chunk-IN7XZ7BC.js +27 -0
  83. package/dist/chunks/chunk-IN7XZ7BC.js.map +7 -0
  84. package/dist/chunks/chunk-L7P4M4KW.js +193 -0
  85. package/dist/chunks/chunk-L7P4M4KW.js.map +7 -0
  86. package/dist/chunks/chunk-LB6TCPDI.js +0 -0
  87. package/dist/{chunk-3RUXVV4S.js → chunks/chunk-LOCXPQNJ.js} +1 -4
  88. package/dist/{chunk-3RUXVV4S.js.map → chunks/chunk-LOCXPQNJ.js.map} +2 -2
  89. package/dist/{chunk-7M2YN6TU.js → chunks/chunk-LOD5ZHCI.js} +213 -208
  90. package/dist/chunks/chunk-LOD5ZHCI.js.map +7 -0
  91. package/dist/{chunk-S3J2TLV6.js → chunks/chunk-M7P3QNRU.js} +1 -4
  92. package/dist/{chunk-S3J2TLV6.js.map → chunks/chunk-M7P3QNRU.js.map} +2 -2
  93. package/dist/chunks/chunk-PPHLQVL7.js +4234 -0
  94. package/dist/chunks/chunk-PPHLQVL7.js.map +7 -0
  95. package/dist/{chunk-ABLVTESJ.js → chunks/chunk-QAXE37B5.js} +1 -4
  96. package/dist/chunks/chunk-QAXE37B5.js.map +7 -0
  97. package/dist/chunks/chunk-QHQOBUF6.js +60 -0
  98. package/dist/chunks/chunk-QHQOBUF6.js.map +7 -0
  99. package/dist/{chunk-W7GRKO7Q.js → chunks/chunk-RPJXO7GG.js} +241 -214
  100. package/dist/chunks/chunk-RPJXO7GG.js.map +7 -0
  101. package/dist/{chunk-NPFOMITO.js → chunks/chunk-SWQV4KSY.js} +1 -4
  102. package/dist/{chunk-NPFOMITO.js.map → chunks/chunk-SWQV4KSY.js.map} +2 -2
  103. package/dist/chunks/chunk-SZLAPULP.js +28 -0
  104. package/dist/chunks/chunk-SZLAPULP.js.map +7 -0
  105. package/dist/{chunk-7U7L4NMD.js → chunks/chunk-T7RB5V5J.js} +23 -25
  106. package/dist/chunks/chunk-T7RB5V5J.js.map +7 -0
  107. package/dist/{chunk-HN4E4UUQ.js → chunks/chunk-TI2CTTMA.js} +25 -17
  108. package/dist/chunks/chunk-TI2CTTMA.js.map +7 -0
  109. package/dist/{chunk-ZVDRDPII.js → chunks/chunk-TNGVRTO5.js} +45 -20
  110. package/dist/chunks/chunk-TNGVRTO5.js.map +7 -0
  111. package/dist/chunks/chunk-TNWB3U5Y.js +2077 -0
  112. package/dist/chunks/chunk-TNWB3U5Y.js.map +7 -0
  113. package/dist/chunks/chunk-U2IHWPCU.js +12 -0
  114. package/dist/chunks/chunk-U2IHWPCU.js.map +7 -0
  115. package/dist/{chunk-KAA5BGMQ.js → chunks/chunk-UNOY3VJ2.js} +1 -4
  116. package/dist/{chunk-KAA5BGMQ.js.map → chunks/chunk-UNOY3VJ2.js.map} +2 -2
  117. package/dist/{chunk-MWRSY4X6.js → chunks/chunk-UVDJL6ZZ.js} +97 -58
  118. package/dist/chunks/chunk-UVDJL6ZZ.js.map +7 -0
  119. package/dist/chunks/chunk-VNCW4C2Z.js +13452 -0
  120. package/dist/chunks/chunk-VNCW4C2Z.js.map +7 -0
  121. package/dist/chunks/chunk-W5EGGA44.js +15 -0
  122. package/dist/chunks/chunk-W5EGGA44.js.map +7 -0
  123. package/dist/chunks/chunk-XR2W3MAM.js +1533 -0
  124. package/dist/chunks/chunk-XR2W3MAM.js.map +7 -0
  125. package/dist/{chunk-STSX7GIX.js → chunks/chunk-YIO5EBMQ.js} +423 -377
  126. package/dist/chunks/chunk-YIO5EBMQ.js.map +7 -0
  127. package/dist/chunks/chunk-ZBVLKZ5V.js +1062 -0
  128. package/dist/chunks/chunk-ZBVLKZ5V.js.map +7 -0
  129. package/dist/{chunk-E6YNABER.js → chunks/chunk-ZCLTZIVP.js} +1 -4
  130. package/dist/chunks/chunk-ZCLTZIVP.js.map +7 -0
  131. package/dist/chunks/client-SILZNM5N.js +42 -0
  132. package/dist/{config-RUSD6G5Y.js → chunks/config-25HRTPSP.js} +48 -10
  133. package/dist/chunks/cost-tracker-Z2UZT2J5.js +28 -0
  134. package/dist/{customCommands-TOIJFZAL.js → chunks/customCommands-TYMYZRG5.js} +11 -8
  135. package/dist/chunks/engine-MRVF6FK6.js +39 -0
  136. package/dist/{env-XGKBLU3D.js → chunks/env-TJ5NOBEB.js} +7 -5
  137. package/dist/{kodeAgentSessionId-X6XWQW7B.js → chunks/kodeAgentSessionId-VTNISJ2L.js} +2 -4
  138. package/dist/chunks/kodeAgentSessionLoad-YB2RKBGJ.js +15 -0
  139. package/dist/chunks/kodeAgentSessionResume-DZSIVKVA.js +13 -0
  140. package/dist/chunks/kodeAgentStreamJson-X5PLS2S6.js +11 -0
  141. package/dist/{kodeAgentStreamJsonSession-UGEZJJEB.js → chunks/kodeAgentStreamJsonSession-RDXM4XYF.js} +38 -24
  142. package/dist/chunks/kodeAgentStreamJsonSession-RDXM4XYF.js.map +7 -0
  143. package/dist/{chunk-4RTX4AG4.js → chunks/kodeAgentStructuredStdio-SVGDSB4P.js} +14 -9
  144. package/dist/chunks/kodeAgentStructuredStdio-SVGDSB4P.js.map +7 -0
  145. package/dist/{kodeHooks-QWM36A3D.js → chunks/kodeHooks-RVKYRJHG.js} +11 -9
  146. package/dist/{llm-ZUQC4WYM.js → chunks/llm-62N6T5ZT.js} +1734 -1526
  147. package/dist/chunks/llm-62N6T5ZT.js.map +7 -0
  148. package/dist/chunks/llmLazy-ZUSSE3ZA.js +13 -0
  149. package/dist/{mentionProcessor-EE3XFHCJ.js → chunks/mentionProcessor-RJW5UPJD.js} +46 -16
  150. package/dist/chunks/mentionProcessor-RJW5UPJD.js.map +7 -0
  151. package/dist/{messages-EOYQKPGM.js → chunks/messages-EEWWLPHN.js} +2 -6
  152. package/dist/chunks/model-5TIEKQPD.js +37 -0
  153. package/dist/{openai-RRCWW33N.js → chunks/openai-XXK3YZG4.js} +13 -10
  154. package/dist/{outputStyles-62Q3VH2J.js → chunks/outputStyles-FAJTXN2A.js} +6 -9
  155. package/dist/chunks/permissions-HO7INPWM.js +27 -0
  156. package/dist/{pluginRuntime-6ETCZ2LL.js → chunks/pluginRuntime-C7K5ULK2.js} +31 -48
  157. package/dist/chunks/pluginRuntime-C7K5ULK2.js.map +7 -0
  158. package/dist/chunks/pluginValidation-DAM7WRTC.js +20 -0
  159. package/dist/chunks/registry-XYJXMOA5.js +60 -0
  160. package/dist/chunks/responsesStreaming-JNGE2P3D.js +8 -0
  161. package/dist/chunks/runNonTextPrintMode-SVBLCZQX.js +577 -0
  162. package/dist/chunks/runNonTextPrintMode-SVBLCZQX.js.map +7 -0
  163. package/dist/chunks/server-REXXF5IK.js +46 -0
  164. package/dist/{skillMarketplace-3RXQBVOL.js → chunks/skillMarketplace-N4HVHNST.js} +8 -6
  165. package/dist/chunks/src-OROQIWP3.js +44 -0
  166. package/dist/chunks/src-QXLGGMUW.js +1647 -0
  167. package/dist/chunks/src-QXLGGMUW.js.map +7 -0
  168. package/dist/{cli-DOPVY2CW.js → chunks/src-SSDT6MVP.js} +2659 -3384
  169. package/dist/chunks/src-SSDT6MVP.js.map +7 -0
  170. package/dist/chunks/theme-YBJUIMWK.js +10 -0
  171. package/dist/{toolPermissionContext-65L65VEZ.js → chunks/toolPermissionContext-MOCTRR7N.js} +2 -4
  172. package/dist/chunks/toolPermissionSettings-EV2EJAXL.js +18 -0
  173. package/dist/chunks/toolPermissionSettings-EV2EJAXL.js.map +7 -0
  174. package/dist/chunks/uuid-6577SO6X.js +7 -0
  175. package/dist/chunks/uuid-6577SO6X.js.map +7 -0
  176. package/dist/chunks/webOnlyMode-ALXX7UQY.js +66 -0
  177. package/dist/chunks/webOnlyMode-ALXX7UQY.js.map +7 -0
  178. package/dist/entrypoints/cli.js +10 -0
  179. package/dist/entrypoints/cli.js.map +7 -0
  180. package/dist/entrypoints/daemon.js +10 -0
  181. package/dist/entrypoints/daemon.js.map +7 -0
  182. package/dist/entrypoints/mcp.js +71 -0
  183. package/dist/entrypoints/mcp.js.map +7 -0
  184. package/dist/index.js +6 -7
  185. package/dist/index.js.map +3 -3
  186. package/dist/sdk/client.cjs +391 -0
  187. package/dist/sdk/client.cjs.map +7 -0
  188. package/dist/sdk/client.js +364 -0
  189. package/dist/sdk/client.js.map +7 -0
  190. package/dist/sdk/core.cjs +19932 -0
  191. package/dist/sdk/core.cjs.map +7 -0
  192. package/dist/sdk/core.js +19893 -0
  193. package/dist/sdk/core.js.map +7 -0
  194. package/dist/sdk/daemon-client.cjs +257 -0
  195. package/dist/sdk/daemon-client.cjs.map +7 -0
  196. package/dist/sdk/daemon-client.js +221 -0
  197. package/dist/sdk/daemon-client.js.map +7 -0
  198. package/dist/sdk/protocol.cjs +170 -0
  199. package/dist/sdk/protocol.cjs.map +7 -0
  200. package/dist/sdk/protocol.js +140 -0
  201. package/dist/sdk/protocol.js.map +7 -0
  202. package/dist/sdk/runtime-node.cjs +236 -0
  203. package/dist/sdk/runtime-node.cjs.map +7 -0
  204. package/dist/sdk/runtime-node.js +222 -0
  205. package/dist/sdk/runtime-node.js.map +7 -0
  206. package/dist/sdk/runtime.cjs +17 -0
  207. package/dist/sdk/runtime.cjs.map +7 -0
  208. package/dist/sdk/runtime.js +0 -0
  209. package/dist/sdk/runtime.js.map +7 -0
  210. package/dist/sdk/tools.cjs +30300 -0
  211. package/dist/sdk/tools.cjs.map +7 -0
  212. package/dist/sdk/tools.js +30282 -0
  213. package/dist/sdk/tools.js.map +7 -0
  214. package/dist/webui/assets/index-5hlfByVS.css +1 -0
  215. package/dist/webui/assets/index-BR9lm1lA.js +82 -0
  216. package/dist/webui/index.html +28 -0
  217. package/package.json +93 -22
  218. package/scripts/binary-utils.cjs +12 -4
  219. package/scripts/cli-acp-wrapper.cjs +3 -17
  220. package/scripts/cli-wrapper.cjs +5 -7
  221. package/scripts/postinstall.js +8 -4
  222. package/dist/REPL-CW7AYLVL.js +0 -42
  223. package/dist/acp-VEPJ74LT.js +0 -1357
  224. package/dist/acp-VEPJ74LT.js.map +0 -7
  225. package/dist/agentsValidate-7LH4HTNR.js.map +0 -7
  226. package/dist/ask-3NHFFUQG.js.map +0 -7
  227. package/dist/autoUpdater-ITPIHCOI.js +0 -17
  228. package/dist/chunk-3IN27HA5.js.map +0 -7
  229. package/dist/chunk-4FX3IVPT.js +0 -164
  230. package/dist/chunk-4FX3IVPT.js.map +0 -7
  231. package/dist/chunk-4RTX4AG4.js.map +0 -7
  232. package/dist/chunk-5PDP7R6N.js +0 -515
  233. package/dist/chunk-5PDP7R6N.js.map +0 -7
  234. package/dist/chunk-73WGVYLQ.js.map +0 -7
  235. package/dist/chunk-7M2YN6TU.js.map +0 -7
  236. package/dist/chunk-7U7L4NMD.js.map +0 -7
  237. package/dist/chunk-ABLVTESJ.js.map +0 -7
  238. package/dist/chunk-AFFSCMYS.js.map +0 -7
  239. package/dist/chunk-ARZSBOAO.js.map +0 -7
  240. package/dist/chunk-CIG63V4E.js +0 -72
  241. package/dist/chunk-CIG63V4E.js.map +0 -7
  242. package/dist/chunk-CM3EGTG6.js +0 -1609
  243. package/dist/chunk-CM3EGTG6.js.map +0 -7
  244. package/dist/chunk-DZE5YA7L.js.map +0 -7
  245. package/dist/chunk-E6YNABER.js.map +0 -7
  246. package/dist/chunk-EZXMVTDU.js.map +0 -7
  247. package/dist/chunk-F2SJXUDI.js +0 -148
  248. package/dist/chunk-F2SJXUDI.js.map +0 -7
  249. package/dist/chunk-FC5ZCKBI.js +0 -30167
  250. package/dist/chunk-FC5ZCKBI.js.map +0 -7
  251. package/dist/chunk-HCBELH4J.js +0 -145
  252. package/dist/chunk-HCBELH4J.js.map +0 -7
  253. package/dist/chunk-HN4E4UUQ.js.map +0 -7
  254. package/dist/chunk-IZVMU4S2.js +0 -654
  255. package/dist/chunk-IZVMU4S2.js.map +0 -7
  256. package/dist/chunk-K2CWOTI2.js.map +0 -7
  257. package/dist/chunk-LC4TVOCZ.js +0 -835
  258. package/dist/chunk-LC4TVOCZ.js.map +0 -7
  259. package/dist/chunk-MIW7N2MY.js +0 -2613
  260. package/dist/chunk-MIW7N2MY.js.map +0 -7
  261. package/dist/chunk-MWRSY4X6.js.map +0 -7
  262. package/dist/chunk-ND3XWFO6.js +0 -34
  263. package/dist/chunk-ND3XWFO6.js.map +0 -7
  264. package/dist/chunk-QVLYOPO5.js.map +0 -7
  265. package/dist/chunk-RZWOUA25.js.map +0 -7
  266. package/dist/chunk-S6HRABTA.js.map +0 -7
  267. package/dist/chunk-STSX7GIX.js.map +0 -7
  268. package/dist/chunk-UHYRLID6.js.map +0 -7
  269. package/dist/chunk-UKHTVRJM.js +0 -47
  270. package/dist/chunk-UKHTVRJM.js.map +0 -7
  271. package/dist/chunk-UYXEDKOZ.js +0 -24
  272. package/dist/chunk-UYXEDKOZ.js.map +0 -7
  273. package/dist/chunk-W7GRKO7Q.js.map +0 -7
  274. package/dist/chunk-WVHORZQ5.js +0 -17
  275. package/dist/chunk-WVHORZQ5.js.map +0 -7
  276. package/dist/chunk-WWUWDNWW.js +0 -49
  277. package/dist/chunk-WWUWDNWW.js.map +0 -7
  278. package/dist/chunk-YC6LJCDE.js.map +0 -7
  279. package/dist/chunk-YXYYDIMI.js +0 -2931
  280. package/dist/chunk-YXYYDIMI.js.map +0 -7
  281. package/dist/chunk-ZVDRDPII.js.map +0 -7
  282. package/dist/cli-DOPVY2CW.js.map +0 -7
  283. package/dist/commands-2BF2CJ3A.js +0 -46
  284. package/dist/context-6FXPETYH.js +0 -30
  285. package/dist/costTracker-6SL26FDB.js +0 -19
  286. package/dist/kodeAgentSessionLoad-MITZADPB.js +0 -18
  287. package/dist/kodeAgentSessionResume-GVRWB4WO.js +0 -16
  288. package/dist/kodeAgentStreamJson-NXFN7TXH.js +0 -13
  289. package/dist/kodeAgentStreamJsonSession-UGEZJJEB.js.map +0 -7
  290. package/dist/kodeAgentStructuredStdio-HGWJT7CU.js +0 -10
  291. package/dist/llm-ZUQC4WYM.js.map +0 -7
  292. package/dist/llmLazy-54QQHA54.js +0 -15
  293. package/dist/loader-FYHJQES5.js +0 -28
  294. package/dist/mcp-J332IKT3.js +0 -49
  295. package/dist/mentionProcessor-EE3XFHCJ.js.map +0 -7
  296. package/dist/model-FV3JDJKH.js +0 -30
  297. package/dist/pluginRuntime-6ETCZ2LL.js.map +0 -7
  298. package/dist/pluginValidation-I4YKUWGS.js +0 -17
  299. package/dist/prompts-ZLEKDD77.js +0 -48
  300. package/dist/query-VFRJPBGD.js +0 -50
  301. package/dist/responsesStreaming-AW344PQO.js +0 -10
  302. package/dist/ripgrep-3NTIKQYW.js +0 -17
  303. package/dist/state-P5G6CO5V.js +0 -16
  304. package/dist/theme-3LWP3BG7.js +0 -14
  305. package/dist/toolPermissionSettings-3ROBVTUK.js +0 -18
  306. package/dist/tools-RO7HSSE5.js +0 -47
  307. package/dist/userInput-JSBJRFSK.js +0 -311
  308. package/dist/userInput-JSBJRFSK.js.map +0 -7
  309. package/dist/uuid-QN2CNKKN.js +0 -9
  310. /package/dist/{REPL-CW7AYLVL.js.map → chunks/Doctor-M3J7GRTJ.js.map} +0 -0
  311. /package/dist/{autoUpdater-ITPIHCOI.js.map → chunks/REPL-RQ6LO6S7.js.map} +0 -0
  312. /package/dist/{chunk-JC6NCUG5.js.map → chunks/ResumeConversation-6DMVBEGH.js.map} +0 -0
  313. /package/dist/{commands-2BF2CJ3A.js.map → chunks/agentLoader-FCRG3TFJ.js.map} +0 -0
  314. /package/dist/{config-RUSD6G5Y.js.map → chunks/autoUpdater-CNESBOKO.js.map} +0 -0
  315. /package/dist/{context-6FXPETYH.js.map → chunks/chunk-4CRUCZR4.js.map} +0 -0
  316. /package/dist/{costTracker-6SL26FDB.js.map → chunks/chunk-54KOYG5C.js.map} +0 -0
  317. /package/dist/{customCommands-TOIJFZAL.js.map → chunks/chunk-GCQCAXJZ.js.map} +0 -0
  318. /package/dist/{env-XGKBLU3D.js.map → chunks/chunk-LB6TCPDI.js.map} +0 -0
  319. /package/dist/{kodeAgentSessionId-X6XWQW7B.js.map → chunks/client-SILZNM5N.js.map} +0 -0
  320. /package/dist/{kodeAgentSessionLoad-MITZADPB.js.map → chunks/config-25HRTPSP.js.map} +0 -0
  321. /package/dist/{kodeAgentSessionResume-GVRWB4WO.js.map → chunks/cost-tracker-Z2UZT2J5.js.map} +0 -0
  322. /package/dist/{kodeAgentStreamJson-NXFN7TXH.js.map → chunks/customCommands-TYMYZRG5.js.map} +0 -0
  323. /package/dist/{kodeAgentStructuredStdio-HGWJT7CU.js.map → chunks/engine-MRVF6FK6.js.map} +0 -0
  324. /package/dist/{kodeHooks-QWM36A3D.js.map → chunks/env-TJ5NOBEB.js.map} +0 -0
  325. /package/dist/{llmLazy-54QQHA54.js.map → chunks/kodeAgentSessionId-VTNISJ2L.js.map} +0 -0
  326. /package/dist/{loader-FYHJQES5.js.map → chunks/kodeAgentSessionLoad-YB2RKBGJ.js.map} +0 -0
  327. /package/dist/{mcp-J332IKT3.js.map → chunks/kodeAgentSessionResume-DZSIVKVA.js.map} +0 -0
  328. /package/dist/{messages-EOYQKPGM.js.map → chunks/kodeAgentStreamJson-X5PLS2S6.js.map} +0 -0
  329. /package/dist/{model-FV3JDJKH.js.map → chunks/kodeHooks-RVKYRJHG.js.map} +0 -0
  330. /package/dist/{openai-RRCWW33N.js.map → chunks/llmLazy-ZUSSE3ZA.js.map} +0 -0
  331. /package/dist/{outputStyles-62Q3VH2J.js.map → chunks/messages-EEWWLPHN.js.map} +0 -0
  332. /package/dist/{pluginValidation-I4YKUWGS.js.map → chunks/model-5TIEKQPD.js.map} +0 -0
  333. /package/dist/{prompts-ZLEKDD77.js.map → chunks/openai-XXK3YZG4.js.map} +0 -0
  334. /package/dist/{query-VFRJPBGD.js.map → chunks/outputStyles-FAJTXN2A.js.map} +0 -0
  335. /package/dist/{responsesStreaming-AW344PQO.js.map → chunks/permissions-HO7INPWM.js.map} +0 -0
  336. /package/dist/{ripgrep-3NTIKQYW.js.map → chunks/pluginValidation-DAM7WRTC.js.map} +0 -0
  337. /package/dist/{skillMarketplace-3RXQBVOL.js.map → chunks/registry-XYJXMOA5.js.map} +0 -0
  338. /package/dist/{state-P5G6CO5V.js.map → chunks/responsesStreaming-JNGE2P3D.js.map} +0 -0
  339. /package/dist/{theme-3LWP3BG7.js.map → chunks/server-REXXF5IK.js.map} +0 -0
  340. /package/dist/{toolPermissionContext-65L65VEZ.js.map → chunks/skillMarketplace-N4HVHNST.js.map} +0 -0
  341. /package/dist/{toolPermissionSettings-3ROBVTUK.js.map → chunks/src-OROQIWP3.js.map} +0 -0
  342. /package/dist/{tools-RO7HSSE5.js.map → chunks/theme-YBJUIMWK.js.map} +0 -0
  343. /package/dist/{uuid-QN2CNKKN.js.map → chunks/toolPermissionContext-MOCTRR7N.js.map} +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/services/plugins/customCommands.ts"],
4
- "sourcesContent": ["import { existsSync, readFileSync, readdirSync, statSync } from 'fs'\nimport { basename, dirname, join, relative, resolve, sep } from 'path'\nimport { homedir } from 'os'\nimport { memoize } from 'lodash-es'\nimport type { MessageParam } from '@anthropic-ai/sdk/resources/index.mjs'\nimport type { Command } from '@commands'\nimport { getCwd } from '@utils/state'\nimport { getSessionPlugins } from '@utils/session/sessionPlugins'\nimport { getKodeBaseDir } from '@utils/config/env'\nimport { debug as debugLogger } from '@utils/log/debugLogger'\nimport { logError } from '@utils/log'\nimport { execFile } from 'child_process'\nimport { promisify } from 'util'\nimport matter from 'gray-matter'\nimport yaml from 'js-yaml'\n\nconst execFileAsync = promisify(execFile)\n\nexport async function executeBashCommands(content: string): Promise<string> {\n const bashCommandRegex = /!\\`([^`]+)\\`/g\n const matches = [...content.matchAll(bashCommandRegex)]\n\n if (matches.length === 0) {\n return content\n }\n\n let result = content\n\n for (const match of matches) {\n const fullMatch = match[0]\n const command = match[1].trim()\n\n try {\n const parts = command.split(/\\s+/)\n const cmd = parts[0]\n const args = parts.slice(1)\n\n const { stdout, stderr } = await execFileAsync(cmd, args, {\n timeout: 5000,\n encoding: 'utf8',\n cwd: getCwd(),\n })\n\n const output = stdout.trim() || stderr.trim() || '(no output)'\n result = result.replace(fullMatch, output)\n } catch (error) {\n logError(error)\n debugLogger.warn('CUSTOM_COMMAND_BASH_EXEC_FAILED', {\n command,\n error: error instanceof Error ? error.message : String(error),\n })\n result = result.replace(fullMatch, `(error executing: ${command})`)\n }\n }\n\n return result\n}\n\nexport async function resolveFileReferences(content: string): Promise<string> {\n const fileRefRegex = /@([a-zA-Z0-9/._-]+(?:\\.[a-zA-Z0-9]+)?)/g\n const matches = [...content.matchAll(fileRefRegex)]\n\n if (matches.length === 0) {\n return content\n }\n\n let result = content\n\n for (const match of matches) {\n const fullMatch = match[0]\n const filePath = match[1]\n\n if (filePath.startsWith('agent-')) {\n continue\n }\n\n try {\n const fullPath = join(getCwd(), filePath)\n\n if (existsSync(fullPath)) {\n const fileContent = readFileSync(fullPath, { encoding: 'utf-8' })\n\n const formattedContent = `\\n\\n## File: ${filePath}\\n\\`\\`\\`\\n${fileContent}\\n\\`\\`\\`\\n`\n result = result.replace(fullMatch, formattedContent)\n } else {\n result = result.replace(fullMatch, `(file not found: ${filePath})`)\n }\n } catch (error) {\n logError(error)\n debugLogger.warn('CUSTOM_COMMAND_FILE_READ_FAILED', {\n filePath,\n error: error instanceof Error ? error.message : String(error),\n })\n result = result.replace(fullMatch, `(error reading: ${filePath})`)\n }\n }\n\n return result\n}\n\nexport interface CustomCommandFrontmatter {\n description?: string\n 'allowed-tools'?: string[]\n 'argument-hint'?: string\n when_to_use?: string\n version?: string\n model?: string\n maxThinkingTokens?: number | string\n max_thinking_tokens?: number | string\n 'max-thinking-tokens'?: number | string\n name?: string\n 'disable-model-invocation'?: boolean | string\n}\n\nexport interface CustomCommandWithScope {\n type: 'prompt'\n name: string\n description: string\n isEnabled: boolean\n isHidden: boolean\n aliases?: string[]\n progressMessage: string\n userFacingName(): string\n getPromptForCommand(args: string): Promise<MessageParam[]>\n allowedTools?: string[]\n maxThinkingTokens?: number\n argumentHint?: string\n whenToUse?: string\n version?: string\n model?: string\n isSkill?: boolean\n disableModelInvocation?: boolean\n hasUserSpecifiedDescription?: boolean\n source?: 'localSettings' | 'userSettings' | 'pluginDir'\n scope?: 'user' | 'project'\n filePath?: string\n}\n\nexport interface CustomCommandFile {\n frontmatter: CustomCommandFrontmatter\n content: string\n filePath: string\n}\n\nexport function parseFrontmatter(content: string): {\n frontmatter: CustomCommandFrontmatter\n content: string\n} {\n const yamlSchema = (yaml as any).JSON_SCHEMA\n const parsed = matter(content, {\n engines: {\n yaml: {\n parse: (input: string) =>\n yaml.load(input, yamlSchema ? { schema: yamlSchema } : undefined) ??\n {},\n },\n },\n })\n return {\n frontmatter: (parsed.data ?? {}) as CustomCommandFrontmatter,\n content: parsed.content ?? '',\n }\n}\n\ntype CommandSource = 'localSettings' | 'userSettings' | 'pluginDir'\n\nfunction isSkillMarkdownFile(filePath: string): boolean {\n return /^skill\\.md$/i.test(basename(filePath))\n}\n\nfunction getUserKodeBaseDir(): string {\n return getKodeBaseDir()\n}\n\nfunction toBoolean(value: unknown): boolean {\n if (typeof value === 'boolean') return value\n if (typeof value === 'string') {\n const normalized = value.trim().toLowerCase()\n if (['1', 'true', 'yes', 'on'].includes(normalized)) return true\n if (['0', 'false', 'no', 'off'].includes(normalized)) return false\n }\n return false\n}\n\nfunction parseAllowedTools(value: unknown): string[] {\n if (Array.isArray(value)) {\n return value.map(v => String(v).trim()).filter(Boolean)\n }\n if (typeof value === 'string') {\n const trimmed = value.trim()\n if (!trimmed) return []\n return trimmed\n .split(/\\s+/)\n .map(v => v.trim())\n .filter(Boolean)\n }\n return []\n}\n\nfunction parseMaxThinkingTokens(\n frontmatter: CustomCommandFrontmatter,\n): number | undefined {\n const raw =\n (frontmatter as any).maxThinkingTokens ??\n (frontmatter as any).max_thinking_tokens ??\n (frontmatter as any)['max-thinking-tokens'] ??\n (frontmatter as any)['max_thinking_tokens']\n if (raw === undefined || raw === null) return undefined\n const value = typeof raw === 'number' ? raw : Number(String(raw).trim())\n if (!Number.isFinite(value) || value < 0) return undefined\n return Math.floor(value)\n}\n\nfunction sourceLabel(source: CommandSource): string {\n if (source === 'localSettings') return 'project'\n if (source === 'userSettings') return 'user'\n if (source === 'pluginDir') return 'plugin'\n return 'unknown'\n}\n\nfunction extractDescriptionFromMarkdown(\n markdown: string,\n fallback: string,\n): string {\n const lines = markdown.split(/\\r?\\n/)\n for (const line of lines) {\n const trimmed = line.trim()\n if (!trimmed) continue\n const heading = trimmed.match(/^#{1,6}\\s+(.*)$/)\n if (heading?.[1]) return heading[1].trim()\n return trimmed.length > 120 ? `${trimmed.slice(0, 117)}...` : trimmed\n }\n return fallback\n}\n\nfunction namespaceFromDirPath(dirPath: string, baseDir: string): string {\n const relPath = relative(baseDir, dirPath)\n if (!relPath || relPath === '.' || relPath.startsWith('..')) return ''\n return relPath.split(sep).join(':')\n}\n\nfunction nameForCommandFile(filePath: string, baseDir: string): string {\n if (isSkillMarkdownFile(filePath)) {\n const skillDir = dirname(filePath)\n const parentDir = dirname(skillDir)\n const skillName = basename(skillDir)\n const namespace = namespaceFromDirPath(parentDir, baseDir)\n return namespace ? `${namespace}:${skillName}` : skillName\n }\n\n const dir = dirname(filePath)\n const namespace = namespaceFromDirPath(dir, baseDir)\n const fileName = basename(filePath).replace(/\\.md$/i, '')\n return namespace ? `${namespace}:${fileName}` : fileName\n}\n\ntype CommandFileRecord = {\n baseDir: string\n filePath: string\n frontmatter: CustomCommandFrontmatter\n content: string\n source: CommandSource\n scope: 'user' | 'project'\n}\n\nfunction buildPluginQualifiedName(\n pluginName: string,\n localName: string,\n): string {\n const p = pluginName.trim()\n const l = localName.trim()\n if (!p) return l\n if (!l || l === p) return p\n return `${p}:${l}`\n}\n\nfunction nameForPluginCommandFile(\n filePath: string,\n commandsDir: string,\n pluginName: string,\n): string {\n const rel = relative(commandsDir, filePath)\n const noExt = rel.replace(/\\.md$/i, '')\n const localName = noExt.split(sep).filter(Boolean).join(':')\n return buildPluginQualifiedName(pluginName, localName)\n}\n\nfunction createPluginPromptCommandFromFile(record: {\n pluginName: string\n commandsDir: string\n filePath: string\n frontmatter: CustomCommandFrontmatter\n content: string\n}): CustomCommandWithScope | null {\n const name = nameForPluginCommandFile(\n record.filePath,\n record.commandsDir,\n record.pluginName,\n )\n if (!name) return null\n\n const descriptionText =\n record.frontmatter.description ??\n extractDescriptionFromMarkdown(record.content, 'Custom command')\n const allowedTools = parseAllowedTools(record.frontmatter['allowed-tools'])\n const maxThinkingTokens = parseMaxThinkingTokens(record.frontmatter)\n const argumentHint = record.frontmatter['argument-hint']\n const whenToUse = record.frontmatter.when_to_use\n const version = record.frontmatter.version\n const disableModelInvocation = toBoolean(\n record.frontmatter['disable-model-invocation'],\n )\n const model =\n record.frontmatter.model === 'inherit'\n ? undefined\n : record.frontmatter.model\n\n return {\n type: 'prompt',\n name,\n description: `${descriptionText} (${sourceLabel('pluginDir')})`,\n isEnabled: true,\n isHidden: false,\n filePath: record.filePath,\n aliases: [],\n progressMessage: 'running',\n allowedTools,\n maxThinkingTokens,\n argumentHint,\n whenToUse,\n version,\n model,\n isSkill: false,\n disableModelInvocation,\n hasUserSpecifiedDescription: !!record.frontmatter.description,\n source: 'pluginDir',\n scope: 'project',\n userFacingName() {\n return name\n },\n async getPromptForCommand(args: string): Promise<MessageParam[]> {\n let prompt = record.content\n const trimmedArgs = args.trim()\n if (trimmedArgs) {\n if (prompt.includes('$ARGUMENTS')) {\n prompt = prompt.replaceAll('$ARGUMENTS', trimmedArgs)\n } else {\n prompt = `${prompt}\\n\\nARGUMENTS: ${trimmedArgs}`\n }\n }\n return [{ role: 'user', content: prompt }]\n },\n }\n}\n\nfunction loadPluginCommandsFromDir(args: {\n pluginName: string\n commandsDir: string\n signal: AbortSignal\n}): CustomCommandWithScope[] {\n let commandsBaseDir = args.commandsDir\n let files: string[] = []\n try {\n const st = statSync(args.commandsDir)\n if (st.isFile()) {\n if (!args.commandsDir.toLowerCase().endsWith('.md')) return []\n files = [args.commandsDir]\n commandsBaseDir = dirname(args.commandsDir)\n } else if (st.isDirectory()) {\n files = listMarkdownFilesRecursively(args.commandsDir, args.signal)\n } else {\n return []\n }\n } catch {\n return []\n }\n\n const out: CustomCommandWithScope[] = []\n for (const filePath of files) {\n if (args.signal.aborted) break\n try {\n const raw = readFileSync(filePath, 'utf8')\n const { frontmatter, content } = parseFrontmatter(raw)\n const cmd = createPluginPromptCommandFromFile({\n pluginName: args.pluginName,\n commandsDir: commandsBaseDir,\n filePath,\n frontmatter,\n content,\n })\n if (cmd) out.push(cmd)\n } catch {\n }\n }\n return out\n}\n\nfunction loadPluginSkillDirectoryCommandsFromBaseDir(args: {\n pluginName: string\n skillsDir: string\n}): CustomCommandWithScope[] {\n if (!existsSync(args.skillsDir)) return []\n\n const out: CustomCommandWithScope[] = []\n let entries\n try {\n entries = readdirSync(args.skillsDir, { withFileTypes: true })\n } catch {\n return []\n }\n\n const strictMode = toBoolean(process.env.KODE_SKILLS_STRICT)\n const validateName = (skillName: string): boolean => {\n if (skillName.length < 1 || skillName.length > 64) return false\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(skillName)\n }\n\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) continue\n const skillDir = join(args.skillsDir, entry.name)\n const skillFileCandidates = [\n join(skillDir, 'SKILL.md'),\n join(skillDir, 'skill.md'),\n ]\n const skillFile = skillFileCandidates.find(p => existsSync(p))\n if (!skillFile) continue\n\n try {\n const raw = readFileSync(skillFile, 'utf8')\n const { frontmatter, content } = parseFrontmatter(raw)\n\n const dirName = entry.name\n const declaredName =\n typeof (frontmatter as any).name === 'string'\n ? String((frontmatter as any).name).trim()\n : ''\n const effectiveDeclaredName =\n declaredName && declaredName === dirName ? declaredName : ''\n if (declaredName && declaredName !== dirName) {\n if (strictMode) continue\n debugLogger.warn('CUSTOM_COMMAND_SKILL_NAME_MISMATCH', {\n dirName,\n declaredName,\n skillFile,\n })\n }\n const name = buildPluginQualifiedName(args.pluginName, dirName)\n if (!validateName(dirName)) {\n if (strictMode) continue\n debugLogger.warn('CUSTOM_COMMAND_SKILL_DIR_INVALID', { dirName, skillFile })\n }\n const descriptionText =\n frontmatter.description ??\n extractDescriptionFromMarkdown(content, 'Skill')\n if (strictMode) {\n const d =\n typeof frontmatter.description === 'string'\n ? frontmatter.description.trim()\n : ''\n if (!d || d.length > 1024) continue\n }\n\n const allowedTools = parseAllowedTools(frontmatter['allowed-tools'])\n const maxThinkingTokens = parseMaxThinkingTokens(frontmatter as any)\n const argumentHint = frontmatter['argument-hint']\n const whenToUse = frontmatter.when_to_use\n const version = frontmatter.version\n const disableModelInvocation = toBoolean(\n frontmatter['disable-model-invocation'],\n )\n const model =\n frontmatter.model === 'inherit' ? undefined : frontmatter.model\n\n out.push({\n type: 'prompt',\n name,\n description: `${descriptionText} (${sourceLabel('pluginDir')})`,\n isEnabled: true,\n isHidden: true,\n aliases: [],\n filePath: skillFile,\n progressMessage: 'loading',\n allowedTools,\n maxThinkingTokens,\n argumentHint,\n whenToUse,\n version,\n model,\n isSkill: true,\n disableModelInvocation,\n hasUserSpecifiedDescription: !!frontmatter.description,\n source: 'pluginDir',\n scope: 'project',\n userFacingName() {\n return effectiveDeclaredName\n ? buildPluginQualifiedName(args.pluginName, effectiveDeclaredName)\n : name\n },\n async getPromptForCommand(argsText: string): Promise<MessageParam[]> {\n let prompt = `Base directory for this skill: ${skillDir}\\n\\n${content}`\n const trimmedArgs = argsText.trim()\n if (trimmedArgs) {\n if (prompt.includes('$ARGUMENTS')) {\n prompt = prompt.replaceAll('$ARGUMENTS', trimmedArgs)\n } else {\n prompt = `${prompt}\\n\\nARGUMENTS: ${trimmedArgs}`\n }\n }\n return [{ role: 'user', content: prompt }]\n },\n })\n } catch {\n }\n }\n\n return out\n}\n\nfunction applySkillFilePreference(\n files: CommandFileRecord[],\n): CommandFileRecord[] {\n const grouped = new Map<string, CommandFileRecord[]>()\n for (const file of files) {\n const key = dirname(file.filePath)\n const existing = grouped.get(key) ?? []\n existing.push(file)\n grouped.set(key, existing)\n }\n\n const result: CommandFileRecord[] = []\n for (const group of grouped.values()) {\n const skillFiles = group.filter(f => isSkillMarkdownFile(f.filePath))\n if (skillFiles.length > 0) {\n result.push(skillFiles[0]!)\n continue\n }\n result.push(...group)\n }\n return result\n}\n\nfunction createPromptCommandFromFile(\n record: CommandFileRecord,\n): CustomCommandWithScope | null {\n const isSkill = isSkillMarkdownFile(record.filePath)\n const name = nameForCommandFile(record.filePath, record.baseDir)\n if (!name) return null\n\n const descriptionText =\n record.frontmatter.description ??\n extractDescriptionFromMarkdown(\n record.content,\n isSkill ? 'Skill' : 'Custom command',\n )\n\n const allowedTools = parseAllowedTools(record.frontmatter['allowed-tools'])\n const maxThinkingTokens = parseMaxThinkingTokens(record.frontmatter)\n const argumentHint = record.frontmatter['argument-hint']\n const whenToUse = record.frontmatter.when_to_use\n const version = record.frontmatter.version\n const disableModelInvocation = toBoolean(\n record.frontmatter['disable-model-invocation'],\n )\n const model =\n record.frontmatter.model === 'inherit'\n ? undefined\n : record.frontmatter.model\n\n const description = `${descriptionText} (${sourceLabel(record.source)})`\n const progressMessage = isSkill ? 'loading' : 'running'\n const skillBaseDir = isSkill ? dirname(record.filePath) : undefined\n\n return {\n type: 'prompt',\n name,\n description,\n isEnabled: true,\n isHidden: false,\n filePath: record.filePath,\n aliases: [],\n progressMessage,\n allowedTools,\n maxThinkingTokens,\n argumentHint,\n whenToUse,\n version,\n model,\n isSkill,\n disableModelInvocation,\n hasUserSpecifiedDescription: !!record.frontmatter.description,\n source: record.source,\n scope: record.scope,\n userFacingName() {\n return name\n },\n async getPromptForCommand(args: string): Promise<MessageParam[]> {\n let prompt = record.content\n if (isSkill && skillBaseDir) {\n prompt = `Base directory for this skill: ${skillBaseDir}\\n\\n${prompt}`\n }\n const trimmedArgs = args.trim()\n if (trimmedArgs) {\n if (prompt.includes('$ARGUMENTS')) {\n prompt = prompt.replaceAll('$ARGUMENTS', trimmedArgs)\n } else {\n prompt = `${prompt}\\n\\nARGUMENTS: ${trimmedArgs}`\n }\n }\n return [{ role: 'user', content: prompt }]\n },\n }\n}\n\nfunction listMarkdownFilesRecursively(\n baseDir: string,\n signal: AbortSignal,\n): string[] {\n const results: string[] = []\n const queue: string[] = [baseDir]\n while (queue.length > 0) {\n if (signal.aborted) break\n const currentDir = queue.pop()!\n let entries\n try {\n entries = readdirSync(currentDir, { withFileTypes: true })\n } catch {\n continue\n }\n for (const entry of entries) {\n if (signal.aborted) break\n const fullPath = join(currentDir, entry.name)\n if (entry.isDirectory()) {\n queue.push(fullPath)\n continue\n }\n if (entry.isFile() && entry.name.toLowerCase().endsWith('.md')) {\n results.push(fullPath)\n }\n }\n }\n return results\n}\n\nfunction loadCommandMarkdownFilesFromBaseDir(\n baseDir: string,\n source: CommandSource,\n scope: 'user' | 'project',\n signal: AbortSignal,\n): CommandFileRecord[] {\n if (!existsSync(baseDir)) return []\n const files = listMarkdownFilesRecursively(baseDir, signal)\n const records: CommandFileRecord[] = []\n for (const filePath of files) {\n if (signal.aborted) break\n try {\n const raw = readFileSync(filePath, 'utf8')\n const { frontmatter, content } = parseFrontmatter(raw)\n records.push({ baseDir, filePath, frontmatter, content, source, scope })\n } catch {\n }\n }\n return records\n}\n\nfunction loadSkillDirectoryCommandsFromBaseDir(\n skillsDir: string,\n source: CommandSource,\n scope: 'user' | 'project',\n): CustomCommandWithScope[] {\n if (!existsSync(skillsDir)) return []\n\n const out: CustomCommandWithScope[] = []\n let entries\n try {\n entries = readdirSync(skillsDir, { withFileTypes: true })\n } catch {\n return []\n }\n\n const strictMode = toBoolean(process.env.KODE_SKILLS_STRICT)\n const validateName = (skillName: string): boolean => {\n if (skillName.length < 1 || skillName.length > 64) return false\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(skillName)\n }\n\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) continue\n const skillDir = join(skillsDir, entry.name)\n const skillFileCandidates = [\n join(skillDir, 'SKILL.md'),\n join(skillDir, 'skill.md'),\n ]\n const skillFile = skillFileCandidates.find(p => existsSync(p))\n if (!skillFile) continue\n\n try {\n const raw = readFileSync(skillFile, 'utf8')\n const { frontmatter, content } = parseFrontmatter(raw)\n\n const dirName = entry.name\n const declaredName =\n typeof (frontmatter as any).name === 'string'\n ? String((frontmatter as any).name).trim()\n : ''\n const effectiveDeclaredName =\n declaredName && declaredName === dirName ? declaredName : ''\n if (declaredName && declaredName !== dirName) {\n if (strictMode) continue\n debugLogger.warn('CUSTOM_COMMAND_SKILL_NAME_MISMATCH', {\n dirName,\n declaredName,\n skillFile,\n })\n }\n const name = dirName\n if (!validateName(name)) {\n if (strictMode) continue\n debugLogger.warn('CUSTOM_COMMAND_SKILL_DIR_INVALID', { name, skillFile })\n }\n const descriptionText =\n frontmatter.description ??\n extractDescriptionFromMarkdown(content, 'Skill')\n if (strictMode) {\n const d =\n typeof frontmatter.description === 'string'\n ? frontmatter.description.trim()\n : ''\n if (!d || d.length > 1024) continue\n }\n\n const allowedTools = parseAllowedTools(frontmatter['allowed-tools'])\n const maxThinkingTokens = parseMaxThinkingTokens(frontmatter as any)\n const argumentHint = frontmatter['argument-hint']\n const whenToUse = frontmatter.when_to_use\n const version = frontmatter.version\n const disableModelInvocation = toBoolean(\n frontmatter['disable-model-invocation'],\n )\n const model =\n frontmatter.model === 'inherit' ? undefined : frontmatter.model\n\n out.push({\n type: 'prompt',\n name,\n description: `${descriptionText} (${sourceLabel(source)})`,\n isEnabled: true,\n isHidden: true,\n aliases: [],\n filePath: skillFile,\n progressMessage: 'loading',\n allowedTools,\n maxThinkingTokens,\n argumentHint,\n whenToUse,\n version,\n model,\n isSkill: true,\n disableModelInvocation,\n hasUserSpecifiedDescription: !!frontmatter.description,\n source,\n scope,\n userFacingName() {\n return effectiveDeclaredName || name\n },\n async getPromptForCommand(args: string): Promise<MessageParam[]> {\n let prompt = `Base directory for this skill: ${skillDir}\\n\\n${content}`\n const trimmedArgs = args.trim()\n if (trimmedArgs) {\n if (prompt.includes('$ARGUMENTS')) {\n prompt = prompt.replaceAll('$ARGUMENTS', trimmedArgs)\n } else {\n prompt = `${prompt}\\n\\nARGUMENTS: ${trimmedArgs}`\n }\n }\n return [{ role: 'user', content: prompt }]\n },\n })\n } catch {\n }\n }\n\n return out\n}\n\nexport const loadCustomCommands = memoize(\n async (): Promise<CustomCommandWithScope[]> => {\n const cwd = getCwd()\n const userKodeBaseDir = getUserKodeBaseDir()\n const sessionPlugins = getSessionPlugins()\n\n const projectLegacyCommandsDir = join(cwd, '.claude', 'commands')\n const userLegacyCommandsDir = join(homedir(), '.claude', 'commands')\n const projectKodeCommandsDir = join(cwd, '.kode', 'commands')\n const userKodeCommandsDir = join(userKodeBaseDir, 'commands')\n\n const projectLegacySkillsDir = join(cwd, '.claude', 'skills')\n const userLegacySkillsDir = join(homedir(), '.claude', 'skills')\n const projectKodeSkillsDir = join(cwd, '.kode', 'skills')\n const userKodeSkillsDir = join(userKodeBaseDir, 'skills')\n\n const abortController = new AbortController()\n const timeout = setTimeout(() => abortController.abort(), 3000)\n\n try {\n const commandFiles = applySkillFilePreference([\n ...loadCommandMarkdownFilesFromBaseDir(\n projectLegacyCommandsDir,\n 'localSettings',\n 'project',\n abortController.signal,\n ),\n ...loadCommandMarkdownFilesFromBaseDir(\n projectKodeCommandsDir,\n 'localSettings',\n 'project',\n abortController.signal,\n ),\n ...loadCommandMarkdownFilesFromBaseDir(\n userLegacyCommandsDir,\n 'userSettings',\n 'user',\n abortController.signal,\n ),\n ...loadCommandMarkdownFilesFromBaseDir(\n userKodeCommandsDir,\n 'userSettings',\n 'user',\n abortController.signal,\n ),\n ])\n\n const fileCommands = commandFiles\n .map(createPromptCommandFromFile)\n .filter((cmd): cmd is CustomCommandWithScope => cmd !== null)\n\n const skillDirCommands: CustomCommandWithScope[] = [\n ...loadSkillDirectoryCommandsFromBaseDir(\n projectLegacySkillsDir,\n 'localSettings',\n 'project',\n ),\n ...loadSkillDirectoryCommandsFromBaseDir(\n projectKodeSkillsDir,\n 'localSettings',\n 'project',\n ),\n ...loadSkillDirectoryCommandsFromBaseDir(\n userLegacySkillsDir,\n 'userSettings',\n 'user',\n ),\n ...loadSkillDirectoryCommandsFromBaseDir(\n userKodeSkillsDir,\n 'userSettings',\n 'user',\n ),\n ]\n\n const pluginCommands: CustomCommandWithScope[] = []\n if (sessionPlugins.length > 0) {\n for (const plugin of sessionPlugins) {\n for (const commandsDir of plugin.commandsDirs) {\n pluginCommands.push(\n ...loadPluginCommandsFromDir({\n pluginName: plugin.name,\n commandsDir,\n signal: abortController.signal,\n }),\n )\n }\n for (const skillsDir of plugin.skillsDirs) {\n pluginCommands.push(\n ...loadPluginSkillDirectoryCommandsFromBaseDir({\n pluginName: plugin.name,\n skillsDir,\n }),\n )\n }\n }\n }\n\n const ordered = [\n ...fileCommands,\n ...skillDirCommands,\n ...pluginCommands,\n ].filter(cmd => cmd.isEnabled)\n\n const seen = new Set<string>()\n const unique: CustomCommandWithScope[] = []\n for (const cmd of ordered) {\n const key = cmd.userFacingName()\n if (seen.has(key)) continue\n seen.add(key)\n unique.push(cmd)\n }\n\n return unique\n } catch (error) {\n logError(error)\n debugLogger.warn('CUSTOM_COMMANDS_LOAD_FAILED', {\n error: error instanceof Error ? error.message : String(error),\n })\n return []\n } finally {\n clearTimeout(timeout)\n }\n },\n () => {\n const cwd = getCwd()\n const userKodeBaseDir = getUserKodeBaseDir()\n const dirs = [\n join(homedir(), '.claude', 'commands'),\n join(cwd, '.claude', 'commands'),\n join(userKodeBaseDir, 'commands'),\n join(cwd, '.kode', 'commands'),\n join(homedir(), '.claude', 'skills'),\n join(cwd, '.claude', 'skills'),\n join(userKodeBaseDir, 'skills'),\n join(cwd, '.kode', 'skills'),\n ]\n const exists = dirs.map(d => (existsSync(d) ? '1' : '0')).join('')\n return `${cwd}:${exists}:${Math.floor(Date.now() / 60000)}`\n },\n)\n\nexport const reloadCustomCommands = (): void => {\n loadCustomCommands.cache.clear()\n}\n\nexport function getCustomCommandDirectories(): {\n userClaudeCommands: string\n projectClaudeCommands: string\n userClaudeSkills: string\n projectClaudeSkills: string\n userKodeCommands: string\n projectKodeCommands: string\n userKodeSkills: string\n projectKodeSkills: string\n} {\n const userKodeBaseDir = getUserKodeBaseDir()\n return {\n userClaudeCommands: join(homedir(), '.claude', 'commands'),\n projectClaudeCommands: join(getCwd(), '.claude', 'commands'),\n userClaudeSkills: join(homedir(), '.claude', 'skills'),\n projectClaudeSkills: join(getCwd(), '.claude', 'skills'),\n userKodeCommands: join(userKodeBaseDir, 'commands'),\n projectKodeCommands: join(getCwd(), '.kode', 'commands'),\n userKodeSkills: join(userKodeBaseDir, 'skills'),\n projectKodeSkills: join(getCwd(), '.kode', 'skills'),\n }\n}\n\nexport function hasCustomCommands(): boolean {\n const dirs = getCustomCommandDirectories()\n return (\n existsSync(dirs.userClaudeCommands) ||\n existsSync(dirs.projectClaudeCommands) ||\n existsSync(dirs.userClaudeSkills) ||\n existsSync(dirs.projectClaudeSkills) ||\n existsSync(dirs.userKodeCommands) ||\n existsSync(dirs.projectKodeCommands) ||\n existsSync(dirs.userKodeSkills) ||\n existsSync(dirs.projectKodeSkills)\n )\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAA,SAAS,YAAY,cAAc,aAAa,gBAAgB;AAChE,SAAS,UAAU,SAAS,MAAM,UAAmB,WAAW;AAChE,SAAS,eAAe;AACxB,SAAS,eAAe;AAQxB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,OAAO,YAAY;AACnB,OAAO,UAAU;AAEjB,IAAM,gBAAgB,UAAU,QAAQ;AAExC,eAAsB,oBAAoB,SAAkC;AAC1E,QAAM,mBAAmB;AACzB,QAAM,UAAU,CAAC,GAAG,QAAQ,SAAS,gBAAgB,CAAC;AAEtD,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,SAAS;AAEb,aAAW,SAAS,SAAS;AAC3B,UAAM,YAAY,MAAM,CAAC;AACzB,UAAM,UAAU,MAAM,CAAC,EAAE,KAAK;AAE9B,QAAI;AACF,YAAM,QAAQ,QAAQ,MAAM,KAAK;AACjC,YAAM,MAAM,MAAM,CAAC;AACnB,YAAM,OAAO,MAAM,MAAM,CAAC;AAE1B,YAAM,EAAE,QAAQ,OAAO,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+0,0 @@
1
- import { createRequire as __kodeCreateRequire } from "node:module";
2
- const require = __kodeCreateRequire(import.meta.url);
3
-
4
- // src/core/tools/tool.ts
5
- function getToolDescription(tool) {
6
- if (tool.cachedDescription) {
7
- return tool.cachedDescription;
8
- }
9
- if (typeof tool.description === "string") {
10
- return tool.description;
11
- }
12
- return `Tool: ${tool.name}`;
13
- }
14
-
15
- export {
16
- getToolDescription
17
- };
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/core/tools/tool.ts"],
4
- "sourcesContent": ["import { z } from 'zod'\nimport type * as React from 'react'\nimport type { PermissionMode } from '@kode-types/permissionMode'\nimport type { ToolPermissionContext } from '@kode-types/toolPermissionContext'\n\nexport type SetToolJSXFn = (\n jsx: {\n jsx: React.ReactNode | null\n shouldHidePromptInput: boolean\n } | null,\n) => void\n\nexport interface ToolUseContext {\n messageId: string | undefined\n toolUseId?: string\n agentId?: string\n safeMode?: boolean\n abortController: AbortController\n readFileTimestamps: { [filePath: string]: number }\n options?: {\n commands?: any[]\n tools?: any[]\n verbose?: boolean\n slowAndCapableModel?: string\n safeMode?: boolean\n permissionMode?: PermissionMode\n toolPermissionContext?: ToolPermissionContext\n lastUserPrompt?: string\n forkNumber?: number\n messageLogName?: string\n maxThinkingTokens?: any\n model?: string\n commandAllowedTools?: string[]\n isKodingRequest?: boolean\n kodingContext?: string\n isCustomCommand?: boolean\n mcpClients?: any[]\n disableSlashCommands?: boolean\n persistSession?: boolean\n shouldAvoidPermissionPrompts?: boolean\n }\n responseState?: {\n previousResponseId?: string\n conversationId?: string\n }\n}\n\nexport interface ExtendedToolUseContext extends ToolUseContext {\n setToolJSX: SetToolJSXFn\n}\n\nexport interface ValidationResult {\n result: boolean\n message?: string\n errorCode?: number\n meta?: any\n}\n\nexport interface Tool<\n TInput extends z.ZodTypeAny = z.ZodTypeAny,\n TOutput = any,\n> {\n name: string\n description?: string | ((input?: z.infer<TInput>) => Promise<string>)\n inputSchema: TInput\n inputJSONSchema?: Record<string, unknown>\n prompt: (options?: { safeMode?: boolean }) => Promise<string>\n userFacingName?: (input?: z.infer<TInput>) => string\n cachedDescription?: string\n isEnabled: () => Promise<boolean>\n isReadOnly: (input?: z.infer<TInput>) => boolean\n isConcurrencySafe: (input?: z.infer<TInput>) => boolean\n needsPermissions: (input?: z.infer<TInput>) => boolean\n requiresUserInteraction?: (input?: z.infer<TInput>) => boolean\n validateInput?: (\n input: z.infer<TInput>,\n context?: ToolUseContext,\n ) => Promise<ValidationResult>\n renderResultForAssistant: (output: TOutput) => string | any[]\n renderToolUseMessage: (\n input: z.infer<TInput>,\n options: { verbose: boolean },\n ) => string | React.ReactElement | null\n renderToolUseRejectedMessage?: (...args: any[]) => React.ReactElement\n renderToolResultMessage?: (\n output: TOutput,\n options: { verbose: boolean },\n ) => React.ReactNode\n call: (\n input: z.infer<TInput>,\n context: ToolUseContext,\n ) => AsyncGenerator<\n | {\n type: 'result'\n data: TOutput\n resultForAssistant?: string | any[]\n newMessages?: unknown[]\n contextModifier?: {\n modifyContext: (ctx: ToolUseContext) => ToolUseContext\n }\n }\n | {\n type: 'progress'\n content: any\n normalizedMessages?: any[]\n tools?: any[]\n },\n void,\n unknown\n >\n}\n\nexport function getToolDescription(tool: Tool): string {\n if (tool.cachedDescription) {\n return tool.cachedDescription\n }\n\n if (typeof tool.description === 'string') {\n return tool.description\n }\n\n return `Tool: ${tool.name}`\n}\n"],
5
- "mappings": ";;;;AAgHO,SAAS,mBAAmB,MAAoB;AACrD,MAAI,KAAK,mBAAmB;AAC1B,WAAO,KAAK;AAAA,EACd;AAEA,MAAI,OAAO,KAAK,gBAAgB,UAAU;AACxC,WAAO,KAAK;AAAA,EACd;AAEA,SAAO,SAAS,KAAK,IAAI;AAC3B;",
6
- "names": []
7
- }
@@ -1,49 +0,0 @@
1
- import { createRequire as __kodeCreateRequire } from "node:module";
2
- const require = __kodeCreateRequire(import.meta.url);
3
-
4
- // src/utils/config/sanitizeAnthropicEnv.ts
5
- var deprecatedAnthropicEnvVars = [
6
- "ANTHROPIC_BASE_URL",
7
- "ANTHROPIC_API_KEY",
8
- "ANTHROPIC_API_TOKEN",
9
- "ANTHROPIC_API_Token"
10
- ];
11
- for (const key of deprecatedAnthropicEnvVars) {
12
- if (process.env[key]) {
13
- delete process.env[key];
14
- }
15
- }
16
-
17
- // src/entrypoints/cli/bootstrapEnv.ts
18
- import { fileURLToPath } from "node:url";
19
- import { basename, dirname, join } from "node:path";
20
- import { existsSync } from "node:fs";
21
- function ensurePackagedRuntimeEnv() {
22
- if (process.env.KODE_PACKAGED !== void 0) return;
23
- try {
24
- const exec = basename(process.execPath || "").toLowerCase();
25
- if (exec && exec !== "bun" && exec !== "bun.exe" && exec !== "node" && exec !== "node.exe") {
26
- process.env.KODE_PACKAGED = "1";
27
- }
28
- } catch {
29
- }
30
- }
31
- function ensureYogaWasmPath(entrypointUrl) {
32
- try {
33
- if (process.env.YOGA_WASM_PATH) return;
34
- const entryFile = fileURLToPath(entrypointUrl);
35
- const entryDir = dirname(entryFile);
36
- const devCandidate = join(entryDir, "../../yoga.wasm");
37
- const distCandidate = join(entryDir, "./yoga.wasm");
38
- const resolved = existsSync(distCandidate) ? distCandidate : existsSync(devCandidate) ? devCandidate : void 0;
39
- if (resolved) {
40
- process.env.YOGA_WASM_PATH = resolved;
41
- }
42
- } catch {
43
- }
44
- }
45
-
46
- export {
47
- ensurePackagedRuntimeEnv,
48
- ensureYogaWasmPath
49
- };
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/utils/config/sanitizeAnthropicEnv.ts", "../src/entrypoints/cli/bootstrapEnv.ts"],
4
- "sourcesContent": ["const deprecatedAnthropicEnvVars = [\n 'ANTHROPIC_BASE_URL',\n 'ANTHROPIC_API_KEY',\n 'ANTHROPIC_API_TOKEN',\n 'ANTHROPIC_API_Token',\n]\n\nfor (const key of deprecatedAnthropicEnvVars) {\n if (process.env[key]) {\n delete process.env[key]\n }\n}\n", "import { fileURLToPath } from 'node:url'\nimport { basename, dirname, join } from 'node:path'\nimport { existsSync } from 'node:fs'\n\nexport function ensurePackagedRuntimeEnv(): void {\n if (process.env.KODE_PACKAGED !== undefined) return\n\n try {\n const exec = basename(process.execPath || '').toLowerCase()\n if (\n exec &&\n exec !== 'bun' &&\n exec !== 'bun.exe' &&\n exec !== 'node' &&\n exec !== 'node.exe'\n ) {\n process.env.KODE_PACKAGED = '1'\n }\n } catch {}\n}\n\nexport function ensureYogaWasmPath(entrypointUrl: string): void {\n try {\n if (process.env.YOGA_WASM_PATH) return\n\n const entryFile = fileURLToPath(entrypointUrl)\n const entryDir = dirname(entryFile)\n const devCandidate = join(entryDir, '../../yoga.wasm')\n const distCandidate = join(entryDir, './yoga.wasm')\n const resolved = existsSync(distCandidate)\n ? distCandidate\n : existsSync(devCandidate)\n ? devCandidate\n : undefined\n if (resolved) {\n process.env.YOGA_WASM_PATH = resolved\n }\n } catch {}\n}\n"],
5
- "mappings": ";;;;AAAA,IAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,WAAW,OAAO,4BAA4B;AAC5C,MAAI,QAAQ,IAAI,GAAG,GAAG;AACpB,WAAO,QAAQ,IAAI,GAAG;AAAA,EACxB;AACF;;;ACXA,SAAS,qBAAqB;AAC9B,SAAS,UAAU,SAAS,YAAY;AACxC,SAAS,kBAAkB;AAEpB,SAAS,2BAAiC;AAC/C,MAAI,QAAQ,IAAI,kBAAkB,OAAW;AAE7C,MAAI;AACF,UAAM,OAAO,SAAS,QAAQ,YAAY,EAAE,EAAE,YAAY;AAC1D,QACE,QACA,SAAS,SACT,SAAS,aACT,SAAS,UACT,SAAS,YACT;AACA,cAAQ,IAAI,gBAAgB;AAAA,IAC9B;AAAA,EACF,QAAQ;AAAA,EAAC;AACX;AAEO,SAAS,mBAAmB,eAA6B;AAC9D,MAAI;AACF,QAAI,QAAQ,IAAI,eAAgB;AAEhC,UAAM,YAAY,cAAc,aAAa;AAC7C,UAAM,WAAW,QAAQ,SAAS;AAClC,UAAM,eAAe,KAAK,UAAU,iBAAiB;AACrD,UAAM,gBAAgB,KAAK,UAAU,aAAa;AAClD,UAAM,WAAW,WAAW,aAAa,IACrC,gBACA,WAAW,YAAY,IACrB,eACA;AACN,QAAI,UAAU;AACZ,cAAQ,IAAI,iBAAiB;AAAA,IAC/B;AAAA,EACF,QAAQ;AAAA,EAAC;AACX;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/services/ui/outputStyles.ts", "../src/utils/config/localSettings.ts"],
4
- "sourcesContent": ["import figures from 'figures'\nimport { memoize } from 'lodash-es'\nimport { existsSync, readdirSync, readFileSync, statSync } from 'fs'\nimport { basename, dirname, join, resolve } from 'path'\nimport { homedir } from 'os'\nimport matter from 'gray-matter'\nimport yaml from 'js-yaml'\nimport { getSessionPlugins } from '@utils/session/sessionPlugins'\nimport { readLocalSettings, updateLocalSettings } from '@utils/config/localSettings'\nimport { getCwd } from '@utils/state'\nimport { isSettingSourceEnabled } from '@utils/config/settingSources'\n\nexport type OutputStyleSource =\n | 'built-in'\n | 'plugin'\n | 'userSettings'\n | 'projectSettings'\n | 'policySettings'\n\nexport type OutputStyleDefinition = {\n name: string\n description: string\n prompt: string\n source: OutputStyleSource\n keepCodingInstructions?: boolean\n}\n\nexport type OutputStyleMap = Record<string, OutputStyleDefinition | null>\n\nexport const DEFAULT_OUTPUT_STYLE = 'default'\n\nfunction normalizeString(value: unknown): string | null {\n if (typeof value !== 'string') return null\n const trimmed = value.trim()\n return trimmed ? trimmed : null\n}\n\nfunction getClaudePolicyBaseDir(): string {\n switch (process.platform) {\n case 'darwin':\n return '/Library/Application Support/ClaudeCode'\n case 'win32':\n return existsSync('C:\\\\Program Files\\\\ClaudeCode')\n ? 'C:\\\\Program Files\\\\ClaudeCode'\n : 'C:\\\\ProgramData\\\\ClaudeCode'\n default:\n return '/etc/claude-code'\n }\n}\n\nfunction getUserConfigBaseDirs(): { claude: string; kode: string }[] {\n const out: { claude: string; kode: string }[] = []\n\n const hasAnyOverride =\n typeof process.env.CLAUDE_CONFIG_DIR === 'string' ||\n typeof process.env.KODE_CONFIG_DIR === 'string'\n\n const claudeBase = normalizeString(process.env.CLAUDE_CONFIG_DIR)\n const kodeBase = normalizeString(process.env.KODE_CONFIG_DIR)\n\n if (claudeBase) out.push({ claude: resolve(claudeBase), kode: resolve(claudeBase) })\n if (kodeBase) out.push({ claude: resolve(kodeBase), kode: resolve(kodeBase) })\n\n if (hasAnyOverride) {\n return dedupeConfigBases(out)\n }\n\n return dedupeConfigBases([\n { claude: join(homedir(), '.claude'), kode: join(homedir(), '.claude') },\n { claude: join(homedir(), '.kode'), kode: join(homedir(), '.kode') },\n ])\n}\n\nfunction dedupeConfigBases(\n bases: Array<{ claude: string; kode: string }>,\n): Array<{ claude: string; kode: string }> {\n const seen = new Set<string>()\n const out: Array<{ claude: string; kode: string }> = []\n for (const base of bases) {\n const key = `${base.claude}::${base.kode}`\n if (seen.has(key)) continue\n seen.add(key)\n out.push(base)\n }\n return out\n}\n\nfunction findProjectSubdirs(subdir: string, cwd: string): string[] {\n const result: string[] = []\n const home = resolve(homedir())\n let current = resolve(cwd)\n\n while (current !== home) {\n const claudeDir = join(current, '.claude', subdir)\n if (existsSync(claudeDir)) result.push(claudeDir)\n\n const kodeDir = join(current, '.kode', subdir)\n if (existsSync(kodeDir)) result.push(kodeDir)\n\n const parent = dirname(current)\n if (parent === current) break\n current = parent\n }\n\n return result\n}\n\nfunction markdownFirstLineOrHeading(content: string, fallback: string): string {\n const lines = content.split('\\n')\n for (const line of lines) {\n const trimmed = line.trim()\n if (!trimmed) continue\n const heading = trimmed.match(/^#+\\s+(.+)$/)?.[1] ?? trimmed\n return heading.length > 100 ? `${heading.substring(0, 97)}...` : heading\n }\n return fallback\n}\n\nfunction listMarkdownFilesRecursively(rootDir: string): string[] {\n const files: string[] = []\n const visitedDirs = new Set<string>()\n\n const walk = (dirPath: string) => {\n let dirStat: ReturnType<typeof statSync>\n try {\n dirStat = statSync(dirPath)\n } catch {\n return\n }\n if (!dirStat.isDirectory()) return\n\n const dirKey = `${dirStat.dev}:${dirStat.ino}`\n if (visitedDirs.has(dirKey)) return\n visitedDirs.add(dirKey)\n\n let entries: Array<{ name: string; isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }>\n try {\n entries = readdirSync(dirPath, { withFileTypes: true, encoding: 'utf8' }) as any\n } catch {\n return\n }\n\n for (const entry of entries) {\n const name = String(entry.name ?? '')\n const fullPath = join(dirPath, name)\n\n if (entry.isDirectory()) {\n walk(fullPath)\n continue\n }\n\n if (entry.isFile()) {\n if (name.endsWith('.md')) files.push(fullPath)\n continue\n }\n\n if (entry.isSymbolicLink()) {\n try {\n const st = statSync(fullPath)\n if (st.isDirectory()) {\n walk(fullPath)\n } else if (st.isFile() && name.endsWith('.md')) {\n files.push(fullPath)\n }\n } catch {\n continue\n }\n }\n }\n }\n\n if (!existsSync(rootDir)) return []\n walk(rootDir)\n return files\n}\n\nfunction readMarkdownFile(filePath: string): { frontmatter: any; content: string } | null {\n try {\n const raw = readFileSync(filePath, 'utf8')\n const yamlSchema = (yaml as any).JSON_SCHEMA\n const matterOptions = {\n engines: {\n yaml: {\n parse: (input: string) =>\n yaml.load(input, yamlSchema ? { schema: yamlSchema } : undefined) ??\n {},\n },\n },\n }\n const parsed = matter(raw, matterOptions)\n return { frontmatter: (parsed.data as any) ?? {}, content: String(parsed.content ?? '') }\n } catch {\n return null\n }\n}\n\nfunction inodeKeyForPath(filePath: string): string | null {\n try {\n const st = statSync(filePath)\n if (typeof (st as any).dev === 'number' && typeof (st as any).ino === 'number') {\n return `${(st as any).dev}:${(st as any).ino}`\n }\n return null\n } catch {\n return null\n }\n}\n\nconst INSIGHTS_SECTION = `\n## Insights\nIn order to encourage learning, before and after writing code, always provide brief educational explanations about implementation choices using (with backticks):\n\"\\`${figures.star} Insight \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\\`\n[2-3 key educational points]\n\\`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\\`\"\n\nThese insights should be included in the conversation, not in the codebase. You should generally focus on interesting insights that are specific to the codebase or the code you just wrote, rather than general programming concepts.`\n\nfunction getBuiltInOutputStyles(): OutputStyleMap {\n return {\n [DEFAULT_OUTPUT_STYLE]: null,\n Explanatory: {\n name: 'Explanatory',\n source: 'built-in',\n description: 'Claude explains its implementation choices and codebase patterns',\n keepCodingInstructions: true,\n prompt: `You are an interactive CLI tool that helps users with software engineering tasks. In addition to software engineering tasks, you should provide educational insights about the codebase along the way.\n\nYou should be clear and educational, providing helpful explanations while remaining focused on the task. Balance educational content with task completion. When providing insights, you may exceed typical length constraints, but remain focused and relevant.\n\n# Explanatory Style Active\n${INSIGHTS_SECTION}`,\n },\n Learning: {\n name: 'Learning',\n source: 'built-in',\n description:\n 'Claude pauses and asks you to write small pieces of code for hands-on practice',\n keepCodingInstructions: true,\n prompt: `You are an interactive CLI tool that helps users with software engineering tasks. In addition to software engineering tasks, you should help users learn more about the codebase through hands-on practice and educational insights.\n\nYou should be collaborative and encouraging. Balance task completion with learning by requesting user input for meaningful design decisions while handling routine implementation yourself. \n\n# Learning Style Active\n## Requesting Human Contributions\nIn order to encourage learning, ask the human to contribute 2-10 line code pieces when generating 20+ lines involving:\n- Design decisions (error handling, data structures)\n- Business logic with multiple valid approaches \n- Key algorithms or interface definitions\n\n**TodoList Integration**: If using a TodoList for the overall task, include a specific todo item like \"Request human input on [specific decision]\" when planning to request human input. This ensures proper task tracking. Note: TodoList is not required for all tasks.\n\nExample TodoList flow:\n \u2713 \"Set up component structure with placeholder for logic\"\n \u2713 \"Request human collaboration on decision logic implementation\"\n \u2713 \"Integrate contribution and complete feature\"\n\n### Request Format\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n**Context:** [what's built and why this decision matters]\n**Your Task:** [specific function/section in file, mention file and TODO(human) but do not include line numbers]\n**Guidance:** [trade-offs and constraints to consider]\n\\`\\`\\`\n\n### Key Guidelines\n- Frame contributions as valuable design decisions, not busy work\n- You must first add a TODO(human) section into the codebase with your editing tools before making the Learn by Doing request \n- Make sure there is one and only one TODO(human) section in the code\n- Don't take any action or output anything after the Learn by Doing request. Wait for human implementation before proceeding.\n\n### Example Requests\n\n**Whole Function Example:**\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n\n**Context:** I've set up the hint feature UI with a button that triggers the hint system. The infrastructure is ready: when clicked, it calls selectHintCell() to determine which cell to hint, then highlights that cell with a yellow background and shows possible values. The hint system needs to decide which empty cell would be most helpful to reveal to the user.\n\n**Your Task:** In sudoku.js, implement the selectHintCell(board) function. Look for TODO(human). This function should analyze the board and return {row, col} for the best cell to hint, or null if the puzzle is complete.\n\n**Guidance:** Consider multiple strategies: prioritize cells with only one possible value (naked singles), or cells that appear in rows/columns/boxes with many filled cells. You could also consider a balanced approach that helps without making it too easy. The board parameter is a 9x9 array where 0 represents empty cells.\n\\`\\`\\`\n\n**Partial Function Example:**\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n\n**Context:** I've built a file upload component that validates files before accepting them. The main validation logic is complete, but it needs specific handling for different file type categories in the switch statement.\n\n**Your Task:** In upload.js, inside the validateFile() function's switch statement, implement the 'case \"document\":' branch. Look for TODO(human). This should validate document files (pdf, doc, docx).\n\n**Guidance:** Consider checking file size limits (maybe 10MB for documents?), validating the file extension matches the MIME type, and returning {valid: boolean, error?: string}. The file object has properties: name, size, type.\n\\`\\`\\`\n\n**Debugging Example:**\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n\n**Context:** The user reported that number inputs aren't working correctly in the calculator. I've identified the handleInput() function as the likely source, but need to understand what values are being processed.\n\n**Your Task:** In calculator.js, inside the handleInput() function, add 2-3 console.log statements after the TODO(human) comment to help debug why number inputs fail.\n\n**Guidance:** Consider logging: the raw input value, the parsed result, and any validation state. This will help us understand where the conversion breaks.\n\\`\\`\\`\n\n### After Contributions\nShare one insight connecting their code to broader patterns or system effects. Avoid praise or repetition.\n\n## Insights\n${INSIGHTS_SECTION}`,\n },\n }\n}\n\nfunction parseKeepCodingInstructions(value: unknown): boolean | undefined {\n if (value === 'true') return true\n if (value === 'false') return false\n return undefined\n}\n\nfunction parseCustomOutputStyleFile(options: {\n filePath: string\n source: Exclude<OutputStyleSource, 'built-in' | 'plugin'>\n}): OutputStyleDefinition | null {\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n const base = basename(options.filePath, '.md')\n const name = normalizeString(parsed.frontmatter?.name) ?? base\n const description =\n normalizeString(parsed.frontmatter?.description) ??\n markdownFirstLineOrHeading(parsed.content, `Custom ${base} output style`)\n const keepCodingInstructions = parseKeepCodingInstructions(\n parsed.frontmatter?.['keep-coding-instructions'],\n )\n const prompt = parsed.content.trim()\n\n return {\n name,\n description,\n prompt,\n source: options.source,\n ...(keepCodingInstructions !== undefined ? { keepCodingInstructions } : {}),\n }\n}\n\nfunction parsePluginOutputStyleFile(options: {\n filePath: string\n pluginName: string\n seen: Set<string>\n}): OutputStyleDefinition | null {\n const inodeKey = inodeKeyForPath(options.filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${options.filePath}`\n if (options.seen.has(dedupeKey)) return null\n options.seen.add(dedupeKey)\n\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n const base = basename(options.filePath, '.md')\n const styleName = normalizeString(parsed.frontmatter?.name) ?? base\n const fullName = `${options.pluginName}:${styleName}`\n const description =\n normalizeString(parsed.frontmatter?.description) ??\n markdownFirstLineOrHeading(\n parsed.content,\n `Output style from ${options.pluginName} plugin`,\n )\n const prompt = parsed.content.trim()\n\n return {\n name: fullName,\n description,\n prompt,\n source: 'plugin',\n }\n}\n\nfunction loadPluginOutputStyles(): OutputStyleDefinition[] {\n const out: OutputStyleDefinition[] = []\n const plugins = getSessionPlugins()\n for (const plugin of plugins) {\n const pluginName = plugin.name\n const seen = new Set<string>()\n for (const dir of plugin.outputStylesDirs ?? []) {\n let st: ReturnType<typeof statSync>\n try {\n st = statSync(dir)\n } catch {\n continue\n }\n if (st.isFile()) {\n if (!dir.endsWith('.md')) continue\n const style = parsePluginOutputStyleFile({\n filePath: dir,\n pluginName,\n seen,\n })\n if (style) out.push(style)\n continue\n }\n\n if (st.isDirectory()) {\n const files = listMarkdownFilesRecursively(dir)\n for (const filePath of files) {\n const style = parsePluginOutputStyleFile({\n filePath,\n pluginName,\n seen,\n })\n if (style) out.push(style)\n }\n }\n }\n }\n return out\n}\n\nfunction loadCustomOutputStyles(options: { cwd: string }): OutputStyleDefinition[] {\n const out: OutputStyleDefinition[] = []\n const seen = new Set<string>()\n\n const policyDir = join(\n getClaudePolicyBaseDir(),\n '.claude',\n 'output-styles',\n )\n for (const filePath of listMarkdownFilesRecursively(policyDir)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseCustomOutputStyleFile({\n filePath,\n source: 'policySettings',\n })\n if (style) out.push(style)\n }\n\n if (isSettingSourceEnabled('userSettings')) {\n const userBases = getUserConfigBaseDirs()\n for (const base of userBases) {\n for (const userBaseDir of new Set([base.claude, base.kode])) {\n const dirPath = join(userBaseDir, 'output-styles')\n for (const filePath of listMarkdownFilesRecursively(dirPath)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseCustomOutputStyleFile({\n filePath,\n source: 'userSettings',\n })\n if (style) out.push(style)\n }\n }\n }\n }\n\n if (isSettingSourceEnabled('projectSettings')) {\n for (const dirPath of findProjectSubdirs('output-styles', options.cwd)) {\n for (const filePath of listMarkdownFilesRecursively(dirPath)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseCustomOutputStyleFile({\n filePath,\n source: 'projectSettings',\n })\n if (style) out.push(style)\n }\n }\n }\n\n return out\n}\n\nexport const getAvailableOutputStyles = memoize((): OutputStyleMap => {\n const cwd = getCwd()\n const builtIn = getBuiltInOutputStyles()\n const merged: OutputStyleMap = { ...builtIn }\n\n for (const style of loadPluginOutputStyles()) {\n merged[style.name] = style\n }\n\n const custom = loadCustomOutputStyles({ cwd })\n const user = custom.filter(s => s.source === 'userSettings')\n const project = custom.filter(s => s.source === 'projectSettings')\n const policy = custom.filter(s => s.source === 'policySettings')\n\n for (const style of user) merged[style.name] = style\n for (const style of project) merged[style.name] = style\n for (const style of policy) merged[style.name] = style\n\n return merged\n})\n\nexport function clearOutputStyleCache(): void {\n ;(getAvailableOutputStyles as any).cache?.clear?.()\n}\n\nexport function getCurrentOutputStyle(): string {\n if (!isSettingSourceEnabled('localSettings')) return DEFAULT_OUTPUT_STYLE\n\n const settings = readLocalSettings()\n const candidate = normalizeString(settings.outputStyle)\n return candidate ?? DEFAULT_OUTPUT_STYLE\n}\n\nexport function setCurrentOutputStyle(styleName: string): void {\n updateLocalSettings({ outputStyle: styleName })\n}\n\nexport function resolveOutputStyleName(input: string): string | null {\n const raw = normalizeString(input)\n if (!raw) return null\n const styles = getAvailableOutputStyles()\n if (raw in styles) return raw\n const lower = raw.toLowerCase()\n for (const name of Object.keys(styles)) {\n if (name.toLowerCase() === lower) return name\n }\n return null\n}\n\nexport function getCurrentOutputStyleDefinition(): OutputStyleDefinition | null {\n const current = getCurrentOutputStyle()\n const styles = getAvailableOutputStyles()\n return styles[current] ?? null\n}\n\nexport function getOutputStyleSystemPromptAdditions(): string[] {\n const style = getCurrentOutputStyleDefinition()\n if (!style) return []\n const prompt = style.prompt.trim()\n if (!prompt) return []\n return [`\\n# Output Style: ${style.name}\\n${prompt}\\n`]\n}\n", "import { join } from 'path'\nimport { getCwd } from '@utils/state'\nimport {\n getSettingsFileCandidates,\n loadSettingsWithLegacyFallback,\n saveSettingsToPrimaryAndSyncLegacy,\n} from '@utils/config/settingsFiles'\n\nexport type LocalSettings = {\n outputStyle?: unknown\n [key: string]: unknown\n}\n\nexport function getLocalSettingsPath(options?: {\n projectDir?: string\n}): string {\n const projectDir = options?.projectDir ?? getCwd()\n return join(projectDir, '.kode', 'settings.local.json')\n}\n\nexport function readLocalSettings(options?: {\n projectDir?: string\n}): LocalSettings {\n const projectDir = options?.projectDir ?? getCwd()\n const loaded = loadSettingsWithLegacyFallback({\n destination: 'localSettings',\n projectDir,\n migrateToPrimary: true,\n })\n return (loaded.settings as LocalSettings | null) ?? {}\n}\n\nexport function updateLocalSettings(\n patch: Record<string, unknown>,\n options?: {\n projectDir?: string\n },\n): LocalSettings {\n const projectDir = options?.projectDir ?? getCwd()\n const candidates = getSettingsFileCandidates({\n destination: 'localSettings',\n projectDir,\n })\n const existing =\n (candidates\n ? loadSettingsWithLegacyFallback({\n destination: 'localSettings',\n projectDir,\n migrateToPrimary: true,\n }).settings\n : null) ?? {}\n\n const next = { ...(existing as Record<string, unknown>), ...patch }\n\n if (candidates) {\n saveSettingsToPrimaryAndSyncLegacy({\n destination: 'localSettings',\n projectDir,\n settings: next,\n syncLegacyIfExists: true,\n })\n }\n\n return next as LocalSettings\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA,OAAO,aAAa;AACpB,SAAS,eAAe;AACxB,SAAS,YAAY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