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 / prompts / node / inline / inlineChatEditMarkdownPrompt.tsx 122 строк · изменён 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
import { PromptElement , PromptSizing , SystemMessage , UserMessage } from '@vscode/prompt-tsx' ;
import { IIgnoreService } from '../../../../platform/ignore/common/ignoreService' ;
import { isNotebookCellOrNotebookChatInput } from '../../../../util/common/notebooks' ;
import { illegalArgument } from '../../../../util/vs/base/common/errors' ;
import { IInstantiationService } from '../../../../util/vs/platform/instantiation/common/instantiation' ;
import
props
@ _ignoreService
@ _instantiationService
props
state sizing
context
context
languageId
languageId
isIgnored context
isIgnored
data
context
context
query history chatVariables
splitDoc splitDoc
splitDoc
line line data
data
{
GenericInlinePromptProps
}
from
'../../../context/node/resolvers/genericInlineIntentInvocation'
;
import
{ SelectionSplitKind , SummarizedDocumentData , SummarizedDocumentWithSelection }
from
'../../../intents/node/testIntent/summarizedDocumentWithSelection'
;
import
{ EarlyStopping , LeadingMarkdownStreaming }
from
'../../../prompt/node/intents'
;
import
{ TextPieceClassifiers }
from
'../../../prompt/node/streamingEdits'
;
import
{ InstructionMessage }
from
'../base/instructionMessage'
;
import
{ LegacySafetyRules }
from
'../base/safetyRules'
;
import
{ Tag }
from
'../base/tag'
;
import
{ ChatToolReferences , ChatVariables , UserQuery }
from
'../panel/chatVariables'
;
import
{ HistoryWithInstructions }
from
'../panel/conversationHistory'
;
import
{ CustomInstructions }
from
'../panel/customInstructions'
;
import
{ MarkdownBlock }
from
'./inlineChatGenerateMarkdownPrompt'
;
import
{ SummarizedDocumentSplit }
from
'./promptingSummarizedDocument'
;
export
interface
InlineChatEditMarkdownPromptProps
extends
GenericInlinePromptProps
{
}
export
class
InlineChatEditMarkdownPrompt
extends
PromptElement< InlineChatEditMarkdownPromptProps>
{
constructor
(
:
InlineChatEditMarkdownPromptProps
,
IIgnoreService
private
readonly
:
IIgnoreService
,
IInstantiationService
private
readonly
:
IInstantiationService
)
{
super
(
)
;
}
async
render
(
:
void
,
:
PromptSizing
)
{
const
=
this
.
props
.
documentContext
;
const
document
=
.
document
;
const
=
document
.
languageId
;
if
(
isNotebookCellOrNotebookChatInput
(
this
.
props
.
documentContext
.
document
.
uri
)
)
{
throw
illegalArgument
(
'InlineChatEditMarkdownPrompt should not be used with a notebook!'
)
;
}
if
(
!==
'markdown'
)
{
throw
illegalArgument
(
'InlineChatEditMarkdownPrompt should only be used with markdown documents!'
)
;
}
const
=
await
this
.
_ignoreService
.
isCopilotIgnored
(
.
document
.
uri
)
;
if
(
)
{
return
< ignoredFiles value = { [ this . props . documentContext . document . uri ] } />
;
}
const
=
await
this
.
_instantiationService
.
invokeFunction
(
SummarizedDocumentData
.
create
,
document
,
.
fileIndentInfo
,
.
wholeRange
,
SelectionSplitKind
.
Adjusted
)
;
const
{
,
,
,
}
=
this
.
props
.
promptContext
;
const
replyInterpreterFn
=
(
:
SummarizedDocumentSplit
)
=>
.
createReplyInterpreter
(
LeadingMarkdownStreaming
.
Mute
,
EarlyStopping
.
None
,
.
replaceSelectionStreaming
,
TextPieceClassifiers
.
createFencedBlockClassifier
(
MarkdownBlock
.
FenceSequence
)
,
=>
.
value
.
trim
(
)
!==
.
placeholderText
)
;
return
(
< >
{
}
< SystemMessage priority = { 1000 } >
You are an AI programming assistant.
< br />
When asked for your name, you must respond with "GitHub Copilot".
< br />
You are a world class markdown editor, very well versed in programming.
< br />
The user needs help to modify some markdown content.
< br />
< LegacySafetyRules />
</ SystemMessage >
< HistoryWithInstructions inline = { true } historyPriority = { 700 } passPriority history = { history} >
< InstructionMessage priority = { 1000 } >
The markdown is always delimited by
{
MarkdownBlock
.
FenceSequence
}
.
< br />
Your answer must begin and end with
{
MarkdownBlock
.
FenceSequence
}
.
< br />
</ InstructionMessage >
</ HistoryWithInstructions >
< UserMessage priority = { 725 } >
< CustomInstructions languageId = { languageId} chatVariables = { chatVariables} />
</ UserMessage >
< ChatToolReferences priority = { 750 } promptContext = { this . props . promptContext } flexGrow = { 1 } embeddedInsideUserMessage = { false } />
< ChatVariables priority = { 750 } chatVariables = { chatVariables} embeddedInsideUserMessage = { false } />
< UserMessage priority = { 900 }
flexGrow = { 2 }
flexReserve = { sizing. endpoint . modelMaxPromptTokens / 3 } >
< SummarizedDocumentWithSelection
documentData = { data}
createReplyInterpreter = { replyInterpreterFn}
tokenBudget = { 'usePromptSizingBudget' }
/>
< Tag name = ' userPrompt' >
< UserQuery chatVariables = { chatVariables} query = { query} />
<br />
The rewritten markdown content that would fit at
{
.
placeholderText
}
wrapped with
{
MarkdownBlock
.
FenceSequence
}
is:
</ Tag >
</ UserMessage >
</ >
)
;
}
}