ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / agentHost / test / node / customizations / claudeMultiRootCustomizationDiscovery.test.ts 125 строк · изменён 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
import assert from 'assert' ;
import { DisposableStore } from '../../../../../base/common/lifecycle.js' ;
import { Schemas } from '../../../../../base/common/network.js' ;
import { URI } from '../../../../../base/common/uri.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js' ;
import { IFileService } from '../../../../files/common/files.js' ;
import { NullLogService } from '../../../../log/common/log.js' ;
import { discoverClaudeMultiRootCustomizations } from
scanClaudeDiskCustomizations
scanClaudeNativePlugins
createInMemoryFileService seedFile
warns
override message args
warns message args a a
disposables
rootA scheme Schemas inMemory path
rootB scheme Schemas inMemory path
userHome scheme Schemas inMemory path
fileService IFileService
seed path content fileService path content
fileService disposables
disposables
enabledPlugins
enabledPlugins
name
name
logService
expectedDiscovered expectedPlugins actual
rootA userHome fileService
rootA userHome fileService logService
rootA userHome fileService logService
assert
discovered actual discovered
plugins actual nativePlugins
discovered expectedDiscovered
plugins expectedPlugins
result rootA rootB userHome fileService
assert
roots result workingDirectories root root path
items result discovered item name item name description item description path item uri path
roots
items
name description path
name description path
name description path
name description path
agentA
agentB
skillA
skillB
logService
rootA rootB userHome fileService logService
assert logService warns
result rootA rootA userHome fileService
assert
roots result workingDirectories root root path
items result discovered item item name
roots
items
'../../../node/claude/customizations/claudeMultiRootCustomizationDiscovery.js'
;
import
{
}
from
'../../../node/claude/customizations/scan/claudeAgentSkillScan.js'
;
import
{
}
from
'../../../node/claude/customizations/scan/claudeNativePluginScan.js'
;
import
{
,
}
from
'./claudeCustomizationTestUtils.js'
;
class
CapturingLogService
extends
NullLogService
{
readonly
:
string
[
]
=
[
]
;
warn
(
:
string
,
...
:
unknown
[
]
)
:
void
{
this
.
.
push
(
[
,
...
.
map
(
=>
String
(
)
)
]
.
join
(
' '
)
)
;
}
}
suite
(
'claudeMultiRootCustomizationDiscovery'
,
(
)
=>
{
const
=
new
DisposableStore
(
)
;
const
=
URI
.
from
(
{
:
.
,
:
'/a'
}
)
;
const
=
URI
.
from
(
{
:
.
,
:
'/b'
}
)
;
const
=
URI
.
from
(
{
:
.
,
:
'/home'
}
)
;
let
:
;
const
=
(
:
string
,
=
''
)
=>
seedFile
(
,
,
)
;
setup
(
(
)
=>
{
=
createInMemoryFileService
(
)
;
}
)
;
teardown
(
(
)
=>
.
clear
(
)
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'uses the existing single-root discovery path without changing output order'
,
async
(
)
=>
{
await
Promise
.
all
(
[
seed
(
'/a/.claude/agents/project.md'
,
'---\nname: project\ndescription: project agent\n---'
)
,
seed
(
'/home/.claude/agents/user.md'
,
'---\nname: user\ndescription: user agent\n---'
)
,
seed
(
'/a/.claude/skills/project-skill/SKILL.md'
,
'---\nname: project-skill\ndescription: project skill\n---'
)
,
seed
(
'/home/.claude/skills/user-skill/SKILL.md'
,
'---\nname: user-skill\ndescription: user skill\n---'
)
,
seed
(
'/home/.claude/settings.json'
,
JSON
.
stringify
(
{
:
{
'user-plugin@m'
:
true
}
}
)
)
,
seed
(
'/a/.claude/settings.json'
,
JSON
.
stringify
(
{
:
{
'project-plugin@m'
:
true
}
}
)
)
,
seed
(
'/home/.claude/plugins/cache/m/user-plugin/1.0.0/.claude-plugin/plugin.json'
,
JSON
.
stringify
(
{
:
'user-plugin'
}
)
)
,
seed
(
'/home/.claude/plugins/cache/m/project-plugin/1.0.0/.claude-plugin/plugin.json'
,
JSON
.
stringify
(
{
:
'project-plugin'
}
)
)
,
]
)
;
const
=
new
NullLogService
(
)
;
const
[
,
,
]
=
await
Promise
.
all
(
[
scanClaudeDiskCustomizations
(
,
,
)
,
scanClaudeNativePlugins
(
,
,
,
)
,
discoverClaudeMultiRootCustomizations
(
[
]
,
,
,
)
,
]
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
,
}
,
{
:
,
:
,
}
)
;
}
)
;
test
(
'combines roots in order and applies first-name-wins precedence'
,
async
(
)
=>
{
await
Promise
.
all
(
[
seed
(
'/a/.claude/agents/shared.md'
,
'---\nname: shared\ndescription: from a\n---'
)
,
seed
(
'/b/.claude/agents/shared.md'
,
'---\nname: shared\ndescription: from b\n---'
)
,
seed
(
'/b/.claude/agents/b-only.md'
,
'---\nname: b-only\ndescription: from b\n---'
)
,
seed
(
'/b/.claude/skills/shared-skill/SKILL.md'
,
'---\nname: shared-skill\ndescription: from b\n---'
)
,
seed
(
'/home/.claude/skills/shared-skill/SKILL.md'
,
'---\nname: shared-skill\ndescription: from user\n---'
)
,
seed
(
'/home/.claude/skills/user-only/SKILL.md'
,
'---\nname: user-only\ndescription: from user\n---'
)
,
seed
(
'/b/.claude/commands/not-loaded.md'
,
'---\nname: not-loaded\ndescription: added-directory command\n---'
)
,
]
)
;
const
=
await
discoverClaudeMultiRootCustomizations
(
[
,
]
,
,
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
{
:
.
.
map
(
=>
.
)
,
:
.
.
map
(
=>
(
{
:
.
,
:
.
,
:
.
.
}
)
)
,
}
,
{
:
[
'/a'
,
'/b'
]
,
:
[
{
:
'shared'
,
:
'from a'
,
:
'/a/.claude/agents/shared.md'
}
,
{
:
'b-only'
,
:
'from b'
,
:
'/b/.claude/agents/b-only.md'
}
,
{
:
'shared-skill'
,
:
'from b'
,
:
'/b/.claude/skills/shared-skill/SKILL.md'
}
,
{
:
'user-only'
,
:
'from user'
,
:
'/home/.claude/skills/user-only/SKILL.md'
}
,
]
,
}
)
;
}
)
;
test
(
'warns when a workspace folder skill or agent is shadowed by another folder'
,
async
(
)
=>
{
const
=
await
seed
(
'/a/.claude/agents/reviewer.md'
,
'---\nname: reviewer\ndescription: from a\n---'
)
;
const
=
await
seed
(
'/b/.claude/agents/reviewer.md'
,
'---\nname: reviewer\ndescription: from b\n---'
)
;
const
=
await
seed
(
'/a/.claude/skills/deploy/SKILL.md'
,
'---\nname: deploy\ndescription: from a\n---'
)
;
const
=
await
seed
(
'/b/.claude/skills/deploy/SKILL.md'
,
'---\nname: deploy\ndescription: from b\n---'
)
;
await
seed
(
'/home/.claude/skills/deploy/SKILL.md'
,
'---\nname: deploy\ndescription: from user\n---'
)
;
const
=
new
CapturingLogService
(
)
;
await
discoverClaudeMultiRootCustomizations
(
[
,
]
,
,
,
)
;
.
deepStrictEqual
(
.
.
sort
(
)
,
[
` [claudeMultiRootCustomizationDiscovery] agent 'reviewer' at ' ${ agentB. toString ( ) } ' is shadowed by ' ${ agentA. toString ( ) } ' from another workspace folder and is unreachable by name `
,
` [claudeMultiRootCustomizationDiscovery] skill 'deploy' at ' ${ skillB. toString ( ) } ' is shadowed by ' ${ skillA. toString ( ) } ' from another workspace folder and is unreachable by name `
,
]
.
sort
(
)
)
;
}
)
;
test
(
'deduplicates equivalent roots without changing precedence'
,
async
(
)
=>
{
await
seed
(
'/a/.claude/agents/a.md'
,
'---\nname: a\ndescription: A\n---'
)
;
const
=
await
discoverClaudeMultiRootCustomizations
(
[
,
]
,
,
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
{
:
.
.
map
(
=>
.
)
,
:
.
.
map
(
=>
.
)
,
}
,
{
:
[
'/a'
]
,
:
[
'a'
]
,
}
)
;
}
)
;
}
)
;