@guanghechen/kit-copilot 0.6.8 → 0.6.10
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-DLiH1pI3.mjs +1 -0
- package/lib/esm/index.mjs +1 -1
- package/package.json +3 -3
- package/lib/esm/command-DIvNFckg.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(_0xd578af,_0x3a1eb0){const _0x255f9e={_0x2235bb:'4K2Y',_0x40aebe:0x4c4,_0x48d3f5:0x4d0,_0x1625b8:0x50b,_0x30dae0:0x50a,_0x26b355:'x[ZA',_0x18fa1d:0x4e3,_0x4fba81:0x4e2,_0x203e72:0x4df,_0x42e1c3:'sU)L',_0x5f47d2:0x4f0,_0x35ee43:0x4da,_0x3cf0de:0x4fd,_0x689c97:'U$$f',_0x58c1d9:0x4ec,_0x384d56:0x503,_0x2aaa51:'fSBH',_0x31df87:0x504,_0x37ff34:0x4db,_0x11ef20:0x4e6,_0x388b8d:0x4bc,_0x54bd06:'4K2Y',_0x44063b:0x4cf,_0x23dcd9:0x4e4,_0x3d95c0:0x4f6,_0x1f66c9:'xQ[i',_0x11c802:0x4ef,_0x966d2d:'ep9I',_0x518583:0x4f7},_0x10c574={_0x1d6f2b:0x374},_0x1c98b8={_0xf67466:0x393};function _0x448a53(_0x105d98,_0x54a5e7,_0x3f1c4f,_0x12b293){return _0x4d72(_0x12b293-_0x1c98b8._0xf67466,_0x3f1c4f);}const _0x2629fb=_0xd578af();function _0x17707a(_0x6ab23d,_0x1d9b96,_0x59d9d4,_0x370680){return _0x4d72(_0x370680-_0x10c574._0x1d6f2b,_0x1d9b96);}while(!![]){try{const _0x398aea=-parseInt(_0x17707a(0x4d9,_0x255f9e._0x2235bb,_0x255f9e._0x40aebe,_0x255f9e._0x48d3f5))/(0xb8a+-0xa88+-0x101)+parseInt(_0x448a53(0x51a,_0x255f9e._0x1625b8,'QAe8',_0x255f9e._0x30dae0))/(0x23de+0x2309*0x1+-0x46e5)*(-parseInt(_0x17707a(0x4e3,_0x255f9e._0x26b355,0x4ce,_0x255f9e._0x18fa1d))/(0xfbd*0x2+0x53*0x43+-0x3530))+-parseInt(_0x448a53(_0x255f9e._0x4fba81,_0x255f9e._0x203e72,_0x255f9e._0x42e1c3,_0x255f9e._0x5f47d2))/(-0x559+-0x833*-0x1+-0xb*0x42)*(parseInt(_0x448a53(_0x255f9e._0x35ee43,_0x255f9e._0x3cf0de,_0x255f9e._0x689c97,_0x255f9e._0x58c1d9))/(-0x19e2+0xfef+0x9f8))+parseInt(_0x448a53(0x4f0,_0x255f9e._0x384d56,_0x255f9e._0x2aaa51,_0x255f9e._0x31df87))/(0x1a0c+-0x29*0x2f+-0x127f)*(parseInt(_0x17707a(0x4d7,'RyvR',_0x255f9e._0x37ff34,_0x255f9e._0x11ef20))/(0xfd4*-0x1+-0x169*0xd+0x2230))+-parseInt(_0x17707a(_0x255f9e._0x388b8d,_0x255f9e._0x54bd06,0x4d9,_0x255f9e._0x44063b))/(-0x2356+0x122a+0x1134)+parseInt(_0x448a53(_0x255f9e._0x23dcd9,_0x255f9e._0x3d95c0,_0x255f9e._0x1f66c9,0x4e2))/(0x2*-0x12d6+-0x2*-0x102b+-0x7d*-0xb)+parseInt(_0x448a53(_0x255f9e._0x11c802,0x50a,_0x255f9e._0x966d2d,_0x255f9e._0x518583))/(-0xc7*-0x1+-0x2586*-0x1+0x5*-0x7a7);if(_0x398aea===_0x3a1eb0)break;else _0x2629fb['push'](_0x2629fb['shift']());}catch(_0x5c46c6){_0x2629fb['push'](_0x2629fb['shift']());}}}(_0x5d86,0x1016e+0x38b3a+0xb8*-0xb9));import{CompletionCommand}from'@guanghechen/commander/node';import{Reporter}from'@guanghechen/reporter';function _0xa89d2f(_0x1f313b,_0x11f6e0,_0x26d8d7,_0x3e7800){const _0x1c6be3={_0x53598b:0xdb};return _0x4d72(_0x26d8d7- -_0x1c6be3._0x53598b,_0x3e7800);}import{a as _0x384cb6,C as _0x1a377b}from'./command-DLiH1pI3.mjs';import'node:fs';import'node:path';function _0x4d72(_0x30a323,_0x5d7ca4){_0x30a323=_0x30a323-(0x443*-0x5+-0x1feb*0x1+-0x25f*-0x17);const _0x45415a=_0x5d86();let _0x404279=_0x45415a[_0x30a323];if(_0x4d72['iRIDgo']===undefined){var _0x4b7cc2=function(_0x44a6e6){const _0x44edfb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2dd200='',_0x3fc6f6='';for(let _0x46ca4b=0xb99*-0x3+-0x88a+0x2b55*0x1,_0xd578af,_0x3a1eb0,_0x2629fb=0x16*0x17+-0x1f83+0x1d89*0x1;_0x3a1eb0=_0x44a6e6['charAt'](_0x2629fb++);~_0x3a1eb0&&(_0xd578af=_0x46ca4b%(0x6*-0x12b+0x692+-0x2*-0x3a)?_0xd578af*(0x5ba*0x4+-0x48b*-0x6+-0x31ea*0x1)+_0x3a1eb0:_0x3a1eb0,_0x46ca4b++%(-0xe01+-0x14b*-0x5+0x78e))?_0x2dd200+=String['fromCharCode'](0x70e+-0x8cc*0x2+0x1*0xb89&_0xd578af>>(-(-0x18d1+-0x701+-0xe*-0x246)*_0x46ca4b&0x1*0x9+-0xca0*0x1+0xc9d*0x1)):-0x13e+-0x5f9+0x737){_0x3a1eb0=_0x44edfb['indexOf'](_0x3a1eb0);}for(let _0x398aea=0x202*-0x8+-0x103e+0x2*0x1027,_0x5c46c6=_0x2dd200['length'];_0x398aea<_0x5c46c6;_0x398aea++){_0x3fc6f6+='%'+('00'+_0x2dd200['charCodeAt'](_0x398aea)['toString'](0x4*-0x7c9+-0xddd*-0x2+-0x2*-0x1bd))['slice'](-(-0x1*-0x36d+0xfc2+-0x132d));}return decodeURIComponent(_0x3fc6f6);};const _0x35a30e=function(_0x43fbac,_0x408c9e){let _0x44580c=[],_0x38c01f=0x89a+-0x9a4+0x7*0x26,_0x1ec8f6,_0x42c15d='';_0x43fbac=_0x4b7cc2(_0x43fbac);let _0x592516;for(_0x592516=0xc0*-0x1d+0x1*-0x22f7+0x1*0x38b7;_0x592516<-0x17fe+-0x1*0xb9e+-0x42*-0x8e;_0x592516++){_0x44580c[_0x592516]=_0x592516;}for(_0x592516=-0x142e+-0x115b+-0x3*-0xc83;_0x592516<0xc11*-0x1+0x793*-0x5+0x28*0x146;_0x592516++){_0x38c01f=(_0x38c01f+_0x44580c[_0x592516]+_0x408c9e['charCodeAt'](_0x592516%_0x408c9e['length']))%(-0x7*-0x1b6+-0x1b1+-0x949),_0x1ec8f6=_0x44580c[_0x592516],_0x44580c[_0x592516]=_0x44580c[_0x38c01f],_0x44580c[_0x38c01f]=_0x1ec8f6;}_0x592516=-0x13d9*0x1+0x11ef*0x2+-0x1005,_0x38c01f=0xfbd*0x2+0x53*0x43+-0x3533;for(let _0x1f7d0e=-0x559+-0x833*-0x1+-0xa*0x49;_0x1f7d0e<_0x43fbac['length'];_0x1f7d0e++){_0x592516=(_0x592516+(-0x19e2+0xfef+0x9f4))%(0x1a0c+-0x29*0x2f+-0x1185),_0x38c01f=(_0x38c01f+_0x44580c[_0x592516])%(0xfd4*-0x1+-0x169*0xd+0x2329),_0x1ec8f6=_0x44580c[_0x592516],_0x44580c[_0x592516]=_0x44580c[_0x38c01f],_0x44580c[_0x38c01f]=_0x1ec8f6,_0x42c15d+=String['fromCharCode'](_0x43fbac['charCodeAt'](_0x1f7d0e)^_0x44580c[(_0x44580c[_0x592516]+_0x44580c[_0x38c01f])%(-0x2356+0x122a+0x122c)]);}return _0x42c15d;};_0x4d72['lZdZYT']=_0x35a30e,_0x4d72['eIcBDE']={},_0x4d72['iRIDgo']=!![];}const _0x19d6cc=_0x45415a[0x2*-0x12d6+-0x2*-0x102b+-0x2ab*-0x2],_0x5cefae=_0x30a323+_0x19d6cc,_0x405534=_0x4d72['eIcBDE'][_0x5cefae];return!_0x405534?(_0x4d72['qjqfIH']===undefined&&(_0x4d72['qjqfIH']=!![]),_0x404279=_0x4d72['lZdZYT'](_0x404279,_0x5d7ca4),_0x4d72['eIcBDE'][_0x5cefae]=_0x404279):_0x404279=_0x405534,_0x404279;}import'node:child_process';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';function _0x469bb9(_0x14100c,_0x5d3ceb,_0x29330c,_0x42e904){return _0x4d72(_0x5d3ceb- -0x3d2,_0x14100c);}import'node:module';import'node:worker_threads';import'node:crypto';const _0xac659b={};_0xac659b[_0xa89d2f(0x80,0x95,0x8d,'C4yU')+'x']=_0x384cb6;const _0x375322=new Reporter(_0xac659b),_0xadaec7=new _0x1a377b(),_0x5d9806={};function _0x5d86(){const _0x34e249=['ACkZW5LDWRiRWQJdKaZcTmoCcG','WRNdTSomzYe','jxH7W4DkWRnsW7DbW7q','uGJdJtZcGgldUbjwWRu','cglcPSk+WRu','CcfFEw8','WRqRlHFcLa','umoUWQVcOmoi','zcO6DSoMbLu','v3/dHWiT','f8kUW7ldSCoYmZL1WPrm','cfRcKwNdPq','hHlcThVcQmohAmooW5OPAmov','eSkPW73dSSkBDNLoWQ1VhmkjW5G','mColkhpdUW','qCkEW6ldLmoz','lvOFWPFdJXVcTq','vwFcT8oS','ldjy','dqddS2xdVa','fq1evmkvhN3dKG','cSkied7dOa','W6hcKhxdQ8ofWOZdRCkVW6tdMmoOBfa','W6NcL3xdQmolW4RcQSkfW7VdTmox','WRDPWQKlW4ldUmoRyYGBW6n2','WQOQW7y','cmosxCkpda','W4pdUSkNsCo1','WPXMw8oauG','CSkpBrBdVG','WQldPXHtWRK','j8k9WPSsyXqwy8krhSotWQldSa','WPqxldq','xCkqW4jU','tYpdVmoVWOS3w8kOecC','WQTnlGRcMq','fL3cJgBcUq','W5ldGamDpq','WRzQWQydW4ldUSoPCJWZW7DZ','dIBcK14dW4nsW4FcHg8','iGamtdC','jGycvq'];_0x5d86=function(){return _0x34e249;};return _0x5d86();}_0x5d9806['progr'+'amNam'+'e']=_0x384cb6,_0x5d9806[_0x469bb9('nHGo',-0x278,-0x264,-0x283)]={},_0x5d9806[_0x469bb9('nHGo',-0x278,-0x264,-0x283)]['bash']=_0x469bb9('uWMg',-0x27e,-0x27f,-0x28c)+_0x469bb9('RyvR',-0x282,-0x273,-0x28a)+_0xa89d2f(0x80,0x85,0x95,'41mz')+_0xa89d2f(0x82,0x73,0x88,'Qs8m')+'etion'+'s/'+_0x384cb6+_0x469bb9('sU)L',-0x274,-0x280,-0x285),_0x5d9806[_0x469bb9('nHGo',-0x278,-0x264,-0x283)][_0x469bb9('!b3x',-0x26d,-0x26b,-0x261)]='~/.co'+_0xa89d2f(0xa4,0x90,0x9a,'sV[#')+'fish/'+'compl'+'etion'+'s/'+_0x384cb6+_0x469bb9('dbTq',-0x25e,-0x273,-0x264),_0x5d9806[_0x469bb9('nHGo',-0x278,-0x264,-0x283)][_0x469bb9('*37k',-0x26c,-0x263,-0x271)]=_0xa89d2f(0x7d,0x81,0x84,'yr@f')+_0x469bb9('Nf#R',-0x271,-0x25c,-0x275)+'pwsh/'+_0xa89d2f(0x85,0x83,0x85,'d8UQ')+_0x469bb9('Ad5W',-0x265,-0x268,-0x269)+'s/'+_0x384cb6+_0x469bb9('AIbz',-0x27c,-0x270,-0x26a),_0xadaec7[_0x469bb9('AIbz',-0x25f,-0x268,-0x266)+_0x469bb9('6Xbi',-0x25a,-0x26b,-0x265)](_0x469bb9('9YM%',-0x27a,-0x27d,-0x26c)+'etion',new CompletionCommand(_0xadaec7,_0x5d9806));try{await _0xadaec7[_0xa89d2f(0x67,0x6c,0x7c,'dbTq')]({'argv':process[_0x469bb9('Ad5W',-0x264,-0x258,-0x272)][_0x469bb9('qR2X',-0x27f,-0x27b,-0x27e)](0x6*0x48b+0x175f+-0x329f*0x1),'envs':process.env,'reporter':_0x375322});}catch(_0x37fdc8){_0x375322['error'](_0x37fdc8 instanceof Error?_0x37fdc8[_0x469bb9('xQ[i',-0x25c,-0x24d,-0x253)]??_0x37fdc8[_0x469bb9('IT]2',-0x270,-0x272,-0x27a)+'ge']:String(_0x37fdc8)),process['exitC'+'ode']=-0xe01+-0x14b*-0x5+0x78b;}
|