ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / src / extension / mcp / vscode-node / mcpToolCallingLoop.tsx 106 строк · изменён 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
import type { CancellationToken , LanguageModelToolInformation , Progress } from 'vscode' ;
import { IAuthenticationChatUpgradeService } from '../../../platform/authentication/common/authenticationUpgrade' ;
import { IChatHookService } from '../../../platform/chat/common/chatHookService' ;
import { ChatLocation , ChatResponse } from '../../../platform/chat/common/commonTypes' ;
import { ISessionTranscriptService } from '../../../platform/chat/common/sessionTranscriptService'
props
options
@ instantiationService
@ logService
@ requestLogger
@ endpointProvider
@ authenticationChatUpgradeService
@ telemetryService
@ configurationService
@ experimentationService
@ chatHookService
@ sessionTranscriptService
@ fileSystemService
@ otelService
@ gitService
options instantiationService endpointProvider logService requestLogger authenticationChatUpgradeService telemetryService configurationService experimentationService chatHookService sessionTranscriptService fileSystemService otelService gitService
buildPromptContext progress token
endpoint
renderer
endpoint
promptContext buildPromptContext
renderer progress token
description
name
inputSchema
source
tags
description
name
inputSchema
source
tags
opts token
endpoint
endpoint
opts
debugName
requestOptions
opts
temperature
token
;
import
{ IConfigurationService }
from
'../../../platform/configuration/common/configurationService'
;
import
{ IEndpointProvider }
from
'../../../platform/endpoint/common/endpointProvider'
;
import
{ IFileSystemService }
from
'../../../platform/filesystem/common/fileSystemService'
;
import
{ IGitService }
from
'../../../platform/git/common/gitService'
;
import
{ ILogService }
from
'../../../platform/log/common/logService'
;
import
{ IOTelService }
from
'../../../platform/otel/common/otelService'
;
import
{ IRequestLogger }
from
'../../../platform/requestLogger/common/requestLogger'
;
import
{ IExperimentationService }
from
'../../../platform/telemetry/common/nullExperimentationService'
;
import
{ ITelemetryService }
from
'../../../platform/telemetry/common/telemetry'
;
import
{ IInstantiationService }
from
'../../../util/vs/platform/instantiation/common/instantiation'
;
import
{ ChatResponseProgressPart , ChatResponseReferencePart }
from
'../../../vscodeTypes'
;
import
{ IToolCallingLoopOptions , ToolCallingLoop , ToolCallingLoopFetchOptions }
from
'../../intents/node/toolCallingLoop'
;
import
{ IBuildPromptContext }
from
'../../prompt/common/intents'
;
import
{ IBuildPromptResult }
from
'../../prompt/node/intents'
;
import
{ PromptRenderer }
from
'../../prompts/node/base/promptRenderer'
;
import
{ IMcpToolCallingLoopPromptContext , McpToolCallingLoopPrompt }
from
'./mcpToolCallingLoopPrompt'
;
import
{ QuickInputTool , QuickPickTool }
from
'./mcpToolCallingTools'
;
export
interface
IMcpToolCallingLoopOptions
extends
IToolCallingLoopOptions
{
:
IMcpToolCallingLoopPromptContext
;
}
export
class
McpToolCallingLoop
extends
ToolCallingLoop< IMcpToolCallingLoopOptions>
{
public
static
readonly
ID
=
'mcpToolSetupLoop'
;
constructor
(
:
IMcpToolCallingLoopOptions
,
IInstantiationService
private
readonly
:
IInstantiationService
,
ILogService
:
ILogService
,
IRequestLogger
:
IRequestLogger
,
IEndpointProvider
private
readonly
:
IEndpointProvider
,
IAuthenticationChatUpgradeService
:
IAuthenticationChatUpgradeService
,
ITelemetryService
:
ITelemetryService
,
IConfigurationService
:
IConfigurationService
,
IExperimentationService
:
IExperimentationService
,
IChatHookService
:
IChatHookService
,
ISessionTranscriptService
:
ISessionTranscriptService
,
IFileSystemService
:
IFileSystemService
,
IOTelService
:
IOTelService
,
IGitService
:
IGitService
,
)
{
super
(
,
,
,
,
,
,
,
,
,
,
,
,
,
)
;
}
private
async
getEndpoint
(
)
{
return
await
this
.
endpointProvider
.
getChatEndpoint
(
'copilot-utility-small'
)
;
}
protected
async
buildPrompt
(
:
IBuildPromptContext
,
:
Progress
<
ChatResponseReferencePart
|
ChatResponseProgressPart
>
,
:
CancellationToken
)
:
Promise
<
IBuildPromptResult
>
{
const
=
await
this
.
getEndpoint
(
)
;
const
=
PromptRenderer
.
create
(
this
.
instantiationService
,
,
McpToolCallingLoopPrompt
,
{
:
,
...
this
.
options
.
props
}
)
;
return
await
.
render
(
,
)
;
}
protected
async
getAvailableTools
(
)
:
Promise
<
LanguageModelToolInformation
[
]
>
{
if
(
this
.
options
.
conversation
.
turns
.
length
>
5
)
{
return
[
]
;
}
return
[
{
:
QuickInputTool
.
description
,
:
QuickInputTool
.
ID
,
:
QuickInputTool
.
schema
,
:
undefined
,
:
[
]
,
}
,
{
:
QuickPickTool
.
description
,
:
QuickPickTool
.
ID
,
:
QuickPickTool
.
schema
,
:
undefined
,
:
[
]
,
}
]
;
}
protected
async
fetch
(
:
ToolCallingLoopFetchOptions
,
:
CancellationToken
)
:
Promise
<
ChatResponse
>
{
const
=
await
this
.
getEndpoint
(
)
;
return
.
makeChatRequest2
(
{
...
,
:
McpToolCallingLoop
.
ID
,
location
:
ChatLocation
.
Agent
,
:
{
...
.
requestOptions
,
:
0
}
,
}
,
)
;
}
}