ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / contrib / chat / browser / aiCustomization / aiCustomizationDebugPanel.ts 332 строк · изменён 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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
import { CancellationToken } from '../../../../../base/common/cancellation.js' ;
import { URI } from '../../../../../base/common/uri.js' ;
import { IPromptsService, PromptsStorage, IPromptPath } from '../../common/promptSyntax/service/promptsService.js' ;
import { PromptsType } from '../../common/promptSyntax/promptTypes.js' ;
import { IAICustomizationWorkspaceService, AICustomizationSources } from '../../common/aiCustomizationWorkspaceService.js' ;
import { type AICustomizationSource , AICustomizationManagementSection, sectionToPromptType } from './aiCustomizationManagement.js'
ICustomizationHarnessService
IAgentPluginService
IAICustomizationItemSource
allItems name source AICustomizationSource groupKey syncable pluginUri
displayEntries type label count collapsed
section AICustomizationManagementSection
promptsService IPromptsService
workspaceService IAICustomizationWorkspaceService
widgetState IDebugWidgetState
itemSource IAICustomizationItemSource
harnessService ICustomizationHarnessService
agentPluginService IAgentPluginService
promptType section
activeDescriptor harnessService
lines
lines
lines
lines
lines
activeDescriptor
lines
lines
lines
lines
lines
lines
lines
lines
lines
lines
extensionProvider activeDescriptor itemProvider
extensionProvider
providerLabel
lines itemSource promptType providerLabel
lines
lines
lines promptsService promptType
lines promptsService promptType
lines widgetState
lines promptsService promptType
harnessService
lines harnessService
agentPluginService
lines agentPluginService
lines
localFiles IPromptPath
userFiles IPromptPath
extensionFiles IPromptPath
promptsService IPromptsService promptType PromptsType IPromptFilesByStorage
localFiles userFiles extensionFiles
promptsService promptType PromptsStorage local CancellationToken None
promptsService promptType PromptsStorage user CancellationToken None
promptsService promptType PromptsStorage extension CancellationToken None
localFiles userFiles extensionFiles
lines itemSource IAICustomizationItemSource promptType PromptsType label
lines
allItems itemSource
allItems length
lines
lines
byType
item allItems
existing byType item type
existing item
byType item type existing
type items byType
lines
item items
path item uri scheme item uri fsPath item uri
lines
item description
lines
lines
item groupKey
lines
item itemKey
lines
item extensionId
lines
item pluginUri
lines
item badge
lines
item status
lines
item enabled
lines
sectionItems allItems i i type promptType
lines
lines
lines promptsService IPromptsService promptType PromptsType
lines
localFiles userFiles extensionFiles promptsService promptType
lines
lines localFiles
lines
lines userFiles
lines
lines extensionFiles
allFiles promptsService promptType CancellationToken None
lines
promptType PromptsType instructions
agentInstructions promptsService CancellationToken None
lines
lines agentInstructions
promptType PromptsType skill
skills promptsService CancellationToken None
lines
s skills
lines
promptType PromptsType agent
agents promptsService CancellationToken None
lines
a agents
lines
promptType PromptsType prompt
commands promptsService CancellationToken None
lines
c commands
lines
lines
lines promptsService IPromptsService promptType PromptsType
lines
localFiles userFiles extensionFiles promptsService promptType
all IPromptPath localFiles userFiles extensionFiles
lines
lines
lines
lines
lines
lines state IDebugWidgetState
lines
lines
lines
lines
lines
lines
lines
syncableCount state allItems i i syncable length
syncableCount
lines
item state allItems
flags
item syncable
flags
item pluginUri
flags
lines
lines
fileEntries state displayEntries e e type
lines
groupEntries state displayEntries e e type
g groupEntries
lines
lines
lines promptsService IPromptsService promptType PromptsType
lines
sourceFolders promptsService promptType
sf sourceFolders
lines
resolvedFolders promptsService promptType
lines
lines
rf resolvedFolders
lines
lines files uri
f files
lines
lines harnessService ICustomizationHarnessService
lines
activeId harnessService activeHarness
harnesses harnessService availableHarnesses
lines
lines
h harnesses
isActive h id activeId
lines
lines
lines
lines
lines
lines
h pluginActions
a h pluginActions
lines
lines
lines agentPluginService IAgentPluginService
lines
plugins agentPluginService plugins
lines
p plugins
lines
p fromMarketplace
m p fromMarketplace
lines
lines
lines
;
import
{
,
type
ICustomizationItem
}
from
'../../common/customizationHarnessService.js'
;
import
{
}
from
'../../common/plugins/agentPluginService.js'
;
import
{
}
from
'./aiCustomizationItemSource.js'
;
export
interface
IDebugWidgetState
{
readonly
:
readonly
{
readonly
?
:
string
;
readonly
?
:
;
readonly
?
:
string
;
readonly
?
:
boolean
;
readonly
?
:
URI
}
[
]
;
readonly
:
readonly
{
:
string
;
?
:
string
;
?
:
number
;
?
:
boolean
}
[
]
;
}
export
async
function
generateCustomizationDebugReport
(
:
,
:
,
:
,
:
,
:
,
:
,
:
,
)
:
Promise
<
string
>
{
const
=
sectionToPromptType
(
)
;
const
=
.
getActiveDescriptor
(
)
;
const
:
string
[
]
=
[
]
;
.
push
(
` == Customization Debug: ${ section} ( ${ promptType} ) == `
)
;
.
push
(
` Window: ${ workspaceService. isSessionsWindow ? 'Sessions' : 'Core VS Code' } `
)
;
.
push
(
` Active root: ${ workspaceService. getActiveProjectRoot ( ) ?. fsPath ?? '(none)' } `
)
;
.
push
(
` Sections: [ ${ workspaceService. managementSections. join ( ', ' ) } ] `
)
;
if
(
)
{
.
push
(
''
)
;
.
push
(
'--- Active Harness ---'
)
;
.
push
(
` id: ${ activeDescriptor. id} `
)
;
.
push
(
` label: ${ activeDescriptor. label} `
)
;
.
push
(
` hasItemProvider: ${ ! ! activeDescriptor. itemProvider} `
)
;
.
push
(
` hasDisableProvider: ${ ! ! activeDescriptor. syncProvider} `
)
;
.
push
(
` hiddenSections: ${ activeDescriptor. hiddenSections ? ` [ ${ activeDescriptor. hiddenSections. join ( ', ' ) } ] ` : '(none)' } `
)
;
.
push
(
` hideGenerateButton: ${ activeDescriptor. hideGenerateButton ?? false } `
)
;
.
push
(
` requiredAgentId: ${ activeDescriptor. requiredAgentId ?? '(none)' } `
)
;
}
.
push
(
''
)
;
const
=
.
;
if
(
)
{
const
=
'Extension Provider'
;
await
appendProviderData
(
,
,
,
)
;
}
else
{
.
push
(
'--- Stage 1: No provider available ---'
)
;
.
push
(
''
)
;
await
appendRawServiceData
(
,
,
)
;
await
appendUnfilteredData
(
,
,
)
;
}
appendWidgetState
(
,
)
;
await
appendSourceFolders
(
,
,
)
;
if
(
)
{
appendAllHarnesses
(
,
)
;
}
if
(
)
{
appendInstalledPlugins
(
,
)
;
}
return
.
join
(
'\n'
)
;
}
interface
IPromptFilesByStorage
{
readonly
:
readonly
[
]
;
readonly
:
readonly
[
]
;
readonly
:
readonly
[
]
;
}
async
function
getPromptFilesByStorage
(
:
,
:
)
:
Promise
<
>
{
const
[
,
,
]
=
await
Promise
.
all
(
[
.
listPromptFilesForStorage
(
,
.
,
.
)
,
.
listPromptFilesForStorage
(
,
.
,
.
)
,
.
listPromptFilesForStorage
(
,
.
,
.
)
,
]
)
;
return
{
,
,
}
;
}
async
function
appendProviderData
(
:
string
[
]
,
:
,
:
,
:
string
)
:
Promise
<
void
>
{
.
push
(
` --- Stage 1: Provider Output ( ${ label} ) --- `
)
;
const
=
await
.
fetchProviderItems
(
)
;
if
(
.
===
0
)
{
.
push
(
` Total items from provider: 0 (or provider returned undefined and the item source normalized it to an empty array) `
)
;
}
else
{
.
push
(
` Total items from provider: ${ allItems. length} `
)
;
}
const
=
new
Map< string , ICustomizationItem[ ] >
(
)
;
for
(
const
of
)
{
const
=
.
get
(
.
)
??
[
]
;
.
push
(
)
;
.
set
(
.
,
)
;
}
for
(
const
[
,
]
of
)
{
.
push
(
` ${ type } : ${ items. length} items `
)
;
for
(
const
of
)
{
const
=
.
.
===
'file'
?
.
.
:
.
.
toString
(
)
;
.
push
(
` ${ item. name} — ${ path} `
)
;
if
(
.
)
{
.
push
(
` desc: ${ item. description} `
)
;
}
.
push
(
` source: ${ item. source} `
)
;
if
(
.
)
{
.
push
(
` groupKey: ${ item. groupKey} `
)
;
}
if
(
.
)
{
.
push
(
` itemKey: ${ item. itemKey} `
)
;
}
if
(
.
)
{
.
push
(
` extensionId: ${ item. extensionId} `
)
;
}
if
(
.
)
{
.
push
(
` pluginUri: ${ item. pluginUri. toString ( ) } `
)
;
}
if
(
.
)
{
.
push
(
` badge: ${ item. badge} `
)
;
}
if
(
.
)
{
.
push
(
` status: ${ item. status} ${ item. statusMessage ? ` ( ${ item. statusMessage} ) ` : '' } `
)
;
}
if
(
.
===
false
)
{
.
push
(
` enabled: false `
)
;
}
}
}
const
=
.
filter
(
=>
.
===
)
;
.
push
(
` Items matching current section ( ${ promptType} ): ${ sectionItems. length} `
)
;
.
push
(
''
)
;
}
async
function
appendRawServiceData
(
:
string
[
]
,
:
,
:
)
:
Promise
<
void
>
{
.
push
(
'--- Stage 2a: Raw PromptsService Data ---'
)
;
const
{
,
,
}
=
await
getPromptFilesByStorage
(
,
)
;
.
push
(
` listPromptFilesForStorage(local): ${ localFiles. length} files `
)
;
appendFileList
(
,
)
;
.
push
(
` listPromptFilesForStorage(user): ${ userFiles. length} files `
)
;
appendFileList
(
,
)
;
.
push
(
` listPromptFilesForStorage(ext): ${ extensionFiles. length} files `
)
;
appendFileList
(
,
)
;
const
=
await
.
listPromptFiles
(
,
.
)
;
.
push
(
` listPromptFiles (merged): ${ allFiles. length} files `
)
;
if
(
===
.
)
{
const
=
await
.
listAgentInstructions
(
.
,
undefined
)
;
.
push
(
` listAgentInstructions (extra): ${ agentInstructions. length} files `
)
;
appendFileList
(
,
)
;
}
if
(
===
.
)
{
const
=
await
.
findAgentSkills
(
.
)
;
.
push
(
` findAgentSkills: ${ skills?. length ?? 0 } skills `
)
;
for
(
const
of
??
[
]
)
{
.
push
(
` ${ s. name ?? '?' } [ ${ s. storage} ] ${ s. uri. fsPath} `
)
;
}
}
if
(
===
.
)
{
const
=
await
.
getCustomAgents
(
.
)
;
.
push
(
` getCustomAgents: ${ agents. length} agents `
)
;
for
(
const
of
)
{
.
push
(
` ${ a. name} [ ${ a. source. storage} ] ${ a. uri. fsPath} `
)
;
}
}
if
(
===
.
)
{
const
=
await
.
getPromptSlashCommands
(
.
)
;
.
push
(
` getPromptSlashCommands: ${ commands. length} commands `
)
;
for
(
const
of
)
{
.
push
(
` / ${ c. name} [ ${ c. storage} ] ${ c. uri. fsPath} (type= ${ c. type } ) `
)
;
}
}
.
push
(
''
)
;
}
async
function
appendUnfilteredData
(
:
string
[
]
,
:
,
:
)
:
Promise
<
void
>
{
.
push
(
'--- Stage 2b: All files (no filtering applied) ---'
)
;
const
{
,
,
}
=
await
getPromptFilesByStorage
(
,
)
;
const
:
[
]
=
[
...
,
...
,
...
]
;
.
push
(
` Count: ${ all. length} total `
)
;
.
push
(
` local: ${ all. filter ( f => f. storage === PromptsStorage. local) . length} `
)
;
.
push
(
` user: ${ all. filter ( f => f. storage === PromptsStorage. user) . length} `
)
;
.
push
(
` extension: ${ all. filter ( f => f. storage === PromptsStorage. extension) . length} `
)
;
.
push
(
''
)
;
}
function
appendWidgetState
(
:
string
[
]
,
:
)
:
void
{
.
push
(
'--- Stage 3: Widget State (loadItems → filterItems) ---'
)
;
.
push
(
` allItems (after loadItems): ${ state. allItems. length} `
)
;
.
push
(
` local: ${ state. allItems. filter ( i => i. source === AICustomizationSources. local) . length} `
)
;
.
push
(
` user: ${ state. allItems. filter ( i => i. source === AICustomizationSources. user) . length} `
)
;
.
push
(
` extension: ${ state. allItems. filter ( i => i. source === AICustomizationSources. extension) . length} `
)
;
.
push
(
` plugin: ${ state. allItems. filter ( i => i. source === AICustomizationSources. plugin) . length} `
)
;
.
push
(
` built-in: ${ state. allItems. filter ( i => i. source === AICustomizationSources. builtin) . length} `
)
;
const
=
.
.
filter
(
=>
.
)
.
;
if
(
>
0
)
{
.
push
(
` syncable: ${ syncableCount} `
)
;
}
for
(
const
of
.
)
{
const
:
string
[
]
=
[
` storage= ${ item. source ?? '?' } `
,
` groupKey= ${ item. groupKey ?? '(none)' } `
]
;
if
(
.
)
{
.
push
(
'syncable'
)
;
}
if
(
.
)
{
.
push
(
` pluginUri= ${ item. pluginUri. toString ( ) } `
)
;
}
.
push
(
` - ${ item. name} [ ${ flags. join ( ', ' ) } ] `
)
;
}
.
push
(
` displayEntries (after filterItems): ${ state. displayEntries. length} `
)
;
const
=
.
.
filter
(
=>
.
===
'file-item'
)
;
.
push
(
` file items shown: ${ fileEntries. length} `
)
;
const
=
.
.
filter
(
=>
.
===
'group-header'
)
;
for
(
const
of
)
{
.
push
(
` group " ${ g. label} ": count= ${ g. count} , collapsed= ${ g. collapsed} `
)
;
}
.
push
(
''
)
;
}
async
function
appendSourceFolders
(
:
string
[
]
,
:
,
:
)
:
Promise
<
void
>
{
.
push
(
'--- Stage 4: Source Folders (creation targets) ---'
)
;
const
=
await
.
getSourceFolders
(
)
;
for
(
const
of
)
{
.
push
(
` [ ${ sf. storage} ] ${ sf. uri. fsPath} `
)
;
}
try
{
const
=
await
.
getResolvedSourceFolders
(
)
;
.
push
(
''
)
;
.
push
(
'--- Resolved Source Folders (discovery order) ---'
)
;
for
(
const
of
)
{
.
push
(
` [ ${ rf. storage} ] ${ rf. uri. fsPath} (source= ${ rf. source} ) `
)
;
}
}
catch
{
}
}
function
appendFileList
(
:
string
[
]
,
:
readonly
{
:
URI
}
[
]
)
:
void
{
for
(
const
of
)
{
.
push
(
` ${ f. uri. fsPath} `
)
;
}
}
function
appendAllHarnesses
(
:
string
[
]
,
:
)
:
void
{
.
push
(
'--- Stage 5: All Registered Harnesses ---'
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
.
push
(
` Active: ${ activeId} `
)
;
.
push
(
` Total harnesses: ${ harnesses. length} `
)
;
for
(
const
of
)
{
const
=
.
===
?
' (ACTIVE)'
:
''
;
.
push
(
` [ ${ h. id} ] ${ isActive} " ${ h. label} " `
)
;
.
push
(
` hasItemProvider: ${ ! ! h. itemProvider} `
)
;
.
push
(
` hasDisableProvider: ${ ! ! h. syncProvider} `
)
;
.
push
(
` hiddenSections: ${ h. hiddenSections ? ` [ ${ h. hiddenSections. join ( ', ' ) } ] ` : '(none)' } `
)
;
.
push
(
` hideGenerateButton: ${ h. hideGenerateButton ?? false } `
)
;
.
push
(
` pluginActions: ${ h. pluginActions?. length ?? 0 } `
)
;
if
(
.
)
{
for
(
const
of
.
)
{
.
push
(
` - ${ a. id} : ${ a. label} `
)
;
}
}
}
.
push
(
''
)
;
}
function
appendInstalledPlugins
(
:
string
[
]
,
:
)
:
void
{
.
push
(
'--- Stage 6: Installed Plugins ---'
)
;
const
=
.
.
get
(
)
;
.
push
(
` Total: ${ plugins. length} `
)
;
for
(
const
of
)
{
.
push
(
` [ ${ p. label} ] ${ p. uri. toString ( ) } `
)
;
if
(
.
)
{
const
=
.
;
.
push
(
` fromMarketplace: ${ m. name} @ ${ m. version} (marketplace= ${ m. marketplace} , type= ${ m. marketplaceType} ) `
)
;
}
else
{
.
push
(
` fromMarketplace: (none) `
)
;
}
}
.
push
(
''
)
;
}