gemkit-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Richard Ng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # GemKit CLI
2
+
3
+ A command-line interface for working with Gemini AI agents, plans, and sessions.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g gemkit-cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ gk <command> [options]
15
+ ```
16
+
17
+ ### Global Options
18
+
19
+ - `--verbose` - Enable verbose output
20
+ - `--json` - Output as JSON
21
+ - `--help` - Show help
22
+ - `--version` - Show version
23
+
24
+ ### Commands
25
+
26
+ | Command | Description |
27
+ |---------|-------------|
28
+ | `gk init` | Initialize GemKit in your project |
29
+ | `gk new` | Create new agents, plans, or skills |
30
+ | `gk agent` | Manage and spawn AI agents |
31
+ | `gk session` | View and manage sessions |
32
+ | `gk plan` | Work with execution plans |
33
+ | `gk tokens` | Analyze token usage and costs |
34
+ | `gk config` | Manage configuration |
35
+ | `gk cache` | Manage local cache |
36
+ | `gk update` | Update GemKit components |
37
+ | `gk versions` | Show available versions |
38
+ | `gk doctor` | Diagnose issues |
39
+ | `gk extension` | Manage extensions |
40
+ | `gk catalog` | Browse available kits |
41
+ | `gk convert` | Convert between formats |
42
+ | `gk paste-image` | Handle image pasting |
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ # Initialize in your project
48
+ gk init
49
+
50
+ # Spawn an agent
51
+ gk agent spawn "Help me write a function"
52
+
53
+ # View session history
54
+ gk session list
55
+ ```
56
+
57
+ ## Requirements
58
+
59
+ - Node.js >= 18
60
+
61
+ ## Links
62
+
63
+ - [Website](https://gemkit.cc)
64
+ - [GitHub](https://github.com/therichardngai-code/gemkit-cli)
65
+ - [Issues](https://github.com/therichardngai-code/gemkit-cli/issues)
66
+
67
+ ## License
68
+
69
+ MIT
package/dist/index.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ var xf=Object.create;var Yl=Object.defineProperty;var _f=Object.getOwnPropertyDescriptor;var Af=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,Rf=Object.prototype.hasOwnProperty;var Ci=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var kf=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Af(e))!Rf.call(t,n)&&n!==s&&Yl(t,n,{get:()=>e[n],enumerable:!(i=_f(e,n))||i.enumerable});return t};var Si=(t,e,s)=>(s=t!=null?xf(vf(t)):{},kf(e||!t||!t.__esModule?Yl(s,"default",{value:t,enumerable:!0}):s,t));var Ea=Ci((t0,dh)=>{dh.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var No=Ci((s0,ba)=>{"use strict";var Pi=Object.assign({},Ea()),Fa=Object.keys(Pi);Object.defineProperty(Pi,"random",{get(){let t=Math.floor(Math.random()*Fa.length),e=Fa[t];return Pi[e]}});ba.exports=Pi});var _a=Ci((g0,xa)=>{xa.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var gc=Ci((ey,ml)=>{var Yn=process||{},dc=Yn.argv||[],Vn=Yn.env||{},sg=!(Vn.NO_COLOR||dc.includes("--no-color"))&&(!!Vn.FORCE_COLOR||dc.includes("--color")||Yn.platform==="win32"||(Yn.stdout||{}).isTTY&&Vn.TERM!=="dumb"||!!Vn.CI),ig=(t,e,s=t)=>i=>{let n=""+i,o=n.indexOf(e,t.length);return~o?t+ng(n,e,s,o)+e:t+n+e},ng=(t,e,s,i)=>{let n="",o=0;do n+=t.substring(o,i)+s,o=i+e.length,i=t.indexOf(e,o);while(~i);return n+t.substring(o)},mc=(t=sg)=>{let e=t?ig:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ml.exports=mc();ml.exports.createColors=mc});import{EventEmitter as Tf}from"events";function yo(t){return t==null?[]:Array.isArray(t)?t:[t]}function If(t,e,s,i){var n,o=t[e],r=~i.string.indexOf(e)?s==null||s===!0?"":String(s):typeof s=="boolean"?s:~i.boolean.indexOf(e)?s==="false"?!1:s==="true"||(t._.push((n=+s,n*0===0?n:s)),!!s):(n=+s,n*0===0?n:s);t[e]=o==null?r:Array.isArray(o)?o.concat(r):[o,r]}function Of(t,e){t=t||[],e=e||{};var s,i,n,o,r,a={_:[]},u=0,c=0,f=0,h=t.length;let g=e.alias!==void 0,m=e.unknown!==void 0,D=e.default!==void 0;if(e.alias=e.alias||{},e.string=yo(e.string),e.boolean=yo(e.boolean),g)for(s in e.alias)for(i=e.alias[s]=yo(e.alias[s]),u=0;u<i.length;u++)(e.alias[i[u]]=i.concat(s)).splice(u,1);for(u=e.boolean.length;u-- >0;)for(i=e.alias[e.boolean[u]]||[],c=i.length;c-- >0;)e.boolean.push(i[c]);for(u=e.string.length;u-- >0;)for(i=e.alias[e.string[u]]||[],c=i.length;c-- >0;)e.string.push(i[c]);if(D){for(s in e.default)if(o=typeof e.default[s],i=e.alias[s]=e.alias[s]||[],e[o]!==void 0)for(e[o].push(s),u=0;u<i.length;u++)e[o].push(i[u])}let F=m?Object.keys(e.alias):[];for(u=0;u<h;u++){if(n=t[u],n==="--"){a._=a._.concat(t.slice(++u));break}for(c=0;c<n.length&&n.charCodeAt(c)===45;c++);if(c===0)a._.push(n);else if(n.substring(c,c+3)==="no-"){if(o=n.substring(c+3),m&&!~F.indexOf(o))return e.unknown(n);a[o]=!1}else{for(f=c+1;f<n.length&&n.charCodeAt(f)!==61;f++);for(o=n.substring(c,f),r=n.substring(++f)||u+1===h||(""+t[u+1]).charCodeAt(0)===45||t[++u],i=c===2?[o]:o,f=0;f<i.length;f++){if(o=i[f],m&&!~F.indexOf(o))return e.unknown("-".repeat(c)+o);If(a,o,f+1<i.length||r,e)}}}if(D)for(s in e.default)a[s]===void 0&&(a[s]=e.default[s]);if(g)for(s in a)for(i=e.alias[s]||[];i.length>0;)a[i.shift()]=a[s];return a}var Xl=t=>t.replace(/[<[].+/,"").trim(),Pf=t=>{let e=/<([^>]+)>/g,s=/\[([^\]]+)\]/g,i=[],n=a=>{let u=!1,c=a[1];return c.startsWith("...")&&(c=c.slice(3),u=!0),{required:a[0].startsWith("<"),value:c,variadic:u}},o;for(;o=e.exec(t);)i.push(n(o));let r;for(;r=s.exec(t);)i.push(n(r));return i},Bf=t=>{let e={alias:{},boolean:[]};for(let[s,i]of t.entries())i.names.length>1&&(e.alias[i.names[0]]=i.names.slice(1)),i.isBoolean&&(i.negated&&t.some((o,r)=>r!==s&&o.names.some(a=>i.names.includes(a))&&typeof o.required=="boolean")||e.boolean.push(i.names[0]));return e},ql=t=>t.sort((e,s)=>e.length>s.length?-1:1)[0],Zl=(t,e)=>t.length>=e?t:`${t}${" ".repeat(e-t.length)}`,Nf=t=>t.replace(/([a-z])-([a-z])/g,(e,s,i)=>s+i.toUpperCase()),$f=(t,e,s)=>{let i=0,n=e.length,o=t,r;for(;i<n;++i)r=o[e[i]],o=o[e[i]]=i===n-1?s:r??(~e[i+1].indexOf(".")||!(+e[i+1]>-1)?{}:[])},Lf=(t,e)=>{for(let s of Object.keys(e)){let i=e[s];i.shouldTransform&&(t[s]=Array.prototype.concat.call([],t[s]),typeof i.transformFunction=="function"&&(t[s]=t[s].map(i.transformFunction)))}},Mf=t=>{let e=/([^\\\/]+)$/.exec(t);return e?e[1]:""},Ql=t=>t.split(".").map((e,s)=>s===0?Nf(e):e).join("."),Ss=class extends Error{constructor(e){super(e),this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}},Co=class{constructor(e,s,i){this.rawName=e,this.description=s,this.config=Object.assign({},i),e=e.replace(/\.\*/g,""),this.negated=!1,this.names=Xl(e).split(",").map(n=>{let o=n.trim().replace(/^-{1,2}/,"");return o.startsWith("no-")&&(this.negated=!0,o=o.replace(/^no-/,"")),Ql(o)}).sort((n,o)=>n.length>o.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null&&(this.config.default=!0),e.includes("<")?this.required=!0:e.includes("[")?this.required=!1:this.isBoolean=!0}},Gf=process.argv,jf=`${process.platform}-${process.arch} node-${process.version}`,xi=class{constructor(e,s,i={},n){this.rawName=e,this.description=s,this.config=i,this.cli=n,this.options=[],this.aliasNames=[],this.name=Xl(e),this.args=Pf(e),this.examples=[]}usage(e){return this.usageText=e,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(e,s="-v, --version"){return this.versionNumber=e,this.option(s,"Display version number"),this}example(e){return this.examples.push(e),this}option(e,s,i){let n=new Co(e,s,i);return this.options.push(n),this}alias(e){return this.aliasNames.push(e),this}action(e){return this.commandAction=e,this}isMatched(e){return this.name===e||this.aliasNames.includes(e)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof _i}hasOption(e){return e=e.split(".")[0],this.options.find(s=>s.names.includes(e))}outputHelp(){let{name:e,commands:s}=this.cli,{versionNumber:i,options:n,helpCallback:o}=this.cli.globalCommand,r=[{body:`${e}${i?`/${i}`:""}`}];if(r.push({title:"Usage",body:` $ ${e} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&s.length>0){let c=ql(s.map(f=>f.rawName));r.push({title:"Commands",body:s.map(f=>` ${Zl(f.rawName,c.length)} ${f.description}`).join(`
3
+ `)}),r.push({title:"For more info, run any command with the `--help` flag",body:s.map(f=>` $ ${e}${f.name===""?"":` ${f.name}`} --help`).join(`
4
+ `)})}let u=this.isGlobalCommand?n:[...this.options,...n||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand&&(u=u.filter(c=>c.name!=="version")),u.length>0){let c=ql(u.map(f=>f.rawName));r.push({title:"Options",body:u.map(f=>` ${Zl(f.rawName,c.length)} ${f.description} ${f.config.default===void 0?"":`(default: ${f.config.default})`}`).join(`
5
+ `)})}this.examples.length>0&&r.push({title:"Examples",body:this.examples.map(c=>typeof c=="function"?c(e):c).join(`
6
+ `)}),o&&(r=o(r)||r),console.log(r.map(c=>c.title?`${c.title}:
7
+ ${c.body}`:c.body).join(`
8
+
9
+ `))}outputVersion(){let{name:e}=this.cli,{versionNumber:s}=this.cli.globalCommand;s&&console.log(`${e}/${s} ${jf}`)}checkRequiredArgs(){let e=this.args.filter(s=>s.required).length;if(this.cli.args.length<e)throw new Ss(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:e,globalCommand:s}=this.cli;if(!this.config.allowUnknownOptions){for(let i of Object.keys(e))if(i!=="--"&&!this.hasOption(i)&&!s.hasOption(i))throw new Ss(`Unknown option \`${i.length>1?`--${i}`:`-${i}`}\``)}}checkOptionValue(){let{options:e,globalCommand:s}=this.cli,i=[...s.options,...this.options];for(let n of i){let o=e[n.name.split(".")[0]];if(n.required){let r=i.some(a=>a.negated&&a.names.includes(n.name));if(o===!0||o===!1&&!r)throw new Ss(`option \`${n.rawName}\` value is missing`)}}}},_i=class extends xi{constructor(e){super("@@global@@","",{},e)}},wi=Object.assign,So=class extends Tf{constructor(e=""){super(),this.name=e,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new _i(this),this.globalCommand.usage("<command> [options]")}usage(e){return this.globalCommand.usage(e),this}command(e,s,i){let n=new xi(e,s||"",i,this);return n.globalCommand=this.globalCommand,this.commands.push(n),n}option(e,s,i){return this.globalCommand.option(e,s,i),this}help(e){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=e,this.showHelpOnExit=!0,this}version(e,s="-v, --version"){return this.globalCommand.version(e,s),this.showVersionOnExit=!0,this}example(e){return this.globalCommand.example(e),this}outputHelp(){this.matchedCommand?this.matchedCommand.outputHelp():this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:s},i,n){return this.args=e,this.options=s,i&&(this.matchedCommand=i),n&&(this.matchedCommandName=n),this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(e=Gf,{run:s=!0}={}){this.rawArgs=e,this.name||(this.name=e[1]?Mf(e[1]):"cli");let i=!0;for(let o of this.commands){let r=this.mri(e.slice(2),o),a=r.args[0];if(o.isMatched(a)){i=!1;let u=wi(wi({},r),{args:r.args.slice(1)});this.setParsedInfo(u,o,a),this.emit(`command:${a}`,o)}}if(i){for(let o of this.commands)if(o.name===""){i=!1;let r=this.mri(e.slice(2),o);this.setParsedInfo(r,o),this.emit("command:!",o)}}if(i){let o=this.mri(e.slice(2));this.setParsedInfo(o)}this.options.help&&this.showHelpOnExit&&(this.outputHelp(),s=!1,this.unsetMatchedCommand()),this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null&&(this.outputVersion(),s=!1,this.unsetMatchedCommand());let n={args:this.args,options:this.options};return s&&this.runMatchedCommand(),!this.matchedCommand&&this.args[0]&&this.emit("command:*"),n}mri(e,s){let i=[...this.globalCommand.options,...s?s.options:[]],n=Bf(i),o=[],r=e.indexOf("--");r>-1&&(o=e.slice(r+1),e=e.slice(0,r));let a=Of(e,n);a=Object.keys(a).reduce((g,m)=>wi(wi({},g),{[Ql(m)]:a[m]}),{_:[]});let u=a._,c={"--":o},f=s&&s.config.ignoreOptionDefaultValue?s.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,h=Object.create(null);for(let g of i){if(!f&&g.config.default!==void 0)for(let m of g.names)c[m]=g.config.default;Array.isArray(g.config.type)&&h[g.name]===void 0&&(h[g.name]=Object.create(null),h[g.name].shouldTransform=!0,h[g.name].transformFunction=g.config.type[0])}for(let g of Object.keys(a))if(g!=="_"){let m=g.split(".");$f(c,m,a[g]),Lf(c,h)}return{args:u,options:c}}runMatchedCommand(){let{args:e,options:s,matchedCommand:i}=this;if(!i||!i.commandAction)return;i.checkUnknownOptions(),i.checkOptionValue(),i.checkRequiredArgs();let n=[];return i.args.forEach((o,r)=>{o.variadic?n.push(e.slice(r)):n.push(e[r])}),n.push(s),i.commandAction.apply(this,n)}},ea=(t="")=>new So(t);import{existsSync as dg}from"fs";import{join as mg}from"path";import{spawn as gg}from"child_process";import Bi from"node:process";var ta=(t=0)=>e=>`\x1B[${e+t}m`,sa=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,ia=(t=0)=>(e,s,i)=>`\x1B[${38+t};2;${e};${s};${i}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},AD=Object.keys(x.modifier),Uf=Object.keys(x.color),zf=Object.keys(x.bgColor),vD=[...Uf,...zf];function Hf(){let t=new Map;for(let[e,s]of Object.entries(x)){for(let[i,n]of Object.entries(s))x[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},s[i]=x[i],t.set(n[0],n[1]);Object.defineProperty(x,e,{value:s,enumerable:!1})}return Object.defineProperty(x,"codes",{value:t,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=ta(),x.color.ansi256=sa(),x.color.ansi16m=ia(),x.bgColor.ansi=ta(10),x.bgColor.ansi256=sa(10),x.bgColor.ansi16m=ia(10),Object.defineProperties(x,{rgbToAnsi256:{value(e,s,i){return e===s&&s===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!s)return[0,0,0];let[i]=s;i.length===3&&(i=[...i].map(o=>o+o).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>x.rgbToAnsi256(...x.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let s,i,n;if(e>=232)s=((e-232)*10+8)/255,i=s,n=s;else{e-=16;let a=e%36;s=Math.floor(e/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let o=Math.max(s,i,n)*2;if(o===0)return 30;let r=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(s));return o===2&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(e,s,i)=>x.ansi256ToAnsi(x.rgbToAnsi256(e,s,i)),enumerable:!1},hexToAnsi:{value:e=>x.ansi256ToAnsi(x.hexToAnsi256(e)),enumerable:!1}}),x}var Wf=Hf(),de=Wf;import wo from"node:process";import Kf from"node:os";import na from"node:tty";function le(t,e=globalThis.Deno?globalThis.Deno.args:wo.argv){let s=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(s+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}var{env:_}=wo,Ai;le("no-color")||le("no-colors")||le("color=false")||le("color=never")?Ai=0:(le("color")||le("colors")||le("color=true")||le("color=always"))&&(Ai=1);function Jf(){if("FORCE_COLOR"in _)return _.FORCE_COLOR==="true"?1:_.FORCE_COLOR==="false"?0:_.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_.FORCE_COLOR,10),3)}function Vf(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Yf(t,{streamIsTTY:e,sniffFlags:s=!0}={}){let i=Jf();i!==void 0&&(Ai=i);let n=s?Ai:i;if(n===0)return 0;if(s){if(le("color=16m")||le("color=full")||le("color=truecolor"))return 3;if(le("color=256"))return 2}if("TF_BUILD"in _&&"AGENT_NAME"in _)return 1;if(t&&!e&&n===void 0)return 0;let o=n||0;if(_.TERM==="dumb")return o;if(wo.platform==="win32"){let r=Kf.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in _)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(r=>r in _)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(r=>r in _)||_.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in _)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION)?1:0;if(_.COLORTERM==="truecolor"||_.TERM==="xterm-kitty"||_.TERM==="xterm-ghostty"||_.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _){let r=Number.parseInt((_.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM)||"COLORTERM"in _?1:o}function oa(t,e={}){let s=Yf(t,{streamIsTTY:t&&t.isTTY,...e});return Vf(s)}var qf={stdout:oa({isTTY:na.isatty(1)}),stderr:oa({isTTY:na.isatty(2)})},ra=qf;function la(t,e,s){let i=t.indexOf(e);if(i===-1)return t;let n=e.length,o=0,r="";do r+=t.slice(o,i)+e+s,o=i+n,i=t.indexOf(e,o);while(i!==-1);return r+=t.slice(o),r}function aa(t,e,s,i){let n=0,o="";do{let r=t[i-1]==="\r";o+=t.slice(n,r?i-1:i)+e+(r?`\r
10
+ `:`
11
+ `)+s,n=i+1,i=t.indexOf(`
12
+ `,n)}while(i!==-1);return o+=t.slice(n),o}var{stdout:ua,stderr:ca}=ra,xo=Symbol("GENERATOR"),Vt=Symbol("STYLER"),ws=Symbol("IS_EMPTY"),fa=["ansi","ansi","ansi256","ansi16m"],Yt=Object.create(null),Zf=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=ua?ua.level:0;t.level=e.level===void 0?s:e.level};var Xf=t=>{let e=(...s)=>s.join(" ");return Zf(e,t),Object.setPrototypeOf(e,xs.prototype),e};function xs(t){return Xf(t)}Object.setPrototypeOf(xs.prototype,Function.prototype);for(let[t,e]of Object.entries(de))Yt[t]={get(){let s=vi(this,Ao(e.open,e.close,this[Vt]),this[ws]);return Object.defineProperty(this,t,{value:s}),s}};Yt.visible={get(){let t=vi(this,this[Vt],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var _o=(t,e,s,...i)=>t==="rgb"?e==="ansi16m"?de[s].ansi16m(...i):e==="ansi256"?de[s].ansi256(de.rgbToAnsi256(...i)):de[s].ansi(de.rgbToAnsi(...i)):t==="hex"?_o("rgb",e,s,...de.hexToRgb(...i)):de[s][t](...i),Qf=["rgb","hex","ansi256"];for(let t of Qf){Yt[t]={get(){let{level:s}=this;return function(...i){let n=Ao(_o(t,fa[s],"color",...i),de.color.close,this[Vt]);return vi(this,n,this[ws])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Yt[e]={get(){let{level:s}=this;return function(...i){let n=Ao(_o(t,fa[s],"bgColor",...i),de.bgColor.close,this[Vt]);return vi(this,n,this[ws])}}}}var eh=Object.defineProperties(()=>{},{...Yt,level:{enumerable:!0,get(){return this[xo].level},set(t){this[xo].level=t}}}),Ao=(t,e,s)=>{let i,n;return s===void 0?(i=t,n=e):(i=s.openAll+t,n=e+s.closeAll),{open:t,close:e,openAll:i,closeAll:n,parent:s}},vi=(t,e,s)=>{let i=(...n)=>th(i,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(i,eh),i[xo]=t,i[Vt]=e,i[ws]=s,i},th=(t,e)=>{if(t.level<=0||!e)return t[ws]?"":e;let s=t[Vt];if(s===void 0)return e;let{openAll:i,closeAll:n}=s;if(e.includes("\x1B"))for(;s!==void 0;)e=la(e,s.close,s.open),s=s.parent;let o=e.indexOf(`
13
+ `);return o!==-1&&(e=aa(e,n,i,o)),i+e+n};Object.defineProperties(xs.prototype,Yt);var sh=xs(),LD=xs({level:ca?ca.level:0});var me=sh;import Da from"node:process";import Ii from"node:process";var ih=(t,e,s,i)=>{if(s==="length"||s==="prototype"||s==="arguments"||s==="caller")return;let n=Object.getOwnPropertyDescriptor(t,s),o=Object.getOwnPropertyDescriptor(e,s);!nh(n,o)&&i||Object.defineProperty(t,s,o)},nh=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},oh=(t,e)=>{let s=Object.getPrototypeOf(e);s!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,s)},rh=(t,e)=>`/* Wrapped ${t}*/
14
+ ${e}`,lh=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ah=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),uh=(t,e,s)=>{let i=s===""?"":`with ${s.trim()}() `,n=rh.bind(null,i,e.toString());Object.defineProperty(n,"name",ah);let{writable:o,enumerable:r,configurable:a}=lh;Object.defineProperty(t,"toString",{value:n,writable:o,enumerable:r,configurable:a})};function vo(t,e,{ignoreNonConfigurable:s=!1}={}){let{name:i}=t;for(let n of Reflect.ownKeys(e))ih(t,e,n,s);return oh(t,e),uh(t,e,i),t}var Ri=new WeakMap,ha=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let s,i=0,n=t.displayName||t.name||"<anonymous>",o=function(...r){if(Ri.set(o,++i),i===1)s=t.apply(this,r),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return s};return vo(o,t),Ri.set(o,i),o};ha.callCount=t=>{if(!Ri.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Ri.get(t)};var da=ha;var yt=[];yt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&yt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&yt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ki=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ro=Symbol.for("signal-exit emitter"),ko=globalThis,ch=Object.defineProperty.bind(Object),To=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ko[Ro])return ko[Ro];ch(ko,Ro,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,s){this.listeners[e].push(s)}removeListener(e,s){let i=this.listeners[e],n=i.indexOf(s);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(e,s,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let o of this.listeners[e])n=o(s,i)===!0||n;return e==="exit"&&(n=this.emit("afterExit",s,i)||n),n}},Ti=class{},fh=t=>({onExit(e,s){return t.onExit(e,s)},load(){return t.load()},unload(){return t.unload()}}),Io=class extends Ti{onExit(){return()=>{}}load(){}unload(){}},Oo=class extends Ti{#e=Po.platform==="win32"?"SIGINT":"SIGHUP";#i=new To;#s;#n;#l;#t={};#o=!1;constructor(e){super(),this.#s=e,this.#t={};for(let s of yt)this.#t[s]=()=>{let i=this.#s.listeners(s),{count:n}=this.#i,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(n+=o.__signal_exit_emitter__.count),i.length===n){this.unload();let r=this.#i.emit("exit",null,s),a=s==="SIGHUP"?this.#e:s;r||e.kill(e.pid,a)}};this.#l=e.reallyExit,this.#n=e.emit}onExit(e,s){if(!ki(this.#s))return()=>{};this.#o===!1&&this.load();let i=s?.alwaysLast?"afterExit":"exit";return this.#i.on(i,e),()=>{this.#i.removeListener(i,e),this.#i.listeners.exit.length===0&&this.#i.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#i.count+=1;for(let e of yt)try{let s=this.#t[e];s&&this.#s.on(e,s)}catch{}this.#s.emit=(e,...s)=>this.#d(e,...s),this.#s.reallyExit=e=>this.#r(e)}}unload(){this.#o&&(this.#o=!1,yt.forEach(e=>{let s=this.#t[e];if(!s)throw new Error("Listener not defined for signal: "+e);try{this.#s.removeListener(e,s)}catch{}}),this.#s.emit=this.#n,this.#s.reallyExit=this.#l,this.#i.count-=1)}#r(e){return ki(this.#s)?(this.#s.exitCode=e||0,this.#i.emit("exit",this.#s.exitCode,null),this.#l.call(this.#s,this.#s.exitCode)):0}#d(e,...s){let i=this.#n;if(e==="exit"&&ki(this.#s)){typeof s[0]=="number"&&(this.#s.exitCode=s[0]);let n=i.call(this.#s,e,...s);return this.#i.emit("exit",this.#s.exitCode,null),n}else return i.call(this.#s,e,...s)}},Po=globalThis.process,{onExit:ma,load:WD,unload:KD}=fh(ki(Po)?new Oo(Po):new Io);var ga=Ii.stderr.isTTY?Ii.stderr:Ii.stdout.isTTY?Ii.stdout:void 0,hh=ga?da(()=>{ma(()=>{ga.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},pa=hh;var Oi=!1,qt={};qt.show=(t=Da.stderr)=>{t.isTTY&&(Oi=!1,t.write("\x1B[?25h"))};qt.hide=(t=Da.stderr)=>{t.isTTY&&(pa(),Oi=!0,t.write("\x1B[?25l"))};qt.toggle=(t,e)=>{t!==void 0&&(Oi=t),Oi?qt.show(e):qt.hide(e)};var Bo=qt;var vs=Si(No(),1);import ge from"node:process";function $o(){return ge.platform!=="win32"?ge.env.TERM!=="linux":!!ge.env.CI||!!ge.env.WT_SESSION||!!ge.env.TERMINUS_SUBLIME||ge.env.ConEmuTask==="{cmd::Cmder}"||ge.env.TERM_PROGRAM==="Terminus-Sublime"||ge.env.TERM_PROGRAM==="vscode"||ge.env.TERM==="xterm-256color"||ge.env.TERM==="alacritty"||ge.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var mh={info:me.blue("\u2139"),success:me.green("\u2714"),warning:me.yellow("\u26A0"),error:me.red("\u2716")},gh={info:me.blue("i"),success:me.green("\u221A"),warning:me.yellow("\u203C"),error:me.red("\xD7")},ph=$o()?mh:gh,_s=ph;function Lo({onlyFirst:t=!1}={}){let n="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(n,t?void 0:"g")}var Dh=Lo();function As(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Dh,"")}function ya(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Ca(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function Sa(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function Eh(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function wa(t,{ambiguousAsWide:e=!1}={}){return Eh(t),Ca(t)||Sa(t)||e&&ya(t)?2:1}var Aa=Si(_a(),1),Fh=new Intl.Segmenter,bh=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Mo(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:s=!0,countAnsiEscapeCodes:i=!1}=e;if(i||(t=As(t)),t.length===0)return 0;let n=0,o={ambiguousAsWide:!s};for(let{segment:r}of Fh.segment(t)){let a=r.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!bh.test(r)){if((0,Aa.default)().test(r)){n+=2;continue}n+=wa(a,o)}}return n}function Go({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import va from"node:process";function jo(){let{env:t}=va,{TERM:e,TERM_PROGRAM:s}=t;return va.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||s==="Terminus-Sublime"||s==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import xe from"node:process";var yh=3,Uo=class{#e=0;start(){this.#e++,this.#e===1&&this.#i()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#s()}#i(){xe.platform==="win32"||!xe.stdin.isTTY||(xe.stdin.setRawMode(!0),xe.stdin.on("data",this.#n),xe.stdin.resume())}#s(){xe.stdin.isTTY&&(xe.stdin.off("data",this.#n),xe.stdin.pause(),xe.stdin.setRawMode(!1))}#n(e){e[0]===yh&&xe.emit("SIGINT")}},Ch=new Uo,zo=Ch;var Sh=Si(No(),1),Ho=class{#e=0;#i=!1;#s=0;#n=-1;#l=0;#t;#o;#r;#d;#g;#c;#f;#h;#p;#a;#u;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:Bi.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#g=this.#t.interval,this.#r=this.#t.stream,this.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Go({stream:this.#r}),this.#f=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,Bi.env.NODE_ENV==="test"&&(this._stream=this.#r,this._isEnabled=this.#c,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(s){this.#e=s}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#s}}))}get indent(){return this.#h}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#h=e,this.#m()}get interval(){return this.#g??this.#o.interval??100}get spinner(){return this.#o}set spinner(e){if(this.#n=-1,this.#g=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#o=e}else if(!jo())this.#o=vs.default.line;else if(e===void 0)this.#o=vs.default.dots;else if(e!=="default"&&vs.default[e])this.#o=vs.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#p}set text(e=""){this.#p=e,this.#m()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#m()}get suffixText(){return this.#u}set suffixText(e=""){this.#u=e,this.#m()}get isSpinning(){return this.#d!==void 0}#D(e=this.#a,s=" "){return typeof e=="string"&&e!==""?e+s:typeof e=="function"?e()+s:""}#E(e=this.#u,s=" "){return typeof e=="string"&&e!==""?s+e:typeof e=="function"?s+e():""}#m(){let e=this.#r.columns??80,s=this.#D(this.#a,"-"),i=this.#E(this.#u,"-"),n=" ".repeat(this.#h)+s+"--"+this.#p+"--"+i;this.#s=0;for(let o of As(n).split(`
15
+ `))this.#s+=Math.max(1,Math.ceil(Mo(o,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#c&&!this.#f}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#c=e}get isSilent(){return this.#f}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#f=e}frame(){let e=Date.now();(this.#n===-1||e-this.#l>=this.interval)&&(this.#n=++this.#n%this.#o.frames.length,this.#l=e);let{frames:s}=this.#o,i=s[this.#n];this.color&&(i=me[this.color](i));let n=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",o=typeof this.text=="string"?" "+this.text:"",r=typeof this.#u=="string"&&this.#u!==""?" "+this.#u:"";return n+i+o+r}clear(){if(!this.#c||!this.#r.isTTY)return this;this.#r.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#r.moveCursor(0,-1),this.#r.clearLine(1);return(this.#h||this.lastIndent!==this.#h)&&this.#r.cursorTo(this.#h),this.lastIndent=this.#h,this.#e=0,this}render(){return this.#f?this:(this.clear(),this.#r.write(this.frame()),this.#e=this.#s,this)}start(e){return e&&(this.text=e),this.#f?this:this.#c?this.isSpinning?this:(this.#t.hideCursor&&Bo.hide(this.#r),this.#t.discardStdin&&Bi.stdin.isTTY&&(this.#i=!0,zo.start()),this.render(),this.#d=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#r.write(`- ${this.text}
16
+ `),this)}stop(){return this.#c?(clearInterval(this.#d),this.#d=void 0,this.#n=0,this.clear(),this.#t.hideCursor&&Bo.show(this.#r),this.#t.discardStdin&&Bi.stdin.isTTY&&this.#i&&(zo.stop(),this.#i=!1),this):this}succeed(e){return this.stopAndPersist({symbol:_s.success,text:e})}fail(e){return this.stopAndPersist({symbol:_s.error,text:e})}warn(e){return this.stopAndPersist({symbol:_s.warning,text:e})}info(e){return this.stopAndPersist({symbol:_s.info,text:e})}stopAndPersist(e={}){if(this.#f)return this;let s=e.prefixText??this.#a,i=this.#D(s," "),n=e.symbol??" ",o=e.text??this.text,a=typeof o=="string"?(n?" ":"")+o:"",u=e.suffixText??this.#u,c=this.#E(u," "),f=i+n+a+c+`
17
+ `;return this.stop(),this.#r.write(f),this}};function $e(t){return new Ho(t)}import{existsSync as Ia,readFileSync as Rh,writeFileSync as kh,mkdirSync as Th}from"fs";import{dirname as Ih}from"path";import{homedir as Ra}from"os";import{join as H}from"path";var wh=H(Ra(),".gemkit"),Wo=H(wh,"projects"),Ko=H(Ra(),".gemini"),N0=H(Ko,"config"),Zt=H(Ko,"cache"),$0=H(Ko,"tmp"),Xt=".gemini";var xh="plans",_h=".gk.json",Ah="metadata.json",vh=".env";function Ni(t=process.cwd()){return H(t,Xt)}function Jo(t=process.cwd()){return H(t,Xt,_h)}function Vo(t=process.cwd()){return H(t,Xt,Ah)}function Ct(t=process.cwd()){return H(t,Xt,vh)}function Rs(t=process.cwd()){return H(t,Xt,"agents")}function St(t=process.cwd()){return H(t,Xt,"extensions")}function $i(t=process.cwd()){return H(t,xh)}function ks(t){return t?t.replace(/^[A-Za-z]:/,e=>e.replace(":","")).replace(/[\\/]+/g,"-").replace(/[^a-zA-Z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):""}function Le(t){return H(Wo,t)}function Ts(t,e){return H(Le(t),`gk-session-${e}.json`)}function Is(t,e){return H(Le(t),`gk-project-${e}.json`)}var _e={defaultScope:"local",github:{repo:"therichardngai-code/gemkit-kits-starter",apiUrl:"https://api.github.com"},cache:{enabled:!0,ttl:3600},installation:{excludePatterns:[],backupOnUpdate:!0},ui:{colors:!0,spinner:!0,verbose:!1},paths:{},spawn:{defaultModel:"gemini-2.5-flash",music:!1}};function ka(t){return!(!t||typeof t!="object")}function Ta(t){return{..._e,...t,github:{..._e.github,...t.github||{}},cache:{..._e.cache,...t.cache||{}},installation:{..._e.installation,...t.installation||{}},ui:{..._e.ui,...t.ui||{}},paths:{..._e.paths,...t.paths||{}},spawn:{..._e.spawn,...t.spawn||{}}}}var Li=class extends Error{constructor(s,i="GEMKIT_ERROR",n){super(s);this.code=i;this.details=n;this.name="GemKitError"}},wt=class extends Li{constructor(e,s){super(e,"CONFIG_ERROR",s),this.name="ConfigError"}};var ae=class extends Li{constructor(e,s){super(e,"GITHUB_ERROR",s),this.name="GitHubError"}};function et(t){let e=Jo(t);if(!Ia(e))return _e;try{let s=Rh(e,"utf-8"),i=JSON.parse(s);if(!ka(i))throw new wt("Invalid configuration format");return Ta(i)}catch(s){throw s instanceof wt?s:new wt(`Failed to load config: ${s}`)}}function Oa(t,e){let s=Jo(e),i=Ih(s);Ia(i)||Th(i,{recursive:!0}),kh(s,JSON.stringify(t,null,2))}function Pa(t,e){let s=et(e),i=t.split("."),n=s;for(let o of i)if(n&&typeof n=="object"&&o in n)n=n[o];else return;return n}function Ba(t,e,s){let i=et(s),n=t.split("."),o=n.pop();if(!o)throw new wt("Invalid config path");let r=i;for(let a of n)(!(a in r)||typeof r[a]!="object")&&(r[a]={}),r=r[a];r[o]=e,Oa(i,s)}function Na(t){Oa(_e,t)}import{existsSync as $a,readFileSync as Oh,writeFileSync as Ph,mkdirSync as Bh,readdirSync as La,unlinkSync as Ma,statSync as Nh}from"fs";import{join as Yo}from"path";function qo(){return $a(Zt)||Bh(Zt,{recursive:!0}),Zt}function Ga(t){let e=t.replace(/[^a-zA-Z0-9-_]/g,"_");return Yo(qo(),`${e}.json`)}function ja(t){let e=Ga(t);if(!$a(e))return null;try{let s=Oh(e,"utf-8"),i=JSON.parse(s);return Date.now()-i.timestamp>i.ttl*1e3?(Ma(e),null):i.data}catch{return null}}function Ua(t,e,s=3600){let i=Ga(t),n={key:t,data:e,timestamp:Date.now(),ttl:s};Ph(i,JSON.stringify(n,null,2))}function za(){let t=qo(),e=La(t).filter(s=>s.endsWith(".json"));for(let s of e)Ma(Yo(t,s));return e.length}function Ha(){let t=qo(),e=La(t).filter(i=>i.endsWith(".json")),s=0;for(let i of e){let n=Nh(Yo(t,i));s+=n.size}return{entries:e.length,size:s}}var Wa="github-releases",$h=300;async function Mi(t=10){let e=ja(Wa);if(e)return e.slice(0,t);let s=et(),{repo:i,apiUrl:n}=s.github,o=`${n}/repos/${i}/releases?per_page=${t}`;try{let r=await fetch(o,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"gemkit-cli"}});if(!r.ok)throw new ae(`Failed to fetch releases: ${r.status}`);let u=(await r.json()).map(c=>({version:c.tag_name.replace(/^v/,""),tag:c.tag_name,publishedAt:c.published_at,prerelease:c.prerelease,assets:c.assets.map(f=>({name:f.name,url:f.url,size:f.size,downloadUrl:f.browser_download_url}))}));return Ua(Wa,u,$h),u}catch(r){throw r instanceof ae?r:new ae(`Failed to fetch releases: ${r}`)}}async function Qt(){let t=await Mi(1);return t.length>0?t[0]:null}async function Ka(t){return(await Mi(50)).find(s=>s.version===t||s.tag===t)||null}import{createWriteStream as Lh,existsSync as Mh,mkdirSync as Gh}from"fs";import{pipeline as jh}from"stream/promises";import{join as Uh}from"path";async function zh(t,e=Zt){Mh(e)||Gh(e,{recursive:!0});let s=Uh(e,t.name);try{let i=await fetch(t.downloadUrl,{headers:{"User-Agent":"gemkit-cli"}});if(!i.ok)throw new ae(`Failed to download asset: ${i.status}`);if(!i.body)throw new ae("No response body");let n=Lh(s);return await jh(i.body,n),s}catch(i){throw i instanceof ae?i:new ae(`Download failed: ${i}`)}}async function es(t){let e=t.assets.find(s=>s.name.endsWith(".tar.gz")||s.name.endsWith(".tgz"));if(!e)throw new ae("No tarball asset found in release");return zh(e)}import{createReadStream as Vm,createWriteStream as Kb,existsSync as uc,mkdirSync as Ym}from"fs";import{pipeline as qm}from"stream/promises";import{createGunzip as Zm}from"zlib";import ed from"events";import X from"fs";import{EventEmitter as ir}from"node:events";import Za from"node:stream";import{StringDecoder as Hh}from"node:string_decoder";var Ja=typeof process=="object"&&process?process:{stdout:null,stderr:null},Wh=t=>!!t&&typeof t=="object"&&(t instanceof $s||t instanceof Za||Kh(t)||Jh(t)),Kh=t=>!!t&&typeof t=="object"&&t instanceof ir&&typeof t.pipe=="function"&&t.pipe!==Za.Writable.prototype.pipe,Jh=t=>!!t&&typeof t=="object"&&t instanceof ir&&typeof t.write=="function"&&typeof t.end=="function",Me=Symbol("EOF"),Ge=Symbol("maybeEmitEnd"),tt=Symbol("emittedEnd"),Gi=Symbol("emittingEnd"),Os=Symbol("emittedError"),ji=Symbol("closed"),Va=Symbol("read"),Ui=Symbol("flush"),Ya=Symbol("flushChunk"),pe=Symbol("encoding"),ts=Symbol("decoder"),P=Symbol("flowing"),Ps=Symbol("paused"),ss=Symbol("resume"),B=Symbol("buffer"),Y=Symbol("pipes"),N=Symbol("bufferLength"),Zo=Symbol("bufferPush"),zi=Symbol("bufferShift"),W=Symbol("objectMode"),v=Symbol("destroyed"),Xo=Symbol("error"),Qo=Symbol("emitData"),qa=Symbol("emitEnd"),er=Symbol("emitEnd2"),Ae=Symbol("async"),tr=Symbol("abort"),Hi=Symbol("aborted"),Bs=Symbol("signal"),xt=Symbol("dataListeners"),Q=Symbol("discarded"),Ns=t=>Promise.resolve().then(t),Vh=t=>t(),Yh=t=>t==="end"||t==="finish"||t==="prefinish",qh=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Zh=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Wi=class{src;dest;opts;ondrain;constructor(e,s,i){this.src=e,this.dest=s,this.opts=i,this.ondrain=()=>e[ss](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},sr=class extends Wi{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,i){super(e,s,i),this.proxyErrors=n=>s.emit("error",n),e.on("error",this.proxyErrors)}},Xh=t=>!!t.objectMode,Qh=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",$s=class extends ir{[P]=!1;[Ps]=!1;[Y]=[];[B]=[];[W];[pe];[Ae];[ts];[Me]=!1;[tt]=!1;[Gi]=!1;[ji]=!1;[Os]=null;[N]=0;[v]=!1;[Bs];[Hi]=!1;[xt]=0;[Q]=!1;writable=!0;readable=!0;constructor(...e){let s=e[0]||{};if(super(),s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Xh(s)?(this[W]=!0,this[pe]=null):Qh(s)?(this[pe]=s.encoding,this[W]=!1):(this[W]=!1,this[pe]=null),this[Ae]=!!s.async,this[ts]=this[pe]?new Hh(this[pe]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[B]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Y]});let{signal:i}=s;i&&(this[Bs]=i,i.aborted?this[tr]():i.addEventListener("abort",()=>this[tr]()))}get bufferLength(){return this[N]}get encoding(){return this[pe]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[W]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ae]}set async(e){this[Ae]=this[Ae]||!!e}[tr](){this[Hi]=!0,this.emit("abort",this[Bs]?.reason),this.destroy(this[Bs]?.reason)}get aborted(){return this[Hi]}set aborted(e){}write(e,s,i){if(this[Hi])return!1;if(this[Me])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(i=s,s="utf8"),s||(s="utf8");let n=this[Ae]?Ns:Vh;if(!this[W]&&!Buffer.isBuffer(e)){if(Zh(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(qh(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[W]?(this[P]&&this[N]!==0&&this[Ui](!0),this[P]?this.emit("data",e):this[Zo](e),this[N]!==0&&this.emit("readable"),i&&n(i),this[P]):e.length?(typeof e=="string"&&!(s===this[pe]&&!this[ts]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[pe]&&(e=this[ts].write(e)),this[P]&&this[N]!==0&&this[Ui](!0),this[P]?this.emit("data",e):this[Zo](e),this[N]!==0&&this.emit("readable"),i&&n(i),this[P]):(this[N]!==0&&this.emit("readable"),i&&n(i),this[P])}read(e){if(this[v])return null;if(this[Q]=!1,this[N]===0||e===0||e&&e>this[N])return this[Ge](),null;this[W]&&(e=null),this[B].length>1&&!this[W]&&(this[B]=[this[pe]?this[B].join(""):Buffer.concat(this[B],this[N])]);let s=this[Va](e||null,this[B][0]);return this[Ge](),s}[Va](e,s){if(this[W])this[zi]();else{let i=s;e===i.length||e===null?this[zi]():typeof i=="string"?(this[B][0]=i.slice(e),s=i.slice(0,e),this[N]-=e):(this[B][0]=i.subarray(e),s=i.subarray(0,e),this[N]-=e)}return this.emit("data",s),!this[B].length&&!this[Me]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[Me]=!0,this.writable=!1,(this[P]||!this[Ps])&&this[Ge](),this}[ss](){this[v]||(!this[xt]&&!this[Y].length&&(this[Q]=!0),this[Ps]=!1,this[P]=!0,this.emit("resume"),this[B].length?this[Ui]():this[Me]?this[Ge]():this.emit("drain"))}resume(){return this[ss]()}pause(){this[P]=!1,this[Ps]=!0,this[Q]=!1}get destroyed(){return this[v]}get flowing(){return this[P]}get paused(){return this[Ps]}[Zo](e){this[W]?this[N]+=1:this[N]+=e.length,this[B].push(e)}[zi](){return this[W]?this[N]-=1:this[N]-=this[B][0].length,this[B].shift()}[Ui](e=!1){do;while(this[Ya](this[zi]())&&this[B].length);!e&&!this[B].length&&!this[Me]&&this.emit("drain")}[Ya](e){return this.emit("data",e),this[P]}pipe(e,s){if(this[v])return e;this[Q]=!1;let i=this[tt];return s=s||{},e===Ja.stdout||e===Ja.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[Y].push(s.proxyErrors?new sr(this,e,s):new Wi(this,e,s)),this[Ae]?Ns(()=>this[ss]()):this[ss]()),e}unpipe(e){let s=this[Y].find(i=>i.dest===e);s&&(this[Y].length===1?(this[P]&&this[xt]===0&&(this[P]=!1),this[Y]=[]):this[Y].splice(this[Y].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[Q]=!1,this[xt]++,!this[Y].length&&!this[P]&&this[ss]();else if(e==="readable"&&this[N]!==0)super.emit("readable");else if(Yh(e)&&this[tt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Os]){let n=s;this[Ae]?Ns(()=>n.call(this,this[Os])):n.call(this,this[Os])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[xt]=this.listeners("data").length,this[xt]===0&&!this[Q]&&!this[Y].length&&(this[P]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[xt]=0,!this[Q]&&!this[Y].length&&(this[P]=!1)),s}get emittedEnd(){return this[tt]}[Ge](){!this[Gi]&&!this[tt]&&!this[v]&&this[B].length===0&&this[Me]&&(this[Gi]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ji]&&this.emit("close"),this[Gi]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==v&&this[v])return!1;if(e==="data")return!this[W]&&!i?!1:this[Ae]?(Ns(()=>this[Qo](i)),!0):this[Qo](i);if(e==="end")return this[qa]();if(e==="close"){if(this[ji]=!0,!this[tt]&&!this[v])return!1;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(e==="error"){this[Os]=i,super.emit(Xo,i);let o=!this[Bs]||this.listeners("error").length?super.emit("error",i):!1;return this[Ge](),o}else if(e==="resume"){let o=super.emit("resume");return this[Ge](),o}else if(e==="finish"||e==="prefinish"){let o=super.emit(e);return this.removeAllListeners(e),o}let n=super.emit(e,...s);return this[Ge](),n}[Qo](e){for(let i of this[Y])i.dest.write(e)===!1&&this.pause();let s=this[Q]?!1:super.emit("data",e);return this[Ge](),s}[qa](){return this[tt]?!1:(this[tt]=!0,this.readable=!1,this[Ae]?(Ns(()=>this[er]()),!0):this[er]())}[er](){if(this[ts]){let s=this[ts].end();if(s){for(let i of this[Y])i.dest.write(s);this[Q]||super.emit("data",s)}}for(let s of this[Y])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[W]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[W]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[W])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[pe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(v,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Q]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[Me])return s();let o,r,a=h=>{this.off("data",u),this.off("end",c),this.off(v,f),s(),r(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(v,f),this.pause(),o({value:h,done:!!this[Me]})},c=()=>{this.off("error",a),this.off("data",u),this.off(v,f),s(),o({done:!0,value:void 0})},f=()=>a(new Error("stream destroyed"));return new Promise((h,g)=>{r=g,o=h,this.once(v,f),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Q]=!1;let e=!1,s=()=>(this.pause(),this.off(Xo,s),this.off(v,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let n=this.read();return n===null?s():{done:!1,value:n}};return this.once("end",s),this.once(Xo,s),this.once(v,s),{next:i,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[v])return e?this.emit("error",e):this.emit(v),this;this[v]=!0,this[Q]=!0,this[B].length=0,this[N]=0;let s=this;return typeof s.close=="function"&&!this[ji]&&s.close(),e?this.emit("error",e):this.emit(v),this}static get isStream(){return Wh}};var td=X.writev,it=Symbol("_autoClose"),Ee=Symbol("_close"),Ls=Symbol("_ended"),S=Symbol("_fd"),nr=Symbol("_finished"),Ue=Symbol("_flags"),or=Symbol("_flush"),ur=Symbol("_handleChunk"),cr=Symbol("_makeBuf"),Gs=Symbol("_mode"),Ki=Symbol("_needDrain"),os=Symbol("_onerror"),rs=Symbol("_onopen"),rr=Symbol("_onread"),is=Symbol("_onwrite"),nt=Symbol("_open"),De=Symbol("_path"),st=Symbol("_pos"),ve=Symbol("_queue"),ns=Symbol("_read"),lr=Symbol("_readSize"),je=Symbol("_reading"),Ms=Symbol("_remain"),ar=Symbol("_size"),Ji=Symbol("_write"),_t=Symbol("_writing"),Vi=Symbol("_defaultFlag"),At=Symbol("_errored"),vt=class extends $s{[At]=!1;[S];[De];[lr];[je]=!1;[ar];[Ms];[it];constructor(e,s){if(s=s||{},super(s),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[At]=!1,this[S]=typeof s.fd=="number"?s.fd:void 0,this[De]=e,this[lr]=s.readSize||16*1024*1024,this[je]=!1,this[ar]=typeof s.size=="number"?s.size:1/0,this[Ms]=this[ar],this[it]=typeof s.autoClose=="boolean"?s.autoClose:!0,typeof this[S]=="number"?this[ns]():this[nt]()}get fd(){return this[S]}get path(){return this[De]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[nt](){X.open(this[De],"r",(e,s)=>this[rs](e,s))}[rs](e,s){e?this[os](e):(this[S]=s,this.emit("open",s),this[ns]())}[cr](){return Buffer.allocUnsafe(Math.min(this[lr],this[Ms]))}[ns](){if(!this[je]){this[je]=!0;let e=this[cr]();if(e.length===0)return process.nextTick(()=>this[rr](null,0,e));X.read(this[S],e,0,e.length,null,(s,i,n)=>this[rr](s,i,n))}}[rr](e,s,i){this[je]=!1,e?this[os](e):this[ur](s,i)&&this[ns]()}[Ee](){if(this[it]&&typeof this[S]=="number"){let e=this[S];this[S]=void 0,X.close(e,s=>s?this.emit("error",s):this.emit("close"))}}[os](e){this[je]=!0,this[Ee](),this.emit("error",e)}[ur](e,s){let i=!1;return this[Ms]-=e,e>0&&(i=super.write(e<s.length?s.subarray(0,e):s)),(e===0||this[Ms]<=0)&&(i=!1,this[Ee](),super.end()),i}emit(e,...s){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[S]=="number"&&this[ns](),!1;case"error":return this[At]?!1:(this[At]=!0,super.emit(e,...s));default:return super.emit(e,...s)}}},Yi=class extends vt{[nt](){let e=!0;try{this[rs](null,X.openSync(this[De],"r")),e=!1}finally{e&&this[Ee]()}}[ns](){let e=!0;try{if(!this[je]){this[je]=!0;do{let s=this[cr](),i=s.length===0?0:X.readSync(this[S],s,0,s.length,null);if(!this[ur](i,s))break}while(!0);this[je]=!1}e=!1}finally{e&&this[Ee]()}}[Ee](){if(this[it]&&typeof this[S]=="number"){let e=this[S];this[S]=void 0,X.closeSync(e),this.emit("close")}}},ze=class extends ed{readable=!1;writable=!0;[At]=!1;[_t]=!1;[Ls]=!1;[ve]=[];[Ki]=!1;[De];[Gs];[it];[S];[Vi];[Ue];[nr]=!1;[st];constructor(e,s){s=s||{},super(s),this[De]=e,this[S]=typeof s.fd=="number"?s.fd:void 0,this[Gs]=s.mode===void 0?438:s.mode,this[st]=typeof s.start=="number"?s.start:void 0,this[it]=typeof s.autoClose=="boolean"?s.autoClose:!0;let i=this[st]!==void 0?"r+":"w";this[Vi]=s.flags===void 0,this[Ue]=s.flags===void 0?i:s.flags,this[S]===void 0&&this[nt]()}emit(e,...s){if(e==="error"){if(this[At])return!1;this[At]=!0}return super.emit(e,...s)}get fd(){return this[S]}get path(){return this[De]}[os](e){this[Ee](),this[_t]=!0,this.emit("error",e)}[nt](){X.open(this[De],this[Ue],this[Gs],(e,s)=>this[rs](e,s))}[rs](e,s){this[Vi]&&this[Ue]==="r+"&&e&&e.code==="ENOENT"?(this[Ue]="w",this[nt]()):e?this[os](e):(this[S]=s,this.emit("open",s),this[_t]||this[or]())}end(e,s){return e&&this.write(e,s),this[Ls]=!0,!this[_t]&&!this[ve].length&&typeof this[S]=="number"&&this[is](null,0),this}write(e,s){return typeof e=="string"&&(e=Buffer.from(e,s)),this[Ls]?(this.emit("error",new Error("write() after end()")),!1):this[S]===void 0||this[_t]||this[ve].length?(this[ve].push(e),this[Ki]=!0,!1):(this[_t]=!0,this[Ji](e),!0)}[Ji](e){X.write(this[S],e,0,e.length,this[st],(s,i)=>this[is](s,i))}[is](e,s){e?this[os](e):(this[st]!==void 0&&typeof s=="number"&&(this[st]+=s),this[ve].length?this[or]():(this[_t]=!1,this[Ls]&&!this[nr]?(this[nr]=!0,this[Ee](),this.emit("finish")):this[Ki]&&(this[Ki]=!1,this.emit("drain"))))}[or](){if(this[ve].length===0)this[Ls]&&this[is](null,0);else if(this[ve].length===1)this[Ji](this[ve].pop());else{let e=this[ve];this[ve]=[],td(this[S],e,this[st],(s,i)=>this[is](s,i))}}[Ee](){if(this[it]&&typeof this[S]=="number"){let e=this[S];this[S]=void 0,X.close(e,s=>s?this.emit("error",s):this.emit("close"))}}},ls=class extends ze{[nt](){let e;if(this[Vi]&&this[Ue]==="r+")try{e=X.openSync(this[De],this[Ue],this[Gs])}catch(s){if(s?.code==="ENOENT")return this[Ue]="w",this[nt]();throw s}else e=X.openSync(this[De],this[Ue],this[Gs]);this[rs](null,e)}[Ee](){if(this[it]&&typeof this[S]=="number"){let e=this[S];this[S]=void 0,X.closeSync(e),this.emit("close")}}[Ji](e){let s=!0;try{this[is](null,X.writeSync(this[S],e,0,e.length,this[st])),s=!1}finally{if(s)try{this[Ee]()}catch{}}}};import ju from"node:path";import ps from"node:fs";import{dirname as Xd,parse as Qd}from"path";var sd=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),Xa=t=>!!t.sync&&!!t.file,Qa=t=>!t.sync&&!!t.file,eu=t=>!!t.sync&&!t.file,tu=t=>!t.sync&&!t.file;var su=t=>!!t.file;var id=t=>{let e=sd.get(t);return e||t},js=(t={})=>{if(!t)return{};let e={};for(let[s,i]of Object.entries(t)){let n=id(s);e[n]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e};var Re=(t,e,s,i,n)=>Object.assign((o=[],r,a)=>{Array.isArray(o)&&(r=o,o={}),typeof r=="function"&&(a=r,r=void 0),r?r=Array.from(r):r=[];let u=js(o);if(n?.(u,r),Xa(u)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return t(u,r)}else if(Qa(u)){let c=e(u,r),f=a||void 0;return f?c.then(()=>f(),f):c}else if(eu(u)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return s(u,r)}else if(tu(u)){if(typeof a=="function")throw new TypeError("callback only supported with file option");return i(u,r)}else throw new Error("impossible options??")},{syncFile:t,asyncFile:e,syncNoFile:s,asyncNoFile:i,validate:n});import{EventEmitter as Vd}from"events";import yr from"assert";import{Buffer as kt}from"buffer";import{EventEmitter as Er}from"node:events";import lu from"node:stream";import{StringDecoder as nd}from"node:string_decoder";var iu=typeof process=="object"&&process?process:{stdout:null,stderr:null},od=t=>!!t&&typeof t=="object"&&(t instanceof Ks||t instanceof lu||rd(t)||ld(t)),rd=t=>!!t&&typeof t=="object"&&t instanceof Er&&typeof t.pipe=="function"&&t.pipe!==lu.Writable.prototype.pipe,ld=t=>!!t&&typeof t=="object"&&t instanceof Er&&typeof t.write=="function"&&typeof t.end=="function",He=Symbol("EOF"),We=Symbol("maybeEmitEnd"),ot=Symbol("emittedEnd"),qi=Symbol("emittingEnd"),Us=Symbol("emittedError"),Zi=Symbol("closed"),nu=Symbol("read"),Xi=Symbol("flush"),ou=Symbol("flushChunk"),Fe=Symbol("encoding"),as=Symbol("decoder"),$=Symbol("flowing"),zs=Symbol("paused"),us=Symbol("resume"),L=Symbol("buffer"),q=Symbol("pipes"),M=Symbol("bufferLength"),hr=Symbol("bufferPush"),Qi=Symbol("bufferShift"),K=Symbol("objectMode"),R=Symbol("destroyed"),dr=Symbol("error"),mr=Symbol("emitData"),ru=Symbol("emitEnd"),gr=Symbol("emitEnd2"),ke=Symbol("async"),pr=Symbol("abort"),en=Symbol("aborted"),Hs=Symbol("signal"),Rt=Symbol("dataListeners"),ee=Symbol("discarded"),Ws=t=>Promise.resolve().then(t),ad=t=>t(),ud=t=>t==="end"||t==="finish"||t==="prefinish",cd=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,fd=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),tn=class{src;dest;opts;ondrain;constructor(e,s,i){this.src=e,this.dest=s,this.opts=i,this.ondrain=()=>e[us](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Dr=class extends tn{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,i){super(e,s,i),this.proxyErrors=n=>s.emit("error",n),e.on("error",this.proxyErrors)}},hd=t=>!!t.objectMode,dd=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Ks=class extends Er{[$]=!1;[zs]=!1;[q]=[];[L]=[];[K];[Fe];[ke];[as];[He]=!1;[ot]=!1;[qi]=!1;[Zi]=!1;[Us]=null;[M]=0;[R]=!1;[Hs];[en]=!1;[Rt]=0;[ee]=!1;writable=!0;readable=!0;constructor(...e){let s=e[0]||{};if(super(),s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");hd(s)?(this[K]=!0,this[Fe]=null):dd(s)?(this[Fe]=s.encoding,this[K]=!1):(this[K]=!1,this[Fe]=null),this[ke]=!!s.async,this[as]=this[Fe]?new nd(this[Fe]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[q]});let{signal:i}=s;i&&(this[Hs]=i,i.aborted?this[pr]():i.addEventListener("abort",()=>this[pr]()))}get bufferLength(){return this[M]}get encoding(){return this[Fe]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[K]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ke]}set async(e){this[ke]=this[ke]||!!e}[pr](){this[en]=!0,this.emit("abort",this[Hs]?.reason),this.destroy(this[Hs]?.reason)}get aborted(){return this[en]}set aborted(e){}write(e,s,i){if(this[en])return!1;if(this[He])throw new Error("write after end");if(this[R])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(i=s,s="utf8"),s||(s="utf8");let n=this[ke]?Ws:ad;if(!this[K]&&!Buffer.isBuffer(e)){if(fd(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(cd(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[K]?(this[$]&&this[M]!==0&&this[Xi](!0),this[$]?this.emit("data",e):this[hr](e),this[M]!==0&&this.emit("readable"),i&&n(i),this[$]):e.length?(typeof e=="string"&&!(s===this[Fe]&&!this[as]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[Fe]&&(e=this[as].write(e)),this[$]&&this[M]!==0&&this[Xi](!0),this[$]?this.emit("data",e):this[hr](e),this[M]!==0&&this.emit("readable"),i&&n(i),this[$]):(this[M]!==0&&this.emit("readable"),i&&n(i),this[$])}read(e){if(this[R])return null;if(this[ee]=!1,this[M]===0||e===0||e&&e>this[M])return this[We](),null;this[K]&&(e=null),this[L].length>1&&!this[K]&&(this[L]=[this[Fe]?this[L].join(""):Buffer.concat(this[L],this[M])]);let s=this[nu](e||null,this[L][0]);return this[We](),s}[nu](e,s){if(this[K])this[Qi]();else{let i=s;e===i.length||e===null?this[Qi]():typeof i=="string"?(this[L][0]=i.slice(e),s=i.slice(0,e),this[M]-=e):(this[L][0]=i.subarray(e),s=i.subarray(0,e),this[M]-=e)}return this.emit("data",s),!this[L].length&&!this[He]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[He]=!0,this.writable=!1,(this[$]||!this[zs])&&this[We](),this}[us](){this[R]||(!this[Rt]&&!this[q].length&&(this[ee]=!0),this[zs]=!1,this[$]=!0,this.emit("resume"),this[L].length?this[Xi]():this[He]?this[We]():this.emit("drain"))}resume(){return this[us]()}pause(){this[$]=!1,this[zs]=!0,this[ee]=!1}get destroyed(){return this[R]}get flowing(){return this[$]}get paused(){return this[zs]}[hr](e){this[K]?this[M]+=1:this[M]+=e.length,this[L].push(e)}[Qi](){return this[K]?this[M]-=1:this[M]-=this[L][0].length,this[L].shift()}[Xi](e=!1){do;while(this[ou](this[Qi]())&&this[L].length);!e&&!this[L].length&&!this[He]&&this.emit("drain")}[ou](e){return this.emit("data",e),this[$]}pipe(e,s){if(this[R])return e;this[ee]=!1;let i=this[ot];return s=s||{},e===iu.stdout||e===iu.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[q].push(s.proxyErrors?new Dr(this,e,s):new tn(this,e,s)),this[ke]?Ws(()=>this[us]()):this[us]()),e}unpipe(e){let s=this[q].find(i=>i.dest===e);s&&(this[q].length===1?(this[$]&&this[Rt]===0&&(this[$]=!1),this[q]=[]):this[q].splice(this[q].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[ee]=!1,this[Rt]++,!this[q].length&&!this[$]&&this[us]();else if(e==="readable"&&this[M]!==0)super.emit("readable");else if(ud(e)&&this[ot])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Us]){let n=s;this[ke]?Ws(()=>n.call(this,this[Us])):n.call(this,this[Us])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[Rt]=this.listeners("data").length,this[Rt]===0&&!this[ee]&&!this[q].length&&(this[$]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Rt]=0,!this[ee]&&!this[q].length&&(this[$]=!1)),s}get emittedEnd(){return this[ot]}[We](){!this[qi]&&!this[ot]&&!this[R]&&this[L].length===0&&this[He]&&(this[qi]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Zi]&&this.emit("close"),this[qi]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==R&&this[R])return!1;if(e==="data")return!this[K]&&!i?!1:this[ke]?(Ws(()=>this[mr](i)),!0):this[mr](i);if(e==="end")return this[ru]();if(e==="close"){if(this[Zi]=!0,!this[ot]&&!this[R])return!1;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(e==="error"){this[Us]=i,super.emit(dr,i);let o=!this[Hs]||this.listeners("error").length?super.emit("error",i):!1;return this[We](),o}else if(e==="resume"){let o=super.emit("resume");return this[We](),o}else if(e==="finish"||e==="prefinish"){let o=super.emit(e);return this.removeAllListeners(e),o}let n=super.emit(e,...s);return this[We](),n}[mr](e){for(let i of this[q])i.dest.write(e)===!1&&this.pause();let s=this[ee]?!1:super.emit("data",e);return this[We](),s}[ru](){return this[ot]?!1:(this[ot]=!0,this.readable=!1,this[ke]?(Ws(()=>this[gr]()),!0):this[gr]())}[gr](){if(this[as]){let s=this[as].end();if(s){for(let i of this[q])i.dest.write(s);this[ee]||super.emit("data",s)}}for(let s of this[q])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[K]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[K]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[K])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Fe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(R,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ee]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[He])return s();let o,r,a=h=>{this.off("data",u),this.off("end",c),this.off(R,f),s(),r(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(R,f),this.pause(),o({value:h,done:!!this[He]})},c=()=>{this.off("error",a),this.off("data",u),this.off(R,f),s(),o({done:!0,value:void 0})},f=()=>a(new Error("stream destroyed"));return new Promise((h,g)=>{r=g,o=h,this.once(R,f),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ee]=!1;let e=!1,s=()=>(this.pause(),this.off(dr,s),this.off(R,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let n=this.read();return n===null?s():{done:!1,value:n}};return this.once("end",s),this.once(dr,s),this.once(R,s),{next:i,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[R])return e?this.emit("error",e):this.emit(R),this;this[R]=!0,this[ee]=!0,this[L].length=0,this[M]=0;let s=this;return typeof s.close=="function"&&!this[Zi]&&s.close(),e?this.emit("error",e):this.emit(R),this}static get isStream(){return od}};import*as au from"zlib";import md from"zlib";var gd=md.constants||{ZLIB_VERNUM:4736},ue=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},gd));var pd=kt.concat,uu=Object.getOwnPropertyDescriptor(kt,"concat"),Dd=t=>t,Fr=uu?.writable===!0||uu?.set!==void 0?t=>{kt.concat=t?Dd:pd}:t=>{},Tt=Symbol("_superWrite"),cs=class extends Error{code;errno;constructor(e,s){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,s??this.constructor)}get name(){return"ZlibError"}},br=Symbol("flushFlag"),Js=class extends Ks{#e=!1;#i=!1;#s;#n;#l;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,s){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#l=e.fullFlushFlag??0,typeof au[s]!="function")throw new TypeError("Compression method not supported: "+s);try{this.#t=new au[s](e)}catch(i){throw new cs(i,this.constructor)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new cs(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return yr(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#l),this.write(Object.assign(kt.alloc(0),{[br]:e})))}end(e,s,i){return typeof e=="function"&&(i=e,s=void 0,e=void 0),typeof s=="function"&&(i=s,s=void 0),e&&(s?this.write(e,s):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Tt](e){return super.write(e)}write(e,s,i){if(typeof s=="function"&&(i=s,s="utf8"),typeof e=="string"&&(e=kt.from(e,s)),this.#e)return;yr(this.#t,"zlib binding closed");let n=this.#t._handle,o=n.close;n.close=()=>{};let r=this.#t.close;this.#t.close=()=>{},Fr(!0);let a;try{let c=typeof e[br]=="number"?e[br]:this.#s;a=this.#t._processChunk(e,c),Fr(!1)}catch(c){Fr(!1),this.#o(new cs(c,this.write))}finally{this.#t&&(this.#t._handle=n,n.close=o,this.#t.close=r,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",c=>this.#o(new cs(c,this.write)));let u;if(a)if(Array.isArray(a)&&a.length>0){let c=a[0];u=this[Tt](kt.from(c));for(let f=1;f<a.length;f++)u=this[Tt](a[f])}else u=this[Tt](kt.from(a));return i&&i(),u}},sn=class extends Js{#e;#i;constructor(e,s){e=e||{},e.flush=e.flush||ue.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ue.Z_FINISH,e.fullFlushFlag=ue.Z_FULL_FLUSH,super(e,s),this.#e=e.level,this.#i=e.strategy}params(e,s){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#i!==s){this.flush(ue.Z_SYNC_FLUSH),yr(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(n,o)=>{typeof n=="function"&&(o=n,n=this.flushFlag),this.flush(n),o?.()};try{this.handle.params(e,s)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=s)}}}};var nn=class extends sn{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Tt](e){return this.#e?(this.#e=!1,e[9]=255,super[Tt](e)):super[Tt](e)}};var on=class extends sn{constructor(e){super(e,"Unzip")}},rn=class extends Js{constructor(e,s){e=e||{},e.flush=e.flush||ue.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ue.BROTLI_OPERATION_FINISH,e.fullFlushFlag=ue.BROTLI_OPERATION_FLUSH,super(e,s)}},ln=class extends rn{constructor(e){super(e,"BrotliCompress")}},an=class extends rn{constructor(e){super(e,"BrotliDecompress")}},un=class extends Js{constructor(e,s){e=e||{},e.flush=e.flush||ue.ZSTD_e_continue,e.finishFlush=e.finishFlush||ue.ZSTD_e_end,e.fullFlushFlag=ue.ZSTD_e_flush,super(e,s)}},cn=class extends un{constructor(e){super(e,"ZstdCompress")}},fn=class extends un{constructor(e){super(e,"ZstdDecompress")}};import{posix as fs}from"node:path";var cu=(t,e)=>{if(Number.isSafeInteger(t))t<0?bd(t,e):Fd(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Fd=(t,e)=>{e[0]=128;for(var s=e.length;s>1;s--)e[s-1]=t&255,t=Math.floor(t/256)},bd=(t,e)=>{e[0]=255;var s=!1;t=t*-1;for(var i=e.length;i>1;i--){var n=t&255;t=Math.floor(t/256),s?e[i-1]=hu(n):n===0?e[i-1]=0:(s=!0,e[i-1]=du(n))}},fu=t=>{let e=t[0],s=e===128?Cd(t.subarray(1,t.length)):e===255?yd(t):null;if(s===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(s))throw Error("parsed number outside of javascript safe integer range");return s},yd=t=>{for(var e=t.length,s=0,i=!1,n=e-1;n>-1;n--){var o=Number(t[n]),r;i?r=hu(o):o===0?r=o:(i=!0,r=du(o)),r!==0&&(s-=r*Math.pow(256,e-n-1))}return s},Cd=t=>{for(var e=t.length,s=0,i=e-1;i>-1;i--){var n=Number(t[i]);n!==0&&(s+=n*Math.pow(256,e-i-1))}return s},hu=t=>(255^t)&255,du=t=>(255^t)+1&255;var hn=t=>dn.has(t);var dn=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),mu=new Map(Array.from(dn).map(t=>[t[1],t[0]]));var te=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,s=0,i,n){Buffer.isBuffer(e)?this.decode(e,s||0,i,n):e&&this.#i(e)}decode(e,s,i,n){if(s||(s=0),!e||!(e.length>=s+512))throw new Error("need 512 bytes for header");this.path=i?.path??It(e,s,100),this.mode=i?.mode??n?.mode??rt(e,s+100,8),this.uid=i?.uid??n?.uid??rt(e,s+108,8),this.gid=i?.gid??n?.gid??rt(e,s+116,8),this.size=i?.size??n?.size??rt(e,s+124,12),this.mtime=i?.mtime??n?.mtime??Cr(e,s+136,12),this.cksum=rt(e,s+148,12),n&&this.#i(n,!0),i&&this.#i(i);let o=It(e,s+156,1);if(hn(o)&&(this.#e=o||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=It(e,s+157,100),e.subarray(s+257,s+265).toString()==="ustar\x0000")if(this.uname=i?.uname??n?.uname??It(e,s+265,32),this.gname=i?.gname??n?.gname??It(e,s+297,32),this.devmaj=i?.devmaj??n?.devmaj??rt(e,s+329,8)??0,this.devmin=i?.devmin??n?.devmin??rt(e,s+337,8)??0,e[s+475]!==0){let a=It(e,s+345,155);this.path=a+"/"+this.path}else{let a=It(e,s+345,130);a&&(this.path=a+"/"+this.path),this.atime=i?.atime??n?.atime??Cr(e,s+476,12),this.ctime=i?.ctime??n?.ctime??Cr(e,s+488,12)}let r=256;for(let a=s;a<s+148;a++)r+=e[a];for(let a=s+156;a<s+512;a++)r+=e[a];this.cksumValid=r===this.cksum,this.cksum===void 0&&r===256&&(this.nullBlock=!0)}#i(e,s=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,n])=>!(n==null||i==="path"&&s||i==="linkpath"&&s||i==="global"))))}encode(e,s=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=s+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,n=wd(this.path||"",i),o=n[0],r=n[1];this.needPax=!!n[2],this.needPax=Ot(e,s,100,o)||this.needPax,this.needPax=lt(e,s+100,8,this.mode)||this.needPax,this.needPax=lt(e,s+108,8,this.uid)||this.needPax,this.needPax=lt(e,s+116,8,this.gid)||this.needPax,this.needPax=lt(e,s+124,12,this.size)||this.needPax,this.needPax=Sr(e,s+136,12,this.mtime)||this.needPax,e[s+156]=this.#e.charCodeAt(0),this.needPax=Ot(e,s+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",s+257,8),this.needPax=Ot(e,s+265,32,this.uname)||this.needPax,this.needPax=Ot(e,s+297,32,this.gname)||this.needPax,this.needPax=lt(e,s+329,8,this.devmaj)||this.needPax,this.needPax=lt(e,s+337,8,this.devmin)||this.needPax,this.needPax=Ot(e,s+345,i,r)||this.needPax,e[s+475]!==0?this.needPax=Ot(e,s+345,155,r)||this.needPax:(this.needPax=Ot(e,s+345,130,r)||this.needPax,this.needPax=Sr(e,s+476,12,this.atime)||this.needPax,this.needPax=Sr(e,s+488,12,this.ctime)||this.needPax);let a=256;for(let u=s;u<s+148;u++)a+=e[u];for(let u=s+156;u<s+512;u++)a+=e[u];return this.cksum=a,lt(e,s+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:dn.get(this.#e)}get typeKey(){return this.#e}set type(e){let s=String(mu.get(e));if(hn(s)||s==="Unsupported")this.#e=s;else if(hn(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}},wd=(t,e)=>{let i=t,n="",o,r=fs.parse(t).root||".";if(Buffer.byteLength(i)<100)o=[i,n,!1];else{n=fs.dirname(i),i=fs.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(n)<=e?o=[i,n,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(n)<=e?o=[i.slice(0,99),n,!0]:(i=fs.join(fs.basename(n),i),n=fs.dirname(n));while(n!==r&&o===void 0);o||(o=[t.slice(0,99),"",!0])}return o},It=(t,e,s)=>t.subarray(e,e+s).toString("utf8").replace(/\0.*/,""),Cr=(t,e,s)=>xd(rt(t,e,s)),xd=t=>t===void 0?void 0:new Date(t*1e3),rt=(t,e,s)=>Number(t[e])&128?fu(t.subarray(e,e+s)):Ad(t,e,s),_d=t=>isNaN(t)?void 0:t,Ad=(t,e,s)=>_d(parseInt(t.subarray(e,e+s).toString("utf8").replace(/\0.*$/,"").trim(),8)),vd={12:8589934591,8:2097151},lt=(t,e,s,i)=>i===void 0?!1:i>vd[s]||i<0?(cu(i,t.subarray(e,e+s)),!0):(Rd(t,e,s,i),!1),Rd=(t,e,s,i)=>t.write(kd(i,s),e,s,"ascii"),kd=(t,e)=>Td(Math.floor(t).toString(8),e),Td=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",Sr=(t,e,s,i)=>i===void 0?!1:lt(t,e,s,i.getTime()/1e3),Id=new Array(156).join("\0"),Ot=(t,e,s,i)=>i===void 0?!1:(t.write(i+Id,e,s,"utf8"),i.length!==Buffer.byteLength(i)||i.length>s);import{basename as Od}from"node:path";var at=class t{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,s=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=s,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let s=Buffer.byteLength(e),i=512*Math.ceil(1+s/512),n=Buffer.allocUnsafe(i);for(let o=0;o<512;o++)n[o]=0;new te({path:("PaxHeader/"+Od(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:s,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(n),n.write(e,512,s,"utf8");for(let o=s+512;o<n.length;o++)n[o]=0;return n}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let s=this[e],i=s instanceof Date?s.getTime()/1e3:s,n=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+i+`
18
+ `,o=Buffer.byteLength(n),r=Math.floor(Math.log(o)/Math.log(10))+1;return o+r>=Math.pow(10,r)&&(r+=1),r+o+n}static parse(e,s,i=!1){return new t(Pd(Bd(e),s),i)}},Pd=(t,e)=>e?Object.assign({},e,t):t,Bd=t=>t.replace(/\n$/,"").split(`
19
+ `).reduce(Nd,Object.create(null)),Nd=(t,e)=>{let s=parseInt(e,10);if(s!==Buffer.byteLength(e)+1)return t;e=e.slice((s+" ").length);let i=e.split("="),n=i.shift();if(!n)return t;let o=n.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),r=i.join("=");return t[o]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(o)?new Date(Number(r)*1e3):/^[0-9]+$/.test(r)?+r:r,t};import{EventEmitter as kr}from"node:events";import bu from"node:stream";import{StringDecoder as $d}from"node:string_decoder";var pu=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ld=t=>!!t&&typeof t=="object"&&(t instanceof Ie||t instanceof bu||Md(t)||Gd(t)),Md=t=>!!t&&typeof t=="object"&&t instanceof kr&&typeof t.pipe=="function"&&t.pipe!==bu.Writable.prototype.pipe,Gd=t=>!!t&&typeof t=="object"&&t instanceof kr&&typeof t.write=="function"&&typeof t.end=="function",Ke=Symbol("EOF"),Je=Symbol("maybeEmitEnd"),ut=Symbol("emittedEnd"),mn=Symbol("emittingEnd"),Vs=Symbol("emittedError"),gn=Symbol("closed"),Du=Symbol("read"),pn=Symbol("flush"),Eu=Symbol("flushChunk"),be=Symbol("encoding"),hs=Symbol("decoder"),G=Symbol("flowing"),Ys=Symbol("paused"),ds=Symbol("resume"),j=Symbol("buffer"),Z=Symbol("pipes"),U=Symbol("bufferLength"),wr=Symbol("bufferPush"),Dn=Symbol("bufferShift"),J=Symbol("objectMode"),k=Symbol("destroyed"),xr=Symbol("error"),_r=Symbol("emitData"),Fu=Symbol("emitEnd"),Ar=Symbol("emitEnd2"),Te=Symbol("async"),vr=Symbol("abort"),En=Symbol("aborted"),qs=Symbol("signal"),Pt=Symbol("dataListeners"),se=Symbol("discarded"),Zs=t=>Promise.resolve().then(t),jd=t=>t(),Ud=t=>t==="end"||t==="finish"||t==="prefinish",zd=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Hd=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Fn=class{src;dest;opts;ondrain;constructor(e,s,i){this.src=e,this.dest=s,this.opts=i,this.ondrain=()=>e[ds](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Rr=class extends Fn{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,i){super(e,s,i),this.proxyErrors=n=>s.emit("error",n),e.on("error",this.proxyErrors)}},Wd=t=>!!t.objectMode,Kd=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Ie=class extends kr{[G]=!1;[Ys]=!1;[Z]=[];[j]=[];[J];[be];[Te];[hs];[Ke]=!1;[ut]=!1;[mn]=!1;[gn]=!1;[Vs]=null;[U]=0;[k]=!1;[qs];[En]=!1;[Pt]=0;[se]=!1;writable=!0;readable=!0;constructor(...e){let s=e[0]||{};if(super(),s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Wd(s)?(this[J]=!0,this[be]=null):Kd(s)?(this[be]=s.encoding,this[J]=!1):(this[J]=!1,this[be]=null),this[Te]=!!s.async,this[hs]=this[be]?new $d(this[be]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[j]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Z]});let{signal:i}=s;i&&(this[qs]=i,i.aborted?this[vr]():i.addEventListener("abort",()=>this[vr]()))}get bufferLength(){return this[U]}get encoding(){return this[be]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[J]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Te]}set async(e){this[Te]=this[Te]||!!e}[vr](){this[En]=!0,this.emit("abort",this[qs]?.reason),this.destroy(this[qs]?.reason)}get aborted(){return this[En]}set aborted(e){}write(e,s,i){if(this[En])return!1;if(this[Ke])throw new Error("write after end");if(this[k])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(i=s,s="utf8"),s||(s="utf8");let n=this[Te]?Zs:jd;if(!this[J]&&!Buffer.isBuffer(e)){if(Hd(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(zd(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[J]?(this[G]&&this[U]!==0&&this[pn](!0),this[G]?this.emit("data",e):this[wr](e),this[U]!==0&&this.emit("readable"),i&&n(i),this[G]):e.length?(typeof e=="string"&&!(s===this[be]&&!this[hs]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[be]&&(e=this[hs].write(e)),this[G]&&this[U]!==0&&this[pn](!0),this[G]?this.emit("data",e):this[wr](e),this[U]!==0&&this.emit("readable"),i&&n(i),this[G]):(this[U]!==0&&this.emit("readable"),i&&n(i),this[G])}read(e){if(this[k])return null;if(this[se]=!1,this[U]===0||e===0||e&&e>this[U])return this[Je](),null;this[J]&&(e=null),this[j].length>1&&!this[J]&&(this[j]=[this[be]?this[j].join(""):Buffer.concat(this[j],this[U])]);let s=this[Du](e||null,this[j][0]);return this[Je](),s}[Du](e,s){if(this[J])this[Dn]();else{let i=s;e===i.length||e===null?this[Dn]():typeof i=="string"?(this[j][0]=i.slice(e),s=i.slice(0,e),this[U]-=e):(this[j][0]=i.subarray(e),s=i.subarray(0,e),this[U]-=e)}return this.emit("data",s),!this[j].length&&!this[Ke]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[Ke]=!0,this.writable=!1,(this[G]||!this[Ys])&&this[Je](),this}[ds](){this[k]||(!this[Pt]&&!this[Z].length&&(this[se]=!0),this[Ys]=!1,this[G]=!0,this.emit("resume"),this[j].length?this[pn]():this[Ke]?this[Je]():this.emit("drain"))}resume(){return this[ds]()}pause(){this[G]=!1,this[Ys]=!0,this[se]=!1}get destroyed(){return this[k]}get flowing(){return this[G]}get paused(){return this[Ys]}[wr](e){this[J]?this[U]+=1:this[U]+=e.length,this[j].push(e)}[Dn](){return this[J]?this[U]-=1:this[U]-=this[j][0].length,this[j].shift()}[pn](e=!1){do;while(this[Eu](this[Dn]())&&this[j].length);!e&&!this[j].length&&!this[Ke]&&this.emit("drain")}[Eu](e){return this.emit("data",e),this[G]}pipe(e,s){if(this[k])return e;this[se]=!1;let i=this[ut];return s=s||{},e===pu.stdout||e===pu.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[Z].push(s.proxyErrors?new Rr(this,e,s):new Fn(this,e,s)),this[Te]?Zs(()=>this[ds]()):this[ds]()),e}unpipe(e){let s=this[Z].find(i=>i.dest===e);s&&(this[Z].length===1?(this[G]&&this[Pt]===0&&(this[G]=!1),this[Z]=[]):this[Z].splice(this[Z].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[se]=!1,this[Pt]++,!this[Z].length&&!this[G]&&this[ds]();else if(e==="readable"&&this[U]!==0)super.emit("readable");else if(Ud(e)&&this[ut])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Vs]){let n=s;this[Te]?Zs(()=>n.call(this,this[Vs])):n.call(this,this[Vs])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[Pt]=this.listeners("data").length,this[Pt]===0&&!this[se]&&!this[Z].length&&(this[G]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Pt]=0,!this[se]&&!this[Z].length&&(this[G]=!1)),s}get emittedEnd(){return this[ut]}[Je](){!this[mn]&&!this[ut]&&!this[k]&&this[j].length===0&&this[Ke]&&(this[mn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[gn]&&this.emit("close"),this[mn]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==k&&this[k])return!1;if(e==="data")return!this[J]&&!i?!1:this[Te]?(Zs(()=>this[_r](i)),!0):this[_r](i);if(e==="end")return this[Fu]();if(e==="close"){if(this[gn]=!0,!this[ut]&&!this[k])return!1;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(e==="error"){this[Vs]=i,super.emit(xr,i);let o=!this[qs]||this.listeners("error").length?super.emit("error",i):!1;return this[Je](),o}else if(e==="resume"){let o=super.emit("resume");return this[Je](),o}else if(e==="finish"||e==="prefinish"){let o=super.emit(e);return this.removeAllListeners(e),o}let n=super.emit(e,...s);return this[Je](),n}[_r](e){for(let i of this[Z])i.dest.write(e)===!1&&this.pause();let s=this[se]?!1:super.emit("data",e);return this[Je](),s}[Fu](){return this[ut]?!1:(this[ut]=!0,this.readable=!1,this[Te]?(Zs(()=>this[Ar]()),!0):this[Ar]())}[Ar](){if(this[hs]){let s=this[hs].end();if(s){for(let i of this[Z])i.dest.write(s);this[se]||super.emit("data",s)}}for(let s of this[Z])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[J]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[J]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[J])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[be]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(k,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[se]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[Ke])return s();let o,r,a=h=>{this.off("data",u),this.off("end",c),this.off(k,f),s(),r(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(k,f),this.pause(),o({value:h,done:!!this[Ke]})},c=()=>{this.off("error",a),this.off("data",u),this.off(k,f),s(),o({done:!0,value:void 0})},f=()=>a(new Error("stream destroyed"));return new Promise((h,g)=>{r=g,o=h,this.once(k,f),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[se]=!1;let e=!1,s=()=>(this.pause(),this.off(xr,s),this.off(k,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let n=this.read();return n===null?s():{done:!1,value:n}};return this.once("end",s),this.once(xr,s),this.once(k,s),{next:i,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[k])return e?this.emit("error",e):this.emit(k),this;this[k]=!0,this[se]=!0,this[j].length=0,this[U]=0;let s=this;return typeof s.close=="function"&&!this[gn]&&s.close(),e?this.emit("error",e):this.emit(k),this}static get isStream(){return Ld}};var Jd=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,b=Jd!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/");var ms=class extends Ie{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,s,i){switch(super({}),this.pause(),this.extended=s,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=b(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?b(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,s&&this.#e(s),i&&this.#e(i,!0)}write(e){let s=e.length;if(s>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,n=this.blockRemain;return this.remain=Math.max(0,i-s),this.blockRemain=Math.max(0,n-s),this.ignore?!0:i>=s?super.write(e):super.write(e.subarray(0,i))}#e(e,s=!1){e.path&&(e.path=b(e.path)),e.linkpath&&(e.linkpath=b(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,n])=>!(n==null||i==="path"&&s))))}};var Bt=(t,e,s,i={})=>{t.file&&(i.file=t.file),t.cwd&&(i.cwd=t.cwd),i.code=s instanceof Error&&s.code||e,i.tarCode=e,!t.strict&&i.recoverable!==!1?(s instanceof Error&&(i=Object.assign(s,i),s=s.message),t.emit("warn",e,s,i)):s instanceof Error?t.emit("error",Object.assign(s,i)):t.emit("error",Object.assign(new Error(`${e}: ${s}`),i))};var Yd=1024*1024,Br=Buffer.from([31,139]),Nr=Buffer.from([40,181,47,253]),qd=Math.max(Br.length,Nr.length),ce=Symbol("state"),Nt=Symbol("writeEntry"),Ve=Symbol("readEntry"),Tr=Symbol("nextEntry"),yu=Symbol("processEntry"),Oe=Symbol("extendedHeader"),Xs=Symbol("globalExtendedHeader"),ct=Symbol("meta"),Cu=Symbol("emitMeta"),w=Symbol("buffer"),Ye=Symbol("queue"),ft=Symbol("ended"),Ir=Symbol("emittedEnd"),$t=Symbol("emit"),I=Symbol("unzip"),bn=Symbol("consumeChunk"),yn=Symbol("consumeChunkSub"),Or=Symbol("consumeBody"),Su=Symbol("consumeMeta"),wu=Symbol("consumeHeader"),Qs=Symbol("consuming"),Pr=Symbol("bufferConcat"),Cn=Symbol("maybeEnd"),gs=Symbol("writing"),ht=Symbol("aborted"),Sn=Symbol("onDone"),Lt=Symbol("sawValidEntry"),wn=Symbol("sawNullBlock"),xn=Symbol("sawEOF"),xu=Symbol("closeStream"),Zd=()=>!0,qe=class extends Vd{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Ye]=[];[w];[Ve];[Nt];[ce]="begin";[ct]="";[Oe];[Xs];[ft]=!1;[I];[ht]=!1;[Lt];[wn]=!1;[xn]=!1;[gs]=!1;[Qs]=!1;[Ir]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(Sn,()=>{(this[ce]==="begin"||this[Lt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Sn,e.ondone):this.on(Sn,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Yd,this.filter=typeof e.filter=="function"?e.filter:Zd;let s=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:s?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[xu]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,s,i={}){Bt(this,e,s,i)}[wu](e,s){this[Lt]===void 0&&(this[Lt]=!1);let i;try{i=new te(e,s,this[Oe],this[Xs])}catch(n){return this.warn("TAR_ENTRY_INVALID",n)}if(i.nullBlock)this[wn]?(this[xn]=!0,this[ce]==="begin"&&(this[ce]="header"),this[$t]("eof")):(this[wn]=!0,this[$t]("nullBlock"));else if(this[wn]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let n=i.type;if(/^(Symbolic)?Link$/.test(n)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(n)&&!/^(Global)?ExtendedHeader$/.test(n)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let o=this[Nt]=new ms(i,this[Oe],this[Xs]);if(!this[Lt])if(o.remain){let r=()=>{o.invalid||(this[Lt]=!0)};o.on("end",r)}else this[Lt]=!0;o.meta?o.size>this.maxMetaEntrySize?(o.ignore=!0,this[$t]("ignoredEntry",o),this[ce]="ignore",o.resume()):o.size>0&&(this[ct]="",o.on("data",r=>this[ct]+=r),this[ce]="meta"):(this[Oe]=void 0,o.ignore=o.ignore||!this.filter(o.path,o),o.ignore?(this[$t]("ignoredEntry",o),this[ce]=o.remain?"ignore":"header",o.resume()):(o.remain?this[ce]="body":(this[ce]="header",o.end()),this[Ve]?this[Ye].push(o):(this[Ye].push(o),this[Tr]())))}}}[xu](){queueMicrotask(()=>this.emit("close"))}[yu](e){let s=!0;if(!e)this[Ve]=void 0,s=!1;else if(Array.isArray(e)){let[i,...n]=e;this.emit(i,...n)}else this[Ve]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[Tr]()),s=!1);return s}[Tr](){do;while(this[yu](this[Ye].shift()));if(!this[Ye].length){let e=this[Ve];!e||e.flowing||e.size===e.remain?this[gs]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[Or](e,s){let i=this[Nt];if(!i)throw new Error("attempt to consume body without entry??");let n=i.blockRemain??0,o=n>=e.length&&s===0?e:e.subarray(s,s+n);return i.write(o),i.blockRemain||(this[ce]="header",this[Nt]=void 0,i.end()),o.length}[Su](e,s){let i=this[Nt],n=this[Or](e,s);return!this[Nt]&&i&&this[Cu](i),n}[$t](e,s,i){!this[Ye].length&&!this[Ve]?this.emit(e,s,i):this[Ye].push([e,s,i])}[Cu](e){switch(this[$t]("meta",this[ct]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Oe]=at.parse(this[ct],this[Oe],!1);break;case"GlobalExtendedHeader":this[Xs]=at.parse(this[ct],this[Xs],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let s=this[Oe]??Object.create(null);this[Oe]=s,s.path=this[ct].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let s=this[Oe]||Object.create(null);this[Oe]=s,s.linkpath=this[ct].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[ht]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,s,i){if(typeof s=="function"&&(i=s,s=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof s=="string"?s:"utf8")),this[ht])return i?.(),!1;if((this[I]===void 0||this.brotli===void 0&&this[I]===!1)&&e){if(this[w]&&(e=Buffer.concat([this[w],e]),this[w]=void 0),e.length<qd)return this[w]=e,i?.(),!0;for(let u=0;this[I]===void 0&&u<Br.length;u++)e[u]!==Br[u]&&(this[I]=!1);let r=!1;if(this[I]===!1&&this.zstd!==!1){r=!0;for(let u=0;u<Nr.length;u++)if(e[u]!==Nr[u]){r=!1;break}}let a=this.brotli===void 0&&!r;if(this[I]===!1&&a)if(e.length<512)if(this[ft])this.brotli=!0;else return this[w]=e,i?.(),!0;else try{new te(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[I]===void 0||this[I]===!1&&(this.brotli||r)){let u=this[ft];this[ft]=!1,this[I]=this[I]===void 0?new on({}):r?new fn({}):new an({}),this[I].on("data",f=>this[bn](f)),this[I].on("error",f=>this.abort(f)),this[I].on("end",()=>{this[ft]=!0,this[bn]()}),this[gs]=!0;let c=!!this[I][u?"end":"write"](e);return this[gs]=!1,i?.(),c}}this[gs]=!0,this[I]?this[I].write(e):this[bn](e),this[gs]=!1;let o=this[Ye].length?!1:this[Ve]?this[Ve].flowing:!0;return!o&&!this[Ye].length&&this[Ve]?.once("drain",()=>this.emit("drain")),i?.(),o}[Pr](e){e&&!this[ht]&&(this[w]=this[w]?Buffer.concat([this[w],e]):e)}[Cn](){if(this[ft]&&!this[Ir]&&!this[ht]&&!this[Qs]){this[Ir]=!0;let e=this[Nt];if(e&&e.blockRemain){let s=this[w]?this[w].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${s} available)`,{entry:e}),this[w]&&e.write(this[w]),e.end()}this[$t](Sn)}}[bn](e){if(this[Qs]&&e)this[Pr](e);else if(!e&&!this[w])this[Cn]();else if(e){if(this[Qs]=!0,this[w]){this[Pr](e);let s=this[w];this[w]=void 0,this[yn](s)}else this[yn](e);for(;this[w]&&this[w]?.length>=512&&!this[ht]&&!this[xn];){let s=this[w];this[w]=void 0,this[yn](s)}this[Qs]=!1}(!this[w]||this[ft])&&this[Cn]()}[yn](e){let s=0,i=e.length;for(;s+512<=i&&!this[ht]&&!this[xn];)switch(this[ce]){case"begin":case"header":this[wu](e,s),s+=512;break;case"ignore":case"body":s+=this[Or](e,s);break;case"meta":s+=this[Su](e,s);break;default:throw new Error("invalid state: "+this[ce])}s<i&&(this[w]?this[w]=Buffer.concat([e.subarray(s),this[w]]):this[w]=e.subarray(s))}end(e,s,i){return typeof e=="function"&&(i=e,s=void 0,e=void 0),typeof s=="function"&&(i=s,s=void 0),typeof e=="string"&&(e=Buffer.from(e,s)),i&&this.once("finish",i),this[ht]||(this[I]?(e&&this[I].write(e),this[I].end()):(this[ft]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[Cn]())),this}};var dt=t=>{let e=t.length-1,s=-1;for(;e>-1&&t.charAt(e)==="/";)s=e,e--;return s===-1?t:t.slice(0,s)};var em=t=>{let e=t.onReadEntry;t.onReadEntry=e?s=>{e(s),s.resume()}:s=>s.resume()},$r=(t,e)=>{let s=new Map(e.map(o=>[dt(o),!0])),i=t.filter,n=(o,r="")=>{let a=r||Qd(o).root||".",u;if(o===a)u=!1;else{let c=s.get(o);c!==void 0?u=c:u=n(Xd(o),a)}return s.set(o,u),u};t.filter=i?(o,r)=>i(o,r)&&n(dt(o)):o=>n(dt(o))},tm=t=>{let e=new qe(t),s=t.file,i;try{i=ps.openSync(s,"r");let n=ps.fstatSync(i),o=t.maxReadSize||16*1024*1024;if(n.size<o){let r=Buffer.allocUnsafe(n.size),a=ps.readSync(i,r,0,n.size,0);e.end(a===r.byteLength?r:r.subarray(0,a))}else{let r=0,a=Buffer.allocUnsafe(o);for(;r<n.size;){let u=ps.readSync(i,a,0,o,r);if(u===0)break;r+=u,e.write(a.subarray(0,u))}e.end()}}finally{if(typeof i=="number")try{ps.closeSync(i)}catch{}}},sm=(t,e)=>{let s=new qe(t),i=t.maxReadSize||16*1024*1024,n=t.file;return new Promise((r,a)=>{s.on("error",a),s.on("end",r),ps.stat(n,(u,c)=>{if(u)a(u);else{let f=new vt(n,{readSize:i,size:c.size});f.on("error",a),f.pipe(s)}})})},Mt=Re(tm,sm,t=>new qe(t),t=>new qe(t),(t,e)=>{e?.length&&$r(t,e),t.noResume||em(t)});import Ln from"fs";import Pe from"fs";import Ru from"path";var Lr=(t,e,s)=>(t&=4095,s&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t);import{win32 as im}from"node:path";var{isAbsolute:nm,parse:_u}=im,ei=t=>{let e="",s=_u(t);for(;nm(t)||s.root;){let i=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":s.root;t=t.slice(i.length),e+=i,s=_u(t)}return[e,t]};var _n=["|","<",">","?",":"],Mr=_n.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),om=new Map(_n.map((t,e)=>[t,Mr[e]])),rm=new Map(Mr.map((t,e)=>[t,_n[e]])),Gr=t=>_n.reduce((e,s)=>e.split(s).join(om.get(s)),t),Au=t=>Mr.reduce((e,s)=>e.split(s).join(rm.get(s)),t);var Pu=(t,e)=>e?(t=b(t).replace(/^\.(\/|$)/,""),dt(e)+"/"+t):b(t),lm=16*1024*1024,ku=Symbol("process"),Tu=Symbol("file"),Iu=Symbol("directory"),Ur=Symbol("symlink"),Ou=Symbol("hardlink"),ti=Symbol("header"),An=Symbol("read"),zr=Symbol("lstat"),vn=Symbol("onlstat"),Hr=Symbol("onread"),Wr=Symbol("onreadlink"),Kr=Symbol("openfile"),Jr=Symbol("onopenfile"),mt=Symbol("close"),Rn=Symbol("mode"),Vr=Symbol("awaitDrain"),jr=Symbol("ondrain"),Be=Symbol("prefix"),si=class extends Ie{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,s={}){let i=js(s);super(),this.path=b(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||lm,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=b(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?b(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[r,a]=ei(this.path);r&&typeof a=="string"&&(this.path=a,n=r)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=Au(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=b(i.absolute||Ru.resolve(this.cwd,e)),this.path===""&&(this.path="./"),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path});let o=this.statCache.get(this.absolute);o?this[vn](o):this[zr]()}warn(e,s,i={}){return Bt(this,e,s,i)}emit(e,...s){return e==="error"&&(this.#e=!0),super.emit(e,...s)}[zr](){Pe.lstat(this.absolute,(e,s)=>{if(e)return this.emit("error",e);this[vn](s)})}[vn](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=am(e),this.emit("stat",e),this[ku]()}[ku](){switch(this.type){case"File":return this[Tu]();case"Directory":return this[Iu]();case"SymbolicLink":return this[Ur]();default:return this.end()}}[Rn](e){return Lr(e,this.type==="Directory",this.portable)}[Be](e){return Pu(e,this.prefix)}[ti](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new te({path:this[Be](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Be](this.linkpath):this.linkpath,mode:this[Rn](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new at({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[Be](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Be](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[Iu](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[ti](),this.end()}[Ur](){Pe.readlink(this.absolute,(e,s)=>{if(e)return this.emit("error",e);this[Wr](s)})}[Wr](e){this.linkpath=b(e),this[ti](),this.end()}[Ou](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=b(Ru.relative(this.cwd,e)),this.stat.size=0,this[ti](),this.end()}[Tu](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,s=this.linkCache.get(e);if(s?.indexOf(this.cwd)===0)return this[Ou](s);this.linkCache.set(e,this.absolute)}if(this[ti](),this.stat.size===0)return this.end();this[Kr]()}[Kr](){Pe.open(this.absolute,"r",(e,s)=>{if(e)return this.emit("error",e);this[Jr](s)})}[Jr](e){if(this.fd=e,this.#e)return this[mt]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let s=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(s),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[An]()}[An](){let{fd:e,buf:s,offset:i,length:n,pos:o}=this;if(e===void 0||s===void 0)throw new Error("cannot read file without first opening");Pe.read(e,s,i,n,o,(r,a)=>{if(r)return this[mt](()=>this.emit("error",r));this[Hr](a)})}[mt](e=()=>{}){this.fd!==void 0&&Pe.close(this.fd,e)}[Hr](e){if(e<=0&&this.remain>0){let n=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[mt](()=>this.emit("error",n))}if(e>this.remain){let n=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[mt](()=>this.emit("error",n))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let n=e;n<this.length&&e<this.blockRemain;n++)this.buf[n+this.offset]=0,e++,this.remain++;let s=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(s)?this[jr]():this[Vr](()=>this[jr]())}[Vr](e){this.once("drain",e)}write(e,s,i){if(typeof s=="function"&&(i=s,s=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof s=="string"?s:"utf8")),this.blockRemain<e.length){let n=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",n)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[jr](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[mt](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[An]()}},kn=class extends si{sync=!0;[zr](){this[vn](Pe.lstatSync(this.absolute))}[Ur](){this[Wr](Pe.readlinkSync(this.absolute))}[Kr](){this[Jr](Pe.openSync(this.absolute,"r"))}[An](){let e=!0;try{let{fd:s,buf:i,offset:n,length:o,pos:r}=this;if(s===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let a=Pe.readSync(s,i,n,o,r);this[Hr](a),e=!1}finally{if(e)try{this[mt](()=>{})}catch{}}}[Vr](e){e()}[mt](e=()=>{}){this.fd!==void 0&&Pe.closeSync(this.fd),e()}},Tn=class extends Ie{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,s,i={}){return Bt(this,e,s,i)}constructor(e,s={}){let i=js(s);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:n}=e;if(n==="Unsupported")throw new Error("writing entry that should be ignored");this.type=n,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=b(e.path),this.mode=e.mode!==void 0?this[Rn](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?b(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let o=!1;if(!this.preservePaths){let[a,u]=ei(this.path);a&&typeof u=="string"&&(this.path=u,o=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new te({path:this[Be](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Be](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),o&&this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:this,path:o+this.path}),this.header.encode()&&!this.noPax&&super.write(new at({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[Be](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Be](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let r=this.header?.block;if(!r)throw new Error("failed to encode header");super.write(r),e.pipe(this)}[Be](e){return Pu(e,this.prefix)}[Rn](e){return Lr(e,this.type==="Directory",this.portable)}write(e,s,i){typeof s=="function"&&(i=s,s=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof s=="string"?s:"utf8"));let n=e.length;if(n>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=n,super.write(e,i)}end(e,s,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,s=void 0,e=void 0),typeof s=="function"&&(i=s,s=void 0),typeof e=="string"&&(e=Buffer.from(e,s??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}},am=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";var In=class t{tail;head;length=0;static create(e=[]){return new t(e)}constructor(e=[]){for(let s of e)this.push(s)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let s=e.next,i=e.prev;return s&&(s.prev=i),i&&(i.next=s),e===this.head&&(this.head=s),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,s}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let s=this.head;e.list=this,e.next=s,s&&(s.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let s=this.tail;e.list=this,e.prev=s,s&&(s.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let s=0,i=e.length;s<i;s++)cm(this,e[s]);return this.length}unshift(...e){for(var s=0,i=e.length;s<i;s++)fm(this,e[s]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,s=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,s.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,s=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,s.list=void 0,this.length--,e}forEach(e,s){s=s||this;for(let i=this.head,n=0;i;n++)e.call(s,i.value,n,this),i=i.next}forEachReverse(e,s){s=s||this;for(let i=this.tail,n=this.length-1;i;n--)e.call(s,i.value,n,this),i=i.prev}get(e){let s=0,i=this.head;for(;i&&s<e;s++)i=i.next;if(s===e&&i)return i.value}getReverse(e){let s=0,i=this.tail;for(;i&&s<e;s++)i=i.prev;if(s===e&&i)return i.value}map(e,s){s=s||this;let i=new t;for(let n=this.head;n;)i.push(e.call(s,n.value,this)),n=n.next;return i}mapReverse(e,s){s=s||this;var i=new t;for(let n=this.tail;n;)i.push(e.call(s,n.value,this)),n=n.prev;return i}reduce(e,s){let i,n=this.head;if(arguments.length>1)i=s;else if(this.head)n=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;n;o++)i=e(i,n.value,o),n=n.next;return i}reduceReverse(e,s){let i,n=this.tail;if(arguments.length>1)i=s;else if(this.tail)n=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let o=this.length-1;n;o--)i=e(i,n.value,o),n=n.prev;return i}toArray(){let e=new Array(this.length);for(let s=0,i=this.head;i;s++)e[s]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let s=0,i=this.tail;i;s++)e[s]=i.value,i=i.prev;return e}slice(e=0,s=this.length){s<0&&(s+=this.length),e<0&&(e+=this.length);let i=new t;if(s<e||s<0)return i;e<0&&(e=0),s>this.length&&(s=this.length);let n=this.head,o=0;for(o=0;n&&o<e;o++)n=n.next;for(;n&&o<s;o++,n=n.next)i.push(n.value);return i}sliceReverse(e=0,s=this.length){s<0&&(s+=this.length),e<0&&(e+=this.length);let i=new t;if(s<e||s<0)return i;e<0&&(e=0),s>this.length&&(s=this.length);let n=this.length,o=this.tail;for(;o&&n>s;n--)o=o.prev;for(;o&&n>e;n--,o=o.prev)i.push(o.value);return i}splice(e,s=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let n=this.head;for(let r=0;n&&r<e;r++)n=n.next;let o=[];for(let r=0;n&&r<s;r++)o.push(n.value),n=this.removeNode(n);n?n!==this.tail&&(n=n.prev):n=this.tail;for(let r of i)n=um(this,n,r);return o}reverse(){let e=this.head,s=this.tail;for(let i=e;i;i=i.prev){let n=i.prev;i.prev=i.next,i.next=n}return this.head=s,this.tail=e,this}};function um(t,e,s){let i=e,n=e?e.next:t.head,o=new ii(s,i,n,t);return o.next===void 0&&(t.tail=o),o.prev===void 0&&(t.head=o),t.length++,o}function cm(t,e){t.tail=new ii(e,t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}function fm(t,e){t.head=new ii(e,void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}var ii=class{list;next;prev;value;constructor(e,s,i,n){this.list=n,this.value=e,s?(s.next=this,this.prev=s):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};import Mu from"path";var Mn=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,s){this.path=e||"./",this.absolute=s}},Bu=Buffer.alloc(1024),On=Symbol("onStat"),ni=Symbol("ended"),ye=Symbol("queue"),Ds=Symbol("current"),Gt=Symbol("process"),oi=Symbol("processing"),Nu=Symbol("processJob"),Ce=Symbol("jobs"),Yr=Symbol("jobDone"),Pn=Symbol("addFSEntry"),$u=Symbol("addTarEntry"),Xr=Symbol("stat"),Qr=Symbol("readdir"),Bn=Symbol("onreaddir"),Nn=Symbol("pipe"),Lu=Symbol("entry"),qr=Symbol("entryOpt"),$n=Symbol("writeEntryClass"),Gu=Symbol("write"),Zr=Symbol("ondrain"),gt=class extends Ie{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[$n];onWriteEntry;[ye];[Ce]=0;[oi]=!1;[ni]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=b(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[$n]=si,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new nn(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new ln(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new cn(e.zstd)),!this.zip)throw new Error("impossible");let s=this.zip;s.on("data",i=>super.write(i)),s.on("end",()=>super.end()),s.on("drain",()=>this[Zr]()),this.on("resume",()=>s.resume())}else this.on("drain",this[Zr]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[ye]=new In,this[Ce]=0,this.jobs=Number(e.jobs)||4,this[oi]=!1,this[ni]=!1}[Gu](e){return super.write(e)}add(e){return this.write(e),this}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s=void 0),e&&this.add(e),this[ni]=!0,this[Gt](),i&&i(),this}write(e){if(this[ni])throw new Error("write after end");return e instanceof ms?this[$u](e):this[Pn](e),this.flowing}[$u](e){let s=b(Mu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Mn(e.path,s);i.entry=new Tn(e,this[qr](i)),i.entry.on("end",()=>this[Yr](i)),this[Ce]+=1,this[ye].push(i)}this[Gt]()}[Pn](e){let s=b(Mu.resolve(this.cwd,e));this[ye].push(new Mn(e,s)),this[Gt]()}[Xr](e){e.pending=!0,this[Ce]+=1;let s=this.follow?"stat":"lstat";Ln[s](e.absolute,(i,n)=>{e.pending=!1,this[Ce]-=1,i?this.emit("error",i):this[On](e,n)})}[On](e,s){this.statCache.set(e.absolute,s),e.stat=s,this.filter(e.path,s)||(e.ignore=!0),this[Gt]()}[Qr](e){e.pending=!0,this[Ce]+=1,Ln.readdir(e.absolute,(s,i)=>{if(e.pending=!1,this[Ce]-=1,s)return this.emit("error",s);this[Bn](e,i)})}[Bn](e,s){this.readdirCache.set(e.absolute,s),e.readdir=s,this[Gt]()}[Gt](){if(!this[oi]){this[oi]=!0;for(let e=this[ye].head;e&&this[Ce]<this.jobs;e=e.next)if(this[Nu](e.value),e.value.ignore){let s=e.next;this[ye].removeNode(e),e.next=s}this[oi]=!1,this[ni]&&!this[ye].length&&this[Ce]===0&&(this.zip?this.zip.end(Bu):(super.write(Bu),super.end()))}}get[Ds](){return this[ye]&&this[ye].head&&this[ye].head.value}[Yr](e){this[ye].shift(),this[Ce]-=1,this[Gt]()}[Nu](e){if(!e.pending){if(e.entry){e===this[Ds]&&!e.piped&&this[Nn](e);return}if(!e.stat){let s=this.statCache.get(e.absolute);s?this[On](e,s):this[Xr](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let s=this.readdirCache.get(e.absolute);if(s?this[Bn](e,s):this[Qr](e),!e.readdir)return}if(e.entry=this[Lu](e),!e.entry){e.ignore=!0;return}e===this[Ds]&&!e.piped&&this[Nn](e)}}}[qr](e){return{onwarn:(s,i,n)=>this.warn(s,i,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Lu](e){this[Ce]+=1;try{return new this[$n](e.path,this[qr](e)).on("end",()=>this[Yr](e)).on("error",i=>this.emit("error",i))}catch(s){this.emit("error",s)}}[Zr](){this[Ds]&&this[Ds].entry&&this[Ds].entry.resume()}[Nn](e){e.piped=!0,e.readdir&&e.readdir.forEach(n=>{let o=e.path,r=o==="./"?"":o.replace(/\/*$/,"/");this[Pn](r+n)});let s=e.entry,i=this.zip;if(!s)throw new Error("cannot pipe without source");i?s.on("data",n=>{i.write(n)||s.pause()}):s.on("data",n=>{super.write(n)||s.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,s,i={}){Bt(this,e,s,i)}},jt=class extends gt{sync=!0;constructor(e){super(e),this[$n]=kn}pause(){}resume(){}[Xr](e){let s=this.follow?"statSync":"lstatSync";this[On](e,Ln[s](e.absolute))}[Qr](e){this[Bn](e,Ln.readdirSync(e.absolute))}[Nn](e){let s=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(n=>{let o=e.path,r=o==="./"?"":o.replace(/\/*$/,"/");this[Pn](r+n)}),!s)throw new Error("Cannot pipe without source");i?s.on("data",n=>{i.write(n)}):s.on("data",n=>{super[Gu](n)})}};var hm=(t,e)=>{let s=new jt(t),i=new ls(t.file,{mode:t.mode||438});s.pipe(i),Uu(s,e)},dm=(t,e)=>{let s=new gt(t),i=new ze(t.file,{mode:t.mode||438});s.pipe(i);let n=new Promise((o,r)=>{i.on("error",r),i.on("close",o),s.on("error",r)});return zu(s,e),n},Uu=(t,e)=>{e.forEach(s=>{s.charAt(0)==="@"?Mt({file:ju.resolve(t.cwd,s.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>t.add(i)}):t.add(s)}),t.end()},zu=async(t,e)=>{for(let s=0;s<e.length;s++){let i=String(e[s]);i.charAt(0)==="@"?await Mt({file:ju.resolve(String(t.cwd),i.slice(1)),noResume:!0,onReadEntry:n=>{t.add(n)}}):t.add(i)}t.end()},mm=(t,e)=>{let s=new jt(t);return Uu(s,e),s},gm=(t,e)=>{let s=new gt(t);return zu(s,e),s},pm=Re(hm,dm,mm,gm,(t,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")});import lc from"node:fs";import Om from"node:assert";import{randomBytes as rc}from"node:crypto";import y from"node:fs";import Ze from"node:path";import Hu from"fs";var Dm=process.env.__FAKE_PLATFORM__||process.platform,Em=Dm==="win32",{O_CREAT:Fm,O_TRUNC:bm,O_WRONLY:ym}=Hu.constants,Wu=Number(process.env.__FAKE_FS_O_FILENAME__)||Hu.constants.UV_FS_O_FILEMAP||0,Cm=Em&&!!Wu,Sm=512*1024,wm=Wu|bm|Fm|ym,el=Cm?t=>t<Sm?wm:"w":()=>"w";import jn from"node:fs";import ri from"node:path";var tl=(t,e,s)=>{try{return jn.lchownSync(t,e,s)}catch(i){if(i?.code!=="ENOENT")throw i}},Gn=(t,e,s,i)=>{jn.lchown(t,e,s,n=>{i(n&&n?.code!=="ENOENT"?n:null)})},xm=(t,e,s,i,n)=>{if(e.isDirectory())sl(ri.resolve(t,e.name),s,i,o=>{if(o)return n(o);let r=ri.resolve(t,e.name);Gn(r,s,i,n)});else{let o=ri.resolve(t,e.name);Gn(o,s,i,n)}},sl=(t,e,s,i)=>{jn.readdir(t,{withFileTypes:!0},(n,o)=>{if(n){if(n.code==="ENOENT")return i();if(n.code!=="ENOTDIR"&&n.code!=="ENOTSUP")return i(n)}if(n||!o.length)return Gn(t,e,s,i);let r=o.length,a=null,u=c=>{if(!a){if(c)return i(a=c);if(--r===0)return Gn(t,e,s,i)}};for(let c of o)xm(t,c,e,s,u)})},_m=(t,e,s,i)=>{e.isDirectory()&&il(ri.resolve(t,e.name),s,i),tl(ri.resolve(t,e.name),s,i)},il=(t,e,s)=>{let i;try{i=jn.readdirSync(t,{withFileTypes:!0})}catch(n){let o=n;if(o?.code==="ENOENT")return;if(o?.code==="ENOTDIR"||o?.code==="ENOTSUP")return tl(t,e,s);throw o}for(let n of i)_m(t,n,e,s);return tl(t,e,s)};import ie from"node:fs";import Am from"node:fs/promises";import Un from"node:path";var li=class extends Error{path;code;syscall="chdir";constructor(e,s){super(`${s}: Cannot cd into '${e}'`),this.path=e,this.code=s}get name(){return"CwdError"}};var ai=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,s){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=s}get name(){return"SymlinkError"}};var vm=(t,e)=>{ie.stat(t,(s,i)=>{(s||!i.isDirectory())&&(s=new li(t,s?.code||"ENOTDIR")),e(s)})},Ku=(t,e,s)=>{t=b(t);let i=e.umask??18,n=e.mode|448,o=(n&i)!==0,r=e.uid,a=e.gid,u=typeof r=="number"&&typeof a=="number"&&(r!==e.processUid||a!==e.processGid),c=e.preserve,f=e.unlink,h=b(e.cwd),g=(F,E)=>{F?s(F):E&&u?sl(E,r,a,C=>g(C)):o?ie.chmod(t,n,s):s()};if(t===h)return vm(t,g);if(c)return Am.mkdir(t,{mode:n,recursive:!0}).then(F=>g(null,F??void 0),g);let D=b(Un.relative(h,t)).split("/");nl(h,D,n,f,h,void 0,g)},nl=(t,e,s,i,n,o,r)=>{if(!e.length)return r(null,o);let a=e.shift(),u=b(Un.resolve(t+"/"+a));ie.mkdir(u,s,Ju(u,e,s,i,n,o,r))},Ju=(t,e,s,i,n,o,r)=>a=>{a?ie.lstat(t,(u,c)=>{if(u)u.path=u.path&&b(u.path),r(u);else if(c.isDirectory())nl(t,e,s,i,n,o,r);else if(i)ie.unlink(t,f=>{if(f)return r(f);ie.mkdir(t,s,Ju(t,e,s,i,n,o,r))});else{if(c.isSymbolicLink())return r(new ai(t,t+"/"+e.join("/")));r(a)}}):(o=o||t,nl(t,e,s,i,n,o,r))},Rm=t=>{let e=!1,s;try{e=ie.statSync(t).isDirectory()}catch(i){s=i?.code}finally{if(!e)throw new li(t,s??"ENOTDIR")}},Vu=(t,e)=>{t=b(t);let s=e.umask??18,i=e.mode|448,n=(i&s)!==0,o=e.uid,r=e.gid,a=typeof o=="number"&&typeof r=="number"&&(o!==e.processUid||r!==e.processGid),u=e.preserve,c=e.unlink,f=b(e.cwd),h=F=>{F&&a&&il(F,o,r),n&&ie.chmodSync(t,i)};if(t===f)return Rm(f),h();if(u)return h(ie.mkdirSync(t,{mode:i,recursive:!0})??void 0);let m=b(Un.relative(f,t)).split("/"),D;for(let F=m.shift(),E=f;F&&(E+="/"+F);F=m.shift()){E=b(Un.resolve(E));try{ie.mkdirSync(E,i),D=D||E}catch{let re=ie.lstatSync(E);if(re.isDirectory())continue;if(c){ie.unlinkSync(E),ie.mkdirSync(E,i),D=D||E;continue}else if(re.isSymbolicLink())return new ai(E,E+"/"+m.join("/"))}}return h(D)};import{join as Zu}from"node:path";var ol=Object.create(null),Yu=1e4,Es=new Set,qu=t=>{Es.has(t)?Es.delete(t):ol[t]=t.normalize("NFD"),Es.add(t);let e=ol[t],s=Es.size-Yu;if(s>Yu/10){for(let i of Es)if(Es.delete(i),delete ol[i],--s<=0)break}return e};var km=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tm=km==="win32",Im=t=>t.split("/").slice(0,-1).reduce((s,i)=>{let n=s[s.length-1];return n!==void 0&&(i=Zu(n,i)),s.push(i||"/"),s},[]),zn=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,s){e=Tm?["win32 parallelization disabled"]:e.map(n=>dt(Zu(qu(n))).toLowerCase());let i=new Set(e.map(n=>Im(n)).reduce((n,o)=>n.concat(o)));this.#i.set(s,{dirs:i,paths:e});for(let n of e){let o=this.#e.get(n);o?o.push(s):this.#e.set(n,[s])}for(let n of i){let o=this.#e.get(n);if(!o)this.#e.set(n,[new Set([s])]);else{let r=o[o.length-1];r instanceof Set?r.add(s):o.push(new Set([s]))}}return this.#l(s)}#n(e){let s=this.#i.get(e);if(!s)throw new Error("function does not have any path reservations");return{paths:s.paths.map(i=>this.#e.get(i)),dirs:[...s.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:s,dirs:i}=this.#n(e);return s.every(n=>n&&n[0]===e)&&i.every(n=>n&&n[0]instanceof Set&&n[0].has(e))}#l(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let s=this.#i.get(e);if(!s)throw new Error("invalid reservation");let{paths:i,dirs:n}=s,o=new Set;for(let r of i){let a=this.#e.get(r);if(!a||a?.[0]!==e)continue;let u=a[1];if(!u){this.#e.delete(r);continue}if(a.shift(),typeof u=="function")o.add(u);else for(let c of u)o.add(c)}for(let r of n){let a=this.#e.get(r),u=a?.[0];if(!(!a||!(u instanceof Set)))if(u.size===1&&a.length===1){this.#e.delete(r);continue}else if(u.size===1){a.shift();let c=a[0];typeof c=="function"&&o.add(c)}else u.delete(e)}return this.#s.delete(e),o.forEach(r=>this.#l(r)),!0}};var Xu=Symbol("onEntry"),al=Symbol("checkFs"),Qu=Symbol("checkFs2"),ul=Symbol("isReusable"),fe=Symbol("makeFs"),cl=Symbol("file"),fl=Symbol("directory"),Kn=Symbol("link"),ec=Symbol("symlink"),tc=Symbol("hardlink"),sc=Symbol("unsupported"),ic=Symbol("checkPath"),pt=Symbol("mkdir"),V=Symbol("onError"),Hn=Symbol("pending"),nc=Symbol("pend"),Fs=Symbol("unpend"),rl=Symbol("ended"),ll=Symbol("maybeClose"),hl=Symbol("skip"),ui=Symbol("doChown"),ci=Symbol("uid"),fi=Symbol("gid"),hi=Symbol("checkedCwd"),Pm=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,di=Pm==="win32",Bm=1024,Nm=(t,e)=>{if(!di)return y.unlink(t,e);let s=t+".DELETE."+rc(16).toString("hex");y.rename(t,s,i=>{if(i)return e(i);y.unlink(s,e)})},$m=t=>{if(!di)return y.unlinkSync(t);let e=t+".DELETE."+rc(16).toString("hex");y.renameSync(t,e),y.unlinkSync(e)},oc=(t,e,s)=>t!==void 0&&t===t>>>0?t:e!==void 0&&e===e>>>0?e:s,bs=class extends qe{[rl]=!1;[hi]=!1;[Hn]=0;reservations=new zn;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[rl]=!0,this[ll]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:Bm,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||di,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=b(Ze.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:process.umask():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",s=>this[Xu](s))}warn(e,s,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,s,i)}[ll](){this[rl]&&this[Hn]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[ic](e){let s=b(e.path),i=s.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let n=b(String(e.linkpath)).split("/");if(n.length>=this.strip)e.linkpath=n.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:s,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(i.includes("..")||di&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:s}),!1;let[n,o]=ei(s);n&&(e.path=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:s}))}if(Ze.isAbsolute(e.path)?e.absolute=b(Ze.resolve(e.path)):e.absolute=b(Ze.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:b(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:n}=Ze.win32.parse(String(e.absolute));e.absolute=n+Gr(String(e.absolute).slice(n.length));let{root:o}=Ze.win32.parse(e.path);e.path=o+Gr(e.path.slice(o.length))}return!0}[Xu](e){if(!this[ic](e))return e.resume();switch(Om.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[al](e);default:return this[sc](e)}}[V](e,s){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:s}),this[Fs](),s.resume())}[pt](e,s,i){Ku(b(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:s},i)}[ui](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[ci](e){return oc(this.uid,e.uid,this.processUid)}[fi](e){return oc(this.gid,e.gid,this.processGid)}[cl](e,s){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,n=new ze(String(e.absolute),{flags:el(e.size),mode:i,autoClose:!1});n.on("error",u=>{n.fd&&y.close(n.fd,()=>{}),n.write=()=>!0,this[V](u,e),s()});let o=1,r=u=>{if(u){n.fd&&y.close(n.fd,()=>{}),this[V](u,e),s();return}--o===0&&n.fd!==void 0&&y.close(n.fd,c=>{c?this[V](c,e):this[Fs](),s()})};n.on("finish",()=>{let u=String(e.absolute),c=n.fd;if(typeof c=="number"&&e.mtime&&!this.noMtime){o++;let f=e.atime||new Date,h=e.mtime;y.futimes(c,f,h,g=>g?y.utimes(u,f,h,m=>r(m&&g)):r())}if(typeof c=="number"&&this[ui](e)){o++;let f=this[ci](e),h=this[fi](e);typeof f=="number"&&typeof h=="number"&&y.fchown(c,f,h,g=>g?y.chown(u,f,h,m=>r(m&&g)):r())}r()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",u=>{this[V](u,e),s()}),e.pipe(a)),a.pipe(n)}[fl](e,s){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[pt](String(e.absolute),i,n=>{if(n){this[V](n,e),s();return}let o=1,r=()=>{--o===0&&(s(),this[Fs](),e.resume())};e.mtime&&!this.noMtime&&(o++,y.utimes(String(e.absolute),e.atime||new Date,e.mtime,r)),this[ui](e)&&(o++,y.chown(String(e.absolute),Number(this[ci](e)),Number(this[fi](e)),r)),r()})}[sc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[ec](e,s){this[Kn](e,String(e.linkpath),"symlink",s)}[tc](e,s){let i=b(Ze.resolve(this.cwd,String(e.linkpath)));this[Kn](e,i,"link",s)}[nc](){this[Hn]++}[Fs](){this[Hn]--,this[ll]()}[hl](e){this[Fs](),e.resume()}[ul](e,s){return e.type==="File"&&!this.unlink&&s.isFile()&&s.nlink<=1&&!di}[al](e){this[nc]();let s=[e.path];e.linkpath&&s.push(e.linkpath),this.reservations.reserve(s,i=>this[Qu](e,i))}[Qu](e,s){let i=a=>{s(a)},n=()=>{this[pt](this.cwd,this.dmode,a=>{if(a){this[V](a,e),i();return}this[hi]=!0,o()})},o=()=>{if(e.absolute!==this.cwd){let a=b(Ze.dirname(String(e.absolute)));if(a!==this.cwd)return this[pt](a,this.dmode,u=>{if(u){this[V](u,e),i();return}r()})}r()},r=()=>{y.lstat(String(e.absolute),(a,u)=>{if(u&&(this.keep||this.newer&&u.mtime>(e.mtime??u.mtime))){this[hl](e),i();return}if(a||this[ul](e,u))return this[fe](null,e,i);if(u.isDirectory()){if(e.type==="Directory"){let c=this.chmod&&e.mode&&(u.mode&4095)!==e.mode,f=h=>this[fe](h??null,e,i);return c?y.chmod(String(e.absolute),Number(e.mode),f):f()}if(e.absolute!==this.cwd)return y.rmdir(String(e.absolute),c=>this[fe](c??null,e,i))}if(e.absolute===this.cwd)return this[fe](null,e,i);Nm(String(e.absolute),c=>this[fe](c??null,e,i))})};this[hi]?o():n()}[fe](e,s,i){if(e){this[V](e,s),i();return}switch(s.type){case"File":case"OldFile":case"ContiguousFile":return this[cl](s,i);case"Link":return this[tc](s,i);case"SymbolicLink":return this[ec](s,i);case"Directory":case"GNUDumpDir":return this[fl](s,i)}}[Kn](e,s,i,n){y[i](s,String(e.absolute),o=>{o?this[V](o,e):(this[Fs](),e.resume()),n()})}},Wn=t=>{try{return[null,t()]}catch(e){return[e,null]}},mi=class extends bs{sync=!0;[fe](e,s){return super[fe](e,s,()=>{})}[al](e){if(!this[hi]){let o=this[pt](this.cwd,this.dmode);if(o)return this[V](o,e);this[hi]=!0}if(e.absolute!==this.cwd){let o=b(Ze.dirname(String(e.absolute)));if(o!==this.cwd){let r=this[pt](o,this.dmode);if(r)return this[V](r,e)}}let[s,i]=Wn(()=>y.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[hl](e);if(s||this[ul](e,i))return this[fe](null,e);if(i.isDirectory()){if(e.type==="Directory"){let r=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[a]=r?Wn(()=>{y.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[fe](a,e)}let[o]=Wn(()=>y.rmdirSync(String(e.absolute)));this[fe](o,e)}let[n]=e.absolute===this.cwd?[]:Wn(()=>$m(String(e.absolute)));this[fe](n,e)}[cl](e,s){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,n=a=>{let u;try{y.closeSync(o)}catch(c){u=c}(a||u)&&this[V](a||u,e),s()},o;try{o=y.openSync(String(e.absolute),el(e.size),i)}catch(a){return n(a)}let r=this.transform&&this.transform(e)||e;r!==e&&(r.on("error",a=>this[V](a,e)),e.pipe(r)),r.on("data",a=>{try{y.writeSync(o,a,0,a.length)}catch(u){n(u)}}),r.on("end",()=>{let a=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,c=e.mtime;try{y.futimesSync(o,u,c)}catch(f){try{y.utimesSync(String(e.absolute),u,c)}catch{a=f}}}if(this[ui](e)){let u=this[ci](e),c=this[fi](e);try{y.fchownSync(o,Number(u),Number(c))}catch(f){try{y.chownSync(String(e.absolute),Number(u),Number(c))}catch{a=a||f}}}n(a)})}[fl](e,s){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,n=this[pt](String(e.absolute),i);if(n){this[V](n,e),s();return}if(e.mtime&&!this.noMtime)try{y.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[ui](e))try{y.chownSync(String(e.absolute),Number(this[ci](e)),Number(this[fi](e)))}catch{}s(),e.resume()}[pt](e,s){try{return Vu(b(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:s})}catch(i){return i}}[Kn](e,s,i,n){let o=`${i}Sync`;try{y[o](s,String(e.absolute)),n(),e.resume()}catch(r){return this[V](r,e)}}};var Lm=t=>{let e=new mi(t),s=t.file,i=lc.statSync(s),n=t.maxReadSize||16*1024*1024;new Yi(s,{readSize:n,size:i.size}).pipe(e)},Mm=(t,e)=>{let s=new bs(t),i=t.maxReadSize||16*1024*1024,n=t.file;return new Promise((r,a)=>{s.on("error",a),s.on("close",r),lc.stat(n,(u,c)=>{if(u)a(u);else{let f=new vt(n,{readSize:i,size:c.size});f.on("error",a),f.pipe(s)}})})},dl=Re(Lm,Mm,t=>new mi(t),t=>new bs(t),(t,e)=>{e?.length&&$r(t,e)});import ne from"node:fs";import ac from"node:path";var Gm=(t,e)=>{let s=new jt(t),i=!0,n,o;try{try{n=ne.openSync(t.file,"r+")}catch(u){if(u?.code==="ENOENT")n=ne.openSync(t.file,"w+");else throw u}let r=ne.fstatSync(n),a=Buffer.alloc(512);e:for(o=0;o<r.size;o+=512){for(let f=0,h=0;f<512;f+=h){if(h=ne.readSync(n,a,f,a.length-f,o+f),o===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!h)break e}let u=new te(a);if(!u.cksumValid)break;let c=512*Math.ceil((u.size||0)/512);if(o+c+512>r.size)break;o+=c,t.mtimeCache&&u.mtime&&t.mtimeCache.set(String(u.path),u.mtime)}i=!1,jm(t,s,o,n,e)}finally{if(i)try{ne.closeSync(n)}catch{}}},jm=(t,e,s,i,n)=>{let o=new ls(t.file,{fd:i,start:s});e.pipe(o),zm(e,n)},Um=(t,e)=>{e=Array.from(e);let s=new gt(t),i=(o,r,a)=>{let u=(m,D)=>{m?ne.close(o,F=>a(m)):a(null,D)},c=0;if(r===0)return u(null,0);let f=0,h=Buffer.alloc(512),g=(m,D)=>{if(m||typeof D>"u")return u(m);if(f+=D,f<512&&D)return ne.read(o,h,f,h.length-f,c+f,g);if(c===0&&h[0]===31&&h[1]===139)return u(new Error("cannot append to compressed archives"));if(f<512)return u(null,c);let F=new te(h);if(!F.cksumValid)return u(null,c);let E=512*Math.ceil((F.size??0)/512);if(c+E+512>r||(c+=E+512,c>=r))return u(null,c);t.mtimeCache&&F.mtime&&t.mtimeCache.set(String(F.path),F.mtime),f=0,ne.read(o,h,0,512,c,g)};ne.read(o,h,0,512,c,g)};return new Promise((o,r)=>{s.on("error",r);let a="r+",u=(c,f)=>{if(c&&c.code==="ENOENT"&&a==="r+")return a="w+",ne.open(t.file,a,u);if(c||!f)return r(c);ne.fstat(f,(h,g)=>{if(h)return ne.close(f,()=>r(h));i(f,g.size,(m,D)=>{if(m)return r(m);let F=new ze(t.file,{fd:f,start:D});s.pipe(F),F.on("error",r),F.on("close",o),Hm(s,e)})})};ne.open(t.file,a,u)})},zm=(t,e)=>{e.forEach(s=>{s.charAt(0)==="@"?Mt({file:ac.resolve(t.cwd,s.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>t.add(i)}):t.add(s)}),t.end()},Hm=async(t,e)=>{for(let s=0;s<e.length;s++){let i=String(e[s]);i.charAt(0)==="@"?await Mt({file:ac.resolve(String(t.cwd),i.slice(1)),noResume:!0,onReadEntry:n=>t.add(n)}):t.add(i)}t.end()},Ut=Re(Gm,Um,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(t,e)=>{if(!su(t))throw new TypeError("file is required");if(t.gzip||t.brotli||t.zstd||t.file.endsWith(".br")||t.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")});var Wm=Re(Ut.syncFile,Ut.asyncFile,Ut.syncNoFile,Ut.asyncNoFile,(t,e=[])=>{Ut.validate?.(t,e),Km(t)}),Km=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(s,i)=>e(s,i)&&!((t.mtimeCache?.get(s)??i.mtime??0)>(i.mtime??0)):(s,i)=>!((t.mtimeCache?.get(s)??i.mtime??0)>(i.mtime??0))};async function ys(t){let{source:e,destination:s,strip:i=1,filter:n}=t,o=[];if(!uc(e))return{success:!1,extractedFiles:[],error:`Source file not found: ${e}`};uc(s)||Ym(s,{recursive:!0});try{return await qm(Vm(e),Zm(),dl({cwd:s,strip:i,filter:r=>n&&!n(r)?!1:(o.push(r),!0)})),{success:!0,extractedFiles:o}}catch(r){return{success:!1,extractedFiles:o,error:r instanceof Error?r.message:String(r)}}}import{existsSync as cc,readFileSync as Xm,writeFileSync as Qm,mkdirSync as eg}from"fs";import{dirname as tg}from"path";function zt(t){let e=Vo(t);if(!cc(e))return null;try{let s=Xm(e,"utf-8");return JSON.parse(s)}catch{return null}}function Jn(t,e){let s=Vo(e),i=tg(s);cc(i)||eg(i,{recursive:!0}),Qm(s,JSON.stringify(t,null,2))}function fc(t,e,s){return{name:"gemkit",version:t,installedAt:new Date().toISOString(),scope:e,installedFiles:s,customizedFiles:[]}}function hc(t){return zt(t)!==null}var p=Si(gc(),1),og=t=>{let e=parseInt(t.slice(1,3),16),s=parseInt(t.slice(3,5),16),i=parseInt(t.slice(5,7),16);return`\x1B[38;2;${e};${s};${i}m`},gi=t=>e=>p.default.isColorSupported?`${og(t)}${e}\x1B[39m`:e,l={primary:gi("#4f46e5"),secondary:gi("#9333ea"),accent:gi("#06b6d4"),geminiBlue:gi("#1a73e8"),geminiPurple:gi("#8e24aa"),success:t=>p.default.green(t),error:t=>p.default.red(t),warn:t=>p.default.yellow(t),info:t=>p.default.cyan(t),dim:t=>p.default.dim(t)},T={line:(t=60)=>"\u2500".repeat(t),doubleLine:(t=60)=>"\u2550".repeat(t),statusIcon:t=>{switch(t){case"active":return l.success("\u25CF");case"completed":return l.dim("\u25CB");case"failed":return l.error("\u2717");default:return"?"}},checkIcon:(t,e=!1)=>t?l.success("\u2713"):e?l.warn("\u25CB"):l.error("\u2717"),header:t=>p.default.bold(l.geminiPurple(t)),section:(t,e=60)=>{console.log(),console.log("\u2500".repeat(e)),console.log(p.default.bold(l.geminiPurple(t))),console.log("\u2500".repeat(e)),console.log()}};var ty={success:l.success,error:l.error,warning:l.warn,info:l.info,dim:l.dim,primary:l.primary,secondary:l.secondary,bold:p.default.bold};var pc={debug:0,info:1,warn:2,error:3,silent:4},he={level:"info",verbose:!1,json:!1};function qn(t){he={...he,...t}}function pi(t){return pc[t]>=pc[he.level]}function rg(t,e){pi("debug")&&(he.json?console.log(JSON.stringify({level:"debug",message:t,data:e})):(console.log(l.dim(`[DEBUG] ${t}`)),e&&he.verbose&&console.log(l.dim(JSON.stringify(e,null,2)))))}function lg(t,e){pi("info")&&(he.json?console.log(JSON.stringify({level:"info",message:t,data:e})):(console.log(`${l.info("\u2139")} ${t}`),e&&he.verbose&&console.log(JSON.stringify(e,null,2))))}function ag(t,e){pi("info")&&(he.json?console.log(JSON.stringify({level:"success",message:t,data:e})):console.log(`${l.success("\u2713")} ${t}`))}function ug(t,e){pi("warn")&&(he.json?console.log(JSON.stringify({level:"warn",message:t,data:e})):console.log(`${l.warn("\u26A0")} ${t}`))}function cg(t,e){pi("error")&&(he.json?console.error(JSON.stringify({level:"error",message:t,data:e})):(console.error(`${l.error("\u2717")} ${t}`),e&&he.verbose&&console.error(JSON.stringify(e,null,2))))}function fg(t){he.json?console.log(JSON.stringify(t)):console.table(t)}function hg(t){console.log(JSON.stringify(t,null,2))}var d={debug:rg,info:lg,success:ag,warn:ug,error:cg,table:fg,json:hg,configure:qn};function pg(t){switch(t){case"gemini":return[".claude",".claude/**",".agent",".agent/**"];case"claude":return[".agent",".agent/**"];case"antigravity":return[".claude",".claude/**"];default:return[]}}function Dg(t){switch(t){case"gemini":return"Gemini CLI (excludes .claude, .agent)";case"claude":return"Claude Code (excludes .agent)";case"antigravity":return"Antigravity (excludes .claude)";default:return"Full (all files)"}}function Eg(t,e){let s=t.replace(/\\/g,"/");for(let i of e)if(i.includes("*")){if(i.endsWith("/**")){let n=i.slice(0,-3);if(s.startsWith(n+"/"))return!0}}else if(s===i||s.startsWith(i+"/"))return!0;return!1}function Fg(t){if(t.length!==0)return e=>!Eg(e,t)}async function bg(){let t=mg(".gemini","extensions","spawn-agent");return dg(t)?new Promise(e=>{let s=gg("gemini",["extensions","install",t],{stdio:["pipe","pipe","pipe"],shell:process.platform==="win32",cwd:process.cwd()}),i="",n="",o=!1,r=setTimeout(()=>{o||(o=!0,s.kill(),e({success:!1,error:"Extension installation timed out"}))},3e4);s.stdout?.on("data",a=>{i+=a.toString()}),s.stderr?.on("data",a=>{n+=a.toString()}),s.on("close",a=>{o||(o=!0,clearTimeout(r),e(a===0?{success:!0}:{success:!1,error:n||i||`Exit code: ${a}`}))}),s.on("error",a=>{o||(o=!0,clearTimeout(r),e({success:!1,error:`Failed to run gemini CLI: ${a.message}`}))})}):{success:!1,error:`Extension directory not found: ${t}`}}function Dc(t){t.command("init","Initialize GemKit in project").option("--version <ver>","Specific version to install").option("-f, --force","Overwrite existing installation").option("--exclude <patterns...>","File patterns to exclude").option("--skip-extension","Skip spawn-agent extension installation").option("--full","Install all files (default)").option("--gemini","Gemini CLI mode (excludes .claude, .agent folders)").option("--claude","Claude Code mode (excludes .agent folder)").option("--antigravity","Antigravity mode (excludes .claude folder)").action(async e=>{let s="full";if(e.gemini?s="gemini":e.claude?s="claude":e.antigravity?s="antigravity":e.full&&(s="full"),hc()&&!e.force){console.log(),d.warn("GemKit is already installed. Use --force to reinstall."),console.log();return}console.log(),console.log(p.default.bold(l.geminiPurple("Initializing GemKit"))),console.log(` ${l.dim("Mode:")} ${l.accent(Dg(s))}`),console.log();let i=$e({text:"Fetching latest release...",color:"magenta"}).start(),n=e.version?await Ka(e.version):await Qt();n||(i.fail("No release found"),console.log(),process.exit(1)),i.succeed(`Found version ${l.primary(n.version)}`);let o=$e({text:"Downloading release...",color:"magenta"}).start(),r;try{r=await es(n),o.succeed("Download complete")}catch(m){o.fail(`Download failed: ${m instanceof Error?m.message:String(m)}`),console.log(),process.exit(1)}let a=pg(s),u=$e({text:s==="full"?"Extracting files...":`Extracting files (${s} mode)...`,color:"magenta"}).start(),c=process.cwd(),f=await ys({source:r,destination:c,strip:1,filter:Fg(a)});f.success||(u.fail(`Extraction failed: ${f.error}`),console.log(),process.exit(1)),u.succeed(`Extracted ${f.extractedFiles.length} files`);let h=fc(n.version,"local",f.extractedFiles);if(Jn(h),console.log(),d.success(`GemKit ${l.primary(n.version)} installed successfully!`),!e.skipExtension&&(s==="full"||s==="gemini")){console.log();let m=$e({text:"Installing spawn-agent extension...",color:"magenta"}).start(),D=await bg();D.success?m.succeed("spawn-agent extension installed in Gemini CLI"):(m.warn(`Could not install spawn-agent extension: ${D.error}`),d.info(`You can manually install it with: ${l.primary("gemini extensions install .gemini/extensions/spawn-agent")}`))}else(s==="claude"||s==="antigravity")&&(console.log(),d.info(`Skipped Gemini extension (${s} mode).`));console.log(),d.info(`Run ${l.primary("gk doctor")} to verify installation.`),console.log()})}function Ec(t){t.command("update","Update GemKit to latest version").option("-f, --force","Force update and overwrite modified files").option("--no-backup","Disable backup before update").action(async e=>{let s=zt();s||(d.error('GemKit not initialized. Run "gk init" first.'),process.exit(1)),d.info("Checking for updates...");let i=await Qt();if(i||(d.error("Failed to check for updates."),process.exit(1)),i.version===s.version&&!e.force){d.success(`GemKit is already up to date (v${s.version})`);return}d.info(`Updating from v${s.version} to v${i.version}...`);let n=await es(i),o=Ni(),r=await ys({source:n,destination:o,strip:1});r.success||(d.error(`Update failed: ${r.error}`),process.exit(1));let a={...s,version:i.version,installedAt:new Date().toISOString(),installedFiles:r.extractedFiles};Jn(a),d.success(`GemKit updated to v${i.version} successfully!`)})}function Fc(t){t.command("versions","List available GemKit versions").alias("v").option("--json","Output as JSON").action(async e=>{let s=zt(),i=await Mi();if(e.json){console.log(JSON.stringify({current:s?.version||null,available:i},null,2));return}console.log(),console.log(p.default.bold(l.geminiPurple("GemKit Versions"))),console.log(),console.log(s?` ${l.dim("Current:")} ${l.success(s.version)}`:` ${l.dim("Current:")} ${l.dim("Not installed")}`),console.log(),console.log(` ${p.default.bold("Available Releases:")}`);for(let n of i){let o=n.version===s?.version?l.success(" (current)"):"";console.log(` - ${l.primary(n.version)}${o}`)}console.log()})}import{existsSync as Zn}from"fs";import{join as yg}from"path";import{spawn as bc}from"child_process";async function Cg(){return new Promise(t=>{let e=bc("gemini",["extensions","list"],{stdio:["pipe","pipe","pipe"],shell:process.platform==="win32"}),s="",i="",n=!1,o=setTimeout(()=>{n||(n=!0,e.kill(),t({installed:!1,error:"Check timed out"}))},2e4);e.stdout?.on("data",r=>{s+=r.toString()}),e.stderr?.on("data",r=>{i+=r.toString()}),e.on("close",r=>{if(!n)if(n=!0,clearTimeout(o),r===0){let a=s.toLowerCase().includes("spawn-agent");t({installed:a})}else t({installed:!1,error:i||"Failed to check extensions"})}),e.on("error",r=>{n||(n=!0,clearTimeout(o),t({installed:!1,error:`Gemini CLI not available: ${r.message}`}))})})}async function Sg(){return new Promise(t=>{let e=bc("gemini",["--version"],{stdio:["pipe","pipe","pipe"],shell:process.platform==="win32"}),s="",i=!1,n=setTimeout(()=>{i||(i=!0,e.kill(),t({available:!1,error:"Timed out"}))},15e3);e.stdout?.on("data",o=>{s+=o.toString()}),e.on("close",o=>{if(!i)if(i=!0,clearTimeout(n),o===0){let r=s.trim().split(`
20
+ `)[0]||"unknown";t({available:!0,version:r})}else t({available:!1,error:"Command failed"})}),e.on("error",o=>{i||(i=!0,clearTimeout(n),t({available:!1,error:o.message}))})})}function yc(t){t.command("doctor","Check installation health").option("--fix","Attempt to fix issues").action(async e=>{console.log(),console.log(p.default.bold(l.geminiPurple("GemKit Health Check"))),console.log();let s=0,i=0,n=[],o=process.version;parseInt(o.slice(1).split(".")[0],10)>=18?n.push({icon:l.success("\u2713"),message:`Node.js ${o}`}):(n.push({icon:l.error("\u2717"),message:`Node.js ${o} ${l.error("(requires >= 18)")}`}),s++);let a=$e({text:"Checking Gemini CLI...",color:"magenta"}).start(),u=await Sg();a.stop(),u.available?n.push({icon:l.success("\u2713"),message:`Gemini CLI ${l.dim(`(${u.version})`)}`}):(n.push({icon:l.error("\u2717"),message:`Gemini CLI not found ${l.dim(`(${u.error})`)}`}),s++);let c=Ni();Zn(c)?n.push({icon:l.success("\u2713"),message:".gemini directory exists"}):(n.push({icon:l.error("\u2717"),message:".gemini directory missing"}),s++);let f=Rs();Zn(f)?n.push({icon:l.success("\u2713"),message:"Agents directory exists"}):(n.push({icon:l.warn("\u25CB"),message:"Agents directory missing"}),i++);let h=St();Zn(h)?n.push({icon:l.success("\u2713"),message:"Extensions directory exists"}):(n.push({icon:l.warn("\u25CB"),message:"Extensions directory missing"}),i++);let g=yg(h,"spawn-agent");if(Zn(g)?n.push({icon:l.success("\u2713"),message:"spawn-agent extension files present"}):(n.push({icon:l.warn("\u25CB"),message:"spawn-agent extension files missing"}),i++),u.available){let D=$e({text:"Checking spawn-agent extension...",color:"magenta"}).start(),F=await Cg();D.stop(),F.installed?n.push({icon:l.success("\u2713"),message:"spawn-agent extension installed in Gemini"}):(n.push({icon:l.error("\u2717"),message:"spawn-agent extension NOT installed in Gemini",hint:F.error?`${F.error}
21
+ Run: gemini extensions install .gemini/extensions/spawn-agent`:"Run: gemini extensions install .gemini/extensions/spawn-agent"}),s++)}let m=zt();m?n.push({icon:l.success("\u2713"),message:`Installation metadata ${l.primary(`(v${m.version})`)}`}):(n.push({icon:l.warn("\u25CB"),message:"Installation metadata missing"}),i++);for(let D of n)if(console.log(` ${D.icon} ${D.message}`),D.hint)for(let F of D.hint.split(`
22
+ `))console.log(` ${l.dim(F)}`);console.log(),s===0&&i===0?console.log(l.success("All checks passed!")):s===0?console.log(l.success(`All critical checks passed! ${l.dim(`(${i} warning${i>1?"s":""})`)}`)):(console.log(l.error(`${s} issue(s) found.`)),i>0&&console.log(l.warn(`${i} warning(s).`)),console.log(),console.log("To fix issues:"),console.log(` ${l.dim("1.")} Run ${l.primary("gk init")} to install GemKit`),console.log(` ${l.dim("2.")} Run ${l.primary("gemini extensions install .gemini/extensions/spawn-agent")} to install extension`)),console.log()})}function wg(){console.log(),console.log(p.default.bold(l.geminiPurple("Configuration Management"))),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk config")} <subcommand> [options]`),console.log(),console.log("Subcommands:"),console.log(` ${l.primary("list")} Show all config (default)`),console.log(` ${l.primary("get")} <key> Get config value`),console.log(` ${l.primary("set")} <key> <val> Set config value`),console.log(` ${l.primary("reset")} Reset to defaults`),console.log(),console.log("Options:"),console.log(` ${l.dim("--json")} [list] Output as JSON`),console.log(),console.log("Examples:"),console.log(` ${l.dim("gk config list")}`),console.log(` ${l.dim("gk config get spawn.defaultModel")}`),console.log(` ${l.dim("gk config set spawn.music true")}`),console.log(` ${l.dim("gk config reset")}`),console.log()}function Cc(t){t.command("config [subcommand] [key] [value]","Configuration management (list, get, set, reset)").alias("c").option("--json","[list] Output as JSON").action(async(e,s,i,n)=>{switch(e||"list"){case"list":await xg(n);break;case"get":s||(console.log(),d.error("Config key required"),console.log(l.dim("Usage: gk config get <key>")),console.log(),process.exit(1)),await _g(s);break;case"set":(!s||i===void 0)&&(console.log(),d.error("Config key and value required"),console.log(l.dim("Usage: gk config set <key> <value>")),console.log(),process.exit(1)),await Ag(s,i);break;case"reset":await vg();break;default:wg()}})}async function xg(t){let e=et();if(t.json){console.log(JSON.stringify(e,null,2));return}console.log(),console.log(p.default.bold(l.geminiPurple("GemKit Configuration"))),console.log(),console.log(JSON.stringify(e,null,2)),console.log()}async function _g(t){let e=Pa(t);if(e===void 0){console.log(),d.error(`Config key not found: ${t}`),console.log();return}console.log(e)}async function Ag(t,e){let s=e;e==="true"?s=!0:e==="false"?s=!1:isNaN(Number(e))||(s=Number(e));try{Ba(t,s),console.log(),d.success(`Config updated: ${l.primary(t)} = ${l.success(String(s))}`),console.log()}catch(i){console.log(),d.error(`Failed to set config: ${i instanceof Error?i.message:String(i)}`),console.log()}}async function vg(){Na(),console.log(),d.success("Configuration reset to defaults."),console.log()}function Sc(t){let e=t.command("cache <subcommand>","Cache management");e.example("gk cache stats # Show cache statistics"),e.example("gk cache clear # Clear all cache"),e.action(async s=>{let i=s||"stats";switch(i){case"stats":await Rg();break;case"clear":await kg();break;default:console.log(),d.error(`Unknown subcommand: ${i}`),console.log(),process.exit(1)}})}async function Rg(){let t=Ha();console.log(),console.log(p.default.bold(l.geminiPurple("Cache Statistics"))),console.log(),console.log(` ${l.dim("Entries:")} ${l.primary(String(t.entries))}`),console.log(` ${l.dim("Size:")} ${l.primary((t.size/1024).toFixed(2))} KB`),console.log()}async function kg(){let t=za();console.log(),d.success(`Cleared ${l.success(String(t))} cache entries.`),console.log()}import{existsSync as Tg}from"fs";import{join as Ig}from"path";function wc(t){t.command("new <name>","Create a new project from starter kit").action(async e=>{let s=Ig(process.cwd(),e);Tg(s)&&(console.log(),d.error(`Directory already exists: ${e}`),console.log(),process.exit(1)),console.log(),console.log(p.default.bold(l.geminiPurple("Creating New Project"))),console.log(),d.info(`Name: ${l.primary(e)}`);let i=await Qt();i||(d.error("Failed to fetch latest starter kit."),console.log(),process.exit(1)),d.info(`Fetching latest starter kit (v${i.version})...`);let n=await es(i),o=await ys({source:n,destination:s,strip:1});o.success?(console.log(),d.success(`Project ${l.primary(e)} created successfully!`),console.log(`
23
+ Next steps:
24
+ cd ${l.primary(e)}
25
+ gk init
26
+ `)):(d.error(`Failed to create project: ${o.error}`),console.log())})}import{spawn as Vg}from"child_process";import{existsSync as gl,readFileSync as Og,readdirSync as Pg}from"fs";import{join as _c,basename as Bg}from"path";function pl(t,e){let s=Rs(e),i=_c(s,`${t}.md`);return gl(i)?Ac(i):null}function Xn(t){let e=Rs(t);if(!gl(e))return[];let s=Pg(e).filter(n=>n.endsWith(".md")),i=[];for(let n of s){let o=_c(e,n),r=Ac(o);r&&i.push(r)}return i}function Ng(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return null;let s={};for(let i of e[1].split(/\r?\n/)){let n=i.indexOf(":");if(n===-1)continue;let o=i.slice(0,n).trim(),r=i.slice(n+1).trim();(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),s[o]=r}return s}function xc(t){if(!t)return[];let e=t.trim();return e.startsWith("[")&&e.endsWith("]")&&(e=e.slice(1,-1)),e.split(",").map(s=>s.trim().replace(/['"]/g,"")).filter(Boolean)}function Ac(t){if(!gl(t))return null;let e=Og(t,"utf-8"),s=Bg(t,".md"),i="",n="gemini-2.5-flash",o=[],r=Ng(e),a=e;if(r)r.description&&(i=r.description),r.model&&(n=r.model),o=xc(r.skills),a=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,"").trim();else{let u=e.split(`
27
+ `);for(let h of u){if(h.startsWith("# ")){i=h.substring(2).trim();break}if(h.trim()&&!h.startsWith("#")){i=h.trim();break}}let c=e.match(/model:\s*(.+)/i);c&&(n=c[1].trim());let f=e.match(/skills:\s*(.+)/i);f&&(o=xc(f[1]))}return{name:s,description:i,model:n,skills:o,content:a,filePath:t}}import{existsSync as Ht,readFileSync as Fl,readdirSync as $g}from"fs";import{join as Di}from"path";var bl=".gemini/extensions/spawn-agent/data",vc=3,Rc={combination:{file:"combinations.csv",searchCols:["keywords","description","use_when","agent","skills","intent","domain"],outputCols:["id","agent","skills","intent","domain","complexity","description","use_when"]},intent:{file:"intents.csv",searchCols:["primary_keywords","expanded_keywords","question_patterns"],outputCols:["intent","agent","primary_keywords","expanded_keywords","action_verbs"]},domain:{file:"domains.csv",searchCols:["keywords","frameworks","file_patterns","technical_terms"],outputCols:["domain","base_skills","enhanced_skills","keywords","frameworks"]},synonym:{file:"synonyms.csv",searchCols:["word","synonyms"],outputCols:["word","synonyms","category"]}},Lg={simple:["quick","simple","basic","small","minor","trivial","easy","straightforward"],standard:[],full:["comprehensive","full","complete","entire","thorough","detailed"],complex:["deep","extensive","advanced","complex","sophisticated","enterprise","production"]};var Dl={research:"researcher",plan:"planner",execute:"code-executor",debug:"debugger",review:"code-reviewer",test:"tester",design:"ui-ux-designer",docs:"docs-manager",git:"git-manager",manage:"project-manager"},Mg={frontend:["frontend-design"],backend:["backend-development"],auth:["better-auth","backend-development"],payment:["payment-integration"],database:["databases"],mobile:["mobile-development"],fullstack:["web-frameworks","backend-development"],ecommerce:["shopify"],media:["ai-multimodal"],ai:["ai-multimodal"],quality:["code-review"],codebase:["repomix"],general:["research"]},Qn=class{k1;b;corpus=[];docLengths=[];avgdl=0;idf=new Map;docFreqs=new Map;N=0;constructor(e=1.5,s=.75){this.k1=e,this.b=s}tokenize(e){return String(e).toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(i=>i.length>1)}fit(e){if(this.corpus=e.map(s=>this.tokenize(s)),this.N=this.corpus.length,this.N!==0){this.docLengths=this.corpus.map(s=>s.length),this.avgdl=this.docLengths.reduce((s,i)=>s+i,0)/this.N;for(let s of this.corpus){let i=new Set;for(let n of s)i.has(n)||(this.docFreqs.set(n,(this.docFreqs.get(n)||0)+1),i.add(n))}for(let[s,i]of this.docFreqs.entries())this.idf.set(s,Math.log((this.N-i+.5)/(i+.5)+1))}}score(e){let s=this.tokenize(e),i=[];for(let n=0;n<this.corpus.length;n++){let o=this.corpus[n],r=0,a=this.docLengths[n],u=new Map;for(let c of o)u.set(c,(u.get(c)||0)+1);for(let c of s){let f=this.idf.get(c);if(f!==void 0){let h=u.get(c)||0,g=h*(this.k1+1),m=h+this.k1*(1-this.b+this.b*a/this.avgdl);r+=f*g/m}}i.push([n,r])}return i.sort((n,o)=>o[1]-n[1])}};function Gg(t){let e=[],s="",i=!1;for(let n=0;n<t.length;n++){let o=t[n];o==='"'?i=!i:o===","&&!i?(e.push(s),s=""):s+=o}return e.push(s),e}function yl(t){if(!Ht(t))return[];let s=Fl(t,"utf-8").trim().split(`
28
+ `);if(s.length<2)return[];let i=s[0].split(",").map(o=>o.trim()),n=[];for(let o=1;o<s.length;o++){let r=Gg(s[o]),a={};i.forEach((u,c)=>{a[u]=r[c]?.trim()||""}),n.push(a)}return n}function jg(t,e,s,i,n){if(!Ht(t))return[];let o=yl(t),r=o.map(f=>e.map(h=>String(f[h]||"")).join(" ")),a=new Qn;a.fit(r);let u=a.score(i),c=[];for(let[f,h]of u.slice(0,n))if(h>0){let g=o[f],m={};for(let D of s)D in g&&(m[D]=g[D]);m._score=Math.round(h*1e4)/1e4,c.push(m)}return c}function Cl(){let t=Di(bl,"synonyms.csv");if(!Ht(t))return new Map;let e=yl(t),s=new Map;for(let i of e){let n=(i.word||"").toLowerCase().trim(),o=(i.synonyms||"").toLowerCase().trim();n&&o&&s.set(n,o.split(",").map(r=>r.trim()))}return s}function kc(t,e){e||(e=Cl());let s=t.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/),i=new Set(s);for(let n of s){let o=e.get(n);o&&o.forEach(r=>i.add(r))}return Array.from(i).join(" ")}function Sl(t){let e=t.toLowerCase();for(let[s,i]of Object.entries(Lg))for(let n of i)if(e.includes(n))return s;return"standard"}function wl(t){let e=t.toLowerCase(),i=e.split(/\s+/)[0]||"",n=[[/system architecture/,"plan"],[/design.*architecture/,"plan"],[/architect.*system/,"plan"],[/create.*roadmap/,"plan"],[/build.*roadmap/,"plan"],[/create.*strategy/,"plan"],[/stunning/,"design"],[/gorgeous/,"design"],[/beautiful.*ui/,"design"],[/beautiful.*component/,"design"],[/beautiful.*page/,"design"],[/write.*documentation/,"docs"],[/write.*docs/,"docs"],[/create.*documentation/,"docs"],[/research.*codebase/,"research"],[/deep research/,"research"]];for(let[c,f]of n)if(typeof c=="string"?e.includes(c):c.test(e))return f;let o={implement:"execute",build:"execute",create:"execute",add:"execute",make:"execute",code:"execute",develop:"execute",write:"execute",setup:"execute",configure:"execute",test:"test",verify:"test",validate:"test",debug:"debug",fix:"debug",troubleshoot:"debug",review:"review",audit:"review",document:"docs",plan:"plan",design:"design",research:"research",analyze:"research",investigate:"research"};if(i in o)return o[i];let r=[["best practices","research"],["how does","research"],["how do","research"],["what is","research"],["why is","research"],["compare","research"],["investigate","research"],["research","research"],["understand","research"],["system architecture","plan"],["implementation plan","plan"],["roadmap","plan"],["strategy for","plan"],["blueprint","plan"],["fix the","debug"],["debug the","debug"],["not working","debug"],["is broken","debug"],["error in","debug"],["fix bug","debug"],["test the","test"],["run tests","test"],["verify the","test"],["review the","review"],["audit the","review"],["check code","review"],["document the","docs"],["write docs","docs"],["api documentation","docs"]];for(let[c,f]of r)if(e.includes(c))return f;let a={debug:["fix","debug","troubleshoot","error","issue","bug","broken","failing","crash"],review:["review","audit","assess","check code","pr review","security audit"],test:["test","verify","validate","qa","coverage","unit test","e2e test"],design:["beautiful","stunning","gorgeous","ui design","ux design","mockup","layout"],docs:["document","documentation","readme","api docs","technical writing"],git:["commit","push","pull","merge","branch","git","stage"],manage:["status","progress","track","milestone","sprint"],plan:["plan","architect","roadmap","strategy","architecture design"],execute:["implement","build","create","add","make","code","develop"],research:["research","investigate","explore","study","analyze","examine","learn"]},u={};for(let[c,f]of Object.entries(a)){let h=f.filter(g=>e.includes(g)).length;h>0&&(u[c]=h)}return Object.keys(u).length>0?Object.entries(u).sort((c,f)=>f[1]-c[1])[0][0]:"execute"}function xl(t){let e=t.toLowerCase(),s=[["flutter","mobile"],["react native","mobile"],["swift","mobile"],["kotlin","mobile"],["ios app","mobile"],["android app","mobile"],["next.js","fullstack"],["nextjs","fullstack"],["nuxt","fullstack"],["sveltekit","fullstack"],["remix","fullstack"],["server component","fullstack"],["openai","ai"],["anthropic","ai"],["claude","ai"],["langchain","ai"],["llm","ai"],["chatbot","ai"],["rag","ai"],["embedding","ai"],["gpt","ai"],["angular","frontend"],["react","frontend"],["vue","frontend"],["svelte","frontend"],["tailwind","frontend"],["nestjs","backend"],["express","backend"],["fastify","backend"],["hono","backend"],["fastapi","backend"],["websocket","backend"],["shopify","ecommerce"],["product catalog","ecommerce"],["checkout flow","ecommerce"],["stripe","payment"],["paypal","payment"],["subscription","payment"],["billing","payment"],["oauth","auth"],["authentication","auth"],["login","auth"],["signup","auth"],["prisma","database"],["drizzle","database"],["postgresql","database"],["mongodb","database"],["mysql","database"],["pdf","media"],["image","media"],["video","media"],["audio","media"],["codebase","codebase"],["repository","codebase"]];for(let[o,r]of s)if(e.includes(o))return r;let i={auth:["login","signup","authentication","oauth","jwt","session","password","2fa"],payment:["payment","checkout","billing","stripe","subscription","invoice","cart"],database:["database","sql","query","migration","schema","prisma","postgresql"],frontend:["ui","component","react","vue","css","tailwind","button","form","modal"],backend:["api","endpoint","server","service","route","rest","graphql","middleware"],mobile:["mobile","ios","android","react native","flutter","app","native"],fullstack:["fullstack","nextjs","next.js","nuxt","sveltekit","app router"],ecommerce:["ecommerce","shopify","store","product","cart","checkout","order"],media:["image","video","audio","media","upload","file","ocr"],ai:["ai","llm","gpt","claude","machine learning","embedding","vector","openai"],quality:["code review","lint","test","coverage","quality","refactor"],codebase:["codebase","repository","repo","project structure"],general:[]},n={};for(let[o,r]of Object.entries(i)){let a=r.filter(u=>e.includes(u)).length;a>0&&(n[o]=a)}return Object.keys(n).length>0?Object.entries(n).sort((o,r)=>r[1]-o[1])[0][0]:"general"}function Tc(t,e=vc,s=!0){let i=Rc.combination,n=Di(bl,i.file),o=t;if(s){let a=Cl();o=kc(t,a)}let r=jg(n,i.searchCols,i.outputCols,o,e);return{query:t,expandedQuery:s?o:void 0,detectedIntent:wl(t),detectedDomain:xl(t),detectedComplexity:Sl(t),count:r.length,results:r}}function El(t,e,s,i=vc,n=!0){let o=Rc.combination,r=Di(bl,o.file);if(!Ht(r))return{results:[],count:0};let a=yl(r);if(e&&(a=a.filter(m=>(m.intent||"").toLowerCase()===e.toLowerCase())),s&&(a=a.filter(m=>(m.domain||"").toLowerCase()===s.toLowerCase())),a.length===0)return{results:[],count:0};let u=t;if(n){let m=Cl();u=kc(t,m)}let c=a.map(m=>o.searchCols.map(D=>String(m[D]||"")).join(" ")),f=new Qn;f.fit(c);let h=f.score(u),g=[];for(let[m,D]of h.slice(0,i))if(D>0){let F=a[m],E={};for(let C of o.outputCols)C in F&&(E[C]=F[C]);E._score=Math.round(D*1e4)/1e4,g.push(E)}return{results:g,count:g.length}}function Ug(t){let e=wl(t),s=xl(t),i=Sl(t);if(["debug","review","test","design","docs","research","plan"].includes(e)){let f=El(t,e,void 0,1,!0);if(f.results.length>0){let h=f.results[0],m=(h.skills||"").split("|").map(D=>D.trim()).filter(Boolean);return{agent:Dl[e]||h.agent||"code-executor",skills:m,intent:e,domain:h.domain||s,complexity:h.complexity||i,score:h._score||0,fallback:!1,description:h.description||"",useWhen:h.use_when||""}}}if(e==="execute"&&["mobile","ai","payment","ecommerce","media","auth","database","fullstack"].includes(s)){let f=El(t,"execute",s,1,!0);if(f.results.length>0){let h=f.results[0];return{agent:"code-executor",skills:(h.skills||"").split("|").map(D=>D.trim()).filter(Boolean),intent:e,domain:s,complexity:h.complexity||i,score:h._score||0,fallback:!1,description:h.description||"",useWhen:h.use_when||""}}}let r=Tc(t,1,!0);if(r.count===0){let f=Dl[e]||"code-executor",h=Mg[s]||["research"];return{agent:f,skills:h,intent:e,domain:s,complexity:i,score:0,fallback:!0,description:`Fallback combination based on detected intent (${e}) and domain (${s})`}}let a=r.results[0],c=(a.skills||"").split("|").map(f=>f.trim()).filter(Boolean);return{agent:a.agent||"code-executor",skills:c,intent:a.intent||e,domain:a.domain||s,complexity:a.complexity||i,score:a._score||0,fallback:!1,description:a.description||"",useWhen:a.use_when||""}}function Ic(t,e){let{top:s=5,forceIntent:i,forceDomain:n,maxSkills:o}=e||{};if(i||n)return El(t,i,n,s,!0).results.map(u=>{let f=(u.skills||"").split("|").map(h=>h.trim()).filter(Boolean);return o&&(f=f.slice(0,o)),{agent:i?Dl[i]:u.agent||"code-executor",skills:f,intent:u.intent||i||wl(t),domain:u.domain||n||xl(t),complexity:u.complexity||Sl(t),score:u._score||0,fallback:!1,description:u.description||"",useWhen:u.use_when||""}});let r=Tc(t,s,!0);return r.count===0?[Ug(t)]:r.results.map(a=>{let c=(a.skills||"").split("|").map(f=>f.trim()).filter(Boolean);return o&&(c=c.slice(0,o)),{agent:a.agent||"code-executor",skills:c,intent:a.intent||r.detectedIntent,domain:a.domain||r.detectedDomain,complexity:a.complexity||r.detectedComplexity,score:a._score||0,fallback:!1,description:a.description||"",useWhen:a.use_when||""}})}function Oc(t){let e=St(t),s=[];if(!Ht(e))return s;let i=$g(e,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>n.name);for(let n of i){let o=Di(e,n,"SKILL.md");if(Ht(o)){let r=Fl(o,"utf-8");s.push({name:n,path:o,content:r})}}return s}function Pc(t,e){let s=St(e),i=Di(s,t,"SKILL.md");return Ht(i)?Fl(i,"utf-8"):null}import{existsSync as zg,readFileSync as Hg}from"fs";function z(t=process.cwd()){let e={ACTIVE_GK_SESSION_ID:"",GK_PROJECT_HASH:"",PROJECT_DIR:"",ACTIVE_GEMINI_SESSION_ID:"",GEMINI_PROJECT_HASH:"",GEMINI_PARENT_ID:"",ACTIVE_PLAN:"",SUGGESTED_PLAN:"",PLAN_DATE_FORMAT:""},s=Ct(t);if(!zg(s))return e;try{let i=Hg(s,"utf-8"),n=i.match(/^ACTIVE_GK_SESSION_ID=(.*)$/m);n&&(e.ACTIVE_GK_SESSION_ID=n[1].trim());let o=i.match(/^GK_PROJECT_HASH=(.*)$/m);o&&(e.GK_PROJECT_HASH=o[1].trim());let r=i.match(/^PROJECT_DIR=(.*)$/m);r&&(e.PROJECT_DIR=r[1].trim());let a=i.match(/^ACTIVE_GEMINI_SESSION_ID=(.*)$/m);a&&(e.ACTIVE_GEMINI_SESSION_ID=a[1].trim());let u=i.match(/^GEMINI_PROJECT_HASH=(.*)$/m);u&&(e.GEMINI_PROJECT_HASH=u[1].trim());let c=i.match(/^GEMINI_PARENT_ID=(.*)$/m);c&&(e.GEMINI_PARENT_ID=c[1].trim());let f=i.match(/^ACTIVE_PLAN=(.*)$/m);f&&(e.ACTIVE_PLAN=f[1].trim());let h=i.match(/^SUGGESTED_PLAN=(.*)$/m);h&&(e.SUGGESTED_PLAN=h[1].trim());let g=i.match(/^PLAN_DATE_FORMAT=(.*)$/m);g&&(e.PLAN_DATE_FORMAT=g[1].trim())}catch{}return e}function Wt(t=process.cwd()){return z(t).ACTIVE_GK_SESSION_ID||void 0}function Xe(t=process.cwd()){let e=z(t);return e.PROJECT_DIR?e.PROJECT_DIR:ks(t)}function eo(t=process.cwd()){return z(t).GEMINI_PROJECT_HASH||void 0}function Ei(t=process.cwd()){return z(t).ACTIVE_PLAN||void 0}import{spawn as Wg,exec as Kg}from"child_process";import{existsSync as to,readFileSync as _l,writeFileSync as Al,unlinkSync as Bc}from"fs";import{join as io}from"path";import{tmpdir as Jg,platform as Nc}from"os";var Ne=io(Jg(),"elevator-music.lock"),so=3e4,no=class{audioFile;loop;volume;process=null;isPlaying=!1;loopInterval=null;hasLock=!1;lockRefreshInterval=null;triedFallback=!1;constructor(e={}){this.audioFile=e.audioFile||this.getDefaultAudioFile(),this.loop=e.loop!==!1,this.volume=e.volume||.5}tryAcquireLock(){let e={pid:process.pid,timestamp:Date.now()};try{return Al(Ne,JSON.stringify(e),{flag:"wx"}),this.hasLock=!0,this.lockRefreshInterval=setInterval(()=>{this.refreshLock()},so/3),!0}catch(s){return s.code==="EEXIST"?this.tryTakeStaleLock(e):!1}}tryTakeStaleLock(e){try{let s=JSON.parse(_l(Ne,"utf8"));if(Date.now()-s.timestamp<so&&s.pid!==process.pid)try{return process.kill(s.pid,0),!1}catch{}Bc(Ne);try{return Al(Ne,JSON.stringify(e),{flag:"wx"}),this.hasLock=!0,this.lockRefreshInterval=setInterval(()=>{this.refreshLock()},so/3),!0}catch{return!1}}catch{return!1}}refreshLock(){if(this.hasLock)try{let e={pid:process.pid,timestamp:Date.now()};Al(Ne,JSON.stringify(e),{flag:"w"})}catch{}}releaseLock(){if(this.lockRefreshInterval&&(clearInterval(this.lockRefreshInterval),this.lockRefreshInterval=null),!!this.hasLock){try{to(Ne)&&JSON.parse(_l(Ne,"utf8")).pid===process.pid&&Bc(Ne)}catch{}this.hasLock=!1}}getDefaultAudioFile(){let e=[io(process.cwd(),".gemini","extensions","spawn-agent","assets","golden-coast-melody.wav"),io(process.cwd(),".gemini","assets","elevator_music.wav"),io(process.cwd(),"assets","elevator_music.wav")];for(let s of e)if(to(s))return s;return null}getPlayCommand(){if(!this.audioFile)return null;switch(Nc()){case"win32":return{command:"powershell",args:["-NoProfile","-Command",`$player = New-Object System.Media.SoundPlayer '${this.audioFile}'; $player.PlaySync()`],shell:!1};case"darwin":return{command:"afplay",args:["-v",String(this.volume),this.audioFile],shell:!1};case"linux":return{command:"paplay",args:["--volume",String(Math.round(this.volume*65536)),this.audioFile],shell:!1,fallback:{command:"aplay",args:["-q",this.audioFile],shell:!1}};default:return null}}start(e={}){if(!this.audioFile||!to(this.audioFile))return!1;if(this.isPlaying)return!0;if(!e.force&&!this.tryAcquireLock())return!1;let s=this.getPlayCommand();return s?(this.isPlaying=!0,this.playLoop(s),!0):(this.releaseLock(),!1)}playLoop(e){if(!this.isPlaying)return;let s=i=>{this.process=Wg(i.command,i.args,{stdio:["ignore","ignore","pipe"],windowsHide:!0,shell:i.shell}),this.process.stderr?.on("data",()=>{i.fallback&&!this.triedFallback&&(this.triedFallback=!0,this.process?.kill(),s(i.fallback))}),this.process.on("close",()=>{this.isPlaying&&this.loop&&(this.loopInterval=setTimeout(()=>{this.playLoop(e)},100))}),this.process.on("error",()=>{i.fallback&&!this.triedFallback&&(this.triedFallback=!0,s(i.fallback))})};s(e)}stop(){this.isPlaying=!1,this.loopInterval&&(clearTimeout(this.loopInterval),this.loopInterval=null),this.process&&(Nc()==="win32"?Kg(`taskkill /pid ${this.process.pid} /T /F`,{windowsHide:!0}):this.process.kill("SIGTERM"),this.process=null),this.releaseLock()}get playing(){return this.isPlaying}static isAnyPlaying(){try{if(!to(Ne))return!1;let e=JSON.parse(_l(Ne,"utf8"));if(Date.now()-e.timestamp>=so)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}catch{return!1}}};var $c=[{icon:"\u{1F4A9}",action:"Pooping out some code"},{icon:"\u{1F373}",action:"Cooking up solutions"},{icon:"\u{1F9E0}",action:"Brain cells working overtime"},{icon:"\u26A1",action:"Neurons firing rapidly"},{icon:"\u{1F52E}",action:"Consulting the crystal ball"},{icon:"\u{1F3B0}",action:"Rolling the dice on this one"},{icon:"\u{1F680}",action:"Launching into hyperthink"},{icon:"\u{1F32A}\uFE0F",action:"Brainstorming intensifies"},{icon:"\u{1F3AA}",action:"Juggling multiple thoughts"},{icon:"\u{1F527}",action:"Tightening the logic bolts"},{icon:"\u{1F3A8}",action:"Painting the solution"},{icon:"\u{1F3D7}\uFE0F",action:"Building something awesome"},{icon:"\u{1F52C}",action:"Analyzing under the microscope"},{icon:"\u{1F9EA}",action:"Mixing the secret sauce"},{icon:"\u{1F3AF}",action:"Aiming for perfection"},{icon:"\u{1F9D9}",action:"Casting coding spells"},{icon:"\u{1F419}",action:"Multitasking like an octopus"},{icon:"\u{1F9BE}",action:"Flexing the AI muscles"},{icon:"\u{1F308}",action:"Finding the pot of gold"},{icon:"\u{1F3B8}",action:"Rocking out some logic"}],Lc=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Yg(t){let e=0,s=0,i=0,n=process.stdout.isTTY,o=setInterval(()=>{i++,s++;let r=i%10===0;r&&e++;let a=$c[e%$c.length],c=`${Lc[s%Lc.length]} ${a.icon} ${a.action}... ${i}s`;n?process.stdout.write(`\r\x1B[K${c}`):(i===1||r)&&console.log(c)},1e3);return{interval:o,stop:()=>{clearInterval(o),n&&process.stdout.write("\r\x1B[K")}}}function qg(t){let{agentType:e="Sub Agent",agentRole:s="unknown",parentSessionId:i=null,activePlan:n=null,projectDir:o=null}=t,r=[`Agent Type: ${e}`,`Agent Role: ${s}`];return i&&r.push(`Parent Session: ${i.slice(0,8)}...`),o&&r.push(`Project: ${o}`),n&&r.push(`Active Plan: ${n}`),r.join(`
29
+ `)}function Mc(){console.log(),console.log(p.default.bold(l.geminiPurple("Agent Management"))),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk agent")} <subcommand> [options]`),console.log(),console.log("Subcommands:"),console.log(` ${l.primary("list")} List all agent profiles`),console.log(` ${l.primary("info")} <name> Show agent profile details`),console.log(` ${l.primary("search")} "<task>" Find best agent+skills for a task`),console.log(` ${l.primary("spawn")} Spawn a sub-agent`),console.log(),console.log("Examples:"),console.log(` ${l.dim("gk agent list")}`),console.log(` ${l.dim("gk agent info researcher")}`),console.log(` ${l.dim('gk agent search "implement authentication"')}`),console.log(` ${l.dim('gk agent spawn -a researcher -p "research best practices"')}`),console.log(),console.log("Run with subcommand for specific help:"),console.log(` ${l.dim("gk agent list --help")}`),console.log(` ${l.dim("gk agent spawn --help")}`),console.log()}function Zg(){console.log(),console.log(p.default.bold(l.geminiPurple("gk agent list"))),console.log(l.dim("List all available agent profiles")),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk agent list")} [options]`),console.log(),console.log("Options:"),console.log(` ${l.dim("--json")} Output as JSON`),console.log()}function Xg(){console.log(),console.log(p.default.bold(l.geminiPurple("gk agent info"))),console.log(l.dim("Show detailed information about an agent profile")),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk agent info")} <name> [options]`),console.log(),console.log("Arguments:"),console.log(` ${l.dim("<name>")} Agent profile name (without .md extension)`),console.log(),console.log("Options:"),console.log(` ${l.dim("--json")} Output as JSON`),console.log(),console.log("Example:"),console.log(` ${l.dim("gk agent info researcher")}`),console.log()}function Qg(){console.log(),console.log(p.default.bold(l.geminiPurple("gk agent search"))),console.log(l.dim("Find best agent+skills combination for a task using BM25 search")),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk agent search")} "<task>" [options]`),console.log(),console.log("Arguments:"),console.log(` ${l.dim("<task>")} Task description to search for`),console.log(),console.log("Options:"),console.log(` ${l.dim("-n, --limit <n>")} Number of results (default: 5)`),console.log(` ${l.dim("-i, --intent <i>")} Force intent: research|plan|execute|debug|review|test|design|docs`),console.log(` ${l.dim("-d, --domain <d>")} Force domain: frontend|backend|auth|payment|database|mobile|ai|etc.`),console.log(` ${l.dim("--max-skills <n>")} Maximum skills to include`),console.log(` ${l.dim("--json")} Output as JSON`),console.log(),console.log("Examples:"),console.log(` ${l.dim('gk agent search "implement user authentication"')}`),console.log(` ${l.dim('gk agent search "debug the login form" -i debug')}`),console.log(` ${l.dim('gk agent search "build a payment page" -d payment')}`),console.log()}function Gc(){console.log(),console.log(p.default.bold(l.geminiPurple("gk agent spawn"))),console.log(l.dim("Spawn a sub-agent with Gemini CLI")),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk agent spawn")} -p "<prompt>" [options]`),console.log(),console.log("Required:"),console.log(` ${l.dim("-p, --prompt <text>")} Task prompt for the agent`),console.log(),console.log("Options:"),console.log(` ${l.dim("-a, --agent <name>")} Agent profile name (from .gemini/agents/)`),console.log(` ${l.dim("-s, --skills <list>")} Comma-separated skill names to inject`),console.log(` ${l.dim("-c, --context <files>")} Context files (@file syntax)`),console.log(` ${l.dim("-m, --model <model>")} Model override (default: from config)`),console.log(` ${l.dim("--music")} Play elevator music while waiting`),console.log(` ${l.dim("--no-music")} Disable elevator music`),console.log(` ${l.dim("--music-file <path>")} Custom music file path`),console.log(),console.log("Examples:"),console.log(` ${l.dim('gk agent spawn -p "fix the login bug"')}`),console.log(` ${l.dim('gk agent spawn -a researcher -p "research React best practices"')}`),console.log(` ${l.dim('gk agent spawn -a code-executor -s "frontend-design" -p "build a dashboard"')}`),console.log(` ${l.dim('gk agent spawn -p "implement auth" -m gemini-2.5-pro --music')}`),console.log()}function jc(t){t.command("agent [subcommand] [arg]","Agent management (list, info, search, spawn)").alias("a").option("--json","[all] Output as JSON").option("-n, --limit <n>","[search] Number of results (default: 5)",{default:5}).option("-i, --intent <intent>","[search] Force intent: research|plan|execute|debug|review|test|design|docs").option("-d, --domain <domain>","[search] Force domain: frontend|backend|auth|payment|database|mobile|ai").option("--max-skills <n>","[search] Maximum skills to include").option("-a, --agent <name>","[spawn] Agent profile name from .gemini/agents/").option("-p, --prompt <text>","[spawn] Task prompt (required for spawn)").option("-s, --skills <list>","[spawn] Comma-separated skill names").option("-c, --context <files>","[spawn] Context files (@file syntax)").option("-m, --model <model>","[spawn] Model override").option("--music","[spawn] Play elevator music while waiting").option("--no-music","[spawn] Disable elevator music").option("--music-file <path>","[spawn] Custom music file path").action(async(e,s,i)=>{if(i.help||i.h)switch(e){case"list":Zg();return;case"info":Xg();return;case"search":Qg();return;case"spawn":Gc();return;default:Mc();return}switch(e){case"list":await ep(i);break;case"info":s||(console.log(),d.error("Agent profile name required"),console.log(l.dim("Usage: gk agent info <name>")),console.log(),process.exit(1)),await tp(s,i);break;case"search":s||(console.log(),d.error("Search query required"),console.log(l.dim('Usage: gk agent search "<task>"')),console.log(),process.exit(1)),await sp(s,i);break;case"spawn":await ip(i);break;default:Mc()}})}async function ep(t){let e=Xn();if(t.json){console.log(JSON.stringify(e,null,2));return}if(console.log(),console.log(p.default.bold(l.geminiPurple("Available Agents"))),console.log(),e.length===0){d.warn('No agent profiles found. Run "gk init" first.'),console.log();return}for(let s of e)console.log(` ${l.primary(s.name)}`),console.log(` ${l.dim(s.description)}`),console.log(` ${l.dim("Model:")} ${s.model}`),s.skills&&s.skills.length>0&&console.log(` ${l.dim("Skills:")} ${s.skills.join(", ")}`),console.log("");console.log(l.dim(` Total: ${e.length} agents`)),console.log()}async function tp(t,e){let s=pl(t);if(s||(console.log(),d.error(`Agent profile not found: ${t}`),console.log(),process.exit(1)),e.json){console.log(JSON.stringify(s,null,2));return}console.log(),console.log(T.doubleLine()),console.log(p.default.bold(l.geminiPurple(`Agent: ${s.name}`))),console.log(T.doubleLine()),console.log(),console.log(` ${l.dim("Description:")} ${s.description}`),console.log(` ${l.dim("Model:")} ${s.model}`),s.skills?.length&&console.log(` ${l.dim("Skills:")} ${s.skills.join(", ")}`),console.log(` ${l.dim("Path:")} ${s.filePath}`),console.log(),console.log(l.dim("--- Profile Content ---")),console.log(),console.log(l.dim(s.content)),console.log()}async function sp(t,e){let s=Ic(t,{top:e.limit,forceIntent:e.intent,forceDomain:e.domain,maxSkills:e.maxSkills});if(e.json){console.log(JSON.stringify(s,null,2));return}if(console.log(),console.log(p.default.bold(l.geminiPurple(`Search results for: "${t}"`))),console.log(),s.length===0){d.warn("No matching agents found for task."),console.log();return}for(let i=0;i<s.length;i++){let n=s[i],o=n.fallback?l.warn(" [FALLBACK]"):"";console.log(` ${l.success(i+1+".")} ${l.primary(n.agent)}${o} ${l.dim(`(score: ${n.score})`)}`),console.log(` ${l.dim("Intent:")} ${n.intent} ${l.dim("Domain:")} ${n.domain} ${l.dim("Complexity:")} ${n.complexity}`),n.skills.length>0&&console.log(` ${l.dim("Skills:")} ${n.skills.join(" | ")}`),n.description&&console.log(` ${l.dim(n.description)}`),n.useWhen&&console.log(` ${l.dim("Use when:")} ${n.useWhen}`),console.log("")}if(s.length>0){let i=s[0],n=i.skills.length>0?` -s "${i.skills.join(",")}"`:"";console.log(l.dim(" Suggested command:")),console.log(` ${l.primary("gk")} agent spawn -a ${i.agent}${n} -p "${t}"`)}console.log()}async function ip(t){t.prompt||(console.log(),d.error("Prompt is required. Use -p or --prompt"),console.log(),Gc(),process.exit(1));let e=et(),s=z(),i=s.ACTIVE_GK_SESSION_ID||null,n=s.ACTIVE_GEMINI_SESSION_ID||null,o=s.ACTIVE_PLAN||null,r=s.SUGGESTED_PLAN||null,a=s.PLAN_DATE_FORMAT||null,u=s.PROJECT_DIR||null,c=null;t.agent&&(c=pl(t.agent),c||(console.log(),d.error(`Agent profile not found: ${t.agent}`),console.log(),process.exit(1)));let f=t.model||c?.model||e.spawn.defaultModel,h=t.music!==void 0?t.music:e.spawn.music,g=t.musicFile||e.spawn.musicFile,m=t.skills?.split(",").map(O=>O.trim())||[],D=c?.skills||[],F=[...new Set([...D,...m])],E=c?.name||t.agent||"Sub",C=[],re=qg({agentType:"Sub Agent",agentRole:E,parentSessionId:i,activePlan:o,projectDir:u});if(C.push("<system-context>"),C.push(re),C.push(`</system-context>
30
+ `),C.push("<task>"),C.push(t.prompt),C.push(`</task>
31
+ `),c&&(C.push("<agent>"),C.push(`# Agent: ${c.name}
32
+ `),C.push("## Role & Responsibilities"),C.push(c.content),C.push(`</agent>
33
+ `)),F.length>0){C.push("<skills>"),C.push(`You have access to the following skills and capabilities:
34
+ `);for(let O=0;O<F.length;O++){let Jl=F[O],Vl=Pc(Jl);Vl&&(C.push(`## Skill ${O+1}: ${Jl}`),C.push(Vl),C.push(`---
35
+ `))}C.push(`</skills>
36
+ `)}let po=C.join(`
37
+ `),Do=t.prompt.length>150?t.prompt.substring(0,150):t.prompt;console.log(),d.info(`Spawning ${l.primary(E)} agent with model: ${l.primary(f)}`),i&&d.info(`Parent session: ${l.dim(i.slice(0,20)+"...")}`),o&&d.info(`Active plan: ${l.dim(o)}`),F.length>0&&d.info(`Injected skills: ${l.dim(F.join(", "))}`),console.log(T.line()),console.log();let Qe=null;h&&(Qe=new no({audioFile:g,loop:!0,volume:.3}),Qe.start()&&(console.log(l.dim("Playing elevator music while waiting...")),console.log()));let Eo=Yg(E),wf=t.context?t.context.split(",").map(O=>O.trim()):[],bt=Vg("gemini",["-y","-m",f],{stdio:["pipe","pipe","pipe"],shell:process.platform==="win32",env:{...process.env,GEMINI_TYPE:"sub-agent",GEMINI_PARENT_SESSION_ID:n||"",GK_PARENT_SESSION_ID:i||"",GEMINI_AGENT_ROLE:E,GEMINI_AGENT_PROMPT:Do,GEMINI_AGENT_MODEL:f||"",GEMINI_AGENT_SKILLS:F.join(","),GEMINI_AGENT_CONTEXT:wf.join(","),GK_ACTIVE_PLAN:o||"",GK_SUGGESTED_PLAN:r||"",GK_PLAN_DATE_FORMAT:a||""}}),Fo="",bo="";bt.stdout.on("data",O=>{Fo+=O.toString()}),bt.stderr.on("data",O=>{bo+=O.toString()}),bt.stdin.write(po),bt.stdin.end(),bt.on("close",O=>{Eo.stop(),Qe&&(Qe.stop(),console.log(l.dim("Music stopped."))),console.log(),Fo&&console.log(Fo),bo&&console.error(bo),O===0?d.success(`${E} agent completed successfully`):d.error(`${E} agent exited with code: ${O}`),console.log(),process.exit(O||0)}),bt.on("error",O=>{Eo.stop(),Qe&&Qe.stop(),console.log(),d.error(`Failed to spawn agent: ${O.message}`),console.log(),process.exit(1)}),process.on("SIGINT",()=>{Eo.stop(),Qe&&Qe.stop(),bt.kill("SIGTERM"),process.exit(1)})}import{existsSync as Uc,readFileSync as zc,readdirSync as np}from"fs";import{join as op}from"path";function Se(t,e){if(!t||!e)return null;let s=Ts(t,e);if(!Uc(s))return null;try{let i=zc(s,"utf-8");return JSON.parse(i)}catch{return null}}function Hc(t,e={}){let{limit:s=10,status:i="all"}=e,n=Le(t);if(!Uc(n))return[];let o=[];try{let r=np(n).filter(a=>a.startsWith("gk-session-")&&a.endsWith(".json"));for(let a of r){let u=op(n,a),c=zc(u,"utf-8"),f=JSON.parse(c);i!=="all"&&(f.agents?.find(m=>m.agentType==="Main Agent")?.status||"active")!==i||o.push(f)}}catch{}return o.sort((r,a)=>new Date(a.initTimestamp).getTime()-new Date(r.initTimestamp).getTime()),o.slice(0,s)}function rp(t,e,s={}){let i=Se(t,e);if(!i||!i.agents)return[];let n=i.agents;return s.agentType&&(n=n.filter(o=>o.agentType===s.agentType)),s.status&&(n=n.filter(o=>o.status===s.status)),n}function Wc(t,e){let s=rp(t,e),i={total:s.length,active:0,completed:0,failed:0,mainAgents:0,subAgents:0,totalDurationMs:0};return s.forEach(n=>{n.status==="active"?i.active++:n.status==="completed"?i.completed++:n.status==="failed"&&i.failed++,n.agentType==="Main Agent"?i.mainAgents++:i.subAgents++,n.startTime&&n.endTime&&(i.totalDurationMs+=new Date(n.endTime).getTime()-new Date(n.startTime).getTime())}),i}import{existsSync as Vc,mkdirSync as cp,writeFileSync as vl,readFileSync as fp,renameSync as hp,unlinkSync as dp}from"fs";import{execSync as mp}from"child_process";import{join as gp}from"path";import{createHash as lp}from"crypto";function ap(t){return lp("sha256").update(t).digest("hex")}function up(t){return ap(t).substring(0,8)}function Kc(t){let e=t.replace(/\\/g,"/").toLowerCase();return up(e)}function Jc(t,e){let s=Date.now().toString(36),i=Math.random().toString(36).substring(2,6);return`${t}-${e}-${s}-${i}`}function pp(t){try{let e=`powershell -Command "$p = Get-CimInstance Win32_Process -Filter 'ProcessId=${t}'; Write-Output $p.ParentProcessId; Write-Output $p.Name"`,i=mp(e,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim().split(/\r?\n/),n=parseInt(i[0],10),o=i[1]||null;return{parentPid:!isNaN(n)&&n>0?n:null,processName:o}}catch{return{parentPid:null,processName:null}}}function Dp(t){return t?["powershell.exe","pwsh.exe","cmd.exe","bash.exe","zsh.exe","sh.exe","fish.exe"].includes(t.toLowerCase()):!1}function Ep(t){if(!t)return!1;let e=t.toLowerCase();return["code.exe","code - insiders.exe","cursor.exe","windsurf.exe","positron.exe","idea64.exe","idea.exe","webstorm64.exe","webstorm.exe","pycharm64.exe","pycharm.exe","phpstorm64.exe","phpstorm.exe","goland64.exe","goland.exe","rustrover64.exe","rustrover.exe","rider64.exe","rider.exe","clion64.exe","clion.exe","datagrip64.exe","datagrip.exe","fleet.exe","windowsterminal.exe","sublime_text.exe","zed.exe","terminal.app"].includes(e)}function Rl(){let t=process.ppid;try{if(process.platform==="win32"){let e=t,s=null;for(let i=0;i<10;i++){let{parentPid:n,processName:o}=pp(e);if(Dp(o)&&(s=e),Ep(o)&&s)return s;if(!n||n<=4)break;e=n}return s||t}else return t}catch{}return t}function oo(t){Vc(t)||cp(t,{recursive:!0})}function Fp(t){let{agents:e,...s}=t;return{...s,agents:e||[]}}function kl(t,e,s){if(!t||!e)return!1;let i=Le(t);oo(i);let n=Ts(t,e),o=`${n}.tmp`;try{let r=Fp(s);return vl(o,JSON.stringify(r,null,2),"utf8"),hp(o,n),!0}catch{try{dp(o)}catch{}return!1}}function Yc(t){try{let e=Ct(),s=["# Auto-generated by gemkit-cli",`# Updated at: ${new Date().toISOString()}`,"","# GEMKIT IDs",`ACTIVE_GK_SESSION_ID=${t.gkSessionId||""}`,`GK_PROJECT_HASH=${t.gkProjectHash||""}`,`PROJECT_DIR=${t.projectDir||""}`,"","# GEMINI IDs (mapped)",`ACTIVE_GEMINI_SESSION_ID=${t.geminiSessionId||""}`,`GEMINI_PROJECT_HASH=${t.geminiProjectHash||""}`,"","# PLAN INFO",`ACTIVE_PLAN=${t.activePlan||""}`,`SUGGESTED_PLAN=${t.suggestedPlan||""}`,`PLAN_DATE_FORMAT=${t.planDateFormat||""}`,""].join(`
38
+ `),i=gp(process.cwd(),".gemini");return oo(i),vl(e,s,"utf8"),!0}catch{return!1}}function bp(t,e){if(!t||!e)return null;let s=Is(t,e);if(!Vc(s))return null;try{let i=fp(s,"utf-8");return JSON.parse(i)}catch{return null}}function qc(t,e,s){if(!t||!e)return!1;let i=Le(t);oo(i);let n=Is(t,e);try{return vl(n,JSON.stringify(s,null,2),"utf8"),!0}catch{return!1}}function Zc(t,e,s){let i=bp(t,e);return i||(i={gkProjectHash:e,projectDir:t,projectPath:s||process.cwd(),geminiProjectHash:null,initialized:!0,initTimestamp:new Date().toISOString(),lastActiveTimestamp:new Date().toISOString(),activeGkSessionId:null,sessions:[]},qc(t,e,i)),i}function yp(t,e,s){let i=Zc(t,e);i.activeGkSessionId=s.gkSessionId,i.lastActiveTimestamp=new Date().toISOString();let n=i.sessions.findIndex(o=>o.gkSessionId===s.gkSessionId);if(n>=0){let o=i.sessions[n];i.sessions[n]={gkSessionId:s.gkSessionId,pid:s.pid??o.pid,sessionType:s.sessionType||o.sessionType,appName:s.appName||o.appName,prompt:s.prompt??o.prompt??null,activePlan:s.activePlan??o.activePlan??null,startTime:s.startTime||o.startTime,endTime:s.endTime??o.endTime??null}}else i.sessions.push({gkSessionId:s.gkSessionId,pid:s.pid??null,sessionType:s.sessionType||"gemini",appName:s.appName||"gemini-main",prompt:s.prompt??null,activePlan:s.activePlan??null,startTime:s.startTime||new Date().toISOString(),endTime:s.endTime??null});return i.sessions.sort((o,r)=>{let a=new Date(o.startTime||0).getTime();return new Date(r.startTime||0).getTime()-a}),qc(t,e,i)}function Xc(t,e,s){let i=Se(t,e);if(!i)return!1;let n=s.gkSessionId||e;i.agents=i.agents||[];let o=i.agents.findIndex(r=>r.gkSessionId===n);if(o>=0){let r=i.agents[o];i.agents[o]={...r,model:r.model||s.model||null,prompt:r.prompt||s.prompt||null}}else{let r={gkSessionId:n,pid:s.pid||null,geminiSessionId:s.geminiSessionId||null,geminiProjectHash:s.geminiProjectHash||null,parentGkSessionId:s.parentGkSessionId||null,agentType:s.parentGkSessionId?"Sub Agent":"Main Agent",agentRole:s.agentRole||"main",prompt:s.prompt||null,model:s.model||null,tokenUsage:s.tokenUsage||null,retryCount:s.retryCount||0,resumeCount:s.resumeCount||0,generation:s.generation||0,injected:s.injected||null,startTime:new Date().toISOString(),endTime:null,status:"active",exitCode:null,error:null};i.agents.push(r)}return kl(t,e,i)}function Qc(t,e={}){let s=e.cwd||process.cwd(),i=ks(s),n=Kc(s),o=Rl(),r=Jc(t,o),a={gkSessionId:r,gkProjectHash:n,projectDir:i,geminiSessionId:null,geminiParentId:null,geminiProjectHash:null,initialized:!0,initTimestamp:new Date().toISOString(),sessionType:"non-gemini",appName:t,pid:o,activePlan:e.activePlan||null,suggestedPlan:e.suggestedPlan||null,agents:[]};oo(Le(i)),kl(i,r,a),Zc(i,n,s),yp(i,n,{gkSessionId:r,pid:o,sessionType:"non-gemini",appName:t,startTime:a.initTimestamp,activePlan:a.activePlan});let u=z(),f=u.PROJECT_DIR===i&&u.GEMINI_PROJECT_HASH||"";return Yc({gkSessionId:r,gkProjectHash:n,projectDir:i,geminiSessionId:"",geminiProjectHash:f,activePlan:a.activePlan||"",suggestedPlan:a.suggestedPlan||"",planDateFormat:""}),{session:a,gkSessionId:r,pid:o,projectDir:i,gkProjectHash:n}}function ef(t,e,s){let i=Se(t,e);if(!i||(i.activePlan=s,i.suggestedPlan=null,!kl(t,e,i)))return!1;let n=z();return Yc({gkSessionId:e,gkProjectHash:i.gkProjectHash||n.GK_PROJECT_HASH,projectDir:t,geminiSessionId:i.geminiSessionId||n.ACTIVE_GEMINI_SESSION_ID,geminiProjectHash:i.geminiProjectHash||n.GEMINI_PROJECT_HASH,activePlan:s,suggestedPlan:"",planDateFormat:i.planDateFormat||n.PLAN_DATE_FORMAT})}function tf(t){if(!t)return null;let e=t.match(/^(.+)-(\d+)-([a-z0-9]+)-([a-z0-9]{4})$/);return e?{appName:e[1],pid:parseInt(e[2],10),timestamp:e[3],random:e[4]}:null}function Cp(){console.log(),console.log(p.default.bold(l.geminiPurple("Session Management"))),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk session")} <subcommand> [options]`),console.log(),console.log("Subcommands:"),console.log(` ${l.primary("status")} Show active session (default)`),console.log(` ${l.primary("list")} List recent sessions`),console.log(` ${l.primary("info")} <id> Show session details`),console.log(` ${l.primary("agents")} [id] List agents in session`),console.log(` ${l.primary("init")} [app] Initialize new session`),console.log(),console.log("Options:"),console.log(` ${l.dim("--json")} Output as JSON`),console.log(` ${l.dim("-n, --limit <n>")} Number of results for list (default: 10)`),console.log(),console.log("Examples:"),console.log(` ${l.dim("gk session status")}`),console.log(` ${l.dim("gk session list -n 20")}`),console.log(` ${l.dim("gk session info abc123")}`),console.log(` ${l.dim("gk session agents")}`),console.log(` ${l.dim("gk session init myapp")}`),console.log()}function sf(t){t.command("session [subcommand] [id]","Session management (status, list, info, agents, init)").alias("s").option("--json","[all] Output as JSON").option("-n, --limit <n>","[list] Number of results",{default:10}).action(async(e,s,i)=>{switch(e||"status"){case"status":await Sp(i);break;case"list":await wp(i);break;case"info":s||(console.log(),d.error("Session ID required"),console.log(l.dim("Usage: gk session info <id>")),console.log(),process.exit(1)),await xp(s,i);break;case"agents":await _p(s,i);break;case"init":await Ap(s||"app",i);break;default:Cp()}})}async function Sp(t){let e=z(),s=Xe(),i=e.ACTIVE_GK_SESSION_ID;if(!i){t.json?console.log(JSON.stringify({active:!1,projectDir:s},null,2)):(console.log(),d.info("No active GemKit session."),console.log(l.dim(` Project: ${s}`)),console.log());return}let n=Se(s,i);if(t.json){console.log(JSON.stringify(n||{active:!1,gkSessionId:i},null,2));return}if(!n){console.log(),d.warn(`Session ID in .env but file not found: ${i}`),console.log(l.dim(` Project: ${s}`)),console.log();return}let o=Wc(s,i),a=n.agents?.find(u=>u.agentType==="Main Agent")?.status||"active";console.log(),console.log(p.default.bold(l.geminiPurple("Active Session"))),console.log(T.line()),console.log(),console.log(` ${l.dim("GK Session ID:")} ${l.primary(n.gkSessionId)}`),console.log(` ${l.dim("Gemini Session ID:")} ${n.geminiSessionId||l.dim("N/A")}`),console.log(` ${l.dim("Project Dir:")} ${n.projectDir}`),console.log(` ${l.dim("App Name:")} ${n.appName}`),console.log(` ${l.dim("PID:")} ${n.pid}`),console.log(` ${l.dim("Status:")} ${T.statusIcon(a)} ${a}`),console.log(` ${l.dim("Started:")} ${n.initTimestamp}`),n.activePlan&&console.log(` ${l.dim("Active Plan:")} ${l.primary(n.activePlan)}`),console.log(),console.log(` ${l.dim("Agents:")} ${o.total} total (${o.mainAgents} main, ${o.subAgents} sub)`),console.log(` ${l.success(String(o.completed))} completed, ${l.error(String(o.failed))} failed, ${o.active} active`),console.log()}async function wp(t){let e=Xe(),s=Hc(e,{limit:t.limit});if(t.json){console.log(JSON.stringify(s,null,2));return}if(console.log(),console.log(p.default.bold(l.geminiPurple("Recent Sessions"))),console.log(l.dim(` Project: ${e}`)),console.log(),s.length===0){d.info(" No sessions found."),console.log();return}for(let i of s){let n=new Date(i.initTimestamp).toLocaleString(),r=i.agents?.find(u=>u.agentType==="Main Agent")?.status||"active",a=i.gkSessionId.length>25?i.gkSessionId.slice(0,25)+"...":i.gkSessionId;console.log(` ${T.statusIcon(r)} ${l.primary(a)} ${l.dim(n)}`),i.activePlan&&console.log(` ${l.dim("Plan:")} ${i.activePlan}`)}console.log(),console.log(l.dim(` Showing ${s.length} sessions (limit: ${t.limit})`)),console.log()}async function xp(t,e){let s=Xe(),i=Se(s,t);if(i||(console.log(),d.error(`Session not found: ${t}`),console.log(l.dim(` Looked in: ~/.gemkit/projects/${s}/`)),console.log(),process.exit(1)),e.json){console.log(JSON.stringify(i,null,2));return}console.log(),console.log(p.default.bold(l.geminiPurple(`Session: ${i.gkSessionId}`))),console.log(T.line()),console.log(),console.log(JSON.stringify(i,null,2)),console.log()}async function _p(t,e){let s=Xe(),i=t||Wt();i||(console.log(),d.error("No session ID provided and no active session found."),console.log(),process.exit(1));let n=Se(s,i);n||(console.log(),d.error(`Session not found: ${i}`),console.log(),process.exit(1));let o=n.agents||[];if(e.json){console.log(JSON.stringify(o,null,2));return}let r=i.length>30?i.slice(0,30)+"...":i;if(console.log(),console.log(p.default.bold(l.geminiPurple("Agents in Session"))),console.log(l.dim(` ${r}`)),console.log(),o.length===0){d.info(" No agents in this session."),console.log();return}for(let a=0;a<o.length;a++){let u=o[a],c=u.agentRole||"unknown",f=u.model||"default",h=u.agentType==="Main Agent"?l.primary("MAIN"):l.dim("SUB");if(console.log(` ${T.statusIcon(u.status)} [${h}] ${l.primary(c)} ${l.dim(`(${f})`)}`),u.prompt){let g=u.prompt.length>60?u.prompt.slice(0,60)+"...":u.prompt;console.log(` ${l.dim("Prompt:")} ${g}`)}u.tokenUsage&&console.log(` ${l.dim("Tokens:")} ${u.tokenUsage.total.toLocaleString()} total`),u.geminiSessionId&&console.log(` ${l.dim("Gemini ID:")} ${u.geminiSessionId.slice(0,8)}...`)}console.log(),console.log(l.dim(` Total: ${o.length} agents`)),console.log()}async function Ap(t,e){let i=z().ACTIVE_GK_SESSION_ID;if(i){let u=tf(i),c=Xe();if(u){let f=Rl();if(Se(c,i)&&u.pid===f){e.json?console.log(JSON.stringify({status:"existing",gkSessionId:i,pid:u.pid},null,2)):(console.log(),d.info(`GemKit session already active: ${l.primary(i.slice(0,30)+"...")}`),console.log(l.dim(` PID: ${u.pid}`)),console.log());return}}}let{session:n,gkSessionId:o,pid:r,projectDir:a}=Qc(t);Xc(a,o,{gkSessionId:o,pid:r,geminiSessionId:null,parentGkSessionId:null,agentRole:"main",prompt:null,model:null}),e.json?console.log(JSON.stringify({status:"initialized",gkSessionId:o,pid:r,projectDir:a},null,2)):(console.log(),d.success(`GemKit session initialized: ${l.primary(o.slice(0,30)+"...")}`),console.log(l.dim(` PID: ${r}`)),console.log())}import{existsSync as Fi,readdirSync as vp,mkdirSync as ro,writeFileSync as Tl,statSync as Rp}from"fs";import{join as Kt}from"path";function Il(t){let e=$i(t);if(!Fi(e))return[];let s=Ei();return vp(e,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>n.name).map(n=>{let o=Kt(e,n),r=Kt(o,"plan.md"),a="";return Fi(r)&&(a=Rp(r).birthtime.toISOString()),{name:n,path:o,createdAt:a,isActive:n===s}})}function nf(t,e){let s=$i(e),i=Kt(s,t);if(Fi(s)||ro(s,{recursive:!0}),Fi(i))throw new Error(`Plan already exists: ${t}`);ro(i,{recursive:!0}),ro(Kt(i,"research"),{recursive:!0}),ro(Kt(i,"artifacts"),{recursive:!0});let n=`# ${t}
39
+
40
+ ## Overview
41
+
42
+ [Describe the plan objectives here]
43
+
44
+ ## Tasks
45
+
46
+ - [ ] Task 1
47
+ - [ ] Task 2
48
+ - [ ] Task 3
49
+
50
+ ## Notes
51
+
52
+ `;return Tl(Kt(i,"plan.md"),n),{name:t,path:i,createdAt:new Date().toISOString(),isActive:!1}}function Ol(t,e){let s=Wt();if(!s){let o=Ct(e),r=z(),a=["# Auto-generated by gemkit-cli",`# Updated at: ${new Date().toISOString()}`,"","# GEMKIT IDs",`ACTIVE_GK_SESSION_ID=${r.ACTIVE_GK_SESSION_ID||""}`,`GK_PROJECT_HASH=${r.GK_PROJECT_HASH||""}`,`PROJECT_DIR=${r.PROJECT_DIR||""}`,"","# GEMINI IDs (mapped)",`ACTIVE_GEMINI_SESSION_ID=${r.ACTIVE_GEMINI_SESSION_ID||""}`,`GEMINI_PROJECT_HASH=${r.GEMINI_PROJECT_HASH||""}`,"","# PLAN INFO",`ACTIVE_PLAN=${t}`,`SUGGESTED_PLAN=${r.SUGGESTED_PLAN||""}`,`PLAN_DATE_FORMAT=${r.PLAN_DATE_FORMAT||""}`,""].join(`
53
+ `);return Tl(o,a),!0}let i=Xe(e);if(!Se(i,s)){let o=Ct(e),r=z(),a=["# Auto-generated by gemkit-cli",`# Updated at: ${new Date().toISOString()}`,"","# GEMKIT IDs",`ACTIVE_GK_SESSION_ID=${r.ACTIVE_GK_SESSION_ID||""}`,`GK_PROJECT_HASH=${r.GK_PROJECT_HASH||""}`,`PROJECT_DIR=${r.PROJECT_DIR||""}`,"","# GEMINI IDs (mapped)",`ACTIVE_GEMINI_SESSION_ID=${r.ACTIVE_GEMINI_SESSION_ID||""}`,`GEMINI_PROJECT_HASH=${r.GEMINI_PROJECT_HASH||""}`,"","# PLAN INFO",`ACTIVE_PLAN=${t}`,`SUGGESTED_PLAN=${r.SUGGESTED_PLAN||""}`,`PLAN_DATE_FORMAT=${r.PLAN_DATE_FORMAT||""}`,""].join(`
54
+ `);return Tl(o,a),!0}return ef(i,s,t)}function of(t,e){let s=$i(e),i=Kt(s,t);if(!Fi(i))return null;let n=Ei();return{name:t,path:i,createdAt:"",isActive:t===n}}function kp(){console.log(),console.log(p.default.bold(l.geminiPurple("Plan Management"))),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk plan")} <subcommand> [options]`),console.log(),console.log("Subcommands:"),console.log(` ${l.primary("list")} List all plans (default)`),console.log(` ${l.primary("status")} Show active plan status`),console.log(` ${l.primary("create")} <name> Create new plan`),console.log(` ${l.primary("set")} <name> Set active plan`),console.log(` ${l.primary("info")} Get plan info from .env`),console.log(),console.log("Options:"),console.log(` ${l.dim("--json")} Output as JSON`),console.log(` ${l.dim("-a, --active")} [info] Show only ACTIVE_PLAN value`),console.log(` ${l.dim("-s, --suggested")} [info] Show only SUGGESTED_PLAN value`),console.log(` ${l.dim("-f, --format")} [info] Show only PLAN_DATE_FORMAT value`),console.log(),console.log("Examples:"),console.log(` ${l.dim("gk plan list")}`),console.log(` ${l.dim("gk plan create my-feature")}`),console.log(` ${l.dim("gk plan set my-feature")}`),console.log(` ${l.dim("gk plan info --active")}`),console.log()}function rf(t){t.command("plan [subcommand] [name]","Plan management (list, status, create, set, info)").alias("p").option("--json","[all] Output as JSON").option("-a, --active","[info] Show only ACTIVE_PLAN value").option("-s, --suggested","[info] Show only SUGGESTED_PLAN value").option("-f, --format","[info] Show only PLAN_DATE_FORMAT value").action(async(e,s,i)=>{switch(e||"list"){case"list":await Tp(i);break;case"status":await Ip(i);break;case"create":s||(console.log(),d.error("Plan name required"),console.log(l.dim("Usage: gk plan create <name>")),console.log(),process.exit(1)),await Op(s);break;case"set":s||(console.log(),d.error("Plan name required"),console.log(l.dim("Usage: gk plan set <name>")),console.log(),process.exit(1)),await Pp(s);break;case"info":await Bp(i);break;default:kp()}})}async function Tp(t){let e=Il();if(t.json){console.log(JSON.stringify(e,null,2));return}if(console.log(),console.log(p.default.bold(l.geminiPurple("Project Plans"))),console.log(),e.length===0){d.info('No plans found. Create one with "gk plan create <name>".'),console.log();return}for(let s of e){let i=s.isActive?l.success("\u2192"):l.dim("\u25CB"),n=s.isActive?l.success(" (active)"):"";console.log(` ${i} ${l.primary(s.name)}${n}`),console.log(` ${l.dim("Created:")} ${l.dim(new Date(s.createdAt).toLocaleDateString())}`)}console.log()}async function Ip(t){let e=Ei();if(!e){t.json?console.log(JSON.stringify({active:!1},null,2)):(console.log(),d.info("No active plan set."),console.log());return}let s=of(e);if(t.json){console.log(JSON.stringify(s,null,2));return}console.log(),console.log(T.line()),console.log(p.default.bold(l.geminiPurple("Active Plan"))),console.log(T.line()),console.log(),console.log(` ${l.primary(e)}`),console.log()}async function Op(t){try{let e=nf(t);console.log(),d.success(`Plan created: ${l.primary(t)}`),d.info(`Path: ${l.dim(e.path)}`),Ol(t),d.info("Set as active plan."),console.log()}catch(e){console.log(),d.error(`Failed to create plan: ${e instanceof Error?e.message:String(e)}`),console.log()}}async function Pp(t){if(!Il().some(o=>o.name===t)){console.log(),d.error(`Plan not found: ${t}`),console.log();return}if(!Ol(t)){console.log(),d.error("Failed to update session or env file"),console.log();return}let n=Wt();console.log(),n&&d.success(`Session ${n.slice(0,20)}...: activePlan set to: ${l.primary(t)}`),d.info(`Environment updated: ACTIVE_PLAN = ${t}`),console.log(),d.success(`Active plan set to: ${l.primary(t)}`),console.log()}async function Bp(t){let e=z(),s={activePlan:e.ACTIVE_PLAN||null,suggestedPlan:e.SUGGESTED_PLAN||null,planDateFormat:e.PLAN_DATE_FORMAT||null,gkSessionId:e.ACTIVE_GK_SESSION_ID||null,projectDir:e.PROJECT_DIR||null};if(t.active){t.json?console.log(JSON.stringify({activePlan:s.activePlan})):console.log(s.activePlan||"");return}if(t.suggested){t.json?console.log(JSON.stringify({suggestedPlan:s.suggestedPlan})):console.log(s.suggestedPlan||"");return}if(t.format){t.json?console.log(JSON.stringify({planDateFormat:s.planDateFormat})):console.log(s.planDateFormat||"");return}if(t.json)console.log(JSON.stringify({activePlan:s.activePlan,suggestedPlan:s.suggestedPlan,planDateFormat:s.planDateFormat,context:{gkSessionId:s.gkSessionId,projectDir:s.projectDir}},null,2));else{console.log(),console.log(T.line()),console.log(p.default.bold(l.geminiPurple("Plan Information"))),console.log(T.line()),console.log(),console.log(` ${l.dim("Active Plan:")} ${s.activePlan||l.dim("(not set)")}`),console.log(` ${l.dim("Suggested Plan:")} ${s.suggestedPlan||l.dim("(not set)")}`),console.log(` ${l.dim("Date Format:")} ${s.planDateFormat||l.dim("(not set)")}`),console.log(),console.log(T.line());let i=s.gkSessionId?s.gkSessionId.substring(0,25)+"...":l.dim("(no session)");console.log(` ${l.dim("Session:")} ${i}`),console.log(` ${l.dim("Project:")} ${s.projectDir||l.dim("(unknown)")}`),console.log()}}import{existsSync as Np,readFileSync as $p,readdirSync as Lp}from"fs";import{join as lf}from"path";import{homedir as Mp}from"os";async function af(){let t=eo();return t?Gp(t):null}function Gp(t){let e=lf(Mp(),".gemini","tmp",t,"chats");if(!Np(e))return null;let s=Lp(e).filter(i=>i.startsWith("session-")&&i.endsWith(".json")).sort().reverse();if(s.length===0)return null;try{let i=lf(e,s[0]);return jp(i)}catch{return null}}function jp(t){try{let e=$p(t,"utf-8"),s=JSON.parse(e);if(!s.messages||s.messages.length===0)return null;let i=new Set,n=0,o=0,r=0,a,u=0;for(let E of s.messages)E.model&&i.add(E.model),E.tokens&&(n+=E.tokens.output||0,o+=E.tokens.thoughts||0,r+=E.tokens.tool||0,a=E.tokens,u++);if(!a||u===0)return null;let c=a.total||0,f=a.cached||0,h=c-n-o;h<0&&(h=0);let g={input:h,output:n,cached:f,thoughts:o,tool:r,total:c},m=null;if(s.startTime&&s.lastUpdated)try{let E=new Date(s.startTime),C=new Date(s.lastUpdated),re=Math.floor((C.getTime()-E.getTime())/1e3),po=Math.floor(re/60),Do=re%60;m={seconds:re,formatted:`${po}m ${Do}s`}}catch{}let D=Array.from(i),F=D[0]||"unknown";return{sessionId:s.sessionId,startTime:s.startTime||null,lastUpdated:s.lastUpdated||null,duration:m,model:F,modelsUsed:D,messageCount:u,tokens:g,averages:{outputPerMessage:u>0?Math.round(n/u):0,thoughtsPerMessage:u>0?Math.round(o/u):0,toolPerMessage:u>0?Math.round(r/u):0}}}catch{return null}}var bi={"gemini-3-pro-preview":{input:2,output:12,cached:.2,thoughts:12},"gemini-3-flash-preview":{input:.5,output:3,cached:.05,thoughts:3},"gemini-2.5-pro":{input:1.25,output:10,cached:.125,thoughts:10},"gemini-2.5-pro-preview":{input:1.25,output:10,cached:.125,thoughts:10},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,thoughts:2.5},"gemini-2.5-flash-lite":{input:.1,output:.4,cached:.01,thoughts:.4},"gemini-2.0-flash":{input:.1,output:.4,cached:.01,thoughts:.4},"gemini-2.0-flash-exp":{input:.1,output:.4,cached:.01,thoughts:.4},default:{input:.5,output:3,cached:.05,thoughts:3}};function Up(t){if(bi[t])return bi[t];for(let e of Object.keys(bi))if(e.includes(t)||t.includes(e))return bi[e];return bi.default}function Pl(t,e="default"){let s=Up(e),i=t.input-t.cached;i<0&&(i=0);let n=i/1e6*s.input,o=t.output/1e6*s.output,r=t.cached/1e6*s.cached,a=t.thoughts/1e6*s.thoughts;return{input:n,output:o,cached:r,thoughts:a,total:n+o+r+a,model:e,pricing:s}}function Dt(t){return t>=1?`$${t.toFixed(2)}`:t>=.01?`$${t.toFixed(3)}`:t>=.001?`$${t.toFixed(4)}`:`$${t.toFixed(6)}`}function Bl(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}var Ft={topLeft:"\u256D",topRight:"\u256E",bottomLeft:"\u2570",bottomRight:"\u256F",horizontal:"\u2500",vertical:"\u2502",middleLeft:"\u251C",middleRight:"\u2524"};function zp(t=75){return l.dim(`${Ft.topLeft}${Ft.horizontal.repeat(t-2)}${Ft.topRight}`)}function Hp(t=75){return l.dim(`${Ft.bottomLeft}${Ft.horizontal.repeat(t-2)}${Ft.bottomRight}`)}function Wp(t,e=75){let s=t.replace(/\x1b\[[0-9;]*m/g,"").length,i=Math.max(0,e-4-s);return`${l.dim(Ft.vertical)} ${t}${" ".repeat(i)} ${l.dim(Ft.vertical)}`}function Nl(t){return`
55
+ ${p.default.bold(l.geminiPurple(`## ${t}`))}`}function we(t,e){let s=t.replace(/\x1b\[[0-9;]*m/g,"").length,i=Math.max(0,e-s);return" ".repeat(i)+t}function Et(t,e){let s=t.replace(/\x1b\[[0-9;]*m/g,"").length,i=Math.max(0,e-s);return t+" ".repeat(i)}function Kp(t){let e=[],s=t.length;for(let i=0;i<s;i++){let n=i/Math.max(s-1,1),o=Math.round(26+116*n),r=Math.round(115+-79*n),a=Math.round(232+-62*n);e.push(`\x1B[38;2;${o};${r};${a}m${t[i]}`)}return e.join("")+"\x1B[0m"}function Jp(t){let e=Pl(t.tokens,t.model);console.log(),console.log(zp(75)),console.log(Wp(`${Kp("SESSION ANALYSIS")} ${l.dim("Cost:")} ${l.warn(Dt(e.total))}`,75)),console.log(Hp(75)),console.log(`
56
+ ${l.dim("Session ID:")} ${l.accent(t.sessionId)}`),console.log(` ${l.dim("Start Time:")} ${t.startTime||"N/A"}`),console.log(` ${l.dim("Duration:")} ${l.accent(t.duration?.formatted||"N/A")}`),console.log(` ${l.dim("Model:")} ${l.geminiBlue(t.modelsUsed.join(", "))}`),console.log(` ${l.dim("Messages:")} ${l.accent(String(t.messageCount))}`),console.log(Nl("Token Breakdown")),console.log(`
57
+ ${Et("Category",10)} ${we("Count",14)} ${we("Formatted",10)}`),console.log(` ${l.dim("\u2500".repeat(10))} ${l.dim("\u2500".repeat(14))} ${l.dim("\u2500".repeat(10))}`);let s=["input","output","cached","thoughts","tool"];for(let o of s){let r=t.tokens[o],a=we(l.accent(r.toLocaleString()),14),u=we(l.accent(Bl(r)),10);console.log(` ${Et(o,10)} ${a} ${u}`)}console.log(` ${l.dim("\u2500".repeat(10))} ${l.dim("\u2500".repeat(14))} ${l.dim("\u2500".repeat(10))}`);let i=we(l.success(t.tokens.total.toLocaleString()),14),n=we(l.success(Bl(t.tokens.total)),10);if(console.log(` ${Et(p.default.bold("total"),10)} ${i} ${n}`),console.log(Nl("Estimated Cost")),console.log(`
58
+ ${Et("Input",12)} ${we(l.warn(Dt(e.input)),12)}`),console.log(` ${Et("Output",12)} ${we(l.warn(Dt(e.output)),12)}`),console.log(` ${Et("Cached",12)} ${we(l.warn(Dt(e.cached)),12)}`),console.log(` ${Et("Thoughts",12)} ${we(l.warn(Dt(e.thoughts)),12)}`),console.log(` ${l.dim("\u2500".repeat(24))}`),console.log(` ${Et(p.default.bold("TOTAL"),12)} ${we(p.default.bold(l.warn(Dt(e.total))),12)}`),t.messageCount>0){console.log(Nl("Averages"));let o=Math.round(t.tokens.total/t.messageCount),r=e.total/t.messageCount;console.log(`
59
+ ${l.dim("Tokens/msg:")} ${l.accent(o.toLocaleString())}`),console.log(` ${l.dim("Cost/msg:")} ${l.warn(Dt(r))}`)}console.log()}function Vp(t){let e=Pl(t.tokens,t.model);console.log(JSON.stringify({sessionId:t.sessionId,startTime:t.startTime,duration:t.duration,model:t.model,modelsUsed:t.modelsUsed,messageCount:t.messageCount,tokens:t.tokens,averages:t.averages,cost:{input:e.input,output:e.output,cached:e.cached,thoughts:e.thoughts,total:e.total}},null,2))}function uf(t){t.command("tokens","Show token usage for current session").alias("t").option("--json","Output as JSON").action(async e=>{let s=await af();if(!s){e.json?console.log(JSON.stringify({found:!1},null,2)):(console.log(),d.info("No token usage found for current session."),console.log());return}if(e.json){Vp(s);return}Jp(s)})}import{existsSync as Yp,readdirSync as qp}from"fs";function cf(t){let e=t.command("extension <subcommand>","Extension management").alias("ext");e.example("gk extension list # List installed extensions"),e.action(async s=>{let i=s||"list";i==="list"?await Zp():(console.log(),d.error(`Unknown subcommand: ${i}`),console.log(),process.exit(1))})}async function Zp(){let t=St();if(!Yp(t)){console.log(),d.info("No extensions directory found."),console.log();return}let e=qp(t,{withFileTypes:!0}).filter(s=>s.isDirectory()).map(s=>s.name);if(e.length===0){console.log(),d.info("No extensions installed."),console.log();return}console.log(),console.log(p.default.bold(l.geminiPurple("Installed Extensions"))),console.log();for(let s of e)console.log(` ${l.success("\u2713")} ${l.primary(s)}`);console.log(),console.log(l.dim(` Total: ${e.length} extensions`)),console.log()}function ff(t){t.command("catalog [subcommand]","Catalog of skills and agents").action(async s=>{let i=s||"skills";switch(i){case"skills":await Xp();break;case"agents":await Qp();break;default:console.log(),d.error(`Unknown subcommand: ${i}`),console.log(),process.exit(1)}})}async function Xp(){let t=Oc();if(console.log(),console.log(p.default.bold(l.geminiPurple("Available Skills"))),console.log(),t.length===0){d.info(" No skills found."),console.log();return}for(let e of t)console.log(` ${l.success("\u2713")} ${l.primary(e.name)}`);console.log(),console.log(l.dim(` Total: ${t.length} skills`)),console.log()}async function Qp(){let t=Xn();if(console.log(),console.log(p.default.bold(l.geminiPurple("Available Agent Profiles"))),console.log(),t.length===0){d.info(" No agent profiles found."),console.log();return}for(let e of t)console.log(` ${l.success("\u25CF")} ${l.primary(e.name)}`),console.log(` ${l.dim(e.description)}`);console.log(),console.log(l.dim(` Total: ${t.length} profiles`)),console.log()}import{spawnSync as Cs}from"child_process";import{existsSync as yi,mkdirSync as hf,writeFileSync as eD,statSync as tD}from"fs";import{join as $l}from"path";import{homedir as sD}from"os";var iD="clipboard-image";function df(t){t.command("paste-image","Capture clipboard image for Gemini analysis").alias("pi").option("--format <fmt>","Image format (png, jpg)",{default:"png"}).option("--json","Output as JSON").action(async e=>{let s=rD(e),i=cD(s);e.json?console.log(JSON.stringify(i,null,2)):(console.log(),i.success?(console.log(`${l.success("\u2713")} Image captured: ${l.primary(String(i.path))}`),console.log(` ${l.dim("Size:")} ${i.size}`),console.log(` ${l.dim("Platform:")} ${i.platform}`)):(console.error(`${l.error("\u2717")} ${i.error}`),i.suggestion&&console.log(` ${l.dim("Hint:")} ${i.suggestion}`)),console.log()),process.exit(s.success?0:1)})}function nD(){let t=eo();if(t){let s=$l(sD(),".gemini","tmp",t);return yi(s)||hf(s,{recursive:!0}),s}let e=$l(process.cwd(),".gemini","tmp","clipboard");return yi(e)||hf(e,{recursive:!0}),e}function oD(t="png"){let e=Date.now(),s=Math.random().toString(36).substring(2,8);return`${iD}-${e}-${s}.${t}`}function rD(t){let e=t.format||"png",s=process.platform,i=nD(),n=oD(e),o=$l(i,n),r;switch(s){case"win32":r=lD(o);break;case"darwin":r=aD(o);break;case"linux":r=uD(o);break;default:r={success:!1,error:`Unsupported platform: ${s}`}}return r.platform=s,r.tempDir=i,r}function lD(t){let e=t.replace(/\\/g,"\\\\"),s=`
60
+ Add-Type -AssemblyName System.Windows.Forms
61
+ Add-Type -AssemblyName System.Drawing
62
+ $clipboard = [System.Windows.Forms.Clipboard]::GetImage()
63
+ if ($clipboard -eq $null) { Write-Error "NO_IMAGE"; exit 1 }
64
+ $dir = Split-Path -Parent "${e}"
65
+ if (-not (Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force | Out-Null }
66
+ $clipboard.Save("${e}", [System.Drawing.Imaging.ImageFormat]::Png)
67
+ $clipboard.Dispose()
68
+ Write-Output "SUCCESS"
69
+ `.trim(),i=Cs("powershell",["-NoProfile","-NonInteractive","-Command",s],{encoding:"utf-8",windowsHide:!0});return i.stderr?.includes("NO_IMAGE")?{success:!1,error:"No image in clipboard. Copy an image first."}:i.status!==0?{success:!1,error:`Failed: ${i.stderr||i.stdout}`.trim()}:yi(t)?{success:!0,path:t}:{success:!1,error:"File not created"}}function aD(t){return Cs("which",["pngpaste"],{encoding:"utf-8"}).status===0&&Cs("pngpaste",[t],{encoding:"utf-8"}).status===0&&yi(t)?{success:!0,path:t}:{success:!1,error:"No image or pngpaste failed",suggestion:"brew install pngpaste"}}function uD(t){if(Cs("which",["xclip"],{encoding:"utf-8"}).status!==0)return{success:!1,error:"xclip not installed",suggestion:"apt install xclip"};let s=Cs("xclip",["-selection","clipboard","-t","TARGETS","-o"],{encoding:"utf-8"});if(!s.stdout?.includes("image/png")&&!s.stdout?.includes("image/jpeg"))return{success:!1,error:"No image in clipboard"};let i=s.stdout.includes("image/png")?"image/png":"image/jpeg",n=Cs("xclip",["-selection","clipboard","-t",i,"-o"],{encoding:"buffer"});return n.status!==0||!n.stdout?.length?{success:!1,error:"Failed to read clipboard"}:(eD(t,n.stdout),yi(t)?{success:!0,path:t}:{success:!1,error:"Save failed"})}function cD(t){if(t.success&&t.path){let e=tD(t.path);return{success:!0,message:"Image captured",path:t.path,size:`${(e.size/1024).toFixed(1)} KB`,platform:t.platform}}return{success:!1,error:t.error,suggestion:t.suggestion,platform:t.platform}}var mf={"claude-3-opus":"gemini-2.5-pro","claude-3-sonnet":"gemini-2.5-flash","claude-3-haiku":"gemini-2.5-flash","claude-3.5-sonnet":"gemini-2.5-pro","claude-3.5-haiku":"gemini-2.5-flash","gemini-2.5-pro":"gemini-2.5-pro","gemini-2.5-flash":"gemini-2.5-flash","gemini-3-flash-preview":"gemini-3-flash-preview"};import{existsSync as oe,readFileSync as lo,readdirSync as ao,mkdirSync as Gl,writeFileSync as gf,copyFileSync as Ll,statSync as pf}from"fs";import{join as A}from"path";var fD=".claude/skills",hD=".gemini/extensions",dD=".claude/agents",mD=".gemini/agents";function jl(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return null;let s={name:"",description:""},i=e[1].split(/\r?\n/);for(let n of i){let o=n.indexOf(":");if(o===-1)continue;let r=n.slice(0,o).trim(),a=n.slice(o+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),s[r]=a}return s}function uo(t=process.cwd()){return A(t,fD)}function co(t=process.cwd()){return A(t,hD)}function fo(t=process.cwd()){let e=uo(t);if(!oe(e))return[];let s=[];try{let i=ao(e,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>n.name);for(let n of i){let o=A(e,n),r=A(o,"SKILL.md"),a=A(o,"references"),u=oe(r),c=oe(a)&&pf(a).isDirectory(),f;if(u)try{let h=lo(r,"utf-8");f=jl(h)?.description}catch{}s.push({name:n,path:o,hasSkillMd:u,hasReferences:c,description:f})}}catch{}return s.sort((i,n)=>i.name.localeCompare(n.name))}function Ul(t,e=process.cwd()){let s=A(co(e),t);return oe(s)}function gD(t,e){let s=["SKILL.md"];return e&&s.push("references/*.md"),{name:t.name||"",version:"1.0.0",description:t.description||"",license:"MIT",contextFileName:s}}function Ml(t,e,s){oe(e)||(Gl(e,{recursive:!0}),s.push(e));let i=ao(t,{withFileTypes:!0});for(let n of i){let o=A(t,n.name),r=A(e,n.name);n.isDirectory()?Ml(o,r,s):(Ll(o,r),s.push(r))}}function zl(t,e={},s=process.cwd()){let i={skill:t,success:!1,created:[],skipped:[],errors:[]},n=uo(s),o=co(s),r=A(n,t),a=A(o,t);if(!oe(r))return i.errors.push(`Skill not found: ${t}`),i;let u=A(r,"SKILL.md");if(!oe(u))return i.errors.push(`SKILL.md not found in ${t}`),i;if(Ul(t,s)&&!e.force)return i.skipped.push(`Extension already exists: ${t} (use --force to overwrite)`),i;let c=null;try{let m=lo(u,"utf-8");c=jl(m)}catch(m){return i.errors.push(`Failed to read SKILL.md: ${m instanceof Error?m.message:String(m)}`),i}(!c||!c.name)&&(c={name:t,description:""});let f=A(r,"references"),h=oe(f)&&pf(f).isDirectory(),g=gD(c,h);if(e.dryRun)return i.created.push(`[DRY RUN] Would create: ${a}`),i.created.push(`[DRY RUN] Would create: ${A(a,"gemini-extension.json")}`),i.created.push("[DRY RUN] Would copy: SKILL.md"),h&&i.created.push("[DRY RUN] Would copy: references/"),i.success=!0,i;try{oe(a)||(Gl(a,{recursive:!0}),i.created.push(a));let m=A(a,"gemini-extension.json");gf(m,JSON.stringify(g,null,2)+`
70
+ `),i.created.push(m);let D=A(a,"SKILL.md");if(Ll(u,D),i.created.push(D),h){let E=A(a,"references");Ml(f,E,i.created)}let F=ao(r,{withFileTypes:!0});for(let E of F){if(E.name==="SKILL.md"||E.name==="references")continue;let C=A(r,E.name),re=A(a,E.name);E.isDirectory()?Ml(C,re,i.created):(Ll(C,re),i.created.push(re))}i.success=!0}catch(m){i.errors.push(`Failed to convert: ${m instanceof Error?m.message:String(m)}`)}return i}function Df(t={},e=process.cwd()){let s=fo(e),i=[];for(let n of s){let o=zl(n.name,t,e);i.push(o)}return i}function Hl(t){return{total:t.length,success:t.filter(e=>e.success&&e.errors.length===0&&e.skipped.length===0).length,skipped:t.filter(e=>e.skipped.length>0).length,failed:t.filter(e=>e.errors.length>0).length}}function ho(t=process.cwd()){return A(t,dD)}function mo(t=process.cwd()){return A(t,mD)}function Ef(t){let e=jl(t);return e?{name:e.name||"",description:e.description||"",model:e.model,skills:e.skills}:null}function go(t=process.cwd()){let e=ho(t);if(!oe(e))return[];let s=[];try{let i=ao(e,{withFileTypes:!0}).filter(n=>n.isFile()&&n.name.endsWith(".md")).map(n=>n.name);for(let n of i){let o=A(e,n),r=n.replace(/\.md$/,""),a,u,c;try{let f=lo(o,"utf-8"),h=Ef(f);h&&(a=h.description,u=h.model,c=h.skills)}catch{}s.push({name:r,path:o,description:a,model:u,skills:c})}}catch{}return s.sort((i,n)=>i.name.localeCompare(n.name))}function Wl(t,e=process.cwd()){let s=A(mo(e),`${t}.md`);return oe(s)}function pD(t){if(t)return mf[t]||t}function DD(t,e){let s=t.match(/^(---\r?\n)([\s\S]*?)(\r?\n---)/);if(!s)return t;let[i,n,o,r]=s,a=o.split(/\r?\n/),u=[],c=new Set;for(let h of a){let g=h.indexOf(":");if(g===-1){u.push(h);continue}let m=h.slice(0,g).trim();m in e?(c.add(m),e[m]!==void 0&&u.push(`${m}: ${e[m]}`)):u.push(h)}for(let[h,g]of Object.entries(e))!c.has(h)&&g!==void 0&&u.push(`${h}: ${g}`);let f=n+u.join(`
71
+ `)+r;return t.replace(i,f)}function Kl(t,e={},s=process.cwd()){let i={skill:t,success:!1,created:[],skipped:[],errors:[]},n=ho(s),o=mo(s),r=A(n,`${t}.md`),a=A(o,`${t}.md`);if(!oe(r))return i.errors.push(`Agent not found: ${t}`),i;if(Wl(t,s)&&!e.force)return i.skipped.push(`Agent already exists in .gemini/agents: ${t} (use --force to overwrite)`),i;let u;try{u=lo(r,"utf-8")}catch(m){return i.errors.push(`Failed to read agent file: ${m instanceof Error?m.message:String(m)}`),i}let f=Ef(u)?.model,h=pD(f),g=u;if(f&&h&&f!==h&&(g=DD(u,{model:h})),e.dryRun)return i.created.push(`[DRY RUN] Would create: ${a}`),f&&h&&f!==h&&i.created.push(`[DRY RUN] Would map model: ${f} -> ${h}`),i.success=!0,i;try{oe(o)||Gl(o,{recursive:!0}),gf(a,g),i.created.push(a),f&&h&&f!==h&&i.created.push(`Model mapped: ${f} -> ${h}`),i.success=!0}catch(m){i.errors.push(`Failed to convert: ${m instanceof Error?m.message:String(m)}`)}return i}function Ff(t={},e=process.cwd()){let s=go(e),i=[];for(let n of s){let o=Kl(n.name,t,e);i.push(o)}return i}function bf(){console.log(),console.log(p.default.bold(l.geminiPurple("Convert .claude to .gemini"))),console.log(),console.log("Usage:"),console.log(` ${l.primary("gk convert")} <type> [name] [options]`),console.log(),console.log("Types:"),console.log(` ${l.primary("skill")} <name> Convert a single skill to extension`),console.log(` ${l.primary("skills")} Convert all skills to extensions`),console.log(` ${l.primary("agent")} <name> Convert a single agent`),console.log(` ${l.primary("agents")} Convert all agents`),console.log(),console.log("Options:"),console.log(` ${l.dim("--list")} List available items`),console.log(` ${l.dim("--force")} Overwrite existing items`),console.log(` ${l.dim("--dry-run")} Show what would be done without changes`),console.log(` ${l.dim("--json")} Output as JSON`),console.log(),console.log("Examples:"),console.log(` ${l.dim("gk convert skill --list")}`),console.log(` ${l.dim("gk convert skill my-skill")}`),console.log(` ${l.dim("gk convert skills --force")}`),console.log(` ${l.dim("gk convert agent --list")}`),console.log(` ${l.dim("gk convert agents --dry-run")}`),console.log()}function yf(t){t.command("convert [type] [name]","Convert .claude to .gemini resources").alias("cv").option("--all","[all] Convert all items").option("--list","[all] List available items").option("--force","[all] Overwrite existing items").option("--dry-run","[all] Show what would be done without making changes").option("--json","[all] Output as JSON").action(async(e,s,i)=>{if(!e){bf();return}if(e==="skill"||e==="skills"){if(i.list){await ED(i);return}if(i.all||e==="skills"){await bD(i);return}s||(console.log(),d.error("Skill name required"),console.log(l.dim("Usage: gk convert skill <name>")),console.log(l.dim(" gk convert skill --list (to see available skills)")),console.log(l.dim(" gk convert skills (to convert all)")),console.log(),process.exit(1)),await FD(s,i);return}if(e==="agent"||e==="agents"){if(i.list){await yD(i);return}if(i.all||e==="agents"){await SD(i);return}s||(console.log(),d.error("Agent name required"),console.log(l.dim("Usage: gk convert agent <name>")),console.log(l.dim(" gk convert agent --list (to see available agents)")),console.log(l.dim(" gk convert agents (to convert all)")),console.log(),process.exit(1)),await CD(s,i);return}bf()})}async function ED(t){let e=fo();if(t.json){console.log(JSON.stringify(e,null,2));return}if(console.log(),console.log(p.default.bold(l.geminiPurple("Available Claude Skills"))),console.log(l.dim(` Source: ${uo()}`)),console.log(),e.length===0){d.info("No skills found in .claude/skills/"),console.log();return}for(let s of e){let i=Ul(s.name),n=i?l.success("\u2713"):l.dim("\u25CB"),o=i?l.dim(" (converted)"):"";if(console.log(` ${n} ${l.primary(s.name)}${o}`),s.description){let r=s.description.length>70?s.description.slice(0,70)+"...":s.description;console.log(` ${l.dim(r)}`)}}console.log(),console.log(l.dim(` Total: ${e.length} skills`)),console.log()}async function FD(t,e){let s=zl(t,{force:e.force,dryRun:e.dryRun});if(e.json){console.log(JSON.stringify(s,null,2));return}if(console.log(),s.errors.length>0){d.error(`Failed to convert skill: ${t}`);for(let i of s.errors)console.log(` ${l.error("\u2717")} ${i}`);console.log(),process.exit(1)}if(s.skipped.length>0){d.warn(`Skipped skill: ${t}`);for(let i of s.skipped)console.log(` ${l.dim("\u25CB")} ${i}`);console.log();return}if(e.dryRun){d.info(`[DRY RUN] Would convert skill: ${t}`);for(let i of s.created)console.log(` ${l.dim("\u2192")} ${i}`);console.log();return}d.success(`Converted skill: ${l.primary(t)}`),console.log(),console.log(` ${l.dim("Created files:")}`);for(let i of s.created.slice(0,5)){let n=i.replace(process.cwd(),".");console.log(` ${l.success("+")} ${n}`)}s.created.length>5&&console.log(` ${l.dim(`... and ${s.created.length-5} more`)}`),console.log(),console.log(l.dim(` Extension created at: ${co()}/${t}`)),console.log()}async function bD(t){if(fo().length===0){t.json?console.log(JSON.stringify({results:[],summary:{total:0,success:0,skipped:0,failed:0}},null,2)):(console.log(),d.info("No skills found in .claude/skills/"),console.log());return}let s=Df({force:t.force,dryRun:t.dryRun}),i=Hl(s);if(t.json){console.log(JSON.stringify({results:s,summary:i},null,2));return}console.log(),t.dryRun?console.log(p.default.bold(l.geminiPurple("[DRY RUN] Skill Conversion Preview"))):console.log(p.default.bold(l.geminiPurple("Skill Conversion Results"))),console.log(T.line()),console.log();for(let n of s)if(n.errors.length>0){console.log(` ${l.error("\u2717")} ${n.skill}`);for(let o of n.errors)console.log(` ${l.dim(o)}`)}else if(n.skipped.length>0)console.log(` ${l.dim("\u25CB")} ${n.skill} ${l.dim("(skipped)")}`);else if(n.success){let o=t.dryRun?l.dim("\u2192"):l.success("\u2713");console.log(` ${o} ${n.skill}`)}console.log(),console.log(T.line()),console.log(),t.dryRun?(console.log(` ${l.dim("Would convert:")} ${i.success} skills`),console.log(` ${l.dim("Would skip:")} ${i.skipped} skills`),console.log(` ${l.dim("Would fail:")} ${i.failed} skills`)):(console.log(` ${l.success("Converted:")} ${i.success}`),console.log(` ${l.dim("Skipped:")} ${i.skipped}`),console.log(` ${l.error("Failed:")} ${i.failed}`)),console.log(),i.skipped>0&&!t.force&&(d.info("Use --force to overwrite existing extensions"),console.log())}async function yD(t){let e=go();if(t.json){console.log(JSON.stringify(e,null,2));return}if(console.log(),console.log(p.default.bold(l.geminiPurple("Available Claude Agents"))),console.log(l.dim(` Source: ${ho()}`)),console.log(),e.length===0){d.info("No agents found in .claude/agents/"),console.log();return}for(let s of e){let i=Wl(s.name),n=i?l.success("\u2713"):l.dim("\u25CB"),o=i?l.dim(" (converted)"):"";if(console.log(` ${n} ${l.primary(s.name)}${o}`),s.model&&console.log(` ${l.dim("Model:")} ${s.model}`),s.description){let r=s.description.length>60?s.description.slice(0,60)+"...":s.description;console.log(` ${l.dim(r)}`)}}console.log(),console.log(l.dim(` Total: ${e.length} agents`)),console.log()}async function CD(t,e){let s=Kl(t,{force:e.force,dryRun:e.dryRun});if(e.json){console.log(JSON.stringify(s,null,2));return}if(console.log(),s.errors.length>0){d.error(`Failed to convert agent: ${t}`);for(let i of s.errors)console.log(` ${l.error("\u2717")} ${i}`);console.log(),process.exit(1)}if(s.skipped.length>0){d.warn(`Skipped agent: ${t}`);for(let i of s.skipped)console.log(` ${l.dim("\u25CB")} ${i}`);console.log();return}if(e.dryRun){d.info(`[DRY RUN] Would convert agent: ${t}`);for(let i of s.created)console.log(` ${l.dim("\u2192")} ${i}`);console.log();return}d.success(`Converted agent: ${l.primary(t)}`),console.log();for(let i of s.created){let n=i.replace(process.cwd(),".");console.log(` ${l.success("+")} ${n}`)}console.log(),console.log(l.dim(` Agent created at: ${mo()}/${t}.md`)),console.log()}async function SD(t){if(go().length===0){t.json?console.log(JSON.stringify({results:[],summary:{total:0,success:0,skipped:0,failed:0}},null,2)):(console.log(),d.info("No agents found in .claude/agents/"),console.log());return}let s=Ff({force:t.force,dryRun:t.dryRun}),i=Hl(s);if(t.json){console.log(JSON.stringify({results:s,summary:i},null,2));return}console.log(),t.dryRun?console.log(p.default.bold(l.geminiPurple("[DRY RUN] Agent Conversion Preview"))):console.log(p.default.bold(l.geminiPurple("Agent Conversion Results"))),console.log(T.line()),console.log();for(let n of s)if(n.errors.length>0){console.log(` ${l.error("\u2717")} ${n.skill}`);for(let o of n.errors)console.log(` ${l.dim(o)}`)}else if(n.skipped.length>0)console.log(` ${l.dim("\u25CB")} ${n.skill} ${l.dim("(skipped)")}`);else if(n.success){let o=t.dryRun?l.dim("\u2192"):l.success("\u2713");console.log(` ${o} ${n.skill}`)}console.log(),console.log(T.line()),console.log(),t.dryRun?(console.log(` ${l.dim("Would convert:")} ${i.success} agents`),console.log(` ${l.dim("Would skip:")} ${i.skipped} agents`),console.log(` ${l.dim("Would fail:")} ${i.failed} agents`)):(console.log(` ${l.success("Converted:")} ${i.success}`),console.log(` ${l.dim("Skipped:")} ${i.skipped}`),console.log(` ${l.error("Failed:")} ${i.failed}`)),console.log(),i.skipped>0&&!t.force&&(d.info("Use --force to overwrite existing agents"),console.log())}function Cf(t){Dc(t),Ec(t),Fc(t),yc(t),Cc(t),Sc(t),wc(t),jc(t),sf(t),rf(t),uf(t),cf(t),ff(t),df(t),yf(t)}var Jt=ea("gk");Jt.version("0.1.0");Jt.help();Jt.option("--verbose","Enable verbose output");Jt.option("--json","Output as JSON");var Sf=Jt.parse(process.argv,{run:!1});Sf.options.verbose&&qn({level:"debug",verbose:!0});Sf.options.json&&qn({json:!0});Cf(Jt);Jt.parse();
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "gemkit-cli",
3
+ "version": "0.1.0",
4
+ "description": "CLI for working with Gemini AI agents, plans, and sessions",
5
+ "type": "module",
6
+ "author": "Richard Ng <the.richardng.ai@gmail.com>",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/therichardngai-code/gemkit-cli.git"
11
+ },
12
+ "homepage": "https://gemkit.cc",
13
+ "bugs": {
14
+ "url": "https://github.com/therichardngai-code/gemkit-cli/issues"
15
+ },
16
+ "keywords": ["cli", "gemkit", "gemini", "ai"],
17
+ "main": "dist/index.js",
18
+ "bin": {
19
+ "gk": "dist/index.js"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --minify --outfile=dist/index.js",
26
+ "build:dev": "tsc",
27
+ "typecheck": "tsc --noEmit",
28
+ "dev": "tsc --watch",
29
+ "start": "node dist/index.js"
30
+ },
31
+ "dependencies": {
32
+ "cac": "^6.7.14",
33
+ "dotenv": "^16.3.1",
34
+ "ora": "^8.0.1",
35
+ "picocolors": "^1.1.1",
36
+ "tar": "^7.5.2"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^20.10.0",
40
+ "@types/tar": "^6.1.13",
41
+ "esbuild": "^0.27.2",
42
+ "typescript": "^5.3.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=18"
46
+ }
47
+ }