@guanghechen/kit-copilot 0.6.9 → 0.6.11
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/README.md +23 -6
- package/lib/esm/cli.mjs +1 -1
- package/lib/esm/command-DF8UKSzn.mjs +1 -0
- package/lib/esm/index.mjs +1 -1
- package/package.json +3 -3
- package/lib/esm/command-DJUrs5rc.mjs +0 -1
package/README.md
CHANGED
|
@@ -15,26 +15,43 @@ There is no runtime fallback from business logic to global `process.env` for cri
|
|
|
15
15
|
- `GH_PRIMARY_TOKEN`
|
|
16
16
|
- `COPILOT_MODEL_REFRESH_SEC`
|
|
17
17
|
|
|
18
|
-
## Preset
|
|
18
|
+
## Preset File (`preset.json`)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Config root:
|
|
21
21
|
|
|
22
22
|
- `$XDG_CONFIG_HOME/kit/copilot` when `XDG_CONFIG_HOME` is set
|
|
23
23
|
- `~/.config/kit/copilot` otherwise
|
|
24
24
|
|
|
25
|
-
Default preset
|
|
25
|
+
Default preset file:
|
|
26
26
|
|
|
27
|
-
- `<
|
|
27
|
+
- `<config-root>/preset.json`
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Commander loads preset data from `preset.json` (`preset.file`) and merges selected profile into `ctx.envs`.
|
|
30
|
+
If `<config-root>/preset.json` does not exist, command runs without preset envs.
|
|
31
|
+
|
|
32
|
+
Example `preset.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"version": 1,
|
|
37
|
+
"defaults": { "profile": "default" },
|
|
38
|
+
"profiles": {
|
|
39
|
+
"default": {
|
|
40
|
+
"envFile": ".env.local"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
30
45
|
|
|
31
46
|
## Token Persistence
|
|
32
47
|
|
|
33
48
|
`kit-copilot auth` persists `GH_PRIMARY_TOKEN` to preset env storage.
|
|
34
49
|
|
|
35
|
-
- Persist target: `<
|
|
50
|
+
- Persist target: `<config-root>/.env.local`
|
|
36
51
|
- `GH_COPILOT_TOKEN` is not persisted
|
|
37
52
|
|
|
53
|
+
Note: `.env.local` is not auto-loaded by commander unless `preset.json` profile points to it (for example via `envFile`).
|
|
54
|
+
|
|
38
55
|
## Examples
|
|
39
56
|
|
|
40
57
|
```bash
|
package/lib/esm/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(function(
|
|
2
|
+
(function(_0x2b15a4,_0x33e30b){const _0x47c9b4={_0x2607fc:'clc!',_0x53e8b6:0x71,_0x4a20ce:0x70,_0x21da19:'8NEn',_0x283a64:0x70,_0x2560ed:0x83,_0x13f033:0x6c,_0x5bb45b:'84I!',_0x1e99ad:0x6a,_0x3b4920:0x6e,_0x3827b1:0x69,_0x4f34e6:0x7e,_0x40ae72:'Xru%',_0x452422:'ZESh',_0x5dba3a:0x56,_0x2dcb46:0x5c,_0x425842:0x53,_0x51a456:')8%n',_0x308177:0x67,_0x336869:0x7a,_0x15865e:0x42,_0x2c0f9e:'c]L4',_0x1bff97:0x67,_0x3248db:0x84,_0x37cd79:0x76,_0xfa129:0x43,_0x374fbf:0x56,_0x296800:0x5e,_0x5a4a8c:0x45,_0x8fc953:0x5c,_0x1ab442:']yph'},_0x4125f8={_0x23ec2c:0x12c},_0x287538=_0x2b15a4();function _0x39246b(_0x479ef4,_0x225126,_0x85b945,_0x24ec68){return _0x2ff3(_0x24ec68- -_0x4125f8._0x23ec2c,_0x479ef4);}function _0x3f1226(_0xc8ebd6,_0x90e437,_0x38973d,_0x411b8d){return _0x2ff3(_0x90e437- -0x123,_0x411b8d);}while(!![]){try{const _0x191354=parseInt(_0x39246b(_0x47c9b4._0x2607fc,-0x7c,-_0x47c9b4._0x53e8b6,-_0x47c9b4._0x4a20ce))/(0x77b+0xa8e+-0x4*0x482)+-parseInt(_0x39246b(_0x47c9b4._0x21da19,-_0x47c9b4._0x283a64,-_0x47c9b4._0x2560ed,-_0x47c9b4._0x13f033))/(0x2*-0x14f+-0x2269+0x2509)*(-parseInt(_0x39246b(_0x47c9b4._0x5bb45b,-0x71,-_0x47c9b4._0x1e99ad,-_0x47c9b4._0x3b4920))/(0x4d*-0x59+0x3*0xaf3+-0x611*0x1))+parseInt(_0x3f1226(-0x76,-_0x47c9b4._0x3827b1,-_0x47c9b4._0x4f34e6,_0x47c9b4._0x40ae72))/(0xea9+0x1f3*0x12+0x31bb*-0x1)*(-parseInt(_0x39246b(_0x47c9b4._0x452422,-_0x47c9b4._0x5dba3a,-_0x47c9b4._0x2dcb46,-_0x47c9b4._0x425842))/(0x262e+-0x22d*0x6+-0x191b))+-parseInt(_0x39246b(_0x47c9b4._0x51a456,-0x6f,-_0x47c9b4._0x308177,-_0x47c9b4._0x336869))/(0x11e7+0x1*0xf59+-0x2*0x109d)*(parseInt(_0x39246b('1!%i',-_0x47c9b4._0x15865e,-0x58,-_0x47c9b4._0x5dba3a))/(-0xe4c+0x9*0x1b7+-0x11c))+-parseInt(_0x39246b(_0x47c9b4._0x2c0f9e,-_0x47c9b4._0x1bff97,-_0x47c9b4._0x3248db,-_0x47c9b4._0x37cd79))/(-0x1f*-0x15+-0x1ca*-0x8+-0x3b*0x49)+-parseInt(_0x3f1226(-_0x47c9b4._0xfa129,-_0x47c9b4._0x374fbf,-_0x47c9b4._0x296800,'uOLk'))/(-0x10*0x1a5+0x1*0x1f49+0x8*-0x9e)+parseInt(_0x3f1226(-_0x47c9b4._0x5a4a8c,-0x5b,-_0x47c9b4._0x8fc953,_0x47c9b4._0x1ab442))/(0x1dad+0x1393+-0x3136);if(_0x191354===_0x33e30b)break;else _0x287538['push'](_0x287538['shift']());}catch(_0x488b31){_0x287538['push'](_0x287538['shift']());}}}(_0x2ec4,-0x880ef+0xea249+0x46aa8));import{CompletionCommand}from'@guanghechen/commander/node';import{Reporter}from'@guanghechen/reporter';import{a as _0x56db25,C as _0x5e3adc}from'./command-DF8UKSzn.mjs';import'node:fs';function _0x2ec4(){const _0x577634=['W4GiW4/dKSoF','e8k1WQpdPCoG','WQlcJmkyW5PuW4pdVCkMW7D6zmk7wq','FxzPWP4X','BCk2q1/cKdrAW65+WOlcTCoiW6C','ACklW7q+fG','WQ9CeqDC','WQFcM8oXW7dcPa','qSohWRJdMNC','WQDtcWG','hmo2jmobdG','W6qhW48juKykBmkgWRNdRSoX','B8kCW7a6oq','W73dJ8k2WQdcUSoQeHC9W4BcG8kTiG','ASk1qf7cKtPFW6HGWPNcVmoKW6y','wtanxmoEWQiLgmkMWOWdWRdcOG','hCo9WOvIW5Lct8oUwx8CeSoe','jSkzk8k7WPC','WPRcR8opWPpcMG','WQpcL1ldSCkNj8oPWQOYWRCCW5tcNW','a0zCW5WMW5JdHW','xCk7W5W','jCkQwatdIa','W5hdKI0c','bmkBWRVdJYCqWRu','kXrdW7Cv','W7tdLGdcVW','W47dVv0zWRj9WRG','WRldPSoKm0tcSfSnWQpcHqddR1m','nH5dW7nF','pCoSbq/cIa','WPNcRCoEWPJdMG','nmkGW5eTmmkwca','W5hdHdDaW78','WQhcJ8kDW59qW43cN8kGW5TfrCkx','n8oCW78H','W79qW4RdMJVcKSkQ','WR/dOSoLnuBcSLTRWRBcLdJdS1uU','AuGCWQ1gW5pcLrpcRmkiW5ZcNSku','WOdcSCoS','WPhcHHujza','rSouEa','WO3dGCork3S','k8o3eWhdJG','nSolWPJcN8oS','WQRdLCk2W74','sSoHW6lcP8k2W48lp8k9DmkVjmkrfW'];_0x2ec4=function(){return _0x577634;};return _0x2ec4();}import'node:path';import'node:child_process';function _0x39ec1a(_0x5db673,_0x64da0c,_0xdb1cb9,_0x2f770e){const _0x34b4bd={_0x45e1b:0xcd};return _0x2ff3(_0x2f770e-_0x34b4bd._0x45e1b,_0x64da0c);}import'node:os';import'node:http';import'node:fs/promises';import'@hono/node-server';import'hono';import'hono/cors';import'uuid';import'zod';import'hono/streaming';import'node:url';import'node:module';import'node:worker_threads';import'node:crypto';const _0x4e611b={};_0x4e611b[_0x171b85('uOLk',-0x73,-0x7e,-0x7c)+'x']=_0x56db25;const _0x5b0248=new Reporter(_0x4e611b),_0x16538a=new _0x5e3adc(),_0x19bcb3={};function _0x171b85(_0x4fbaa8,_0x218126,_0xe31d7c,_0x5ca1c7){const _0x2e9bef={_0x159dab:0x138};return _0x2ff3(_0x218126- -_0x2e9bef._0x159dab,_0x4fbaa8);}function _0x2ff3(_0x32ca90,_0x4127b0){_0x32ca90=_0x32ca90-(0x3e2+0x43*-0x4d+0x10f1);const _0x458129=_0x2ec4();let _0x17016b=_0x458129[_0x32ca90];if(_0x2ff3['xKPDUK']===undefined){var _0x328520=function(_0x55ded5){const _0x356102='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x18b64f='',_0x327218='';for(let _0x41c9a2=0x1f0*-0xf+-0xb69+0x2879,_0x494557,_0x3e9196,_0x53e83a=-0xdf4+0x2536+0x1ca*-0xd;_0x3e9196=_0x55ded5['charAt'](_0x53e83a++);~_0x3e9196&&(_0x494557=_0x41c9a2%(-0x152e+-0x59*-0x6e+0x4*-0x443)?_0x494557*(-0x2420+0x67a*0x1+-0x59*-0x56)+_0x3e9196:_0x3e9196,_0x41c9a2++%(-0x16*0x147+0x130*0x8+0x1*0x129e))?_0x18b64f+=String['fromCharCode'](-0x254a+0xe56*0x1+0x17f3*0x1&_0x494557>>(-(0x1c*-0xbe+0x4*-0x47f+0x26c6)*_0x41c9a2&-0x2282+-0x21b1+-0x4439*-0x1)):-0x11*-0xaa+0x4d2+-0x101c){_0x3e9196=_0x356102['indexOf'](_0x3e9196);}for(let _0x4793e2=-0x1223+-0x5*-0x52f+-0x7c8,_0x20e380=_0x18b64f['length'];_0x4793e2<_0x20e380;_0x4793e2++){_0x327218+='%'+('00'+_0x18b64f['charCodeAt'](_0x4793e2)['toString'](-0x2448+0x16cf*-0x1+0x3b27))['slice'](-(0x15d7*0x1+-0x591+-0x1044));}return decodeURIComponent(_0x327218);};const _0xf9301c=function(_0x1bfe21,_0x221bc4){let _0x1c77ac=[],_0x50c414=-0x1c4*-0x6+0x1c51+0x58f*-0x7,_0x2ac960,_0x11885a='';_0x1bfe21=_0x328520(_0x1bfe21);let _0x20d39b;for(_0x20d39b=0x15c*-0x8+0x1106*-0x1+0x1*0x1be6;_0x20d39b<-0x826+-0x7*-0x1d+-0x17*-0x5d;_0x20d39b++){_0x1c77ac[_0x20d39b]=_0x20d39b;}for(_0x20d39b=-0x1c17+-0xa*0x21f+0x314d;_0x20d39b<0xb68+0x22dc+-0x2d44;_0x20d39b++){_0x50c414=(_0x50c414+_0x1c77ac[_0x20d39b]+_0x221bc4['charCodeAt'](_0x20d39b%_0x221bc4['length']))%(0x12b3*0x2+0x17f8+-0x3c5e),_0x2ac960=_0x1c77ac[_0x20d39b],_0x1c77ac[_0x20d39b]=_0x1c77ac[_0x50c414],_0x1c77ac[_0x50c414]=_0x2ac960;}_0x20d39b=-0x104e+0x1*0x5ed+-0x1*-0xa61,_0x50c414=-0x9c3+0x22a9+-0x18e6;for(let _0x2b15a4=0x2550+0x556+-0x2aa6;_0x2b15a4<_0x1bfe21['length'];_0x2b15a4++){_0x20d39b=(_0x20d39b+(0xaf3*0x3+0x851*0x2+-0x317a))%(0xea9+0x1f3*0x12+0x30bf*-0x1),_0x50c414=(_0x50c414+_0x1c77ac[_0x20d39b])%(0x262e+-0x22d*0x6+-0x1820),_0x2ac960=_0x1c77ac[_0x20d39b],_0x1c77ac[_0x20d39b]=_0x1c77ac[_0x50c414],_0x1c77ac[_0x50c414]=_0x2ac960,_0x11885a+=String['fromCharCode'](_0x1bfe21['charCodeAt'](_0x2b15a4)^_0x1c77ac[(_0x1c77ac[_0x20d39b]+_0x1c77ac[_0x50c414])%(0x11e7+0x1*0xf59+-0x40*0x81)]);}return _0x11885a;};_0x2ff3['sedKIH']=_0xf9301c,_0x2ff3['gvmLxL']={},_0x2ff3['xKPDUK']=!![];}const _0x109f43=_0x458129[-0xe4c+0x9*0x1b7+-0x123],_0x52dd11=_0x32ca90+_0x109f43,_0x20072f=_0x2ff3['gvmLxL'][_0x52dd11];return!_0x20072f?(_0x2ff3['ruBBxe']===undefined&&(_0x2ff3['ruBBxe']=!![]),_0x17016b=_0x2ff3['sedKIH'](_0x17016b,_0x4127b0),_0x2ff3['gvmLxL'][_0x52dd11]=_0x17016b):_0x17016b=_0x20072f,_0x17016b;}_0x19bcb3[_0x171b85('dPiR',-0x74,-0x6a,-0x89)+'amNam'+'e']=_0x56db25,_0x19bcb3[_0x39ec1a(0x17d,'m7Nw',0x17b,0x18f)]={},_0x19bcb3[_0x39ec1a(0x17d,'m7Nw',0x17b,0x18f)][_0x171b85('$aGc',-0x7b,-0x66,-0x8e)]='~/.co'+_0x39ec1a(0x1a7,'&fXn',0x1a6,0x19c)+_0x39ec1a(0x18f,'1!%i',0x19b,0x19d)+'compl'+_0x171b85('tzar',-0x67,-0x72,-0x75)+'s/'+_0x56db25+_0x39ec1a(0x1a2,'eLC#',0x1a7,0x190),_0x19bcb3[_0x39ec1a(0x17d,'m7Nw',0x17b,0x18f)][_0x171b85('&fXn',-0x66,-0x70,-0x66)]=_0x171b85('uOLk',-0x88,-0x78,-0x83)+_0x171b85('&fXn',-0x69,-0x5e,-0x67)+_0x39ec1a(0x191,'uOLk',0x173,0x185)+_0x171b85('USM%',-0x65,-0x7b,-0x65)+'etion'+'s/'+_0x56db25+_0x39ec1a(0x174,'FB%K',0x176,0x188),_0x19bcb3[_0x39ec1a(0x17d,'m7Nw',0x17b,0x18f)][_0x171b85('N1]1',-0x71,-0x78,-0x88)]=_0x39ec1a(0x1a5,'yDeM',0x196,0x1a7)+_0x171b85('8NEn',-0x81,-0x7b,-0x6e)+_0x39ec1a(0x184,'$no1',0x193,0x186)+'compl'+'etion'+'s/'+_0x56db25+_0x39ec1a(0x193,'FB%K',0x18c,0x17e),_0x16538a[_0x171b85('$no1',-0x8c,-0x98,-0x80)+'mmand'](_0x39ec1a(0x18e,'Xru%',0x18c,0x1a2)+_0x39ec1a(0x184,'E[jD',0x19a,0x199),new CompletionCommand(_0x16538a,_0x19bcb3));try{await _0x16538a[_0x171b85('ZESh',-0x89,-0x8a,-0x7a)]({'argv':process[_0x39ec1a(0x170,'s4Q#',0x18a,0x181)][_0x39ec1a(0x17f,'8NEn',0x187,0x180)](0x19ee+0x3*-0x69d+-0x615),'envs':process.env,'reporter':_0x5b0248});}catch(_0x37d4ad){_0x5b0248['error'](_0x37d4ad instanceof Error?_0x37d4ad[_0x39ec1a(0x181,'J&aO',0x19b,0x196)]??_0x37d4ad[_0x39ec1a(0x191,']yph',0x183,0x197)+'ge']:String(_0x37d4ad)),process[_0x39ec1a(0x18d,'Xru%',0x184,0x19b)+_0x39ec1a(0x17d,'TxgF',0x193,0x18e)]=0x1*0x180b+0x1f6a+-0xb6*0x4e;}
|