ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / script / postinstall.ts 299 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
import * as fs from 'fs' ;
import * as path from 'path' ;
import { compressTikToken } from './build/compressTikToken' ;
import { copyStaticAssets } from './build/copyStaticAssets' ;
export interface ITreeSitterGrammar {
name: string ;
filename? : string ;
projectPath? : string ;
}
const treeSitterGrammars: ITreeSitterGrammar[
name
filename
name
name
name
name
name
name
projectPath
name
projectPath
name
name
name
path __dirname
path
exports Record
process platform
report process report header glibcVersionRuntime
report header glibcVersionRuntime
arch process arch
process platform
linuxCandidates
linuxCandidates linuxCandidates
tried
platformPackage
sourceDir path
tried sourceDir
fs path sourceDir
sourceDir
fs path
packageJsonPath path
packageJson fs promises packageJsonPath ICopilotPackageJson
packageJson exports
packageJson exports
types
fs promises packageJsonPath
sourceDir
sourceDir
path sourceDir path
dir
sourcePath path sourceDir dir
fs sourcePath
sourcePath path dir
entry fs promises sourceDir
entry entry
fs promises path sourceDir entry path entry
sourceDir
shimsPath path
fs promises shimsPath force
targetDir path
fs promises targetDir recursive force
copilotCliSourceDir
sourceDir path copilotCliSourceDir
targetDir path
sourceDir targetDir
copilotCliSourceDir
sourceDir path copilotCliSourceDir
targetDir path
sourceDir targetDir
copilotCliSourceDir
sourceDir path copilotCliSourceDir
targetDir path
sourceDir targetDir
copilotCliSourceDir
sourceDir path copilotCliSourceDir
targetDir path
sourceDir targetDir
copilotCliSourceDir
sourceDir path copilotCliSourceDir
targetDir path
fs promises targetDir recursive force
fs promises targetDir recursive
fs promises sourceDir targetDir
recursive force src
fs src
normalizedSrc src path sep path posix sep
src
src
src
src
src
src
normalizedSrc
sourceDir targetDir
fs promises targetDir recursive force
fs promises targetDir recursive
fs promises sourceDir targetDir recursive force
process platform
claudeDir path
fs promises claudeDir recursive
symlinks link target
link path claudeDir target path
link path claudeDir target path
link target symlinks
fs link
fs promises target link
fs promises path recursive
vendoredTiktokenFiles
tokens vendoredTiktokenFiles
tokens
treeSitterGrammars grammar
copilotCliSourceDir
copilotCliSourceDir
copilotCliSourceDir
copilotCliSourceDir
copilotCliSourceDir
copilotCliSourceDir
baseCachePath path
fs baseCachePath
]
=
[
{
:
'tree-sitter-c-sharp'
,
:
'tree-sitter-c_sharp.wasm'
}
,
{
:
'tree-sitter-cpp'
,
}
,
{
:
'tree-sitter-go'
,
}
,
{
:
'tree-sitter-javascript'
,
}
,
{
:
'tree-sitter-python'
,
}
,
{
:
'tree-sitter-ruby'
,
}
,
{
:
'tree-sitter-typescript'
,
:
'tree-sitter-typescript/typescript'
,
}
,
{
:
'tree-sitter-tsx'
,
:
'tree-sitter-typescript/tsx'
,
}
,
{
:
'tree-sitter-java'
,
}
,
{
:
'tree-sitter-rust'
,
}
,
{
:
'tree-sitter-php'
}
]
;
const
REPO_ROOT
=
.
join
(
,
'..'
)
;
const
COPILOT_PACKAGE_DIR
=
.
join
(
REPO_ROOT
,
'node_modules'
,
'@github'
,
'copilot'
)
;
const
COPILOT_CLI_TOP_LEVEL_DIRS
=
[
'worker'
,
'definitions'
,
'builtin-skills'
,
'builtin'
,
'tgrep'
,
'queries'
,
'prebuilds'
,
'ripgrep'
,
'foundry-local-sdk'
,
'pvrecorder'
,
'mxc-bin'
,
'clipboard'
,
'copilot-sdk'
,
'schemas'
,
'preloads'
,
]
;
interface
ICopilotPackageJson
{
?
:
<
string
,
unknown
>
;
}
function
isLinuxMuslRuntime
(
)
:
boolean
{
if
(
.
!==
'linux'
)
{
return
false
;
}
const
=
.
?.
getReport
(
)
as
{
?
:
{
?
:
string
}
}
|
undefined
;
return
!
?.
?.
;
}
function
getCopilotPlatformPackageCandidates
(
)
:
string
[
]
{
const
=
.
;
if
(
.
===
'linux'
)
{
const
=
[
` linux- ${ arch} `
,
` linuxmusl- ${ arch} `
]
;
return
isLinuxMuslRuntime
(
)
?
.
reverse
(
)
:
;
}
return
[
` ${ process. platform} - ${ arch} `
]
;
}
async
function
resolveCopilotCliSourceDir
(
)
:
Promise
<
string
>
{
const
:
string
[
]
=
[
]
;
for
(
const
of
getCopilotPlatformPackageCandidates
(
)
)
{
const
=
.
join
(
REPO_ROOT
,
'node_modules'
,
'@github'
,
` copilot- ${ platformPackage} `
)
;
.
push
(
)
;
if
(
.
existsSync
(
.
join
(
,
'sdk'
,
'index.js'
)
)
)
{
return
;
}
}
if
(
.
existsSync
(
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'index.js'
)
)
)
{
return
COPILOT_PACKAGE_DIR
;
}
throw
new
Error
(
` Could not find @github/copilot SDK files. Tried: ${ [ COPILOT_PACKAGE_DIR , ... tried] . join ( ', ' ) } `
)
;
}
async
function
ensureCopilotSdkExport
(
)
{
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'package.json'
)
;
const
=
JSON
.
parse
(
await
.
.
readFile
(
,
'utf8'
)
)
as
;
.
=
{
...
(
.
??
{
}
)
,
'./sdk'
:
{
:
'./sdk/index.d.ts'
,
import
:
'./sdk/index.js'
}
}
;
await
.
.
writeFile
(
,
` ${ JSON . stringify ( packageJson, undefined , 2 ) } \n `
)
;
}
async
function
materializeCopilotCliSdkLayout
(
)
:
Promise
<
string
>
{
const
=
await
resolveCopilotCliSourceDir
(
)
;
if
(
!==
COPILOT_PACKAGE_DIR
)
{
await
copyCopilotCLIFolders
(
.
join
(
,
'sdk'
)
,
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
)
)
;
for
(
const
of
COPILOT_CLI_TOP_LEVEL_DIRS
)
{
const
=
.
join
(
,
)
;
if
(
.
existsSync
(
)
)
{
await
copyCopilotCLIFolders
(
,
.
join
(
COPILOT_PACKAGE_DIR
,
)
)
;
}
}
for
(
const
of
await
.
.
readdir
(
)
)
{
if
(
.
startsWith
(
'tree-sitter'
)
&&
.
endsWith
(
'.wasm'
)
)
{
await
.
.
copyFile
(
.
join
(
,
)
,
.
join
(
COPILOT_PACKAGE_DIR
,
)
)
;
}
}
}
await
ensureCopilotSdkExport
(
)
;
return
;
}
async
function
removeCopilotCLIShim
(
)
{
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'shims.txt'
)
;
await
.
.
rm
(
,
{
:
true
}
)
.
catch
(
(
)
=>
{
}
)
;
}
async
function
removeCopilotCliWorkerFiles
(
)
{
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'worker'
)
;
await
.
.
rm
(
,
{
:
true
,
:
true
}
)
;
}
async
function
copyCopilotCliTGrepFiles
(
:
string
)
{
const
=
.
join
(
,
'tgrep'
)
;
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'tgrep'
)
;
await
copyCopilotCLIFolders
(
,
)
;
}
async
function
copyCopilotCliDefinitionFiles
(
:
string
)
{
const
=
.
join
(
,
'definitions'
)
;
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'definitions'
)
;
await
copyCopilotCLIFolders
(
,
)
;
}
async
function
copyCopilotCliSkillsFiles
(
:
string
)
{
const
=
.
join
(
,
'builtin-skills'
)
;
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'builtin-skills'
)
;
await
copyCopilotCLIFolders
(
,
)
;
}
async
function
copyCopilotCliQueryFiles
(
:
string
)
{
const
=
.
join
(
,
'queries'
)
;
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'queries'
)
;
await
copyCopilotCLIFolders
(
,
)
;
}
async
function
copyCopilotCliPrebuildFiles
(
:
string
)
{
const
=
.
join
(
,
'prebuilds'
)
;
const
=
.
join
(
COPILOT_PACKAGE_DIR
,
'sdk'
,
'prebuilds'
)
;
await
.
.
rm
(
,
{
:
true
,
:
true
}
)
;
await
.
.
mkdir
(
,
{
:
true
}
)
;
await
.
.
cp
(
,
,
{
:
true
,
:
true
,
filter
:
(
)
=>
{
try
{
if
(
.
statSync
(
)
.
isFile
(
)
)
{
const
=
.
split
(
.
)
.
join
(
.
.
)
;
return
.
endsWith
(
'computer.node'
)
||
.
endsWith
(
'runtime.node'
)
||
.
endsWith
(
'cli-native.node'
)
||
.
endsWith
(
'pty.node'
)
||
.
endsWith
(
'conpty_console_list.node'
)
||
.
endsWith
(
'spawn-helper'
)
||
.
includes
(
'/conpty/'
)
;
}
return
true
;
}
catch
{
return
true
;
}
}
}
)
;
}
async
function
copyCopilotCLIFolders
(
:
string
,
:
string
)
{
await
.
.
rm
(
,
{
:
true
,
:
true
}
)
;
await
.
.
mkdir
(
,
{
:
true
}
)
;
await
.
.
cp
(
,
,
{
:
true
,
:
true
}
)
;
}
async
function
createClaudeSymlinks
(
)
{
if
(
.
===
'win32'
)
{
return
;
}
console
.
log
(
'Creating symlinks for Claude session storage and instructions...'
)
;
const
=
.
join
(
REPO_ROOT
,
'.claude'
)
;
await
.
.
mkdir
(
,
{
:
true
}
)
;
const
:
{
:
string
;
:
string
}
[
]
=
[
{
:
.
join
(
,
'CLAUDE.md'
)
,
:
.
join
(
'..'
,
'.github'
,
'copilot-instructions.md'
)
}
,
{
:
.
join
(
,
'skills'
)
,
:
.
join
(
'..'
,
'.agents'
,
'skills'
)
}
,
]
;
for
(
const
{
,
}
of
)
{
if
(
!
.
existsSync
(
)
)
{
await
.
.
symlink
(
,
)
;
}
}
}
async
function
main
(
)
{
await
.
.
mkdir
(
.
join
(
REPO_ROOT
,
'.build'
)
,
{
:
true
}
)
;
await
createClaudeSymlinks
(
)
;
const
=
[
'src/platform/tokenizer/node/cl100k_base.tiktoken'
,
'src/platform/tokenizer/node/o200k_base.tiktoken'
]
;
for
(
const
of
)
{
await
compressTikToken
(
,
` dist/ ${ path. basename ( tokens) } `
)
;
}
await
copyStaticAssets
(
[
...
.
map
(
=>
` node_modules/@vscode/tree-sitter-wasm/wasm/ ${ grammar. name} .wasm `
)
,
'node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm'
,
'node_modules/@github/blackbird-external-ingest-utils/pkg/nodejs/external_ingest_utils_bg.wasm'
,
]
,
'dist'
)
;
const
=
await
materializeCopilotCliSdkLayout
(
)
;
await
removeCopilotCLIShim
(
)
;
await
removeCopilotCliWorkerFiles
(
)
;
await
copyCopilotCliDefinitionFiles
(
)
;
await
copyCopilotCliSkillsFiles
(
)
;
await
copyCopilotCliTGrepFiles
(
)
;
await
copyCopilotCliQueryFiles
(
)
;
await
copyCopilotCliPrebuildFiles
(
)
;
const
=
.
join
(
'test'
,
'simulation'
,
'cache'
,
'base.sqlite'
)
;
if
(
!
.
existsSync
(
)
)
{
console
.
warn
(
` Warning: Base cache file does not exist at ${ baseCachePath} . Please ensure that you have git lfs installed and initialized before the repository is cloned. `
)
;
}
}
main
(
)
;