@codingame/monaco-vscode-xterm-addons-common 26.2.2 → 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +62 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugAttachment.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugAttachment.js +72 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +79 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +117 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js +11 -12
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -209
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +0 -112
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +0 -1314
|
@@ -49,6 +49,10 @@ var RenderConstants;
|
|
|
49
49
|
(function(RenderConstants) {
|
|
50
50
|
RenderConstants[RenderConstants["SmoothScrollDuration"] = 125] = "SmoothScrollDuration";
|
|
51
51
|
})(RenderConstants || (RenderConstants = {}));
|
|
52
|
+
var TextBlinkConstants;
|
|
53
|
+
(function(TextBlinkConstants) {
|
|
54
|
+
TextBlinkConstants[TextBlinkConstants["IntervalDuration"] = 600] = "IntervalDuration";
|
|
55
|
+
})(TextBlinkConstants || (TextBlinkConstants = {}));
|
|
52
56
|
function getFullBufferLineAsString(lineIndex, buffer) {
|
|
53
57
|
let line = buffer.getLine(lineIndex);
|
|
54
58
|
if (!line) {
|
|
@@ -202,6 +206,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
202
206
|
minimumContrastRatio: config.minimumContrastRatio,
|
|
203
207
|
tabStopWidth: config.tabStopWidth,
|
|
204
208
|
cursorBlink: config.cursorBlinking,
|
|
209
|
+
blinkIntervalDuration: config.textBlinking ? TextBlinkConstants.IntervalDuration : 0,
|
|
205
210
|
cursorStyle: vscodeToXtermCursorStyle(config.cursorStyle),
|
|
206
211
|
cursorInactiveStyle: vscodeToXtermCursorStyle(config.cursorStyleInactive),
|
|
207
212
|
cursorWidth: config.cursorWidth,
|
|
@@ -212,11 +217,11 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
212
217
|
scrollSensitivity: config.mouseWheelScrollSensitivity,
|
|
213
218
|
scrollOnEraseInDisplay: true,
|
|
214
219
|
wordSeparator: config.wordSeparators,
|
|
215
|
-
|
|
216
|
-
width: 0
|
|
217
|
-
} : {
|
|
220
|
+
scrollbar: options.disableOverviewRuler ? undefined : {
|
|
218
221
|
width: 14,
|
|
219
|
-
|
|
222
|
+
overviewRuler: {
|
|
223
|
+
showTopBorder: true
|
|
224
|
+
}
|
|
220
225
|
},
|
|
221
226
|
ignoreBracketedPasteMode: config.ignoreBracketedPasteMode,
|
|
222
227
|
rescaleOverlappingGlyphs: config.rescaleOverlappingGlyphs,
|
|
@@ -224,6 +229,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
224
229
|
kittyKeyboard: config.enableKittyKeyboardProtocol,
|
|
225
230
|
win32InputMode: config.enableWin32InputMode
|
|
226
231
|
},
|
|
232
|
+
allowTransparency: config.enableImages,
|
|
227
233
|
windowOptions: {
|
|
228
234
|
getWinSizePixels: true,
|
|
229
235
|
getCellSizePixels: true,
|
|
@@ -515,6 +521,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
515
521
|
const config = this._terminalConfigurationService.config;
|
|
516
522
|
this.raw.options.altClickMovesCursor = config.altClickMovesCursor;
|
|
517
523
|
this._setCursorBlink(config.cursorBlinking);
|
|
524
|
+
this._setTextBlinking(config.textBlinking);
|
|
518
525
|
this._setCursorStyle(config.cursorStyle);
|
|
519
526
|
this._setCursorStyleInactive(config.cursorStyleInactive);
|
|
520
527
|
this._setCursorWidth(config.cursorWidth);
|
|
@@ -532,6 +539,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
532
539
|
this.raw.options.wordSeparator = config.wordSeparators;
|
|
533
540
|
this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode;
|
|
534
541
|
this.raw.options.rescaleOverlappingGlyphs = config.rescaleOverlappingGlyphs;
|
|
542
|
+
this.raw.options.allowTransparency = config.enableImages;
|
|
535
543
|
this.raw.options.vtExtensions = {
|
|
536
544
|
kittyKeyboard: config.enableKittyKeyboardProtocol,
|
|
537
545
|
win32InputMode: config.enableWin32InputMode
|
|
@@ -599,16 +607,16 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
599
607
|
highlightLimit: XtermTerminalConstants.SearchHighlightLimit
|
|
600
608
|
}));
|
|
601
609
|
this.raw.loadAddon(this._searchAddon);
|
|
602
|
-
this._searchAddon.onDidChangeResults(results => {
|
|
610
|
+
this._store.add(this._searchAddon.onDidChangeResults(results => {
|
|
603
611
|
this._lastFindResult = results;
|
|
604
612
|
this._onDidChangeFindResults.fire(results);
|
|
605
|
-
});
|
|
606
|
-
this._searchAddon.onBeforeSearch(() => {
|
|
613
|
+
}));
|
|
614
|
+
this._store.add(this._searchAddon.onBeforeSearch(() => {
|
|
607
615
|
this._onBeforeSearch.fire();
|
|
608
|
-
});
|
|
609
|
-
this._searchAddon.onAfterSearch(() => {
|
|
616
|
+
}));
|
|
617
|
+
this._store.add(this._searchAddon.onAfterSearch(() => {
|
|
610
618
|
this._onAfterSearch.fire();
|
|
611
|
-
});
|
|
619
|
+
}));
|
|
612
620
|
return this._searchAddon;
|
|
613
621
|
});
|
|
614
622
|
}
|
|
@@ -738,7 +746,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
738
746
|
await this._clipboardService.writeText(this.raw.getSelection());
|
|
739
747
|
}
|
|
740
748
|
} else {
|
|
741
|
-
this._notificationService.warn(( localize(
|
|
749
|
+
this._notificationService.warn(( localize(13227, "The terminal has no selection to copy")));
|
|
742
750
|
}
|
|
743
751
|
}
|
|
744
752
|
_setCursorBlink(blink) {
|
|
@@ -747,6 +755,13 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
747
755
|
this.raw.refresh(0, this.raw.rows - 1);
|
|
748
756
|
}
|
|
749
757
|
}
|
|
758
|
+
_setTextBlinking(enabled) {
|
|
759
|
+
const blinkIntervalDuration = enabled ? TextBlinkConstants.IntervalDuration : 0;
|
|
760
|
+
const options = this.raw.options;
|
|
761
|
+
if (options.blinkIntervalDuration !== blinkIntervalDuration) {
|
|
762
|
+
options.blinkIntervalDuration = blinkIntervalDuration;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
750
765
|
_setCursorStyle(style) {
|
|
751
766
|
const mapped = vscodeToXtermCursorStyle(style);
|
|
752
767
|
if (this.raw.options.cursorStyle !== mapped) {
|
|
@@ -778,10 +793,10 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
778
793
|
try {
|
|
779
794
|
this.raw.loadAddon(this._webglAddon);
|
|
780
795
|
this._logService.trace("Webgl was loaded");
|
|
781
|
-
this._webglAddon.onContextLoss(() => {
|
|
796
|
+
this._store.add(this._webglAddon.onContextLoss(() => {
|
|
782
797
|
this._logService.info(`Webgl lost context, disposing of webgl renderer`);
|
|
783
798
|
this._disposeOfWebglRenderer();
|
|
784
|
-
});
|
|
799
|
+
}));
|
|
785
800
|
this._refreshImageAddon();
|
|
786
801
|
this._onDidRequestRefreshDimensions.fire();
|
|
787
802
|
} catch (e) {
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
|
|
3
|
-
import { Command } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
|
|
4
|
-
import { Action2 } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
5
|
-
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
-
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
7
|
-
import { IChatRequestVariableValue, IDynamicVariable } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariables";
|
|
8
|
-
import { IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
9
|
-
import { IChatWidgetContrib } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/widget/chatWidget";
|
|
10
|
-
export declare const dynamicVariableDecorationType = "chat-dynamic-variable";
|
|
11
|
-
export declare class ChatDynamicVariableModel extends Disposable implements IChatWidgetContrib {
|
|
12
|
-
private readonly widget;
|
|
13
|
-
private readonly labelService;
|
|
14
|
-
static readonly ID = "chatDynamicVariableModel";
|
|
15
|
-
private _variables;
|
|
16
|
-
get variables(): ReadonlyArray<IDynamicVariable>;
|
|
17
|
-
get id(): string;
|
|
18
|
-
private decorationData;
|
|
19
|
-
constructor(widget: IChatWidget, labelService: ILabelService);
|
|
20
|
-
getInputState(contrib: Record<string, unknown>): void;
|
|
21
|
-
setInputState(contrib: Readonly<Record<string, unknown>>): void;
|
|
22
|
-
addReference(ref: IDynamicVariable): void;
|
|
23
|
-
private updateDecorations;
|
|
24
|
-
private getHoverForReference;
|
|
25
|
-
/**
|
|
26
|
-
* Dispose all existing variables.
|
|
27
|
-
*/
|
|
28
|
-
private disposeVariables;
|
|
29
|
-
dispose(): void;
|
|
30
|
-
}
|
|
31
|
-
export interface IAddDynamicVariableContext {
|
|
32
|
-
id: string;
|
|
33
|
-
widget: IChatWidget;
|
|
34
|
-
range: IRange;
|
|
35
|
-
variableData: IChatRequestVariableValue;
|
|
36
|
-
command?: Command;
|
|
37
|
-
}
|
|
38
|
-
export declare class AddDynamicVariableAction extends Action2 {
|
|
39
|
-
static readonly ID = "workbench.action.chat.addDynamicVariable";
|
|
40
|
-
constructor();
|
|
41
|
-
run(accessor: ServicesAccessor, ...args: unknown[]): Promise<void>;
|
|
42
|
-
}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
4
|
-
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
5
|
-
import { Disposable, dispose, isDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
7
|
-
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
8
|
-
import { isLocation } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
9
|
-
import { Action2, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
10
|
-
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
11
|
-
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
12
|
-
import { addDynamicVariableActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant';
|
|
13
|
-
|
|
14
|
-
var ChatDynamicVariableModel_1;
|
|
15
|
-
const dynamicVariableDecorationType = "chat-dynamic-variable";
|
|
16
|
-
let ChatDynamicVariableModel = class ChatDynamicVariableModel extends Disposable {
|
|
17
|
-
static {
|
|
18
|
-
ChatDynamicVariableModel_1 = this;
|
|
19
|
-
}
|
|
20
|
-
static {
|
|
21
|
-
this.ID = "chatDynamicVariableModel";
|
|
22
|
-
}
|
|
23
|
-
get variables() {
|
|
24
|
-
return [...this._variables];
|
|
25
|
-
}
|
|
26
|
-
get id() {
|
|
27
|
-
return ChatDynamicVariableModel_1.ID;
|
|
28
|
-
}
|
|
29
|
-
constructor(widget, labelService) {
|
|
30
|
-
super();
|
|
31
|
-
this.widget = widget;
|
|
32
|
-
this.labelService = labelService;
|
|
33
|
-
this._variables = [];
|
|
34
|
-
this.decorationData = [];
|
|
35
|
-
this._register(widget.inputEditor.onDidChangeModelContent(e => {
|
|
36
|
-
const removed = [];
|
|
37
|
-
let didChange = false;
|
|
38
|
-
this._variables = coalesce(( this._variables.map((ref, idx) => {
|
|
39
|
-
const model = widget.inputEditor.getModel();
|
|
40
|
-
if (!model) {
|
|
41
|
-
removed.push(ref);
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
const data = this.decorationData[idx];
|
|
45
|
-
const newRange = model.getDecorationRange(data.id);
|
|
46
|
-
if (!newRange) {
|
|
47
|
-
removed.push(ref);
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const newText = model.getValueInRange(newRange);
|
|
51
|
-
if (newText !== data.text) {
|
|
52
|
-
this.widget.inputEditor.executeEdits(this.id, [{
|
|
53
|
-
range: newRange,
|
|
54
|
-
text: ""
|
|
55
|
-
}]);
|
|
56
|
-
this.widget.refreshParsedInput();
|
|
57
|
-
removed.push(ref);
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
if (newRange.equalsRange(ref.range)) {
|
|
61
|
-
return ref;
|
|
62
|
-
}
|
|
63
|
-
didChange = true;
|
|
64
|
-
return {
|
|
65
|
-
...ref,
|
|
66
|
-
range: newRange
|
|
67
|
-
};
|
|
68
|
-
})));
|
|
69
|
-
dispose(removed.filter(isDisposable));
|
|
70
|
-
if (didChange || removed.length > 0) {
|
|
71
|
-
this.widget.refreshParsedInput();
|
|
72
|
-
}
|
|
73
|
-
this.updateDecorations();
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
getInputState(contrib) {
|
|
77
|
-
contrib[ChatDynamicVariableModel_1.ID] = this.variables;
|
|
78
|
-
}
|
|
79
|
-
setInputState(contrib) {
|
|
80
|
-
let s = contrib[ChatDynamicVariableModel_1.ID];
|
|
81
|
-
if (!Array.isArray(s)) {
|
|
82
|
-
s = [];
|
|
83
|
-
}
|
|
84
|
-
this.disposeVariables();
|
|
85
|
-
this._variables = [];
|
|
86
|
-
for (const variable of s) {
|
|
87
|
-
if (!isDynamicVariable(variable)) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
this.addReference(variable);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
addReference(ref) {
|
|
94
|
-
this._variables.push(ref);
|
|
95
|
-
this.updateDecorations();
|
|
96
|
-
this.widget.refreshParsedInput();
|
|
97
|
-
}
|
|
98
|
-
updateDecorations() {
|
|
99
|
-
const decorationIds = this.widget.inputEditor.setDecorationsByType("chat", dynamicVariableDecorationType, ( this._variables.map(r => ({
|
|
100
|
-
range: r.range,
|
|
101
|
-
hoverMessage: this.getHoverForReference(r)
|
|
102
|
-
}))));
|
|
103
|
-
this.decorationData = [];
|
|
104
|
-
for (let i = 0; i < decorationIds.length; i++) {
|
|
105
|
-
this.decorationData.push({
|
|
106
|
-
id: decorationIds[i],
|
|
107
|
-
text: this.widget.inputEditor.getModel().getValueInRange(this._variables[i].range)
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
getHoverForReference(ref) {
|
|
112
|
-
const value = ref.data;
|
|
113
|
-
if (URI.isUri(value)) {
|
|
114
|
-
return ( new MarkdownString(this.labelService.getUriLabel(value, {
|
|
115
|
-
relative: true
|
|
116
|
-
})));
|
|
117
|
-
} else if (isLocation(value)) {
|
|
118
|
-
const prefix = ref.fullName ? ` ${ref.fullName}` : "";
|
|
119
|
-
const rangeString = `#${value.range.startLineNumber}-${value.range.endLineNumber}`;
|
|
120
|
-
return ( new MarkdownString(prefix + this.labelService.getUriLabel(value.uri, {
|
|
121
|
-
relative: true
|
|
122
|
-
}) + rangeString));
|
|
123
|
-
} else {
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
disposeVariables() {
|
|
128
|
-
for (const variable of this._variables) {
|
|
129
|
-
if (isDisposable(variable)) {
|
|
130
|
-
variable.dispose();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
dispose() {
|
|
135
|
-
this.disposeVariables();
|
|
136
|
-
super.dispose();
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
ChatDynamicVariableModel = ChatDynamicVariableModel_1 = ( __decorate([( __param(1, ILabelService))], ChatDynamicVariableModel));
|
|
140
|
-
function isDynamicVariable(obj) {
|
|
141
|
-
return obj && typeof obj.id === "string" && Range.isIRange(obj.range) && "data" in obj;
|
|
142
|
-
}
|
|
143
|
-
function isAddDynamicVariableContext(context) {
|
|
144
|
-
return "widget" in context && "range" in context && "variableData" in context;
|
|
145
|
-
}
|
|
146
|
-
class AddDynamicVariableAction extends Action2 {
|
|
147
|
-
static {
|
|
148
|
-
this.ID = addDynamicVariableActionId;
|
|
149
|
-
}
|
|
150
|
-
constructor() {
|
|
151
|
-
super({
|
|
152
|
-
id: AddDynamicVariableAction.ID,
|
|
153
|
-
title: ""
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
async run(accessor, ...args) {
|
|
157
|
-
const context = args[0];
|
|
158
|
-
if (!isAddDynamicVariableContext(context)) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
let range = context.range;
|
|
162
|
-
const variableData = context.variableData;
|
|
163
|
-
const doCleanup = () => {
|
|
164
|
-
context.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments", [{
|
|
165
|
-
range: context.range,
|
|
166
|
-
text: ``
|
|
167
|
-
}]);
|
|
168
|
-
};
|
|
169
|
-
if (context.command) {
|
|
170
|
-
const commandService = accessor.get(ICommandService);
|
|
171
|
-
const selection = await commandService.executeCommand(context.command.id, ...(context.command.arguments ?? []));
|
|
172
|
-
if (!selection) {
|
|
173
|
-
doCleanup();
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
const insertText = ":" + selection;
|
|
177
|
-
const insertRange = ( new Range(
|
|
178
|
-
range.startLineNumber,
|
|
179
|
-
range.endColumn,
|
|
180
|
-
range.endLineNumber,
|
|
181
|
-
range.endColumn + insertText.length
|
|
182
|
-
));
|
|
183
|
-
range = ( new Range(
|
|
184
|
-
range.startLineNumber,
|
|
185
|
-
range.startColumn,
|
|
186
|
-
range.endLineNumber,
|
|
187
|
-
range.endColumn + insertText.length
|
|
188
|
-
));
|
|
189
|
-
const editor = context.widget.inputEditor;
|
|
190
|
-
const success = editor.executeEdits("chatInsertDynamicVariableWithArguments", [{
|
|
191
|
-
range: insertRange,
|
|
192
|
-
text: insertText + " "
|
|
193
|
-
}]);
|
|
194
|
-
if (!success) {
|
|
195
|
-
doCleanup();
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
context.widget.getContrib(ChatDynamicVariableModel.ID)?.addReference({
|
|
200
|
-
id: context.id,
|
|
201
|
-
range: range,
|
|
202
|
-
isFile: true,
|
|
203
|
-
data: variableData
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
registerAction2(AddDynamicVariableAction);
|
|
208
|
-
|
|
209
|
-
export { AddDynamicVariableAction, ChatDynamicVariableModel, dynamicVariableDecorationType };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
2
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
-
import { IMarkerData } from "@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers";
|
|
4
|
-
import { IMarkerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers.service";
|
|
5
|
-
import { IChatModeService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service";
|
|
6
|
-
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
7
|
-
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
|
|
8
|
-
import { PromptsType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes";
|
|
9
|
-
import { ParsedPromptFile, PromptHeader } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser";
|
|
10
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
11
|
-
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
12
|
-
import { Target } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService";
|
|
13
|
-
import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service";
|
|
14
|
-
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
15
|
-
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
16
|
-
export declare const MARKERS_OWNER_ID = "prompts-diagnostics-provider";
|
|
17
|
-
export declare class PromptValidator {
|
|
18
|
-
private readonly languageModelsService;
|
|
19
|
-
private readonly languageModelToolsService;
|
|
20
|
-
private readonly chatModeService;
|
|
21
|
-
private readonly fileService;
|
|
22
|
-
private readonly labelService;
|
|
23
|
-
private readonly promptsService;
|
|
24
|
-
constructor(languageModelsService: ILanguageModelsService, languageModelToolsService: ILanguageModelToolsService, chatModeService: IChatModeService, fileService: IFileService, labelService: ILabelService, promptsService: IPromptsService);
|
|
25
|
-
validate(promptAST: ParsedPromptFile, promptType: PromptsType, report: (markers: IMarkerData) => void): Promise<void>;
|
|
26
|
-
private validateFileName;
|
|
27
|
-
private validateSkillFolderName;
|
|
28
|
-
private validateBody;
|
|
29
|
-
private validateHeader;
|
|
30
|
-
private checkForInvalidArguments;
|
|
31
|
-
private validateName;
|
|
32
|
-
private validateDescription;
|
|
33
|
-
private validateArgumentHint;
|
|
34
|
-
private validateModel;
|
|
35
|
-
private validateClaudeAttributes;
|
|
36
|
-
private findModelByName;
|
|
37
|
-
private validateAgent;
|
|
38
|
-
private validateAgentValue;
|
|
39
|
-
private validateTools;
|
|
40
|
-
private validateVSCodeTools;
|
|
41
|
-
private validateApplyTo;
|
|
42
|
-
private validatePaths;
|
|
43
|
-
private validateExcludeAgent;
|
|
44
|
-
private validateHandoffs;
|
|
45
|
-
private validateInfer;
|
|
46
|
-
private validateTarget;
|
|
47
|
-
private validateUserInvokable;
|
|
48
|
-
private validateDisableModelInvocation;
|
|
49
|
-
private validateAgentsAttribute;
|
|
50
|
-
}
|
|
51
|
-
export declare function getValidAttributeNames(promptType: PromptsType, includeNonRecommended: boolean, target: Target): string[];
|
|
52
|
-
export declare function isNonRecommendedAttribute(attributeName: string): boolean;
|
|
53
|
-
export declare function getAttributeDescription(attributeName: string, promptType: PromptsType, target: Target): string | undefined;
|
|
54
|
-
export declare const knownGithubCopilotTools: {
|
|
55
|
-
name: string;
|
|
56
|
-
description: string;
|
|
57
|
-
}[];
|
|
58
|
-
export interface IValueEntry {
|
|
59
|
-
readonly name: string;
|
|
60
|
-
readonly description?: string;
|
|
61
|
-
}
|
|
62
|
-
export declare const knownClaudeTools: {
|
|
63
|
-
name: string;
|
|
64
|
-
description: string;
|
|
65
|
-
toolEquivalent: string[];
|
|
66
|
-
}[];
|
|
67
|
-
export declare const knownClaudeModels: ({
|
|
68
|
-
name: string;
|
|
69
|
-
description: string;
|
|
70
|
-
modelEquivalent: string;
|
|
71
|
-
} | {
|
|
72
|
-
name: string;
|
|
73
|
-
description: string;
|
|
74
|
-
modelEquivalent: undefined;
|
|
75
|
-
})[];
|
|
76
|
-
export declare function mapClaudeModels(claudeModelNames: readonly string[]): readonly string[];
|
|
77
|
-
/**
|
|
78
|
-
* Maps Claude tool names to their VS Code tool equivalents.
|
|
79
|
-
*/
|
|
80
|
-
export declare function mapClaudeTools(claudeToolNames: readonly string[]): string[];
|
|
81
|
-
export declare const claudeAgentAttributes: Record<string, {
|
|
82
|
-
type: string;
|
|
83
|
-
description: string;
|
|
84
|
-
defaults?: string[];
|
|
85
|
-
items?: IValueEntry[];
|
|
86
|
-
enums?: IValueEntry[];
|
|
87
|
-
}>;
|
|
88
|
-
/**
|
|
89
|
-
* Attributes supported in Claude rules files (`.claude/rules/*.md`).
|
|
90
|
-
* Claude rules use `paths` instead of `applyTo` for glob patterns.
|
|
91
|
-
*/
|
|
92
|
-
export declare const claudeRulesAttributes: Record<string, {
|
|
93
|
-
type: string;
|
|
94
|
-
description: string;
|
|
95
|
-
defaults?: string[];
|
|
96
|
-
items?: IValueEntry[];
|
|
97
|
-
enums?: IValueEntry[];
|
|
98
|
-
}>;
|
|
99
|
-
export declare function isVSCodeOrDefaultTarget(target: Target): boolean;
|
|
100
|
-
export declare function getTarget(promptType: PromptsType, header: PromptHeader | URI): Target;
|
|
101
|
-
export declare class PromptValidatorContribution extends Disposable {
|
|
102
|
-
private modelService;
|
|
103
|
-
private readonly markerService;
|
|
104
|
-
private readonly promptsService;
|
|
105
|
-
private readonly languageModelsService;
|
|
106
|
-
private readonly languageModelToolsService;
|
|
107
|
-
private readonly chatModeService;
|
|
108
|
-
private readonly validator;
|
|
109
|
-
private readonly localDisposables;
|
|
110
|
-
constructor(modelService: IModelService, instantiationService: IInstantiationService, markerService: IMarkerService, promptsService: IPromptsService, languageModelsService: ILanguageModelsService, languageModelToolsService: ILanguageModelToolsService, chatModeService: IChatModeService);
|
|
111
|
-
updateRegistration(): void;
|
|
112
|
-
}
|