@plumpslabs/fennec-cli 1.12.1 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1851,2613 +1851,6 @@ var require_cli_table3 = __commonJS({
1851
1851
  }
1852
1852
  });
1853
1853
 
1854
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/package.json
1855
- var require_package = __commonJS({
1856
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/package.json"(exports, module) {
1857
- module.exports = {
1858
- name: "cfonts",
1859
- description: "Sexy ANSI fonts for the console",
1860
- version: "3.3.1",
1861
- homepage: "https://github.com/dominikwilkowski/cfonts",
1862
- author: {
1863
- name: "Dominik Wilkowski",
1864
- email: "Hi@Dominik-Wilkowski.com",
1865
- url: "http://dominik-wilkowski.com/"
1866
- },
1867
- contributors: [
1868
- {
1869
- name: "Dominik Wilkowski",
1870
- email: "Hi@Dominik-Wilkowski.com",
1871
- url: "http://dominik-wilkowski.com/"
1872
- }
1873
- ],
1874
- repository: {
1875
- type: "git",
1876
- url: "git://github.com/dominikwilkowski/cfonts.git"
1877
- },
1878
- bugs: {
1879
- url: "https://github.com/dominikwilkowski/cfonts/issues"
1880
- },
1881
- engines: {
1882
- node: ">=10"
1883
- },
1884
- scripts: {
1885
- test: "yarn test:format && yarn build && yarn test:unit && yarn test:lint && yarn test:types && yarn test:fonts",
1886
- "test:fonts": "node ./test/fonttest.js",
1887
- "test:watch": "jest --watchAll --coverage",
1888
- "test:unit": "npx cross-env FORCE_COLOR=3 jest",
1889
- "test:types": "yarn types:clean && tsc -p tsconfig.json",
1890
- "test:lint": "eslint src/",
1891
- "test:format": 'prettier --version && prettier --list-different "**/*.{js,json}"',
1892
- format: 'prettier --write "**/*.{js,json}"',
1893
- build: "yarn build:lib && yarn build:bin && yarn build:fonts",
1894
- "build:bin": "npx mkdirp bin && mv lib/bin.js bin/index.js",
1895
- "build:lib": "npx mkdirp lib && babel src --out-dir lib",
1896
- "build:fonts": "make",
1897
- "types:clean": 'npx trash-cli@5.0.0 "lib/*.d.ts"',
1898
- watch: "yarn build:lib && onchange 'src/**/*' -- yarn build:lib",
1899
- coveralls: "jest --coverage --coverageReporters=text-lcov | coveralls",
1900
- nuke: "rm -rf lib && rm -rf node_modules && rm yarn.lock"
1901
- },
1902
- devDependencies: {
1903
- "@babel/cli": "^7",
1904
- "@babel/core": "^7",
1905
- "@babel/preset-env": "^7",
1906
- "@types/node": "^20",
1907
- coveralls: "^3",
1908
- eslint: "^8",
1909
- "jest-cli": "^27",
1910
- onchange: "^7",
1911
- prettier: "^2",
1912
- typescript: "5.0"
1913
- },
1914
- peerDependencies: {},
1915
- dependencies: {
1916
- "supports-color": "^8",
1917
- "window-size": "^1"
1918
- },
1919
- jest: {
1920
- displayName: "CFonts",
1921
- testEnvironment: "node",
1922
- testRegex: "\\.spec.js$",
1923
- collectCoverageFrom: [
1924
- "src/*.js"
1925
- ],
1926
- setupFiles: [
1927
- "<rootDir>/test/env.js"
1928
- ],
1929
- coverageThreshold: {
1930
- global: {
1931
- branches: 95,
1932
- functions: 100,
1933
- lines: 95,
1934
- statements: 95
1935
- }
1936
- }
1937
- },
1938
- browserslist: [
1939
- "node >= 10"
1940
- ],
1941
- keywords: [
1942
- "font",
1943
- "banner",
1944
- "logo",
1945
- "CLI",
1946
- "console",
1947
- "ascii",
1948
- "pretty"
1949
- ],
1950
- files: [
1951
- "lib/*",
1952
- "bin/*",
1953
- "fonts/*"
1954
- ],
1955
- main: "lib/index.js",
1956
- types: "lib/index.d.ts",
1957
- bin: {
1958
- cfonts: "./bin/index.js"
1959
- },
1960
- licenses: [
1961
- {
1962
- type: "GPL-3.0-or-later",
1963
- url: "https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE"
1964
- }
1965
- ],
1966
- license: "GPL-3.0-or-later"
1967
- };
1968
- }
1969
- });
1970
-
1971
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/constants.js
1972
- var require_constants = __commonJS({
1973
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/constants.js"(exports, module) {
1974
- "use strict";
1975
- var CHARS = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "|", "!", "?", ".", "+", "-", "_", "=", "@", "#", "$", "%", "&", "(", ")", "/", ":", ";", ",", " ", "'", '"'];
1976
- var COLORS = {
1977
- system: "system",
1978
- black: "black",
1979
- red: "red",
1980
- green: "green",
1981
- yellow: "yellow",
1982
- blue: "blue",
1983
- magenta: "magenta",
1984
- cyan: "cyan",
1985
- white: "white",
1986
- gray: "gray",
1987
- redbright: "redBright",
1988
- greenbright: "greenBright",
1989
- yellowbright: "yellowBright",
1990
- bluebright: "blueBright",
1991
- magentabright: "magentaBright",
1992
- cyanbright: "cyanBright",
1993
- whitebright: "whiteBright"
1994
- };
1995
- var BGCOLORS = {
1996
- transparent: "transparent",
1997
- black: "black",
1998
- red: "red",
1999
- green: "green",
2000
- yellow: "yellow",
2001
- blue: "blue",
2002
- magenta: "magenta",
2003
- cyan: "cyan",
2004
- white: "white",
2005
- blackbright: "blackBright",
2006
- redbright: "redBright",
2007
- greenbright: "greenBright",
2008
- yellowbright: "yellowBright",
2009
- bluebright: "blueBright",
2010
- magentabright: "magentaBright",
2011
- cyanbright: "cyanBright",
2012
- whitebright: "whiteBright"
2013
- };
2014
- var GRADIENTCOLORS = {
2015
- transparent: "transparent",
2016
- black: "black",
2017
- red: "red",
2018
- green: "green",
2019
- yellow: "yellow",
2020
- blue: "blue",
2021
- magenta: "magenta",
2022
- cyan: "cyan",
2023
- white: "white",
2024
- gray: "gray",
2025
- grey: "grey"
2026
- };
2027
- var GRADIENTS = {
2028
- lgbt: ["#750787", "#004dff", "#008026", "#ffed00", "#ff8c00", "#e40303"],
2029
- lgbtq: ["#750787", "#004dff", "#008026", "#ffed00", "#ff8c00", "#e40303"],
2030
- pride: ["#750787", "#004dff", "#008026", "#ffed00", "#ff8c00", "#e40303"],
2031
- agender: ["#000000", "#b9b9b9", "#ffffff", "#b8f483", "#ffffff", "#b9b9b9", "#000000"],
2032
- aromantic: ["#3da542", "#a7d379", "#ffffff", "#a9a9a9", "#000000"],
2033
- asexual: ["#000000", "#a3a3a3", "#ffffff", "#800080"],
2034
- bisexual: ["#d60270", "#d60270", "#9b4f96", "#0038a8", "#0038a8"],
2035
- genderfluid: ["#ff75a2", "#ffffff", "#be18d6", "#000000", "#333ebd"],
2036
- genderqueer: ["#b57edc", "#ffffff", "#4a8123"],
2037
- intersex: ["#ffd800", "#ffd800", "#7902aa", "#ffd800", "#ffd800"],
2038
- lesbian: ["#d52d00", "#ff9a56", "#ffffff", "#d362a4", "#a30262"],
2039
- nonbinary: ["#fcf434", "#ffffff", "#9c5cd4", "#2c2c2c"],
2040
- pansexual: ["#ff218c", "#ffd800", "#21b1ff"],
2041
- polysexual: ["#f61cb9", "#07d569", "#1c92f6"],
2042
- transgender: ["#5bcefa", "#f5a9b8", "#ffffff", "#f5a9b8", "#5bcefa"]
2043
- };
2044
- var ALIGNMENT = ["left", "center", "right", "top", "bottom"];
2045
- var FONTFACES = {
2046
- console: "console",
2047
- block: "block",
2048
- simpleblock: "simpleBlock",
2049
- simple: "simple",
2050
- "3d": "3d",
2051
- simple3d: "simple3d",
2052
- chrome: "chrome",
2053
- huge: "huge",
2054
- shade: "shade",
2055
- slick: "slick",
2056
- grid: "grid",
2057
- pallet: "pallet",
2058
- tiny: "tiny"
2059
- };
2060
- var CLIOPTIONS = {
2061
- "--version": {
2062
- description: "Use to display the version of cfonts",
2063
- example: "--version",
2064
- short: "-v",
2065
- fallback_shortcut: "-V",
2066
- default: false
2067
- },
2068
- "--help": {
2069
- description: "Use to display this help",
2070
- example: "--help",
2071
- short: "-h",
2072
- fallback_shortcut: false,
2073
- default: false
2074
- },
2075
- "--font": {
2076
- description: "Use to define the font face",
2077
- example: `--font block [green-open][ ${Object.keys(FONTFACES).map((font) => FONTFACES[font]).join(", ")} ][green-close]`,
2078
- short: "-f",
2079
- fallback_shortcut: false,
2080
- options: Object.keys(FONTFACES).map((color) => FONTFACES[color]),
2081
- default: "block"
2082
- },
2083
- "--colors": {
2084
- description: "Use to define the font color",
2085
- example: `--colors red [green-open][ ${Object.keys(COLORS).map((color) => COLORS[color]).join(", ")}, #ff8800, hex-colors etc... ][green-close]`,
2086
- short: "-c",
2087
- fallback_shortcut: false,
2088
- options: true,
2089
- default: "system"
2090
- },
2091
- "--background": {
2092
- description: "Use to define background color",
2093
- example: `--background blue [green-open][ ${Object.keys(BGCOLORS).map((bgcolor) => BGCOLORS[bgcolor]).join(", ")} ][green-close]`,
2094
- short: "-b",
2095
- fallback_shortcut: false,
2096
- options: Object.keys(BGCOLORS).map((color) => BGCOLORS[color]),
2097
- default: "transparent"
2098
- },
2099
- "--align": {
2100
- description: "Use to align your text output",
2101
- example: `--align [green-open][ ${ALIGNMENT.join(", ")} ][green-close]`,
2102
- short: "-a",
2103
- fallback_shortcut: false,
2104
- options: ALIGNMENT,
2105
- default: "left"
2106
- },
2107
- "--letter-spacing": {
2108
- description: "Use to define your letter spacing",
2109
- example: "--letter-spacing 2",
2110
- short: "-l",
2111
- fallback_shortcut: false,
2112
- options: true,
2113
- default: void 0
2114
- },
2115
- "--line-height": {
2116
- description: "Use to define your line height",
2117
- example: "--line-height 5",
2118
- short: "-z",
2119
- fallback_shortcut: false,
2120
- options: true,
2121
- default: void 0
2122
- },
2123
- "--spaceless": {
2124
- description: "Use to disable the padding around your output",
2125
- example: "--spaceless",
2126
- short: "-s",
2127
- fallback_shortcut: false,
2128
- default: false
2129
- },
2130
- "--max-length": {
2131
- description: "Use to define the amount of maximum characters per line",
2132
- example: "--max-length 10",
2133
- short: "-m",
2134
- fallback_shortcut: false,
2135
- options: true,
2136
- default: 0
2137
- },
2138
- "--gradient": {
2139
- description: "Use to define a start and end color of a gradient",
2140
- example: "--gradient red,blue,green",
2141
- short: "-g",
2142
- fallback_shortcut: false,
2143
- options: true,
2144
- default: false
2145
- },
2146
- "--independent-gradient": {
2147
- description: "Use to define that a gradient is applied independently for each line",
2148
- example: "--gradient red,blue --independent-gradient",
2149
- short: "-i",
2150
- fallback_shortcut: false,
2151
- default: false
2152
- },
2153
- "--transition-gradient": {
2154
- description: "Use to define that a gradient is a transition between the colors",
2155
- example: "--gradient red,blue,green --transition-gradient",
2156
- short: "-t",
2157
- fallback_shortcut: false,
2158
- default: false
2159
- },
2160
- "--raw-mode": {
2161
- description: "Use to enable proper newline rendering in raw mode in the terminal by adding \\r to line breaks",
2162
- example: "--raw-mode",
2163
- short: "-r",
2164
- fallback_shortcut: false,
2165
- default: false
2166
- },
2167
- "--env": {
2168
- description: "Use to define what environment you run CFonts in.",
2169
- example: `--env [green-open][ "node", "browser" ][green-close]`,
2170
- short: "-e",
2171
- fallback_shortcut: false,
2172
- options: true,
2173
- default: "node"
2174
- },
2175
- "--debug": {
2176
- description: "Use to enable debug mode",
2177
- example: "--debug",
2178
- short: "-d",
2179
- fallback_shortcut: false,
2180
- default: false
2181
- },
2182
- "--debug-level": {
2183
- description: "Use to define the debug level. The higher, the less debug infos",
2184
- example: "--debug-level 2",
2185
- short: "-x",
2186
- fallback_shortcut: false,
2187
- options: true,
2188
- default: 1
2189
- }
2190
- };
2191
- var PACKAGE = require_package();
2192
- module.exports = exports = {
2193
- CHARS,
2194
- COLORS,
2195
- BGCOLORS,
2196
- GRADIENTCOLORS,
2197
- GRADIENTS,
2198
- ALIGNMENT,
2199
- FONTFACES,
2200
- CLIOPTIONS,
2201
- PACKAGE
2202
- };
2203
- }
2204
- });
2205
-
2206
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/DisplayVersion.js
2207
- var require_DisplayVersion = __commonJS({
2208
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/DisplayVersion.js"(exports, module) {
2209
- "use strict";
2210
- var {
2211
- PACKAGE
2212
- } = require_constants();
2213
- var DisplayVersion = () => {
2214
- console.log(PACKAGE.version);
2215
- };
2216
- module.exports = exports = {
2217
- DisplayVersion
2218
- };
2219
- }
2220
- });
2221
-
2222
- // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
2223
- var require_has_flag2 = __commonJS({
2224
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
2225
- "use strict";
2226
- module.exports = (flag, argv = process.argv) => {
2227
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
2228
- const position = argv.indexOf(prefix + flag);
2229
- const terminatorPosition = argv.indexOf("--");
2230
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
2231
- };
2232
- }
2233
- });
2234
-
2235
- // ../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
2236
- var require_supports_color = __commonJS({
2237
- "../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module) {
2238
- "use strict";
2239
- var os = __require("os");
2240
- var tty = __require("tty");
2241
- var hasFlag = require_has_flag2();
2242
- var { env } = process;
2243
- var flagForceColor;
2244
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
2245
- flagForceColor = 0;
2246
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
2247
- flagForceColor = 1;
2248
- }
2249
- function envForceColor() {
2250
- if ("FORCE_COLOR" in env) {
2251
- if (env.FORCE_COLOR === "true") {
2252
- return 1;
2253
- }
2254
- if (env.FORCE_COLOR === "false") {
2255
- return 0;
2256
- }
2257
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
2258
- }
2259
- }
2260
- function translateLevel(level) {
2261
- if (level === 0) {
2262
- return false;
2263
- }
2264
- return {
2265
- level,
2266
- hasBasic: true,
2267
- has256: level >= 2,
2268
- has16m: level >= 3
2269
- };
2270
- }
2271
- function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
2272
- const noFlagForceColor = envForceColor();
2273
- if (noFlagForceColor !== void 0) {
2274
- flagForceColor = noFlagForceColor;
2275
- }
2276
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
2277
- if (forceColor === 0) {
2278
- return 0;
2279
- }
2280
- if (sniffFlags) {
2281
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
2282
- return 3;
2283
- }
2284
- if (hasFlag("color=256")) {
2285
- return 2;
2286
- }
2287
- }
2288
- if (haveStream && !streamIsTTY && forceColor === void 0) {
2289
- return 0;
2290
- }
2291
- const min = forceColor || 0;
2292
- if (env.TERM === "dumb") {
2293
- return min;
2294
- }
2295
- if (process.platform === "win32") {
2296
- const osRelease = os.release().split(".");
2297
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
2298
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
2299
- }
2300
- return 1;
2301
- }
2302
- if ("CI" in env) {
2303
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
2304
- return 1;
2305
- }
2306
- return min;
2307
- }
2308
- if ("TEAMCITY_VERSION" in env) {
2309
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
2310
- }
2311
- if (env.COLORTERM === "truecolor") {
2312
- return 3;
2313
- }
2314
- if ("TERM_PROGRAM" in env) {
2315
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
2316
- switch (env.TERM_PROGRAM) {
2317
- case "iTerm.app":
2318
- return version >= 3 ? 3 : 2;
2319
- case "Apple_Terminal":
2320
- return 2;
2321
- }
2322
- }
2323
- if (/-256(color)?$/i.test(env.TERM)) {
2324
- return 2;
2325
- }
2326
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
2327
- return 1;
2328
- }
2329
- if ("COLORTERM" in env) {
2330
- return 1;
2331
- }
2332
- return min;
2333
- }
2334
- function getSupportLevel(stream, options = {}) {
2335
- const level = supportsColor(stream, {
2336
- streamIsTTY: stream && stream.isTTY,
2337
- ...options
2338
- });
2339
- return translateLevel(level);
2340
- }
2341
- module.exports = {
2342
- supportsColor: getSupportLevel,
2343
- stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
2344
- stderr: getSupportLevel({ isTTY: tty.isatty(2) })
2345
- };
2346
- }
2347
- });
2348
-
2349
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Options.js
2350
- var require_Options = __commonJS({
2351
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Options.js"(exports, module) {
2352
- "use strict";
2353
- var {
2354
- COLORS,
2355
- BGCOLORS,
2356
- FONTFACES
2357
- } = require_constants();
2358
- var Options = {
2359
- store: {},
2360
- reset() {
2361
- const defaults = {
2362
- font: "block",
2363
- align: "left",
2364
- colors: [],
2365
- background: "transparent",
2366
- letterSpacing: 1,
2367
- lineHeight: 1,
2368
- spaceless: false,
2369
- maxLength: 0,
2370
- gradient: false,
2371
- independentGradient: false,
2372
- transitionGradient: false,
2373
- rawMode: false,
2374
- env: "node"
2375
- };
2376
- this.store = {
2377
- ...defaults
2378
- };
2379
- },
2380
- /**
2381
- * Get the current options
2382
- *
2383
- * @return {object} - Our options as hey are stored in our object
2384
- */
2385
- get get() {
2386
- return this.store;
2387
- },
2388
- /**
2389
- * Merge settings into our options object
2390
- *
2391
- * @param {object} options - The settings object
2392
- * @param {string} options.font - Font face, Default 'block'
2393
- * @param {string} options.align - Text alignment, Default: 'left'
2394
- * @param {array} options.colors - Colors for font, Default: []
2395
- * @param {string} options.background - Color string for background, Default 'Black'
2396
- * @param {string} options.backgroundColor - Alias for background
2397
- * @param {number} options.letterSpacing - Space between letters, Default: set by selected font face
2398
- * @param {number} options.lineHeight - Space between lines, Default: 1
2399
- * @param {boolean} options.spaceless - Don't output space before and after output, Default: false
2400
- * @param {number} options.maxLength - Maximum amount of characters per line, Default width of console window
2401
- * @param {(string|array|boolean)} options.gradient - Gradient color pair, Default: false
2402
- * @param {boolean} options.independentGradient - A switch to calculate gradient per line or not
2403
- * @param {boolean} options.transitionGradient - A switch for transition gradients
2404
- * @param {string} options.env - The environment we run cfonts in
2405
- * @param {object} options.allowedColors - All allowed font colors
2406
- * @param {object} options.allowedBG - All allowed background colors
2407
- * @param {object} options.allowedFont - All allowed fontfaces
2408
- * @param {boolean} options.rawMode - A switch for raw mode in terminals
2409
- */
2410
- set set({
2411
- font = "",
2412
- align,
2413
- colors: colors2,
2414
- background,
2415
- backgroundColor,
2416
- letterSpacing,
2417
- lineHeight,
2418
- spaceless,
2419
- maxLength,
2420
- gradient,
2421
- independentGradient,
2422
- transitionGradient,
2423
- env,
2424
- allowedColors = COLORS,
2425
- allowedBG = BGCOLORS,
2426
- allowedFont = FONTFACES,
2427
- rawMode
2428
- }) {
2429
- this.store.font = font !== "" ? allowedFont[font.toLowerCase()] || font : this.store.font;
2430
- this.store.align = align !== void 0 ? align.toLowerCase() : this.store.align;
2431
- this.store.colors = Array.isArray(colors2) ? colors2.map((color) => allowedColors[color.toLowerCase()] || color) : this.store.colors;
2432
- const bg = backgroundColor || background;
2433
- this.store.background = bg !== void 0 ? allowedBG[bg.toLowerCase()] || bg : this.store.background;
2434
- this.store.letterSpacing = letterSpacing !== void 0 ? parseInt(letterSpacing.toString()) : font.toLowerCase() === "console" ? 0 : this.store.letterSpacing;
2435
- this.store.lineHeight = lineHeight !== void 0 ? parseInt(lineHeight.toString()) : font.toLowerCase() === "console" ? 0 : this.store.lineHeight;
2436
- this.store.spaceless = typeof spaceless === "boolean" ? spaceless : this.store.spaceless;
2437
- this.store.maxLength = maxLength !== void 0 ? maxLength : this.store.maxLength;
2438
- this.store.gradient = gradient !== void 0 && typeof gradient !== "boolean" ? Array.isArray(gradient) ? gradient : gradient.split(",") : gradient === false ? false : this.store.gradient;
2439
- this.store.independentGradient = independentGradient !== void 0 ? independentGradient : this.store.independentGradient;
2440
- this.store.transitionGradient = transitionGradient !== void 0 ? transitionGradient : this.store.transitionGradient;
2441
- this.store.env = env !== void 0 ? env : this.store.env;
2442
- this.store.rawMode = rawMode !== void 0 ? rawMode : this.store.rawMode;
2443
- }
2444
- };
2445
- module.exports = exports = {
2446
- Options
2447
- };
2448
- }
2449
- });
2450
-
2451
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Color.js
2452
- var require_Color = __commonJS({
2453
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Color.js"(exports, module) {
2454
- "use strict";
2455
- var {
2456
- supportsColor
2457
- } = require_supports_color();
2458
- var {
2459
- Options
2460
- } = require_Options();
2461
- var HEXTEST = RegExp("^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$");
2462
- function Rgb2hsv({
2463
- r,
2464
- g,
2465
- b
2466
- }) {
2467
- r /= 255;
2468
- g /= 255;
2469
- b /= 255;
2470
- const max = Math.max(r, g, b);
2471
- const min = Math.min(r, g, b);
2472
- const diff = max - min;
2473
- let h = 0;
2474
- let v = max;
2475
- let s = max === 0 ? 0 : diff / max;
2476
- if (max === min) {
2477
- h = 0;
2478
- } else if (max === r && g >= b) {
2479
- h = 60 * ((g - b) / diff);
2480
- } else if (max === r && g < b) {
2481
- h = 60 * ((g - b) / diff) + 360;
2482
- } else if (max === g) {
2483
- h = 60 * ((b - r) / diff) + 120;
2484
- } else {
2485
- h = 60 * ((r - g) / diff) + 240;
2486
- }
2487
- return [h, s * 100, v * 100];
2488
- }
2489
- function Hsv2rgb(h, s, v) {
2490
- h /= 60;
2491
- s /= 100;
2492
- v /= 100;
2493
- const hi = Math.floor(h) % 6;
2494
- const f = h - Math.floor(h);
2495
- const p = 255 * v * (1 - s);
2496
- const q = 255 * v * (1 - s * f);
2497
- const t = 255 * v * (1 - s * (1 - f));
2498
- v *= 255;
2499
- switch (hi) {
2500
- case 0:
2501
- return {
2502
- r: v,
2503
- g: t,
2504
- b: p
2505
- };
2506
- case 1:
2507
- return {
2508
- r: q,
2509
- g: v,
2510
- b: p
2511
- };
2512
- case 2:
2513
- return {
2514
- r: p,
2515
- g: v,
2516
- b: t
2517
- };
2518
- case 3:
2519
- return {
2520
- r: p,
2521
- g: q,
2522
- b: v
2523
- };
2524
- case 4:
2525
- return {
2526
- r: t,
2527
- g: p,
2528
- b: v
2529
- };
2530
- case 5:
2531
- return {
2532
- r: v,
2533
- g: p,
2534
- b: q
2535
- };
2536
- }
2537
- }
2538
- function Rgb2hex(r, g, b) {
2539
- const val = (b | g << 8 | r << 16 | 1 << 24).toString(16).slice(1);
2540
- return "#" + val.toLowerCase();
2541
- }
2542
- function Hex2rgb(hex2) {
2543
- hex2 = hex2.replace(/^#/, "");
2544
- if (hex2.length > 6) {
2545
- hex2 = hex2.slice(0, 6);
2546
- }
2547
- if (hex2.length === 4) {
2548
- hex2 = hex2.slice(0, 3);
2549
- }
2550
- if (hex2.length === 3) {
2551
- hex2 = hex2[0] + hex2[0] + hex2[1] + hex2[1] + hex2[2] + hex2[2];
2552
- }
2553
- const num = parseInt(hex2, 16);
2554
- const r = num >> 16;
2555
- const g = num >> 8 & 255;
2556
- const b = num & 255;
2557
- const rgb = [r, g, b];
2558
- return rgb;
2559
- }
2560
- function Hsv2hsvRad([h, s, v]) {
2561
- return [h * Math.PI / 180, s, v];
2562
- }
2563
- function HsvRad2hsv(hRad, s, v) {
2564
- const precision = 1e12;
2565
- const h = Math.round(hRad * 180 / Math.PI * precision) / precision;
2566
- return [h, s, v];
2567
- }
2568
- function Hex2hsvRad(hex2) {
2569
- const [r, g, b] = Hex2rgb(hex2);
2570
- const hsv = Rgb2hsv({
2571
- r,
2572
- g,
2573
- b
2574
- });
2575
- const hsvRad = Hsv2hsvRad(hsv);
2576
- return hsvRad;
2577
- }
2578
- function HsvRad2hex(hRad, s, v) {
2579
- const [h] = HsvRad2hsv(hRad, s, v);
2580
- const {
2581
- r,
2582
- g,
2583
- b
2584
- } = Hsv2rgb(h, s, v);
2585
- const hex2 = Rgb2hex(r, g, b);
2586
- return hex2;
2587
- }
2588
- function rgb2ansi_16m(r, g, b, bg = false) {
2589
- const layer_code = bg ? 48 : 38;
2590
- return `\x1B[${layer_code};2;${r};${g};${b}m`;
2591
- }
2592
- function rgb2ansi256Code(red, green, blue) {
2593
- if (red === green && green === blue) {
2594
- if (red < 8) {
2595
- return 16;
2596
- }
2597
- if (red > 248) {
2598
- return 231;
2599
- }
2600
- return Math.round((red - 8) / 247 * 24) + 232;
2601
- }
2602
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
2603
- }
2604
- function rgb2ansi_256(r, g, b, bg = false) {
2605
- const layer_code = bg ? 48 : 38;
2606
- const code = rgb2ansi256Code(r, g, b);
2607
- return `\x1B[${layer_code};5;${code}m`;
2608
- }
2609
- function ansi_2562ansi_16(code, bg = false) {
2610
- let ansi_16_code;
2611
- if (code <= 7) {
2612
- ansi_16_code = code + 10;
2613
- }
2614
- if (code >= 8 && code <= 15) {
2615
- ansi_16_code = code + 82;
2616
- }
2617
- if (code === 16) {
2618
- ansi_16_code = 0;
2619
- }
2620
- if (code >= 17 && code <= 19) {
2621
- ansi_16_code = 34;
2622
- }
2623
- if (code >= 20 && code <= 21 || code >= 25 && code <= 27) {
2624
- ansi_16_code = 94;
2625
- }
2626
- if (code >= 22 && code <= 24 || code >= 58 && code <= 60 || code >= 64 && code <= 66 || code >= 94 && code <= 95 || code >= 100 && code <= 102 || code >= 106 && code <= 108 || code >= 130 && code <= 131 || code >= 136 && code <= 138 || code >= 142 && code <= 144 || code >= 148 && code <= 151 || code >= 172 && code <= 174 || code >= 178 && code <= 181 || code >= 184 && code <= 189) {
2627
- ansi_16_code = 33;
2628
- }
2629
- if (code >= 28 && code <= 30 || code >= 34 && code <= 36 || code >= 70 && code <= 72 || code >= 76 && code <= 79 || code >= 112 && code <= 114) {
2630
- ansi_16_code = 32;
2631
- }
2632
- if (code >= 31 && code <= 33 || code >= 37 && code <= 39 || code >= 44 && code <= 45 || code >= 61 && code <= 63 || code >= 67 && code <= 69 || code >= 73 && code <= 75 || code >= 80 && code <= 81 || code >= 103 && code <= 111 || code >= 115 && code <= 117 || code >= 152 && code <= 153) {
2633
- ansi_16_code = 36;
2634
- }
2635
- if (code >= 40 && code <= 43 || code >= 46 && code <= 49 || code >= 82 && code <= 85 || code >= 118 && code <= 120 || code >= 154 && code <= 157) {
2636
- ansi_16_code = 92;
2637
- }
2638
- if (code >= 50 && code <= 51 || code >= 86 && code <= 87 || code >= 121 && code <= 123 || code >= 158 && code <= 159) {
2639
- ansi_16_code = 96;
2640
- }
2641
- if (code >= 52 && code <= 54 || code >= 88 && code <= 90 || code >= 124 && code <= 126 || code >= 166 && code <= 168) {
2642
- ansi_16_code = 31;
2643
- }
2644
- if (code >= 55 && code <= 57 || code >= 91 && code <= 93 || code >= 96 && code <= 99 || code >= 127 && code <= 129 || code >= 132 && code <= 135 || code >= 139 && code <= 141 || code >= 145 && code <= 147 || code >= 169 && code <= 171 || code >= 175 && code <= 177) {
2645
- ansi_16_code = 35;
2646
- }
2647
- if (code >= 160 && code <= 163 || code >= 196 && code <= 199 || code >= 202 && code <= 213) {
2648
- ansi_16_code = 91;
2649
- }
2650
- if (code >= 164 && code <= 165 || code >= 182 && code <= 183 || code >= 200 && code <= 201 || code >= 218 && code <= 219) {
2651
- ansi_16_code = 95;
2652
- }
2653
- if (code >= 190 && code <= 193 || code >= 214 && code <= 217 || code >= 220 && code <= 228) {
2654
- ansi_16_code = 93;
2655
- }
2656
- if (code >= 194 && code <= 195 || code >= 229 && code <= 231 || code >= 253 && code <= 255) {
2657
- ansi_16_code = 97;
2658
- }
2659
- if (code >= 232 && code <= 239) {
2660
- ansi_16_code = 30;
2661
- }
2662
- if (code >= 240 && code <= 246) {
2663
- ansi_16_code = 90;
2664
- }
2665
- if (code >= 247 && code <= 252) {
2666
- ansi_16_code = 37;
2667
- }
2668
- if (bg) {
2669
- ansi_16_code = ansi_16_code + 10;
2670
- }
2671
- return `\x1B[${ansi_16_code}m`;
2672
- }
2673
- function get_term_color_support() {
2674
- let term_support = supportsColor().level || 3;
2675
- if ("NO_COLOR" in process.env) {
2676
- term_support = 0;
2677
- }
2678
- if (process.env["FORCE_COLOR"] === "0") {
2679
- term_support = 0;
2680
- }
2681
- if (process.env["FORCE_COLOR"] === "1") {
2682
- term_support = 1;
2683
- }
2684
- if (process.env["FORCE_COLOR"] === "2") {
2685
- term_support = 2;
2686
- }
2687
- if (process.env["FORCE_COLOR"] === "3") {
2688
- term_support = 3;
2689
- }
2690
- return term_support;
2691
- }
2692
- var Color = (color, bg = false) => {
2693
- const COLORS = {
2694
- black: "#000",
2695
- red: "#ea3223",
2696
- green: "#377d22",
2697
- yellow: "#fffd54",
2698
- blue: "#0020f5",
2699
- magenta: "#ea3df7",
2700
- cyan: "#74fbfd",
2701
- white: "#fff",
2702
- gray: "#808080",
2703
- redbright: "#ee776d",
2704
- greenbright: "#8cf57b",
2705
- yellowbright: "#fffb7f",
2706
- bluebright: "#6974f6",
2707
- magentabright: "#ee82f8",
2708
- cyanbright: "#8dfafd",
2709
- whitebright: "#fff"
2710
- };
2711
- const support = get_term_color_support();
2712
- if (color === "system" || support === 0) {
2713
- return {
2714
- open: "",
2715
- close: ""
2716
- };
2717
- }
2718
- const OPTIONS = Options.get;
2719
- if (OPTIONS.env === "node") {
2720
- let open;
2721
- let close = bg ? "\x1B[49m" : "\x1B[39m";
2722
- switch (color.toLowerCase()) {
2723
- case "transparent":
2724
- open = "\x1B[49m";
2725
- break;
2726
- case "black":
2727
- open = bg ? "\x1B[40m" : "\x1B[30m";
2728
- break;
2729
- case "red":
2730
- open = bg ? "\x1B[41m" : "\x1B[31m";
2731
- break;
2732
- case "green":
2733
- open = bg ? "\x1B[42m" : "\x1B[32m";
2734
- break;
2735
- case "yellow":
2736
- open = bg ? "\x1B[43m" : "\x1B[33m";
2737
- break;
2738
- case "blue":
2739
- open = bg ? "\x1B[44m" : "\x1B[34m";
2740
- break;
2741
- case "magenta":
2742
- open = bg ? "\x1B[45m" : "\x1B[35m";
2743
- break;
2744
- case "cyan":
2745
- open = bg ? "\x1B[46m" : "\x1B[36m";
2746
- break;
2747
- case "white":
2748
- open = bg ? "\x1B[47m" : "\x1B[37m";
2749
- break;
2750
- case "gray":
2751
- open = bg ? "\x1B[100m" : "\x1B[90m";
2752
- break;
2753
- case "redbright":
2754
- open = bg ? "\x1B[101m" : "\x1B[91m";
2755
- break;
2756
- case "greenbright":
2757
- open = bg ? "\x1B[102m" : "\x1B[92m";
2758
- break;
2759
- case "yellowbright":
2760
- open = bg ? "\x1B[103m" : "\x1B[93m";
2761
- break;
2762
- case "bluebright":
2763
- open = bg ? "\x1B[104m" : "\x1B[94m";
2764
- break;
2765
- case "magentabright":
2766
- open = bg ? "\x1B[105m" : "\x1B[95m";
2767
- break;
2768
- case "cyanbright":
2769
- open = bg ? "\x1B[106m" : "\x1B[96m";
2770
- break;
2771
- case "whitebright":
2772
- open = bg ? "\x1B[107m" : "\x1B[97m";
2773
- break;
2774
- case "candy":
2775
- open = ["\x1B[31m", "\x1B[32m", "\x1B[33m", "\x1B[35m", "\x1B[36m", "\x1B[91m", "\x1B[92m", "\x1B[93m", "\x1B[94m", "\x1B[95m", "\x1B[96m"][Math.floor(Math.random() * 11)];
2776
- break;
2777
- default: {
2778
- let hex2 = color;
2779
- if (!HEXTEST.test(color)) {
2780
- return {
2781
- open: "",
2782
- close: ""
2783
- };
2784
- }
2785
- const rgb = Hex2rgb(hex2);
2786
- if (support === 1) {
2787
- open = ansi_2562ansi_16(rgb2ansi256Code(rgb[0], rgb[1], rgb[2]), bg);
2788
- }
2789
- if (support === 2) {
2790
- open = rgb2ansi_256(rgb[0], rgb[1], rgb[2], bg);
2791
- }
2792
- if (support === 3) {
2793
- open = rgb2ansi_16m(rgb[0], rgb[1], rgb[2], bg);
2794
- }
2795
- }
2796
- }
2797
- return {
2798
- open,
2799
- close
2800
- };
2801
- } else if (!OPTIONS.env) {
2802
- return {
2803
- open: "",
2804
- close: ""
2805
- };
2806
- } else {
2807
- if (!HEXTEST.test(color)) {
2808
- color = COLORS[color.toLowerCase()];
2809
- if (!color) {
2810
- return {
2811
- open: "",
2812
- close: ""
2813
- };
2814
- }
2815
- }
2816
- if (bg) {
2817
- return {
2818
- open: color,
2819
- close: ""
2820
- };
2821
- }
2822
- return {
2823
- open: `<span style="color:${color}">`,
2824
- close: "</span>"
2825
- };
2826
- }
2827
- };
2828
- module.exports = exports = {
2829
- HEXTEST,
2830
- Rgb2hsv,
2831
- Hsv2rgb,
2832
- Rgb2hex,
2833
- Hex2rgb,
2834
- Hsv2hsvRad,
2835
- HsvRad2hsv,
2836
- Hex2hsvRad,
2837
- HsvRad2hex,
2838
- rgb2ansi_16m,
2839
- rgb2ansi256Code,
2840
- rgb2ansi_256,
2841
- ansi_2562ansi_16,
2842
- get_term_color_support,
2843
- Color
2844
- };
2845
- }
2846
- });
2847
-
2848
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Debugging.js
2849
- var require_Debugging = __commonJS({
2850
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Debugging.js"(exports, module) {
2851
- "use strict";
2852
- var {
2853
- Color
2854
- } = require_Color();
2855
- var DEBUG = {
2856
- store: {
2857
- enabled: false,
2858
- level: 2
2859
- },
2860
- set enabled(value) {
2861
- this.store.enabled = value;
2862
- },
2863
- get enabled() {
2864
- return this.store.enabled;
2865
- },
2866
- set level(value) {
2867
- this.store.level = value;
2868
- },
2869
- get level() {
2870
- return this.store.level;
2871
- }
2872
- };
2873
- var Debugging = {
2874
- /**
2875
- * Return a headline preferably at the beginning of your app
2876
- *
2877
- * @param {string} text - The sting you want to log
2878
- * @param {number} level - The debug level. Show equal and greater levels. Default: 99
2879
- * @param {boolean} debug - Global debug mode on/off
2880
- * @param {number} debuglevel - Global debug level
2881
- */
2882
- headline: (text, level = 99, debug = DEBUG.enabled, debuglevel = DEBUG.level) => {
2883
- if (debug && level >= debuglevel) {
2884
- const {
2885
- open,
2886
- close
2887
- } = Color("black", true);
2888
- console.log(`${open}
2889
- \x1B[1m \u2611 \x1B[22m ${text}${close}`);
2890
- }
2891
- },
2892
- /**
2893
- * Return a message to report starting a process
2894
- *
2895
- * @param {string} text - The sting you want to log
2896
- * @param {number} level - The debug level. Show equal and greater levels. Default: 99
2897
- * @param {boolean} debug - Global debug mode on/off
2898
- * @param {number} debuglevel - Global debug level
2899
- */
2900
- report: (text, level = 99, debug = DEBUG.enabled, debuglevel = DEBUG.level) => {
2901
- if (debug && level >= debuglevel) {
2902
- const {
2903
- open: blackbg_open,
2904
- close: blackbg_close
2905
- } = Color("black", true);
2906
- const {
2907
- open: green_open,
2908
- close: green_close
2909
- } = Color("green");
2910
- const {
2911
- open: white_open,
2912
- close: white_close
2913
- } = Color("white");
2914
- console.log(`${blackbg_open}
2915
- \x1B[1m${green_open} \u2611 ${green_close}\x1B[22m ${white_open}${text}${white_close}${blackbg_close}`);
2916
- }
2917
- },
2918
- /**
2919
- * Return a message to report an error
2920
- *
2921
- * @param {string} text - The sting you want to log
2922
- * @param {number} level - The debug level. Show equal and greater levels. Default: 99
2923
- * @param {boolean} debug - Global debug mode on/off
2924
- * @param {number} debuglevel - Global debug level
2925
- */
2926
- error: (text, level = 99, debug = DEBUG.enabled, debuglevel = DEBUG.level) => {
2927
- if (debug && level >= debuglevel) {
2928
- const {
2929
- open: blackbg_open,
2930
- close: blackbg_close
2931
- } = Color("black", true);
2932
- const {
2933
- open: red_open,
2934
- close: red_close
2935
- } = Color("red");
2936
- const {
2937
- open: white_open,
2938
- close: white_close
2939
- } = Color("white");
2940
- console.error(`${blackbg_open}
2941
- ${red_open} \u2612 ${red_close} ${white_open}${text}${white_close}${blackbg_close}`);
2942
- }
2943
- }
2944
- };
2945
- module.exports = exports = {
2946
- DEBUG,
2947
- Debugging
2948
- };
2949
- }
2950
- });
2951
-
2952
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Colorize.js
2953
- var require_Colorize = __commonJS({
2954
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Colorize.js"(exports, module) {
2955
- "use strict";
2956
- var {
2957
- Debugging
2958
- } = require_Debugging();
2959
- var {
2960
- Color
2961
- } = require_Color();
2962
- var Colorize = (character, fontColors, optionColors) => {
2963
- Debugging.report(`Running Colorize`, 1);
2964
- if (character !== void 0) {
2965
- if (fontColors > 1) {
2966
- for (let i = 0; i < fontColors; i++) {
2967
- const color = optionColors[i] || "system";
2968
- const {
2969
- open: openNew,
2970
- close: closeNew
2971
- } = Color(color);
2972
- const open = new RegExp(`<c${i + 1}>`, "g");
2973
- const close = new RegExp(`</c${i + 1}>`, "g");
2974
- character = character.replace(open, openNew);
2975
- character = character.replace(close, closeNew);
2976
- }
2977
- }
2978
- if (fontColors === 1) {
2979
- const color = optionColors[0] || "system";
2980
- const {
2981
- open: openNew,
2982
- close: closeNew
2983
- } = Color(color);
2984
- character = openNew + character + closeNew;
2985
- }
2986
- }
2987
- return character;
2988
- };
2989
- module.exports = exports = {
2990
- Colorize
2991
- };
2992
- }
2993
- });
2994
-
2995
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddLetterSpacing.js
2996
- var require_AddLetterSpacing = __commonJS({
2997
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddLetterSpacing.js"(exports, module) {
2998
- "use strict";
2999
- var {
3000
- Debugging
3001
- } = require_Debugging();
3002
- var {
3003
- Colorize
3004
- } = require_Colorize();
3005
- var AddLetterSpacing = (output, fontLines, fontLetterspace, fontColors, colors2, letterSpacing) => {
3006
- Debugging.report(`Running AddLetterSpacing`, 1);
3007
- let lines = output.length - fontLines;
3008
- for (let i = lines; i < output.length; i++) {
3009
- let index = i - lines;
3010
- let space = Colorize(fontLetterspace[index], fontColors, colors2);
3011
- if (space.length === 0 && letterSpacing > 0) {
3012
- Debugging.report(`AddLetterSpacing: Adding space to letter spacing`, 1);
3013
- space = " ";
3014
- }
3015
- output[i] += space.repeat(letterSpacing);
3016
- }
3017
- return output;
3018
- };
3019
- module.exports = exports = {
3020
- AddLetterSpacing
3021
- };
3022
- }
3023
- });
3024
-
3025
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/GetFirstCharacterPosition.js
3026
- var require_GetFirstCharacterPosition = __commonJS({
3027
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/GetFirstCharacterPosition.js"(exports, module) {
3028
- "use strict";
3029
- function GetFirstCharacterPosition(lines) {
3030
- const earliest = lines.reduce((prevLine, line) => line.length - line.trimStart().length < prevLine.length - prevLine.trimStart().length && line !== "" ? line : prevLine, lines[0]);
3031
- return earliest.length - earliest.trimStart().length;
3032
- }
3033
- module.exports = exports = {
3034
- GetFirstCharacterPosition
3035
- };
3036
- }
3037
- });
3038
-
3039
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/GetLongestLine.js
3040
- var require_GetLongestLine = __commonJS({
3041
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/GetLongestLine.js"(exports, module) {
3042
- "use strict";
3043
- var GetLongestLine = (lines) => lines.reduce((longestLine, line) => line.length > longestLine.length && line.length !== 0 ? line : longestLine, "");
3044
- module.exports = exports = {
3045
- GetLongestLine
3046
- };
3047
- }
3048
- });
3049
-
3050
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Gradient.js
3051
- var require_Gradient = __commonJS({
3052
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Gradient.js"(exports, module) {
3053
- "use strict";
3054
- var {
3055
- GetFirstCharacterPosition
3056
- } = require_GetFirstCharacterPosition();
3057
- var {
3058
- Color,
3059
- Hex2rgb,
3060
- Hex2hsvRad,
3061
- HsvRad2hex,
3062
- Rgb2hex
3063
- } = require_Color();
3064
- var {
3065
- GetLongestLine
3066
- } = require_GetLongestLine();
3067
- var {
3068
- GRADIENTS
3069
- } = require_constants();
3070
- var {
3071
- Debugging
3072
- } = require_Debugging();
3073
- function GetLinear(pointA, pointB, n, steps) {
3074
- if (steps === 0) {
3075
- return pointB;
3076
- }
3077
- return pointA + n * ((pointB - pointA) / steps);
3078
- }
3079
- function GetTheta(fromTheta, toTheta, n, steps) {
3080
- const TAU = 2 * Math.PI;
3081
- let longDistance;
3082
- if (steps === 0) {
3083
- return toTheta;
3084
- }
3085
- if (fromTheta > toTheta) {
3086
- if (fromTheta - toTheta < Math.PI) {
3087
- longDistance = TAU - (fromTheta - toTheta);
3088
- } else {
3089
- longDistance = toTheta - fromTheta;
3090
- }
3091
- } else {
3092
- if (toTheta - fromTheta < Math.PI) {
3093
- longDistance = toTheta - fromTheta - TAU;
3094
- } else {
3095
- longDistance = -1 * (fromTheta - toTheta);
3096
- }
3097
- }
3098
- let result = fromTheta + n * (longDistance / steps);
3099
- if (result < 0) {
3100
- result += TAU;
3101
- }
3102
- if (result > TAU) {
3103
- result -= TAU;
3104
- }
3105
- return result;
3106
- }
3107
- function GetGradientColors(fromColor, toColor, steps) {
3108
- const [fromHRad, fromS, fromV] = Hex2hsvRad(fromColor);
3109
- const [toHRad, toS, toV] = Hex2hsvRad(toColor);
3110
- const hexColors = [];
3111
- for (let n = 0; n < steps; n++) {
3112
- const hRad = GetTheta(fromHRad, toHRad, n, steps - 1);
3113
- const s = GetLinear(fromS, toS, n, steps - 1);
3114
- const v = GetLinear(fromV, toV, n, steps - 1);
3115
- hexColors.push(HsvRad2hex(hRad, s, v));
3116
- }
3117
- return hexColors;
3118
- }
3119
- function PaintLines(lines, colors2, firstCharacterPosition) {
3120
- Debugging.report(`Running PaintLines`, 1);
3121
- Debugging.report(colors2, 2);
3122
- const space = " ".repeat(firstCharacterPosition);
3123
- return lines.map((line) => {
3124
- const coloredLine = line.slice(firstCharacterPosition).split("").map((char, i) => {
3125
- const {
3126
- open,
3127
- close
3128
- } = Color(colors2[i]);
3129
- return `${open}${char}${close}`;
3130
- }).join("");
3131
- return `${space}${coloredLine}`;
3132
- });
3133
- }
3134
- function Color2hex(color) {
3135
- const colorMap = {
3136
- black: "#000000",
3137
- red: "#ff0000",
3138
- green: "#00ff00",
3139
- yellow: "#ffff00",
3140
- blue: "#0000ff",
3141
- magenta: "#ff00ff",
3142
- cyan: "#00ffff",
3143
- white: "#ffffff",
3144
- gray: "#808080",
3145
- grey: "#808080"
3146
- };
3147
- return colorMap[color] || color;
3148
- }
3149
- function GetGaps(points, steps) {
3150
- const gapSteps = Math.floor((steps - points.length) / (points.length - 1));
3151
- const rest = steps - (points.length + gapSteps * (points.length - 1));
3152
- const gaps = Array(points.length - 1).fill(gapSteps);
3153
- for (let i = 0; i < rest; i++) {
3154
- gaps[gaps.length - 1 - i]++;
3155
- }
3156
- return gaps;
3157
- }
3158
- function TransitionBetweenHex(fromHex, toHex, steps) {
3159
- const fromRgb = Hex2rgb(fromHex);
3160
- const toRgb = Hex2rgb(toHex);
3161
- const hexColors = [];
3162
- steps++;
3163
- for (let n = 1; n < steps; n++) {
3164
- const red = GetLinear(fromRgb[0], toRgb[0], n, steps);
3165
- const green = GetLinear(fromRgb[1], toRgb[1], n, steps);
3166
- const blue = GetLinear(fromRgb[2], toRgb[2], n, steps);
3167
- hexColors.push(Rgb2hex(red, green, blue));
3168
- }
3169
- return hexColors;
3170
- }
3171
- function Transition(colors2, steps, gradients = GRADIENTS) {
3172
- let hexColors = [];
3173
- if (colors2.length === 1) {
3174
- colors2 = gradients[colors2[0].toLowerCase()];
3175
- } else {
3176
- colors2 = colors2.map((color) => Color2hex(color));
3177
- }
3178
- const gaps = GetGaps(colors2, steps);
3179
- if (steps <= 1) {
3180
- return [colors2[colors2.length - 1]];
3181
- }
3182
- for (let i = 0; i < colors2.length; i++) {
3183
- const gap = gaps[i - 1];
3184
- if (colors2[i - 1]) {
3185
- const gapColors = TransitionBetweenHex(colors2[i - 1], colors2[i], gap);
3186
- hexColors = [...hexColors, ...gapColors];
3187
- }
3188
- if (gap !== -1) {
3189
- hexColors.push(colors2[i]);
3190
- }
3191
- }
3192
- return hexColors;
3193
- }
3194
- function PaintGradient({
3195
- output,
3196
- gradient,
3197
- lines,
3198
- lineHeight,
3199
- fontLines,
3200
- independentGradient,
3201
- transitionGradient
3202
- }) {
3203
- Debugging.report(`Running PaintGradient`, 1);
3204
- let newOutput = [];
3205
- if (transitionGradient) {
3206
- Debugging.report(`Gradient transition with colors: ${JSON.stringify(gradient)}`, 2);
3207
- } else {
3208
- Debugging.report(`Gradient start: ${gradient[0]} | Gradient end: ${gradient[1]}`, 2);
3209
- }
3210
- let firstCharacterPosition = GetFirstCharacterPosition(output);
3211
- let longestLine = GetLongestLine(output).length;
3212
- for (let i = 0; i < lines; i++) {
3213
- const start = i * (fontLines + lineHeight);
3214
- const end = fontLines + start;
3215
- const thisLine = output.slice(start, end);
3216
- if (independentGradient) {
3217
- firstCharacterPosition = GetFirstCharacterPosition(thisLine);
3218
- longestLine = GetLongestLine(thisLine).length;
3219
- }
3220
- const colorsNeeded = longestLine - firstCharacterPosition;
3221
- const linesInbetween = i === 0 ? [] : Array(lineHeight).fill("");
3222
- Debugging.report(`longestLine: ${longestLine} | firstCharacterPosition: ${firstCharacterPosition}`, 2);
3223
- const colors2 = transitionGradient ? Transition(gradient, colorsNeeded) : GetGradientColors(Color2hex(gradient[0]), Color2hex(gradient[1]), colorsNeeded);
3224
- newOutput = [...newOutput, ...linesInbetween, ...PaintLines(thisLine, colors2, firstCharacterPosition)];
3225
- }
3226
- return newOutput;
3227
- }
3228
- module.exports = exports = {
3229
- GetLinear,
3230
- GetTheta,
3231
- GetGradientColors,
3232
- PaintLines,
3233
- Color2hex,
3234
- GetGaps,
3235
- TransitionBetweenHex,
3236
- Transition,
3237
- PaintGradient
3238
- };
3239
- }
3240
- });
3241
-
3242
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/CharLength.js
3243
- var require_CharLength = __commonJS({
3244
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/CharLength.js"(exports, module) {
3245
- "use strict";
3246
- var {
3247
- Debugging
3248
- } = require_Debugging();
3249
- var CharLength = (character, fontLines, letterSpacing) => {
3250
- Debugging.report(`Running CharLength`, 1);
3251
- let charWidth = 0;
3252
- for (let i = 0; i < fontLines; i++) {
3253
- let char = character[i].replace(/(<([^>]+)>)/gi, "");
3254
- if (char.length > charWidth) {
3255
- charWidth = char.length;
3256
- }
3257
- }
3258
- if (charWidth === 0 && letterSpacing > 0) {
3259
- Debugging.report(`CharLength: Adding space to letter spacing`, 1);
3260
- charWidth = 1;
3261
- }
3262
- return charWidth;
3263
- };
3264
- module.exports = exports = {
3265
- CharLength
3266
- };
3267
- }
3268
- });
3269
-
3270
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/CheckInput.js
3271
- var require_CheckInput = __commonJS({
3272
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/CheckInput.js"(exports, module) {
3273
- "use strict";
3274
- var {
3275
- HEXTEST,
3276
- Color
3277
- } = require_Color();
3278
- var {
3279
- COLORS,
3280
- BGCOLORS,
3281
- GRADIENTCOLORS,
3282
- GRADIENTS,
3283
- ALIGNMENT,
3284
- FONTFACES
3285
- } = require_constants();
3286
- var CheckInput = (INPUT, userFont, userColors, userBackground, userAlign, userGradient, userTransitionGradient, userEnv, fontfaces = FONTFACES, colors2 = COLORS, bgcolors = BGCOLORS, gradientcolors = GRADIENTCOLORS, gradients = GRADIENTS, alignment = ALIGNMENT) => {
3287
- let result = {
3288
- message: "",
3289
- pass: true
3290
- };
3291
- const {
3292
- open: red_open,
3293
- close: red_close
3294
- } = Color("red");
3295
- const {
3296
- open: green_open,
3297
- close: green_close
3298
- } = Color("green");
3299
- if (INPUT === void 0 || INPUT === "") {
3300
- return {
3301
- message: "Please provide text to convert",
3302
- pass: false
3303
- };
3304
- }
3305
- if (Object.keys(fontfaces).indexOf(userFont.toLowerCase()) === -1) {
3306
- return {
3307
- message: `"${red_open}${userFont}${red_close}" is not a valid font option.
3308
- Please use a font from the supported stack:
3309
- ${green_open}${Object.keys(fontfaces).map((font) => fontfaces[font]).join(", ")}${green_close}`,
3310
- pass: false
3311
- };
3312
- }
3313
- userColors.forEach((color) => {
3314
- if (Object.keys(colors2).indexOf(color.toLowerCase()) === -1 && color !== "candy" && !HEXTEST.test(color)) {
3315
- result = {
3316
- message: `"${red_open}${color}${red_close}" is not a valid font color option.
3317
- Please use a color from the supported stack or any valid hex color:
3318
- ${green_open}${Object.keys(colors2).map((color2) => colors2[color2]).join(", ")}, candy, "#3456ff", "#f80", etc...${green_close}`,
3319
- pass: false
3320
- };
3321
- }
3322
- });
3323
- if (Object.keys(bgcolors).indexOf(userBackground.toLowerCase()) === -1 && !HEXTEST.test(userBackground)) {
3324
- return {
3325
- message: `"${red_open}${userBackground}${red_close}" is not a valid background option.
3326
- Please use a color from the supported stack:
3327
- ${green_open}${Object.keys(bgcolors).map((bgcolor) => bgcolors[bgcolor]).join(", ")}, "#3456ff", "#f80", etc...${green_close}`,
3328
- pass: false
3329
- };
3330
- }
3331
- if (alignment.indexOf(userAlign.toLowerCase()) === -1) {
3332
- return {
3333
- message: `"${red_open}${userAlign}${red_close}" is not a valid alignment option.
3334
- Please use an alignment option from the supported stack:
3335
- ${green_open}${alignment.join(" | ")}${green_close}`,
3336
- pass: false
3337
- };
3338
- }
3339
- if (userGradient) {
3340
- if (userGradient.length === 1 && Object.keys(gradients).indexOf(userGradient[0].toLowerCase()) !== -1 && userTransitionGradient) {
3341
- return result;
3342
- } else {
3343
- if (userGradient.length < 2) {
3344
- return {
3345
- message: `"${red_open}${userGradient}${red_close}" is not a valid gradient option.
3346
- Please pass in${userTransitionGradient ? " at least" : ""} two colors.`,
3347
- pass: false
3348
- };
3349
- }
3350
- if (userGradient.length !== 2 && !userTransitionGradient) {
3351
- return {
3352
- message: `"${red_open}${userGradient}${red_close}" is not a valid gradient option.
3353
- Please pass in two colors.`,
3354
- pass: false
3355
- };
3356
- }
3357
- userGradient.forEach((color) => {
3358
- if (Object.keys(gradientcolors).indexOf(color.toLowerCase()) === -1 && !HEXTEST.test(color)) {
3359
- result = {
3360
- message: `"${red_open}${color}${red_close}" is not a valid gradient color option.
3361
- Please use a color from the supported stack or any valid hex color:
3362
- ${green_open}${Object.keys(gradientcolors).map((color2) => colors2[color2]).join(", ")}, "#3456ff", "#f80", etc...${green_close}`,
3363
- pass: false
3364
- };
3365
- }
3366
- });
3367
- }
3368
- }
3369
- if (userEnv !== "node" && userEnv !== "browser") {
3370
- return {
3371
- message: `"${red_open}${userEnv}${red_close}" is not a valid environment option.
3372
- Please use only the supported options:
3373
- ${green_open}node | browser${green_close}`,
3374
- pass: false
3375
- };
3376
- }
3377
- return result;
3378
- };
3379
- module.exports = exports = {
3380
- CheckInput
3381
- };
3382
- }
3383
- });
3384
-
3385
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/CleanInput.js
3386
- var require_CleanInput = __commonJS({
3387
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/CleanInput.js"(exports, module) {
3388
- "use strict";
3389
- var {
3390
- CHARS
3391
- } = require_constants();
3392
- var CleanInput = (INPUT, chars = CHARS) => {
3393
- if (typeof INPUT === "string") {
3394
- const clean = INPUT.replace(/(?:\r\n|\r|\n)/g, "|").split("").filter((char) => chars.includes(char.toUpperCase())).join("");
3395
- return clean;
3396
- } else {
3397
- return "";
3398
- }
3399
- };
3400
- module.exports = exports = {
3401
- CleanInput
3402
- };
3403
- }
3404
- });
3405
-
3406
- // ../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js
3407
- var require_implementation = __commonJS({
3408
- "../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports, module) {
3409
- "use strict";
3410
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3411
- var toStr = Object.prototype.toString;
3412
- var max = Math.max;
3413
- var funcType = "[object Function]";
3414
- var concatty = function concatty2(a, b) {
3415
- var arr = [];
3416
- for (var i = 0; i < a.length; i += 1) {
3417
- arr[i] = a[i];
3418
- }
3419
- for (var j = 0; j < b.length; j += 1) {
3420
- arr[j + a.length] = b[j];
3421
- }
3422
- return arr;
3423
- };
3424
- var slicy = function slicy2(arrLike, offset) {
3425
- var arr = [];
3426
- for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
3427
- arr[j] = arrLike[i];
3428
- }
3429
- return arr;
3430
- };
3431
- var joiny = function(arr, joiner) {
3432
- var str = "";
3433
- for (var i = 0; i < arr.length; i += 1) {
3434
- str += arr[i];
3435
- if (i + 1 < arr.length) {
3436
- str += joiner;
3437
- }
3438
- }
3439
- return str;
3440
- };
3441
- module.exports = function bind(that) {
3442
- var target = this;
3443
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
3444
- throw new TypeError(ERROR_MESSAGE + target);
3445
- }
3446
- var args2 = slicy(arguments, 1);
3447
- var bound;
3448
- var binder = function() {
3449
- if (this instanceof bound) {
3450
- var result = target.apply(
3451
- this,
3452
- concatty(args2, arguments)
3453
- );
3454
- if (Object(result) === result) {
3455
- return result;
3456
- }
3457
- return this;
3458
- }
3459
- return target.apply(
3460
- that,
3461
- concatty(args2, arguments)
3462
- );
3463
- };
3464
- var boundLength = max(0, target.length - args2.length);
3465
- var boundArgs = [];
3466
- for (var i = 0; i < boundLength; i++) {
3467
- boundArgs[i] = "$" + i;
3468
- }
3469
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3470
- if (target.prototype) {
3471
- var Empty = function Empty2() {
3472
- };
3473
- Empty.prototype = target.prototype;
3474
- bound.prototype = new Empty();
3475
- Empty.prototype = null;
3476
- }
3477
- return bound;
3478
- };
3479
- }
3480
- });
3481
-
3482
- // ../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js
3483
- var require_function_bind = __commonJS({
3484
- "../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports, module) {
3485
- "use strict";
3486
- var implementation = require_implementation();
3487
- module.exports = Function.prototype.bind || implementation;
3488
- }
3489
- });
3490
-
3491
- // ../../node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js
3492
- var require_hasown = __commonJS({
3493
- "../../node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js"(exports, module) {
3494
- "use strict";
3495
- var call = Function.prototype.call;
3496
- var $hasOwn = Object.prototype.hasOwnProperty;
3497
- var bind = require_function_bind();
3498
- module.exports = bind.call(call, $hasOwn);
3499
- }
3500
- });
3501
-
3502
- // ../../node_modules/.pnpm/is-accessor-descriptor@1.0.2/node_modules/is-accessor-descriptor/index.js
3503
- var require_is_accessor_descriptor = __commonJS({
3504
- "../../node_modules/.pnpm/is-accessor-descriptor@1.0.2/node_modules/is-accessor-descriptor/index.js"(exports, module) {
3505
- "use strict";
3506
- var hasOwn = require_hasown();
3507
- var accessor = {
3508
- __proto__: null,
3509
- configurable: "boolean",
3510
- enumerable: "boolean",
3511
- get: "function",
3512
- set: "function"
3513
- };
3514
- module.exports = function isAccessorDescriptor(obj, prop) {
3515
- if (typeof prop === "string") {
3516
- var val = Object.getOwnPropertyDescriptor(obj, prop);
3517
- return typeof val !== "undefined";
3518
- }
3519
- if (!obj || typeof obj !== "object") {
3520
- return false;
3521
- }
3522
- if (hasOwn(obj, "value") || hasOwn(obj, "writable")) {
3523
- return false;
3524
- }
3525
- if ((!hasOwn(obj, "get") || typeof obj.get !== "function") && (!hasOwn(obj, "set") || typeof obj.set !== "function")) {
3526
- return false;
3527
- }
3528
- if (hasOwn(obj, "get") && typeof obj.get !== "function" && typeof obj.get !== "undefined" || hasOwn(obj, "set") && typeof obj.set !== "function" && typeof obj.set !== "undefined") {
3529
- return false;
3530
- }
3531
- for (var key in obj) {
3532
- if (hasOwn(obj, key) && hasOwn(accessor, key) && typeof obj[key] !== accessor[key] && typeof obj[key] !== "undefined") {
3533
- return false;
3534
- }
3535
- }
3536
- return true;
3537
- };
3538
- }
3539
- });
3540
-
3541
- // ../../node_modules/.pnpm/is-data-descriptor@1.0.1/node_modules/is-data-descriptor/index.js
3542
- var require_is_data_descriptor = __commonJS({
3543
- "../../node_modules/.pnpm/is-data-descriptor@1.0.1/node_modules/is-data-descriptor/index.js"(exports, module) {
3544
- "use strict";
3545
- var hasOwn = require_hasown();
3546
- var data = {
3547
- __proto__: null,
3548
- configurable: "boolean",
3549
- enumerable: "boolean",
3550
- writable: "boolean"
3551
- };
3552
- module.exports = function isDataDescriptor(obj, prop) {
3553
- if (!obj || typeof obj !== "object") {
3554
- return false;
3555
- }
3556
- if (typeof prop === "string") {
3557
- var val = Object.getOwnPropertyDescriptor(obj, prop);
3558
- return typeof val !== "undefined";
3559
- }
3560
- if (!("value" in obj) && !("writable" in obj) || "get" in obj || "set" in obj) {
3561
- return false;
3562
- }
3563
- for (var key in obj) {
3564
- if (key !== "value" && hasOwn(obj, key) && hasOwn(data, key) && typeof obj[key] !== data[key] && typeof obj[key] !== "undefined") {
3565
- return false;
3566
- }
3567
- }
3568
- return true;
3569
- };
3570
- }
3571
- });
3572
-
3573
- // ../../node_modules/.pnpm/is-descriptor@1.0.4/node_modules/is-descriptor/index.js
3574
- var require_is_descriptor = __commonJS({
3575
- "../../node_modules/.pnpm/is-descriptor@1.0.4/node_modules/is-descriptor/index.js"(exports, module) {
3576
- "use strict";
3577
- var isAccessor = require_is_accessor_descriptor();
3578
- var isData = require_is_data_descriptor();
3579
- module.exports = function isDescriptor(obj, key) {
3580
- if (!obj || typeof obj !== "object" && typeof obj !== "function") {
3581
- return false;
3582
- }
3583
- try {
3584
- if ("get" in obj || "set" in obj) {
3585
- return isAccessor(obj, key);
3586
- }
3587
- return isData(obj, key);
3588
- } catch (e) {
3589
- return false;
3590
- }
3591
- };
3592
- }
3593
- });
3594
-
3595
- // ../../node_modules/.pnpm/define-property@1.0.0/node_modules/define-property/index.js
3596
- var require_define_property = __commonJS({
3597
- "../../node_modules/.pnpm/define-property@1.0.0/node_modules/define-property/index.js"(exports, module) {
3598
- "use strict";
3599
- var isDescriptor = require_is_descriptor();
3600
- module.exports = function defineProperty(obj, prop, val) {
3601
- if (typeof obj !== "object" && typeof obj !== "function") {
3602
- throw new TypeError("expected an object or function.");
3603
- }
3604
- if (typeof prop !== "string") {
3605
- throw new TypeError("expected `prop` to be a string.");
3606
- }
3607
- if (isDescriptor(val) && ("set" in val || "get" in val)) {
3608
- return Object.defineProperty(obj, prop, val);
3609
- }
3610
- return Object.defineProperty(obj, prop, {
3611
- configurable: true,
3612
- enumerable: false,
3613
- writable: true,
3614
- value: val
3615
- });
3616
- };
3617
- }
3618
- });
3619
-
3620
- // ../../node_modules/.pnpm/is-buffer@1.1.6/node_modules/is-buffer/index.js
3621
- var require_is_buffer = __commonJS({
3622
- "../../node_modules/.pnpm/is-buffer@1.1.6/node_modules/is-buffer/index.js"(exports, module) {
3623
- "use strict";
3624
- module.exports = function(obj) {
3625
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
3626
- };
3627
- function isBuffer(obj) {
3628
- return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
3629
- }
3630
- function isSlowBuffer(obj) {
3631
- return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0));
3632
- }
3633
- }
3634
- });
3635
-
3636
- // ../../node_modules/.pnpm/kind-of@3.2.2/node_modules/kind-of/index.js
3637
- var require_kind_of = __commonJS({
3638
- "../../node_modules/.pnpm/kind-of@3.2.2/node_modules/kind-of/index.js"(exports, module) {
3639
- "use strict";
3640
- var isBuffer = require_is_buffer();
3641
- var toString = Object.prototype.toString;
3642
- module.exports = function kindOf(val) {
3643
- if (typeof val === "undefined") {
3644
- return "undefined";
3645
- }
3646
- if (val === null) {
3647
- return "null";
3648
- }
3649
- if (val === true || val === false || val instanceof Boolean) {
3650
- return "boolean";
3651
- }
3652
- if (typeof val === "string" || val instanceof String) {
3653
- return "string";
3654
- }
3655
- if (typeof val === "number" || val instanceof Number) {
3656
- return "number";
3657
- }
3658
- if (typeof val === "function" || val instanceof Function) {
3659
- return "function";
3660
- }
3661
- if (typeof Array.isArray !== "undefined" && Array.isArray(val)) {
3662
- return "array";
3663
- }
3664
- if (val instanceof RegExp) {
3665
- return "regexp";
3666
- }
3667
- if (val instanceof Date) {
3668
- return "date";
3669
- }
3670
- var type = toString.call(val);
3671
- if (type === "[object RegExp]") {
3672
- return "regexp";
3673
- }
3674
- if (type === "[object Date]") {
3675
- return "date";
3676
- }
3677
- if (type === "[object Arguments]") {
3678
- return "arguments";
3679
- }
3680
- if (type === "[object Error]") {
3681
- return "error";
3682
- }
3683
- if (isBuffer(val)) {
3684
- return "buffer";
3685
- }
3686
- if (type === "[object Set]") {
3687
- return "set";
3688
- }
3689
- if (type === "[object WeakSet]") {
3690
- return "weakset";
3691
- }
3692
- if (type === "[object Map]") {
3693
- return "map";
3694
- }
3695
- if (type === "[object WeakMap]") {
3696
- return "weakmap";
3697
- }
3698
- if (type === "[object Symbol]") {
3699
- return "symbol";
3700
- }
3701
- if (type === "[object Int8Array]") {
3702
- return "int8array";
3703
- }
3704
- if (type === "[object Uint8Array]") {
3705
- return "uint8array";
3706
- }
3707
- if (type === "[object Uint8ClampedArray]") {
3708
- return "uint8clampedarray";
3709
- }
3710
- if (type === "[object Int16Array]") {
3711
- return "int16array";
3712
- }
3713
- if (type === "[object Uint16Array]") {
3714
- return "uint16array";
3715
- }
3716
- if (type === "[object Int32Array]") {
3717
- return "int32array";
3718
- }
3719
- if (type === "[object Uint32Array]") {
3720
- return "uint32array";
3721
- }
3722
- if (type === "[object Float32Array]") {
3723
- return "float32array";
3724
- }
3725
- if (type === "[object Float64Array]") {
3726
- return "float64array";
3727
- }
3728
- return "object";
3729
- };
3730
- }
3731
- });
3732
-
3733
- // ../../node_modules/.pnpm/is-number@3.0.0/node_modules/is-number/index.js
3734
- var require_is_number = __commonJS({
3735
- "../../node_modules/.pnpm/is-number@3.0.0/node_modules/is-number/index.js"(exports, module) {
3736
- "use strict";
3737
- var typeOf = require_kind_of();
3738
- module.exports = function isNumber(num) {
3739
- var type = typeOf(num);
3740
- if (type === "string") {
3741
- if (!num.trim()) return false;
3742
- } else if (type !== "number") {
3743
- return false;
3744
- }
3745
- return num - num + 1 >= 0;
3746
- };
3747
- }
3748
- });
3749
-
3750
- // ../../node_modules/.pnpm/window-size@1.1.1/node_modules/window-size/utils.js
3751
- var require_utils2 = __commonJS({
3752
- "../../node_modules/.pnpm/window-size@1.1.1/node_modules/window-size/utils.js"(exports, module) {
3753
- "use strict";
3754
- var os = __require("os");
3755
- var isNumber = require_is_number();
3756
- var cp = __require("child_process");
3757
- function windowSize(options) {
3758
- options = options || {};
3759
- return streamSize(options, "stdout") || streamSize(options, "stderr") || envSize() || ttySize(options);
3760
- }
3761
- function streamSize(options, name) {
3762
- var stream = process && process[name] || options[name];
3763
- var size;
3764
- if (!stream) return;
3765
- if (typeof stream.getWindowSize === "function") {
3766
- size = stream.getWindowSize();
3767
- if (isSize(size)) {
3768
- return {
3769
- width: size[0],
3770
- height: size[1],
3771
- type: name
3772
- };
3773
- }
3774
- }
3775
- size = [stream.columns, stream.rows];
3776
- if (isSize(size)) {
3777
- return {
3778
- width: Number(size[0]),
3779
- height: Number(size[1]),
3780
- type: name
3781
- };
3782
- }
3783
- }
3784
- function envSize() {
3785
- if (process && process.env) {
3786
- var size = [process.env.COLUMNS, process.env.ROWS];
3787
- if (isSize(size)) {
3788
- return {
3789
- width: Number(size[0]),
3790
- height: Number(size[1]),
3791
- type: "process.env"
3792
- };
3793
- }
3794
- }
3795
- }
3796
- function ttySize(options, stdout) {
3797
- var tty = options.tty || __require("tty");
3798
- if (tty && typeof tty.getWindowSize === "function") {
3799
- var size = tty.getWindowSize(stdout);
3800
- if (isSize(size)) {
3801
- return {
3802
- width: Number(size[1]),
3803
- height: Number(size[0]),
3804
- type: "tty"
3805
- };
3806
- }
3807
- }
3808
- }
3809
- function winSize() {
3810
- if (os.release().startsWith("10")) {
3811
- var cmd = "wmic path Win32_VideoController get CurrentHorizontalResolution,CurrentVerticalResolution";
3812
- var numberPattern = /\d+/g;
3813
- var code = cp.execSync(cmd).toString();
3814
- var size = code.match(numberPattern);
3815
- if (isSize(size)) {
3816
- return {
3817
- width: Number(size[0]),
3818
- height: Number(size[1]),
3819
- type: "windows"
3820
- };
3821
- }
3822
- }
3823
- }
3824
- function tputSize() {
3825
- try {
3826
- var buf = cp.execSync("tput cols && tput lines", { stdio: ["ignore", "pipe", process.stderr] });
3827
- var size = buf.toString().trim().split("\n");
3828
- if (isSize(size)) {
3829
- return {
3830
- width: Number(size[0]),
3831
- height: Number(size[1]),
3832
- type: "tput"
3833
- };
3834
- }
3835
- } catch (err) {
3836
- }
3837
- }
3838
- function isSize(size) {
3839
- return Array.isArray(size) && isNumber(size[0]) && isNumber(size[1]);
3840
- }
3841
- module.exports = {
3842
- get: windowSize,
3843
- env: envSize,
3844
- tty: ttySize,
3845
- tput: tputSize,
3846
- win: winSize
3847
- };
3848
- }
3849
- });
3850
-
3851
- // ../../node_modules/.pnpm/window-size@1.1.1/node_modules/window-size/index.js
3852
- var require_window_size = __commonJS({
3853
- "../../node_modules/.pnpm/window-size@1.1.1/node_modules/window-size/index.js"(exports, module) {
3854
- "use strict";
3855
- var define = require_define_property();
3856
- var utils = require_utils2();
3857
- module.exports = utils.get();
3858
- if (module.exports) {
3859
- define(module.exports, "get", utils.get);
3860
- define(module.exports, "env", utils.env);
3861
- define(module.exports, "tty", utils.tty);
3862
- define(module.exports, "tput", utils.tput);
3863
- define(module.exports, "win", utils.win);
3864
- }
3865
- }
3866
- });
3867
-
3868
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Size.js
3869
- var require_Size = __commonJS({
3870
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Size.js"(exports, module) {
3871
- "use strict";
3872
- var WinSize = require_window_size();
3873
- var Size = {
3874
- width: WinSize ? WinSize.width > 0 ? WinSize.width : 80 : 80,
3875
- height: WinSize ? WinSize.height > 0 ? WinSize.height : 24 : 24
3876
- };
3877
- module.exports = exports = {
3878
- Size
3879
- };
3880
- }
3881
- });
3882
-
3883
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AlignText.js
3884
- var require_AlignText = __commonJS({
3885
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AlignText.js"(exports, module) {
3886
- "use strict";
3887
- var {
3888
- Debugging
3889
- } = require_Debugging();
3890
- var {
3891
- Size
3892
- } = require_Size();
3893
- var AlignText = (output, lineLength, characterLines, align, size = Size) => {
3894
- Debugging.report(`Running AlignText`, 1);
3895
- let space = 0;
3896
- if (align === "center") {
3897
- space = Math.ceil((size.width - lineLength) / 2);
3898
- Debugging.report(`AlignText: Center lineLength: ${lineLength}, size.width: ${size.width}, space: ${space}`, 2);
3899
- }
3900
- if (align === "right") {
3901
- space = size.width - lineLength;
3902
- Debugging.report(`AlignText: Right lineLength: ${lineLength}, size.width: ${size.width}, space: ${space}`, 2);
3903
- }
3904
- if (space > 0) {
3905
- let lines = output.length - characterLines;
3906
- const spaces = " ".repeat(space);
3907
- for (let i = lines; i < output.length; i++) {
3908
- output[i] = spaces + output[i];
3909
- }
3910
- }
3911
- return output;
3912
- };
3913
- module.exports = exports = {
3914
- AlignText
3915
- };
3916
- }
3917
- });
3918
-
3919
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddLine.js
3920
- var require_AddLine = __commonJS({
3921
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddLine.js"(exports, module) {
3922
- "use strict";
3923
- var {
3924
- Debugging
3925
- } = require_Debugging();
3926
- var AddLine = (output, fontLines, FontBuffer, lineHeight) => {
3927
- Debugging.report(`Running AddLine`, 1);
3928
- if (output.length === 0) {
3929
- lineHeight = 0;
3930
- }
3931
- let lines = fontLines + output.length + lineHeight;
3932
- let length = output.length;
3933
- for (let i = length; i < lines; i++) {
3934
- let index = i - length;
3935
- if (index > lineHeight) {
3936
- output[i] = FontBuffer[index - lineHeight];
3937
- } else {
3938
- output[i] = "";
3939
- }
3940
- }
3941
- return output;
3942
- };
3943
- module.exports = exports = {
3944
- AddLine
3945
- };
3946
- }
3947
- });
3948
-
3949
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddChar.js
3950
- var require_AddChar = __commonJS({
3951
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddChar.js"(exports, module) {
3952
- "use strict";
3953
- var {
3954
- Debugging
3955
- } = require_Debugging();
3956
- var {
3957
- Colorize
3958
- } = require_Colorize();
3959
- var AddChar = (CHAR, output, fontLines, fontChars, fontColors, colors2) => {
3960
- Debugging.report(`Running AddChar with "${CHAR}"`, 1);
3961
- let lines = output.length - fontLines;
3962
- for (let i = lines; i < output.length; i++) {
3963
- let index = i - lines;
3964
- output[i] += Colorize(fontChars[CHAR][index], fontColors, colors2);
3965
- }
3966
- return output;
3967
- };
3968
- module.exports = exports = {
3969
- AddChar
3970
- };
3971
- }
3972
- });
3973
-
3974
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/GetFont.js
3975
- var require_GetFont = __commonJS({
3976
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/GetFont.js"(exports, module) {
3977
- "use strict";
3978
- var path = __require("path");
3979
- var {
3980
- Debugging
3981
- } = require_Debugging();
3982
- var GetFont = (font) => {
3983
- Debugging.report(`Running GetFont`, 1);
3984
- try {
3985
- let FONTFACE = __require(path.normalize(`../fonts/${font}.json`));
3986
- Debugging.report(`GetFont: Fontface path selected: "${font}.json"`, 2);
3987
- return FONTFACE;
3988
- } catch (error) {
3989
- Debugging.error(`Font file for "${font}" errored out: ${error}`, 2);
3990
- return false;
3991
- }
3992
- };
3993
- module.exports = exports = {
3994
- GetFont
3995
- };
3996
- }
3997
- });
3998
-
3999
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Log.js
4000
- var require_Log = __commonJS({
4001
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Log.js"(exports, module) {
4002
- "use strict";
4003
- var {
4004
- Color
4005
- } = require_Color();
4006
- var Log = {
4007
- /**
4008
- * Print error message to console.
4009
- *
4010
- * @param {string} text - The sting you want to log
4011
- */
4012
- error: (text) => {
4013
- text = text.replace(/(?:\r\n|\r|\n)/g, "\n ");
4014
- const {
4015
- open,
4016
- close
4017
- } = Color("red");
4018
- console.error(`
4019
- \x1B[1m${open}Ouch:${close}\x1B[22m ${text}
4020
- `);
4021
- }
4022
- };
4023
- module.exports = exports = {
4024
- Log
4025
- };
4026
- }
4027
- });
4028
-
4029
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Render.js
4030
- var require_Render = __commonJS({
4031
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Render.js"(exports, module) {
4032
- "use strict";
4033
- var {
4034
- AddLetterSpacing
4035
- } = require_AddLetterSpacing();
4036
- var {
4037
- Debugging,
4038
- DEBUG
4039
- } = require_Debugging();
4040
- var {
4041
- PaintGradient
4042
- } = require_Gradient();
4043
- var {
4044
- CharLength
4045
- } = require_CharLength();
4046
- var {
4047
- CheckInput
4048
- } = require_CheckInput();
4049
- var {
4050
- CleanInput
4051
- } = require_CleanInput();
4052
- var {
4053
- AlignText
4054
- } = require_AlignText();
4055
- var {
4056
- AddLine
4057
- } = require_AddLine();
4058
- var {
4059
- AddChar
4060
- } = require_AddChar();
4061
- var {
4062
- Options
4063
- } = require_Options();
4064
- var {
4065
- GetFont
4066
- } = require_GetFont();
4067
- var {
4068
- CHARS
4069
- } = require_constants();
4070
- var {
4071
- Color
4072
- } = require_Color();
4073
- var {
4074
- Size
4075
- } = require_Size();
4076
- var {
4077
- Log
4078
- } = require_Log();
4079
- var Render = (input, SETTINGS = {}, debug = DEBUG.enabled, debuglevel = DEBUG.level, size = Size) => {
4080
- Debugging.report(`Running render`, 1);
4081
- DEBUG.enabled = debug;
4082
- DEBUG.level = debuglevel;
4083
- const INPUT = CleanInput(input, CHARS);
4084
- Options.reset();
4085
- Options.set = SETTINGS;
4086
- const OPTIONS = Options.get;
4087
- let output = [];
4088
- let lines = 0;
4089
- let FONTFACE = {};
4090
- const _isGoodHuman = CheckInput(INPUT, OPTIONS.font, OPTIONS.colors, OPTIONS.background, OPTIONS.align, OPTIONS.gradient, OPTIONS.transitionGradient, OPTIONS.env);
4091
- if (!_isGoodHuman.pass) {
4092
- Log.error(_isGoodHuman.message);
4093
- return false;
4094
- }
4095
- if (OPTIONS.gradient) {
4096
- OPTIONS.colors = [];
4097
- }
4098
- if (DEBUG.enabled) {
4099
- let outOption = `OPTIONS:
4100
- Text: ${INPUT}`;
4101
- for (let key in OPTIONS) {
4102
- outOption += `
4103
- Options.${key}: ${OPTIONS[key]}`;
4104
- }
4105
- Debugging.report(outOption, 3);
4106
- }
4107
- if (OPTIONS.env === "browser") {
4108
- size = {
4109
- ...size
4110
- };
4111
- size.width = OPTIONS.maxLength === 0 ? 999999999999 : OPTIONS.maxLength;
4112
- }
4113
- FONTFACE = GetFont(OPTIONS.font);
4114
- if (!FONTFACE) {
4115
- Log.error(`Font file for the font "${OPTIONS.font}" could not be found.
4116
- Try reinstalling this package.`);
4117
- return false;
4118
- }
4119
- if (SETTINGS.letterSpacing === void 0) {
4120
- Debugging.report(`Looking up letter spacing from font face`, 1);
4121
- let width = 0;
4122
- FONTFACE.letterspace.forEach((item) => {
4123
- let char = item.replace(/(<([^>]+)>)/gi, "");
4124
- if (width < char.length) {
4125
- width = char.length;
4126
- }
4127
- });
4128
- Debugging.report(`Letter spacing set to font face default: "${width}"`, 2);
4129
- OPTIONS.letterSpacing = width;
4130
- }
4131
- let lineLength = CharLength(FONTFACE.buffer, FONTFACE.lines, OPTIONS);
4132
- let maxChars = 0;
4133
- let line_break = "\n";
4134
- if (OPTIONS.env === "node" && OPTIONS.rawMode === true) {
4135
- line_break = "\r\n";
4136
- }
4137
- output = AddLine([], FONTFACE.lines, FONTFACE.buffer, OPTIONS.lineHeight);
4138
- lines++;
4139
- for (let i = 0; i < INPUT.length; i++) {
4140
- let CHAR = INPUT.charAt(i).toUpperCase();
4141
- let lastLineLength = lineLength;
4142
- Debugging.report(`Character found in font: "${CHAR}"`, 2);
4143
- if (CHAR !== `|`) {
4144
- lineLength += CharLength(FONTFACE.chars[CHAR], FONTFACE.lines, OPTIONS);
4145
- lineLength += CharLength(FONTFACE.letterspace, FONTFACE.lines, OPTIONS) * OPTIONS.letterSpacing;
4146
- }
4147
- if (maxChars >= OPTIONS.maxLength && OPTIONS.maxLength != 0 || CHAR === `|` || lineLength > size.width) {
4148
- lines++;
4149
- Debugging.report(`NEWLINE: maxChars: ${maxChars}, OPTIONS.maxLength: ${OPTIONS.maxLength}, CHAR: ${CHAR}, lineLength: ${lineLength}, Size.width: ${size.width} `, 2);
4150
- if (OPTIONS.env === "node") {
4151
- output = AlignText(output, lastLineLength, FONTFACE.lines, OPTIONS.align, size);
4152
- }
4153
- lineLength += CharLength(FONTFACE.letterspace, FONTFACE.lines, OPTIONS) * OPTIONS.letterSpacing;
4154
- lineLength = CharLength(FONTFACE.buffer, FONTFACE.lines, OPTIONS);
4155
- if (CHAR !== `|`) {
4156
- lineLength += CharLength(FONTFACE.letterspace, FONTFACE.lines, OPTIONS) * OPTIONS.letterSpacing;
4157
- lineLength += CharLength(FONTFACE.chars[CHAR], FONTFACE.lines, OPTIONS);
4158
- }
4159
- maxChars = 0;
4160
- output = AddLine(output, FONTFACE.lines, FONTFACE.buffer, OPTIONS.lineHeight);
4161
- }
4162
- Debugging.report(`lineLength at: "${lineLength}"`, 2);
4163
- if (CHAR !== `|`) {
4164
- maxChars++;
4165
- output = AddLetterSpacing(output, FONTFACE.lines, FONTFACE.letterspace, FONTFACE.colors, OPTIONS.colors, OPTIONS.letterSpacing);
4166
- output = AddChar(CHAR, output, FONTFACE.lines, FONTFACE.chars, FONTFACE.colors, OPTIONS.colors);
4167
- }
4168
- }
4169
- if (OPTIONS.env === "node") {
4170
- output = AlignText(output, lineLength, FONTFACE.lines, OPTIONS.align, size);
4171
- }
4172
- if (OPTIONS.gradient) {
4173
- output = PaintGradient({
4174
- output,
4175
- gradient: OPTIONS.gradient,
4176
- lines,
4177
- lineHeight: OPTIONS.lineHeight,
4178
- fontLines: FONTFACE.lines,
4179
- independentGradient: OPTIONS.independentGradient,
4180
- transitionGradient: OPTIONS.transitionGradient
4181
- });
4182
- }
4183
- if (!OPTIONS.spaceless) {
4184
- if (OPTIONS.align === "top") {
4185
- output[output.length - 1] = `${output[output.length - 1]}${line_break}${line_break}${line_break}${line_break}`;
4186
- } else if (OPTIONS.align === "bottom") {
4187
- output[0] = `${line_break}${line_break}${line_break}${line_break}${output[0]}`;
4188
- } else {
4189
- output[0] = `${line_break}${line_break}${output[0]}`;
4190
- output[output.length - 1] = `${output[output.length - 1]}${line_break}${line_break}`;
4191
- }
4192
- }
4193
- if (OPTIONS.background !== "transparent" && OPTIONS.env === "node") {
4194
- const {
4195
- open: openNew,
4196
- close: closeNew
4197
- } = Color(OPTIONS.background, true);
4198
- output[0] = `${openNew}${line_break}${output[0]}`;
4199
- output[output.length - 1] = `${output[output.length - 1]}${closeNew}`;
4200
- }
4201
- let write = output.join(OPTIONS.env === "node" ? `${line_break}` : `<br>${line_break}`);
4202
- if (OPTIONS.env === "browser") {
4203
- const {
4204
- open: bgColor
4205
- } = Color(OPTIONS.background, true);
4206
- write = `<div style="font-family:monospace;white-space:pre;text-align:${OPTIONS.align};max-width:100%;overflow:scroll;background:${bgColor ? bgColor : "transparent"}">${write}</div>`;
4207
- }
4208
- return {
4209
- string: write,
4210
- array: output,
4211
- lines,
4212
- options: OPTIONS
4213
- };
4214
- };
4215
- module.exports = exports = {
4216
- Render
4217
- };
4218
- }
4219
- });
4220
-
4221
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/DisplayHelp.js
4222
- var require_DisplayHelp = __commonJS({
4223
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/DisplayHelp.js"(exports, module) {
4224
- "use strict";
4225
- var {
4226
- CLIOPTIONS
4227
- } = require_constants();
4228
- var {
4229
- Render
4230
- } = require_Render();
4231
- var {
4232
- Color
4233
- } = require_Color();
4234
- var DisplayHelp = () => {
4235
- const {
4236
- string: headline
4237
- } = Render("cfonts", {
4238
- align: "left",
4239
- gradient: ["red", "green"]
4240
- }) || {
4241
- string: "cfonts"
4242
- };
4243
- console.log(` ${headline}This is a tool for sexy fonts in the console. Give your cli some love.
4244
-
4245
- Usage: cfonts "<value>" [option1] <input1> [option2] <input1>,<input2> [option3]
4246
- Example: \x1B[1m$ cfonts "sexy font" -f chrome -a center -c red,green,gray\x1B[22m
4247
-
4248
- Options:
4249
- `);
4250
- const {
4251
- open,
4252
- close
4253
- } = Color("green");
4254
- Object.keys(CLIOPTIONS).forEach((option) => {
4255
- console.log(`\x1B[1m${option}, ${CLIOPTIONS[option].short}\x1B[22m`);
4256
- console.log(CLIOPTIONS[option].description);
4257
- console.log(`\x1B[1m$\x1B[22m cfonts ${CLIOPTIONS[option].example.replace(/\[green-open\]/g, open).replace(/\[green-close\]/g, close)}
4258
- `);
4259
- });
4260
- };
4261
- module.exports = exports = {
4262
- DisplayHelp
4263
- };
4264
- }
4265
- });
4266
-
4267
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddShortcuts.js
4268
- var require_AddShortcuts = __commonJS({
4269
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/AddShortcuts.js"(exports, module) {
4270
- "use strict";
4271
- var AddShortcuts = (options) => {
4272
- const flatOptions = Object.assign({}, options);
4273
- Object.keys(flatOptions).forEach((option) => {
4274
- flatOptions[option]._name = option;
4275
- flatOptions[flatOptions[option].short] = flatOptions[option];
4276
- if (flatOptions[option].fallback_shortcut) {
4277
- flatOptions[flatOptions[option].fallback_shortcut] = flatOptions[option];
4278
- }
4279
- });
4280
- return flatOptions;
4281
- };
4282
- module.exports = exports = {
4283
- AddShortcuts
4284
- };
4285
- }
4286
- });
4287
-
4288
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/ParseArgs.js
4289
- var require_ParseArgs = __commonJS({
4290
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/ParseArgs.js"(exports, module) {
4291
- "use strict";
4292
- var {
4293
- AddShortcuts
4294
- } = require_AddShortcuts();
4295
- var {
4296
- CLIOPTIONS
4297
- } = require_constants();
4298
- var {
4299
- Debugging
4300
- } = require_Debugging();
4301
- var ParseArgs = (inputOptions = CLIOPTIONS, inputArgs = process.argv) => {
4302
- const parsedArgs = {
4303
- text: inputArgs[2]
4304
- };
4305
- Object.keys(inputOptions).forEach((option) => {
4306
- const name = option.replace("--", "");
4307
- parsedArgs[name] = inputOptions[option].default;
4308
- });
4309
- const args2 = inputArgs.splice(3);
4310
- const options = AddShortcuts(inputOptions);
4311
- const version_options = options["-v"];
4312
- if (inputArgs[2] === version_options._name || inputArgs[2] === version_options.short || inputArgs[2] === version_options.fallback_shortcut) {
4313
- parsedArgs.version = true;
4314
- }
4315
- const help_options = options["-h"];
4316
- if (inputArgs[2] === help_options._name || inputArgs[2] === help_options.short || inputArgs[2] === help_options.fallback_shortcut) {
4317
- parsedArgs.help = true;
4318
- }
4319
- for (let index = 0; args2.length > index; index++) {
4320
- const option = options[args2[index]];
4321
- if (option) {
4322
- const name = option._name.replace("--", "");
4323
- if (option.options !== void 0) {
4324
- index++;
4325
- const value = args2[index];
4326
- parsedArgs[name] = value;
4327
- } else {
4328
- parsedArgs[name] = true;
4329
- }
4330
- } else {
4331
- Debugging.report(`The cli argument ${args2[index]} was not found and ignored`, 2);
4332
- }
4333
- }
4334
- return parsedArgs;
4335
- };
4336
- module.exports = exports = {
4337
- ParseArgs
4338
- };
4339
- }
4340
- });
4341
-
4342
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Say.js
4343
- var require_Say = __commonJS({
4344
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/Say.js"(exports, module) {
4345
- "use strict";
4346
- var {
4347
- Debugging,
4348
- DEBUG
4349
- } = require_Debugging();
4350
- var {
4351
- Render
4352
- } = require_Render();
4353
- var {
4354
- Size
4355
- } = require_Size();
4356
- var Say = (INPUT, SETTINGS = {}, debug = DEBUG.enabled, debuglevel = DEBUG.level, size = Size) => {
4357
- Debugging.report(`Running say`, 1);
4358
- DEBUG.enabled = debug;
4359
- DEBUG.level = debuglevel;
4360
- const write = Render(INPUT, SETTINGS, debug, debuglevel, size);
4361
- if (write) {
4362
- console.log(write.string);
4363
- }
4364
- };
4365
- module.exports = exports = {
4366
- Say
4367
- };
4368
- }
4369
- });
4370
-
4371
- // ../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/index.js
4372
- var require_lib = __commonJS({
4373
- "../../node_modules/.pnpm/cfonts@3.3.1/node_modules/cfonts/lib/index.js"(exports, module) {
4374
- "use strict";
4375
- var {
4376
- DisplayVersion
4377
- } = require_DisplayVersion();
4378
- var {
4379
- DisplayHelp
4380
- } = require_DisplayHelp();
4381
- var {
4382
- CLIOPTIONS
4383
- } = require_constants();
4384
- var {
4385
- Debugging
4386
- } = require_Debugging();
4387
- var {
4388
- ParseArgs
4389
- } = require_ParseArgs();
4390
- var {
4391
- Render
4392
- } = require_Render();
4393
- var {
4394
- Color
4395
- } = require_Color();
4396
- var {
4397
- Log
4398
- } = require_Log();
4399
- var {
4400
- Say
4401
- } = require_Say();
4402
- var Cli = (inputOptions = CLIOPTIONS, inputArgs = process.argv) => {
4403
- const args2 = ParseArgs(inputOptions, inputArgs);
4404
- Debugging.report(`OPTIONS:
4405
- CFonts.say("${args2.text}", {
4406
- font: "${args2.font}",
4407
- align: "${args2.align}",
4408
- colors: ${args2.colors ? JSON.stringify(args2.colors.split(",")) : []},
4409
- background: "${args2.background}",
4410
- letterSpacing: ${args2["letter-spacing"]},
4411
- lineHeight: ${args2["line-height"]},
4412
- spaceless: ${args2.spaceless},
4413
- maxLength: ${args2["max-length"]},
4414
- gradient: ${args2.gradient},
4415
- independentGradient: ${args2["independent-gradient"]},
4416
- transitionGradient: ${args2["transition-gradient"]},
4417
- rawMode: ${args2["raw-mode"]},
4418
- env: ${args2.env},
4419
- }, ${args2.debug}, ${args2["debug-level"]} );`, 3, args2.debug, args2["debug-level"]);
4420
- if (args2.help) {
4421
- DisplayHelp();
4422
- return;
4423
- }
4424
- if (args2.version) {
4425
- DisplayVersion();
4426
- return;
4427
- }
4428
- if (!args2.text) {
4429
- const {
4430
- open: green_open,
4431
- close: green_close
4432
- } = Color("green");
4433
- Log.error(`Please provide text to convert with ${green_open}cfonts "Text"${green_close}
4434
- Run ${green_open}cfonts --help${green_close} for more infos`);
4435
- return;
4436
- }
4437
- Say(args2.text, {
4438
- font: args2.font,
4439
- align: args2.align,
4440
- colors: args2.colors ? args2.colors.split(",") : [],
4441
- background: args2.background,
4442
- letterSpacing: args2["letter-spacing"],
4443
- lineHeight: args2["line-height"],
4444
- spaceless: args2.spaceless,
4445
- maxLength: args2["max-length"],
4446
- gradient: args2.gradient,
4447
- independentGradient: args2["independent-gradient"],
4448
- transitionGradient: args2["transition-gradient"],
4449
- rawMode: args2["raw-mode"],
4450
- env: args2.env
4451
- }, args2.debug, args2["debug-level"]);
4452
- };
4453
- module.exports = exports = {
4454
- render: Render,
4455
- say: Say,
4456
- Cli
4457
- };
4458
- }
4459
- });
4460
-
4461
1854
  // src/utils/format.ts
