@cometix/claude-code 2.1.129 → 2.1.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun-ink-compat.cjs +868 -0
- package/package.json +12 -14
|
@@ -0,0 +1,868 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// node_modules/emoji-regex/index.js
|
|
33
|
+
var require_emoji_regex = __commonJS({
|
|
34
|
+
"node_modules/emoji-regex/index.js"(exports2, module2) {
|
|
35
|
+
module2.exports = () => {
|
|
36
|
+
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;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// bun-compat-entry.ts
|
|
42
|
+
var bun_compat_entry_exports = {};
|
|
43
|
+
__export(bun_compat_entry_exports, {
|
|
44
|
+
stringWidth: () => stringWidth2,
|
|
45
|
+
stripANSI: () => stripANSI,
|
|
46
|
+
wrapAnsi: () => wrapAnsi2
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(bun_compat_entry_exports);
|
|
49
|
+
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
|
50
|
+
|
|
51
|
+
// node_modules/get-east-asian-width/lookup-data.js
|
|
52
|
+
var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
|
|
53
|
+
var fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
54
|
+
var halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
|
|
55
|
+
var narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
|
|
56
|
+
var wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
|
|
57
|
+
|
|
58
|
+
// node_modules/get-east-asian-width/utilities.js
|
|
59
|
+
var isInRange = (ranges, codePoint) => {
|
|
60
|
+
let low = 0;
|
|
61
|
+
let high = Math.floor(ranges.length / 2) - 1;
|
|
62
|
+
while (low <= high) {
|
|
63
|
+
const mid = Math.floor((low + high) / 2);
|
|
64
|
+
const i = mid * 2;
|
|
65
|
+
if (codePoint < ranges[i]) {
|
|
66
|
+
high = mid - 1;
|
|
67
|
+
} else if (codePoint > ranges[i + 1]) {
|
|
68
|
+
low = mid + 1;
|
|
69
|
+
} else {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// node_modules/get-east-asian-width/lookup.js
|
|
77
|
+
var minimumAmbiguousCodePoint = ambiguousRanges[0];
|
|
78
|
+
var maximumAmbiguousCodePoint = ambiguousRanges.at(-1);
|
|
79
|
+
var minimumFullWidthCodePoint = fullwidthRanges[0];
|
|
80
|
+
var maximumFullWidthCodePoint = fullwidthRanges.at(-1);
|
|
81
|
+
var minimumHalfWidthCodePoint = halfwidthRanges[0];
|
|
82
|
+
var maximumHalfWidthCodePoint = halfwidthRanges.at(-1);
|
|
83
|
+
var minimumNarrowCodePoint = narrowRanges[0];
|
|
84
|
+
var maximumNarrowCodePoint = narrowRanges.at(-1);
|
|
85
|
+
var minimumWideCodePoint = wideRanges[0];
|
|
86
|
+
var maximumWideCodePoint = wideRanges.at(-1);
|
|
87
|
+
var commonCjkCodePoint = 19968;
|
|
88
|
+
var [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);
|
|
89
|
+
function findWideFastPathRange(ranges) {
|
|
90
|
+
let fastPathStart = ranges[0];
|
|
91
|
+
let fastPathEnd = ranges[1];
|
|
92
|
+
for (let index = 0; index < ranges.length; index += 2) {
|
|
93
|
+
const start = ranges[index];
|
|
94
|
+
const end = ranges[index + 1];
|
|
95
|
+
if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) {
|
|
96
|
+
return [start, end];
|
|
97
|
+
}
|
|
98
|
+
if (end - start > fastPathEnd - fastPathStart) {
|
|
99
|
+
fastPathStart = start;
|
|
100
|
+
fastPathEnd = end;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return [fastPathStart, fastPathEnd];
|
|
104
|
+
}
|
|
105
|
+
var isAmbiguous = (codePoint) => {
|
|
106
|
+
if (codePoint < minimumAmbiguousCodePoint || codePoint > maximumAmbiguousCodePoint) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return isInRange(ambiguousRanges, codePoint);
|
|
110
|
+
};
|
|
111
|
+
var isFullWidth = (codePoint) => {
|
|
112
|
+
if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
return isInRange(fullwidthRanges, codePoint);
|
|
116
|
+
};
|
|
117
|
+
var isWide = (codePoint) => {
|
|
118
|
+
if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (codePoint < minimumWideCodePoint || codePoint > maximumWideCodePoint) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return isInRange(wideRanges, codePoint);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// node_modules/get-east-asian-width/index.js
|
|
128
|
+
function validate(codePoint) {
|
|
129
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
130
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
134
|
+
validate(codePoint);
|
|
135
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
136
|
+
return 2;
|
|
137
|
+
}
|
|
138
|
+
return 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// node_modules/ansi-regex/index.js
|
|
142
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
143
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
144
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
145
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
146
|
+
const pattern = `${osc}|${csi}`;
|
|
147
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// node_modules/strip-ansi/index.js
|
|
151
|
+
var regex = ansiRegex();
|
|
152
|
+
function stripAnsi(string) {
|
|
153
|
+
if (typeof string !== "string") {
|
|
154
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
155
|
+
}
|
|
156
|
+
if (!string.includes("\x1B") && !string.includes("\x9B")) {
|
|
157
|
+
return string;
|
|
158
|
+
}
|
|
159
|
+
return string.replace(regex, "");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// node_modules/string-width/index.js
|
|
163
|
+
var segmenter = new Intl.Segmenter();
|
|
164
|
+
var zeroWidthClusterRegex = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$", "v");
|
|
165
|
+
var leadingNonPrintingRegex = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+", "v");
|
|
166
|
+
var rgiEmojiRegex = new RegExp("^\\p{RGI_Emoji}$", "v");
|
|
167
|
+
var unqualifiedKeycapRegex = /^[\d#*]\u20E3$/;
|
|
168
|
+
var extendedPictographicRegex = new RegExp("\\p{Extended_Pictographic}", "gu");
|
|
169
|
+
function isDoubleWidthNonRgiEmojiSequence(segment) {
|
|
170
|
+
if (segment.length > 50) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (unqualifiedKeycapRegex.test(segment)) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (segment.includes("\u200D")) {
|
|
177
|
+
const pictographics = segment.match(extendedPictographicRegex);
|
|
178
|
+
return pictographics !== null && pictographics.length >= 2;
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
function baseVisible(segment) {
|
|
183
|
+
return segment.replace(leadingNonPrintingRegex, "");
|
|
184
|
+
}
|
|
185
|
+
function isZeroWidthCluster(segment) {
|
|
186
|
+
return zeroWidthClusterRegex.test(segment);
|
|
187
|
+
}
|
|
188
|
+
function trailingHalfwidthWidth(segment, eastAsianWidthOptions) {
|
|
189
|
+
let extra = 0;
|
|
190
|
+
if (segment.length > 1) {
|
|
191
|
+
for (const char of segment.slice(1)) {
|
|
192
|
+
if (char >= "\uFF00" && char <= "\uFFEF") {
|
|
193
|
+
extra += eastAsianWidth(char.codePointAt(0), eastAsianWidthOptions);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return extra;
|
|
198
|
+
}
|
|
199
|
+
function stringWidth(input, options = {}) {
|
|
200
|
+
if (typeof input !== "string" || input.length === 0) {
|
|
201
|
+
return 0;
|
|
202
|
+
}
|
|
203
|
+
const {
|
|
204
|
+
ambiguousIsNarrow = true,
|
|
205
|
+
countAnsiEscapeCodes = false
|
|
206
|
+
} = options;
|
|
207
|
+
let string = input;
|
|
208
|
+
if (!countAnsiEscapeCodes && (string.includes("\x1B") || string.includes("\x9B"))) {
|
|
209
|
+
string = stripAnsi(string);
|
|
210
|
+
}
|
|
211
|
+
if (string.length === 0) {
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
if (/^[\u0020-\u007E]*$/.test(string)) {
|
|
215
|
+
return string.length;
|
|
216
|
+
}
|
|
217
|
+
let width = 0;
|
|
218
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
219
|
+
for (const { segment } of segmenter.segment(string)) {
|
|
220
|
+
if (isZeroWidthCluster(segment)) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
if (rgiEmojiRegex.test(segment) || isDoubleWidthNonRgiEmojiSequence(segment)) {
|
|
224
|
+
width += 2;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const codePoint = baseVisible(segment).codePointAt(0);
|
|
228
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
229
|
+
width += trailingHalfwidthWidth(segment, eastAsianWidthOptions);
|
|
230
|
+
}
|
|
231
|
+
return width;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// node_modules/ansi-styles/index.js
|
|
235
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
236
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
237
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
238
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
239
|
+
var styles = {
|
|
240
|
+
modifier: {
|
|
241
|
+
reset: [0, 0],
|
|
242
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
243
|
+
bold: [1, 22],
|
|
244
|
+
dim: [2, 22],
|
|
245
|
+
italic: [3, 23],
|
|
246
|
+
underline: [4, 24],
|
|
247
|
+
overline: [53, 55],
|
|
248
|
+
inverse: [7, 27],
|
|
249
|
+
hidden: [8, 28],
|
|
250
|
+
strikethrough: [9, 29]
|
|
251
|
+
},
|
|
252
|
+
color: {
|
|
253
|
+
black: [30, 39],
|
|
254
|
+
red: [31, 39],
|
|
255
|
+
green: [32, 39],
|
|
256
|
+
yellow: [33, 39],
|
|
257
|
+
blue: [34, 39],
|
|
258
|
+
magenta: [35, 39],
|
|
259
|
+
cyan: [36, 39],
|
|
260
|
+
white: [37, 39],
|
|
261
|
+
// Bright color
|
|
262
|
+
blackBright: [90, 39],
|
|
263
|
+
gray: [90, 39],
|
|
264
|
+
// Alias of `blackBright`
|
|
265
|
+
grey: [90, 39],
|
|
266
|
+
// Alias of `blackBright`
|
|
267
|
+
redBright: [91, 39],
|
|
268
|
+
greenBright: [92, 39],
|
|
269
|
+
yellowBright: [93, 39],
|
|
270
|
+
blueBright: [94, 39],
|
|
271
|
+
magentaBright: [95, 39],
|
|
272
|
+
cyanBright: [96, 39],
|
|
273
|
+
whiteBright: [97, 39]
|
|
274
|
+
},
|
|
275
|
+
bgColor: {
|
|
276
|
+
bgBlack: [40, 49],
|
|
277
|
+
bgRed: [41, 49],
|
|
278
|
+
bgGreen: [42, 49],
|
|
279
|
+
bgYellow: [43, 49],
|
|
280
|
+
bgBlue: [44, 49],
|
|
281
|
+
bgMagenta: [45, 49],
|
|
282
|
+
bgCyan: [46, 49],
|
|
283
|
+
bgWhite: [47, 49],
|
|
284
|
+
// Bright color
|
|
285
|
+
bgBlackBright: [100, 49],
|
|
286
|
+
bgGray: [100, 49],
|
|
287
|
+
// Alias of `bgBlackBright`
|
|
288
|
+
bgGrey: [100, 49],
|
|
289
|
+
// Alias of `bgBlackBright`
|
|
290
|
+
bgRedBright: [101, 49],
|
|
291
|
+
bgGreenBright: [102, 49],
|
|
292
|
+
bgYellowBright: [103, 49],
|
|
293
|
+
bgBlueBright: [104, 49],
|
|
294
|
+
bgMagentaBright: [105, 49],
|
|
295
|
+
bgCyanBright: [106, 49],
|
|
296
|
+
bgWhiteBright: [107, 49]
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
300
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
301
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
302
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
303
|
+
function assembleStyles() {
|
|
304
|
+
const codes = /* @__PURE__ */ new Map();
|
|
305
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
306
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
307
|
+
styles[styleName] = {
|
|
308
|
+
open: `\x1B[${style[0]}m`,
|
|
309
|
+
close: `\x1B[${style[1]}m`
|
|
310
|
+
};
|
|
311
|
+
group[styleName] = styles[styleName];
|
|
312
|
+
codes.set(style[0], style[1]);
|
|
313
|
+
}
|
|
314
|
+
Object.defineProperty(styles, groupName, {
|
|
315
|
+
value: group,
|
|
316
|
+
enumerable: false
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
Object.defineProperty(styles, "codes", {
|
|
320
|
+
value: codes,
|
|
321
|
+
enumerable: false
|
|
322
|
+
});
|
|
323
|
+
styles.color.close = "\x1B[39m";
|
|
324
|
+
styles.bgColor.close = "\x1B[49m";
|
|
325
|
+
styles.color.ansi = wrapAnsi16();
|
|
326
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
327
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
328
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
329
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
330
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
331
|
+
Object.defineProperties(styles, {
|
|
332
|
+
rgbToAnsi256: {
|
|
333
|
+
value(red, green, blue) {
|
|
334
|
+
if (red === green && green === blue) {
|
|
335
|
+
if (red < 8) {
|
|
336
|
+
return 16;
|
|
337
|
+
}
|
|
338
|
+
if (red > 248) {
|
|
339
|
+
return 231;
|
|
340
|
+
}
|
|
341
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
342
|
+
}
|
|
343
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
344
|
+
},
|
|
345
|
+
enumerable: false
|
|
346
|
+
},
|
|
347
|
+
hexToRgb: {
|
|
348
|
+
value(hex) {
|
|
349
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
350
|
+
if (!matches) {
|
|
351
|
+
return [0, 0, 0];
|
|
352
|
+
}
|
|
353
|
+
let [colorString] = matches;
|
|
354
|
+
if (colorString.length === 3) {
|
|
355
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
356
|
+
}
|
|
357
|
+
const integer = Number.parseInt(colorString, 16);
|
|
358
|
+
return [
|
|
359
|
+
/* eslint-disable no-bitwise */
|
|
360
|
+
integer >> 16 & 255,
|
|
361
|
+
integer >> 8 & 255,
|
|
362
|
+
integer & 255
|
|
363
|
+
/* eslint-enable no-bitwise */
|
|
364
|
+
];
|
|
365
|
+
},
|
|
366
|
+
enumerable: false
|
|
367
|
+
},
|
|
368
|
+
hexToAnsi256: {
|
|
369
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
370
|
+
enumerable: false
|
|
371
|
+
},
|
|
372
|
+
ansi256ToAnsi: {
|
|
373
|
+
value(code) {
|
|
374
|
+
if (code < 8) {
|
|
375
|
+
return 30 + code;
|
|
376
|
+
}
|
|
377
|
+
if (code < 16) {
|
|
378
|
+
return 90 + (code - 8);
|
|
379
|
+
}
|
|
380
|
+
let red;
|
|
381
|
+
let green;
|
|
382
|
+
let blue;
|
|
383
|
+
if (code >= 232) {
|
|
384
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
385
|
+
green = red;
|
|
386
|
+
blue = red;
|
|
387
|
+
} else {
|
|
388
|
+
code -= 16;
|
|
389
|
+
const remainder = code % 36;
|
|
390
|
+
red = Math.floor(code / 36) / 5;
|
|
391
|
+
green = Math.floor(remainder / 6) / 5;
|
|
392
|
+
blue = remainder % 6 / 5;
|
|
393
|
+
}
|
|
394
|
+
const value = Math.max(red, green, blue) * 2;
|
|
395
|
+
if (value === 0) {
|
|
396
|
+
return 30;
|
|
397
|
+
}
|
|
398
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
399
|
+
if (value === 2) {
|
|
400
|
+
result += 60;
|
|
401
|
+
}
|
|
402
|
+
return result;
|
|
403
|
+
},
|
|
404
|
+
enumerable: false
|
|
405
|
+
},
|
|
406
|
+
rgbToAnsi: {
|
|
407
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
408
|
+
enumerable: false
|
|
409
|
+
},
|
|
410
|
+
hexToAnsi: {
|
|
411
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
412
|
+
enumerable: false
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
return styles;
|
|
416
|
+
}
|
|
417
|
+
var ansiStyles = assembleStyles();
|
|
418
|
+
var ansi_styles_default = ansiStyles;
|
|
419
|
+
|
|
420
|
+
// node_modules/wrap-ansi/index.js
|
|
421
|
+
var ANSI_ESCAPE = "\x1B";
|
|
422
|
+
var ANSI_ESCAPE_CSI = "\x9B";
|
|
423
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
424
|
+
ANSI_ESCAPE,
|
|
425
|
+
ANSI_ESCAPE_CSI
|
|
426
|
+
]);
|
|
427
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
428
|
+
var ANSI_CSI = "[";
|
|
429
|
+
var ANSI_OSC = "]";
|
|
430
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
431
|
+
var ANSI_SGR_RESET = 0;
|
|
432
|
+
var ANSI_SGR_RESET_FOREGROUND = 39;
|
|
433
|
+
var ANSI_SGR_RESET_BACKGROUND = 49;
|
|
434
|
+
var ANSI_SGR_RESET_UNDERLINE_COLOR = 59;
|
|
435
|
+
var ANSI_SGR_FOREGROUND_EXTENDED = 38;
|
|
436
|
+
var ANSI_SGR_BACKGROUND_EXTENDED = 48;
|
|
437
|
+
var ANSI_SGR_UNDERLINE_COLOR_EXTENDED = 58;
|
|
438
|
+
var ANSI_SGR_COLOR_MODE_256 = 5;
|
|
439
|
+
var ANSI_SGR_COLOR_MODE_RGB = 2;
|
|
440
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
441
|
+
var ANSI_ESCAPE_REGEX = new RegExp(`^\\u001B(?:\\${ANSI_CSI}(?<sgr>[0-9;]*)${ANSI_SGR_TERMINATOR}|${ANSI_ESCAPE_LINK}(?<uri>[^\\u0007\\u001B]*)(?:\\u0007|\\u001B\\\\))`);
|
|
442
|
+
var ANSI_ESCAPE_CSI_REGEX = new RegExp(`^\\u009B(?<sgr>[0-9;]*)${ANSI_SGR_TERMINATOR}`);
|
|
443
|
+
var ANSI_SGR_MODIFIER_CLOSE_CODES = new Set(ansi_styles_default.codes.values());
|
|
444
|
+
ANSI_SGR_MODIFIER_CLOSE_CODES.delete(ANSI_SGR_RESET);
|
|
445
|
+
var segmenter2 = new Intl.Segmenter();
|
|
446
|
+
var getGraphemes = (string) => Array.from(segmenter2.segment(string), ({ segment }) => segment);
|
|
447
|
+
var TAB_SIZE = 8;
|
|
448
|
+
var wrapAnsiCode = (code) => `${ANSI_ESCAPE}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
449
|
+
var wrapAnsiHyperlink = (url) => `${ANSI_ESCAPE}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
450
|
+
var getSgrTokens = (sgrParameters) => {
|
|
451
|
+
const codes = sgrParameters.split(";").map((sgrParameter) => sgrParameter === "" ? ANSI_SGR_RESET : Number.parseInt(sgrParameter, 10));
|
|
452
|
+
const sgrTokens = [];
|
|
453
|
+
for (let index = 0; index < codes.length; index++) {
|
|
454
|
+
const code = codes[index];
|
|
455
|
+
if (!Number.isFinite(code)) {
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
if (code === ANSI_SGR_FOREGROUND_EXTENDED || code === ANSI_SGR_BACKGROUND_EXTENDED || code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED) {
|
|
459
|
+
if (index + 1 >= codes.length) {
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
const mode = codes[index + 1];
|
|
463
|
+
if (mode === ANSI_SGR_COLOR_MODE_256 && Number.isFinite(codes[index + 2])) {
|
|
464
|
+
sgrTokens.push([code, mode, codes[index + 2]]);
|
|
465
|
+
index += 2;
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
const red = codes[index + 2];
|
|
469
|
+
const green = codes[index + 3];
|
|
470
|
+
const blue = codes[index + 4];
|
|
471
|
+
if (mode === ANSI_SGR_COLOR_MODE_RGB && Number.isFinite(red) && Number.isFinite(green) && Number.isFinite(blue)) {
|
|
472
|
+
sgrTokens.push([code, mode, red, green, blue]);
|
|
473
|
+
index += 4;
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
sgrTokens.push([code]);
|
|
479
|
+
}
|
|
480
|
+
return sgrTokens;
|
|
481
|
+
};
|
|
482
|
+
var removeActiveStyle = (activeStyles, family) => {
|
|
483
|
+
const activeStyleIndex = activeStyles.findIndex((activeStyle) => activeStyle.family === family);
|
|
484
|
+
if (activeStyleIndex !== -1) {
|
|
485
|
+
activeStyles.splice(activeStyleIndex, 1);
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
var upsertActiveStyle = (activeStyles, nextActiveStyle) => {
|
|
489
|
+
removeActiveStyle(activeStyles, nextActiveStyle.family);
|
|
490
|
+
activeStyles.push(nextActiveStyle);
|
|
491
|
+
};
|
|
492
|
+
var removeModifierStylesByClose = (activeStyles, closeCode) => {
|
|
493
|
+
for (let index = activeStyles.length - 1; index >= 0; index--) {
|
|
494
|
+
const activeStyle = activeStyles[index];
|
|
495
|
+
if (activeStyle.family.startsWith("modifier-") && activeStyle.close === closeCode) {
|
|
496
|
+
activeStyles.splice(index, 1);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
var getColorStyle = (code, sgrToken) => {
|
|
501
|
+
if (code >= 30 && code <= 37 || code >= 90 && code <= 97 || code === ANSI_SGR_FOREGROUND_EXTENDED && sgrToken.length > 1) {
|
|
502
|
+
return {
|
|
503
|
+
family: "foreground",
|
|
504
|
+
open: sgrToken.join(";"),
|
|
505
|
+
close: ANSI_SGR_RESET_FOREGROUND
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
if (code >= 40 && code <= 47 || code >= 100 && code <= 107 || code === ANSI_SGR_BACKGROUND_EXTENDED && sgrToken.length > 1) {
|
|
509
|
+
return {
|
|
510
|
+
family: "background",
|
|
511
|
+
open: sgrToken.join(";"),
|
|
512
|
+
close: ANSI_SGR_RESET_BACKGROUND
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
if (code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED && sgrToken.length > 1) {
|
|
516
|
+
return {
|
|
517
|
+
family: "underlineColor",
|
|
518
|
+
open: sgrToken.join(";"),
|
|
519
|
+
close: ANSI_SGR_RESET_UNDERLINE_COLOR
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
var applySgrResetCode = (code, activeStyles) => {
|
|
524
|
+
if (code === ANSI_SGR_RESET) {
|
|
525
|
+
activeStyles.length = 0;
|
|
526
|
+
return true;
|
|
527
|
+
}
|
|
528
|
+
if (code === ANSI_SGR_RESET_FOREGROUND) {
|
|
529
|
+
removeActiveStyle(activeStyles, "foreground");
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
if (code === ANSI_SGR_RESET_BACKGROUND) {
|
|
533
|
+
removeActiveStyle(activeStyles, "background");
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
if (code === ANSI_SGR_RESET_UNDERLINE_COLOR) {
|
|
537
|
+
removeActiveStyle(activeStyles, "underlineColor");
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
if (ANSI_SGR_MODIFIER_CLOSE_CODES.has(code)) {
|
|
541
|
+
removeModifierStylesByClose(activeStyles, code);
|
|
542
|
+
return true;
|
|
543
|
+
}
|
|
544
|
+
return false;
|
|
545
|
+
};
|
|
546
|
+
var applySgrToken = (sgrToken, activeStyles) => {
|
|
547
|
+
const [code] = sgrToken;
|
|
548
|
+
if (applySgrResetCode(code, activeStyles)) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
const colorStyle = getColorStyle(code, sgrToken);
|
|
552
|
+
if (colorStyle) {
|
|
553
|
+
upsertActiveStyle(activeStyles, colorStyle);
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
const close = ansi_styles_default.codes.get(code);
|
|
557
|
+
if (close !== void 0 && close !== ANSI_SGR_RESET) {
|
|
558
|
+
upsertActiveStyle(activeStyles, {
|
|
559
|
+
family: `modifier-${code}`,
|
|
560
|
+
open: sgrToken.join(";"),
|
|
561
|
+
close
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
var applySgrParameters = (sgrParameters, activeStyles) => {
|
|
566
|
+
for (const sgrToken of getSgrTokens(sgrParameters)) {
|
|
567
|
+
applySgrToken(sgrToken, activeStyles);
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
var applySgrResets = (sgrParameters, activeStyles) => {
|
|
571
|
+
for (const sgrToken of getSgrTokens(sgrParameters)) {
|
|
572
|
+
const [code] = sgrToken;
|
|
573
|
+
applySgrResetCode(code, activeStyles);
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
var applyLeadingSgrResets = (string, activeStyles) => {
|
|
577
|
+
let remainder = string;
|
|
578
|
+
while (remainder.length > 0) {
|
|
579
|
+
if (remainder.startsWith(ANSI_ESCAPE) && remainder[1] !== "\\") {
|
|
580
|
+
const match = ANSI_ESCAPE_REGEX.exec(remainder);
|
|
581
|
+
if (!match) {
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
584
|
+
if (match.groups.sgr !== void 0) {
|
|
585
|
+
applySgrResets(match.groups.sgr, activeStyles);
|
|
586
|
+
}
|
|
587
|
+
remainder = remainder.slice(match[0].length);
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
if (remainder.startsWith(ANSI_ESCAPE_CSI)) {
|
|
591
|
+
const match = ANSI_ESCAPE_CSI_REGEX.exec(remainder);
|
|
592
|
+
if (!match || match.groups.sgr === void 0) {
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
applySgrResets(match.groups.sgr, activeStyles);
|
|
596
|
+
remainder = remainder.slice(match[0].length);
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
var getClosingSgrSequence = (activeStyles) => [...activeStyles].reverse().map((activeStyle) => wrapAnsiCode(activeStyle.close)).join("");
|
|
603
|
+
var getOpeningSgrSequence = (activeStyles) => activeStyles.map((activeStyle) => wrapAnsiCode(activeStyle.open)).join("");
|
|
604
|
+
var wordLengths = (string) => string.split(" ").map((word) => stringWidth(word));
|
|
605
|
+
var wrapWord = (rows, word, columns) => {
|
|
606
|
+
const characters = getGraphemes(word);
|
|
607
|
+
let isInsideEscape = false;
|
|
608
|
+
let isInsideLinkEscape = false;
|
|
609
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
610
|
+
for (const [index, character] of characters.entries()) {
|
|
611
|
+
const characterLength = stringWidth(character);
|
|
612
|
+
if (visible + characterLength <= columns) {
|
|
613
|
+
rows[rows.length - 1] += character;
|
|
614
|
+
} else {
|
|
615
|
+
rows.push(character);
|
|
616
|
+
visible = 0;
|
|
617
|
+
}
|
|
618
|
+
if (ESCAPES.has(character) && !(isInsideLinkEscape && character === ANSI_ESCAPE && characters[index + 1] === "\\")) {
|
|
619
|
+
isInsideEscape = true;
|
|
620
|
+
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
|
|
621
|
+
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
622
|
+
}
|
|
623
|
+
if (isInsideEscape) {
|
|
624
|
+
if (isInsideLinkEscape) {
|
|
625
|
+
if (character === ANSI_ESCAPE_BELL || character === "\\" && index > 0 && characters[index - 1] === ANSI_ESCAPE) {
|
|
626
|
+
isInsideEscape = false;
|
|
627
|
+
isInsideLinkEscape = false;
|
|
628
|
+
}
|
|
629
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
630
|
+
isInsideEscape = false;
|
|
631
|
+
}
|
|
632
|
+
continue;
|
|
633
|
+
}
|
|
634
|
+
visible += characterLength;
|
|
635
|
+
if (visible === columns && index < characters.length - 1) {
|
|
636
|
+
rows.push("");
|
|
637
|
+
visible = 0;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
641
|
+
rows[rows.length - 2] += rows.pop();
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
645
|
+
const words = string.split(" ");
|
|
646
|
+
let last = words.length;
|
|
647
|
+
while (last > 0) {
|
|
648
|
+
if (stringWidth(words[last - 1]) > 0) {
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
651
|
+
last--;
|
|
652
|
+
}
|
|
653
|
+
if (last === words.length) {
|
|
654
|
+
return string;
|
|
655
|
+
}
|
|
656
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
657
|
+
};
|
|
658
|
+
var expandTabs = (line) => {
|
|
659
|
+
if (!line.includes(" ")) {
|
|
660
|
+
return line;
|
|
661
|
+
}
|
|
662
|
+
const segments = line.split(" ");
|
|
663
|
+
let visible = 0;
|
|
664
|
+
let expandedLine = "";
|
|
665
|
+
for (const [index, segment] of segments.entries()) {
|
|
666
|
+
expandedLine += segment;
|
|
667
|
+
visible += stringWidth(segment);
|
|
668
|
+
if (index < segments.length - 1) {
|
|
669
|
+
const spaces = TAB_SIZE - visible % TAB_SIZE;
|
|
670
|
+
expandedLine += " ".repeat(spaces);
|
|
671
|
+
visible += spaces;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return expandedLine;
|
|
675
|
+
};
|
|
676
|
+
var exec = (string, columns, options = {}) => {
|
|
677
|
+
if (options.trim !== false && string.trim() === "") {
|
|
678
|
+
return "";
|
|
679
|
+
}
|
|
680
|
+
let returnValue = "";
|
|
681
|
+
let escapeUrl;
|
|
682
|
+
const activeStyles = [];
|
|
683
|
+
const lengths = wordLengths(string);
|
|
684
|
+
let rows = [""];
|
|
685
|
+
for (const [index, word] of string.split(" ").entries()) {
|
|
686
|
+
if (options.trim !== false) {
|
|
687
|
+
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
688
|
+
}
|
|
689
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
690
|
+
if (index !== 0) {
|
|
691
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
692
|
+
rows.push("");
|
|
693
|
+
rowLength = 0;
|
|
694
|
+
}
|
|
695
|
+
if (rowLength > 0 || options.trim === false) {
|
|
696
|
+
rows[rows.length - 1] += " ";
|
|
697
|
+
rowLength++;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
if (options.hard && options.wordWrap !== false && lengths[index] > columns) {
|
|
701
|
+
const remainingColumns = columns - rowLength;
|
|
702
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
703
|
+
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
704
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
705
|
+
rows.push("");
|
|
706
|
+
}
|
|
707
|
+
wrapWord(rows, word, columns);
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
711
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
712
|
+
wrapWord(rows, word, columns);
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
rows.push("");
|
|
716
|
+
}
|
|
717
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
718
|
+
wrapWord(rows, word, columns);
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
rows[rows.length - 1] += word;
|
|
722
|
+
}
|
|
723
|
+
if (options.trim !== false) {
|
|
724
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
725
|
+
}
|
|
726
|
+
const preString = rows.join("\n");
|
|
727
|
+
const pre = getGraphemes(preString);
|
|
728
|
+
let preStringIndex = 0;
|
|
729
|
+
for (const [index, character] of pre.entries()) {
|
|
730
|
+
returnValue += character;
|
|
731
|
+
if (character === ANSI_ESCAPE && pre[index + 1] !== "\\") {
|
|
732
|
+
const { groups } = ANSI_ESCAPE_REGEX.exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
733
|
+
if (groups.sgr !== void 0) {
|
|
734
|
+
applySgrParameters(groups.sgr, activeStyles);
|
|
735
|
+
} else if (groups.uri !== void 0) {
|
|
736
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
737
|
+
}
|
|
738
|
+
} else if (character === ANSI_ESCAPE_CSI) {
|
|
739
|
+
const { groups } = ANSI_ESCAPE_CSI_REGEX.exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
740
|
+
if (groups.sgr !== void 0) {
|
|
741
|
+
applySgrParameters(groups.sgr, activeStyles);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (pre[index + 1] === "\n") {
|
|
745
|
+
if (escapeUrl) {
|
|
746
|
+
returnValue += wrapAnsiHyperlink("");
|
|
747
|
+
}
|
|
748
|
+
returnValue += getClosingSgrSequence(activeStyles);
|
|
749
|
+
} else if (character === "\n") {
|
|
750
|
+
const openingStyles = [...activeStyles];
|
|
751
|
+
applyLeadingSgrResets(preString.slice(preStringIndex + 1), openingStyles);
|
|
752
|
+
returnValue += getOpeningSgrSequence(openingStyles);
|
|
753
|
+
if (escapeUrl) {
|
|
754
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
preStringIndex += character.length;
|
|
758
|
+
}
|
|
759
|
+
return returnValue;
|
|
760
|
+
};
|
|
761
|
+
function wrapAnsi(string, columns, options) {
|
|
762
|
+
return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line), columns, options)).join("\n");
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// bun-compat-entry.ts
|
|
766
|
+
var _segmenter = null;
|
|
767
|
+
function getGraphemeSegmenter() {
|
|
768
|
+
if (!_segmenter) _segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
769
|
+
return _segmenter;
|
|
770
|
+
}
|
|
771
|
+
var EMOJI_REGEX = (0, import_emoji_regex.default)();
|
|
772
|
+
function needsSegmentation(str) {
|
|
773
|
+
for (const char of str) {
|
|
774
|
+
const cp = char.codePointAt(0);
|
|
775
|
+
if (cp >= 127744 && cp <= 129791) return true;
|
|
776
|
+
if (cp >= 9728 && cp <= 10175) return true;
|
|
777
|
+
if (cp >= 127462 && cp <= 127487) return true;
|
|
778
|
+
if (cp >= 65024 && cp <= 65039) return true;
|
|
779
|
+
if (cp === 8205) return true;
|
|
780
|
+
}
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
function getEmojiWidth(grapheme) {
|
|
784
|
+
const first = grapheme.codePointAt(0);
|
|
785
|
+
if (first >= 127462 && first <= 127487) {
|
|
786
|
+
let count = 0;
|
|
787
|
+
for (const _ of grapheme) count++;
|
|
788
|
+
return count === 1 ? 1 : 2;
|
|
789
|
+
}
|
|
790
|
+
if (grapheme.length === 2) {
|
|
791
|
+
const second = grapheme.codePointAt(1);
|
|
792
|
+
if (second === 65039 && (first >= 48 && first <= 57 || first === 35 || first === 42)) return 1;
|
|
793
|
+
}
|
|
794
|
+
return 2;
|
|
795
|
+
}
|
|
796
|
+
function isZeroWidth(codePoint) {
|
|
797
|
+
if (codePoint >= 32 && codePoint < 127) return false;
|
|
798
|
+
if (codePoint >= 160 && codePoint < 768) return codePoint === 173;
|
|
799
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) return true;
|
|
800
|
+
if (codePoint >= 8203 && codePoint <= 8205 || codePoint === 65279 || codePoint >= 8288 && codePoint <= 8292) return true;
|
|
801
|
+
if (codePoint >= 65024 && codePoint <= 65039 || codePoint >= 917760 && codePoint <= 917999) return true;
|
|
802
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) return true;
|
|
803
|
+
if (codePoint >= 2304 && codePoint <= 3407) {
|
|
804
|
+
const offset = codePoint & 127;
|
|
805
|
+
if (offset <= 3) return true;
|
|
806
|
+
if (offset >= 58 && offset <= 79) return true;
|
|
807
|
+
if (offset >= 81 && offset <= 87) return true;
|
|
808
|
+
if (offset >= 98 && offset <= 99) return true;
|
|
809
|
+
}
|
|
810
|
+
if (codePoint === 3633 || codePoint >= 3636 && codePoint <= 3642 || codePoint >= 3655 && codePoint <= 3662 || codePoint === 3761 || codePoint >= 3764 && codePoint <= 3772 || codePoint >= 3784 && codePoint <= 3789) return true;
|
|
811
|
+
if (codePoint >= 1536 && codePoint <= 1541 || codePoint === 1757 || codePoint === 1807 || codePoint === 2274) return true;
|
|
812
|
+
if (codePoint >= 55296 && codePoint <= 57343) return true;
|
|
813
|
+
if (codePoint >= 917504 && codePoint <= 917631) return true;
|
|
814
|
+
return false;
|
|
815
|
+
}
|
|
816
|
+
function stringWidth2(str) {
|
|
817
|
+
if (typeof str !== "string" || str.length === 0) return 0;
|
|
818
|
+
let isPureAscii = true;
|
|
819
|
+
for (let i = 0; i < str.length; i++) {
|
|
820
|
+
if (str.charCodeAt(i) >= 127 || str.charCodeAt(i) === 27) {
|
|
821
|
+
isPureAscii = false;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (isPureAscii) {
|
|
826
|
+
let width2 = 0;
|
|
827
|
+
for (let i = 0; i < str.length; i++) {
|
|
828
|
+
if (str.charCodeAt(i) > 31) width2++;
|
|
829
|
+
}
|
|
830
|
+
return width2;
|
|
831
|
+
}
|
|
832
|
+
if (str.includes("\x1B")) {
|
|
833
|
+
str = stripAnsi(str);
|
|
834
|
+
if (str.length === 0) return 0;
|
|
835
|
+
}
|
|
836
|
+
if (!needsSegmentation(str)) {
|
|
837
|
+
let width2 = 0;
|
|
838
|
+
for (const char of str) {
|
|
839
|
+
const cp = char.codePointAt(0);
|
|
840
|
+
if (!isZeroWidth(cp)) width2 += eastAsianWidth(cp, { ambiguousAsWide: false });
|
|
841
|
+
}
|
|
842
|
+
return width2;
|
|
843
|
+
}
|
|
844
|
+
let width = 0;
|
|
845
|
+
for (const { segment: grapheme } of getGraphemeSegmenter().segment(str)) {
|
|
846
|
+
EMOJI_REGEX.lastIndex = 0;
|
|
847
|
+
if (EMOJI_REGEX.test(grapheme)) {
|
|
848
|
+
width += getEmojiWidth(grapheme);
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
for (const char of grapheme) {
|
|
852
|
+
const cp = char.codePointAt(0);
|
|
853
|
+
if (!isZeroWidth(cp)) {
|
|
854
|
+
width += eastAsianWidth(cp, { ambiguousAsWide: false });
|
|
855
|
+
break;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return width;
|
|
860
|
+
}
|
|
861
|
+
var stripANSI = stripAnsi;
|
|
862
|
+
var wrapAnsi2 = wrapAnsi;
|
|
863
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
864
|
+
0 && (module.exports = {
|
|
865
|
+
stringWidth,
|
|
866
|
+
stripANSI,
|
|
867
|
+
wrapAnsi
|
|
868
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometix/claude-code",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.131",
|
|
4
4
|
"bin": {
|
|
5
5
|
"claude": "cli.js"
|
|
6
6
|
},
|
|
@@ -25,21 +25,18 @@
|
|
|
25
25
|
"ws": "^8.18.0",
|
|
26
26
|
"yaml": "^2.7.0",
|
|
27
27
|
"undici": "^7.3.0",
|
|
28
|
-
"semver": "^7.6.3"
|
|
29
|
-
"strip-ansi": "^6.0.1",
|
|
30
|
-
"string-width": "^4.2.3",
|
|
31
|
-
"wrap-ansi": "^7.0.0"
|
|
28
|
+
"semver": "^7.6.3"
|
|
32
29
|
},
|
|
33
30
|
"optionalDependencies": {
|
|
34
|
-
"@cometix/claude-code-darwin-arm64": "2.1.
|
|
35
|
-
"@cometix/claude-code-darwin-x64": "2.1.
|
|
36
|
-
"@cometix/claude-code-linux-arm64": "2.1.
|
|
37
|
-
"@cometix/claude-code-linux-x64": "2.1.
|
|
38
|
-
"@cometix/claude-code-linux-arm64-musl": "2.1.
|
|
39
|
-
"@cometix/claude-code-linux-x64-musl": "2.1.
|
|
40
|
-
"@cometix/claude-code-win32-arm64": "2.1.
|
|
41
|
-
"@cometix/claude-code-win32-x64": "2.1.
|
|
42
|
-
"@cometix/claude-code-android-arm64": "2.1.
|
|
31
|
+
"@cometix/claude-code-darwin-arm64": "2.1.131",
|
|
32
|
+
"@cometix/claude-code-darwin-x64": "2.1.131",
|
|
33
|
+
"@cometix/claude-code-linux-arm64": "2.1.131",
|
|
34
|
+
"@cometix/claude-code-linux-x64": "2.1.131",
|
|
35
|
+
"@cometix/claude-code-linux-arm64-musl": "2.1.131",
|
|
36
|
+
"@cometix/claude-code-linux-x64-musl": "2.1.131",
|
|
37
|
+
"@cometix/claude-code-win32-arm64": "2.1.131",
|
|
38
|
+
"@cometix/claude-code-win32-x64": "2.1.131",
|
|
39
|
+
"@cometix/claude-code-android-arm64": "2.1.131",
|
|
43
40
|
"@img/sharp-darwin-arm64": "^0.34.2",
|
|
44
41
|
"@img/sharp-darwin-x64": "^0.34.2",
|
|
45
42
|
"@img/sharp-linux-arm": "^0.34.2",
|
|
@@ -53,6 +50,7 @@
|
|
|
53
50
|
"files": [
|
|
54
51
|
"cli.js",
|
|
55
52
|
"install.cjs",
|
|
53
|
+
"bun-ink-compat.cjs",
|
|
56
54
|
"sdk-tools.d.ts"
|
|
57
55
|
]
|
|
58
56
|
}
|