@sunasteriskrnd/takumi 1.0.0-dev.32 → 1.0.0-dev.34

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 (2) hide show
  1. package/dist/index.js +542 -2183
  2. package/package.json +1 -6
package/dist/index.js CHANGED
@@ -2732,14 +2732,14 @@ var init_get_east_asian_width = __esm(() => {
2732
2732
  init_lookup();
2733
2733
  });
2734
2734
 
2735
- // node_modules/ora/node_modules/string-width/node_modules/emoji-regex/index.js
2735
+ // node_modules/emoji-regex/index.js
2736
2736
  var require_emoji_regex = __commonJS((exports, module) => {
2737
2737
  module.exports = () => {
2738
2738
  return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
2739
2739
  };
2740
2740
  });
2741
2741
 
2742
- // node_modules/ora/node_modules/string-width/index.js
2742
+ // node_modules/string-width/index.js
2743
2743
  function stringWidth(string, options2 = {}) {
2744
2744
  if (typeof string !== "string" || string.length === 0) {
2745
2745
  return 0;
@@ -19815,7 +19815,7 @@ var package_default;
19815
19815
  var init_package = __esm(() => {
19816
19816
  package_default = {
19817
19817
  name: "@sunasteriskrnd/takumi",
19818
- version: "1.0.0-dev.32",
19818
+ version: "1.0.0-dev.34",
19819
19819
  description: "CLI tool for bootstrapping and managing Takumi projects",
19820
19820
  type: "module",
19821
19821
  repository: {
@@ -19874,15 +19874,12 @@ var init_package = __esm(() => {
19874
19874
  "@clack/prompts": "^0.7.0",
19875
19875
  "@octokit/rest": "^22.0.0",
19876
19876
  "@supabase/supabase-js": "^2.106.1",
19877
- "better-sqlite3": "^12.6.2",
19878
19877
  cac: "^6.7.14",
19879
- "cli-progress": "^3.12.0",
19880
19878
  "compare-versions": "^6.1.1",
19881
19879
  diff: "^8.0.3",
19882
19880
  "fs-extra": "^11.2.0",
19883
19881
  "gray-matter": "^4.0.3",
19884
19882
  ignore: "^5.3.2",
19885
- minimatch: "^10.1.1",
19886
19883
  open: "^10.1.0",
19887
19884
  ora: "^8.0.0",
19888
19885
  "p-limit": "^7.2.0",
@@ -19900,9 +19897,7 @@ var init_package = __esm(() => {
19900
19897
  "@biomejs/biome": "^1.9.4",
19901
19898
  "@semantic-release/changelog": "^6.0.3",
19902
19899
  "@semantic-release/git": "^10.0.1",
19903
- "@types/better-sqlite3": "^7.6.13",
19904
19900
  "@types/bun": "latest",
19905
- "@types/cli-progress": "^3.11.6",
19906
19901
  "@types/diff": "^8.0.0",
19907
19902
  "@types/fs-extra": "^11.0.4",
19908
19903
  "@types/node": "^22.19.7",
@@ -29249,1673 +29244,21 @@ var init_selective_merger = __esm(() => {
29249
29244
  import_semver = __toESM(require_semver2(), 1);
29250
29245
  });
29251
29246
 
29252
- // node_modules/balanced-match/dist/esm/index.js
29253
- var balanced = (a3, b3, str2) => {
29254
- const ma = a3 instanceof RegExp ? maybeMatch(a3, str2) : a3;
29255
- const mb = b3 instanceof RegExp ? maybeMatch(b3, str2) : b3;
29256
- const r2 = ma !== null && mb != null && range(ma, mb, str2);
29257
- return r2 && {
29258
- start: r2[0],
29259
- end: r2[1],
29260
- pre: str2.slice(0, r2[0]),
29261
- body: str2.slice(r2[0] + ma.length, r2[1]),
29262
- post: str2.slice(r2[1] + mb.length)
29263
- };
29264
- }, maybeMatch = (reg, str2) => {
29265
- const m2 = str2.match(reg);
29266
- return m2 ? m2[0] : null;
29267
- }, range = (a3, b3, str2) => {
29268
- let begs, beg, left, right = undefined, result;
29269
- let ai = str2.indexOf(a3);
29270
- let bi = str2.indexOf(b3, ai + 1);
29271
- let i = ai;
29272
- if (ai >= 0 && bi > 0) {
29273
- if (a3 === b3) {
29274
- return [ai, bi];
29275
- }
29276
- begs = [];
29277
- left = str2.length;
29278
- while (i >= 0 && !result) {
29279
- if (i === ai) {
29280
- begs.push(i);
29281
- ai = str2.indexOf(a3, i + 1);
29282
- } else if (begs.length === 1) {
29283
- const r2 = begs.pop();
29284
- if (r2 !== undefined)
29285
- result = [r2, bi];
29286
- } else {
29287
- beg = begs.pop();
29288
- if (beg !== undefined && beg < left) {
29289
- left = beg;
29290
- right = bi;
29291
- }
29292
- bi = str2.indexOf(b3, i + 1);
29293
- }
29294
- i = ai < bi && ai >= 0 ? ai : bi;
29295
- }
29296
- if (begs.length && right !== undefined) {
29297
- result = [left, right];
29298
- }
29299
- }
29300
- return result;
29301
- };
29302
-
29303
- // node_modules/brace-expansion/dist/esm/index.js
29304
- function numeric(str2) {
29305
- return !isNaN(str2) ? parseInt(str2, 10) : str2.charCodeAt(0);
29306
- }
29307
- function escapeBraces(str2) {
29308
- return str2.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
29309
- }
29310
- function unescapeBraces(str2) {
29311
- return str2.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
29312
- }
29313
- function parseCommaParts(str2) {
29314
- if (!str2) {
29315
- return [""];
29316
- }
29317
- const parts = [];
29318
- const m2 = balanced("{", "}", str2);
29319
- if (!m2) {
29320
- return str2.split(",");
29321
- }
29322
- const { pre, body, post: post2 } = m2;
29323
- const p = pre.split(",");
29324
- p[p.length - 1] += "{" + body + "}";
29325
- const postParts = parseCommaParts(post2);
29326
- if (post2.length) {
29327
- p[p.length - 1] += postParts.shift();
29328
- p.push.apply(p, postParts);
29329
- }
29330
- parts.push.apply(parts, p);
29331
- return parts;
29332
- }
29333
- function expand(str2, options2 = {}) {
29334
- if (!str2) {
29335
- return [];
29336
- }
29337
- const { max = EXPANSION_MAX } = options2;
29338
- if (str2.slice(0, 2) === "{}") {
29339
- str2 = "\\{\\}" + str2.slice(2);
29340
- }
29341
- return expand_(escapeBraces(str2), max, true).map(unescapeBraces);
29342
- }
29343
- function embrace(str2) {
29344
- return "{" + str2 + "}";
29345
- }
29346
- function isPadded(el) {
29347
- return /^-?0\d/.test(el);
29348
- }
29349
- function lte(i, y3) {
29350
- return i <= y3;
29351
- }
29352
- function gte(i, y3) {
29353
- return i >= y3;
29354
- }
29355
- function expand_(str2, max, isTop) {
29356
- const expansions = [];
29357
- const m2 = balanced("{", "}", str2);
29358
- if (!m2)
29359
- return [str2];
29360
- const pre = m2.pre;
29361
- const post2 = m2.post.length ? expand_(m2.post, max, false) : [""];
29362
- if (/\$$/.test(m2.pre)) {
29363
- for (let k2 = 0;k2 < post2.length && k2 < max; k2++) {
29364
- const expansion = pre + "{" + m2.body + "}" + post2[k2];
29365
- expansions.push(expansion);
29366
- }
29367
- } else {
29368
- const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m2.body);
29369
- const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m2.body);
29370
- const isSequence = isNumericSequence || isAlphaSequence;
29371
- const isOptions = m2.body.indexOf(",") >= 0;
29372
- if (!isSequence && !isOptions) {
29373
- if (m2.post.match(/,(?!,).*\}/)) {
29374
- str2 = m2.pre + "{" + m2.body + escClose + m2.post;
29375
- return expand_(str2, max, true);
29376
- }
29377
- return [str2];
29378
- }
29379
- let n;
29380
- if (isSequence) {
29381
- n = m2.body.split(/\.\./);
29382
- } else {
29383
- n = parseCommaParts(m2.body);
29384
- if (n.length === 1 && n[0] !== undefined) {
29385
- n = expand_(n[0], max, false).map(embrace);
29386
- if (n.length === 1) {
29387
- return post2.map((p) => m2.pre + n[0] + p);
29388
- }
29389
- }
29390
- }
29391
- let N2;
29392
- if (isSequence && n[0] !== undefined && n[1] !== undefined) {
29393
- const x3 = numeric(n[0]);
29394
- const y3 = numeric(n[1]);
29395
- const width = Math.max(n[0].length, n[1].length);
29396
- let incr = n.length === 3 && n[2] !== undefined ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
29397
- let test = lte;
29398
- const reverse = y3 < x3;
29399
- if (reverse) {
29400
- incr *= -1;
29401
- test = gte;
29402
- }
29403
- const pad = n.some(isPadded);
29404
- N2 = [];
29405
- for (let i = x3;test(i, y3); i += incr) {
29406
- let c2;
29407
- if (isAlphaSequence) {
29408
- c2 = String.fromCharCode(i);
29409
- if (c2 === "\\") {
29410
- c2 = "";
29411
- }
29412
- } else {
29413
- c2 = String(i);
29414
- if (pad) {
29415
- const need = width - c2.length;
29416
- if (need > 0) {
29417
- const z3 = new Array(need + 1).join("0");
29418
- if (i < 0) {
29419
- c2 = "-" + z3 + c2.slice(1);
29420
- } else {
29421
- c2 = z3 + c2;
29422
- }
29423
- }
29424
- }
29425
- }
29426
- N2.push(c2);
29427
- }
29428
- } else {
29429
- N2 = [];
29430
- for (let j2 = 0;j2 < n.length; j2++) {
29431
- N2.push.apply(N2, expand_(n[j2], max, false));
29432
- }
29433
- }
29434
- for (let j2 = 0;j2 < N2.length; j2++) {
29435
- for (let k2 = 0;k2 < post2.length && expansions.length < max; k2++) {
29436
- const expansion = pre + N2[j2] + post2[k2];
29437
- if (!isTop || isSequence || expansion) {
29438
- expansions.push(expansion);
29439
- }
29440
- }
29441
- }
29442
- }
29443
- return expansions;
29444
- }
29445
- var escSlash, escOpen, escClose, escComma, escPeriod, escSlashPattern, escOpenPattern, escClosePattern, escCommaPattern, escPeriodPattern, slashPattern, openPattern, closePattern, commaPattern, periodPattern, EXPANSION_MAX = 1e5;
29446
- var init_esm = __esm(() => {
29447
- escSlash = "\x00SLASH" + Math.random() + "\x00";
29448
- escOpen = "\x00OPEN" + Math.random() + "\x00";
29449
- escClose = "\x00CLOSE" + Math.random() + "\x00";
29450
- escComma = "\x00COMMA" + Math.random() + "\x00";
29451
- escPeriod = "\x00PERIOD" + Math.random() + "\x00";
29452
- escSlashPattern = new RegExp(escSlash, "g");
29453
- escOpenPattern = new RegExp(escOpen, "g");
29454
- escClosePattern = new RegExp(escClose, "g");
29455
- escCommaPattern = new RegExp(escComma, "g");
29456
- escPeriodPattern = new RegExp(escPeriod, "g");
29457
- slashPattern = /\\\\/g;
29458
- openPattern = /\\{/g;
29459
- closePattern = /\\}/g;
29460
- commaPattern = /\\,/g;
29461
- periodPattern = /\\\./g;
29462
- });
29463
-
29464
- // node_modules/minimatch/dist/esm/assert-valid-pattern.js
29465
- var MAX_PATTERN_LENGTH, assertValidPattern = (pattern) => {
29466
- if (typeof pattern !== "string") {
29467
- throw new TypeError("invalid pattern");
29468
- }
29469
- if (pattern.length > MAX_PATTERN_LENGTH) {
29470
- throw new TypeError("pattern is too long");
29471
- }
29472
- };
29473
- var init_assert_valid_pattern = __esm(() => {
29474
- MAX_PATTERN_LENGTH = 1024 * 64;
29475
- });
29476
-
29477
- // node_modules/minimatch/dist/esm/brace-expressions.js
29478
- var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), rangesToString = (ranges) => ranges.join(""), parseClass = (glob, position) => {
29479
- const pos = position;
29480
- if (glob.charAt(pos) !== "[") {
29481
- throw new Error("not in a brace expression");
29482
- }
29483
- const ranges = [];
29484
- const negs = [];
29485
- let i = pos + 1;
29486
- let sawStart = false;
29487
- let uflag = false;
29488
- let escaping = false;
29489
- let negate = false;
29490
- let endPos = pos;
29491
- let rangeStart = "";
29492
- WHILE:
29493
- while (i < glob.length) {
29494
- const c2 = glob.charAt(i);
29495
- if ((c2 === "!" || c2 === "^") && i === pos + 1) {
29496
- negate = true;
29497
- i++;
29498
- continue;
29499
- }
29500
- if (c2 === "]" && sawStart && !escaping) {
29501
- endPos = i + 1;
29502
- break;
29503
- }
29504
- sawStart = true;
29505
- if (c2 === "\\") {
29506
- if (!escaping) {
29507
- escaping = true;
29508
- i++;
29509
- continue;
29510
- }
29511
- }
29512
- if (c2 === "[" && !escaping) {
29513
- for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
29514
- if (glob.startsWith(cls, i)) {
29515
- if (rangeStart) {
29516
- return ["$.", false, glob.length - pos, true];
29517
- }
29518
- i += cls.length;
29519
- if (neg)
29520
- negs.push(unip);
29521
- else
29522
- ranges.push(unip);
29523
- uflag = uflag || u;
29524
- continue WHILE;
29525
- }
29526
- }
29527
- }
29528
- escaping = false;
29529
- if (rangeStart) {
29530
- if (c2 > rangeStart) {
29531
- ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c2));
29532
- } else if (c2 === rangeStart) {
29533
- ranges.push(braceEscape(c2));
29534
- }
29535
- rangeStart = "";
29536
- i++;
29537
- continue;
29538
- }
29539
- if (glob.startsWith("-]", i + 1)) {
29540
- ranges.push(braceEscape(c2 + "-"));
29541
- i += 2;
29542
- continue;
29543
- }
29544
- if (glob.startsWith("-", i + 1)) {
29545
- rangeStart = c2;
29546
- i += 2;
29547
- continue;
29548
- }
29549
- ranges.push(braceEscape(c2));
29550
- i++;
29551
- }
29552
- if (endPos < i) {
29553
- return ["", false, 0, false];
29554
- }
29555
- if (!ranges.length && !negs.length) {
29556
- return ["$.", false, glob.length - pos, true];
29557
- }
29558
- if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
29559
- const r2 = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
29560
- return [regexpEscape(r2), false, endPos - pos, false];
29561
- }
29562
- const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
29563
- const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
29564
- const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
29565
- return [comb, uflag, endPos - pos, true];
29566
- };
29567
- var init_brace_expressions = __esm(() => {
29568
- posixClasses = {
29569
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
29570
- "[:alpha:]": ["\\p{L}\\p{Nl}", true],
29571
- "[:ascii:]": ["\\x" + "00-\\x" + "7f", false],
29572
- "[:blank:]": ["\\p{Zs}\\t", true],
29573
- "[:cntrl:]": ["\\p{Cc}", true],
29574
- "[:digit:]": ["\\p{Nd}", true],
29575
- "[:graph:]": ["\\p{Z}\\p{C}", true, true],
29576
- "[:lower:]": ["\\p{Ll}", true],
29577
- "[:print:]": ["\\p{C}", true],
29578
- "[:punct:]": ["\\p{P}", true],
29579
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
29580
- "[:upper:]": ["\\p{Lu}", true],
29581
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
29582
- "[:xdigit:]": ["A-Fa-f0-9", false]
29583
- };
29584
- });
29585
-
29586
- // node_modules/minimatch/dist/esm/unescape.js
29587
- var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
29588
- if (magicalBraces) {
29589
- return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
29590
- }
29591
- return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
29592
- };
29593
-
29594
- // node_modules/minimatch/dist/esm/ast.js
29595
- var _a, types2, isExtglobType = (c2) => types2.has(c2), isExtglobAST = (c2) => isExtglobType(c2.type), adoptionMap, adoptionWithSpaceMap, adoptionAnyMap, usurpMap, startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))", startNoDot = "(?!\\.)", addPatternStart, justDots, reSpecials, regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), qmark = "[^/]", star, starNoEmpty, ID = 0, AST;
29596
- var init_ast = __esm(() => {
29597
- init_brace_expressions();
29598
- types2 = new Set(["!", "?", "+", "*", "@"]);
29599
- adoptionMap = new Map([
29600
- ["!", ["@"]],
29601
- ["?", ["?", "@"]],
29602
- ["@", ["@"]],
29603
- ["*", ["*", "+", "?", "@"]],
29604
- ["+", ["+", "@"]]
29605
- ]);
29606
- adoptionWithSpaceMap = new Map([
29607
- ["!", ["?"]],
29608
- ["@", ["?"]],
29609
- ["+", ["?", "*"]]
29610
- ]);
29611
- adoptionAnyMap = new Map([
29612
- ["!", ["?", "@"]],
29613
- ["?", ["?", "@"]],
29614
- ["@", ["?", "@"]],
29615
- ["*", ["*", "+", "?", "@"]],
29616
- ["+", ["+", "@", "?", "*"]]
29617
- ]);
29618
- usurpMap = new Map([
29619
- ["!", new Map([["!", "@"]])],
29620
- [
29621
- "?",
29622
- new Map([
29623
- ["*", "*"],
29624
- ["+", "*"]
29625
- ])
29626
- ],
29627
- [
29628
- "@",
29629
- new Map([
29630
- ["!", "!"],
29631
- ["?", "?"],
29632
- ["@", "@"],
29633
- ["*", "*"],
29634
- ["+", "+"]
29635
- ])
29636
- ],
29637
- [
29638
- "+",
29639
- new Map([
29640
- ["?", "*"],
29641
- ["*", "*"]
29642
- ])
29643
- ]
29644
- ]);
29645
- addPatternStart = new Set(["[", "."]);
29646
- justDots = new Set(["..", "."]);
29647
- reSpecials = new Set("().*{}+?[]^$\\!");
29648
- star = qmark + "*?";
29649
- starNoEmpty = qmark + "+?";
29650
- AST = class AST {
29651
- type;
29652
- #root;
29653
- #hasMagic;
29654
- #uflag = false;
29655
- #parts = [];
29656
- #parent;
29657
- #parentIndex;
29658
- #negs;
29659
- #filledNegs = false;
29660
- #options;
29661
- #toString;
29662
- #emptyExt = false;
29663
- id = ++ID;
29664
- get depth() {
29665
- return (this.#parent?.depth ?? -1) + 1;
29666
- }
29667
- [Symbol.for("nodejs.util.inspect.custom")]() {
29668
- return {
29669
- "@@type": "AST",
29670
- id: this.id,
29671
- type: this.type,
29672
- root: this.#root.id,
29673
- parent: this.#parent?.id,
29674
- depth: this.depth,
29675
- partsLength: this.#parts.length,
29676
- parts: this.#parts
29677
- };
29678
- }
29679
- constructor(type, parent, options2 = {}) {
29680
- this.type = type;
29681
- if (type)
29682
- this.#hasMagic = true;
29683
- this.#parent = parent;
29684
- this.#root = this.#parent ? this.#parent.#root : this;
29685
- this.#options = this.#root === this ? options2 : this.#root.#options;
29686
- this.#negs = this.#root === this ? [] : this.#root.#negs;
29687
- if (type === "!" && !this.#root.#filledNegs)
29688
- this.#negs.push(this);
29689
- this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
29690
- }
29691
- get hasMagic() {
29692
- if (this.#hasMagic !== undefined)
29693
- return this.#hasMagic;
29694
- for (const p of this.#parts) {
29695
- if (typeof p === "string")
29696
- continue;
29697
- if (p.type || p.hasMagic)
29698
- return this.#hasMagic = true;
29699
- }
29700
- return this.#hasMagic;
29701
- }
29702
- toString() {
29703
- return this.#toString !== undefined ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
29704
- }
29705
- #fillNegs() {
29706
- if (this !== this.#root)
29707
- throw new Error("should only call on root");
29708
- if (this.#filledNegs)
29709
- return this;
29710
- this.toString();
29711
- this.#filledNegs = true;
29712
- let n;
29713
- while (n = this.#negs.pop()) {
29714
- if (n.type !== "!")
29715
- continue;
29716
- let p = n;
29717
- let pp = p.#parent;
29718
- while (pp) {
29719
- for (let i = p.#parentIndex + 1;!pp.type && i < pp.#parts.length; i++) {
29720
- for (const part of n.#parts) {
29721
- if (typeof part === "string") {
29722
- throw new Error("string part in extglob AST??");
29723
- }
29724
- part.copyIn(pp.#parts[i]);
29725
- }
29726
- }
29727
- p = pp;
29728
- pp = p.#parent;
29729
- }
29730
- }
29731
- return this;
29732
- }
29733
- push(...parts) {
29734
- for (const p of parts) {
29735
- if (p === "")
29736
- continue;
29737
- if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
29738
- throw new Error("invalid part: " + p);
29739
- }
29740
- this.#parts.push(p);
29741
- }
29742
- }
29743
- toJSON() {
29744
- const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
29745
- if (this.isStart() && !this.type)
29746
- ret.unshift([]);
29747
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
29748
- ret.push({});
29749
- }
29750
- return ret;
29751
- }
29752
- isStart() {
29753
- if (this.#root === this)
29754
- return true;
29755
- if (!this.#parent?.isStart())
29756
- return false;
29757
- if (this.#parentIndex === 0)
29758
- return true;
29759
- const p = this.#parent;
29760
- for (let i = 0;i < this.#parentIndex; i++) {
29761
- const pp = p.#parts[i];
29762
- if (!(pp instanceof _a && pp.type === "!")) {
29763
- return false;
29764
- }
29765
- }
29766
- return true;
29767
- }
29768
- isEnd() {
29769
- if (this.#root === this)
29770
- return true;
29771
- if (this.#parent?.type === "!")
29772
- return true;
29773
- if (!this.#parent?.isEnd())
29774
- return false;
29775
- if (!this.type)
29776
- return this.#parent?.isEnd();
29777
- const pl = this.#parent ? this.#parent.#parts.length : 0;
29778
- return this.#parentIndex === pl - 1;
29779
- }
29780
- copyIn(part) {
29781
- if (typeof part === "string")
29782
- this.push(part);
29783
- else
29784
- this.push(part.clone(this));
29785
- }
29786
- clone(parent) {
29787
- const c2 = new _a(this.type, parent);
29788
- for (const p of this.#parts) {
29789
- c2.copyIn(p);
29790
- }
29791
- return c2;
29792
- }
29793
- static #parseAST(str2, ast, pos, opt, extDepth) {
29794
- const maxDepth = opt.maxExtglobRecursion ?? 2;
29795
- let escaping = false;
29796
- let inBrace = false;
29797
- let braceStart = -1;
29798
- let braceNeg = false;
29799
- if (ast.type === null) {
29800
- let i2 = pos;
29801
- let acc2 = "";
29802
- while (i2 < str2.length) {
29803
- const c2 = str2.charAt(i2++);
29804
- if (escaping || c2 === "\\") {
29805
- escaping = !escaping;
29806
- acc2 += c2;
29807
- continue;
29808
- }
29809
- if (inBrace) {
29810
- if (i2 === braceStart + 1) {
29811
- if (c2 === "^" || c2 === "!") {
29812
- braceNeg = true;
29813
- }
29814
- } else if (c2 === "]" && !(i2 === braceStart + 2 && braceNeg)) {
29815
- inBrace = false;
29816
- }
29817
- acc2 += c2;
29818
- continue;
29819
- } else if (c2 === "[") {
29820
- inBrace = true;
29821
- braceStart = i2;
29822
- braceNeg = false;
29823
- acc2 += c2;
29824
- continue;
29825
- }
29826
- const doRecurse = !opt.noext && isExtglobType(c2) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
29827
- if (doRecurse) {
29828
- ast.push(acc2);
29829
- acc2 = "";
29830
- const ext = new _a(c2, ast);
29831
- i2 = _a.#parseAST(str2, ext, i2, opt, extDepth + 1);
29832
- ast.push(ext);
29833
- continue;
29834
- }
29835
- acc2 += c2;
29836
- }
29837
- ast.push(acc2);
29838
- return i2;
29839
- }
29840
- let i = pos + 1;
29841
- let part = new _a(null, ast);
29842
- const parts = [];
29843
- let acc = "";
29844
- while (i < str2.length) {
29845
- const c2 = str2.charAt(i++);
29846
- if (escaping || c2 === "\\") {
29847
- escaping = !escaping;
29848
- acc += c2;
29849
- continue;
29850
- }
29851
- if (inBrace) {
29852
- if (i === braceStart + 1) {
29853
- if (c2 === "^" || c2 === "!") {
29854
- braceNeg = true;
29855
- }
29856
- } else if (c2 === "]" && !(i === braceStart + 2 && braceNeg)) {
29857
- inBrace = false;
29858
- }
29859
- acc += c2;
29860
- continue;
29861
- } else if (c2 === "[") {
29862
- inBrace = true;
29863
- braceStart = i;
29864
- braceNeg = false;
29865
- acc += c2;
29866
- continue;
29867
- }
29868
- const doRecurse = !opt.noext && isExtglobType(c2) && str2.charAt(i) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c2));
29869
- if (doRecurse) {
29870
- const depthAdd = ast && ast.#canAdoptType(c2) ? 0 : 1;
29871
- part.push(acc);
29872
- acc = "";
29873
- const ext = new _a(c2, part);
29874
- part.push(ext);
29875
- i = _a.#parseAST(str2, ext, i, opt, extDepth + depthAdd);
29876
- continue;
29877
- }
29878
- if (c2 === "|") {
29879
- part.push(acc);
29880
- acc = "";
29881
- parts.push(part);
29882
- part = new _a(null, ast);
29883
- continue;
29884
- }
29885
- if (c2 === ")") {
29886
- if (acc === "" && ast.#parts.length === 0) {
29887
- ast.#emptyExt = true;
29888
- }
29889
- part.push(acc);
29890
- acc = "";
29891
- ast.push(...parts, part);
29892
- return i;
29893
- }
29894
- acc += c2;
29895
- }
29896
- ast.type = null;
29897
- ast.#hasMagic = undefined;
29898
- ast.#parts = [str2.substring(pos - 1)];
29899
- return i;
29900
- }
29901
- #canAdoptWithSpace(child) {
29902
- return this.#canAdopt(child, adoptionWithSpaceMap);
29903
- }
29904
- #canAdopt(child, map = adoptionMap) {
29905
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
29906
- return false;
29907
- }
29908
- const gc = child.#parts[0];
29909
- if (!gc || typeof gc !== "object" || gc.type === null) {
29910
- return false;
29911
- }
29912
- return this.#canAdoptType(gc.type, map);
29913
- }
29914
- #canAdoptType(c2, map = adoptionAnyMap) {
29915
- return !!map.get(this.type)?.includes(c2);
29916
- }
29917
- #adoptWithSpace(child, index) {
29918
- const gc = child.#parts[0];
29919
- const blank = new _a(null, gc, this.options);
29920
- blank.#parts.push("");
29921
- gc.push(blank);
29922
- this.#adopt(child, index);
29923
- }
29924
- #adopt(child, index) {
29925
- const gc = child.#parts[0];
29926
- this.#parts.splice(index, 1, ...gc.#parts);
29927
- for (const p of gc.#parts) {
29928
- if (typeof p === "object")
29929
- p.#parent = this;
29930
- }
29931
- this.#toString = undefined;
29932
- }
29933
- #canUsurpType(c2) {
29934
- const m2 = usurpMap.get(this.type);
29935
- return !!m2?.has(c2);
29936
- }
29937
- #canUsurp(child) {
29938
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
29939
- return false;
29940
- }
29941
- const gc = child.#parts[0];
29942
- if (!gc || typeof gc !== "object" || gc.type === null) {
29943
- return false;
29944
- }
29945
- return this.#canUsurpType(gc.type);
29946
- }
29947
- #usurp(child) {
29948
- const m2 = usurpMap.get(this.type);
29949
- const gc = child.#parts[0];
29950
- const nt = m2?.get(gc.type);
29951
- if (!nt)
29952
- return false;
29953
- this.#parts = gc.#parts;
29954
- for (const p of this.#parts) {
29955
- if (typeof p === "object") {
29956
- p.#parent = this;
29957
- }
29958
- }
29959
- this.type = nt;
29960
- this.#toString = undefined;
29961
- this.#emptyExt = false;
29962
- }
29963
- static fromGlob(pattern, options2 = {}) {
29964
- const ast = new _a(null, undefined, options2);
29965
- _a.#parseAST(pattern, ast, 0, options2, 0);
29966
- return ast;
29967
- }
29968
- toMMPattern() {
29969
- if (this !== this.#root)
29970
- return this.#root.toMMPattern();
29971
- const glob = this.toString();
29972
- const [re2, body, hasMagic, uflag] = this.toRegExpSource();
29973
- const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
29974
- if (!anyMagic) {
29975
- return body;
29976
- }
29977
- const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
29978
- return Object.assign(new RegExp(`^${re2}$`, flags), {
29979
- _src: re2,
29980
- _glob: glob
29981
- });
29982
- }
29983
- get options() {
29984
- return this.#options;
29985
- }
29986
- toRegExpSource(allowDot) {
29987
- const dot = allowDot ?? !!this.#options.dot;
29988
- if (this.#root === this) {
29989
- this.#flatten();
29990
- this.#fillNegs();
29991
- }
29992
- if (!isExtglobAST(this)) {
29993
- const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
29994
- const src = this.#parts.map((p) => {
29995
- const [re2, _3, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
29996
- this.#hasMagic = this.#hasMagic || hasMagic;
29997
- this.#uflag = this.#uflag || uflag;
29998
- return re2;
29999
- }).join("");
30000
- let start2 = "";
30001
- if (this.isStart()) {
30002
- if (typeof this.#parts[0] === "string") {
30003
- const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
30004
- if (!dotTravAllowed) {
30005
- const aps = addPatternStart;
30006
- const needNoTrav = dot && aps.has(src.charAt(0)) || src.startsWith("\\.") && aps.has(src.charAt(2)) || src.startsWith("\\.\\.") && aps.has(src.charAt(4));
30007
- const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
30008
- start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
30009
- }
30010
- }
30011
- }
30012
- let end = "";
30013
- if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
30014
- end = "(?:$|\\/)";
30015
- }
30016
- const final2 = start2 + src + end;
30017
- return [
30018
- final2,
30019
- unescape(src),
30020
- this.#hasMagic = !!this.#hasMagic,
30021
- this.#uflag
30022
- ];
30023
- }
30024
- const repeated = this.type === "*" || this.type === "+";
30025
- const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
30026
- let body = this.#partsToRegExp(dot);
30027
- if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
30028
- const s = this.toString();
30029
- const me2 = this;
30030
- me2.#parts = [s];
30031
- me2.type = null;
30032
- me2.#hasMagic = undefined;
30033
- return [s, unescape(this.toString()), false, false];
30034
- }
30035
- let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
30036
- if (bodyDotAllowed === body) {
30037
- bodyDotAllowed = "";
30038
- }
30039
- if (bodyDotAllowed) {
30040
- body = `(?:${body})(?:${bodyDotAllowed})*?`;
30041
- }
30042
- let final = "";
30043
- if (this.type === "!" && this.#emptyExt) {
30044
- final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
30045
- } else {
30046
- const close = this.type === "!" ? "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
30047
- final = start + body + close;
30048
- }
30049
- return [
30050
- final,
30051
- unescape(body),
30052
- this.#hasMagic = !!this.#hasMagic,
30053
- this.#uflag
30054
- ];
30055
- }
30056
- #flatten() {
30057
- if (!isExtglobAST(this)) {
30058
- for (const p of this.#parts) {
30059
- if (typeof p === "object") {
30060
- p.#flatten();
30061
- }
30062
- }
30063
- } else {
30064
- let iterations = 0;
30065
- let done = false;
30066
- do {
30067
- done = true;
30068
- for (let i = 0;i < this.#parts.length; i++) {
30069
- const c2 = this.#parts[i];
30070
- if (typeof c2 === "object") {
30071
- c2.#flatten();
30072
- if (this.#canAdopt(c2)) {
30073
- done = false;
30074
- this.#adopt(c2, i);
30075
- } else if (this.#canAdoptWithSpace(c2)) {
30076
- done = false;
30077
- this.#adoptWithSpace(c2, i);
30078
- } else if (this.#canUsurp(c2)) {
30079
- done = false;
30080
- this.#usurp(c2);
30081
- }
30082
- }
30083
- }
30084
- } while (!done && ++iterations < 10);
30085
- }
30086
- this.#toString = undefined;
30087
- }
30088
- #partsToRegExp(dot) {
30089
- return this.#parts.map((p) => {
30090
- if (typeof p === "string") {
30091
- throw new Error("string type in extglob ast??");
30092
- }
30093
- const [re2, _3, _hasMagic, uflag] = p.toRegExpSource(dot);
30094
- this.#uflag = this.#uflag || uflag;
30095
- return re2;
30096
- }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
30097
- }
30098
- static #parseGlob(glob, hasMagic, noEmpty = false) {
30099
- let escaping = false;
30100
- let re2 = "";
30101
- let uflag = false;
30102
- let inStar = false;
30103
- for (let i = 0;i < glob.length; i++) {
30104
- const c2 = glob.charAt(i);
30105
- if (escaping) {
30106
- escaping = false;
30107
- re2 += (reSpecials.has(c2) ? "\\" : "") + c2;
30108
- continue;
30109
- }
30110
- if (c2 === "*") {
30111
- if (inStar)
30112
- continue;
30113
- inStar = true;
30114
- re2 += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
30115
- hasMagic = true;
30116
- continue;
30117
- } else {
30118
- inStar = false;
30119
- }
30120
- if (c2 === "\\") {
30121
- if (i === glob.length - 1) {
30122
- re2 += "\\\\";
30123
- } else {
30124
- escaping = true;
30125
- }
30126
- continue;
30127
- }
30128
- if (c2 === "[") {
30129
- const [src, needUflag, consumed, magic] = parseClass(glob, i);
30130
- if (consumed) {
30131
- re2 += src;
30132
- uflag = uflag || needUflag;
30133
- i += consumed - 1;
30134
- hasMagic = hasMagic || magic;
30135
- continue;
30136
- }
30137
- }
30138
- if (c2 === "?") {
30139
- re2 += qmark;
30140
- hasMagic = true;
30141
- continue;
30142
- }
30143
- re2 += regExpEscape(c2);
30144
- }
30145
- return [re2, unescape(glob), !!hasMagic, uflag];
30146
- }
30147
- };
30148
- _a = AST;
30149
- });
30150
-
30151
- // node_modules/minimatch/dist/esm/escape.js
30152
- var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
30153
- if (magicalBraces) {
30154
- return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
30155
- }
30156
- return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
30157
- };
30158
-
30159
- // node_modules/minimatch/dist/esm/index.js
30160
- class Minimatch {
30161
- options;
30162
- set;
30163
- pattern;
30164
- windowsPathsNoEscape;
30165
- nonegate;
30166
- negate;
30167
- comment;
30168
- empty;
30169
- preserveMultipleSlashes;
30170
- partial;
30171
- globSet;
30172
- globParts;
30173
- nocase;
30174
- isWindows;
30175
- platform;
30176
- windowsNoMagicRoot;
30177
- maxGlobstarRecursion;
30178
- regexp;
30179
- constructor(pattern, options2 = {}) {
30180
- assertValidPattern(pattern);
30181
- options2 = options2 || {};
30182
- this.options = options2;
30183
- this.maxGlobstarRecursion = options2.maxGlobstarRecursion ?? 200;
30184
- this.pattern = pattern;
30185
- this.platform = options2.platform || defaultPlatform;
30186
- this.isWindows = this.platform === "win32";
30187
- const awe = "allowWindow" + "sEscape";
30188
- this.windowsPathsNoEscape = !!options2.windowsPathsNoEscape || options2[awe] === false;
30189
- if (this.windowsPathsNoEscape) {
30190
- this.pattern = this.pattern.replace(/\\/g, "/");
30191
- }
30192
- this.preserveMultipleSlashes = !!options2.preserveMultipleSlashes;
30193
- this.regexp = null;
30194
- this.negate = false;
30195
- this.nonegate = !!options2.nonegate;
30196
- this.comment = false;
30197
- this.empty = false;
30198
- this.partial = !!options2.partial;
30199
- this.nocase = !!this.options.nocase;
30200
- this.windowsNoMagicRoot = options2.windowsNoMagicRoot !== undefined ? options2.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
30201
- this.globSet = [];
30202
- this.globParts = [];
30203
- this.set = [];
30204
- this.make();
30205
- }
30206
- hasMagic() {
30207
- if (this.options.magicalBraces && this.set.length > 1) {
30208
- return true;
30209
- }
30210
- for (const pattern of this.set) {
30211
- for (const part of pattern) {
30212
- if (typeof part !== "string")
30213
- return true;
30214
- }
30215
- }
30216
- return false;
30217
- }
30218
- debug(..._3) {}
30219
- make() {
30220
- const pattern = this.pattern;
30221
- const options2 = this.options;
30222
- if (!options2.nocomment && pattern.charAt(0) === "#") {
30223
- this.comment = true;
30224
- return;
30225
- }
30226
- if (!pattern) {
30227
- this.empty = true;
30228
- return;
30229
- }
30230
- this.parseNegate();
30231
- this.globSet = [...new Set(this.braceExpand())];
30232
- if (options2.debug) {
30233
- this.debug = (...args) => console.error(...args);
30234
- }
30235
- this.debug(this.pattern, this.globSet);
30236
- const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
30237
- this.globParts = this.preprocess(rawGlobParts);
30238
- this.debug(this.pattern, this.globParts);
30239
- let set = this.globParts.map((s, _3, __) => {
30240
- if (this.isWindows && this.windowsNoMagicRoot) {
30241
- const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
30242
- const isDrive = /^[a-z]:/i.test(s[0]);
30243
- if (isUNC) {
30244
- return [
30245
- ...s.slice(0, 4),
30246
- ...s.slice(4).map((ss) => this.parse(ss))
30247
- ];
30248
- } else if (isDrive) {
30249
- return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
30250
- }
30251
- }
30252
- return s.map((ss) => this.parse(ss));
30253
- });
30254
- this.debug(this.pattern, set);
30255
- this.set = set.filter((s) => s.indexOf(false) === -1);
30256
- if (this.isWindows) {
30257
- for (let i = 0;i < this.set.length; i++) {
30258
- const p = this.set[i];
30259
- if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
30260
- p[2] = "?";
30261
- }
30262
- }
30263
- }
30264
- this.debug(this.pattern, this.set);
30265
- }
30266
- preprocess(globParts) {
30267
- if (this.options.noglobstar) {
30268
- for (const partset of globParts) {
30269
- for (let j2 = 0;j2 < partset.length; j2++) {
30270
- if (partset[j2] === "**") {
30271
- partset[j2] = "*";
30272
- }
30273
- }
30274
- }
30275
- }
30276
- const { optimizationLevel = 1 } = this.options;
30277
- if (optimizationLevel >= 2) {
30278
- globParts = this.firstPhasePreProcess(globParts);
30279
- globParts = this.secondPhasePreProcess(globParts);
30280
- } else if (optimizationLevel >= 1) {
30281
- globParts = this.levelOneOptimize(globParts);
30282
- } else {
30283
- globParts = this.adjascentGlobstarOptimize(globParts);
30284
- }
30285
- return globParts;
30286
- }
30287
- adjascentGlobstarOptimize(globParts) {
30288
- return globParts.map((parts) => {
30289
- let gs = -1;
30290
- while ((gs = parts.indexOf("**", gs + 1)) !== -1) {
30291
- let i = gs;
30292
- while (parts[i + 1] === "**") {
30293
- i++;
30294
- }
30295
- if (i !== gs) {
30296
- parts.splice(gs, i - gs);
30297
- }
30298
- }
30299
- return parts;
30300
- });
30301
- }
30302
- levelOneOptimize(globParts) {
30303
- return globParts.map((parts) => {
30304
- parts = parts.reduce((set, part) => {
30305
- const prev = set[set.length - 1];
30306
- if (part === "**" && prev === "**") {
30307
- return set;
30308
- }
30309
- if (part === "..") {
30310
- if (prev && prev !== ".." && prev !== "." && prev !== "**") {
30311
- set.pop();
30312
- return set;
30313
- }
30314
- }
30315
- set.push(part);
30316
- return set;
30317
- }, []);
30318
- return parts.length === 0 ? [""] : parts;
30319
- });
30320
- }
30321
- levelTwoFileOptimize(parts) {
30322
- if (!Array.isArray(parts)) {
30323
- parts = this.slashSplit(parts);
30324
- }
30325
- let didSomething = false;
30326
- do {
30327
- didSomething = false;
30328
- if (!this.preserveMultipleSlashes) {
30329
- for (let i = 1;i < parts.length - 1; i++) {
30330
- const p = parts[i];
30331
- if (i === 1 && p === "" && parts[0] === "")
30332
- continue;
30333
- if (p === "." || p === "") {
30334
- didSomething = true;
30335
- parts.splice(i, 1);
30336
- i--;
30337
- }
30338
- }
30339
- if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
30340
- didSomething = true;
30341
- parts.pop();
30342
- }
30343
- }
30344
- let dd = 0;
30345
- while ((dd = parts.indexOf("..", dd + 1)) !== -1) {
30346
- const p = parts[dd - 1];
30347
- if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) {
30348
- didSomething = true;
30349
- parts.splice(dd - 1, 2);
30350
- dd -= 2;
30351
- }
30352
- }
30353
- } while (didSomething);
30354
- return parts.length === 0 ? [""] : parts;
30355
- }
30356
- firstPhasePreProcess(globParts) {
30357
- let didSomething = false;
30358
- do {
30359
- didSomething = false;
30360
- for (let parts of globParts) {
30361
- let gs = -1;
30362
- while ((gs = parts.indexOf("**", gs + 1)) !== -1) {
30363
- let gss = gs;
30364
- while (parts[gss + 1] === "**") {
30365
- gss++;
30366
- }
30367
- if (gss > gs) {
30368
- parts.splice(gs + 1, gss - gs);
30369
- }
30370
- let next = parts[gs + 1];
30371
- const p = parts[gs + 2];
30372
- const p2 = parts[gs + 3];
30373
- if (next !== "..")
30374
- continue;
30375
- if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
30376
- continue;
30377
- }
30378
- didSomething = true;
30379
- parts.splice(gs, 1);
30380
- const other = parts.slice(0);
30381
- other[gs] = "**";
30382
- globParts.push(other);
30383
- gs--;
30384
- }
30385
- if (!this.preserveMultipleSlashes) {
30386
- for (let i = 1;i < parts.length - 1; i++) {
30387
- const p = parts[i];
30388
- if (i === 1 && p === "" && parts[0] === "")
30389
- continue;
30390
- if (p === "." || p === "") {
30391
- didSomething = true;
30392
- parts.splice(i, 1);
30393
- i--;
30394
- }
30395
- }
30396
- if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
30397
- didSomething = true;
30398
- parts.pop();
30399
- }
30400
- }
30401
- let dd = 0;
30402
- while ((dd = parts.indexOf("..", dd + 1)) !== -1) {
30403
- const p = parts[dd - 1];
30404
- if (p && p !== "." && p !== ".." && p !== "**") {
30405
- didSomething = true;
30406
- const needDot = dd === 1 && parts[dd + 1] === "**";
30407
- const splin = needDot ? ["."] : [];
30408
- parts.splice(dd - 1, 2, ...splin);
30409
- if (parts.length === 0)
30410
- parts.push("");
30411
- dd -= 2;
30412
- }
30413
- }
30414
- }
30415
- } while (didSomething);
30416
- return globParts;
30417
- }
30418
- secondPhasePreProcess(globParts) {
30419
- for (let i = 0;i < globParts.length - 1; i++) {
30420
- for (let j2 = i + 1;j2 < globParts.length; j2++) {
30421
- const matched = this.partsMatch(globParts[i], globParts[j2], !this.preserveMultipleSlashes);
30422
- if (matched) {
30423
- globParts[i] = [];
30424
- globParts[j2] = matched;
30425
- break;
30426
- }
30427
- }
30428
- }
30429
- return globParts.filter((gs) => gs.length);
30430
- }
30431
- partsMatch(a3, b3, emptyGSMatch = false) {
30432
- let ai = 0;
30433
- let bi = 0;
30434
- let result = [];
30435
- let which = "";
30436
- while (ai < a3.length && bi < b3.length) {
30437
- if (a3[ai] === b3[bi]) {
30438
- result.push(which === "b" ? b3[bi] : a3[ai]);
30439
- ai++;
30440
- bi++;
30441
- } else if (emptyGSMatch && a3[ai] === "**" && b3[bi] === a3[ai + 1]) {
30442
- result.push(a3[ai]);
30443
- ai++;
30444
- } else if (emptyGSMatch && b3[bi] === "**" && a3[ai] === b3[bi + 1]) {
30445
- result.push(b3[bi]);
30446
- bi++;
30447
- } else if (a3[ai] === "*" && b3[bi] && (this.options.dot || !b3[bi].startsWith(".")) && b3[bi] !== "**") {
30448
- if (which === "b")
30449
- return false;
30450
- which = "a";
30451
- result.push(a3[ai]);
30452
- ai++;
30453
- bi++;
30454
- } else if (b3[bi] === "*" && a3[ai] && (this.options.dot || !a3[ai].startsWith(".")) && a3[ai] !== "**") {
30455
- if (which === "a")
30456
- return false;
30457
- which = "b";
30458
- result.push(b3[bi]);
30459
- ai++;
30460
- bi++;
30461
- } else {
30462
- return false;
30463
- }
30464
- }
30465
- return a3.length === b3.length && result;
30466
- }
30467
- parseNegate() {
30468
- if (this.nonegate)
30469
- return;
30470
- const pattern = this.pattern;
30471
- let negate = false;
30472
- let negateOffset = 0;
30473
- for (let i = 0;i < pattern.length && pattern.charAt(i) === "!"; i++) {
30474
- negate = !negate;
30475
- negateOffset++;
30476
- }
30477
- if (negateOffset)
30478
- this.pattern = pattern.slice(negateOffset);
30479
- this.negate = negate;
30480
- }
30481
- matchOne(file, pattern, partial = false) {
30482
- let fileStartIndex = 0;
30483
- let patternStartIndex = 0;
30484
- if (this.isWindows) {
30485
- const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
30486
- const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
30487
- const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
30488
- const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
30489
- const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
30490
- const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
30491
- if (typeof fdi === "number" && typeof pdi === "number") {
30492
- const [fd, pd] = [
30493
- file[fdi],
30494
- pattern[pdi]
30495
- ];
30496
- if (fd.toLowerCase() === pd.toLowerCase()) {
30497
- pattern[pdi] = fd;
30498
- patternStartIndex = pdi;
30499
- fileStartIndex = fdi;
30500
- }
30501
- }
30502
- }
30503
- const { optimizationLevel = 1 } = this.options;
30504
- if (optimizationLevel >= 2) {
30505
- file = this.levelTwoFileOptimize(file);
30506
- }
30507
- if (pattern.includes(GLOBSTAR)) {
30508
- return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
30509
- }
30510
- return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
30511
- }
30512
- #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
30513
- const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
30514
- const lastgs = pattern.lastIndexOf(GLOBSTAR);
30515
- const [head2, body, tail] = partial ? [
30516
- pattern.slice(patternIndex, firstgs),
30517
- pattern.slice(firstgs + 1),
30518
- []
30519
- ] : [
30520
- pattern.slice(patternIndex, firstgs),
30521
- pattern.slice(firstgs + 1, lastgs),
30522
- pattern.slice(lastgs + 1)
30523
- ];
30524
- if (head2.length) {
30525
- const fileHead = file.slice(fileIndex, fileIndex + head2.length);
30526
- if (!this.#matchOne(fileHead, head2, partial, 0, 0)) {
30527
- return false;
30528
- }
30529
- fileIndex += head2.length;
30530
- patternIndex += head2.length;
30531
- }
30532
- let fileTailMatch = 0;
30533
- if (tail.length) {
30534
- if (tail.length + fileIndex > file.length)
30535
- return false;
30536
- let tailStart = file.length - tail.length;
30537
- if (this.#matchOne(file, tail, partial, tailStart, 0)) {
30538
- fileTailMatch = tail.length;
30539
- } else {
30540
- if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
30541
- return false;
30542
- }
30543
- tailStart--;
30544
- if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
30545
- return false;
30546
- }
30547
- fileTailMatch = tail.length + 1;
30548
- }
30549
- }
30550
- if (!body.length) {
30551
- let sawSome = !!fileTailMatch;
30552
- for (let i2 = fileIndex;i2 < file.length - fileTailMatch; i2++) {
30553
- const f3 = String(file[i2]);
30554
- sawSome = true;
30555
- if (f3 === "." || f3 === ".." || !this.options.dot && f3.startsWith(".")) {
30556
- return false;
30557
- }
30558
- }
30559
- return partial || sawSome;
30560
- }
30561
- const bodySegments = [[[], 0]];
30562
- let currentBody = bodySegments[0];
30563
- let nonGsParts = 0;
30564
- const nonGsPartsSums = [0];
30565
- for (const b3 of body) {
30566
- if (b3 === GLOBSTAR) {
30567
- nonGsPartsSums.push(nonGsParts);
30568
- currentBody = [[], 0];
30569
- bodySegments.push(currentBody);
30570
- } else {
30571
- currentBody[0].push(b3);
30572
- nonGsParts++;
30573
- }
30574
- }
30575
- let i = bodySegments.length - 1;
30576
- const fileLength = file.length - fileTailMatch;
30577
- for (const b3 of bodySegments) {
30578
- b3[1] = fileLength - (nonGsPartsSums[i--] + b3[0].length);
30579
- }
30580
- return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
30581
- }
30582
- #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
30583
- const bs = bodySegments[bodyIndex];
30584
- if (!bs) {
30585
- for (let i = fileIndex;i < file.length; i++) {
30586
- sawTail = true;
30587
- const f3 = file[i];
30588
- if (f3 === "." || f3 === ".." || !this.options.dot && f3.startsWith(".")) {
30589
- return false;
30590
- }
30591
- }
30592
- return sawTail;
30593
- }
30594
- const [body, after] = bs;
30595
- while (fileIndex <= after) {
30596
- const m2 = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
30597
- if (m2 && globStarDepth < this.maxGlobstarRecursion) {
30598
- const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
30599
- if (sub !== false) {
30600
- return sub;
30601
- }
30602
- }
30603
- const f3 = file[fileIndex];
30604
- if (f3 === "." || f3 === ".." || !this.options.dot && f3.startsWith(".")) {
30605
- return false;
30606
- }
30607
- fileIndex++;
30608
- }
30609
- return partial || null;
30610
- }
30611
- #matchOne(file, pattern, partial, fileIndex, patternIndex) {
30612
- let fi;
30613
- let pi;
30614
- let pl;
30615
- let fl;
30616
- for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
30617
- this.debug("matchOne loop");
30618
- let p = pattern[pi];
30619
- let f3 = file[fi];
30620
- this.debug(pattern, p, f3);
30621
- if (p === false || p === GLOBSTAR) {
30622
- return false;
30623
- }
30624
- let hit;
30625
- if (typeof p === "string") {
30626
- hit = f3 === p;
30627
- this.debug("string match", p, f3, hit);
30628
- } else {
30629
- hit = p.test(f3);
30630
- this.debug("pattern match", p, f3, hit);
30631
- }
30632
- if (!hit)
30633
- return false;
30634
- }
30635
- if (fi === fl && pi === pl) {
30636
- return true;
30637
- } else if (fi === fl) {
30638
- return partial;
30639
- } else if (pi === pl) {
30640
- return fi === fl - 1 && file[fi] === "";
30641
- } else {
30642
- throw new Error("wtf?");
30643
- }
30644
- }
30645
- braceExpand() {
30646
- return braceExpand(this.pattern, this.options);
30647
- }
30648
- parse(pattern) {
30649
- assertValidPattern(pattern);
30650
- const options2 = this.options;
30651
- if (pattern === "**")
30652
- return GLOBSTAR;
30653
- if (pattern === "")
30654
- return "";
30655
- let m2;
30656
- let fastTest = null;
30657
- if (m2 = pattern.match(starRE)) {
30658
- fastTest = options2.dot ? starTestDot : starTest;
30659
- } else if (m2 = pattern.match(starDotExtRE)) {
30660
- fastTest = (options2.nocase ? options2.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options2.dot ? starDotExtTestDot : starDotExtTest)(m2[1]);
30661
- } else if (m2 = pattern.match(qmarksRE)) {
30662
- fastTest = (options2.nocase ? options2.dot ? qmarksTestNocaseDot : qmarksTestNocase : options2.dot ? qmarksTestDot : qmarksTest)(m2);
30663
- } else if (m2 = pattern.match(starDotStarRE)) {
30664
- fastTest = options2.dot ? starDotStarTestDot : starDotStarTest;
30665
- } else if (m2 = pattern.match(dotStarRE)) {
30666
- fastTest = dotStarTest;
30667
- }
30668
- const re2 = AST.fromGlob(pattern, this.options).toMMPattern();
30669
- if (fastTest && typeof re2 === "object") {
30670
- Reflect.defineProperty(re2, "test", { value: fastTest });
30671
- }
30672
- return re2;
30673
- }
30674
- makeRe() {
30675
- if (this.regexp || this.regexp === false)
30676
- return this.regexp;
30677
- const set = this.set;
30678
- if (!set.length) {
30679
- this.regexp = false;
30680
- return this.regexp;
30681
- }
30682
- const options2 = this.options;
30683
- const twoStar = options2.noglobstar ? star2 : options2.dot ? twoStarDot : twoStarNoDot;
30684
- const flags = new Set(options2.nocase ? ["i"] : []);
30685
- let re2 = set.map((pattern) => {
30686
- const pp = pattern.map((p) => {
30687
- if (p instanceof RegExp) {
30688
- for (const f3 of p.flags.split(""))
30689
- flags.add(f3);
30690
- }
30691
- return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
30692
- });
30693
- pp.forEach((p, i) => {
30694
- const next = pp[i + 1];
30695
- const prev = pp[i - 1];
30696
- if (p !== GLOBSTAR || prev === GLOBSTAR) {
30697
- return;
30698
- }
30699
- if (prev === undefined) {
30700
- if (next !== undefined && next !== GLOBSTAR) {
30701
- pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
30702
- } else {
30703
- pp[i] = twoStar;
30704
- }
30705
- } else if (next === undefined) {
30706
- pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
30707
- } else if (next !== GLOBSTAR) {
30708
- pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
30709
- pp[i + 1] = GLOBSTAR;
30710
- }
30711
- });
30712
- const filtered = pp.filter((p) => p !== GLOBSTAR);
30713
- if (this.partial && filtered.length >= 1) {
30714
- const prefixes = [];
30715
- for (let i = 1;i <= filtered.length; i++) {
30716
- prefixes.push(filtered.slice(0, i).join("/"));
30717
- }
30718
- return "(?:" + prefixes.join("|") + ")";
30719
- }
30720
- return filtered.join("/");
30721
- }).join("|");
30722
- const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
30723
- re2 = "^" + open + re2 + close + "$";
30724
- if (this.partial) {
30725
- re2 = "^(?:\\/|" + open + re2.slice(1, -1) + close + ")$";
30726
- }
30727
- if (this.negate)
30728
- re2 = "^(?!" + re2 + ").+$";
30729
- try {
30730
- this.regexp = new RegExp(re2, [...flags].join(""));
30731
- } catch {
30732
- this.regexp = false;
30733
- }
30734
- return this.regexp;
30735
- }
30736
- slashSplit(p) {
30737
- if (this.preserveMultipleSlashes) {
30738
- return p.split("/");
30739
- } else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
30740
- return ["", ...p.split(/\/+/)];
30741
- } else {
30742
- return p.split(/\/+/);
30743
- }
30744
- }
30745
- match(f3, partial = this.partial) {
30746
- this.debug("match", f3, this.pattern);
30747
- if (this.comment) {
30748
- return false;
30749
- }
30750
- if (this.empty) {
30751
- return f3 === "";
30752
- }
30753
- if (f3 === "/" && partial) {
30754
- return true;
30755
- }
30756
- const options2 = this.options;
30757
- if (this.isWindows) {
30758
- f3 = f3.split("\\").join("/");
30759
- }
30760
- const ff = this.slashSplit(f3);
30761
- this.debug(this.pattern, "split", ff);
30762
- const set = this.set;
30763
- this.debug(this.pattern, "set", set);
30764
- let filename = ff[ff.length - 1];
30765
- if (!filename) {
30766
- for (let i = ff.length - 2;!filename && i >= 0; i--) {
30767
- filename = ff[i];
30768
- }
30769
- }
30770
- for (const pattern of set) {
30771
- let file = ff;
30772
- if (options2.matchBase && pattern.length === 1) {
30773
- file = [filename];
30774
- }
30775
- const hit = this.matchOne(file, pattern, partial);
30776
- if (hit) {
30777
- if (options2.flipNegate) {
30778
- return true;
30779
- }
30780
- return !this.negate;
30781
- }
30782
- }
30783
- if (options2.flipNegate) {
30784
- return false;
30785
- }
30786
- return this.negate;
30787
- }
30788
- static defaults(def) {
30789
- return minimatch.defaults(def).Minimatch;
30790
- }
30791
- }
30792
- var minimatch = (p, pattern, options2 = {}) => {
30793
- assertValidPattern(pattern);
30794
- if (!options2.nocomment && pattern.charAt(0) === "#") {
30795
- return false;
30796
- }
30797
- return new Minimatch(pattern, options2).match(p);
30798
- }, starDotExtRE, starDotExtTest = (ext) => (f3) => !f3.startsWith(".") && f3.endsWith(ext), starDotExtTestDot = (ext) => (f3) => f3.endsWith(ext), starDotExtTestNocase = (ext) => {
30799
- ext = ext.toLowerCase();
30800
- return (f3) => !f3.startsWith(".") && f3.toLowerCase().endsWith(ext);
30801
- }, starDotExtTestNocaseDot = (ext) => {
30802
- ext = ext.toLowerCase();
30803
- return (f3) => f3.toLowerCase().endsWith(ext);
30804
- }, starDotStarRE, starDotStarTest = (f3) => !f3.startsWith(".") && f3.includes("."), starDotStarTestDot = (f3) => f3 !== "." && f3 !== ".." && f3.includes("."), dotStarRE, dotStarTest = (f3) => f3 !== "." && f3 !== ".." && f3.startsWith("."), starRE, starTest = (f3) => f3.length !== 0 && !f3.startsWith("."), starTestDot = (f3) => f3.length !== 0 && f3 !== "." && f3 !== "..", qmarksRE, qmarksTestNocase = ([$0, ext = ""]) => {
30805
- const noext = qmarksTestNoExt([$0]);
30806
- if (!ext)
30807
- return noext;
30808
- ext = ext.toLowerCase();
30809
- return (f3) => noext(f3) && f3.toLowerCase().endsWith(ext);
30810
- }, qmarksTestNocaseDot = ([$0, ext = ""]) => {
30811
- const noext = qmarksTestNoExtDot([$0]);
30812
- if (!ext)
30813
- return noext;
30814
- ext = ext.toLowerCase();
30815
- return (f3) => noext(f3) && f3.toLowerCase().endsWith(ext);
30816
- }, qmarksTestDot = ([$0, ext = ""]) => {
30817
- const noext = qmarksTestNoExtDot([$0]);
30818
- return !ext ? noext : (f3) => noext(f3) && f3.endsWith(ext);
30819
- }, qmarksTest = ([$0, ext = ""]) => {
30820
- const noext = qmarksTestNoExt([$0]);
30821
- return !ext ? noext : (f3) => noext(f3) && f3.endsWith(ext);
30822
- }, qmarksTestNoExt = ([$0]) => {
30823
- const len = $0.length;
30824
- return (f3) => f3.length === len && !f3.startsWith(".");
30825
- }, qmarksTestNoExtDot = ([$0]) => {
30826
- const len = $0.length;
30827
- return (f3) => f3.length === len && f3 !== "." && f3 !== "..";
30828
- }, defaultPlatform, path2, sep2, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options2 = {}) => (p) => minimatch(p, pattern, options2), ext = (a3, b3 = {}) => Object.assign({}, a3, b3), defaults = (def) => {
30829
- if (!def || typeof def !== "object" || !Object.keys(def).length) {
30830
- return minimatch;
30831
- }
30832
- const orig = minimatch;
30833
- const m2 = (p, pattern, options2 = {}) => orig(p, pattern, ext(def, options2));
30834
- return Object.assign(m2, {
30835
- Minimatch: class Minimatch extends orig.Minimatch {
30836
- constructor(pattern, options2 = {}) {
30837
- super(pattern, ext(def, options2));
30838
- }
30839
- static defaults(options2) {
30840
- return orig.defaults(ext(def, options2)).Minimatch;
30841
- }
30842
- },
30843
- AST: class AST2 extends orig.AST {
30844
- constructor(type, parent, options2 = {}) {
30845
- super(type, parent, ext(def, options2));
30846
- }
30847
- static fromGlob(pattern, options2 = {}) {
30848
- return orig.AST.fromGlob(pattern, ext(def, options2));
30849
- }
30850
- },
30851
- unescape: (s, options2 = {}) => orig.unescape(s, ext(def, options2)),
30852
- escape: (s, options2 = {}) => orig.escape(s, ext(def, options2)),
30853
- filter: (pattern, options2 = {}) => orig.filter(pattern, ext(def, options2)),
30854
- defaults: (options2) => orig.defaults(ext(def, options2)),
30855
- makeRe: (pattern, options2 = {}) => orig.makeRe(pattern, ext(def, options2)),
30856
- braceExpand: (pattern, options2 = {}) => orig.braceExpand(pattern, ext(def, options2)),
30857
- match: (list, pattern, options2 = {}) => orig.match(list, pattern, ext(def, options2)),
30858
- sep: orig.sep,
30859
- GLOBSTAR
30860
- });
30861
- }, braceExpand = (pattern, options2 = {}) => {
30862
- assertValidPattern(pattern);
30863
- if (options2.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
30864
- return [pattern];
30865
- }
30866
- return expand(pattern, { max: options2.braceExpandMax });
30867
- }, makeRe = (pattern, options2 = {}) => new Minimatch(pattern, options2).makeRe(), match = (list, pattern, options2 = {}) => {
30868
- const mm = new Minimatch(pattern, options2);
30869
- list = list.filter((f3) => mm.match(f3));
30870
- if (mm.options.nonull && !list.length) {
30871
- list.push(pattern);
30872
- }
30873
- return list;
30874
- }, globMagic, regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
30875
- var init_esm2 = __esm(() => {
30876
- init_esm();
30877
- init_assert_valid_pattern();
30878
- init_ast();
30879
- init_ast();
30880
- starDotExtRE = /^\*+([^+@!?*[(]*)$/;
30881
- starDotStarRE = /^\*+\.\*+$/;
30882
- dotStarRE = /^\.\*+$/;
30883
- starRE = /^\*+$/;
30884
- qmarksRE = /^\?+([^+@!?*[(]*)?$/;
30885
- defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
30886
- path2 = {
30887
- win32: { sep: "\\" },
30888
- posix: { sep: "/" }
30889
- };
30890
- sep2 = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep;
30891
- minimatch.sep = sep2;
30892
- GLOBSTAR = Symbol("globstar **");
30893
- minimatch.GLOBSTAR = GLOBSTAR;
30894
- star2 = qmark2 + "*?";
30895
- minimatch.filter = filter;
30896
- minimatch.defaults = defaults;
30897
- minimatch.braceExpand = braceExpand;
30898
- minimatch.makeRe = makeRe;
30899
- minimatch.match = match;
30900
- globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
30901
- minimatch.AST = AST;
30902
- minimatch.Minimatch = Minimatch;
30903
- minimatch.escape = escape;
30904
- minimatch.unescape = unescape;
30905
- });
30906
-
30907
29247
  // src/domains/installation/merger/file-scanner.ts
30908
29248
  import { relative as relative3 } from "node:path";
30909
29249
  import { join as join11 } from "node:path";
30910
29250
 
30911
29251
  class FileScanner {
30912
- includePatterns = [];
29252
+ includeMatchers = [];
30913
29253
  neverCopyChecker;
30914
29254
  constructor(neverCopyPatterns) {
30915
29255
  this.neverCopyChecker = import_ignore.default().add(neverCopyPatterns);
30916
29256
  }
30917
29257
  setIncludePatterns(patterns) {
30918
- this.includePatterns = patterns;
29258
+ this.includeMatchers = patterns.map((pattern) => {
29259
+ const globPattern = pattern.includes("*") ? pattern : `${pattern}/**`;
29260
+ return { pattern, matcher: import_picomatch2.default(globPattern, { dot: true }) };
29261
+ });
30919
29262
  }
30920
29263
  addIgnorePatterns(patterns) {
30921
29264
  this.neverCopyChecker.add(patterns);
@@ -30935,15 +29278,14 @@ class FileScanner {
30935
29278
  logger.warning(`Skipping symbolic link: ${normalizedRelativePath}`);
30936
29279
  continue;
30937
29280
  }
30938
- if (this.includePatterns.length > 0) {
30939
- const shouldInclude = this.includePatterns.some((pattern) => {
30940
- const globPattern = pattern.includes("*") ? pattern : `${pattern}/**`;
29281
+ if (this.includeMatchers.length > 0) {
29282
+ const shouldInclude = this.includeMatchers.some(({ pattern, matcher }) => {
30941
29283
  if (!stats.isDirectory()) {
30942
- return minimatch(normalizedRelativePath, globPattern, { dot: true });
29284
+ return matcher(normalizedRelativePath);
30943
29285
  }
30944
29286
  const normalizedPattern = pattern.endsWith("/") ? pattern.slice(0, -1) : pattern;
30945
29287
  const normalizedPath = normalizedRelativePath.endsWith("/") ? normalizedRelativePath.slice(0, -1) : normalizedRelativePath;
30946
- return normalizedPattern.startsWith(`${normalizedPath}/`) || normalizedPattern === normalizedPath || minimatch(normalizedRelativePath, globPattern, { dot: true });
29288
+ return normalizedPattern.startsWith(`${normalizedPath}/`) || normalizedPattern === normalizedPath || matcher(normalizedRelativePath);
30947
29289
  });
30948
29290
  if (!shouldInclude) {
30949
29291
  continue;
@@ -30959,12 +29301,12 @@ class FileScanner {
30959
29301
  return files;
30960
29302
  }
30961
29303
  }
30962
- var import_fs_extra8, import_ignore;
29304
+ var import_fs_extra8, import_ignore, import_picomatch2;
30963
29305
  var init_file_scanner = __esm(() => {
30964
29306
  init_logger();
30965
- init_esm2();
30966
29307
  import_fs_extra8 = __toESM(require_lib(), 1);
30967
29308
  import_ignore = __toESM(require_ignore(), 1);
29309
+ import_picomatch2 = __toESM(require_picomatch2(), 1);
30968
29310
  });
30969
29311
 
30970
29312
  // src/shared/safe-prompts.ts
@@ -31924,8 +30266,8 @@ class SettingsProcessor {
31924
30266
  const pluginRootMatch = command.match(/CLAUDE_PLUGIN_ROOT[^/]*\/([\w.\-/\\]+)/);
31925
30267
  if (pluginRootMatch)
31926
30268
  return pluginRootMatch[1].replace(/\\/g, "/");
31927
- const match2 = command.match(/\.claude[/\\]([\w.\-/\\]+)/);
31928
- return match2 ? match2[1].replace(/\\/g, "/") : null;
30269
+ const match = command.match(/\.claude[/\\]([\w.\-/\\]+)/);
30270
+ return match ? match[1].replace(/\\/g, "/") : null;
31929
30271
  }
31930
30272
  async trackInstalledSettings(settings) {
31931
30273
  if (!this.tracker)
@@ -32105,8 +30447,8 @@ class SettingsProcessor {
32105
30447
  timeout: 5000,
32106
30448
  stdio: ["ignore", "pipe", "ignore"]
32107
30449
  });
32108
- const match2 = output2.match(/(\d+\.\d+\.\d+)/);
32109
- this.cachedVersion = match2 ? match2[1] : null;
30450
+ const match = output2.match(/(\d+\.\d+\.\d+)/);
30451
+ this.cachedVersion = match ? match[1] : null;
32110
30452
  } catch {
32111
30453
  this.cachedVersion = null;
32112
30454
  }
@@ -32700,8 +31042,8 @@ var require_section_matter = __commonJS((exports, module) => {
32700
31042
  options2 = { parse: options2 };
32701
31043
  }
32702
31044
  var file = toObject(input);
32703
- var defaults2 = { section_delimiter: "---", parse: identity2 };
32704
- var opts = extend({}, defaults2, options2);
31045
+ var defaults = { section_delimiter: "---", parse: identity2 };
31046
+ var opts = extend({}, defaults, options2);
32705
31047
  var delim = opts.section_delimiter;
32706
31048
  var lines = file.content.split(/\r?\n/);
32707
31049
  var sections = null;
@@ -33039,34 +31381,34 @@ var require_schema = __commonJS((exports, module) => {
33039
31381
  }
33040
31382
  Schema.DEFAULT = null;
33041
31383
  Schema.create = function createSchema() {
33042
- var schemas, types3;
31384
+ var schemas, types2;
33043
31385
  switch (arguments.length) {
33044
31386
  case 1:
33045
31387
  schemas = Schema.DEFAULT;
33046
- types3 = arguments[0];
31388
+ types2 = arguments[0];
33047
31389
  break;
33048
31390
  case 2:
33049
31391
  schemas = arguments[0];
33050
- types3 = arguments[1];
31392
+ types2 = arguments[1];
33051
31393
  break;
33052
31394
  default:
33053
31395
  throw new YAMLException("Wrong number of arguments for Schema.create function");
33054
31396
  }
33055
31397
  schemas = common.toArray(schemas);
33056
- types3 = common.toArray(types3);
31398
+ types2 = common.toArray(types2);
33057
31399
  if (!schemas.every(function(schema) {
33058
31400
  return schema instanceof Schema;
33059
31401
  })) {
33060
31402
  throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
33061
31403
  }
33062
- if (!types3.every(function(type) {
31404
+ if (!types2.every(function(type) {
33063
31405
  return type instanceof Type;
33064
31406
  })) {
33065
31407
  throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
33066
31408
  }
33067
31409
  return new Schema({
33068
31410
  include: schemas,
33069
- explicit: types3
31411
+ explicit: types2
33070
31412
  });
33071
31413
  };
33072
31414
  module.exports = Schema;
@@ -33466,33 +31808,33 @@ var require_timestamp = __commonJS((exports, module) => {
33466
31808
  return false;
33467
31809
  }
33468
31810
  function constructYamlTimestamp(data) {
33469
- var match2, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
33470
- match2 = YAML_DATE_REGEXP.exec(data);
33471
- if (match2 === null)
33472
- match2 = YAML_TIMESTAMP_REGEXP.exec(data);
33473
- if (match2 === null)
31811
+ var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
31812
+ match = YAML_DATE_REGEXP.exec(data);
31813
+ if (match === null)
31814
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
31815
+ if (match === null)
33474
31816
  throw new Error("Date resolve error");
33475
- year = +match2[1];
33476
- month = +match2[2] - 1;
33477
- day = +match2[3];
33478
- if (!match2[4]) {
31817
+ year = +match[1];
31818
+ month = +match[2] - 1;
31819
+ day = +match[3];
31820
+ if (!match[4]) {
33479
31821
  return new Date(Date.UTC(year, month, day));
33480
31822
  }
33481
- hour = +match2[4];
33482
- minute = +match2[5];
33483
- second = +match2[6];
33484
- if (match2[7]) {
33485
- fraction = match2[7].slice(0, 3);
31823
+ hour = +match[4];
31824
+ minute = +match[5];
31825
+ second = +match[6];
31826
+ if (match[7]) {
31827
+ fraction = match[7].slice(0, 3);
33486
31828
  while (fraction.length < 3) {
33487
31829
  fraction += "0";
33488
31830
  }
33489
31831
  fraction = +fraction;
33490
31832
  }
33491
- if (match2[9]) {
33492
- tz_hour = +match2[10];
33493
- tz_minute = +(match2[11] || 0);
31833
+ if (match[9]) {
31834
+ tz_hour = +match[10];
31835
+ tz_minute = +(match[11] || 0);
33494
31836
  delta = (tz_hour * 60 + tz_minute) * 60000;
33495
- if (match2[9] === "-")
31837
+ if (match[9] === "-")
33496
31838
  delta = -delta;
33497
31839
  }
33498
31840
  date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
@@ -34009,19 +32351,19 @@ var require_loader = __commonJS((exports, module) => {
34009
32351
  }
34010
32352
  var directiveHandlers = {
34011
32353
  YAML: function handleYamlDirective(state, name, args) {
34012
- var match2, major, minor;
32354
+ var match, major, minor;
34013
32355
  if (state.version !== null) {
34014
32356
  throwError(state, "duplication of %YAML directive");
34015
32357
  }
34016
32358
  if (args.length !== 1) {
34017
32359
  throwError(state, "YAML directive accepts exactly one argument");
34018
32360
  }
34019
- match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
34020
- if (match2 === null) {
32361
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
32362
+ if (match === null) {
34021
32363
  throwError(state, "ill-formed argument of the YAML directive");
34022
32364
  }
34023
- major = parseInt(match2[1], 10);
34024
- minor = parseInt(match2[2], 10);
32365
+ major = parseInt(match[1], 10);
32366
+ minor = parseInt(match[2], 10);
34025
32367
  if (major !== 1) {
34026
32368
  throwError(state, "unacceptable YAML version of the document");
34027
32369
  }
@@ -35288,9 +33630,9 @@ var require_dumper = __commonJS((exports, module) => {
35288
33630
  var prevMoreIndented = string[0] === `
35289
33631
  ` || string[0] === " ";
35290
33632
  var moreIndented;
35291
- var match2;
35292
- while (match2 = lineRe.exec(string)) {
35293
- var prefix = match2[1], line = match2[2];
33633
+ var match;
33634
+ while (match = lineRe.exec(string)) {
33635
+ var prefix = match[1], line = match[2];
35294
33636
  moreIndented = line[0] === " ";
35295
33637
  result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? `
35296
33638
  ` : "") + foldLine(line, width);
@@ -35302,11 +33644,11 @@ var require_dumper = __commonJS((exports, module) => {
35302
33644
  if (line === "" || line[0] === " ")
35303
33645
  return line;
35304
33646
  var breakRe = / [^ ]/g;
35305
- var match2;
33647
+ var match;
35306
33648
  var start = 0, end, curr = 0, next = 0;
35307
33649
  var result = "";
35308
- while (match2 = breakRe.exec(line)) {
35309
- next = match2.index;
33650
+ while (match = breakRe.exec(line)) {
33651
+ next = match.index;
35310
33652
  if (next - start > width) {
35311
33653
  end = curr > start ? curr : next;
35312
33654
  result += `
@@ -35760,7 +34102,7 @@ var require_engine = __commonJS((exports, module) => {
35760
34102
  var require_stringify = __commonJS((exports, module) => {
35761
34103
  var typeOf = require_kind_of();
35762
34104
  var getEngine = require_engine();
35763
- var defaults2 = require_defaults();
34105
+ var defaults = require_defaults();
35764
34106
  module.exports = function(file, data, options2) {
35765
34107
  if (data == null && options2 == null) {
35766
34108
  switch (typeOf(file)) {
@@ -35776,7 +34118,7 @@ var require_stringify = __commonJS((exports, module) => {
35776
34118
  }
35777
34119
  }
35778
34120
  const str2 = file.content;
35779
- const opts = defaults2(options2);
34121
+ const opts = defaults(options2);
35780
34122
  if (data == null) {
35781
34123
  if (!opts.data)
35782
34124
  return file;
@@ -35811,20 +34153,20 @@ var require_stringify = __commonJS((exports, module) => {
35811
34153
 
35812
34154
  // node_modules/gray-matter/lib/excerpt.js
35813
34155
  var require_excerpt = __commonJS((exports, module) => {
35814
- var defaults2 = require_defaults();
34156
+ var defaults = require_defaults();
35815
34157
  module.exports = function(file, options2) {
35816
- const opts = defaults2(options2);
34158
+ const opts = defaults(options2);
35817
34159
  if (file.data == null) {
35818
34160
  file.data = {};
35819
34161
  }
35820
34162
  if (typeof opts.excerpt === "function") {
35821
34163
  return opts.excerpt(file, opts);
35822
34164
  }
35823
- const sep3 = file.data.excerpt_separator || opts.excerpt_separator;
35824
- if (sep3 == null && (opts.excerpt === false || opts.excerpt == null)) {
34165
+ const sep2 = file.data.excerpt_separator || opts.excerpt_separator;
34166
+ if (sep2 == null && (opts.excerpt === false || opts.excerpt == null)) {
35825
34167
  return file;
35826
34168
  }
35827
- const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep3 || opts.delimiters[0];
34169
+ const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep2 || opts.delimiters[0];
35828
34170
  const idx = file.content.indexOf(delimiter);
35829
34171
  if (idx !== -1) {
35830
34172
  file.excerpt = file.content.slice(0, idx);
@@ -35867,9 +34209,9 @@ var require_to_file = __commonJS((exports, module) => {
35867
34209
  // node_modules/gray-matter/lib/parse.js
35868
34210
  var require_parse3 = __commonJS((exports, module) => {
35869
34211
  var getEngine = require_engine();
35870
- var defaults2 = require_defaults();
34212
+ var defaults = require_defaults();
35871
34213
  module.exports = function(language, str2, options2) {
35872
- const opts = defaults2(options2);
34214
+ const opts = defaults(options2);
35873
34215
  const engine = getEngine(language, opts);
35874
34216
  if (typeof engine.parse !== "function") {
35875
34217
  throw new TypeError('expected "' + language + '.parse" to be a function');
@@ -35882,7 +34224,7 @@ var require_parse3 = __commonJS((exports, module) => {
35882
34224
  var require_gray_matter = __commonJS((exports, module) => {
35883
34225
  var fs = __require("fs");
35884
34226
  var sections = require_section_matter();
35885
- var defaults2 = require_defaults();
34227
+ var defaults = require_defaults();
35886
34228
  var stringify = require_stringify();
35887
34229
  var excerpt = require_excerpt();
35888
34230
  var engines = require_engines();
@@ -35906,7 +34248,7 @@ var require_gray_matter = __commonJS((exports, module) => {
35906
34248
  return parseMatter(file, options2);
35907
34249
  }
35908
34250
  function parseMatter(file, options2) {
35909
- const opts = defaults2(options2);
34251
+ const opts = defaults(options2);
35910
34252
  const open = opts.delimiters[0];
35911
34253
  const close = `
35912
34254
  ` + opts.delimiters[1];
@@ -35973,10 +34315,10 @@ var require_gray_matter = __commonJS((exports, module) => {
35973
34315
  return file;
35974
34316
  };
35975
34317
  matter.test = function(str2, options2) {
35976
- return utils.startsWith(str2, defaults2(options2).delimiters[0]);
34318
+ return utils.startsWith(str2, defaults(options2).delimiters[0]);
35977
34319
  };
35978
34320
  matter.language = function(str2, options2) {
35979
- const opts = defaults2(options2);
34321
+ const opts = defaults(options2);
35980
34322
  const open = opts.delimiters[0];
35981
34323
  if (matter.test(str2)) {
35982
34324
  str2 = str2.slice(open.length);
@@ -36052,9 +34394,9 @@ async function readWorkflowSlashNames(workflowsDir) {
36052
34394
  if (!entry.isFile() && !entry.isSymbolicLink())
36053
34395
  continue;
36054
34396
  const lowered = entry.name.toLowerCase();
36055
- const ext2 = WORKFLOW_ENTRY_EXTENSIONS.find((e2) => lowered.endsWith(e2));
36056
- if (ext2) {
36057
- names.add(basename(lowered, ext2));
34397
+ const ext = WORKFLOW_ENTRY_EXTENSIONS.find((e2) => lowered.endsWith(e2));
34398
+ if (ext) {
34399
+ names.add(basename(lowered, ext));
36058
34400
  }
36059
34401
  }
36060
34402
  } catch (error) {
@@ -36508,8 +34850,8 @@ class FileScanner2 {
36508
34850
  const resolvedTarget = resolve2(targetPath);
36509
34851
  return resolvedTarget.startsWith(resolvedBase);
36510
34852
  }
36511
- static toPosixPath(path3) {
36512
- return path3.replace(/\\/g, "/");
34853
+ static toPosixPath(path2) {
34854
+ return path2.replace(/\\/g, "/");
36513
34855
  }
36514
34856
  }
36515
34857
  var import_fs_extra14;
@@ -36550,8 +34892,8 @@ function transformCommandContent(content) {
36550
34892
  return { transformed, changes };
36551
34893
  }
36552
34894
  function shouldTransformFile(filename) {
36553
- const ext2 = filename.toLowerCase().slice(filename.lastIndexOf("."));
36554
- return TRANSFORMABLE_EXTENSIONS.has(ext2);
34895
+ const ext = filename.toLowerCase().slice(filename.lastIndexOf("."));
34896
+ return TRANSFORMABLE_EXTENSIONS.has(ext);
36555
34897
  }
36556
34898
  async function transformCommandReferences(directory, options2 = {}) {
36557
34899
  let filesTransformed = 0;
@@ -36619,35 +34961,35 @@ var init_content_transformer = __esm(() => {
36619
34961
  });
36620
34962
 
36621
34963
  // src/services/transformers/commands-prefix/prefix-utils.ts
36622
- function stripWindowsDrivePrefix(path3) {
36623
- if (path3.length >= 2 && /[a-zA-Z]/.test(path3[0]) && path3[1] === ":") {
36624
- return path3.slice(2);
34964
+ function stripWindowsDrivePrefix(path2) {
34965
+ if (path2.length >= 2 && /[a-zA-Z]/.test(path2[0]) && path2[1] === ":") {
34966
+ return path2.slice(2);
36625
34967
  }
36626
- if (path3.startsWith("\\\\?\\")) {
36627
- const remainder = path3.slice(4);
34968
+ if (path2.startsWith("\\\\?\\")) {
34969
+ const remainder = path2.slice(4);
36628
34970
  if (remainder.length >= 2 && /[a-zA-Z]/.test(remainder[0]) && remainder[1] === ":") {
36629
34971
  return remainder.slice(2);
36630
34972
  }
36631
34973
  }
36632
- return path3;
34974
+ return path2;
36633
34975
  }
36634
- function validatePath(path3, paramName) {
36635
- if (!path3 || typeof path3 !== "string") {
34976
+ function validatePath(path2, paramName) {
34977
+ if (!path2 || typeof path2 !== "string") {
36636
34978
  throw new Error(`${paramName} must be a non-empty string`);
36637
34979
  }
36638
- if (path3.length > 1000) {
34980
+ if (path2.length > 1000) {
36639
34981
  throw new Error(`${paramName} path too long (max 1000 chars)`);
36640
34982
  }
36641
- if (/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(path3) || path3.startsWith("~")) {
36642
- throw new Error(`${paramName} contains path traversal: ${path3}`);
34983
+ if (/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(path2) || path2.startsWith("~")) {
34984
+ throw new Error(`${paramName} contains path traversal: ${path2}`);
36643
34985
  }
36644
- const sanitizedPath = stripWindowsDrivePrefix(path3);
34986
+ const sanitizedPath = stripWindowsDrivePrefix(path2);
36645
34987
  if (/[<>:"|?*]/.test(sanitizedPath)) {
36646
- logger.debug(`Path validation failed (invalid character) for ${paramName}: ${path3}`);
36647
- throw new Error(`${paramName} contains invalid characters: ${path3}`);
34988
+ logger.debug(`Path validation failed (invalid character) for ${paramName}: ${path2}`);
34989
+ throw new Error(`${paramName} contains invalid characters: ${path2}`);
36648
34990
  }
36649
- for (let i = 0;i < path3.length; i++) {
36650
- const code = path3.charCodeAt(i);
34991
+ for (let i = 0;i < path2.length; i++) {
34992
+ const code = path2.charCodeAt(i);
36651
34993
  if (code < 32 || code === 127) {
36652
34994
  throw new Error(`${paramName} contains control characters`);
36653
34995
  }
@@ -37113,11 +35455,11 @@ class OwnershipDisplay {
37113
35455
  OwnershipDisplay.displaySummary(summary, "Preview Summary");
37114
35456
  f2.warn(import_picocolors13.default.yellow("No changes were made. Run without --dry-run to apply changes."));
37115
35457
  }
37116
- static displayFile(path3, ownership, action, reason) {
35458
+ static displayFile(path2, ownership, action, reason) {
37117
35459
  const ownershipStr = OwnershipDisplay.formatOwnership(ownership);
37118
35460
  const actionStr = OwnershipDisplay.formatAction(action);
37119
35461
  const reasonStr = reason ? import_picocolors13.default.gray(` - ${reason}`) : "";
37120
- console.log(` ${actionStr} ${path3} [${ownershipStr}]${reasonStr}`);
35462
+ console.log(` ${actionStr} ${path2} [${ownershipStr}]${reasonStr}`);
37121
35463
  }
37122
35464
  static displayForceWarning() {
37123
35465
  f2.warn(`${import_picocolors13.default.yellow(import_picocolors13.default.bold("FORCE MODE ENABLED"))}
@@ -37250,8 +35592,8 @@ async function handleMerge(ctx) {
37250
35592
  const deletionResult = await handleDeletions(sourceMetadata, ctx.claudeDir, ctx.kitType);
37251
35593
  if (deletionResult.deletedPaths.length > 0) {
37252
35594
  logger.info(`Removed ${deletionResult.deletedPaths.length} deprecated file(s)`);
37253
- for (const path3 of deletionResult.deletedPaths) {
37254
- logger.verbose(` - ${path3}`);
35595
+ for (const path2 of deletionResult.deletedPaths) {
35596
+ logger.verbose(` - ${path2}`);
37255
35597
  }
37256
35598
  }
37257
35599
  if (deletionResult.preservedPaths.length > 0) {
@@ -38059,26 +36401,26 @@ var init_migration_executor = __esm(() => {
38059
36401
  });
38060
36402
 
38061
36403
  // src/domains/skills/migrator/migration-validator.ts
38062
- function validateMigrationPath(path3, paramName) {
38063
- if (!path3 || typeof path3 !== "string") {
36404
+ function validateMigrationPath(path2, paramName) {
36405
+ if (!path2 || typeof path2 !== "string") {
38064
36406
  throw new SkillsMigrationError(`${paramName} must be a non-empty string`);
38065
36407
  }
38066
- if (path3.length > 1000) {
36408
+ if (path2.length > 1000) {
38067
36409
  throw new SkillsMigrationError(`${paramName} path too long (max 1000 characters)`);
38068
36410
  }
38069
- const isWindowsAbsolutePath = /^[A-Za-z]:[/\\]/.test(path3);
38070
- const hasDangerousTilde = path3.includes("~") && !isWindowsAbsolutePath;
38071
- if (/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(path3) || hasDangerousTilde) {
38072
- throw new SkillsMigrationError(`${paramName} contains potentially dangerous path traversal: ${path3}`);
36411
+ const isWindowsAbsolutePath = /^[A-Za-z]:[/\\]/.test(path2);
36412
+ const hasDangerousTilde = path2.includes("~") && !isWindowsAbsolutePath;
36413
+ if (/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(path2) || hasDangerousTilde) {
36414
+ throw new SkillsMigrationError(`${paramName} contains potentially dangerous path traversal: ${path2}`);
38073
36415
  }
38074
- const pathWithoutDrive = path3.replace(/^[A-Za-z]:/, "");
36416
+ const pathWithoutDrive = path2.replace(/^[A-Za-z]:/, "");
38075
36417
  if (/[<>:"|?*]/.test(pathWithoutDrive)) {
38076
- throw new SkillsMigrationError(`${paramName} contains invalid characters: ${path3}`);
36418
+ throw new SkillsMigrationError(`${paramName} contains invalid characters: ${path2}`);
38077
36419
  }
38078
- for (let i = 0;i < path3.length; i++) {
38079
- const charCode = path3.charCodeAt(i);
36420
+ for (let i = 0;i < path2.length; i++) {
36421
+ const charCode = path2.charCodeAt(i);
38080
36422
  if (charCode < 32 || charCode === 127) {
38081
- throw new SkillsMigrationError(`${paramName} contains control characters: ${path3}`);
36423
+ throw new SkillsMigrationError(`${paramName} contains control characters: ${path2}`);
38082
36424
  }
38083
36425
  }
38084
36426
  }
@@ -38089,14 +36431,14 @@ var init_migration_validator = __esm(() => {
38089
36431
  // src/domains/skills/skills-backup-manager.ts
38090
36432
  import { copyFile as copyFile3, mkdir as mkdir5, readdir as readdir13, rm as rm2, stat as stat6 } from "node:fs/promises";
38091
36433
  import { basename as basename2, join as join29, normalize as normalize3 } from "node:path";
38092
- function validatePath2(path3, paramName) {
38093
- if (!path3 || typeof path3 !== "string") {
36434
+ function validatePath2(path2, paramName) {
36435
+ if (!path2 || typeof path2 !== "string") {
38094
36436
  throw new SkillsMigrationError(`${paramName} must be a non-empty string`);
38095
36437
  }
38096
- if (path3.includes("..")) {
38097
- const normalized = normalize3(path3);
36438
+ if (path2.includes("..")) {
36439
+ const normalized = normalize3(path2);
38098
36440
  if (normalized.startsWith("..")) {
38099
- throw new SkillsMigrationError(`${paramName} contains invalid path traversal: ${path3}`);
36441
+ throw new SkillsMigrationError(`${paramName} contains invalid path traversal: ${path2}`);
38100
36442
  }
38101
36443
  }
38102
36444
  }
@@ -38384,14 +36726,14 @@ var init_comparison_engine = __esm(() => {
38384
36726
  // src/domains/skills/customization/scan-reporter.ts
38385
36727
  import { readdir as readdir15 } from "node:fs/promises";
38386
36728
  import { join as join31, normalize as normalize4 } from "node:path";
38387
- function validatePath3(path3, paramName) {
38388
- if (!path3 || typeof path3 !== "string") {
36729
+ function validatePath3(path2, paramName) {
36730
+ if (!path2 || typeof path2 !== "string") {
38389
36731
  throw new SkillsMigrationError(`${paramName} must be a non-empty string`);
38390
36732
  }
38391
- if (path3.includes("..")) {
38392
- const normalized = normalize4(path3);
36733
+ if (path2.includes("..")) {
36734
+ const normalized = normalize4(path2);
38393
36735
  if (normalized.startsWith("..")) {
38394
- throw new SkillsMigrationError(`${paramName} contains invalid path traversal: ${path3}`);
36736
+ throw new SkillsMigrationError(`${paramName} contains invalid path traversal: ${path2}`);
38395
36737
  }
38396
36738
  }
38397
36739
  }
@@ -38694,8 +37036,8 @@ function transformOpenCodeContent(content) {
38694
37036
  return { transformed, changes };
38695
37037
  }
38696
37038
  function shouldTransformFile2(filename) {
38697
- const ext2 = extname(filename).toLowerCase();
38698
- return TRANSFORMABLE_EXTENSIONS2.has(ext2);
37039
+ const ext = extname(filename).toLowerCase();
37040
+ return TRANSFORMABLE_EXTENSIONS2.has(ext);
38699
37041
  }
38700
37042
  async function transformPathsForGlobalOpenCode(directory, options2 = {}) {
38701
37043
  let filesTransformed = 0;
@@ -38973,9 +37315,9 @@ async function getPackageVersion(packageName) {
38973
37315
  new RegExp(`${escapeRegex(packageName)}@([0-9]+\\.[0-9]+\\.[0-9]+(?:-[\\w.-]+)?)`)
38974
37316
  ];
38975
37317
  for (const pattern of patterns) {
38976
- const match2 = stdout.match(pattern);
38977
- if (match2?.[1]) {
38978
- return match2[1].trim();
37318
+ const match = stdout.match(pattern);
37319
+ if (match?.[1]) {
37320
+ return match[1].trim();
38979
37321
  }
38980
37322
  }
38981
37323
  return null;
@@ -40113,14 +38455,14 @@ var init_installer = __esm(() => {
40113
38455
  import { existsSync as existsSync13, readdirSync as readdirSync2, statSync } from "node:fs";
40114
38456
  import { homedir as homedir7 } from "node:os";
40115
38457
  import { join as join45 } from "node:path";
40116
- function hasInstallSignal(path3) {
40117
- if (!path3 || !existsSync13(path3)) {
38458
+ function hasInstallSignal(path2) {
38459
+ if (!path2 || !existsSync13(path2)) {
40118
38460
  return false;
40119
38461
  }
40120
38462
  try {
40121
- const stat7 = statSync(path3);
38463
+ const stat7 = statSync(path2);
40122
38464
  if (stat7.isDirectory()) {
40123
- return readdirSync2(path3).length > 0;
38465
+ return readdirSync2(path2).length > 0;
40124
38466
  }
40125
38467
  if (stat7.isFile()) {
40126
38468
  return true;
@@ -40131,7 +38473,7 @@ function hasInstallSignal(path3) {
40131
38473
  }
40132
38474
  }
40133
38475
  function hasAnyInstallSignal(paths) {
40134
- return paths.some((path3) => hasInstallSignal(path3));
38476
+ return paths.some((path2) => hasInstallSignal(path2));
40135
38477
  }
40136
38478
  var home2, cwd, providers;
40137
38479
  var init_provider_registry = __esm(() => {
@@ -41342,7 +39684,7 @@ async function withRegistryLock(operation) {
41342
39684
  await release();
41343
39685
  }
41344
39686
  }
41345
- async function addPortableInstallation(item, type, provider, global3, path3, sourcePath, options2) {
39687
+ async function addPortableInstallation(item, type, provider, global3, path2, sourcePath, options2) {
41346
39688
  await withRegistryLock(async () => {
41347
39689
  const registry = await readPortableRegistry();
41348
39690
  registry.installations = registry.installations.filter((i) => !(i.item === item && i.type === type && i.provider === provider && i.global === global3));
@@ -41351,7 +39693,7 @@ async function addPortableInstallation(item, type, provider, global3, path3, sou
41351
39693
  type,
41352
39694
  provider,
41353
39695
  global: global3,
41354
- path: path3,
39696
+ path: path2,
41355
39697
  installedAt: new Date().toISOString(),
41356
39698
  sourcePath,
41357
39699
  cliVersion: getCliVersion2(),
@@ -41461,9 +39803,9 @@ var init_portable_registry = __esm(() => {
41461
39803
  // src/commands/portable/portable-manifest.ts
41462
39804
  import { existsSync as existsSync15 } from "node:fs";
41463
39805
  import { readFile as readFile19 } from "node:fs/promises";
41464
- import path3 from "node:path";
39806
+ import path2 from "node:path";
41465
39807
  async function loadPortableManifest(kitPath) {
41466
- const manifestPath = path3.join(kitPath, "portable-manifest.json");
39808
+ const manifestPath = path2.join(kitPath, "portable-manifest.json");
41467
39809
  try {
41468
39810
  if (!existsSync15(manifestPath)) {
41469
39811
  logger.verbose("No portable-manifest.json found — no evolution tracking");
@@ -41525,7 +39867,7 @@ var init_portable_manifest = __esm(() => {
41525
39867
  init_zod();
41526
39868
  init_logger();
41527
39869
  import_semver3 = __toESM(require_semver2(), 1);
41528
- safeRelativePath = exports_external.string().min(1).refine((p) => !p.includes("..") && !path3.isAbsolute(p), {
39870
+ safeRelativePath = exports_external.string().min(1).refine((p) => !p.includes("..") && !path2.isAbsolute(p), {
41529
39871
  message: "Path must be relative without traversal"
41530
39872
  });
41531
39873
  RenameEntrySchema = exports_external.object({
@@ -41556,16 +39898,16 @@ var init_portable_manifest = __esm(() => {
41556
39898
  });
41557
39899
 
41558
39900
  // src/commands/portable/reconciler.ts
41559
- import path4 from "node:path";
39901
+ import path3 from "node:path";
41560
39902
  function normalizePortablePath(value) {
41561
39903
  const asPosix = value.replace(/\\/g, "/");
41562
- const normalized = path4.posix.normalize(asPosix);
39904
+ const normalized = path3.posix.normalize(asPosix);
41563
39905
  if (normalized === ".")
41564
39906
  return "";
41565
39907
  return normalized.replace(/^\.\/+/, "");
41566
39908
  }
41567
39909
  function isAbsoluteLike(value) {
41568
- return path4.isAbsolute(value) || /^[a-zA-Z]:[\\/]/.test(value) || /^\\\\/.test(value);
39910
+ return path3.isAbsolute(value) || /^[a-zA-Z]:[\\/]/.test(value) || /^\\\\/.test(value);
41569
39911
  }
41570
39912
  function hasDotDotSegment(value) {
41571
39913
  return value.replace(/\\/g, "/").split("/").some((segment) => segment === "..");
@@ -42607,8 +40949,8 @@ var init_fm_to_yaml = __esm(() => {
42607
40949
 
42608
40950
  // src/commands/portable/converters/md-strip.ts
42609
40951
  import { homedir as homedir9 } from "node:os";
42610
- function normalizeProjectPath(path5) {
42611
- const normalized = path5.replace(/\\/g, "/").replace(/^\.\//, "");
40952
+ function normalizeProjectPath(path4) {
40953
+ const normalized = path4.replace(/\\/g, "/").replace(/^\.\//, "");
42612
40954
  const home4 = homedir9().replace(/\\/g, "/");
42613
40955
  return normalized.startsWith(home4) ? normalized.replace(home4, "~") : normalized;
42614
40956
  }
@@ -42657,9 +40999,9 @@ function truncateAtCleanBoundary(content, limit) {
42657
40999
  }
42658
41000
  const sectionRegex = /^(#{2,3})\s+(.+)$/gm;
42659
41001
  const sectionStarts = [];
42660
- for (const match2 of content.matchAll(sectionRegex)) {
42661
- if (match2.index !== undefined) {
42662
- sectionStarts.push({ index: match2.index, title: match2[2].trim() });
41002
+ for (const match of content.matchAll(sectionRegex)) {
41003
+ if (match.index !== undefined) {
41004
+ sectionStarts.push({ index: match.index, title: match[2].trim() });
42663
41005
  }
42664
41006
  }
42665
41007
  if (sectionStarts.length === 0) {
@@ -42720,9 +41062,9 @@ function stripClaudeRefs(content, options2) {
42720
41062
  return { content, warnings, removedSections: [] };
42721
41063
  }
42722
41064
  const codeBlockRanges = [];
42723
- for (const match2 of content.matchAll(/```[\s\S]*?```/g)) {
42724
- if (match2.index !== undefined) {
42725
- codeBlockRanges.push([match2.index, match2.index + match2[0].length]);
41065
+ for (const match of content.matchAll(/```[\s\S]*?```/g)) {
41066
+ if (match.index !== undefined) {
41067
+ codeBlockRanges.push([match.index, match.index + match[0].length]);
42726
41068
  }
42727
41069
  }
42728
41070
  const isInCodeBlock = (pos) => {
@@ -42991,7 +41333,7 @@ var init_converters = __esm(() => {
42991
41333
  import { existsSync as existsSync16 } from "node:fs";
42992
41334
  import { mkdir as mkdir10, readFile as readFile20, unlink as unlink3, writeFile as writeFile13 } from "node:fs/promises";
42993
41335
  import { homedir as homedir10 } from "node:os";
42994
- import { basename as basename3, dirname as dirname10, join as join48, resolve as resolve5, sep as sep3 } from "node:path";
41336
+ import { basename as basename3, dirname as dirname10, join as join48, resolve as resolve5, sep as sep2 } from "node:path";
42995
41337
  function isSamePath(path1, path22) {
42996
41338
  try {
42997
41339
  return resolve5(path1) === resolve5(path22);
@@ -43019,13 +41361,13 @@ function getErrorMessage(error, targetPath) {
43019
41361
  function isErrnoCode2(error, code) {
43020
41362
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
43021
41363
  }
43022
- function isWindowsAbsolutePath(path5) {
43023
- return /^[a-zA-Z]:[\\/]/.test(path5) || /^\\\\/.test(path5);
41364
+ function isWindowsAbsolutePath(path4) {
41365
+ return /^[a-zA-Z]:[\\/]/.test(path4) || /^\\\\/.test(path4);
43024
41366
  }
43025
41367
  function isPathWithinBoundary(targetPath, boundaryPath) {
43026
41368
  const resolvedTarget = resolve5(targetPath);
43027
41369
  const resolvedBoundary = resolve5(boundaryPath);
43028
- return resolvedTarget === resolvedBoundary || resolvedTarget.startsWith(`${resolvedBoundary}${sep3}`);
41370
+ return resolvedTarget === resolvedBoundary || resolvedTarget.startsWith(`${resolvedBoundary}${sep2}`);
43029
41371
  }
43030
41372
  function getProjectBoundary(options2) {
43031
41373
  return options2.projectRoot ?? process.cwd();
@@ -43162,7 +41504,7 @@ var init_internal = __esm(() => {
43162
41504
 
43163
41505
  // src/domains/installers/shared/writers/install-one-file.ts
43164
41506
  import { writeFile as writeFile14 } from "node:fs/promises";
43165
- import { dirname as dirname11, join as join49, resolve as resolve6, sep as sep4 } from "node:path";
41507
+ import { dirname as dirname11, join as join49, resolve as resolve6, sep as sep3 } from "node:path";
43166
41508
  async function installOneFile(item, provider, kind, options2) {
43167
41509
  const config = providers[provider];
43168
41510
  const typeKey = getProviderPathKey(kind);
@@ -43214,14 +41556,14 @@ async function installOneFile(item, provider, kind, options2) {
43214
41556
  let resolvedFilename = result.filename;
43215
41557
  if (pathConfig.nestedCommands === false && resolvedFilename.includes("/")) {
43216
41558
  const extIdx = resolvedFilename.lastIndexOf(".");
43217
- const ext2 = extIdx >= 0 ? resolvedFilename.substring(extIdx) : "";
41559
+ const ext = extIdx >= 0 ? resolvedFilename.substring(extIdx) : "";
43218
41560
  const nameWithoutExt = extIdx >= 0 ? resolvedFilename.substring(0, extIdx) : resolvedFilename;
43219
- resolvedFilename = `${nameWithoutExt.replace(/\//g, "-")}${ext2}`;
41561
+ resolvedFilename = `${nameWithoutExt.replace(/\//g, "-")}${ext}`;
43220
41562
  }
43221
41563
  targetPath = pathConfig.writeStrategy === "single-file" ? basePath : join49(basePath, resolvedFilename);
43222
41564
  const resolvedTarget = resolve6(targetPath);
43223
41565
  const resolvedBase = pathConfig.writeStrategy === "single-file" ? resolve6(dirname11(basePath)) : resolve6(basePath);
43224
- if (!resolvedTarget.startsWith(resolvedBase + sep4) && resolvedTarget !== resolvedBase) {
41566
+ if (!resolvedTarget.startsWith(resolvedBase + sep3) && resolvedTarget !== resolvedBase) {
43225
41567
  return {
43226
41568
  provider,
43227
41569
  providerDisplayName: config.displayName,
@@ -43826,8 +42168,8 @@ async function ensureDir3(filePath) {
43826
42168
  function isErrnoCode3(error, code) {
43827
42169
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
43828
42170
  }
43829
- function normalizePathForComparison(path5) {
43830
- const normalized = resolve7(path5);
42171
+ function normalizePathForComparison(path4) {
42172
+ const normalized = resolve7(path4);
43831
42173
  return process.platform === "win32" ? normalized.toLowerCase() : normalized;
43832
42174
  }
43833
42175
  function isPathWithinBoundary2(targetPath, boundaryPath) {
@@ -43839,11 +42181,11 @@ function isPathWithinBoundary2(targetPath, boundaryPath) {
43839
42181
  const rel = relative10(normalizedBoundary, normalizedTarget);
43840
42182
  return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
43841
42183
  }
43842
- async function resolveRealPathSafe(path5) {
42184
+ async function resolveRealPathSafe(path4) {
43843
42185
  try {
43844
- return await realpath(path5);
42186
+ return await realpath(path4);
43845
42187
  } catch {
43846
- return resolve7(path5);
42188
+ return resolve7(path4);
43847
42189
  }
43848
42190
  }
43849
42191
  async function isCanonicalPathWithinBoundary(targetPath, boundaryPath) {
@@ -43869,9 +42211,9 @@ function extractManagedAgentEntries(existing) {
43869
42211
  const endPattern = `# --- ${LEGACY_SENTINEL_PATTERN}-end ---`;
43870
42212
  const blockRegex = new RegExp(`^${startPattern}\\s*\\r?\\n[\\s\\S]*?^${endPattern}\\s*(?:\\r?\\n)?`, "gm");
43871
42213
  const sentinelLineRegex = new RegExp(`^# --- ${LEGACY_SENTINEL_PATTERN}-(start|end) ---$`);
43872
- let match2 = blockRegex.exec(existing);
43873
- while (match2) {
43874
- const blockContent = match2[0].split(/\r?\n/).filter((line) => {
42214
+ let match = blockRegex.exec(existing);
42215
+ while (match) {
42216
+ const blockContent = match[0].split(/\r?\n/).filter((line) => {
43875
42217
  const trimmed = line.trim();
43876
42218
  return !sentinelLineRegex.test(trimmed);
43877
42219
  }).join(`
@@ -43898,7 +42240,7 @@ function extractManagedAgentEntries(existing) {
43898
42240
  }
43899
42241
  }
43900
42242
  commitEntry();
43901
- match2 = blockRegex.exec(existing);
42243
+ match = blockRegex.exec(existing);
43902
42244
  }
43903
42245
  return entries;
43904
42246
  }
@@ -43909,9 +42251,9 @@ function stripRanges(content, ranges) {
43909
42251
  const sorted = [...ranges].sort((a3, b3) => a3.start - b3.start);
43910
42252
  let cursor = 0;
43911
42253
  let result = "";
43912
- for (const range2 of sorted) {
43913
- result += content.slice(cursor, range2.start);
43914
- cursor = range2.end;
42254
+ for (const range of sorted) {
42255
+ result += content.slice(cursor, range.start);
42256
+ cursor = range.end;
43915
42257
  }
43916
42258
  result += content.slice(cursor);
43917
42259
  return result;
@@ -43927,14 +42269,14 @@ function analyzeConfigToml(existing) {
43927
42269
  const endCount = [...existing.matchAll(endLineRegex)].length;
43928
42270
  const blockRegex = new RegExp(`^${startPattern}\\s*\\r?\\n[\\s\\S]*?^${endPattern}\\s*(?:\\r?\\n)?`, "gm");
43929
42271
  const candidateRanges = [];
43930
- let match2 = blockRegex.exec(existing);
43931
- while (match2) {
42272
+ let match = blockRegex.exec(existing);
42273
+ while (match) {
43932
42274
  candidateRanges.push({
43933
- start: match2.index,
43934
- end: match2.index + match2[0].length,
43935
- content: match2[0]
42275
+ start: match.index,
42276
+ end: match.index + match[0].length,
42277
+ content: match[0]
43936
42278
  });
43937
- match2 = blockRegex.exec(existing);
42279
+ match = blockRegex.exec(existing);
43938
42280
  }
43939
42281
  const candidateCount = candidateRanges.length;
43940
42282
  const unmatchedStart = Math.max(0, startCount - candidateCount);
@@ -43948,7 +42290,7 @@ function analyzeConfigToml(existing) {
43948
42290
  error: "Malformed managed agent sentinels in config.toml (unmatched start/end markers). Please clean up sentinels manually."
43949
42291
  };
43950
42292
  }
43951
- const managedRanges = candidateRanges.filter((range2) => isManagedAgentBlock(range2.content));
42293
+ const managedRanges = candidateRanges.filter((range) => isManagedAgentBlock(range.content));
43952
42294
  if (managedRanges.length > 1) {
43953
42295
  warnings.push(`Found ${managedRanges.length} managed agent blocks in config.toml; collapsing into one managed block`);
43954
42296
  }
@@ -43963,13 +42305,13 @@ function analyzeConfigToml(existing) {
43963
42305
  function extractUnmanagedAgentSlugs(content) {
43964
42306
  const slugs = new Set;
43965
42307
  const regex2 = /^\[agents\.(?:"([^"]+)"|([^\]\r\n]+))\]\s*$/gm;
43966
- let match2 = regex2.exec(content);
43967
- while (match2) {
43968
- const slug = (match2[1] || match2[2] || "").trim();
42308
+ let match = regex2.exec(content);
42309
+ while (match) {
42310
+ const slug = (match[1] || match[2] || "").trim();
43969
42311
  if (slug.length > 0) {
43970
42312
  slugs.add(slug);
43971
42313
  }
43972
- match2 = regex2.exec(content);
42314
+ match = regex2.exec(content);
43973
42315
  }
43974
42316
  return slugs;
43975
42317
  }
@@ -44656,12 +42998,12 @@ var init_reconcile_registry_backfill = __esm(() => {
44656
42998
  });
44657
42999
 
44658
43000
  // src/commands/portable/hook-migration-compatibility.ts
44659
- import path5 from "node:path";
43001
+ import path4 from "node:path";
44660
43002
  function normalizeHookAssetPath(value) {
44661
43003
  return value.replace(/\\/g, "/").replace(/^["']|["']$/g, "").replace(/[),;]+$/, "").replace(/^\.\//, "").replace(/^\$HOME\/\.claude\/hooks\//, "").replace(/^\$HOME\/\.codex\/hooks\//, "").replace(/^~\/\.claude\/hooks\//, "").replace(/^~\/\.codex\/hooks\//, "").replace(/^\.claude\/hooks\//, "").replace(/^\.codex\/hooks\//, "").replace(/^hooks\//, "").replace(/^\.\//, "").replace(/^\/+/, "");
44662
43004
  }
44663
43005
  function hookAssetBasename(value) {
44664
- return path5.posix.basename(normalizeHookAssetPath(value));
43006
+ return path4.posix.basename(normalizeHookAssetPath(value));
44665
43007
  }
44666
43008
  function isExcludedHookAsset(value) {
44667
43009
  return CODEX_EXCLUDED_HOOK_BASENAMES.has(hookAssetBasename(value));
@@ -44672,16 +43014,16 @@ function isCodexSupportedHookEvent(event) {
44672
43014
  function extractHookReferencesFromCommand(command) {
44673
43015
  const refs = new Set;
44674
43016
  const hookDirPattern = /(?:\$HOME\/|~\/)?\.(?:claude|codex)\/hooks\/([^"'\s;&|><)]+)/g;
44675
- for (const match2 of command.matchAll(hookDirPattern)) {
44676
- const ref = normalizeHookAssetPath(match2[1] ?? "");
44677
- if (ref && HOOK_REF_EXTENSIONS.has(path5.posix.extname(ref).toLowerCase()))
43017
+ for (const match of command.matchAll(hookDirPattern)) {
43018
+ const ref = normalizeHookAssetPath(match[1] ?? "");
43019
+ if (ref && HOOK_REF_EXTENSIONS.has(path4.posix.extname(ref).toLowerCase()))
44678
43020
  refs.add(ref);
44679
43021
  }
44680
43022
  for (const rawToken of command.split(/\s+/)) {
44681
43023
  const token = normalizeHookAssetPath(rawToken);
44682
43024
  if (!token || refs.has(token))
44683
43025
  continue;
44684
- if (HOOK_REF_EXTENSIONS.has(path5.posix.extname(token).toLowerCase()))
43026
+ if (HOOK_REF_EXTENSIONS.has(path4.posix.extname(token).toLowerCase()))
44685
43027
  refs.add(token);
44686
43028
  }
44687
43029
  return [...refs];
@@ -44900,9 +43242,9 @@ async function detectCodexCapabilities() {
44900
43242
  if (rawStdout !== null) {
44901
43243
  const raw = rawStdout.trim();
44902
43244
  const version3 = raw.replace(/^(codex\s+)?v?/i, "").trim();
44903
- const match2 = findCapabilitiesForVersion(version3);
44904
- if (match2)
44905
- return match2;
43245
+ const match = findCapabilitiesForVersion(version3);
43246
+ if (match)
43247
+ return match;
44906
43248
  logger.warning(`[!] Codex version ${version3} not found in capability table; using most-restrictive baseline. Set CK_CODEX_COMPAT=optimistic to use newest known capabilities instead.`);
44907
43249
  return FALLBACK_CAPABILITIES;
44908
43250
  }
@@ -45146,17 +43488,17 @@ var init_claude_to_codex_hooks = () => {};
45146
43488
  import { existsSync as existsSync21 } from "node:fs";
45147
43489
  import { mkdir as mkdir13, realpath as realpath2 } from "node:fs/promises";
45148
43490
  import { homedir as homedir13 } from "node:os";
45149
- import { dirname as dirname14, join as join53, resolve as resolve9, sep as sep5 } from "node:path";
43491
+ import { dirname as dirname14, join as join53, resolve as resolve9, sep as sep4 } from "node:path";
45150
43492
  function isPathWithinBoundary3(targetPath, boundaryPath) {
45151
43493
  const resolvedTarget = resolve9(targetPath);
45152
43494
  const resolvedBoundary = resolve9(boundaryPath);
45153
- return resolvedTarget === resolvedBoundary || resolvedTarget.startsWith(`${resolvedBoundary}${sep5}`);
43495
+ return resolvedTarget === resolvedBoundary || resolvedTarget.startsWith(`${resolvedBoundary}${sep4}`);
45154
43496
  }
45155
- async function resolveRealPathSafe2(path6) {
43497
+ async function resolveRealPathSafe2(path5) {
45156
43498
  try {
45157
- return await realpath2(path6);
43499
+ return await realpath2(path5);
45158
43500
  } catch {
45159
- return resolve9(path6);
43501
+ return resolve9(path5);
45160
43502
  }
45161
43503
  }
45162
43504
  async function isCanonicalPathWithinBoundary2(targetPath, boundaryPath) {
@@ -45268,8 +43610,8 @@ async function _ensureFeatureFlagLocked(configTomlPath) {
45268
43610
  return { status: hadManagedBlock ? "updated" : "written", configPath: configTomlPath };
45269
43611
  }
45270
43612
  function findFeaturesSectionStart(content) {
45271
- const match2 = /^[ \t]*\[features\][ \t]*(?:#[^\r\n]*)?$/m.exec(content);
45272
- return match2 ? match2.index : -1;
43613
+ const match = /^[ \t]*\[features\][ \t]*(?:#[^\r\n]*)?$/m.exec(content);
43614
+ return match ? match.index : -1;
45273
43615
  }
45274
43616
  function ensureFlagInFeaturesSection(content, headerStartIdx) {
45275
43617
  const headerLineEnd = content.indexOf(`
@@ -46207,8 +44549,8 @@ async function computeCodexTargetStates(global3) {
46207
44549
  const registry = await readPortableRegistry();
46208
44550
  const relevant = registry.installations.filter((e2) => e2.provider === "codex" && e2.global === global3 && e2.type !== "skill");
46209
44551
  return buildTargetStates(relevant, {
46210
- onReadFailure: (path6, error) => {
46211
- logger.debug(`[init/codex] Target read failed: ${path6} (${String(error)})`);
44552
+ onReadFailure: (path5, error) => {
44553
+ logger.debug(`[init/codex] Target read failed: ${path5} (${String(error)})`);
46212
44554
  }
46213
44555
  });
46214
44556
  }
@@ -46231,7 +44573,7 @@ var init_reconcile_helpers = __esm(() => {
46231
44573
  import { existsSync as existsSync25 } from "node:fs";
46232
44574
  import { readFile as readFile26, readdir as readdir18 } from "node:fs/promises";
46233
44575
  import { homedir as homedir15 } from "node:os";
46234
- import { extname as extname4, join as join58, relative as relative11, sep as sep6 } from "node:path";
44576
+ import { extname as extname4, join as join58, relative as relative11, sep as sep5 } from "node:path";
46235
44577
  function getConfigSourcePath() {
46236
44578
  return findExistingProjectConfigPath(process.cwd()) ?? getGlobalConfigSourcePath();
46237
44579
  }
@@ -46245,26 +44587,26 @@ function getHooksSourcePath() {
46245
44587
  return findExistingProjectLayoutPath(process.cwd(), "hooks") ?? join58(homedir15(), ".claude", "hooks");
46246
44588
  }
46247
44589
  async function discoverConfig(sourcePath) {
46248
- const path6 = sourcePath ?? getConfigSourcePath();
46249
- if (!existsSync25(path6)) {
44590
+ const path5 = sourcePath ?? getConfigSourcePath();
44591
+ if (!existsSync25(path5)) {
46250
44592
  return null;
46251
44593
  }
46252
- const content = await readFile26(path6, "utf-8");
44594
+ const content = await readFile26(path5, "utf-8");
46253
44595
  return {
46254
44596
  name: "CLAUDE",
46255
44597
  description: "Project configuration",
46256
44598
  type: "config",
46257
- sourcePath: path6,
44599
+ sourcePath: path5,
46258
44600
  frontmatter: {},
46259
44601
  body: content
46260
44602
  };
46261
44603
  }
46262
44604
  async function discoverRules(sourcePath) {
46263
- const path6 = sourcePath ?? getRulesSourcePath();
46264
- if (!existsSync25(path6)) {
44605
+ const path5 = sourcePath ?? getRulesSourcePath();
44606
+ if (!existsSync25(path5)) {
46265
44607
  return [];
46266
44608
  }
46267
- return discoverPortableFiles(path6, path6, {
44609
+ return discoverPortableFiles(path5, path5, {
46268
44610
  type: "rules",
46269
44611
  includeExtensions: new Set([".md"]),
46270
44612
  stripExtension: true,
@@ -46272,13 +44614,13 @@ async function discoverRules(sourcePath) {
46272
44614
  });
46273
44615
  }
46274
44616
  async function discoverHooks(sourcePath) {
46275
- const path6 = sourcePath ?? getHooksSourcePath();
46276
- if (!existsSync25(path6)) {
44617
+ const path5 = sourcePath ?? getHooksSourcePath();
44618
+ if (!existsSync25(path5)) {
46277
44619
  return { items: [], skippedShellHooks: [] };
46278
44620
  }
46279
44621
  let entries;
46280
44622
  try {
46281
- entries = await readdir18(path6, { withFileTypes: true, encoding: "utf8" });
44623
+ entries = await readdir18(path5, { withFileTypes: true, encoding: "utf8" });
46282
44624
  } catch {
46283
44625
  return { items: [], skippedShellHooks: [] };
46284
44626
  }
@@ -46287,14 +44629,14 @@ async function discoverHooks(sourcePath) {
46287
44629
  for (const entry of entries) {
46288
44630
  if (!entry.isFile() || entry.name.startsWith("."))
46289
44631
  continue;
46290
- const ext2 = extname4(entry.name).toLowerCase();
46291
- if (SHELL_HOOK_EXTENSIONS.has(ext2)) {
44632
+ const ext = extname4(entry.name).toLowerCase();
44633
+ if (SHELL_HOOK_EXTENSIONS.has(ext)) {
46292
44634
  skippedShellHooks.push(entry.name);
46293
44635
  continue;
46294
44636
  }
46295
- if (!HOOK_EXTENSIONS.has(ext2))
44637
+ if (!HOOK_EXTENSIONS.has(ext))
46296
44638
  continue;
46297
- const fullPath = join58(path6, entry.name);
44639
+ const fullPath = join58(path5, entry.name);
46298
44640
  try {
46299
44641
  const content = await readFile26(fullPath, "utf-8");
46300
44642
  items.push({
@@ -46603,10 +44945,10 @@ import { existsSync as existsSync26 } from "node:fs";
46603
44945
  import { mkdir as mkdir14, readFile as readFile28, writeFile as writeFile18 } from "node:fs/promises";
46604
44946
  import { homedir as homedir18 } from "node:os";
46605
44947
  import { join as join61 } from "node:path";
46606
- function getNestedValue(obj, path6) {
44948
+ function getNestedValue(obj, path5) {
46607
44949
  if (!obj || typeof obj !== "object")
46608
44950
  return;
46609
- const keys = path6.split(".");
44951
+ const keys = path5.split(".");
46610
44952
  let current = obj;
46611
44953
  for (const key of keys) {
46612
44954
  if (current === null || current === undefined)
@@ -46617,8 +44959,8 @@ function getNestedValue(obj, path6) {
46617
44959
  }
46618
44960
  return current;
46619
44961
  }
46620
- function setNestedValue(obj, path6, value) {
46621
- const keys = path6.split(".");
44962
+ function setNestedValue(obj, path5, value) {
44963
+ const keys = path5.split(".");
46622
44964
  if (keys.some((k2) => DANGEROUS_KEYS.includes(k2))) {
46623
44965
  throw new Error("Invalid field path: dangerous key detected");
46624
44966
  }
@@ -46701,22 +45043,22 @@ class TakumiConfigManager {
46701
45043
  }
46702
45044
  static computeSources(mergedConfig, globalConfig, projectConfig, prefix = "") {
46703
45045
  const sources = {};
46704
- const processValue = (key, value, path6) => {
45046
+ const processValue = (key, value, path5) => {
46705
45047
  if (key === "$schema")
46706
45048
  return;
46707
45049
  if (value !== null && typeof value === "object" && !Array.isArray(value)) {
46708
45050
  for (const [nestedKey, nestedVal] of Object.entries(value)) {
46709
- processValue(nestedKey, nestedVal, path6 ? `${path6}.${nestedKey}` : nestedKey);
45051
+ processValue(nestedKey, nestedVal, path5 ? `${path5}.${nestedKey}` : nestedKey);
46710
45052
  }
46711
45053
  } else {
46712
- const projectVal = projectConfig ? getNestedValue(projectConfig, path6) : undefined;
46713
- const globalVal = globalConfig ? getNestedValue(globalConfig, path6) : undefined;
45054
+ const projectVal = projectConfig ? getNestedValue(projectConfig, path5) : undefined;
45055
+ const globalVal = globalConfig ? getNestedValue(globalConfig, path5) : undefined;
46714
45056
  if (projectConfig && projectVal !== undefined && valuesEqual(value, projectVal)) {
46715
- sources[path6] = "project";
45057
+ sources[path5] = "project";
46716
45058
  } else if (globalConfig && globalVal !== undefined && valuesEqual(value, globalVal)) {
46717
- sources[path6] = "global";
45059
+ sources[path5] = "global";
46718
45060
  } else {
46719
- sources[path6] = "default";
45061
+ sources[path5] = "default";
46720
45062
  }
46721
45063
  }
46722
45064
  };
@@ -46971,12 +45313,12 @@ function getCodexSkillsTargetDir(global3, projectRoot) {
46971
45313
  if (!cfg) {
46972
45314
  throw new Error("[codex] skills configuration missing from provider registry");
46973
45315
  }
46974
- const path6 = global3 ? cfg.globalPath : cfg.projectPath;
46975
- if (!path6) {
45316
+ const path5 = global3 ? cfg.globalPath : cfg.projectPath;
45317
+ if (!path5) {
46976
45318
  throw new Error(`[codex] no ${global3 ? "global" : "project"}-level skills path configured`);
46977
45319
  }
46978
45320
  const projectBase = projectRoot ?? process.cwd();
46979
- const resolved = global3 ? resolve14(path6) : resolve14(projectBase, path6);
45321
+ const resolved = global3 ? resolve14(path5) : resolve14(projectBase, path5);
46980
45322
  const boundary = global3 ? homedir19() : projectBase;
46981
45323
  if (!isPathWithinBoundary3(resolved, boundary)) {
46982
45324
  throw new Error(`[codex] resolved skills path "${resolved}" escapes boundary "${boundary}"`);
@@ -47045,17 +45387,17 @@ function resolveConfigSource(extractDir) {
47045
45387
  return findExistingProjectConfigPath(extractDir);
47046
45388
  }
47047
45389
  function hasAnyCodexSource(sources) {
47048
- return Object.values(sources).some((path6) => path6 !== null);
45390
+ return Object.values(sources).some((path5) => path5 !== null);
47049
45391
  }
47050
45392
  var init_source_resolver = __esm(() => {
47051
45393
  init_kit_layout();
47052
45394
  });
47053
45395
 
47054
45396
  // src/domains/installers/codex/manifest-helpers.ts
47055
- import { join as join64, relative as relative13, sep as sep7 } from "node:path";
45397
+ import { join as join64, relative as relative13, sep as sep6 } from "node:path";
47056
45398
  async function collectCodexInstalledFiles(results, codexRoot) {
47057
45399
  const out = [];
47058
- const toPosix = (p) => p.split(sep7).join("/");
45400
+ const toPosix = (p) => p.split(sep6).join("/");
47059
45401
  for (const r2 of results) {
47060
45402
  if (!r2.success || r2.skipped || !r2.path)
47061
45403
  continue;
@@ -47146,13 +45488,13 @@ async function wipeCodexTargets(global3, projectRoot) {
47146
45488
  ].filter((p) => Boolean(p));
47147
45489
  const projectBase = projectRoot ?? process.cwd();
47148
45490
  const targetPaths = rawPaths.map((p) => global3 ? p : join65(projectBase, p));
47149
- for (const path6 of targetPaths) {
47150
- if (existsSync28(path6)) {
45491
+ for (const path5 of targetPaths) {
45492
+ if (existsSync28(path5)) {
47151
45493
  try {
47152
- await rm5(path6, { recursive: true, force: true });
47153
- logger.debug(`[init/codex] wiped ${path6}`);
45494
+ await rm5(path5, { recursive: true, force: true });
45495
+ logger.debug(`[init/codex] wiped ${path5}`);
47154
45496
  } catch (error) {
47155
- logger.warning(`[init/codex] failed to wipe ${path6}: ${String(error)}`);
45497
+ logger.warning(`[init/codex] failed to wipe ${path5}: ${String(error)}`);
47156
45498
  }
47157
45499
  }
47158
45500
  }
@@ -47353,12 +45695,12 @@ var require_umd = __commonJS((exports, module) => {
47353
45695
  if (typeof version3 !== "string") {
47354
45696
  throw new TypeError("Invalid argument expected string");
47355
45697
  }
47356
- const match2 = version3.match(semver5);
47357
- if (!match2) {
45698
+ const match = version3.match(semver5);
45699
+ if (!match) {
47358
45700
  throw new Error(`Invalid argument not valid semver ('${version3}' received)`);
47359
45701
  }
47360
- match2.shift();
47361
- return match2;
45702
+ match.shift();
45703
+ return match;
47362
45704
  };
47363
45705
  const isWildcard = (s) => s === "*" || s === "x" || s === "X";
47364
45706
  const tryParse = (v2) => {
@@ -47421,22 +45763,22 @@ var require_umd = __commonJS((exports, module) => {
47421
45763
  throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
47422
45764
  }
47423
45765
  };
47424
- const satisfies = (version3, range2) => {
47425
- range2 = range2.replace(/([><=]+)\s+/g, "$1");
47426
- if (range2.includes("||")) {
47427
- return range2.split("||").some((r5) => satisfies(version3, r5));
47428
- } else if (range2.includes(" - ")) {
47429
- const [a3, b3] = range2.split(" - ", 2);
45766
+ const satisfies = (version3, range) => {
45767
+ range = range.replace(/([><=]+)\s+/g, "$1");
45768
+ if (range.includes("||")) {
45769
+ return range.split("||").some((r5) => satisfies(version3, r5));
45770
+ } else if (range.includes(" - ")) {
45771
+ const [a3, b3] = range.split(" - ", 2);
47430
45772
  return satisfies(version3, `>=${a3} <=${b3}`);
47431
- } else if (range2.includes(" ")) {
47432
- return range2.trim().replace(/\s{2,}/g, " ").split(" ").every((r5) => satisfies(version3, r5));
45773
+ } else if (range.includes(" ")) {
45774
+ return range.trim().replace(/\s{2,}/g, " ").split(" ").every((r5) => satisfies(version3, r5));
47433
45775
  }
47434
- const m2 = range2.match(/^([<>=~^]+)/);
45776
+ const m2 = range.match(/^([<>=~^]+)/);
47435
45777
  const op = m2 ? m2[1] : "=";
47436
45778
  if (op !== "^" && op !== "~")
47437
- return compare(version3, range2, op);
45779
+ return compare(version3, range, op);
47438
45780
  const [v1, v2, v3, , vp] = validateAndParse(version3);
47439
- const [r1, r2, r3, , rp] = validateAndParse(range2);
45781
+ const [r1, r2, r3, , rp] = validateAndParse(range);
47440
45782
  const v4 = [v1, v2, v3];
47441
45783
  const r4 = [r1, r2 !== null && r2 !== undefined ? r2 : "x", r3 !== null && r3 !== undefined ? r3 : "x"];
47442
45784
  if (rp) {
@@ -48140,14 +46482,14 @@ class VersionFormatter {
48140
46482
  }
48141
46483
  static parseVersion(version3) {
48142
46484
  const normalized = VersionFormatter.normalize(version3);
48143
- const match2 = normalized.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/);
48144
- if (!match2)
46485
+ const match = normalized.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/);
46486
+ if (!match)
48145
46487
  return null;
48146
46488
  return {
48147
- major: Number.parseInt(match2[1], 10),
48148
- minor: Number.parseInt(match2[2], 10),
48149
- patch: Number.parseInt(match2[3], 10),
48150
- prerelease: match2[4]
46489
+ major: Number.parseInt(match[1], 10),
46490
+ minor: Number.parseInt(match[2], 10),
46491
+ patch: Number.parseInt(match[3], 10),
46492
+ prerelease: match[4]
48151
46493
  };
48152
46494
  }
48153
46495
  static isPrerelease(version3) {
@@ -49221,18 +47563,18 @@ async function readCachedConfig() {
49221
47563
  }
49222
47564
  }
49223
47565
  async function writeCachedConfig(config) {
49224
- const path6 = getCachePath();
47566
+ const path5 = getCachePath();
49225
47567
  const dir = join69(getConfigDir(), "auth");
49226
47568
  await fs.mkdir(dir, { recursive: true, mode: 448 });
49227
47569
  const body = { ...config, cachedAt: Date.now() };
49228
- const fh = await fs.open(path6, "w", 384);
47570
+ const fh = await fs.open(path5, "w", 384);
49229
47571
  try {
49230
47572
  await fh.writeFile(JSON.stringify(body, null, 2), "utf8");
49231
47573
  } finally {
49232
47574
  await fh.close();
49233
47575
  }
49234
47576
  try {
49235
- await fs.chmod(path6, 384);
47577
+ await fs.chmod(path5, 384);
49236
47578
  } catch (err) {
49237
47579
  logger.verbose(`config-cache: chmod 600 skipped (${err instanceof Error ? err.message : String(err)})`);
49238
47580
  }
@@ -49256,12 +47598,12 @@ import { promises as fs2 } from "node:fs";
49256
47598
  async function ensureParentDir() {
49257
47599
  await fs2.mkdir(getAuthDir(), { recursive: true, mode: 448 });
49258
47600
  }
49259
- async function chmodSafe(path6, mode) {
47601
+ async function chmodSafe(path5, mode) {
49260
47602
  try {
49261
- await fs2.chmod(path6, mode);
47603
+ await fs2.chmod(path5, mode);
49262
47604
  } catch (err) {
49263
47605
  const message = err instanceof Error ? err.message : String(err);
49264
- logger.verbose(`token-store: chmod ${mode.toString(8)} on ${path6} skipped (${message})`);
47606
+ logger.verbose(`token-store: chmod ${mode.toString(8)} on ${path5} skipped (${message})`);
49265
47607
  }
49266
47608
  }
49267
47609
  async function readToken() {
@@ -49278,8 +47620,8 @@ async function readToken() {
49278
47620
  }
49279
47621
  async function writeToken(session) {
49280
47622
  await ensureParentDir();
49281
- const path6 = getTokenPath();
49282
- const tmpPath = `${path6}.tmp.${process.pid}.${++writeCounter}`;
47623
+ const path5 = getTokenPath();
47624
+ const tmpPath = `${path5}.tmp.${process.pid}.${++writeCounter}`;
49283
47625
  const fh = await fs2.open(tmpPath, "w", 384);
49284
47626
  try {
49285
47627
  await fh.writeFile(JSON.stringify(session, null, 2), "utf8");
@@ -49288,7 +47630,7 @@ async function writeToken(session) {
49288
47630
  }
49289
47631
  await chmodSafe(tmpPath, 384);
49290
47632
  try {
49291
- await fs2.rename(tmpPath, path6);
47633
+ await fs2.rename(tmpPath, path5);
49292
47634
  } catch (err) {
49293
47635
  await fs2.rm(tmpPath, { force: true }).catch(() => {
49294
47636
  return;
@@ -49297,9 +47639,9 @@ async function writeToken(session) {
49297
47639
  }
49298
47640
  }
49299
47641
  async function clearToken() {
49300
- const path6 = getTokenPath();
47642
+ const path5 = getTokenPath();
49301
47643
  try {
49302
- await fs2.rm(path6, { force: true });
47644
+ await fs2.rm(path5, { force: true });
49303
47645
  } catch (err) {
49304
47646
  if (err?.code === "ENOENT")
49305
47647
  return;
@@ -49482,8 +47824,8 @@ async function defaultBrowserId() {
49482
47824
  throw new Error("macOS only");
49483
47825
  }
49484
47826
  const { stdout } = await execFileAsync3("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
49485
- const match2 = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
49486
- const browserId = match2?.groups.id ?? "com.apple.Safari";
47827
+ const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
47828
+ const browserId = match?.groups.id ?? "com.apple.Safari";
49487
47829
  if (browserId === "com.apple.safari") {
49488
47830
  return "com.apple.Safari";
49489
47831
  }
@@ -49534,11 +47876,11 @@ async function defaultBrowser(_execFileAsync = execFileAsync5) {
49534
47876
  "/v",
49535
47877
  "ProgId"
49536
47878
  ]);
49537
- const match2 = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
49538
- if (!match2) {
47879
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
47880
+ if (!match) {
49539
47881
  throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
49540
47882
  }
49541
- const { id } = match2.groups;
47883
+ const { id } = match.groups;
49542
47884
  const dotIndex = id.lastIndexOf(".");
49543
47885
  const hyphenIndex = id.lastIndexOf("-");
49544
47886
  const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
@@ -49609,7 +47951,7 @@ __export(exports_open, {
49609
47951
  });
49610
47952
  import process15 from "node:process";
49611
47953
  import { Buffer as Buffer2 } from "node:buffer";
49612
- import path6 from "node:path";
47954
+ import path5 from "node:path";
49613
47955
  import { fileURLToPath } from "node:url";
49614
47956
  import { promisify as promisify7 } from "node:util";
49615
47957
  import childProcess from "node:child_process";
@@ -49834,8 +48176,8 @@ var init_open = __esm(() => {
49834
48176
  init_default_browser();
49835
48177
  init_is_inside_container();
49836
48178
  execFile7 = promisify7(childProcess.execFile);
49837
- __dirname2 = path6.dirname(fileURLToPath(import.meta.url));
49838
- localXdgOpenPath = path6.join(__dirname2, "xdg-open");
48179
+ __dirname2 = path5.dirname(fileURLToPath(import.meta.url));
48180
+ localXdgOpenPath = path5.join(__dirname2, "xdg-open");
49839
48181
  ({ platform: platform3, arch } = process15);
49840
48182
  apps = {};
49841
48183
  defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
@@ -50608,8 +48950,8 @@ var require_parse4 = __commonJS((exports, module) => {
50608
48950
  env2 = {};
50609
48951
  }
50610
48952
  var commented = false;
50611
- return matches3.map(function(match2) {
50612
- var s = match2[0];
48953
+ return matches3.map(function(match) {
48954
+ var s = match[0];
50613
48955
  if (!s || commented) {
50614
48956
  return;
50615
48957
  }
@@ -50685,7 +49027,7 @@ var require_parse4 = __commonJS((exports, module) => {
50685
49027
  return { op: s };
50686
49028
  } else if (hash.test(c2)) {
50687
49029
  commented = true;
50688
- var commentObj = { comment: string.slice(match2.index + i2 + 1) };
49030
+ var commentObj = { comment: string.slice(match.index + i2 + 1) };
50689
49031
  if (out.length) {
50690
49032
  return [out, commentObj];
50691
49033
  }
@@ -53599,12 +51941,12 @@ function samePath(a3, b3) {
53599
51941
  return CASE_INSENSITIVE_FS ? a3.toLowerCase() === b3.toLowerCase() : a3 === b3;
53600
51942
  }
53601
51943
  async function readManifest2() {
53602
- const path7 = getManifestPath2();
51944
+ const path6 = getManifestPath2();
53603
51945
  try {
53604
- const raw = await fs9.readFile(path7, "utf8");
51946
+ const raw = await fs9.readFile(path6, "utf8");
53605
51947
  const parsed = JSON.parse(raw);
53606
51948
  if (!parsed || typeof parsed !== "object" || !Array.isArray(parsed.entries)) {
53607
- logger.warning(`artifact-manifest: malformed manifest at ${path7}, using empty manifest`);
51949
+ logger.warning(`artifact-manifest: malformed manifest at ${path6}, using empty manifest`);
53608
51950
  return { entries: [] };
53609
51951
  }
53610
51952
  return parsed;
@@ -53612,13 +51954,13 @@ async function readManifest2() {
53612
51954
  if (err?.code === "ENOENT")
53613
51955
  return { entries: [] };
53614
51956
  const message = err instanceof Error ? err.message : String(err);
53615
- logger.warning(`artifact-manifest: failed to read ${path7}: ${message}. Using empty manifest.`);
51957
+ logger.warning(`artifact-manifest: failed to read ${path6}: ${message}. Using empty manifest.`);
53616
51958
  return { entries: [] };
53617
51959
  }
53618
51960
  }
53619
51961
  async function writeManifest2(manifest) {
53620
- const path7 = getManifestPath2();
53621
- const tmpPath = `${path7}.tmp`;
51962
+ const path6 = getManifestPath2();
51963
+ const tmpPath = `${path6}.tmp`;
53622
51964
  await fs9.mkdir(getConfigDir(), { recursive: true, mode: 448 });
53623
51965
  const fh = await fs9.open(tmpPath, "w", 384);
53624
51966
  try {
@@ -53629,7 +51971,7 @@ async function writeManifest2(manifest) {
53629
51971
  try {
53630
51972
  await fs9.chmod(tmpPath, 384);
53631
51973
  } catch {}
53632
- await fs9.rename(tmpPath, path7);
51974
+ await fs9.rename(tmpPath, path6);
53633
51975
  }
53634
51976
  function lookupByPath(manifest, absPath) {
53635
51977
  return manifest.entries.find((e2) => samePath(e2.localPath, absPath));
@@ -53825,8 +52167,8 @@ class DisallowedExtensionError extends Error {
53825
52167
  }
53826
52168
  function mimeForPath(relPath) {
53827
52169
  const dot = relPath.lastIndexOf(".");
53828
- const ext2 = dot >= 0 ? relPath.slice(dot + 1).toLowerCase() : "";
53829
- return EXT_TO_MIME[ext2] ?? "application/octet-stream";
52170
+ const ext = dot >= 0 ? relPath.slice(dot + 1).toLowerCase() : "";
52171
+ return EXT_TO_MIME[ext] ?? "application/octet-stream";
53830
52172
  }
53831
52173
  function extOf(relPath) {
53832
52174
  const dot = relPath.lastIndexOf(".");
@@ -54105,9 +52447,9 @@ async function artifactUpload(filePath, opts) {
54105
52447
  }
54106
52448
  }
54107
52449
  async function uploadFile(absPath, displayPath, size, token, opts) {
54108
- const ext2 = extname5(absPath).toLowerCase().slice(1);
54109
- if (!ALLOWED_EXTENSIONS.has(ext2)) {
54110
- console.error(`Error: unsupported file type ".${ext2}". Allowed: ${[...ALLOWED_EXTENSIONS].map((e2) => `.${e2}`).join(", ")}`);
52450
+ const ext = extname5(absPath).toLowerCase().slice(1);
52451
+ if (!ALLOWED_EXTENSIONS.has(ext)) {
52452
+ console.error(`Error: unsupported file type ".${ext}". Allowed: ${[...ALLOWED_EXTENSIONS].map((e2) => `.${e2}`).join(", ")}`);
54111
52453
  process.exitCode = 1;
54112
52454
  return;
54113
52455
  }
@@ -54766,8 +53108,8 @@ async function handleGet(key, options2) {
54766
53108
  console.log(value);
54767
53109
  }
54768
53110
  }
54769
- function getNestedValue2(obj, path7) {
54770
- return path7.split(".").reduce((acc, key) => {
53111
+ function getNestedValue2(obj, path6) {
53112
+ return path6.split(".").reduce((acc, key) => {
54771
53113
  if (acc && typeof acc === "object" && key in acc) {
54772
53114
  return acc[key];
54773
53115
  }
@@ -55055,7 +53397,7 @@ function foldAnalytics(aggregates, now) {
55055
53397
  // src/domains/sessions/adapters/claude.ts
55056
53398
  import * as fs15 from "node:fs";
55057
53399
  import * as os4 from "node:os";
55058
- import * as path7 from "node:path";
53400
+ import * as path6 from "node:path";
55059
53401
 
55060
53402
  // src/domains/sessions/transcript-parser.ts
55061
53403
  import * as fs14 from "node:fs";
@@ -55216,7 +53558,7 @@ function sumCodexAgentTokens(jsonlPath) {
55216
53558
  }
55217
53559
 
55218
53560
  // src/domains/sessions/adapters/claude.ts
55219
- var CLAUDE_ROOT = path7.join(os4.homedir(), ".claude", "projects");
53561
+ var CLAUDE_ROOT = path6.join(os4.homedir(), ".claude", "projects");
55220
53562
  var MAX_PARSE_BYTES = 50 * 1024 * 1024;
55221
53563
  var HARNESS_TAGS = [
55222
53564
  "command-name",
@@ -55367,7 +53709,7 @@ async function listSessions(rootDir) {
55367
53709
  return out;
55368
53710
  }
55369
53711
  for (const proj of projects) {
55370
- const projDir = path7.join(root, proj);
53712
+ const projDir = path6.join(root, proj);
55371
53713
  let entries;
55372
53714
  try {
55373
53715
  entries = fs15.readdirSync(projDir);
@@ -55377,7 +53719,7 @@ async function listSessions(rootDir) {
55377
53719
  for (const entry of entries) {
55378
53720
  if (!entry.endsWith(".jsonl"))
55379
53721
  continue;
55380
- const full = path7.join(projDir, entry);
53722
+ const full = path6.join(projDir, entry);
55381
53723
  let st;
55382
53724
  try {
55383
53725
  st = fs15.statSync(full);
@@ -55401,7 +53743,7 @@ async function listSessions(rootDir) {
55401
53743
  return out;
55402
53744
  }
55403
53745
  function loadSubagentIndex(parentTranscriptPath, sessionId) {
55404
- const subDir = path7.join(path7.dirname(parentTranscriptPath), sessionId, "subagents");
53746
+ const subDir = path6.join(path6.dirname(parentTranscriptPath), sessionId, "subagents");
55405
53747
  const byToolUseId = new Map;
55406
53748
  const byAgentId = new Map;
55407
53749
  let names;
@@ -55416,9 +53758,9 @@ function loadSubagentIndex(parentTranscriptPath, sessionId) {
55416
53758
  const agentId = name.replace(/^agent-/, "").replace(/\.meta\.json$/, "");
55417
53759
  let meta = {};
55418
53760
  try {
55419
- meta = JSON.parse(fs15.readFileSync(path7.join(subDir, name), "utf-8"));
53761
+ meta = JSON.parse(fs15.readFileSync(path6.join(subDir, name), "utf-8"));
55420
53762
  } catch {}
55421
- const jsonlPath = path7.join(subDir, `agent-${agentId}.jsonl`);
53763
+ const jsonlPath = path6.join(subDir, `agent-${agentId}.jsonl`);
55422
53764
  const { tokens, model } = sumClaudeAgentTokens(jsonlPath);
55423
53765
  const entry = {
55424
53766
  agentId,
@@ -55481,9 +53823,9 @@ function handleTaskUse(state, rec, toolUse, subIdx) {
55481
53823
  return;
55482
53824
  const inp = toolUse.input || {};
55483
53825
  const toolUseId = toolUse.id;
55484
- const match2 = toolUseId ? subIdx.byToolUseId.get(toolUseId) : null;
53826
+ const match = toolUseId ? subIdx.byToolUseId.get(toolUseId) : null;
55485
53827
  const now = rec.timestamp || new Date().toISOString();
55486
- if (!match2) {
53828
+ if (!match) {
55487
53829
  const aid = (toolUseId || `unknown-${turn.agentIds.length}`).replace(/^toolu_/, "");
55488
53830
  const agent2 = {
55489
53831
  id: aid,
@@ -55500,24 +53842,24 @@ function handleTaskUse(state, rec, toolUse, subIdx) {
55500
53842
  turn.agentIds.push(aid);
55501
53843
  return;
55502
53844
  }
55503
- const agentId = match2.agentId;
53845
+ const agentId = match.agentId;
55504
53846
  const agent = {
55505
53847
  id: agentId,
55506
- type: match2.type || inp.subagent_type || "unknown",
55507
- description: inp.description || match2.description || "",
53848
+ type: match.type || inp.subagent_type || "unknown",
53849
+ description: inp.description || match.description || "",
55508
53850
  promptPreview: String(inp.prompt || "").slice(0, 120),
55509
53851
  turnId: turn.id,
55510
- startedAt: match2.startedAt || now,
55511
- endedAt: match2.endedAt || now,
53852
+ startedAt: match.startedAt || now,
53853
+ endedAt: match.endedAt || now,
55512
53854
  status: "done",
55513
- tokens: match2.tokens || emptyTokens(),
55514
- model: match2.model || null
53855
+ tokens: match.tokens || emptyTokens(),
53856
+ model: match.model || null
55515
53857
  };
55516
53858
  state.agents[agentId] = agent;
55517
53859
  turn.agentIds.push(agentId);
55518
- if (match2.jsonlPath) {
53860
+ if (match.jsonlPath) {
55519
53861
  try {
55520
- state.agentOffsets[agentId] = fs15.statSync(match2.jsonlPath).size;
53862
+ state.agentOffsets[agentId] = fs15.statSync(match.jsonlPath).size;
55521
53863
  } catch {
55522
53864
  state.agentOffsets[agentId] = 0;
55523
53865
  }
@@ -55576,13 +53918,13 @@ function lastNonStartupTurn(state) {
55576
53918
  return null;
55577
53919
  }
55578
53920
  async function parse2(filePath) {
55579
- const sessionId = path7.basename(filePath, ".jsonl");
53921
+ const sessionId = path6.basename(filePath, ".jsonl");
55580
53922
  try {
55581
53923
  const st = fs15.statSync(filePath);
55582
53924
  if (st.size > MAX_PARSE_BYTES) {
55583
53925
  const mb = (st.size / (1024 * 1024)).toFixed(0);
55584
53926
  const cap = MAX_PARSE_BYTES / (1024 * 1024);
55585
- throw Object.assign(new Error(`Claude transcript ${path7.basename(filePath)} is ${mb}MB (> ${cap}MB cap).`), { code: "TRANSCRIPT_TOO_LARGE" });
53927
+ throw Object.assign(new Error(`Claude transcript ${path6.basename(filePath)} is ${mb}MB (> ${cap}MB cap).`), { code: "TRANSCRIPT_TOO_LARGE" });
55586
53928
  }
55587
53929
  } catch (e2) {
55588
53930
  if (e2.code === "TRANSCRIPT_TOO_LARGE")
@@ -55762,8 +54104,8 @@ async function parse2(filePath) {
55762
54104
  function matches(filePath) {
55763
54105
  if (!filePath)
55764
54106
  return false;
55765
- const norm = path7.resolve(filePath);
55766
- return norm.includes(`${path7.sep}.claude${path7.sep}projects${path7.sep}`) && norm.endsWith(".jsonl");
54107
+ const norm = path6.resolve(filePath);
54108
+ return norm.includes(`${path6.sep}.claude${path6.sep}projects${path6.sep}`) && norm.endsWith(".jsonl");
55767
54109
  }
55768
54110
  var claudeAdapter = {
55769
54111
  name: "claude",
@@ -55775,15 +54117,15 @@ var claudeAdapter = {
55775
54117
  // src/domains/sessions/adapters/codex.ts
55776
54118
  import * as fs16 from "node:fs";
55777
54119
  import * as os5 from "node:os";
55778
- import * as path8 from "node:path";
55779
- var CODEX_ROOT = path8.join(os5.homedir(), ".codex", "sessions");
54120
+ import * as path7 from "node:path";
54121
+ var CODEX_ROOT = path7.join(os5.homedir(), ".codex", "sessions");
55780
54122
  function normalizeName(n) {
55781
54123
  return String(n || "").toLowerCase().replace(/[^a-z0-9]/g, "");
55782
54124
  }
55783
54125
  function skillDirs(cwd2) {
55784
- const dirs = [path8.join(os5.homedir(), ".codex", "skills")];
54126
+ const dirs = [path7.join(os5.homedir(), ".codex", "skills")];
55785
54127
  if (cwd2)
55786
- dirs.push(path8.join(cwd2, ".codex", "skills"));
54128
+ dirs.push(path7.join(cwd2, ".codex", "skills"));
55787
54129
  return dirs;
55788
54130
  }
55789
54131
  function loadSkillCatalog(cwd2) {
@@ -55799,7 +54141,7 @@ function loadSkillCatalog(cwd2) {
55799
54141
  for (const name of names) {
55800
54142
  if (name.startsWith("."))
55801
54143
  continue;
55802
- const entryPath = path8.join(dir, name);
54144
+ const entryPath = path7.join(dir, name);
55803
54145
  let st;
55804
54146
  try {
55805
54147
  st = fs16.statSync(entryPath);
@@ -55808,7 +54150,7 @@ function loadSkillCatalog(cwd2) {
55808
54150
  }
55809
54151
  if (!st.isDirectory())
55810
54152
  continue;
55811
- if (!fs16.existsSync(path8.join(entryPath, "SKILL.md")))
54153
+ if (!fs16.existsSync(path7.join(entryPath, "SKILL.md")))
55812
54154
  continue;
55813
54155
  const key = normalizeName(name);
55814
54156
  if (!key || seen.has(key))
@@ -55857,7 +54199,7 @@ function safeJSON2(line) {
55857
54199
  }
55858
54200
  }
55859
54201
  function extractUuidFromName(filePath) {
55860
- const base = path8.basename(filePath, ".jsonl");
54202
+ const base = path7.basename(filePath, ".jsonl");
55861
54203
  const m2 = base.match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/);
55862
54204
  return m2?.[1] ?? null;
55863
54205
  }
@@ -55869,7 +54211,7 @@ function walkRolloutFiles(dir, depth, maxDepth, out) {
55869
54211
  return;
55870
54212
  }
55871
54213
  for (const e2 of entries) {
55872
- const full = path8.join(dir, e2.name);
54214
+ const full = path7.join(dir, e2.name);
55873
54215
  if (e2.isDirectory()) {
55874
54216
  if (depth < maxDepth)
55875
54217
  walkRolloutFiles(full, depth + 1, maxDepth, out);
@@ -55993,7 +54335,7 @@ async function listSessions2(rootDir) {
55993
54335
  const summary = readFirstUserPrompt(full);
55994
54336
  const idFromName = extractUuidFromName(full);
55995
54337
  out.push({
55996
- id: idFromName || meta.session_id || path8.basename(full, ".jsonl"),
54338
+ id: idFromName || meta.session_id || path7.basename(full, ".jsonl"),
55997
54339
  adapterName: "codex",
55998
54340
  path: full,
55999
54341
  startedAt: meta.timestamp || new Date(st.mtimeMs).toISOString(),
@@ -56086,7 +54428,7 @@ async function parse3(filePath) {
56086
54428
  const recs = records;
56087
54429
  const sessionMetaRec = recs.find((r2) => r2?.type === "session_meta");
56088
54430
  const sessionMeta = sessionMetaRec?.payload || {};
56089
- const sessionId = extractUuidFromName(filePath) || sessionMeta.session_id || path8.basename(filePath, ".jsonl");
54431
+ const sessionId = extractUuidFromName(filePath) || sessionMeta.session_id || path7.basename(filePath, ".jsonl");
56090
54432
  const firstTs = sessionMeta.timestamp || recs.find((r2) => r2?.timestamp)?.timestamp || new Date().toISOString();
56091
54433
  const skillCatalog = loadSkillCatalog(sessionMeta.cwd || null);
56092
54434
  const state = {
@@ -56257,8 +54599,8 @@ async function parse3(filePath) {
56257
54599
  function matches2(filePath) {
56258
54600
  if (!filePath)
56259
54601
  return false;
56260
- const norm = path8.resolve(filePath);
56261
- return norm.includes(`${path8.sep}.codex${path8.sep}sessions${path8.sep}`) && /rollout-.*\.jsonl$/.test(norm);
54602
+ const norm = path7.resolve(filePath);
54603
+ return norm.includes(`${path7.sep}.codex${path7.sep}sessions${path7.sep}`) && /rollout-.*\.jsonl$/.test(norm);
56262
54604
  }
56263
54605
  var codexAdapter = {
56264
54606
  name: "codex",
@@ -57039,10 +55381,10 @@ async function getCommandPath(command) {
57039
55381
  const whichCmd = process.platform === "win32" ? "where" : "which";
57040
55382
  logger.verbose(`Getting path for command: ${command}`);
57041
55383
  const { stdout } = await execAsync2(`${whichCmd} ${command}`);
57042
- const path9 = stdout.trim().split(`
55384
+ const path8 = stdout.trim().split(`
57043
55385
  `)[0] || null;
57044
- logger.verbose(`Command path resolved: ${command} -> ${path9}`);
57045
- return path9;
55386
+ logger.verbose(`Command path resolved: ${command} -> ${path8}`);
55387
+ return path8;
57046
55388
  } catch {
57047
55389
  logger.verbose(`Failed to get path for command: ${command}`);
57048
55390
  return null;
@@ -57068,8 +55410,8 @@ async function getCommandVersion(command, versionFlag, versionRegex) {
57068
55410
  logger.verbose(`Getting version for: ${command} ${versionFlag}`);
57069
55411
  const { stdout, stderr } = await execAsync2(`${command} ${versionFlag}`);
57070
55412
  const output2 = stdout || stderr;
57071
- const match2 = output2.match(versionRegex);
57072
- const version3 = match2?.[1] || null;
55413
+ const match = output2.match(versionRegex);
55414
+ const version3 = match?.[1] || null;
57073
55415
  logger.verbose(`Version detected: ${command} -> ${version3}`);
57074
55416
  return version3;
57075
55417
  } catch (error) {
@@ -57097,7 +55439,7 @@ async function checkDependency(config) {
57097
55439
  const exists = await commandExists(command);
57098
55440
  if (exists) {
57099
55441
  logger.verbose(`Found ${config.name} via command: ${command}`);
57100
- const path9 = await getCommandPath(command);
55442
+ const path8 = await getCommandPath(command);
57101
55443
  const version3 = await getCommandVersion(command, config.versionFlag, config.versionRegex);
57102
55444
  let meetsRequirements = true;
57103
55445
  let message;
@@ -57111,7 +55453,7 @@ async function checkDependency(config) {
57111
55453
  name: config.name,
57112
55454
  installed: true,
57113
55455
  version: version3 || undefined,
57114
- path: path9 || undefined,
55456
+ path: path8 || undefined,
57115
55457
  minVersion: config.minVersion,
57116
55458
  meetsRequirements,
57117
55459
  message
@@ -57471,13 +55813,13 @@ class SystemChecker {
57471
55813
  async checkGit() {
57472
55814
  try {
57473
55815
  const { stdout } = await execAsync5("git --version");
57474
- const match2 = stdout.match(/(\d+\.\d+\.\d+)/);
55816
+ const match = stdout.match(/(\d+\.\d+\.\d+)/);
57475
55817
  return {
57476
55818
  id: "git-version",
57477
55819
  name: "Git",
57478
55820
  group: "system",
57479
55821
  status: "pass",
57480
- message: match2 ? `v${match2[1]}` : "Installed",
55822
+ message: match ? `v${match[1]}` : "Installed",
57481
55823
  autoFixable: false
57482
55824
  };
57483
55825
  } catch {
@@ -57495,8 +55837,8 @@ class SystemChecker {
57495
55837
  async checkGitHubCli() {
57496
55838
  try {
57497
55839
  const { stdout } = await execAsync5("gh --version");
57498
- const match2 = stdout.match(/(\d+\.\d+\.\d+)/);
57499
- const version3 = match2?.[1];
55840
+ const match = stdout.match(/(\d+\.\d+\.\d+)/);
55841
+ const version3 = match?.[1];
57500
55842
  if (version3 && compareVersions4(version3, MIN_GH_CLI_VERSION) < 0) {
57501
55843
  return {
57502
55844
  id: "gh-cli-version",
@@ -58285,8 +56627,8 @@ function checkClaudeMd(setup, projectDir) {
58285
56627
  results.push(checkClaudeMdFile(projectClaudeMd, "Project CLAUDE.md", "sk-project-claude-md"));
58286
56628
  return results;
58287
56629
  }
58288
- function checkClaudeMdFile(path9, name, id) {
58289
- if (!existsSync36(path9)) {
56630
+ function checkClaudeMdFile(path8, name, id) {
56631
+ if (!existsSync36(path8)) {
58290
56632
  return {
58291
56633
  id,
58292
56634
  name,
@@ -58299,7 +56641,7 @@ function checkClaudeMdFile(path9, name, id) {
58299
56641
  };
58300
56642
  }
58301
56643
  try {
58302
- const stat8 = statSync5(path9);
56644
+ const stat8 = statSync5(path8);
58303
56645
  const sizeKB = (stat8.size / 1024).toFixed(1);
58304
56646
  if (stat8.size === 0) {
58305
56647
  return {
@@ -58309,7 +56651,7 @@ function checkClaudeMdFile(path9, name, id) {
58309
56651
  priority: "standard",
58310
56652
  status: "warn",
58311
56653
  message: "Empty (0 bytes)",
58312
- details: path9,
56654
+ details: path8,
58313
56655
  suggestion: "Add project instructions to CLAUDE.md",
58314
56656
  autoFixable: false
58315
56657
  };
@@ -58321,7 +56663,7 @@ function checkClaudeMdFile(path9, name, id) {
58321
56663
  priority: "standard",
58322
56664
  status: "pass",
58323
56665
  message: `Found (${sizeKB}KB)`,
58324
- details: path9,
56666
+ details: path8,
58325
56667
  autoFixable: false
58326
56668
  };
58327
56669
  } catch {
@@ -58332,7 +56674,7 @@ function checkClaudeMdFile(path9, name, id) {
58332
56674
  priority: "standard",
58333
56675
  status: "warn",
58334
56676
  message: "Unreadable",
58335
- details: path9,
56677
+ details: path8,
58336
56678
  suggestion: "Check file permissions",
58337
56679
  autoFixable: false
58338
56680
  };
@@ -58554,7 +56896,7 @@ async function checkHooksExist(projectDir) {
58554
56896
  const checkedFiles = new Set;
58555
56897
  if (globalExists) {
58556
56898
  const files = await readdir23(globalHooksDir, { withFileTypes: false });
58557
- const hooks = files.filter((f3) => HOOK_EXTENSIONS2.some((ext2) => f3.endsWith(ext2)));
56899
+ const hooks = files.filter((f3) => HOOK_EXTENSIONS2.some((ext) => f3.endsWith(ext)));
58558
56900
  hooks.forEach((hook) => {
58559
56901
  const fullPath = join82(globalHooksDir, hook);
58560
56902
  checkedFiles.add(normalizePath(fullPath));
@@ -58564,7 +56906,7 @@ async function checkHooksExist(projectDir) {
58564
56906
  const normalizedProject = normalizePath(projectHooksDir);
58565
56907
  if (projectExists && normalizedProject !== normalizedGlobal) {
58566
56908
  const files = await readdir23(projectHooksDir, { withFileTypes: false });
58567
- const hooks = files.filter((f3) => HOOK_EXTENSIONS2.some((ext2) => f3.endsWith(ext2)));
56909
+ const hooks = files.filter((f3) => HOOK_EXTENSIONS2.some((ext) => f3.endsWith(ext)));
58568
56910
  hooks.forEach((hook) => {
58569
56911
  const fullPath = join82(projectHooksDir, hook);
58570
56912
  checkedFiles.add(normalizePath(fullPath));
@@ -58983,14 +57325,14 @@ init_logger();
58983
57325
  import { execSync as execSync3 } from "node:child_process";
58984
57326
  import * as fs18 from "node:fs";
58985
57327
  import * as os6 from "node:os";
58986
- import * as path9 from "node:path";
57328
+ import * as path8 from "node:path";
58987
57329
  var VALID_TAG_PATTERN = /^[a-zA-Z0-9._+\-]+$/;
58988
57330
 
58989
57331
  class GitCloneManager {
58990
57332
  tempBaseDir;
58991
57333
  constructor() {
58992
57334
  const homeDir = process.env.HOME || process.env.USERPROFILE;
58993
- this.tempBaseDir = process.env.TMPDIR || process.env.TEMP || process.env.TMP || (homeDir ? path9.join(homeDir, ".sunagentkit", "tmp") : null) || path9.join(os6.tmpdir(), ".sunagentkit", "tmp");
57335
+ this.tempBaseDir = process.env.TMPDIR || process.env.TEMP || process.env.TMP || (homeDir ? path8.join(homeDir, ".sunagentkit", "tmp") : null) || path8.join(os6.tmpdir(), ".sunagentkit", "tmp");
58994
57336
  }
58995
57337
  validateTag(tag) {
58996
57338
  if (!VALID_TAG_PATTERN.test(tag)) {
@@ -59011,7 +57353,7 @@ Error: ${msg}
59011
57353
 
59012
57354
  Check disk space and directory permissions.`);
59013
57355
  }
59014
- const tempDir = await fs18.promises.mkdtemp(path9.join(this.tempBaseDir, `sk-git-${kit.repo}-`));
57356
+ const tempDir = await fs18.promises.mkdtemp(path8.join(this.tempBaseDir, `sk-git-${kit.repo}-`));
59015
57357
  const url = preferSsh ? `git@github.com:${kit.owner}/${kit.repo}.git` : `https://github.com/${kit.owner}/${kit.repo}.git`;
59016
57358
  const method = preferSsh ? "ssh" : "https";
59017
57359
  logger.verbose("Git clone", { url, tag, tempDir, method });
@@ -59044,7 +57386,7 @@ Check disk space and directory permissions.`);
59044
57386
  throw shallowError;
59045
57387
  }
59046
57388
  }
59047
- const gitDir = path9.join(tempDir, ".git");
57389
+ const gitDir = path8.join(tempDir, ".git");
59048
57390
  await fs18.promises.rm(gitDir, { recursive: true, force: true });
59049
57391
  logger.debug(`Git clone successful: ${tempDir}`);
59050
57392
  return {
@@ -59093,13 +57435,13 @@ Ensure you have access to the repository and your git credentials are configured
59093
57435
  const homeDir = process.env.HOME || process.env.USERPROFILE;
59094
57436
  if (!homeDir)
59095
57437
  return false;
59096
- const sshDir = path9.join(homeDir, ".ssh");
57438
+ const sshDir = path8.join(homeDir, ".ssh");
59097
57439
  const keyFiles = ["id_rsa", "id_ed25519", "id_ecdsa", "id_rsa.pub", "id_ed25519.pub"];
59098
57440
  try {
59099
57441
  if (!fs18.existsSync(sshDir))
59100
57442
  return false;
59101
57443
  for (const keyFile of keyFiles) {
59102
- if (fs18.existsSync(path9.join(sshDir, keyFile))) {
57444
+ if (fs18.existsSync(path8.join(sshDir, keyFile))) {
59103
57445
  return true;
59104
57446
  }
59105
57447
  }
@@ -59348,15 +57690,15 @@ async function checkHomeDirResolution() {
59348
57690
  const nodeHome = normalize8(homedir25());
59349
57691
  const rawEnvHome = getHomeDirectoryFromEnv(platform6());
59350
57692
  const envHome = rawEnvHome ? normalize8(rawEnvHome) : "";
59351
- const match2 = nodeHome === envHome && envHome !== "";
57693
+ const match = nodeHome === envHome && envHome !== "";
59352
57694
  return {
59353
57695
  id: "home-dir-resolution",
59354
57696
  name: "Home Directory",
59355
57697
  group: "platform",
59356
57698
  priority: "standard",
59357
- status: match2 ? "pass" : "warn",
59358
- message: match2 ? nodeHome : `Mismatch: Node=${nodeHome}, Env=${envHome || "not set"}`,
59359
- suggestion: !match2 ? "homedir() differs from environment. May cause path issues." : undefined,
57699
+ status: match ? "pass" : "warn",
57700
+ message: match ? nodeHome : `Mismatch: Node=${nodeHome}, Env=${envHome || "not set"}`,
57701
+ suggestion: !match ? "homedir() differs from environment. May cause path issues." : undefined,
59360
57702
  autoFixable: false
59361
57703
  };
59362
57704
  }
@@ -60021,9 +58363,9 @@ class ReportGenerator {
60021
58363
  cliVersion: getCliVersion3()
60022
58364
  };
60023
58365
  }
60024
- scrubPath(path10) {
58366
+ scrubPath(path9) {
60025
58367
  const home6 = process.env.HOME || process.env.USERPROFILE || "";
60026
- return home6 ? path10.replace(home6, "~") : path10;
58368
+ return home6 ? path9.replace(home6, "~") : path9;
60027
58369
  }
60028
58370
  getStatusIcon(status2) {
60029
58371
  switch (status2) {
@@ -60136,9 +58478,9 @@ class DoctorUIRenderer {
60136
58478
  return message;
60137
58479
  }
60138
58480
  }
60139
- shortenPath(path10) {
58481
+ shortenPath(path9) {
60140
58482
  const home6 = process.env.HOME || process.env.USERPROFILE || "";
60141
- let shortened = home6 ? path10.replace(home6, "~") : path10;
58483
+ let shortened = home6 ? path9.replace(home6, "~") : path9;
60142
58484
  const maxLen = 50;
60143
58485
  if (shortened.length > maxLen) {
60144
58486
  const start2 = shortened.slice(0, 20);
@@ -60382,9 +58724,9 @@ function writeEnvFile(filePath, entries) {
60382
58724
  throw err;
60383
58725
  }
60384
58726
  }
60385
- function removeQuietly(path10) {
58727
+ function removeQuietly(path9) {
60386
58728
  try {
60387
- unlinkSync5(path10);
58729
+ unlinkSync5(path9);
60388
58730
  } catch {}
60389
58731
  }
60390
58732
 
@@ -60567,7 +58909,7 @@ var conventionQualityGate = {
60567
58909
 
60568
58910
  // src/domains/hooks/handlers/extension-skill/handler.ts
60569
58911
  import fs19 from "node:fs";
60570
- import path10 from "node:path";
58912
+ import path9 from "node:path";
60571
58913
  var CONFIG_KEY2 = "skill-extension-loader";
60572
58914
  var SKILLS_ROOT_SEGMENTS = [".claude", "skills"];
60573
58915
  var INLINE_CHAR_CAP = 4096;
@@ -60657,9 +58999,9 @@ function loadExtensions(input, ctx) {
60657
58999
  const skillDir = baseSkillName(skill);
60658
59000
  if (!skillDir)
60659
59001
  return NO_OP2;
60660
- const skillsRoot = path10.resolve(cwd2, ...SKILLS_ROOT_SEGMENTS);
60661
- const extDir = path10.resolve(skillsRoot, skillDir, "extensions");
60662
- if (extDir !== skillsRoot && !extDir.startsWith(skillsRoot + path10.sep))
59002
+ const skillsRoot = path9.resolve(cwd2, ...SKILLS_ROOT_SEGMENTS);
59003
+ const extDir = path9.resolve(skillsRoot, skillDir, "extensions");
59004
+ if (extDir !== skillsRoot && !extDir.startsWith(skillsRoot + path9.sep))
60663
59005
  return NO_OP2;
60664
59006
  let entries;
60665
59007
  try {
@@ -60675,7 +59017,7 @@ function loadExtensions(input, ctx) {
60675
59017
  continue;
60676
59018
  let raw;
60677
59019
  try {
60678
- raw = fs19.readFileSync(path10.join(extDir, entry.name), "utf8");
59020
+ raw = fs19.readFileSync(path9.join(extDir, entry.name), "utf8");
60679
59021
  } catch {
60680
59022
  skipped.push(entry.name);
60681
59023
  continue;
@@ -60723,13 +59065,13 @@ function splitTopLevel(command, operators) {
60723
59065
  const re2 = new RegExp(`"[^"]*"|'[^']*'|${opAlternation}`, "g");
60724
59066
  const segments = [];
60725
59067
  let last = 0;
60726
- let match2 = re2.exec(withoutHeredocs);
60727
- while (match2 !== null) {
60728
- if (operators.includes(match2[0])) {
60729
- segments.push(withoutHeredocs.slice(last, match2.index));
60730
- last = match2.index + match2[0].length;
59068
+ let match = re2.exec(withoutHeredocs);
59069
+ while (match !== null) {
59070
+ if (operators.includes(match[0])) {
59071
+ segments.push(withoutHeredocs.slice(last, match.index));
59072
+ last = match.index + match[0].length;
60731
59073
  }
60732
- match2 = re2.exec(withoutHeredocs);
59074
+ match = re2.exec(withoutHeredocs);
60733
59075
  }
60734
59076
  segments.push(withoutHeredocs.slice(last));
60735
59077
  return segments.map((s) => s.trim()).filter((s) => s.length > 0);
@@ -60889,11 +59231,11 @@ function findGitRoot(startDir) {
60889
59231
  dir = parent;
60890
59232
  }
60891
59233
  }
60892
- function readIgnoreFile(path11) {
60893
- if (!existsSync44(path11))
59234
+ function readIgnoreFile(path10) {
59235
+ if (!existsSync44(path10))
60894
59236
  return null;
60895
59237
  try {
60896
- return readFileSync13(path11, "utf8").split(/\r?\n/);
59238
+ return readFileSync13(path10, "utf8").split(/\r?\n/);
60897
59239
  } catch {
60898
59240
  return null;
60899
59241
  }
@@ -61244,9 +59586,9 @@ function runScoutCheck(toolName, rawToolInput, cwd2) {
61244
59586
  return { blocked: false };
61245
59587
  }
61246
59588
  function formatBlockedPathMessage(params) {
61247
- const { path: path11, matchedPattern, toolName } = params;
59589
+ const { path: path10, matchedPattern, toolName } = params;
61248
59590
  return [
61249
- `Blocked: ${toolName} would touch "${path11}", which matches the ignore pattern "${matchedPattern}".`,
59591
+ `Blocked: ${toolName} would touch "${path10}", which matches the ignore pattern "${matchedPattern}".`,
61250
59592
  "This path is excluded because it sits in a high-noise, generated, or vendored directory that " + "would burn context without adding signal.",
61251
59593
  `If this path genuinely needs to be readable, add a line "!${matchedPattern}" to the project's .claude/.tkmignore file to re-include it.`
61252
59594
  ].join(`
@@ -61615,9 +59957,9 @@ import { homedir as homedir26 } from "node:os";
61615
59957
  import { dirname as dirname25, join as join94, resolve as resolve20 } from "node:path";
61616
59958
  var PROVIDER_DIRS = [".claude", ".codex"];
61617
59959
  var MAX_WALK = 6;
61618
- function readManifestRaw(path11) {
59960
+ function readManifestRaw(path10) {
61619
59961
  try {
61620
- const raw = readFileSync14(path11, "utf8");
59962
+ const raw = readFileSync14(path10, "utf8");
61621
59963
  return JSON.parse(raw);
61622
59964
  } catch {
61623
59965
  return null;
@@ -61633,9 +59975,9 @@ function findManifest(cwd2) {
61633
59975
  for (const provider of PROVIDER_DIRS) {
61634
59976
  const providerRoot = join94(dir, provider);
61635
59977
  if (existsSync45(providerRoot)) {
61636
- const path11 = findManifestInProviderDir(providerRoot);
61637
- if (path11)
61638
- return path11;
59978
+ const path10 = findManifestInProviderDir(providerRoot);
59979
+ if (path10)
59980
+ return path10;
61639
59981
  }
61640
59982
  }
61641
59983
  const parent = dirname25(dir);
@@ -61682,8 +60024,8 @@ init_takumi_constants();
61682
60024
  // src/domains/hooks/lib/hook-logger.ts
61683
60025
  import { appendFileSync } from "node:fs";
61684
60026
  var extraLogPath = null;
61685
- function setHookDebugLog(path11) {
61686
- extraLogPath = path11 && path11.trim().length > 0 ? path11 : null;
60027
+ function setHookDebugLog(path10) {
60028
+ extraLogPath = path10 && path10.trim().length > 0 ? path10 : null;
61687
60029
  }
61688
60030
  function formatValue(v2) {
61689
60031
  if (v2 === null || v2 === undefined)
@@ -61955,6 +60297,7 @@ function buildSessionPayload(args) {
61955
60297
  const endedAt = summary.timing.ended_at ?? startedAt;
61956
60298
  const durationS = summary.timing.duration_s ?? Math.max(0, Math.round((Date.parse(endedAt) - Date.parse(startedAt)) / 1000));
61957
60299
  const tokens = summary.totals;
60300
+ const hasTokenUsage = summary.token_usage && Object.keys(summary.token_usage).length > 0;
61958
60301
  return {
61959
60302
  session: {
61960
60303
  id: summary.session_id,
@@ -61971,7 +60314,8 @@ function buildSessionPayload(args) {
61971
60314
  cache_write_tokens: tokens.cache_write,
61972
60315
  milestone_completed: args.milestone,
61973
60316
  error_count: args.errorCount,
61974
- tool_stats: summary.tool_stats
60317
+ tool_stats: summary.tool_stats,
60318
+ ...hasTokenUsage ? { token_usage: summary.token_usage } : {}
61975
60319
  }
61976
60320
  };
61977
60321
  }
@@ -61991,6 +60335,7 @@ function initialSummary(args) {
61991
60335
  project: args.project,
61992
60336
  timing: { started_at: args.startedAt, ended_at: null, duration_s: null },
61993
60337
  main_loop_tokens: zeroTokens(),
60338
+ token_usage: {},
61994
60339
  subagents: [],
61995
60340
  skills: [],
61996
60341
  tool_stats: {
@@ -62123,6 +60468,7 @@ async function tailRead(args) {
62123
60468
  function bucketTokens(records) {
62124
60469
  const mainLoopDelta = zeroTokens2();
62125
60470
  const subagentDeltas = new Map;
60471
+ const tokenUsageDeltas = new Map;
62126
60472
  for (const record of records) {
62127
60473
  if (record.type !== "assistant")
62128
60474
  continue;
@@ -62141,8 +60487,13 @@ function bucketTokens(records) {
62141
60487
  } else {
62142
60488
  Object.assign(mainLoopDelta, addTokens2(mainLoopDelta, tokens));
62143
60489
  }
60490
+ const model = record.message?.model;
60491
+ if (model) {
60492
+ const prev = tokenUsageDeltas.get(model) ?? zeroTokens2();
60493
+ tokenUsageDeltas.set(model, addTokens2(prev, tokens));
60494
+ }
62144
60495
  }
62145
- return { mainLoopDelta, subagentDeltas };
60496
+ return { mainLoopDelta, subagentDeltas, tokenUsageDeltas };
62146
60497
  }
62147
60498
 
62148
60499
  // src/domains/hooks/telemetry/lib/transcript-apply.ts
@@ -62157,6 +60508,13 @@ function addTokens3(a3, b3) {
62157
60508
  cache_write: a3.cache_write + b3.cache_write
62158
60509
  };
62159
60510
  }
60511
+ function mergeTokenUsageDeltas(existing, deltas) {
60512
+ const out = { ...existing ?? {} };
60513
+ for (const [model, delta] of deltas) {
60514
+ out[model] = addTokens3(ensureTokens(out[model]), delta);
60515
+ }
60516
+ return out;
60517
+ }
62160
60518
  async function applyTranscriptDelta(args) {
62161
60519
  if (!args.transcriptPath) {
62162
60520
  return { summary: args.summary, read: false };
@@ -62169,7 +60527,7 @@ async function applyTranscriptDelta(args) {
62169
60527
  if (records.length === 0 && nextOffset === args.summary.transcript_offset) {
62170
60528
  return { summary: args.summary, read: true };
62171
60529
  }
62172
- const { mainLoopDelta, subagentDeltas } = bucketTokens(records);
60530
+ const { mainLoopDelta, subagentDeltas, tokenUsageDeltas } = bucketTokens(records);
62173
60531
  const updated = {
62174
60532
  ...args.summary,
62175
60533
  main_loop_tokens: addTokens3(args.summary.main_loop_tokens, mainLoopDelta),
@@ -62179,6 +60537,7 @@ async function applyTranscriptDelta(args) {
62179
60537
  return rec;
62180
60538
  return { ...rec, tokens: addTokens3(ensureTokens(rec.tokens), delta) };
62181
60539
  }),
60540
+ token_usage: mergeTokenUsageDeltas(args.summary.token_usage, tokenUsageDeltas),
62182
60541
  transcript_offset: nextOffset
62183
60542
  };
62184
60543
  return { summary: updated, read: true };
@@ -62605,9 +60964,9 @@ import { join as join99 } from "node:path";
62605
60964
  // src/domains/hooks/telemetry/lib/retention.ts
62606
60965
  import { promises as fs24 } from "node:fs";
62607
60966
  import { join as join98 } from "node:path";
62608
- async function pathExists24(path11) {
60967
+ async function pathExists24(path10) {
62609
60968
  try {
62610
- await fs24.access(path11);
60969
+ await fs24.access(path10);
62611
60970
  return true;
62612
60971
  } catch {
62613
60972
  return false;
@@ -62683,9 +61042,9 @@ async function sweepRetention(args) {
62683
61042
 
62684
61043
  // src/domains/hooks/telemetry/otlp/observations-export-state.ts
62685
61044
  import { promises as fs25 } from "node:fs";
62686
- async function exists(path11) {
61045
+ async function exists(path10) {
62687
61046
  try {
62688
- await fs25.access(path11);
61047
+ await fs25.access(path10);
62689
61048
  return true;
62690
61049
  } catch {
62691
61050
  return false;
@@ -63082,21 +61441,21 @@ function lockPath() {
63082
61441
  return join99(getConfigDir(), "obs-flush.lock");
63083
61442
  }
63084
61443
  async function acquireSweepLock(now) {
63085
- const path11 = lockPath();
61444
+ const path10 = lockPath();
63086
61445
  try {
63087
61446
  await fs27.mkdir(getConfigDir(), { recursive: true });
63088
61447
  } catch {
63089
61448
  return false;
63090
61449
  }
63091
61450
  try {
63092
- openSync6(path11, "wx");
61451
+ openSync6(path10, "wx");
63093
61452
  return true;
63094
61453
  } catch {
63095
61454
  try {
63096
- const stat8 = await fs27.stat(path11);
61455
+ const stat8 = await fs27.stat(path10);
63097
61456
  if (now - stat8.mtimeMs > STALE_LOCK_MS) {
63098
- await fs27.rm(path11, { force: true });
63099
- openSync6(path11, "wx");
61457
+ await fs27.rm(path10, { force: true });
61458
+ openSync6(path10, "wx");
63100
61459
  return true;
63101
61460
  }
63102
61461
  } catch {}
@@ -63487,13 +61846,13 @@ function parseUserPrompt(prompt) {
63487
61846
  if (typeof prompt !== "string" || prompt.length === 0) {
63488
61847
  return { skills, subagents };
63489
61848
  }
63490
- for (const match2 of prompt.matchAll(SLASH_COMMAND_RE)) {
63491
- const name = match2[1];
61849
+ for (const match of prompt.matchAll(SLASH_COMMAND_RE)) {
61850
+ const name = match[1];
63492
61851
  if (name)
63493
61852
  skills.push(name);
63494
61853
  }
63495
- for (const match2 of prompt.matchAll(SUBAGENT_MENTION_RE)) {
63496
- const name = match2[1]?.toLowerCase();
61854
+ for (const match of prompt.matchAll(SUBAGENT_MENTION_RE)) {
61855
+ const name = match[1]?.toLowerCase();
63497
61856
  if (name)
63498
61857
  subagents.push(name);
63499
61858
  }
@@ -63793,8 +62152,8 @@ function resolveSuggestedPlan(plansPath, branch, branchPattern) {
63793
62152
  return "";
63794
62153
  let slug = "";
63795
62154
  try {
63796
- const match2 = new RegExp(branchPattern).exec(branch);
63797
- slug = match2 && (match2[1] ?? match2[0]) || "";
62155
+ const match = new RegExp(branchPattern).exec(branch);
62156
+ slug = match && (match[1] ?? match[0]) || "";
63798
62157
  } catch {
63799
62158
  return "";
63800
62159
  }
@@ -64928,7 +63287,7 @@ class Diff {
64928
63287
  return this.diffWithOptionsObj(oldTokens, newTokens, options2, callback);
64929
63288
  }
64930
63289
  diffWithOptionsObj(oldTokens, newTokens, options2, callback) {
64931
- var _a2;
63290
+ var _a;
64932
63291
  const done = (value) => {
64933
63292
  value = this.postProcess(value, options2);
64934
63293
  if (callback) {
@@ -64946,7 +63305,7 @@ class Diff {
64946
63305
  if (options2.maxEditLength != null) {
64947
63306
  maxEditLength = Math.min(maxEditLength, options2.maxEditLength);
64948
63307
  }
64949
- const maxExecutionTime = (_a2 = options2.timeout) !== null && _a2 !== undefined ? _a2 : Infinity;
63308
+ const maxExecutionTime = (_a = options2.timeout) !== null && _a !== undefined ? _a : Infinity;
64950
63309
  const abortAfterTimestamp = Date.now() + maxExecutionTime;
64951
63310
  const bestPath = [{ oldPos: -1, lastComponent: undefined }];
64952
63311
  let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options2);
@@ -65011,16 +63370,16 @@ class Diff {
65011
63370
  }
65012
63371
  }
65013
63372
  }
65014
- addToPath(path11, added, removed, oldPosInc, options2) {
65015
- const last = path11.lastComponent;
63373
+ addToPath(path10, added, removed, oldPosInc, options2) {
63374
+ const last = path10.lastComponent;
65016
63375
  if (last && !options2.oneChangePerToken && last.added === added && last.removed === removed) {
65017
63376
  return {
65018
- oldPos: path11.oldPos + oldPosInc,
63377
+ oldPos: path10.oldPos + oldPosInc,
65019
63378
  lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
65020
63379
  };
65021
63380
  } else {
65022
63381
  return {
65023
- oldPos: path11.oldPos + oldPosInc,
63382
+ oldPos: path10.oldPos + oldPosInc,
65024
63383
  lastComponent: { count: 1, added, removed, previousComponent: last }
65025
63384
  };
65026
63385
  }
@@ -65236,8 +63595,8 @@ function leadingWs(string, segmenter2) {
65236
63595
  if (segmenter2) {
65237
63596
  return leadingAndTrailingWs(string, segmenter2)[0];
65238
63597
  }
65239
- const match2 = string.match(/^\s*/);
65240
- return match2 ? match2[0] : "";
63598
+ const match = string.match(/^\s*/);
63599
+ return match ? match[0] : "";
65241
63600
  }
65242
63601
  function leadingAndTrailingWs(string, segmenter2) {
65243
63602
  if (!segmenter2) {
@@ -65450,7 +63809,7 @@ function isSentenceEndPunct(char) {
65450
63809
 
65451
63810
  class SentenceDiff extends Diff {
65452
63811
  tokenize(value) {
65453
- var _a2;
63812
+ var _a;
65454
63813
  const result = [];
65455
63814
  let tokenStartI = 0;
65456
63815
  for (let i = 0;i < value.length; i++) {
@@ -65461,7 +63820,7 @@ class SentenceDiff extends Diff {
65461
63820
  if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\s/)) {
65462
63821
  result.push(value.slice(tokenStartI, i + 1));
65463
63822
  i = tokenStartI = i + 1;
65464
- while ((_a2 = value[i + 1]) === null || _a2 === undefined ? undefined : _a2.match(/\s/)) {
63823
+ while ((_a = value[i + 1]) === null || _a === undefined ? undefined : _a.match(/\s/)) {
65465
63824
  i++;
65466
63825
  }
65467
63826
  result.push(value.slice(tokenStartI, i + 1));
@@ -65570,8 +63929,8 @@ function unixToWin(patch) {
65570
63929
  return patch.map((p) => unixToWin(p));
65571
63930
  }
65572
63931
  return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map((hunk) => Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map((line, i) => {
65573
- var _a2;
65574
- return line.startsWith("\\") || line.endsWith("\r") || ((_a2 = hunk.lines[i + 1]) === null || _a2 === undefined ? undefined : _a2.startsWith("\\")) ? line : line + "\r";
63932
+ var _a;
63933
+ return line.startsWith("\\") || line.endsWith("\r") || ((_a = hunk.lines[i + 1]) === null || _a === undefined ? undefined : _a.startsWith("\\")) ? line : line + "\r";
65575
63934
  }) })) });
65576
63935
  }
65577
63936
  function winToUnix(patch) {
@@ -65591,8 +63950,8 @@ function isWin(patch) {
65591
63950
  patch = [patch];
65592
63951
  }
65593
63952
  return patch.some((index) => index.hunks.some((hunk) => hunk.lines.some((line) => line.endsWith("\r")))) && patch.every((index) => index.hunks.every((hunk) => hunk.lines.every((line, i) => {
65594
- var _a2;
65595
- return line.startsWith("\\") || line.endsWith("\r") || ((_a2 = hunk.lines[i + 1]) === null || _a2 === undefined ? undefined : _a2.startsWith("\\"));
63953
+ var _a;
63954
+ return line.startsWith("\\") || line.endsWith("\r") || ((_a = hunk.lines[i + 1]) === null || _a === undefined ? undefined : _a.startsWith("\\"));
65596
63955
  })));
65597
63956
  }
65598
63957
 
@@ -65649,7 +64008,7 @@ function parsePatch(uniDiff) {
65649
64008
  }
65650
64009
  }
65651
64010
  function parseHunk() {
65652
- var _a2;
64011
+ var _a;
65653
64012
  const chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
65654
64013
  const hunk = {
65655
64014
  oldStart: +chunkHeader[1],
@@ -65665,7 +64024,7 @@ function parsePatch(uniDiff) {
65665
64024
  hunk.newStart += 1;
65666
64025
  }
65667
64026
  let addCount = 0, removeCount = 0;
65668
- for (;i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a2 = diffstr[i]) === null || _a2 === undefined ? undefined : _a2.startsWith("\\"))); i++) {
64027
+ for (;i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a = diffstr[i]) === null || _a === undefined ? undefined : _a.startsWith("\\"))); i++) {
65669
64028
  const operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? " " : diffstr[i][0];
65670
64029
  if (operation === "+" || operation === "-" || operation === " " || operation === "\\") {
65671
64030
  hunk.lines.push(diffstr[i]);
@@ -66080,12 +64439,12 @@ var EMPTY_RESULT = (status2) => ({
66080
64439
  deletions: 0,
66081
64440
  backupPath: null
66082
64441
  });
66083
- function readCurrent(path11) {
66084
- if (!existsSync49(path11))
64442
+ function readCurrent(path10) {
64443
+ if (!existsSync49(path10))
66085
64444
  return { kind: "missing" };
66086
64445
  let raw = "";
66087
64446
  try {
66088
- raw = readFileSync18(path11, "utf8");
64447
+ raw = readFileSync18(path10, "utf8");
66089
64448
  const parsed = JSON.parse(raw);
66090
64449
  return { kind: "ok", raw, parsed };
66091
64450
  } catch {
@@ -66111,21 +64470,21 @@ function diffStats(diff) {
66111
64470
  }
66112
64471
  return { additions, deletions };
66113
64472
  }
66114
- function atomicWrite2(path11, contents, backupPath) {
66115
- mkdirSync7(dirname29(path11), { recursive: true });
66116
- const tmp = `${path11}.tmp`;
64473
+ function atomicWrite2(path10, contents, backupPath) {
64474
+ mkdirSync7(dirname29(path10), { recursive: true });
64475
+ const tmp = `${path10}.tmp`;
66117
64476
  try {
66118
64477
  writeFileSync10(tmp, contents);
66119
- renameSync3(tmp, path11);
64478
+ renameSync3(tmp, path10);
66120
64479
  } catch (err) {
66121
64480
  rmSync4(tmp, { force: true });
66122
64481
  const trailer = backupPath ? `. Backup preserved at: ${backupPath}` : "";
66123
- throw new Error(`Failed to write ${path11}: ${err instanceof Error ? err.message : String(err)}${trailer}`);
64482
+ throw new Error(`Failed to write ${path10}: ${err instanceof Error ? err.message : String(err)}${trailer}`);
66124
64483
  }
66125
64484
  }
66126
- function writeBackup(path11, raw) {
64485
+ function writeBackup(path10, raw) {
66127
64486
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
66128
- const backupPath = `${path11}.${timestamp}.bak`;
64487
+ const backupPath = `${path10}.${timestamp}.bak`;
66129
64488
  try {
66130
64489
  writeFileSync10(backupPath, raw);
66131
64490
  return backupPath;
@@ -66134,7 +64493,7 @@ function writeBackup(path11, raw) {
66134
64493
  }
66135
64494
  }
66136
64495
  async function resolveMissingFile(options2) {
66137
- const { missingFile, interactive, label, path: path11 } = options2;
64496
+ const { missingFile, interactive, label, path: path10 } = options2;
66138
64497
  if (missingFile === "create")
66139
64498
  return "proceed";
66140
64499
  if (missingFile === "skip")
@@ -66142,7 +64501,7 @@ async function resolveMissingFile(options2) {
66142
64501
  if (!interactive)
66143
64502
  return "skip";
66144
64503
  const result = await se({
66145
- message: `${label} does not exist at ${path11}. Create it?`,
64504
+ message: `${label} does not exist at ${path10}. Create it?`,
66146
64505
  initialValue: false
66147
64506
  });
66148
64507
  if (lD(result))
@@ -66150,9 +64509,9 @@ async function resolveMissingFile(options2) {
66150
64509
  return result ? "proceed" : "skip";
66151
64510
  }
66152
64511
  async function writeSettingsWithConfirm(options2) {
66153
- const { path: path11, transform, yes, dryRun, interactive, useStepUI } = options2;
64512
+ const { path: path10, transform, yes, dryRun, interactive, useStepUI } = options2;
66154
64513
  const diffPrint = useStepUI ? stepLine : undefined;
66155
- const current = readCurrent(path11);
64514
+ const current = readCurrent(path10);
66156
64515
  if (current.kind === "corrupt")
66157
64516
  return EMPTY_RESULT("skipped-corrupt");
66158
64517
  const fileMissing = current.kind === "missing";
@@ -66169,7 +64528,7 @@ async function writeSettingsWithConfirm(options2) {
66169
64528
  if (before === after) {
66170
64529
  return EMPTY_RESULT("no-changes");
66171
64530
  }
66172
- const diff = createPatch(path11, before, after, "", "", { context: 3 });
64531
+ const diff = createPatch(path10, before, after, "", "", { context: 3 });
66173
64532
  const { additions, deletions } = diffStats(diff);
66174
64533
  if (dryRun) {
66175
64534
  displayDiff(diff, { color: true, print: diffPrint });
@@ -66178,15 +64537,15 @@ async function writeSettingsWithConfirm(options2) {
66178
64537
  if (!yes && interactive) {
66179
64538
  displayDiff(diff, { color: true, print: diffPrint });
66180
64539
  const accepted = await se({
66181
- message: `Apply changes to ${path11}?`,
64540
+ message: `Apply changes to ${path10}?`,
66182
64541
  initialValue: false
66183
64542
  });
66184
64543
  if (lD(accepted) || !accepted) {
66185
64544
  return { status: "user-declined", diff, additions, deletions, backupPath: null };
66186
64545
  }
66187
64546
  }
66188
- const backupPath = fileMissing ? null : writeBackup(path11, raw);
66189
- atomicWrite2(path11, after, backupPath);
64547
+ const backupPath = fileMissing ? null : writeBackup(path10, raw);
64548
+ atomicWrite2(path10, after, backupPath);
66190
64549
  return { status: "wrote", diff, additions, deletions, backupPath };
66191
64550
  }
66192
64551
 
@@ -66399,12 +64758,12 @@ function pruneHooksSection(hooks, agent) {
66399
64758
  }
66400
64759
  return { pruned, removed };
66401
64760
  }
66402
- function writeAtomic(path11, contents) {
66403
- mkdirSync8(dirname30(path11), { recursive: true });
66404
- const tmp = `${path11}.tmp`;
64761
+ function writeAtomic(path10, contents) {
64762
+ mkdirSync8(dirname30(path10), { recursive: true });
64763
+ const tmp = `${path10}.tmp`;
66405
64764
  try {
66406
64765
  writeFileSync11(tmp, contents);
66407
- renameSync4(tmp, path11);
64766
+ renameSync4(tmp, path10);
66408
64767
  } catch (err) {
66409
64768
  rmSync5(tmp, { force: true });
66410
64769
  throw err;
@@ -66862,8 +65221,8 @@ async function probeBinary(candidates) {
66862
65221
  return null;
66863
65222
  }
66864
65223
  function extractVersion(stdout) {
66865
- const match2 = stdout.match(/(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);
66866
- return match2 ? match2[1] : undefined;
65224
+ const match = stdout.match(/(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);
65225
+ return match ? match[1] : undefined;
66867
65226
  }
66868
65227
  async function detectAgentInstallations(providers2) {
66869
65228
  const probes = providers2.filter((p) => (p in BINARY_CANDIDATES)).map(async (provider) => {
@@ -66946,7 +65305,7 @@ async function selectKit(defaultKit, accessibleKits) {
66946
65305
  }
66947
65306
  return kit;
66948
65307
  }
66949
- async function selectKits(accessibleKits, defaults2) {
65308
+ async function selectKits(accessibleKits, defaults) {
66950
65309
  const kits = accessibleKits ?? Object.keys(AVAILABLE_KITS);
66951
65310
  const options2 = kits.map((key) => {
66952
65311
  const isBase = key === BASE_KIT;
@@ -66957,7 +65316,7 @@ async function selectKits(accessibleKits, defaults2) {
66957
65316
  hint: cfg.description
66958
65317
  };
66959
65318
  });
66960
- const initialValues = defaults2 && defaults2.length > 0 ? Array.from(new Set([BASE_KIT, ...defaults2])).filter((k2) => kits.includes(k2)) : kits;
65319
+ const initialValues = defaults && defaults.length > 0 ? Array.from(new Set([BASE_KIT, ...defaults])).filter((k2) => kits.includes(k2)) : kits;
66961
65320
  const selected = await ae({
66962
65321
  message: "Select kit(s) to install:",
66963
65322
  options: options2,
@@ -67760,8 +66119,8 @@ class PromptsManager {
67760
66119
  async selectKit(defaultKit, accessibleKits) {
67761
66120
  return selectKit(defaultKit, accessibleKits);
67762
66121
  }
67763
- async selectKits(accessibleKits, defaults2) {
67764
- return selectKits(accessibleKits, defaults2);
66122
+ async selectKits(accessibleKits, defaults) {
66123
+ return selectKits(accessibleKits, defaults);
67765
66124
  }
67766
66125
  async selectVersion(versions, defaultVersion) {
67767
66126
  return selectVersion(versions, defaultVersion);
@@ -68040,7 +66399,7 @@ init_logger();
68040
66399
  // src/domains/installation/download-extractor.ts
68041
66400
  init_auth_client();
68042
66401
  import * as fs29 from "node:fs";
68043
- import * as path11 from "node:path";
66402
+ import * as path10 from "node:path";
68044
66403
 
68045
66404
  // src/domains/github/auth-prompt.ts
68046
66405
  init_dist2();
@@ -68548,13 +66907,13 @@ async function validateExtraction(extractDir) {
68548
66907
  }
68549
66908
  const criticalPaths = [".claude", "CLAUDE.md"];
68550
66909
  const missingPaths = [];
68551
- for (const path11 of criticalPaths) {
66910
+ for (const path10 of criticalPaths) {
68552
66911
  try {
68553
- await access3(join110(extractDir, path11), constants3.F_OK);
68554
- logger.debug(`Found: ${path11}`);
66912
+ await access3(join110(extractDir, path10), constants3.F_OK);
66913
+ logger.debug(`Found: ${path10}`);
68555
66914
  } catch {
68556
- logger.warning(`Expected path not found: ${path11}`);
68557
- missingPaths.push(path11);
66915
+ logger.warning(`Expected path not found: ${path10}`);
66916
+ missingPaths.push(path10);
68558
66917
  }
68559
66918
  }
68560
66919
  if (missingPaths.length > 0) {
@@ -71764,20 +70123,20 @@ function normalizeZipEntryName(entryName) {
71764
70123
  }
71765
70124
  return String(entryName);
71766
70125
  }
71767
- function decodeFilePath(path11) {
71768
- if (!path11.includes("%")) {
71769
- return path11;
70126
+ function decodeFilePath(path10) {
70127
+ if (!path10.includes("%")) {
70128
+ return path10;
71770
70129
  }
71771
70130
  try {
71772
- if (/%[0-9A-F]{2}/i.test(path11)) {
71773
- const decoded = decodeURIComponent(path11);
71774
- logger.debug(`Decoded path: ${path11} -> ${decoded}`);
70131
+ if (/%[0-9A-F]{2}/i.test(path10)) {
70132
+ const decoded = decodeURIComponent(path10);
70133
+ logger.debug(`Decoded path: ${path10} -> ${decoded}`);
71775
70134
  return decoded;
71776
70135
  }
71777
- return path11;
70136
+ return path10;
71778
70137
  } catch (error) {
71779
- logger.warning(`Failed to decode path "${path11}": ${error instanceof Error ? error.message : "Unknown error"}`);
71780
- return path11;
70138
+ logger.warning(`Failed to decode path "${path10}": ${error instanceof Error ? error.message : "Unknown error"}`);
70139
+ return path10;
71781
70140
  }
71782
70141
  }
71783
70142
 
@@ -71873,12 +70232,12 @@ class TarExtractor {
71873
70232
  onwarn: (code, message) => {
71874
70233
  logger.debug(`tar warning [${code}]: ${message}`);
71875
70234
  },
71876
- filter: (path11, entry) => {
70235
+ filter: (path10, entry) => {
71877
70236
  if ("type" in entry && (entry.type === "SymbolicLink" || entry.type === "Link")) {
71878
- logger.debug(`Skipping symlink: ${path11}`);
70237
+ logger.debug(`Skipping symlink: ${path10}`);
71879
70238
  return false;
71880
70239
  }
71881
- const decodedPath = decodeFilePath(path11);
70240
+ const decodedPath = decodeFilePath(path10);
71882
70241
  const shouldInclude = !shouldExclude(decodedPath);
71883
70242
  if (!shouldInclude) {
71884
70243
  logger.debug(`Excluding: ${decodedPath}`);
@@ -72147,7 +70506,7 @@ function buildReleaseAllowlist(layout) {
72147
70506
  return [...new Set([layout.sourceDir, ...RELEASE_ROOT_ALLOWLIST])];
72148
70507
  }
72149
70508
  async function ensureLayoutSourceDir(projectRoot, layout, strict) {
72150
- const sourceDir = path11.join(projectRoot, layout.sourceDir);
70509
+ const sourceDir = path10.join(projectRoot, layout.sourceDir);
72151
70510
  try {
72152
70511
  const stat11 = await fs29.promises.stat(sourceDir);
72153
70512
  if (!stat11.isDirectory()) {
@@ -72172,8 +70531,8 @@ async function materializeRuntimeLayoutInPlace(projectRoot, layout) {
72172
70531
  if (layout.sourceDir === layout.runtimeDir) {
72173
70532
  return;
72174
70533
  }
72175
- const sourceDir = path11.join(projectRoot, layout.sourceDir);
72176
- const runtimeDir = path11.join(projectRoot, layout.runtimeDir);
70534
+ const sourceDir = path10.join(projectRoot, layout.sourceDir);
70535
+ const runtimeDir = path10.join(projectRoot, layout.runtimeDir);
72177
70536
  await fs29.promises.rm(runtimeDir, { recursive: true, force: true });
72178
70537
  await fs29.promises.rename(sourceDir, runtimeDir);
72179
70538
  }
@@ -72192,12 +70551,12 @@ async function stageLocalKitPathForRuntimeLayout(kitRoot, layout) {
72192
70551
  if (!allowlist.includes(entry) || entry === layout.sourceDir) {
72193
70552
  continue;
72194
70553
  }
72195
- await fs29.promises.cp(path11.join(kitRoot, entry), path11.join(extractDir, entry), {
70554
+ await fs29.promises.cp(path10.join(kitRoot, entry), path10.join(extractDir, entry), {
72196
70555
  recursive: true
72197
70556
  });
72198
70557
  }
72199
- const runtimeDir = path11.join(extractDir, layout.runtimeDir);
72200
- await fs29.promises.mkdir(path11.dirname(runtimeDir), { recursive: true });
70558
+ const runtimeDir = path10.join(extractDir, layout.runtimeDir);
70559
+ await fs29.promises.mkdir(path10.dirname(runtimeDir), { recursive: true });
72201
70560
  await fs29.promises.cp(sourceDir, runtimeDir, { recursive: true });
72202
70561
  logger.verbose("Staged local kit path with runtime layout", {
72203
70562
  kitRoot,
@@ -72225,14 +70584,14 @@ var MONOREPO_KIT_CONTENT = [
72225
70584
  ];
72226
70585
  function resolveRepoRootForKit(kitRoot) {
72227
70586
  try {
72228
- const parent = path11.dirname(kitRoot);
72229
- const parentPackageJson = path11.join(parent, "package.json");
70587
+ const parent = path10.dirname(kitRoot);
70588
+ const parentPackageJson = path10.join(parent, "package.json");
72230
70589
  if (!fs29.existsSync(parentPackageJson))
72231
70590
  return kitRoot;
72232
70591
  const pkg = JSON.parse(fs29.readFileSync(parentPackageJson, "utf-8"));
72233
70592
  const kitCfg = pkg.takumi;
72234
70593
  const sourceDir = kitCfg?.sourceDir;
72235
- if (typeof sourceDir === "string" && path11.resolve(parent, sourceDir) === path11.resolve(kitRoot)) {
70594
+ if (typeof sourceDir === "string" && path10.resolve(parent, sourceDir) === path10.resolve(kitRoot)) {
72236
70595
  return parent;
72237
70596
  }
72238
70597
  } catch {}
@@ -72242,7 +70601,7 @@ async function stageMonorepoForInstallation(kitRoot) {
72242
70601
  const downloadManager = new DownloadManager;
72243
70602
  const tempDir = await downloadManager.createTempDir();
72244
70603
  const extractDir = `${tempDir}/extracted`;
72245
- const claudeDir = path11.join(extractDir, ".claude");
70604
+ const claudeDir = path10.join(extractDir, ".claude");
72246
70605
  await fs29.promises.mkdir(claudeDir, { recursive: true });
72247
70606
  const repoRoot = resolveRepoRootForKit(kitRoot);
72248
70607
  const kitEntries = await fs29.promises.readdir(kitRoot);
@@ -72252,15 +70611,15 @@ async function stageMonorepoForInstallation(kitRoot) {
72252
70611
  continue;
72253
70612
  if (skipLegacyManifest && entry === LEGACY_MANIFEST_FILENAME)
72254
70613
  continue;
72255
- const srcPath = path11.join(kitRoot, entry);
72256
- await fs29.promises.cp(srcPath, path11.join(claudeDir, entry), { recursive: true });
70614
+ const srcPath = path10.join(kitRoot, entry);
70615
+ await fs29.promises.cp(srcPath, path10.join(claudeDir, entry), { recursive: true });
72257
70616
  }
72258
70617
  const repoEntries = repoRoot === kitRoot ? kitEntries : await fs29.promises.readdir(repoRoot);
72259
70618
  for (const entry of repoEntries) {
72260
70619
  if (!RELEASE_ROOT_ALLOWLIST.includes(entry))
72261
70620
  continue;
72262
- const srcPath = path11.join(repoRoot, entry);
72263
- await fs29.promises.cp(srcPath, path11.join(extractDir, entry), { recursive: true });
70621
+ const srcPath = path10.join(repoRoot, entry);
70622
+ await fs29.promises.cp(srcPath, path10.join(extractDir, entry), { recursive: true });
72264
70623
  }
72265
70624
  logger.verbose("Staged monorepo for installation", {
72266
70625
  kitRoot,
@@ -72279,7 +70638,7 @@ async function normalizeFullRepoExtract(dir, strict) {
72279
70638
  let removedCount = 0;
72280
70639
  for (const entry of entries) {
72281
70640
  if (!releaseAllowlist.includes(entry)) {
72282
- const fullPath = path11.join(dir, entry);
70641
+ const fullPath = path10.join(dir, entry);
72283
70642
  await fs29.promises.rm(fullPath, { recursive: true, force: true });
72284
70643
  removedCount++;
72285
70644
  }
@@ -72393,7 +70752,7 @@ Or try: tkm init --use-git`);
72393
70752
  async function useLocalKitPath(kitPath, isMonorepo) {
72394
70753
  logger.verbose("Using local kit path", { kitPath });
72395
70754
  output.section("Using local kit");
72396
- const absolutePath = path11.resolve(kitPath);
70755
+ const absolutePath = path10.resolve(kitPath);
72397
70756
  try {
72398
70757
  const stat11 = await fs29.promises.stat(absolutePath);
72399
70758
  if (!stat11.isDirectory()) {
@@ -72432,7 +70791,7 @@ Please verify the path exists and is accessible.`);
72432
70791
  };
72433
70792
  }
72434
70793
  }
72435
- const claudeDir = path11.join(absolutePath, DEFAULT_KIT_LAYOUT.runtimeDir);
70794
+ const claudeDir = path10.join(absolutePath, DEFAULT_KIT_LAYOUT.runtimeDir);
72436
70795
  try {
72437
70796
  const stat11 = await fs29.promises.stat(claudeDir);
72438
70797
  if (!stat11.isDirectory()) {
@@ -72455,10 +70814,10 @@ This may not be a valid Takumi installation. Proceeding anyway...`);
72455
70814
  var VALID_ARCHIVE_FORMATS = [".zip", ".tar.gz", ".tgz", ".tar"];
72456
70815
  function validateArchiveFormat(archivePath) {
72457
70816
  const lowerPath = archivePath.toLowerCase();
72458
- const isValid2 = VALID_ARCHIVE_FORMATS.some((ext2) => lowerPath.endsWith(ext2));
70817
+ const isValid2 = VALID_ARCHIVE_FORMATS.some((ext) => lowerPath.endsWith(ext));
72459
70818
  if (!isValid2) {
72460
- const ext2 = path11.extname(archivePath) || "(no extension)";
72461
- throw new Error(`Unsupported archive format: ${ext2}
70819
+ const ext = path10.extname(archivePath) || "(no extension)";
70820
+ throw new Error(`Unsupported archive format: ${ext}
72462
70821
 
72463
70822
  ` + `Supported formats: ${VALID_ARCHIVE_FORMATS.join(", ")}`);
72464
70823
  }
@@ -72466,7 +70825,7 @@ function validateArchiveFormat(archivePath) {
72466
70825
  async function extractLocalArchive(archivePath, exclude) {
72467
70826
  logger.verbose("Using local archive", { archivePath });
72468
70827
  output.section("Extracting local archive");
72469
- const absolutePath = path11.resolve(archivePath);
70828
+ const absolutePath = path10.resolve(archivePath);
72470
70829
  validateArchiveFormat(absolutePath);
72471
70830
  try {
72472
70831
  const stat11 = await fs29.promises.stat(absolutePath);
@@ -72600,7 +70959,7 @@ async function downloadViaWorker(release, kit, isNonInteractive2) {
72600
70959
  const res = await source.fetchAsset(release.tag_name, assetName);
72601
70960
  const downloadManager = new DownloadManager;
72602
70961
  const tempDir = await downloadManager.createTempDir();
72603
- const archivePath = path11.join(tempDir, assetName);
70962
+ const archivePath = path10.join(tempDir, assetName);
72604
70963
  const buf = Buffer.from(await res.arrayBuffer());
72605
70964
  await fs29.promises.writeFile(archivePath, buf);
72606
70965
  const extractDir = `${tempDir}/extracted`;
@@ -72895,8 +71254,8 @@ async function runPreflightChecks() {
72895
71254
  };
72896
71255
  try {
72897
71256
  const { stdout } = await execAsync7("gh --version", { timeout: GH_COMMAND_TIMEOUT_MS });
72898
- const match2 = stdout.match(/(\d+\.\d+\.\d+)/);
72899
- if (!match2) {
71257
+ const match = stdout.match(/(\d+\.\d+\.\d+)/);
71258
+ if (!match) {
72900
71259
  logger.debug(`GitHub CLI version not detected from output: ${stdout.trim()}`);
72901
71260
  result.ghInstalled = true;
72902
71261
  result.errorLines.push("✗ GitHub CLI installed but version could not be detected");
@@ -72904,7 +71263,7 @@ async function runPreflightChecks() {
72904
71263
  result.errorLines.push(" Try running: gh --version");
72905
71264
  return result;
72906
71265
  }
72907
- result.ghVersion = match2[1];
71266
+ result.ghVersion = match[1];
72908
71267
  result.ghInstalled = true;
72909
71268
  logger.debug(`GitHub CLI detected: v${result.ghVersion}`);
72910
71269
  } catch (error) {
@@ -73746,8 +72105,8 @@ import { lstat as lstat7, readFile as readFile40, readlink, realpath as realpath
73746
72105
  import { isAbsolute as isAbsolute5, join as join120, normalize as normalize9, relative as relative17 } from "node:path";
73747
72106
  var MAX_SYNC_FILE_SIZE = 10 * 1024 * 1024;
73748
72107
  var MAX_SYMLINK_DEPTH = 20;
73749
- async function validateSymlinkChain(path12, basePath, maxDepth = MAX_SYMLINK_DEPTH) {
73750
- let current = path12;
72108
+ async function validateSymlinkChain(path11, basePath, maxDepth = MAX_SYMLINK_DEPTH) {
72109
+ let current = path11;
73751
72110
  let depth = 0;
73752
72111
  while (depth < maxDepth) {
73753
72112
  try {
@@ -73759,7 +72118,7 @@ async function validateSymlinkChain(path12, basePath, maxDepth = MAX_SYMLINK_DEP
73759
72118
  const normalizedTarget = normalize9(resolvedTarget);
73760
72119
  const rel = relative17(basePath, normalizedTarget);
73761
72120
  if (rel.startsWith("..") || isAbsolute5(rel)) {
73762
- throw new Error(`Symlink chain escapes base directory at depth ${depth}: ${path12}`);
72121
+ throw new Error(`Symlink chain escapes base directory at depth ${depth}: ${path11}`);
73763
72122
  }
73764
72123
  current = normalizedTarget;
73765
72124
  depth++;
@@ -73771,7 +72130,7 @@ async function validateSymlinkChain(path12, basePath, maxDepth = MAX_SYMLINK_DEP
73771
72130
  }
73772
72131
  }
73773
72132
  if (depth >= maxDepth) {
73774
- throw new Error(`Symlink chain too deep (>${maxDepth}): ${path12}`);
72133
+ throw new Error(`Symlink chain too deep (>${maxDepth}): ${path11}`);
73775
72134
  }
73776
72135
  }
73777
72136
  async function validateSyncPath(basePath, filePath) {
@@ -73997,7 +72356,7 @@ class SyncEngine {
73997
72356
  }
73998
72357
  // src/domains/sync/deletion-path-filter.ts
73999
72358
  init_path_resolver();
74000
- var import_picomatch2 = __toESM(require_picomatch2(), 1);
72359
+ var import_picomatch3 = __toESM(require_picomatch2(), 1);
74001
72360
  function filterDeletionPaths(trackedFiles, deletions) {
74002
72361
  if (!deletions || deletions.length === 0) {
74003
72362
  return trackedFiles;
@@ -74006,7 +72365,7 @@ function filterDeletionPaths(trackedFiles, deletions) {
74006
72365
  const globMatchers = [];
74007
72366
  for (const pattern of deletions) {
74008
72367
  if (PathResolver.isGlobPattern(pattern)) {
74009
- globMatchers.push(import_picomatch2.default(pattern));
72368
+ globMatchers.push(import_picomatch3.default(pattern));
74010
72369
  } else {
74011
72370
  exactPaths.add(pattern);
74012
72371
  }
@@ -74709,7 +73068,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
74709
73068
  filesChanged += subResult.filesChanged;
74710
73069
  replacementsCount += subResult.replacementsCount;
74711
73070
  } else if (entry.isFile()) {
74712
- const shouldTransform = TRANSFORMABLE_FILE_PATTERNS.some((ext2) => entry.name.toLowerCase().endsWith(ext2));
73071
+ const shouldTransform = TRANSFORMABLE_FILE_PATTERNS.some((ext) => entry.name.toLowerCase().endsWith(ext));
74713
73072
  if (!shouldTransform)
74714
73073
  continue;
74715
73074
  try {
@@ -74925,9 +73284,9 @@ function transformContent(content) {
74925
73284
  return { transformed, changes };
74926
73285
  }
74927
73286
  function shouldTransformFile3(filename) {
74928
- const ext2 = extname7(filename).toLowerCase();
73287
+ const ext = extname7(filename).toLowerCase();
74929
73288
  const basename19 = filename.split("/").pop() || filename;
74930
- return TRANSFORMABLE_EXTENSIONS3.has(ext2) || ALWAYS_TRANSFORM_FILES.has(basename19);
73289
+ return TRANSFORMABLE_EXTENSIONS3.has(ext) || ALWAYS_TRANSFORM_FILES.has(basename19);
74931
73290
  }
74932
73291
  async function transformPathsForGlobalInstall(directory, options2 = {}) {
74933
73292
  let filesTransformed = 0;
@@ -75350,8 +73709,8 @@ function parseHeaderAwareTable(content, dir, options2) {
75350
73709
  function parseFormat1(content, dir, options2) {
75351
73710
  const regex2 = /\|\s*(\d+)([a-z]?)\s*\|\s*([^|]+)\s*\|\s*([^|]+)\s*\|\s*\[([^\]]+)\]\(([^)]+)\)/gi;
75352
73711
  const phases = [];
75353
- for (const match2 of content.matchAll(regex2)) {
75354
- const [, num4, suffix, name, status2, linkText, linkPath] = match2;
73712
+ for (const match of content.matchAll(regex2)) {
73713
+ const [, num4, suffix, name, status2, linkText, linkPath] = match;
75355
73714
  const phaseId = `${num4}${suffix}`;
75356
73715
  const anchor = options2?.generateAnchors ? buildAnchor(phaseId, name.trim()) : null;
75357
73716
  phases.push({
@@ -75369,8 +73728,8 @@ function parseFormat1(content, dir, options2) {
75369
73728
  function parseFormat2(content, dir, options2) {
75370
73729
  const regex2 = /\|\s*\[(?:Phase\s*)?(\d+)([a-z]?)\]\(([^)]+)\)\s*\|\s*([^|]+)\s*\|\s*([^|]+)/gi;
75371
73730
  const phases = [];
75372
- for (const match2 of content.matchAll(regex2)) {
75373
- const [, num4, suffix, linkPath, name, status2] = match2;
73731
+ for (const match of content.matchAll(regex2)) {
73732
+ const [, num4, suffix, linkPath, name, status2] = match;
75374
73733
  const phaseId = `${num4}${suffix}`;
75375
73734
  const linkText = `Phase ${phaseId}`;
75376
73735
  const anchor = options2?.generateAnchors ? buildAnchor(phaseId, name.trim()) : null;
@@ -75389,8 +73748,8 @@ function parseFormat2(content, dir, options2) {
75389
73748
  function parseFormat2b(content, dir, options2) {
75390
73749
  const regex2 = /\|\s*(\d+)([a-z]?)\s*\|\s*\[([^\]]+)\]\(([^)]+)\)\s*\|\s*([^|]+)/gi;
75391
73750
  const phases = [];
75392
- for (const match2 of content.matchAll(regex2)) {
75393
- const [, num4, suffix, name, linkPath, status2] = match2;
73751
+ for (const match of content.matchAll(regex2)) {
73752
+ const [, num4, suffix, name, linkPath, status2] = match;
75394
73753
  const phaseId = `${num4}${suffix}`;
75395
73754
  const anchor = options2?.generateAnchors ? buildAnchor(phaseId, name.trim()) : null;
75396
73755
  phases.push({
@@ -75408,22 +73767,22 @@ function parseFormat2b(content, dir, options2) {
75408
73767
  function parseFormat2c(content, _dir, options2) {
75409
73768
  const phases = [];
75410
73769
  const regex2 = /\|\s*(\d+)([a-z]?)\s*\|\s*([^|]+)\s*\|\s*([^|]+)\s*\|/gi;
75411
- for (const match2 of content.matchAll(regex2)) {
75412
- const name = match2[3].trim();
73770
+ for (const match of content.matchAll(regex2)) {
73771
+ const name = match[3].trim();
75413
73772
  if (name.includes("---") || name.includes("==="))
75414
73773
  continue;
75415
- if (Number.isNaN(Number.parseInt(match2[1], 10)))
73774
+ if (Number.isNaN(Number.parseInt(match[1], 10)))
75416
73775
  continue;
75417
73776
  const nameText = name.toLowerCase();
75418
73777
  if (["description", "name", "phase", "task"].includes(nameText))
75419
73778
  continue;
75420
- const phaseId = `${match2[1]}${match2[2]}`;
73779
+ const phaseId = `${match[1]}${match[2]}`;
75421
73780
  const anchor = options2?.generateAnchors ? buildAnchor(phaseId, name) : null;
75422
73781
  phases.push({
75423
- phase: Number.parseInt(match2[1], 10),
73782
+ phase: Number.parseInt(match[1], 10),
75424
73783
  phaseId,
75425
73784
  name,
75426
- status: normalizeStatus(match2[4]),
73785
+ status: normalizeStatus(match[4]),
75427
73786
  file: "",
75428
73787
  linkText: name,
75429
73788
  anchor
@@ -75520,8 +73879,8 @@ function parseFormat4(content, planFilePath, options2) {
75520
73879
  function parseFormat5(content, _dir, options2) {
75521
73880
  const phases = [];
75522
73881
  const phaseMap = new Map;
75523
- for (const match2 of content.matchAll(/^(\d+)([a-z]?)[).]\s*\*\*([^*]+)\*\*/gim)) {
75524
- const [, num4, suffix, name] = match2;
73882
+ for (const match of content.matchAll(/^(\d+)([a-z]?)[).]\s*\*\*([^*]+)\*\*/gim)) {
73883
+ const [, num4, suffix, name] = match;
75525
73884
  const phaseId = `${num4}${suffix}`;
75526
73885
  const anchor = options2?.generateAnchors ? buildAnchor(phaseId, name.trim()) : null;
75527
73886
  phaseMap.set(name.trim().toLowerCase(), {
@@ -75534,8 +73893,8 @@ function parseFormat5(content, _dir, options2) {
75534
73893
  anchor
75535
73894
  });
75536
73895
  }
75537
- for (const match2 of content.matchAll(/^-\s*\[(x| )\]\s*([^:\n]+)/gim)) {
75538
- const [, checked, name] = match2;
73896
+ for (const match of content.matchAll(/^-\s*\[(x| )\]\s*([^:\n]+)/gim)) {
73897
+ const [, checked, name] = match;
75539
73898
  const entry = phaseMap.get(name.trim().toLowerCase());
75540
73899
  if (entry)
75541
73900
  entry.status = checked.toLowerCase() === "x" ? "completed" : "pending";
@@ -75553,8 +73912,8 @@ function parseFormat5(content, _dir, options2) {
75553
73912
  function parseFormat6(content, dir, options2) {
75554
73913
  const regex2 = /^-\s*\[(x| )\]\s*\*\*\[(?:Phase\s*)?(\d+)([a-z]?)[:\s]*([^\]]*)\]\(([^)]+)\)\*\*/gim;
75555
73914
  const phases = [];
75556
- for (const match2 of content.matchAll(regex2)) {
75557
- const [, checked, num4, suffix, name, linkPath] = match2;
73915
+ for (const match of content.matchAll(regex2)) {
73916
+ const [, checked, num4, suffix, name, linkPath] = match;
75558
73917
  const phaseId = `${num4}${suffix}`;
75559
73918
  const phaseName = name.trim() || `Phase ${phaseId}`;
75560
73919
  const anchor = options2?.generateAnchors ? buildAnchor(phaseId, phaseName) : null;
@@ -75639,8 +73998,8 @@ function validatePlanFile(filePath, strict = false) {
75639
73998
  });
75640
73999
  }
75641
74000
  lines.forEach((line, i) => {
75642
- const match2 = /\[phase-\d+[a-z]?-[^\]]*\.md\]/i.exec(line);
75643
- if (match2) {
74001
+ const match = /\[phase-\d+[a-z]?-[^\]]*\.md\]/i.exec(line);
74002
+ if (match) {
75644
74003
  issues.push({
75645
74004
  line: i + 1,
75646
74005
  severity: "warning",
@@ -75895,8 +74254,8 @@ function addPhase(planFile, name, afterId) {
75895
74254
  const { data: frontmatter, content: body } = import_gray_matter7.default(raw);
75896
74255
  const planDir = dirname38(planFile);
75897
74256
  const existingIds = [];
75898
- for (const match2 of body.matchAll(/^\|\s*(\d+[a-z]?)\s*\|/gim)) {
75899
- existingIds.push(match2[1].toLowerCase());
74257
+ for (const match of body.matchAll(/^\|\s*(\d+[a-z]?)\s*\|/gim)) {
74258
+ existingIds.push(match[1].toLowerCase());
75900
74259
  }
75901
74260
  let phaseId;
75902
74261
  if (afterId) {
@@ -76615,7 +74974,7 @@ init_safe_prompts();
76615
74974
  init_safe_spinner();
76616
74975
  var import_fs_extra37 = __toESM(require_lib(), 1);
76617
74976
  import { readdirSync as readdirSync13, rmSync as rmSync9 } from "node:fs";
76618
- import { join as join131, resolve as resolve34, sep as sep10 } from "node:path";
74977
+ import { join as join131, resolve as resolve34, sep as sep9 } from "node:path";
76619
74978
 
76620
74979
  // src/commands/uninstall/analysis-handler.ts
76621
74980
  init_metadata_migration();
@@ -76769,7 +75128,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
76769
75128
  try {
76770
75129
  const resolvedPath = resolve34(filePath);
76771
75130
  const resolvedBase = resolve34(baseDir);
76772
- if (!resolvedPath.startsWith(resolvedBase + sep10) && resolvedPath !== resolvedBase) {
75131
+ if (!resolvedPath.startsWith(resolvedBase + sep9) && resolvedPath !== resolvedBase) {
76773
75132
  logger.debug(`Path outside installation directory: ${filePath}`);
76774
75133
  return false;
76775
75134
  }
@@ -76777,7 +75136,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
76777
75136
  if (stats.isSymbolicLink()) {
76778
75137
  const realPath = await import_fs_extra37.realpath(filePath);
76779
75138
  const resolvedReal = resolve34(realPath);
76780
- if (!resolvedReal.startsWith(resolvedBase + sep10) && resolvedReal !== resolvedBase) {
75139
+ if (!resolvedReal.startsWith(resolvedBase + sep9) && resolvedReal !== resolvedBase) {
76781
75140
  logger.debug(`Symlink points outside installation directory: ${filePath} -> ${realPath}`);
76782
75141
  return false;
76783
75142
  }
@@ -77077,8 +75436,8 @@ function isBetaVersion(version3) {
77077
75436
  function parseCliVersionFromOutput(output2) {
77078
75437
  if (!output2)
77079
75438
  return null;
77080
- const match2 = output2.match(/CLI Version:\s*(\S+)/);
77081
- return match2 ? match2[1] : null;
75439
+ const match = output2.match(/CLI Version:\s*(\S+)/);
75440
+ return match ? match[1] : null;
77082
75441
  }
77083
75442
  function selectKitForUpdate(params) {
77084
75443
  const { hasLocal, hasGlobal, localKits, globalKits } = params;
@@ -77633,8 +75992,8 @@ function registerCommands(cli) {
77633
75992
  cli.command("plan [action] [target]", "Plan management: parse, validate, status, kanban, create, check, uncheck, add-phase").option("--json", "Output in JSON format").option("--strict", "Strict validation mode").option("--title <title>", "Plan title (for create)").option("--phases <phases>", "Comma-separated phase names (for create)").option("--dir <dir>", "Plan directory (for create)").option("--priority <priority>", "Priority: P1, P2, P3 (for create)").option("--issue <issue>", "GitHub issue number (for create)").option("--after <after>", "Insert after phase ID (for add-phase)").option("--start", "Mark as in-progress instead of completed (for check)").action(async (action, target, options2) => {
77634
75993
  await planCommand(action, target, options2);
77635
75994
  });
77636
- cli.command("api [action] [service] [path]", "Interact with Takumi API and proxy services").option("--method <method>", "HTTP method for proxy requests (default: GET)").option("--body <json>", "Request body as JSON string (proxy only)").option("--query <json>", "Query params as JSON string (proxy only)").option("--key <key>", "API key to use (setup only)").option("--force", "Force re-setup even if key exists (setup only)").option("--json", "Output raw JSON instead of formatted display").option("--locale <locale>", "Locale for vidcap summary/caption (default: en)").option("--max-results <n>", "Max results for vidcap search").option("--second <s>", "Timestamp in seconds for vidcap screenshot").option("--order <order>", "Sort order for vidcap comments (time/relevance)").option("--format <fmt>", "Summary format for reviewweb (bullet/paragraph)").option("--max-length <n>", "Max summary length for reviewweb").option("--instructions <text>", "Extraction instructions for reviewweb extract").option("--template <json>", "JSON template for reviewweb extract").option("--type <type>", "Link type filter for reviewweb links (web/image/file/all)").option("--country <code>", "Country code for reviewweb SEO commands").action(async (action, service, path12, options2) => {
77637
- await apiCommand(action, service, path12, options2);
75995
+ cli.command("api [action] [service] [path]", "Interact with Takumi API and proxy services").option("--method <method>", "HTTP method for proxy requests (default: GET)").option("--body <json>", "Request body as JSON string (proxy only)").option("--query <json>", "Query params as JSON string (proxy only)").option("--key <key>", "API key to use (setup only)").option("--force", "Force re-setup even if key exists (setup only)").option("--json", "Output raw JSON instead of formatted display").option("--locale <locale>", "Locale for vidcap summary/caption (default: en)").option("--max-results <n>", "Max results for vidcap search").option("--second <s>", "Timestamp in seconds for vidcap screenshot").option("--order <order>", "Sort order for vidcap comments (time/relevance)").option("--format <fmt>", "Summary format for reviewweb (bullet/paragraph)").option("--max-length <n>", "Max summary length for reviewweb").option("--instructions <text>", "Extraction instructions for reviewweb extract").option("--template <json>", "JSON template for reviewweb extract").option("--type <type>", "Link type filter for reviewweb links (web/image/file/all)").option("--country <code>", "Country code for reviewweb SEO commands").action(async (action, service, path11, options2) => {
75996
+ await apiCommand(action, service, path11, options2);
77638
75997
  });
77639
75998
  cli.command("artifact [action] [target]", "Manage Takumi artifacts (upload <file> | download <uuid|url> | delete <uuid|url>)").option("--id <uuid|url>", "Existing artifact (UUID or viewer URL) to overwrite on upload").option("--title <title>", "Display title for the artifact (max 200 chars)").option("-m, --message <message>", "Short note describing this version's change (max 100 chars)").option("-o, --output <dir>", "(download) Output directory; default: slug(title) or uuid in CWD").option("-v, --version <n>", "(download) Download a specific version number").option("--force", "(download) Allow writing into a non-empty directory").option("-y, --yes", "Skip delete confirmation prompt").action(async (action, target, opts) => {
77640
75999
  const version3 = opts.version !== undefined ? Number.parseInt(opts.version, 10) : undefined;
@@ -77861,18 +76220,18 @@ class Logger2 {
77861
76220
  isVerbose() {
77862
76221
  return this.verboseEnabled;
77863
76222
  }
77864
- setLogFile(path12) {
76223
+ setLogFile(path11) {
77865
76224
  if (this.logFileStream) {
77866
76225
  this.logFileStream.end();
77867
76226
  this.logFileStream = undefined;
77868
76227
  }
77869
- if (path12) {
77870
- this.logFileStream = createWriteStream4(path12, {
76228
+ if (path11) {
76229
+ this.logFileStream = createWriteStream4(path11, {
77871
76230
  flags: "a",
77872
76231
  mode: 384
77873
76232
  });
77874
76233
  this.registerExitHandler();
77875
- this.verbose(`Logging to file: ${path12}`);
76234
+ this.verbose(`Logging to file: ${path11}`);
77876
76235
  }
77877
76236
  }
77878
76237
  close() {