@guanghechen/kit-copilot 0.6.18 → 0.7.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/README.md +44 -1
- package/lib/esm/cli.mjs +1 -1
- package/lib/esm/command-DfmDRc-y.mjs +1 -0
- package/lib/esm/index.mjs +1 -1
- package/package.json +9 -9
- package/lib/esm/command-Cg8K-uGX.mjs +0 -1
package/README.md
CHANGED
|
@@ -76,21 +76,49 @@ COPILOT_OPENAI_BETA_ALLOWLIST=responses_websockets=2026-02-06
|
|
|
76
76
|
|
|
77
77
|
`kit-copilot` supports Codex Realtime voice input via WebSocket handoff events.
|
|
78
78
|
|
|
79
|
+
Codex must use websocket realtime transport for local STT. The default WebRTC transport is not
|
|
80
|
+
implemented by `kit-copilot` because WebRTC requires SDP negotiation and a media channel in addition
|
|
81
|
+
to STT. Configure Codex with:
|
|
82
|
+
|
|
83
|
+
```toml
|
|
84
|
+
[realtime]
|
|
85
|
+
transport = "websocket"
|
|
86
|
+
version = "v2"
|
|
87
|
+
type = "conversational"
|
|
88
|
+
```
|
|
89
|
+
|
|
79
90
|
Supported WS paths:
|
|
80
91
|
|
|
81
92
|
- `/api/codex`
|
|
82
93
|
- `/api/codex/realtime`
|
|
83
94
|
- `/api/codex/v1/realtime`
|
|
84
95
|
|
|
96
|
+
`POST /api/codex/realtime/calls` returns `501 realtime_webrtc_unsupported` with the same websocket
|
|
97
|
+
transport guidance.
|
|
98
|
+
|
|
85
99
|
Path matching is exact by design:
|
|
86
100
|
|
|
87
101
|
- Trailing slash variants like `/api/codex/` and `/api/codex/realtime/` are rejected.
|
|
88
102
|
|
|
89
|
-
STT
|
|
103
|
+
STT selector envs:
|
|
104
|
+
|
|
105
|
+
- `KIT_COPILOT_REALTIME_STT_PROVIDER` (optional, default: `aoai`)
|
|
106
|
+
- `KIT_COPILOT_REALTIME_STT_MODEL` (optional, default: `whisper`)
|
|
107
|
+
- `KIT_COPILOT_REALTIME_STT_LANGUAGE` (optional, BCP-47 language tag)
|
|
108
|
+
|
|
109
|
+
Azure STT runtime envs:
|
|
90
110
|
|
|
91
111
|
- `KIT_STT_AZURE_API_KEY`
|
|
92
112
|
- `KIT_STT_AZURE_API_ENDPOINT`
|
|
93
113
|
|
|
114
|
+
Local whisper.cpp STT runtime envs:
|
|
115
|
+
|
|
116
|
+
- `KIT_STT_LOCAL_WHISPER_BIN`
|
|
117
|
+
- `KIT_STT_LOCAL_WHISPER_MODEL`
|
|
118
|
+
- `KIT_STT_LOCAL_WHISPER_THREADS` (optional)
|
|
119
|
+
- `KIT_STT_LOCAL_TMP_DIR` (optional)
|
|
120
|
+
- `KIT_STT_LOCAL_FFMPEG_BIN` (optional)
|
|
121
|
+
|
|
94
122
|
Audio buffering policy:
|
|
95
123
|
|
|
96
124
|
- Flush is triggered by either idle debounce (`600ms`) or max segment duration (`4000ms`).
|
|
@@ -105,3 +133,18 @@ KIT_STT_AZURE_API_ENDPOINT=https://<resource>.openai.azure.com \
|
|
|
105
133
|
OPENAI_BASE_URL=http://127.0.0.1:4141/api/codex \
|
|
106
134
|
codex
|
|
107
135
|
```
|
|
136
|
+
|
|
137
|
+
Local whisper.cpp example:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
KIT_COPILOT_REALTIME_STT_PROVIDER=local \
|
|
141
|
+
KIT_COPILOT_REALTIME_STT_MODEL=whisper-cpp \
|
|
142
|
+
KIT_COPILOT_REALTIME_STT_LANGUAGE=zh-CN \
|
|
143
|
+
KIT_STT_LOCAL_WHISPER_BIN=/path/to/whisper.cpp/build/bin/whisper-cli \
|
|
144
|
+
KIT_STT_LOCAL_WHISPER_MODEL=/path/to/whisper.cpp/models/ggml-large-v3-turbo-q5_0.bin \
|
|
145
|
+
OPENAI_BASE_URL=http://127.0.0.1:4141/api/codex \
|
|
146
|
+
codex
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The Codex config still needs `[realtime].transport = "websocket"`; otherwise Codex will attempt the
|
|
150
|
+
WebRTC call creation path and receive the explicit unsupported response.
|
package/lib/esm/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(function(
|
|
2
|
+
(function(_0x31b40d,_0x471708){const _0x3a9dc6={_0x2062ba:'ceH&',_0x1c4c22:'k1dd',_0x585c51:0x38e,_0x5ce864:0x3a3,_0x25cb41:0xbb,_0x108ad0:0xc9,_0x1889aa:0x391,_0x573889:0x399,_0x3170cb:0x398,_0x3c070d:0x39e,_0x375934:'1ZaN',_0x3de9e1:0x3c1,_0xd24ca4:0x3ad,_0x3df5a8:0xc0,_0x144c07:0xca,_0x2680f5:0xd4,_0xd2489:0x387,_0x42bff0:0x3a4,_0x104078:0x394,_0x40bea5:0xbf,_0x313787:0xcd,_0x56b755:'Z4f7',_0x14bf4f:0xd9,_0x48c689:0xe5,_0x1ba90a:'BhLe',_0x120747:0xdd,_0xcbdad7:0xdf,_0x4e576c:0xe7,_0x367cf8:'btMo'},_0x3bae1a={_0x29e157:0x1f4},_0xdd1ccf={_0x5e3b11:0xde};function _0x42dcd0(_0x332e9e,_0xb3a6ec,_0x8f2501,_0x1a0730){return _0x4272(_0xb3a6ec- -_0xdd1ccf._0x5e3b11,_0x1a0730);}function _0x4bfe65(_0x3b80b0,_0x2b00e9,_0x356ce5,_0x33fc18){return _0x4272(_0x33fc18-_0x3bae1a._0x29e157,_0x2b00e9);}const _0x4b0c82=_0x31b40d();while(!![]){try{const _0x2eff99=-parseInt(_0x4bfe65(0x3ab,_0x3a9dc6._0x2062ba,0x3b2,0x3af))/(0x4*-0xf+-0x1d4f+0x1d8c)+parseInt(_0x4bfe65(0x3b3,_0x3a9dc6._0x1c4c22,_0x3a9dc6._0x585c51,_0x3a9dc6._0x5ce864))/(0x2*0x864+0xc9b*-0x1+-0x42b)*(parseInt(_0x42dcd0(_0x3a9dc6._0x25cb41,_0x3a9dc6._0x108ad0,0xc7,'[rA7'))/(-0x15b4+0x9f*-0x24+0x2c13*0x1))+-parseInt(_0x4bfe65(_0x3a9dc6._0x1889aa,'[rA7',_0x3a9dc6._0x573889,_0x3a9dc6._0x3170cb))/(-0x942+0x24cb*-0x1+0x2e11)+parseInt(_0x4bfe65(_0x3a9dc6._0x3c070d,_0x3a9dc6._0x375934,_0x3a9dc6._0x3de9e1,_0x3a9dc6._0xd24ca4))/(0x74f+-0xd*0x3b+-0x7*0x9d)+-parseInt(_0x42dcd0(_0x3a9dc6._0x3df5a8,_0x3a9dc6._0x144c07,_0x3a9dc6._0x2680f5,'#U5X'))/(-0x2b*-0xe1+-0x1*-0x1b83+-0x2*0x20a4)*(parseInt(_0x4bfe65(_0x3a9dc6._0xd2489,'DVsG',_0x3a9dc6._0x42bff0,_0x3a9dc6._0x104078))/(0x25ea+-0xbbe+-0x1a25))+-parseInt(_0x42dcd0(_0x3a9dc6._0x40bea5,_0x3a9dc6._0x313787,_0x3a9dc6._0x108ad0,_0x3a9dc6._0x56b755))/(0x1468+0x199c+-0x1b*0x1b4)*(parseInt(_0x42dcd0(_0x3a9dc6._0x14bf4f,_0x3a9dc6._0x48c689,0xe2,_0x3a9dc6._0x1ba90a))/(-0x1279*-0x1+0x6c9+-0x1939))+parseInt(_0x42dcd0(_0x3a9dc6._0x120747,_0x3a9dc6._0xcbdad7,_0x3a9dc6._0x4e576c,_0x3a9dc6._0x367cf8))/(0x1d*-0x53+-0xe6+0xa57);if(_0x2eff99===_0x471708)break;else _0x4b0c82['push'](_0x4b0c82['shift']());}catch(_0x144313){_0x4b0c82['push'](_0x4b0c82['shift']());}}}(_0x1365,-0xbd*-0x140b+0x13*0x10159+0x6d5d6*-0x3));function _0x1365(){const _0x1746d5=['jmkPW7ZcL8kA','u8kllZm','W5zap8kCW48','hCkIWPK5','j8ozumkniq','W6DItK5V','CSovz2tdTfepW7TlW6VcU28','WO7cJwm','W51UWPuTWQK','W4jTB0VdP8oYW6hcU8kabmoYsSkd','W6Wkr14','W5vlqmomWRFdNmo/WQWaW40hyW','imkUW4C3WR/dGvW2dq','lmkOh8oaD8kocCk/l8oog0TaW5O','W6yxuCkjW70YfSo2','W4G+WPNcKa','WORdVGKg','W5zwomkCWPm','wH1BWOjGW6yEWPhdHZJdQmoEWO4','zbzfFColje3dTCoBW6W','vmklAmo6W7W','WRaxDd7cGG','WQvpBmkIW6u','dfGeW5q7','j8ozwSkmoG','n1Co','rCoFWP99w8oMDSoJgq','oSolEJtcRW','s8kBDq','hSo7WQtcJgtcVmkJW7ydBG','smoZW5jGW79ZW4WRA8kNWQjRsq','e8oWgSojya','fSkMWOS/WQm','smoYWQmsWQWxWPys','WRzbmSoSq8oaWOdcS8okWOvLW7O','u8kxc2lcSW','WP1vxCkCW6W','hSoWWQJcH0FcVmkgW7u5zW','W6DUtLvc','WOixpCkEW64','iSk0W6pcImke','WR7dUepdKdpcRJ8jWQ3cKJWD'];_0x1365=function(){return _0x1746d5;};return _0x1365();}import{CompletionCommand}from'@guanghechen/commander/node';import{Reporter as _0x59e551}from'@guanghechen/reporter';import{C as _0xc714b5,a as _0x3021ba}from'./command-DfmDRc-y.mjs';import'node:fs';import'node:path';import'node:child_process';function _0x4272(_0x1b40f6,_0x422594){_0x1b40f6=_0x1b40f6-(-0xa3b+-0x2*-0x187+-0x2*-0x466);const _0x1f8fc7=_0x1365();let _0x463baf=_0x1f8fc7[_0x1b40f6];if(_0x4272['lveagG']===undefined){var _0x37f869=function(_0x2436b7){const _0x2e97fd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5397d2='',_0x405988='';for(let _0x2060cf=0x1175+-0x1d*-0x93+0x2*-0x110e,_0x15bbe7,_0x4a07d9,_0x51b0b5=0x3bc*-0x1+-0x25*0x101+0x28e1;_0x4a07d9=_0x2436b7['charAt'](_0x51b0b5++);~_0x4a07d9&&(_0x15bbe7=_0x2060cf%(0x8b*-0x2b+0x1e94+-0x1*0x737)?_0x15bbe7*(0xae6+-0x161d+0x1*0xb77)+_0x4a07d9:_0x4a07d9,_0x2060cf++%(-0x1*-0xc89+0x26e+-0x59*0x2b))?_0x5397d2+=String['fromCharCode'](0xfe9*-0x1+0xf27+0x1c1*0x1&_0x15bbe7>>(-(-0x13b6*0x1+-0xa*0x3ce+-0xe71*-0x4)*_0x2060cf&0xe1c+-0x1937+0x103*0xb)):-0x2a9*0x5+-0x8ef*0x2+0x1f2b){_0x4a07d9=_0x2e97fd['indexOf'](_0x4a07d9);}for(let _0x330eaf=-0x14bd+0x1fb8+-0xafb,_0x1d592a=_0x5397d2['length'];_0x330eaf<_0x1d592a;_0x330eaf++){_0x405988+='%'+('00'+_0x5397d2['charCodeAt'](_0x330eaf)['toString'](0x274*0xb+0x1e4f+-0x393b))['slice'](-(-0x109d*0x2+-0x1*-0xd2d+-0x140f*-0x1));}return decodeURIComponent(_0x405988);};const _0x13e747=function(_0x4dc0a6,_0x4490d1){let _0x35cdda=[],_0x5b9bae=-0x1549+0x147*0x1+0xc5*0x1a,_0x31b40d,_0x471708='';_0x4dc0a6=_0x37f869(_0x4dc0a6);let _0x4b0c82;for(_0x4b0c82=-0x1b49+-0x1e19+0x3962;_0x4b0c82<0x1b1*-0x12+0x752+0x10*0x182;_0x4b0c82++){_0x35cdda[_0x4b0c82]=_0x4b0c82;}for(_0x4b0c82=-0x2b2+-0x90+0x116*0x3;_0x4b0c82<0xa4b*-0x2+0x24e0+0x13*-0xce;_0x4b0c82++){_0x5b9bae=(_0x5b9bae+_0x35cdda[_0x4b0c82]+_0x4490d1['charCodeAt'](_0x4b0c82%_0x4490d1['length']))%(0x47*0x8a+-0x4d9+-0x206d),_0x31b40d=_0x35cdda[_0x4b0c82],_0x35cdda[_0x4b0c82]=_0x35cdda[_0x5b9bae],_0x35cdda[_0x5b9bae]=_0x31b40d;}_0x4b0c82=-0xa51+0x116f+-0x71e,_0x5b9bae=0x372+0xab1+-0xb*0x149;for(let _0x2eff99=0xaad*0x1+0x352+-0xdff;_0x2eff99<_0x4dc0a6['length'];_0x2eff99++){_0x4b0c82=(_0x4b0c82+(0x9f*-0x24+0x1e4*-0x2+0x1a25))%(0x24cb*-0x1+-0x1b48+-0x1*-0x4113),_0x5b9bae=(_0x5b9bae+_0x35cdda[_0x4b0c82])%(-0x7a3+-0x3*-0x463+0x182*-0x3),_0x31b40d=_0x35cdda[_0x4b0c82],_0x35cdda[_0x4b0c82]=_0x35cdda[_0x5b9bae],_0x35cdda[_0x5b9bae]=_0x31b40d,_0x471708+=String['fromCharCode'](_0x4dc0a6['charCodeAt'](_0x2eff99)^_0x35cdda[(_0x35cdda[_0x4b0c82]+_0x35cdda[_0x5b9bae])%(-0x25*-0xdf+-0x3*0x49a+-0x3*0x5cf)]);}return _0x471708;};_0x4272['ODlGDd']=_0x13e747,_0x4272['ygEdOz']={},_0x4272['lveagG']=!![];}const _0x30e710=_0x1f8fc7[-0xa91+0x2bb*-0x8+0x2069],_0x1d36fb=_0x1b40f6+_0x30e710,_0x2487a8=_0x4272['ygEdOz'][_0x1d36fb];return!_0x2487a8?(_0x4272['YsOtvy']===undefined&&(_0x4272['YsOtvy']=!![]),_0x463baf=_0x4272['ODlGDd'](_0x463baf,_0x422594),_0x4272['ygEdOz'][_0x1d36fb]=_0x463baf):_0x463baf=_0x2487a8,_0x463baf;}import'node:os';import'node:http';import'node:fs/promises';import'node:crypto';import'node:url';import'@hono/node-server';import'hono';import'hono/cors';function _0x5e6cfe(_0x7ec034,_0x78c940,_0x160dc5,_0x5c1ae1){const _0x516d5e={_0x4ff10f:0x141};return _0x4272(_0x160dc5- -_0x516d5e._0x4ff10f,_0x78c940);}import'@guanghechen/kit-stt';import'uuid';import'ws';import'zod';import'hono/streaming';import'node:module';import'node:worker_threads';const _0x48e960={};_0x48e960[_0x5e6cfe(0x85,'*oOb',0x87,0x84)+'x']=_0xc714b5;const _0x17a1d6=new _0x59e551(_0x48e960),_0x1407b4=new _0x3021ba(),_0x43b78c={};_0x43b78c[_0x481952('*oOb',-0xc,0x2,-0xa)+_0x481952('ceH&',-0x13,-0x4,-0x15)+'e']=_0xc714b5,_0x43b78c[_0x5e6cfe(0x93,'U15p',0x84,0x80)]={},_0x43b78c[_0x5e6cfe(0x93,'U15p',0x84,0x80)][_0x481952('86GW',-0x6,-0x16,-0x14)]=_0x5e6cfe(0x66,'ceH&',0x69,0x55)+_0x5e6cfe(0x7d,'(q3C',0x68,0x71)+'bash/'+'compl'+'etion'+'s/'+_0xc714b5+_0x481952('Bk6o',-0x9,-0x1,-0x11);function _0x481952(_0x503bd9,_0x2f2a6c,_0x3b5051,_0xe04b42){const _0x3b3dd9={_0x6f7245:0x1c0};return _0x4272(_0x2f2a6c- -_0x3b3dd9._0x6f7245,_0x503bd9);}_0x43b78c[_0x5e6cfe(0x93,'U15p',0x84,0x80)][_0x5e6cfe(0x6b,'[rA7',0x72,0x65)]='~/.co'+'nfig/'+'fish/'+'compl'+_0x481952('izsB',0x7,-0x5,0x4)+'s/'+_0xc714b5+'.fish',_0x43b78c[_0x5e6cfe(0x93,'U15p',0x84,0x80)][_0x5e6cfe(0x7d,'4FuH',0x70,0x72)]=_0x481952('^CvY',-0x1f,-0x11,-0x18)+'nfig/'+_0x481952('8LcA',-0xe,-0x1e,-0x19)+'compl'+_0x5e6cfe(0x5b,'fh)R',0x6b,0x6f)+'s/'+_0xc714b5+_0x5e6cfe(0x84,'nHKI',0x7e,0x88),_0x1407b4['subco'+_0x5e6cfe(0x6d,'[rA7',0x65,0x79)](_0x5e6cfe(0x5f,'3%Gf',0x6d,0x74)+'etion',new CompletionCommand(_0x1407b4,_0x43b78c));try{await _0x1407b4[_0x481952('nPJz',-0x1e,-0x32,-0x11)]({'argv':process[_0x5e6cfe(0x75,'Lxih',0x7f,0x8b)][_0x5e6cfe(0x65,'RKxA',0x77,0x84)](0x1*-0x611+0x1*-0x14b9+-0x14*-0x157),'envs':process.env,'reporter':_0x17a1d6});}catch(_0xaa025){_0x17a1d6[_0x481952('3%Gf',-0x10,-0x1b,0x5)](_0xaa025 instanceof Error?_0xaa025[_0x5e6cfe(0x5c,'J#qQ',0x64,0x74)]??_0xaa025[_0x481952('nPJz',0x4,0x2,0x12)+'ge']:String(_0xaa025)),process[_0x5e6cfe(0x73,'fh)R',0x74,0x7c)+_0x481952('JOQG',-0x21,-0x15,-0x17)]=-0x2212+0x2097+0x5*0x4c;}
|