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 / common / streamingToolCallDisplay.ts 181 строк · изменён 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
import { escapeMarkdownLinkLabel } from '../../../base/common/htmlContent.js' ;
import { basename } from '../../../base/common/resources.js' ;
import { splitLines } from '../../../base/common/strings.js' ;
import { URI } from '../../../base/common/uri.js' ;
import { localize } from '../../../nls.js' ;
import type { StringOrMarkdown } from './state/protocol/state.js' ;
export type ToolPathResolver = ( path: string ) =>
identityPathResolver path path
message StringOrMarkdown
message message message markdown
input Record rawFallback
input
rawFallback
input
rawFallback
value StringOrMarkdown
markdown value
path resolvePath ToolPathResolver
path path
uri path
value
value value length
path
lineCount
resolvePath ToolPathResolver identityPathResolver
StringOrMarkdown
file path resolvePath
lineCount
file
lineCount
file
lineCount file
lineCount
lineCount
file
file
path
oldLineCount
newLineCount
resolvePath ToolPathResolver identityPathResolver
StringOrMarkdown
file path resolvePath
oldLineCount newLineCount
file
oldLineCount newLineCount
file
oldLineCount
newLineCount file
newLineCount
oldLineCount file
oldLineCount newLineCount file
oldLineCount newLineCount
oldLineCount
newLineCount
newLineCount
oldLineCount
oldLineCount newLineCount
oldLineCount
file
oldLineCount
file
oldLineCount file
oldLineCount
oldLineCount
path resolvePath
path
lineCount
resolvePath ToolPathResolver identityPathResolver
StringOrMarkdown
file path resolvePath
lineCount
file
lineCount
file
file lineCount
lineCount
lineCount
file
file
path
lineCount
resolvePath ToolPathResolver identityPathResolver
StringOrMarkdown
file path resolvePath
lineCount
file
lineCount
file
lineCount file
lineCount
lineCount
file
file
paths
lineCount
resolvePath ToolPathResolver identityPathResolver
StringOrMarkdown
fileList paths path path resolvePath path path
lineCount
fileList
lineCount
fileList
lineCount fileList
lineCount
lineCount
fileList
fileList
string
;
const
:
ToolPathResolver
=
=>
;
export
const
STREAMING_TOOL_DISPLAY_INTERVAL_MS
=
100
;
export
function
streamingToolDisplayText
(
:
)
:
string
{
return
typeof
===
'string'
?
:
.
;
}
export
function
formatGenericToolInput
(
:
<
string
,
unknown
>
|
undefined
,
?
:
string
)
:
string
|
undefined
{
if
(
!
)
{
return
;
}
try
{
return
JSON
.
stringify
(
,
null
,
2
)
;
}
catch
{
return
;
}
}
function
markdown
(
:
string
)
:
{
return
{
:
}
;
}
function
formatPath
(
:
unknown
,
:
)
:
string
|
undefined
{
if
(
typeof
!==
'string'
||
!
)
{
return
undefined
;
}
const
=
URI
.
file
(
resolvePath
(
)
)
;
return
` [ ${ escapeMarkdownLinkLabel ( basename ( uri) ) } ]( ${ uri} ) `
;
}
export
function
streamingToolTextLineCount
(
:
unknown
)
:
number
|
undefined
{
return
typeof
===
'string'
?
splitLines
(
)
.
:
undefined
;
}
export
function
getStreamingEditMessage
(
:
unknown
,
:
number
|
undefined
,
:
=
,
)
:
{
const
=
formatPath
(
,
)
;
if
(
!==
undefined
)
{
if
(
)
{
return
===
1
?
markdown
(
localize
(
'toolStream.editOneLineInFile'
,
"Editing 1 line in {0}"
,
)
)
:
markdown
(
localize
(
'toolStream.editLinesInFile'
,
"Editing {0} lines in {1}"
,
,
)
)
;
}
return
===
1
?
localize
(
'toolStream.editOneLine'
,
"Editing 1 line"
)
:
localize
(
'toolStream.editLines'
,
"Editing {0} lines"
,
)
;
}
return
?
markdown
(
localize
(
'toolStream.editFile'
,
"Editing {0}"
,
)
)
:
localize
(
'toolStream.edit'
,
"Editing file"
)
;
}
export
function
getStreamingReplaceMessage
(
:
unknown
,
:
number
|
undefined
,
:
number
|
undefined
,
:
=
,
)
:
{
const
=
formatPath
(
,
)
;
if
(
!==
undefined
&&
!==
undefined
)
{
if
(
)
{
if
(
===
1
&&
===
1
)
{
return
markdown
(
localize
(
'toolStream.replaceOneLineWithOneLineInFile'
,
"Replacing 1 line with 1 line in {0}"
,
)
)
;
}
if
(
===
1
)
{
return
markdown
(
localize
(
'toolStream.replaceOneLineWithLinesInFile'
,
"Replacing 1 line with {0} lines in {1}"
,
,
)
)
;
}
if
(
===
1
)
{
return
markdown
(
localize
(
'toolStream.replaceLinesWithOneLineInFile'
,
"Replacing {0} lines with 1 line in {1}"
,
,
)
)
;
}
return
markdown
(
localize
(
'toolStream.replaceLinesWithLinesInFile'
,
"Replacing {0} lines with {1} lines in {2}"
,
,
,
)
)
;
}
if
(
===
1
&&
===
1
)
{
return
localize
(
'toolStream.replaceOneLineWithOneLine'
,
"Replacing 1 line with 1 line"
)
;
}
if
(
===
1
)
{
return
localize
(
'toolStream.replaceOneLineWithLines'
,
"Replacing 1 line with {0} lines"
,
)
;
}
if
(
===
1
)
{
return
localize
(
'toolStream.replaceLinesWithOneLine'
,
"Replacing {0} lines with 1 line"
,
)
;
}
return
localize
(
'toolStream.replaceLinesWithLines'
,
"Replacing {0} lines with {1} lines"
,
,
)
;
}
if
(
!==
undefined
)
{
if
(
)
{
return
===
1
?
markdown
(
localize
(
'toolStream.replaceOneLineInFile'
,
"Replacing 1 line in {0}"
,
)
)
:
markdown
(
localize
(
'toolStream.replaceLinesInFile'
,
"Replacing {0} lines in {1}"
,
,
)
)
;
}
return
===
1
?
localize
(
'toolStream.replaceOneLine'
,
"Replacing 1 line"
)
:
localize
(
'toolStream.replaceLines'
,
"Replacing {0} lines"
,
)
;
}
return
getStreamingEditMessage
(
,
undefined
,
)
;
}
export
function
getStreamingCreateMessage
(
:
unknown
,
:
number
|
undefined
,
:
=
,
)
:
{
const
=
formatPath
(
,
)
;
if
(
!==
undefined
)
{
if
(
)
{
return
===
1
?
markdown
(
localize
(
'toolStream.createOneLineInFile'
,
"Creating {0} (1 line)"
,
)
)
:
markdown
(
localize
(
'toolStream.createLinesInFile'
,
"Creating {0} ({1} lines)"
,
,
)
)
;
}
return
===
1
?
localize
(
'toolStream.createOneLine'
,
"Creating file (1 line)"
)
:
localize
(
'toolStream.createLines'
,
"Creating file ({0} lines)"
,
)
;
}
return
?
markdown
(
localize
(
'toolStream.createFile'
,
"Creating {0}"
,
)
)
:
localize
(
'toolStream.create'
,
"Creating file"
)
;
}
export
function
getStreamingInsertMessage
(
:
unknown
,
:
number
|
undefined
,
:
=
,
)
:
{
const
=
formatPath
(
,
)
;
if
(
!==
undefined
)
{
if
(
)
{
return
===
1
?
markdown
(
localize
(
'toolStream.insertOneLineInFile'
,
"Inserting 1 line in {0}"
,
)
)
:
markdown
(
localize
(
'toolStream.insertLinesInFile'
,
"Inserting {0} lines in {1}"
,
,
)
)
;
}
return
===
1
?
localize
(
'toolStream.insertOneLine'
,
"Inserting 1 line"
)
:
localize
(
'toolStream.insertLines'
,
"Inserting {0} lines"
,
)
;
}
return
?
markdown
(
localize
(
'toolStream.insertInFile'
,
"Inserting text in {0}"
,
)
)
:
localize
(
'toolStream.insert'
,
"Inserting text"
)
;
}
export
function
getStreamingPatchMessage
(
:
readonly
string
[
]
,
:
number
|
undefined
,
:
=
,
)
:
{
const
=
.
map
(
=>
formatPath
(
,
)
)
.
filter
(
=>
!==
undefined
)
.
join
(
', '
)
||
undefined
;
if
(
!==
undefined
)
{
if
(
)
{
return
===
1
?
markdown
(
localize
(
'toolStream.patchOneLineInFiles'
,
"Generating patch (1 line) in {0}"
,
)
)
:
markdown
(
localize
(
'toolStream.patchLinesInFiles'
,
"Generating patch ({0} lines) in {1}"
,
,
)
)
;
}
return
===
1
?
localize
(
'toolStream.patchOneLine'
,
"Generating patch (1 line)"
)
:
localize
(
'toolStream.patchLines'
,
"Generating patch ({0} lines)"
,
)
;
}
return
?
markdown
(
localize
(
'toolStream.patchFiles'
,
"Generating patch in {0}"
,
)
)
:
localize
(
'toolStream.patch'
,
"Generating patch"
)
;
}