4462
1855
  var import_cli_table3 = __toESM(require_cli_table3(), 1);
4463
1856
  import { createInterface } from "readline";
@@ -4686,7 +2079,6 @@ function renderSuccess(message) {
4686
2079
  }
4687
2080
 
4688
2081
  // src/utils/banner.ts
4689
- var import_cfonts = __toESM(require_lib(), 1);
4690
2082
  import pc2 from "picocolors";
4691
2083
  function hexColor(color) {
4692
2084
  if (typeof pc2.hex === "function") {
@@ -4696,25 +2088,26 @@ function hexColor(color) {
4696
2088
  }
4697
2089
  var fennecOrange2 = hexColor("#FF6432");
4698
2090
  var fennecGold = hexColor("#FFB347");
4699
- var VERSION = "1.11.2";
2091
+ var VERSION = "1.12.3";
4700
2092
  var cachedBanner = null;
4701
2093
  var cachedCompact = null;
4702
2094
  function generateBanner() {
4703
2095
  if (cachedBanner) return cachedBanner;
4704
- const result = import_cfonts.default.render("FENNEC", {
4705
- font: "block",
4706
- align: "left",
4707
- gradient: ["#FF6432", "#FFB347", "#FFD700"],
4708
- independentGradient: false,
4709
- transitionGradient: true,
4710
- letterSpacing: 1,
4711
- lineHeight: 1,
4712
- space: true,
4713
- maxLength: "0",
4714
- env: "node"
4715
- });
2096
+ const logo = [
2097
+ "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557",
2098
+ "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D",
2099
+ "\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 ",
2100
+ "\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 ",
2101
+ "\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
2102
+ "\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D"
2103
+ ];
2104
+ const gradientSteps = logo.length;
2105
+ const bannerStr = logo.map((line, i) => {
2106
+ const ratio = i / (gradientSteps - 1);
2107
+ const color = ratio < 0.5 ? fennecOrange2 : fennecGold;
2108
+ return color(line);
2109
+ }).join("\n");
4716
2110
  const tagline = pc2.dim("ears everywhere in your stack.") + pc2.dim(` v${VERSION}`);
4717
- const bannerStr = typeof result !== "boolean" ? result.string : "\u{1F98A} Fennec";
4718
2111
  cachedBanner = `
4719
2112
  ${bannerStr}
4720
2113
  ${tagline}
@@ -4827,6 +2220,7 @@ function showHelp() {
4827
2220
  }
4828
2221
 
4829
2222
  // src/commands/pipe.ts
2223
+ import { PipeWatcher } from "@plumpslabs/fennec-core";
4830
2224
  async function pipeCommand(args2) {
4831
2225
  const nameIndex = args2.indexOf("--name");
4832
2226
  const name = nameIndex !== -1 ? args2[nameIndex + 1] : "pipe";
@@ -4834,7 +2228,6 @@ async function pipeCommand(args2) {
4834
2228
  console.error("Error: --name is required for pipe command");
4835
2229
  process.exit(1);
4836
2230
  }
4837
- const { PipeWatcher } = await import("@plumpslabs/fennec-core");
4838
2231
  const watcher = new PipeWatcher();
4839
2232
  const { write } = watcher.createPipe(name);
4840
2233
  console.error(`Pipe watcher '${name}' active. Forwarding stdin...`);
@@ -4872,13 +2265,13 @@ async function pipeCommand(args2) {
4872
2265
  }
4873
2266
 
4874
2267
  // src/commands/attach-pid.ts
2268
+ import { PortDetector } from "@plumpslabs/fennec-core";
4875
2269
  async function attachPidCommand(args2) {
4876
2270
  const pid = parseInt(args2[0], 10);
4877
2271
  if (isNaN(pid)) {
4878
2272
  console.error("Error: valid PID is required");
4879
2273
  process.exit(1);
4880
2274
  }
4881
- const { PortDetector } = await import("@plumpslabs/fennec-core");
4882
2275
  const detector = new PortDetector();
4883
2276
  const info = detector.detectByPid(pid);
4884
2277
  if (info) {
@@ -4891,14 +2284,14 @@ async function attachPidCommand(args2) {
4891
2284
  }
4892
2285
 
4893
2286
  // src/commands/attach-port.ts
2287
+ import { PortDetector as PortDetector2 } from "@plumpslabs/fennec-core";
4894
2288
  async function attachPortCommand(args2) {
4895
2289
  const port = parseInt(args2[0], 10);
4896
2290
  if (isNaN(port)) {
4897
2291
  console.error("Error: valid port number is required");
4898
2292
  process.exit(1);
4899
2293
  }
4900
- const { PortDetector } = await import("@plumpslabs/fennec-core");
4901
- const detector = new PortDetector();
2294
+ const detector = new PortDetector2();
4902
2295
  const info = detector.detectByPort(port);
4903
2296
  if (info) {
4904
2297
  console.log(`Found process on port ${port}: PID ${info.pid}${info.command ? ` (${info.command})` : ""}`);
@@ -4911,6 +2304,7 @@ async function attachPortCommand(args2) {
4911
2304
  // src/commands/watch.ts
4912
2305
  import { existsSync } from "fs";
4913
2306
  import { resolve } from "path";
2307
+ import { LogWatcher } from "@plumpslabs/fennec-core";
4914
2308
  async function watchCommand(args2) {
4915
2309
  const fileIndex = args2.indexOf("--file");
4916
2310
  const filePath = fileIndex !== -1 ? args2[fileIndex + 1] : void 0;
@@ -4925,7 +2319,6 @@ async function watchCommand(args2) {
4925
2319
  console.error(`Error: File not found: ${resolvedPath}`);
4926
2320
  process.exit(1);
4927
2321
  }
4928
- const { LogWatcher } = await import("@plumpslabs/fennec-core");
4929
2322
  const watcher = new LogWatcher();
4930
2323
  const watcherId = watcher.watchFile(resolvedPath, name);
4931
2324
  console.log(`Watching file: ${resolvedPath}`);
@@ -4934,12 +2327,12 @@ async function watchCommand(args2) {
4934
2327
  }
4935
2328
 
4936
2329
  // src/commands/start.ts
4937
- import { createWriteStream, readFileSync as readFileSync3, mkdirSync as mkdirSync2 } from "fs";
2330
+ import { createWriteStream, mkdirSync as mkdirSync2 } from "fs";
4938
2331
  import { resolve as resolve3 } from "path";
4939
2332
  import { homedir as homedir2 } from "os";
4940
2333
  import { spawn } from "child_process";
4941
2334
  import { FennecServer } from "@plumpslabs/fennec-core";
4942
- import pc4 from "picocolors";
2335
+ import pc5 from "picocolors";
4943
2336
 
4944
2337
  // src/commands/tracker.ts
4945
2338
  import { existsSync as existsSync2, writeFileSync, readFileSync, mkdirSync, renameSync, statSync, rmSync } from "fs";
@@ -5242,51 +2635,215 @@ function getSystemProcesses(filter) {
5242
2635
  processes = processes.slice(0, filter.limit);
5243
2636
  }
5244
2637
  }
5245
- return processes;
5246
- }
5247
- function killProcess(pid, signal = "SIGTERM") {
5248
- try {
5249
- process.kill(pid, signal);
5250
- return true;
5251
- } catch {
5252
- return false;
5253
- }
5254
- }
5255
- function isProcessRunning(pid) {
5256
- try {
5257
- process.kill(pid, 0);
5258
- return true;
5259
- } catch {
5260
- return false;
2638
+ return processes;
2639
+ }
2640
+ function killProcess(pid, signal = "SIGTERM") {
2641
+ try {
2642
+ process.kill(pid, signal);
2643
+ return true;
2644
+ } catch {
2645
+ return false;
2646
+ }
2647
+ }
2648
+ function isProcessRunning(pid) {
2649
+ try {
2650
+ process.kill(pid, 0);
2651
+ return true;
2652
+ } catch {
2653
+ return false;
2654
+ }
2655
+ }
2656
+ function formatProcessState(state) {
2657
+ switch (state) {
2658
+ case "R":
2659
+ return "Running";
2660
+ case "S":
2661
+ return "Sleeping";
2662
+ case "D":
2663
+ return "Disk Sleep";
2664
+ case "Z":
2665
+ return "Zombie";
2666
+ case "T":
2667
+ return "Stopped";
2668
+ case "t":
2669
+ return "Tracing";
2670
+ case "X":
2671
+ return "Dead";
2672
+ case "I":
2673
+ return "Idle";
2674
+ default:
2675
+ return state;
2676
+ }
2677
+ }
2678
+
2679
+ // src/commands/ps.ts
2680
+ import pc4 from "picocolors";
2681
+ async function psCommand(args2) {
2682
+ const watchFlag = args2.includes("-w") || args2.includes("--watch");
2683
+ const systemFlag = args2.includes("--system") || args2.includes("-a") || args2.includes("--all");
2684
+ const nameFilter = args2.includes("--name") ? args2[args2.indexOf("--name") + 1] : void 0;
2685
+ const sortBy = args2.includes("--sort") ? args2[args2.indexOf("--sort") + 1] : "name";
2686
+ if (watchFlag && systemFlag) {
2687
+ await watchSystemProcesses(sortBy, 15);
2688
+ return;
2689
+ }
2690
+ if (systemFlag) {
2691
+ const spinner = createSpinner("Scanning system processes...");
2692
+ try {
2693
+ const processes = getSystemProcesses({ name: nameFilter, userOnly: true, sortBy, limit: 30 });
2694
+ spinner.stop();
2695
+ process.stdout.write("\r\x1B[K");
2696
+ if (processes.length === 0) {
2697
+ console.error(`
2698
+ ${pc4.dim("No system processes found.")}
2699
+ `);
2700
+ return;
2701
+ }
2702
+ const columns2 = [
2703
+ { key: "pid", label: "PID", align: "right", format: (v) => pc4.dim(String(v).padStart(6)) },
2704
+ { key: "name", label: "Name", format: (v) => pc4.bold(String(v)) },
2705
+ { key: "cpu", label: "CPU%", align: "right", format: (v) => {
2706
+ const n = v;
2707
+ return n > 10 ? pc4.red(String(n)) : n > 5 ? pc4.yellow(String(n)) : pc4.dim(String(n));
2708
+ } },
2709
+ { key: "mem", label: "MEM%", align: "right", format: (v) => {
2710
+ const n = v;
2711
+ return n > 10 ? pc4.red(String(n)) : n > 5 ? pc4.yellow(String(n)) : pc4.dim(String(n));
2712
+ } },
2713
+ { key: "state", label: "State", format: (v) => {
2714
+ const s = String(v);
2715
+ if (s === "R" || s === "Running") return pc4.green(s);
2716
+ if (s === "Z" || s === "Zombie") return pc4.red(s);
2717
+ if (s === "S" || s === "Sleeping") return pc4.cyan(s);
2718
+ return pc4.dim(s);
2719
+ } }
2720
+ ];
2721
+ const rows2 = processes.map((p) => ({ pid: p.pid, name: p.name, cpu: p.cpuPercent, mem: p.memPercent, state: formatProcessState(p.state) }));
2722
+ console.error(`
2723
+ ${symbols.fox} ${pc4.bold("System Processes")} ${pc4.dim(`(top ${processes.length} by ${sortBy})`)}
2724
+ `);
2725
+ console.error(renderTable(columns2, rows2));
2726
+ console.error();
2727
+ } catch (error) {
2728
+ spinner.fail("Failed to scan processes");
2729
+ console.error(renderError("Process scan failed", String(error)));
2730
+ }
2731
+ return;
2732
+ }
2733
+ const tracked = readTracked();
2734
+ if (tracked.length === 0) {
2735
+ console.error(`
2736
+ ${pc4.dim("No tracked processes.")}`);
2737
+ console.error(` ${pc4.dim("Start an app with:")} ${pc4.cyan("fennec start <command> --name <name>")}
2738
+ `);
2739
+ return;
2740
+ }
2741
+ const columns = [
2742
+ { key: "name", label: "App", format: (v) => pc4.bold(String(v)) },
2743
+ { key: "pid", label: "PID", align: "right" },
2744
+ { key: "status", label: "Status", format: (v) => {
2745
+ const s = v;
2746
+ return s === "running" ? pc4.green("\u25CF running") : pc4.red("\u25CB stopped");
2747
+ } },
2748
+ { key: "port", label: "Port", format: (v) => {
2749
+ const p = v;
2750
+ return p ? pc4.yellow(`:${p}`) : pc4.dim("-");
2751
+ } },
2752
+ { key: "command", label: "Command", format: (v) => {
2753
+ const c = String(v);
2754
+ return c.length > 50 ? c.slice(0, 50) + "\u2026" : c;
2755
+ } },
2756
+ { key: "uptime", label: "Uptime", format: (v) => pc4.dim(String(v)) }
2757
+ ];
2758
+ const rows = tracked.map((t) => {
2759
+ const running = isProcessRunning(t.pid);
2760
+ const uptime = running ? formatUptime(Math.floor((Date.now() - new Date(t.startedAt).getTime()) / 1e3)) : "-";
2761
+ return { name: t.name, pid: running ? String(t.pid) : pc4.dim(String(t.pid)), status: running ? "running" : "stopped", port: t.port ?? null, command: t.command, uptime };
2762
+ });
2763
+ const runningCount = tracked.filter((t) => isProcessRunning(t.pid)).length;
2764
+ console.error(`
2765
+ ${symbols.fox} ${pc4.bold("Fennec Apps")} ${pc4.dim(`(${runningCount}/${tracked.length} running)`)}
2766
+ `);
2767
+ console.error(renderTable(columns, rows));
2768
+ console.error(` ${pc4.dim("Use")} ${pc4.cyan("fennec start <command> --name <name> --port <port>")} ${pc4.dim("to add more apps.")}`);
2769
+ console.error(` ${pc4.dim("Use")} ${pc4.cyan("fennec log <name>")} ${pc4.dim("to view logs.")}`);
2770
+ console.error(` ${pc4.dim("Use")} ${pc4.cyan("fennec kill <name>")} ${pc4.dim("to stop an app.")}`);
2771
+ console.error();
2772
+ }
2773
+ async function statusCommand(_args) {
2774
+ const watchFlag = _args.includes("-w") || _args.includes("--watch");
2775
+ const tracked = readTracked();
2776
+ const topSystem = getSystemProcesses({ userOnly: true, sortBy: "cpu", limit: 5 });
2777
+ const totalUserProcs = getSystemProcesses({ userOnly: true }).length;
2778
+ console.error(`
2779
+ ${symbols.fox} ${pc4.bold("Fennec Status")}
2780
+ `);
2781
+ if (tracked.length > 0) {
2782
+ const runningCount = tracked.filter((t) => isProcessRunning(t.pid)).length;
2783
+ console.error(` ${pc4.bold("Managed Apps")} ${pc4.dim(`(${runningCount}/${tracked.length} running)`)}
2784
+ `);
2785
+ for (const t of tracked) {
2786
+ const running = isProcessRunning(t.pid);
2787
+ const statusIcon = running ? pc4.green("\u25CF") : pc4.red("\u25CB");
2788
+ const portStr = t.port ? ` ${pc4.yellow(`:${t.port}`)}` : "";
2789
+ const uptime = running ? pc4.dim(formatUptime(Math.floor((Date.now() - new Date(t.startedAt).getTime()) / 1e3))) : pc4.red("stopped");
2790
+ console.error(` ${statusIcon} ${pc4.bold(t.name)}${portStr} ${pc4.dim(`(PID ${t.pid})`)} \u2014 ${uptime}`);
2791
+ }
2792
+ console.error();
2793
+ } else {
2794
+ console.error(` ${pc4.dim("No managed apps.")} ${pc4.cyan("fennec start <command> --name <name>")}
2795
+ `);
2796
+ }
2797
+ console.error(` ${pc4.bold("System")} ${pc4.dim(`(${totalUserProcs} user processes)`)}`);
2798
+ for (const p of topSystem) {
2799
+ const cpuStr = p.cpuPercent > 10 ? pc4.red(`${p.cpuPercent}%`) : p.cpuPercent > 5 ? pc4.yellow(`${p.cpuPercent}%`) : pc4.dim(`${p.cpuPercent}%`);
2800
+ const memStr = p.memPercent > 10 ? pc4.red(`${p.memPercent}%`) : p.memPercent > 5 ? pc4.yellow(`${p.memPercent}%`) : pc4.dim(`${p.memPercent}%`);
2801
+ console.error(` ${pc4.dim(`PID ${p.pid}`)} ${pc4.bold(p.name)} \u2014 CPU: ${cpuStr} MEM: ${memStr}`);
5261
2802
  }
2803
+ if (watchFlag) await watchSystemProcesses("cpu", 15);
2804
+ console.error();
5262
2805
  }
5263
- function formatProcessState(state) {
5264
- switch (state) {
5265
- case "R":
5266
- return "Running";
5267
- case "S":
5268
- return "Sleeping";
5269
- case "D":
5270
- return "Disk Sleep";
5271
- case "Z":
5272
- return "Zombie";
5273
- case "T":
5274
- return "Stopped";
5275
- case "t":
5276
- return "Tracing";
5277
- case "X":
5278
- return "Dead";
5279
- case "I":
5280
- return "Idle";
5281
- default:
5282
- return state;
5283
- }
2806
+ async function watchSystemProcesses(sortBy, limit) {
2807
+ console.error(`
2808
+ ${pc4.bold("Watching system processes")} ${pc4.dim("(Ctrl+C to stop, refreshes every 3s)")}
2809
+ `);
2810
+ const render = () => {
2811
+ const processes = getSystemProcesses({ userOnly: true, sortBy, limit });
2812
+ const columns = [
2813
+ { key: "pid", label: "PID", align: "right", format: (v) => pc4.dim(String(v).padStart(6)) },
2814
+ { key: "name", label: "Name", format: (v) => pc4.bold(String(v)) },
2815
+ { key: "cpu", label: "CPU%", align: "right", format: (v) => {
2816
+ const n = v;
2817
+ return n > 10 ? pc4.red(String(n)) : n > 5 ? pc4.yellow(String(n)) : pc4.dim(String(n));
2818
+ } },
2819
+ { key: "mem", label: "MEM%", align: "right", format: (v) => {
2820
+ const n = v;
2821
+ return n > 10 ? pc4.red(String(n)) : n > 5 ? pc4.yellow(String(n)) : pc4.dim(String(n));
2822
+ } },
2823
+ { key: "state", label: "S", align: "center" }
2824
+ ];
2825
+ const rows = processes.map((p) => ({ pid: p.pid, name: p.name, cpu: p.cpuPercent, mem: p.memPercent, state: p.state }));
2826
+ return ` ${timestamp()} ${pc4.dim(`${processes.length} processes`)}
2827
+ ${renderTable(columns, rows, { compact: true })}`;
2828
+ };
2829
+ console.error(render());
2830
+ const interval = setInterval(() => {
2831
+ process.stdout.write("\x1B[J");
2832
+ console.error(render());
2833
+ }, 3e3);
2834
+ await new Promise((resolve8) => {
2835
+ process.once("SIGINT", () => {
2836
+ clearInterval(interval);
2837
+ process.stdout.write("\x1B[J");
2838
+ resolve8();
2839
+ });
2840
+ });
5284
2841
  }
5285
2842
 
5286
2843
  // src/commands/start.ts
5287
2844
  async function startServer(args2) {
5288
2845
  printBanner();
5289
- console.error(` ${pc4.dim("Starting Fennec MCP server...")}
2846
+ console.error(` ${pc5.dim("Starting Fennec MCP server...")}
5290
2847
  `);
5291
2848
  const configIndex = args2.indexOf("--config");
5292
2849
  const configPath = configIndex !== -1 ? args2[configIndex + 1] : void 0;
@@ -5295,11 +2852,11 @@ async function startServer(args2) {
5295
2852
  await resurrectTracked();
5296
2853
  await server.start();
5297
2854
  console.error(`
5298
- ${pc4.green("\u2713")} ${pc4.bold("Fennec server is running")}`);
2855
+ ${pc5.green("\u2713")} ${pc5.bold("Fennec server is running")}`);
5299
2856
  console.error(` ${renderKV("Transport", "stdio")}`);
5300
2857
  console.error(` ${renderKV("AI Agent", "Connect via MCP protocol")}`);
5301
2858
  console.error(`
5302
- ${pc4.dim("Press Ctrl+C to stop")}
2859
+ ${pc5.dim("Press Ctrl+C to stop")}
5303
2860
  `);
5304
2861
  } catch (error) {
5305
2862
  console.error(renderError("Failed to start server", String(error)));
@@ -5308,7 +2865,7 @@ async function startServer(args2) {
5308
2865
  }
5309
2866
  async function startCommand(args2) {
5310
2867
  printBanner();
5311
- console.error(` ${pc4.dim("Starting app...")}
2868
+ console.error(` ${pc5.dim("Starting app...")}
5312
2869
  `);
5313
2870
  await runCommand(args2);
5314
2871
  }
@@ -5332,9 +2889,9 @@ async function runCommand(args2) {
5332
2889
  const existing = tracked.find((t) => t.name === appName);
5333
2890
  if (existing && isProcessRunning(existing.pid)) {
5334
2891
  console.error();
5335
- console.error(` ${pc4.yellow("\u26A0")} ${pc4.bold(appName)} ${pc4.dim(`is already running (PID: ${existing.pid})`)}`);
5336
- console.error(` ${renderKV("Logs", pc4.cyan(`fennec log ${appName}`))}`);
5337
- console.error(` ${renderKV("Stop", pc4.cyan(`fennec kill ${appName}`))}`);
2892
+ console.error(` ${pc5.yellow("\u26A0")} ${pc5.bold(appName)} ${pc5.dim(`is already running (PID: ${existing.pid})`)}`);
2893
+ console.error(` ${renderKV("Logs", pc5.cyan(`fennec log ${appName}`))}`);
2894
+ console.error(` ${renderKV("Stop", pc5.cyan(`fennec kill ${appName}`))}`);
5338
2895
  console.error();
5339
2896
  process.exit(0);
5340
2897
  }
@@ -5342,7 +2899,7 @@ async function runCommand(args2) {
5342
2899
  mkdirSync2(logDir, { recursive: true });
5343
2900
  const logFilePath = resolve3(logDir, `${appName}.log`);
5344
2901
  console.error(`
5345
- ${symbols.fox} ${pc4.bold("Starting")} ${renderAppName(appName)} ${pc4.dim("(daemon)")}
2902
+ ${symbols.fox} ${pc5.bold("Starting")} ${renderAppName(appName)} ${pc5.dim("(daemon)")}
5346
2903
  `);
5347
2904
  console.error(` ${renderKV("Command", cmd)}`);
5348
2905
  if (port) console.error(` ${renderKV("Port", String(port))}`);
@@ -5369,32 +2926,8 @@ async function runCommand(args2) {
5369
2926
  cwd,
5370
2927
  startedAt: (/* @__PURE__ */ new Date()).toISOString()
5371
2928
  });
5372
- console.error(`
5373
- ${pc4.green("\u25CF")} ${pc4.bold(appName)} ${pc4.dim(`started (PID: ${pid})`)}${port ? pc4.dim(` :${port}`) : ""}
5374
- `);
5375
- await new Promise((r) => setTimeout(r, 1500));
5376
- try {
5377
- const initialLogs = readFileSync3(logFilePath, "utf-8").split("\n").filter(Boolean).slice(-8);
5378
- if (initialLogs.length > 0) {
5379
- for (const line of initialLogs) {
5380
- const truncated = line.length > 150 ? line.slice(0, 150) + "\u2026" : line;
5381
- if (line.toLowerCase().includes("error")) {
5382
- console.error(` ${pc4.dim("\u2502")} ${pc4.red(truncated)}`);
5383
- } else if (line.toLowerCase().includes("warn")) {
5384
- console.error(` ${pc4.dim("\u2502")} ${pc4.yellow(truncated)}`);
5385
- } else {
5386
- console.error(` ${pc4.dim("\u2502")} ${truncated}`);
5387
- }
5388
- }
5389
- }
5390
- } catch {
5391
- }
5392
- console.error();
5393
- console.error(` ${pc4.green("\u2713")} ${pc4.bold(appName)} running in background`);
5394
- console.error(` ${renderKV("Logs", pc4.cyan(`fennec log ${appName}`))}`);
5395
- console.error(` ${renderKV("Status", pc4.cyan("fennec ps"))}`);
5396
- console.error(` ${renderKV("Stop", pc4.cyan(`fennec kill ${appName}`))}`);
5397
- console.error();
2929
+ console.error(` ${pc5.green("\u2713")} ${pc5.bold(appName)} ${pc5.dim(`started (PID: ${pid})`)}`);
2930
+ await psCommand([]);
5398
2931
  } catch (error) {
5399
2932
  console.error(renderError(`Failed to start ${appName}`, String(error)));
5400
2933
  process.exit(1);
@@ -5445,175 +2978,11 @@ async function resurrectTracked() {
5445
2978
  spinner.stop();
5446
2979
  process.stdout.write("\r\x1B[K");
5447
2980
  if (resurrected > 0) {
5448
- console.error(` ${pc4.green("\u25CF")} ${pc4.bold(`Resurrected ${resurrected} process(es)`)}`);
2981
+ console.error(` ${pc5.green("\u25CF")} ${pc5.bold(`Resurrected ${resurrected} process(es)`)}`);
5449
2982
  }
5450
2983
  if (failed > 0) {
5451
- console.error(` ${pc4.red("\u25CF")} ${pc4.bold(`${failed} process(es) failed to resurrect`)}`);
5452
- }
5453
- }
5454
-
5455
- // src/commands/ps.ts
5456
- import pc5 from "picocolors";
5457
- async function psCommand(args2) {
5458
- const watchFlag = args2.includes("-w") || args2.includes("--watch");
5459
- const systemFlag = args2.includes("--system") || args2.includes("-a") || args2.includes("--all");
5460
- const nameFilter = args2.includes("--name") ? args2[args2.indexOf("--name") + 1] : void 0;
5461
- const sortBy = args2.includes("--sort") ? args2[args2.indexOf("--sort") + 1] : "name";
5462
- if (watchFlag && systemFlag) {
5463
- await watchSystemProcesses(sortBy, 15);
5464
- return;
5465
- }
5466
- if (systemFlag) {
5467
- const spinner = createSpinner("Scanning system processes...");
5468
- try {
5469
- const processes = getSystemProcesses({ name: nameFilter, userOnly: true, sortBy, limit: 30 });
5470
- spinner.stop();
5471
- process.stdout.write("\r\x1B[K");
5472
- if (processes.length === 0) {
5473
- console.error(`
5474
- ${pc5.dim("No system processes found.")}
5475
- `);
5476
- return;
5477
- }
5478
- const columns2 = [
5479
- { key: "pid", label: "PID", align: "right", format: (v) => pc5.dim(String(v).padStart(6)) },
5480
- { key: "name", label: "Name", format: (v) => pc5.bold(String(v)) },
5481
- { key: "cpu", label: "CPU%", align: "right", format: (v) => {
5482
- const n = v;
5483
- return n > 10 ? pc5.red(String(n)) : n > 5 ? pc5.yellow(String(n)) : pc5.dim(String(n));
5484
- } },
5485
- { key: "mem", label: "MEM%", align: "right", format: (v) => {
5486
- const n = v;
5487
- return n > 10 ? pc5.red(String(n)) : n > 5 ? pc5.yellow(String(n)) : pc5.dim(String(n));
5488
- } },
5489
- { key: "state", label: "State", format: (v) => {
5490
- const s = String(v);
5491
- if (s === "R" || s === "Running") return pc5.green(s);
5492
- if (s === "Z" || s === "Zombie") return pc5.red(s);
5493
- if (s === "S" || s === "Sleeping") return pc5.cyan(s);
5494
- return pc5.dim(s);
5495
- } }
5496
- ];
5497
- const rows2 = processes.map((p) => ({ pid: p.pid, name: p.name, cpu: p.cpuPercent, mem: p.memPercent, state: formatProcessState(p.state) }));
5498
- console.error(`
5499
- ${symbols.fox} ${pc5.bold("System Processes")} ${pc5.dim(`(top ${processes.length} by ${sortBy})`)}
5500
- `);
5501
- console.error(renderTable(columns2, rows2));
5502
- console.error();
5503
- } catch (error) {
5504
- spinner.fail("Failed to scan processes");
5505
- console.error(renderError("Process scan failed", String(error)));
5506
- }
5507
- return;
5508
- }
5509
- const tracked = readTracked();
5510
- if (tracked.length === 0) {
5511
- console.error(`
5512
- ${pc5.dim("No tracked processes.")}`);
5513
- console.error(` ${pc5.dim("Start an app with:")} ${pc5.cyan("fennec start <command> --name <name>")}
5514
- `);
5515
- return;
5516
- }
5517
- const columns = [
5518
- { key: "name", label: "App", format: (v) => pc5.bold(String(v)) },
5519
- { key: "pid", label: "PID", align: "right" },
5520
- { key: "status", label: "Status", format: (v) => {
5521
- const s = v;
5522
- return s === "running" ? pc5.green("\u25CF running") : pc5.red("\u25CB stopped");
5523
- } },
5524
- { key: "port", label: "Port", format: (v) => {
5525
- const p = v;
5526
- return p ? pc5.yellow(`:${p}`) : pc5.dim("-");
5527
- } },
5528
- { key: "command", label: "Command", format: (v) => {
5529
- const c = String(v);
5530
- return c.length > 50 ? c.slice(0, 50) + "\u2026" : c;
5531
- } },
5532
- { key: "uptime", label: "Uptime", format: (v) => pc5.dim(String(v)) }
5533
- ];
5534
- const rows = tracked.map((t) => {
5535
- const running = isProcessRunning(t.pid);
5536
- const uptime = running ? formatUptime(Math.floor((Date.now() - new Date(t.startedAt).getTime()) / 1e3)) : "-";
5537
- return { name: t.name, pid: running ? String(t.pid) : pc5.dim(String(t.pid)), status: running ? "running" : "stopped", port: t.port ?? null, command: t.command, uptime };
5538
- });
5539
- const runningCount = tracked.filter((t) => isProcessRunning(t.pid)).length;
5540
- console.error(`
5541
- ${symbols.fox} ${pc5.bold("Fennec Apps")} ${pc5.dim(`(${runningCount}/${tracked.length} running)`)}
5542
- `);
5543
- console.error(renderTable(columns, rows));
5544
- console.error(` ${pc5.dim("Use")} ${pc5.cyan("fennec start <command> --name <name> --port <port>")} ${pc5.dim("to add more apps.")}`);
5545
- console.error(` ${pc5.dim("Use")} ${pc5.cyan("fennec log <name>")} ${pc5.dim("to view logs.")}`);
5546
- console.error(` ${pc5.dim("Use")} ${pc5.cyan("fennec kill <name>")} ${pc5.dim("to stop an app.")}`);
5547
- console.error();
5548
- }
5549
- async function statusCommand(_args) {
5550
- const watchFlag = _args.includes("-w") || _args.includes("--watch");
5551
- const tracked = readTracked();
5552
- const topSystem = getSystemProcesses({ userOnly: true, sortBy: "cpu", limit: 5 });
5553
- const totalUserProcs = getSystemProcesses({ userOnly: true }).length;
5554
- console.error(`
5555
- ${symbols.fox} ${pc5.bold("Fennec Status")}
5556
- `);
5557
- if (tracked.length > 0) {
5558
- const runningCount = tracked.filter((t) => isProcessRunning(t.pid)).length;
5559
- console.error(` ${pc5.bold("Managed Apps")} ${pc5.dim(`(${runningCount}/${tracked.length} running)`)}
5560
- `);
5561
- for (const t of tracked) {
5562
- const running = isProcessRunning(t.pid);
5563
- const statusIcon = running ? pc5.green("\u25CF") : pc5.red("\u25CB");
5564
- const portStr = t.port ? ` ${pc5.yellow(`:${t.port}`)}` : "";
5565
- const uptime = running ? pc5.dim(formatUptime(Math.floor((Date.now() - new Date(t.startedAt).getTime()) / 1e3))) : pc5.red("stopped");
5566
- console.error(` ${statusIcon} ${pc5.bold(t.name)}${portStr} ${pc5.dim(`(PID ${t.pid})`)} \u2014 ${uptime}`);
5567
- }
5568
- console.error();
5569
- } else {
5570
- console.error(` ${pc5.dim("No managed apps.")} ${pc5.cyan("fennec start <command> --name <name>")}
5571
- `);
5572
- }
5573
- console.error(` ${pc5.bold("System")} ${pc5.dim(`(${totalUserProcs} user processes)`)}`);
5574
- for (const p of topSystem) {
5575
- const cpuStr = p.cpuPercent > 10 ? pc5.red(`${p.cpuPercent}%`) : p.cpuPercent > 5 ? pc5.yellow(`${p.cpuPercent}%`) : pc5.dim(`${p.cpuPercent}%`);
5576
- const memStr = p.memPercent > 10 ? pc5.red(`${p.memPercent}%`) : p.memPercent > 5 ? pc5.yellow(`${p.memPercent}%`) : pc5.dim(`${p.memPercent}%`);
5577
- console.error(` ${pc5.dim(`PID ${p.pid}`)} ${pc5.bold(p.name)} \u2014 CPU: ${cpuStr} MEM: ${memStr}`);
2984
+ console.error(` ${pc5.red("\u25CF")} ${pc5.bold(`${failed} process(es) failed to resurrect`)}`);
5578
2985
  }
5579
- if (watchFlag) await watchSystemProcesses("cpu", 15);
5580
- console.error();
5581
- }
5582
- async function watchSystemProcesses(sortBy, limit) {
5583
- console.error(`
5584
- ${pc5.bold("Watching system processes")} ${pc5.dim("(Ctrl+C to stop, refreshes every 3s)")}
5585
- `);
5586
- const render = () => {
5587
- const processes = getSystemProcesses({ userOnly: true, sortBy, limit });
5588
- const columns = [
5589
- { key: "pid", label: "PID", align: "right", format: (v) => pc5.dim(String(v).padStart(6)) },
5590
- { key: "name", label: "Name", format: (v) => pc5.bold(String(v)) },
5591
- { key: "cpu", label: "CPU%", align: "right", format: (v) => {
5592
- const n = v;
5593
- return n > 10 ? pc5.red(String(n)) : n > 5 ? pc5.yellow(String(n)) : pc5.dim(String(n));
5594
- } },
5595
- { key: "mem", label: "MEM%", align: "right", format: (v) => {
5596
- const n = v;
5597
- return n > 10 ? pc5.red(String(n)) : n > 5 ? pc5.yellow(String(n)) : pc5.dim(String(n));
5598
- } },
5599
- { key: "state", label: "S", align: "center" }
5600
- ];
5601
- const rows = processes.map((p) => ({ pid: p.pid, name: p.name, cpu: p.cpuPercent, mem: p.memPercent, state: p.state }));
5602
- return ` ${timestamp()} ${pc5.dim(`${processes.length} processes`)}
5603
- ${renderTable(columns, rows, { compact: true })}`;
5604
- };
5605
- console.error(render());
5606
- const interval = setInterval(() => {
5607
- process.stdout.write("\x1B[J");
5608
- console.error(render());
5609
- }, 3e3);
5610
- await new Promise((resolve8) => {
5611
- process.once("SIGINT", () => {
5612
- clearInterval(interval);
5613
- process.stdout.write("\x1B[J");
5614
- resolve8();
5615
- });
5616
- });
5617
2986
  }
5618
2987
 
5619
2988
  // src/commands/kill.ts
@@ -5642,25 +3011,32 @@ async function killCommand(args2) {
5642
3011
  targetPid = pid;
5643
3012
  displayName = `PID ${pid}`;
5644
3013
  } else {
5645
- const matches = getSystemProcesses({ name: rawTarget, userOnly: true, sortBy: "cpu" });
5646
- if (matches.length === 0) {
5647
- console.error(renderError("Process not found", `No running process matching "${rawTarget}"`));
5648
- process.exit(1);
5649
- }
5650
- if (matches.length > 1) {
5651
- console.error(`
3014
+ const tracked = readTracked();
3015
+ const trackedMatch = tracked.find((t) => t.name === rawTarget);
3016
+ if (trackedMatch && isProcessRunning(trackedMatch.pid)) {
3017
+ targetPid = trackedMatch.pid;
3018
+ displayName = `${trackedMatch.name} (PID ${targetPid})`;
3019
+ } else {
3020
+ const matches = getSystemProcesses({ name: rawTarget, userOnly: true, sortBy: "cpu" });
3021
+ if (matches.length === 0) {
3022
+ console.error(renderError("Process not found", `No running process matching "${rawTarget}"`));
3023
+ process.exit(1);
3024
+ }
3025
+ if (matches.length > 1) {
3026
+ console.error(`
5652
3027
  ${pc6.bold(`Multiple processes match "${rawTarget}":`)}`);
5653
- const selected = await selectPrompt("Select which to kill:", matches.map((p, i) => ({ value: String(i), label: `${p.name} (PID ${p.pid})`, description: `${p.command.slice(0, 80)} \u2014 CPU: ${p.cpuPercent}% MEM: ${p.memPercent}%` })));
5654
- if (selected === null) {
5655
- console.error(` ${pc6.dim("Cancelled")}`);
5656
- return;
3028
+ const selected = await selectPrompt("Select which to kill:", matches.map((p, i) => ({ value: String(i), label: `${p.name} (PID ${p.pid})`, description: `${p.command.slice(0, 80)} \u2014 CPU: ${p.cpuPercent}% MEM: ${p.memPercent}%` })));
3029
+ if (selected === null) {
3030
+ console.error(` ${pc6.dim("Cancelled")}`);
3031
+ return;
3032
+ }
3033
+ const idx = parseInt(selected, 10);
3034
+ targetPid = matches[idx].pid;
3035
+ displayName = `${matches[idx].name} (PID ${targetPid})`;
3036
+ } else {
3037
+ targetPid = matches[0].pid;
3038
+ displayName = `${matches[0].name} (PID ${targetPid})`;
5657
3039
  }
5658
- const idx = parseInt(selected, 10);
5659
- targetPid = matches[idx].pid;
5660
- displayName = `${matches[idx].name} (PID ${targetPid})`;
5661
- } else {
5662
- targetPid = matches[0].pid;
5663
- displayName = `${matches[0].name} (PID ${targetPid})`;
5664
3040
  }
5665
3041
  }
5666
3042
  const confirmed = await confirmPrompt(`Kill ${pc6.bold(displayName)} with ${pc6.yellow(signal)}?`, false);
@@ -5813,7 +3189,7 @@ async function restartCommand(args2) {
5813
3189
  }
5814
3190
 
5815
3191
  // src/commands/log.ts
5816
- import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
3192
+ import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
5817
3193
  import { resolve as resolve5 } from "path";
5818
3194
  import { homedir as homedir4 } from "os";
5819
3195
  import { spawn as spawn3, execSync as execSync2 } from "child_process";
@@ -5845,7 +3221,7 @@ async function logCommand(args2) {
5845
3221
  try {
5846
3222
  let logLines = [];
5847
3223
  if (logFilePath && existsSync4(logFilePath)) {
5848
- const content = readFileSync4(logFilePath, "utf-8");
3224
+ const content = readFileSync3(logFilePath, "utf-8");
5849
3225
  logLines = content.split("\n").filter(Boolean);
5850
3226
  } else {
5851
3227
  const pid = trackedMatch?.pid ?? parseInt(target, 10);
@@ -5878,8 +3254,12 @@ async function logCommand(args2) {
5878
3254
  ${pc8.dim("Following... (Ctrl+C to stop)")}
5879
3255
  `);
5880
3256
  const tail = spawn3("tail", ["-n", "0", "-f", logFilePath], { stdio: "inherit" });
5881
- tail.on("exit", () => process.exit(0));
5882
- await new Promise(() => {
3257
+ await new Promise((resolve8) => {
3258
+ tail.on("exit", () => resolve8());
3259
+ process.once("SIGINT", () => {
3260
+ tail.kill("SIGTERM");
3261
+ resolve8();
3262
+ });
5883
3263
  });
5884
3264
  }
5885
3265
  console.error();
@@ -5890,6 +3270,7 @@ async function logCommand(args2) {
5890
3270
  }
5891
3271
 
5892
3272
  // src/commands/attach.ts
3273
+ import { PortDetector as PortDetector3 } from "@plumpslabs/fennec-core";
5893
3274
  import pc9 from "picocolors";
5894
3275
  async function attachCommand(args2) {
5895
3276
  const port = parseInt(args2[0], 10);
@@ -5902,8 +3283,7 @@ async function attachCommand(args2) {
5902
3283
  const name = rawName ?? `port-${port}`;
5903
3284
  const spinner = createSpinner(`Attaching to :${port}...`);
5904
3285
  try {
5905
- const { PortDetector } = await import("@plumpslabs/fennec-core");
5906
- const detector = new PortDetector();
3286
+ const detector = new PortDetector3();
5907
3287
  const info = detector.detectByPort(port);
5908
3288
  if (info) {
5909
3289
  spinner.succeed(`Attached to :${port}`);
@@ -6228,466 +3608,4 @@ main().catch((error) => {
6228
3608
  console.error(renderError("Fatal error", String(error)));
6229
3609
  process.exit(1);
6230
3610
  });
6231
- /*! Bundled license information:
6232
-
6233
- cfonts/lib/constants.js:
6234
- (***************************************************************************************************************************************************************
6235
- *
6236
- * cfonts
6237
- *
6238
- * Sexy fonts for the console. (CLI output)
6239
- *
6240
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6241
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6242
- * @repository https://github.com/dominikwilkowski/cfonts
6243
- *
6244
- * Constants
6245
- * CHARS
6246
- * COLORS
6247
- * BGCOLORS
6248
- * GRADIENTCOLORS
6249
- * ALIGNMENT
6250
- * FONTFACES
6251
- * CLIOPTIONS
6252
- * PACKAGE
6253
- *
6254
- **************************************************************************************************************************************************************)
6255
-
6256
- cfonts/lib/DisplayVersion.js:
6257
- (***************************************************************************************************************************************************************
6258
- *
6259
- * cfonts
6260
- *
6261
- * Sexy fonts for the console. (CLI output)
6262
- *
6263
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6264
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6265
- * @repository https://github.com/dominikwilkowski/cfonts
6266
- *
6267
- * DisplayVersion
6268
- * Display the version of this package
6269
- *
6270
- **************************************************************************************************************************************************************)
6271
-
6272
- cfonts/lib/Options.js:
6273
- (***************************************************************************************************************************************************************
6274
- *
6275
- * cfonts
6276
- *
6277
- * Sexy fonts for the console. (CLI output)
6278
- *
6279
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6280
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6281
- * @repository https://github.com/dominikwilkowski/cfonts
6282
- *
6283
- * Options
6284
- * Merge user settings with default options
6285
- *
6286
- **************************************************************************************************************************************************************)
6287
-
6288
- cfonts/lib/Color.js:
6289
- (***************************************************************************************************************************************************************
6290
- *
6291
- * cfonts
6292
- *
6293
- * Sexy fonts for the console. (CLI output)
6294
- *
6295
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6296
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6297
- * @repository https://github.com/dominikwilkowski/cfonts
6298
- *
6299
- * HEXTEST - Regex to see if a string is a hex color
6300
- * Rgb2hsv - Converts an RGB color value to HSV
6301
- * Hsv2rgb - Converts an HSV color value to RGB
6302
- * Rgb2hex - Converts RGB to HEX
6303
- * Hex2rgb - Convert HEX to RGB
6304
- * Hsv2hsvRad - Convert HSV coordinate to HSVrad (degree to radian)
6305
- * HsvRad2hsv - Convert HSVrad color to HSV (radian to degree)
6306
- * Hex2hsvRad - Convert HEX to HSVrad
6307
- * HsvRad2hex - Convert HSVrad to HEX
6308
- * rgb2ansi_16m - - Convert RGB values to ANSI16 million colors - truecolor
6309
- * rgb2ansi256Code - Convert RGB values to ANSI256 escape code
6310
- * rgb2ansi_256 - Convert RGB values to ANSI256
6311
- * ansi_2562ansi_16 - Convert ANSI256 code values to ANSI16
6312
- * get_term_color_support - Detect the ANSI support for the current terminal taking into account env vars NO_COLOR and FORCE_COLOR
6313
- * Color - Abstraction for coloring hex-, keyword- and background-colors
6314
- *
6315
- **************************************************************************************************************************************************************)
6316
-
6317
- cfonts/lib/Debugging.js:
6318
- (***************************************************************************************************************************************************************
6319
- *
6320
- * cfonts
6321
- *
6322
- * Sexy fonts for the console. (CLI output)
6323
- *
6324
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6325
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6326
- * @repository https://github.com/dominikwilkowski/cfonts
6327
- *
6328
- * Debugging
6329
- * Debugging prettiness
6330
- *
6331
- **************************************************************************************************************************************************************)
6332
-
6333
- cfonts/lib/Colorize.js:
6334
- (***************************************************************************************************************************************************************
6335
- *
6336
- * cfonts
6337
- *
6338
- * Sexy fonts for the console. (CLI output)
6339
- *
6340
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6341
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6342
- * @repository https://github.com/dominikwilkowski/cfonts
6343
- *
6344
- * Colorize
6345
- * Replace placeholders with color information
6346
- *
6347
- **************************************************************************************************************************************************************)
6348
-
6349
- cfonts/lib/AddLetterSpacing.js:
6350
- (***************************************************************************************************************************************************************
6351
- *
6352
- * cfonts
6353
- *
6354
- * Sexy fonts for the console. (CLI output)
6355
- *
6356
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6357
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6358
- * @repository https://github.com/dominikwilkowski/cfonts
6359
- *
6360
- * AddLetterSpacing
6361
- * Add letter spacing for the next character
6362
- *
6363
- **************************************************************************************************************************************************************)
6364
-
6365
- cfonts/lib/GetFirstCharacterPosition.js:
6366
- (***************************************************************************************************************************************************************
6367
- *
6368
- * cfonts
6369
- *
6370
- * Sexy fonts for the console. (CLI output)
6371
- *
6372
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6373
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6374
- * @repository https://github.com/dominikwilkowski/cfonts
6375
- *
6376
- * GetFirstCharacterPosition
6377
- * Get the position of the first character out of all strings inside an array
6378
- *
6379
- **************************************************************************************************************************************************************)
6380
-
6381
- cfonts/lib/GetLongestLine.js:
6382
- (***************************************************************************************************************************************************************
6383
- *
6384
- * cfonts
6385
- *
6386
- * Sexy fonts for the console. (CLI output)
6387
- *
6388
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6389
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6390
- * @repository https://github.com/dominikwilkowski/cfonts
6391
- *
6392
- * GetLongestLine
6393
- * Return the longest line of an Array
6394
- *
6395
- **************************************************************************************************************************************************************)
6396
-
6397
- cfonts/lib/Gradient.js:
6398
- (***************************************************************************************************************************************************************
6399
- *
6400
- * cfonts
6401
- *
6402
- * Sexy fonts for the console. (CLI output)
6403
- *
6404
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6405
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6406
- * @repository https://github.com/dominikwilkowski/cfonts
6407
- *
6408
- * GetLinear - Interpolate a linear path from a number to another number
6409
- * GetTheta - Interpolate a radial path from a number to another number
6410
- * GetGradientColors - Generate the most colorful delta between two colors
6411
- * PaintLines - Take a bunch of lines and color them in the colors provided
6412
- * Color2hex - Make sure a color is hex
6413
- * GetGaps - Calculate the gaps between an array of points
6414
- * TransitionBetweenHex - Generate colors between two given colors
6415
- * Transition - Generate n colors between x colors
6416
- * PaintGradient - Paint finished output in a gradient
6417
- *
6418
- **************************************************************************************************************************************************************)
6419
-
6420
- cfonts/lib/CharLength.js:
6421
- (***************************************************************************************************************************************************************
6422
- *
6423
- * cfonts
6424
- *
6425
- * Sexy fonts for the console. (CLI output)
6426
- *
6427
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6428
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6429
- * @repository https://github.com/dominikwilkowski/cfonts
6430
- *
6431
- * CharLength
6432
- * Return the max width of a character by looking at its longest line
6433
- *
6434
- **************************************************************************************************************************************************************)
6435
-
6436
- cfonts/lib/CheckInput.js:
6437
- (***************************************************************************************************************************************************************
6438
- *
6439
- * cfonts
6440
- *
6441
- * Sexy fonts for the console. (CLI output)
6442
- *
6443
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6444
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6445
- * @repository https://github.com/dominikwilkowski/cfonts
6446
- *
6447
- * CheckInput
6448
- * Check input for human errors
6449
- *
6450
- **************************************************************************************************************************************************************)
6451
-
6452
- cfonts/lib/CleanInput.js:
6453
- (***************************************************************************************************************************************************************
6454
- *
6455
- * cfonts
6456
- *
6457
- * Sexy fonts for the console. (CLI output)
6458
- *
6459
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6460
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6461
- * @repository https://github.com/dominikwilkowski/cfonts
6462
- *
6463
- * CleanInput
6464
- * Filter only allowed character
6465
- *
6466
- **************************************************************************************************************************************************************)
6467
-
6468
- define-property/index.js:
6469
- (*!
6470
- * define-property <https://github.com/jonschlinkert/define-property>
6471
- *
6472
- * Copyright (c) 2015, 2017, Jon Schlinkert.
6473
- * Released under the MIT License.
6474
- *)
6475
-
6476
- is-buffer/index.js:
6477
- (*!
6478
- * Determine if an object is a Buffer
6479
- *
6480
- * @author Feross Aboukhadijeh <https://feross.org>
6481
- * @license MIT
6482
- *)
6483
-
6484
- is-number/index.js:
6485
- (*!
6486
- * is-number <https://github.com/jonschlinkert/is-number>
6487
- *
6488
- * Copyright (c) 2014-2015, Jon Schlinkert.
6489
- * Licensed under the MIT License.
6490
- *)
6491
-
6492
- window-size/utils.js:
6493
- window-size/index.js:
6494
- (*!
6495
- * window-size <https://github.com/jonschlinkert/window-size>
6496
- *
6497
- * Copyright (c) 2014-2017, Jon Schlinkert.
6498
- * Released under the MIT License.
6499
- *)
6500
-
6501
- cfonts/lib/Size.js:
6502
- (***************************************************************************************************************************************************************
6503
- *
6504
- * cfonts
6505
- *
6506
- * Sexy fonts for the console. (CLI output)
6507
- *
6508
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6509
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6510
- * @repository https://github.com/dominikwilkowski/cfonts
6511
- *
6512
- * Size
6513
- * Abstraction for windows size
6514
- *
6515
- **************************************************************************************************************************************************************)
6516
-
6517
- cfonts/lib/AlignText.js:
6518
- (***************************************************************************************************************************************************************
6519
- *
6520
- * cfonts
6521
- *
6522
- * Sexy fonts for the console. (CLI output)
6523
- *
6524
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6525
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6526
- * @repository https://github.com/dominikwilkowski/cfonts
6527
- *
6528
- * AlignText
6529
- * Calculate the spaces to be added to the left of each line to align them either center or right
6530
- *
6531
- **************************************************************************************************************************************************************)
6532
-
6533
- cfonts/lib/AddLine.js:
6534
- (***************************************************************************************************************************************************************
6535
- *
6536
- * cfonts
6537
- *
6538
- * Sexy fonts for the console. (CLI output)
6539
- *
6540
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6541
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6542
- * @repository https://github.com/dominikwilkowski/cfonts
6543
- *
6544
- * AddLine
6545
- * Add a new line to the output array
6546
- *
6547
- **************************************************************************************************************************************************************)
6548
-
6549
- cfonts/lib/AddChar.js:
6550
- (***************************************************************************************************************************************************************
6551
- *
6552
- * cfonts
6553
- *
6554
- * Sexy fonts for the console. (CLI output)
6555
- *
6556
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6557
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6558
- * @repository https://github.com/dominikwilkowski/cfonts
6559
- *
6560
- * AddChar
6561
- * Add a new character to the output array
6562
- *
6563
- **************************************************************************************************************************************************************)
6564
-
6565
- cfonts/lib/GetFont.js:
6566
- (***************************************************************************************************************************************************************
6567
- *
6568
- * cfonts
6569
- *
6570
- * Sexy fonts for the console. (CLI output)
6571
- *
6572
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6573
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6574
- * @repository https://github.com/dominikwilkowski/cfonts
6575
- *
6576
- * GetFont
6577
- * Get a selected JSON font-file object
6578
- *
6579
- **************************************************************************************************************************************************************)
6580
-
6581
- cfonts/lib/Log.js:
6582
- (***************************************************************************************************************************************************************
6583
- *
6584
- * cfonts
6585
- *
6586
- * Sexy fonts for the console. (CLI output)
6587
- *
6588
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6589
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6590
- * @repository https://github.com/dominikwilkowski/cfonts
6591
- *
6592
- * Log
6593
- * Logging prettiness
6594
- *
6595
- **************************************************************************************************************************************************************)
6596
-
6597
- cfonts/lib/Render.js:
6598
- (***************************************************************************************************************************************************************
6599
- *
6600
- * cfonts
6601
- *
6602
- * Sexy fonts for the console. (CLI output)
6603
- *
6604
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6605
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6606
- * @repository https://github.com/dominikwilkowski/cfonts
6607
- *
6608
- * Render
6609
- * Main method to get the ANSI output for a string
6610
- *
6611
- **************************************************************************************************************************************************************)
6612
-
6613
- cfonts/lib/DisplayHelp.js:
6614
- (***************************************************************************************************************************************************************
6615
- *
6616
- * cfonts
6617
- *
6618
- * Sexy fonts for the console. (CLI output)
6619
- *
6620
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6621
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6622
- * @repository https://github.com/dominikwilkowski/cfonts
6623
- *
6624
- * DisplayHelp
6625
- * Display the help generated from our CLIOPTIONS
6626
- *
6627
- **************************************************************************************************************************************************************)
6628
-
6629
- cfonts/lib/AddShortcuts.js:
6630
- (***************************************************************************************************************************************************************
6631
- *
6632
- * cfonts
6633
- *
6634
- * Sexy fonts for the console. (CLI output)
6635
- *
6636
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6637
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6638
- * @repository https://github.com/dominikwilkowski/cfonts
6639
- *
6640
- * AddShortcuts
6641
- * Flatten the shortcuts in our cli options object
6642
- *
6643
- **************************************************************************************************************************************************************)
6644
-
6645
- cfonts/lib/ParseArgs.js:
6646
- (***************************************************************************************************************************************************************
6647
- *
6648
- * cfonts
6649
- *
6650
- * Sexy fonts for the console. (CLI output)
6651
- *
6652
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6653
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6654
- * @repository https://github.com/dominikwilkowski/cfonts
6655
- *
6656
- * ParseArgs
6657
- * Parse cli arguments into a nice object
6658
- *
6659
- **************************************************************************************************************************************************************)
6660
-
6661
- cfonts/lib/Say.js:
6662
- (***************************************************************************************************************************************************************
6663
- *
6664
- * cfonts
6665
- *
6666
- * Sexy fonts for the console. (CLI output)
6667
- *
6668
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6669
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6670
- * @repository https://github.com/dominikwilkowski/cfonts
6671
- *
6672
- * Say
6673
- * Print to console
6674
- *
6675
- **************************************************************************************************************************************************************)
6676
-
6677
- cfonts/lib/index.js:
6678
- (***************************************************************************************************************************************************************
6679
- *
6680
- * cfonts
6681
- *
6682
- * Sexy fonts for the console. (CLI output)
6683
- *
6684
- * @license https://github.com/dominikwilkowski/cfonts/blob/released/LICENSE GNU GPL-3.0-or-later
6685
- * @author Dominik Wilkowski hi@dominik-wilkowski.com
6686
- * @repository https://github.com/dominikwilkowski/cfonts
6687
- *
6688
- * Cli
6689
- * Run cli commands
6690
- *
6691
- **************************************************************************************************************************************************************)
6692
- */
6693
3611
  //# sourceMappingURL=index.js.map