|
@@ -18,7 +18,7 @@ import { supportPrompt } from "../../shared/support-prompt"
|
|
|
import { GlobalFileNames } from "../../shared/globalFileNames"
|
|
import { GlobalFileNames } from "../../shared/globalFileNames"
|
|
|
import { HistoryItem } from "../../shared/HistoryItem"
|
|
import { HistoryItem } from "../../shared/HistoryItem"
|
|
|
import { ExtensionMessage } from "../../shared/ExtensionMessage"
|
|
import { ExtensionMessage } from "../../shared/ExtensionMessage"
|
|
|
-import { Mode, PromptComponent, defaultModeSlug } from "../../shared/modes"
|
|
|
|
|
|
|
+import { Mode, defaultModeSlug } from "../../shared/modes"
|
|
|
import { experimentDefault } from "../../shared/experiments"
|
|
import { experimentDefault } from "../../shared/experiments"
|
|
|
import { formatLanguage } from "../../shared/language"
|
|
import { formatLanguage } from "../../shared/language"
|
|
|
import { Terminal } from "../../integrations/terminal/Terminal"
|
|
import { Terminal } from "../../integrations/terminal/Terminal"
|
|
@@ -449,33 +449,21 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
|
|
|
options: Partial<
|
|
options: Partial<
|
|
|
Pick<
|
|
Pick<
|
|
|
TaskOptions,
|
|
TaskOptions,
|
|
|
- | "customInstructions"
|
|
|
|
|
- | "enableDiff"
|
|
|
|
|
- | "enableCheckpoints"
|
|
|
|
|
- | "fuzzyMatchThreshold"
|
|
|
|
|
- | "consecutiveMistakeLimit"
|
|
|
|
|
- | "experiments"
|
|
|
|
|
|
|
+ "enableDiff" | "enableCheckpoints" | "fuzzyMatchThreshold" | "consecutiveMistakeLimit" | "experiments"
|
|
|
>
|
|
>
|
|
|
> = {},
|
|
> = {},
|
|
|
) {
|
|
) {
|
|
|
const {
|
|
const {
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
- customModePrompts,
|
|
|
|
|
diffEnabled: enableDiff,
|
|
diffEnabled: enableDiff,
|
|
|
enableCheckpoints,
|
|
enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
|
- mode,
|
|
|
|
|
- customInstructions: globalInstructions,
|
|
|
|
|
experiments,
|
|
experiments,
|
|
|
} = await this.getState()
|
|
} = await this.getState()
|
|
|
|
|
|
|
|
- const modePrompt = customModePrompts?.[mode] as PromptComponent
|
|
|
|
|
- const effectiveInstructions = [globalInstructions, modePrompt?.customInstructions].filter(Boolean).join("\n\n")
|
|
|
|
|
-
|
|
|
|
|
const cline = new Task({
|
|
const cline = new Task({
|
|
|
provider: this,
|
|
provider: this,
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
- customInstructions: effectiveInstructions,
|
|
|
|
|
enableDiff,
|
|
enableDiff,
|
|
|
enableCheckpoints,
|
|
enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
@@ -503,22 +491,15 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
|
|
|
|
|
|
|
|
const {
|
|
const {
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
- customModePrompts,
|
|
|
|
|
diffEnabled: enableDiff,
|
|
diffEnabled: enableDiff,
|
|
|
enableCheckpoints,
|
|
enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
|
- mode,
|
|
|
|
|
- customInstructions: globalInstructions,
|
|
|
|
|
experiments,
|
|
experiments,
|
|
|
} = await this.getState()
|
|
} = await this.getState()
|
|
|
|
|
|
|
|
- const modePrompt = customModePrompts?.[mode] as PromptComponent
|
|
|
|
|
- const effectiveInstructions = [globalInstructions, modePrompt?.customInstructions].filter(Boolean).join("\n\n")
|
|
|
|
|
-
|
|
|
|
|
const cline = new Task({
|
|
const cline = new Task({
|
|
|
provider: this,
|
|
provider: this,
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
- customInstructions: effectiveInstructions,
|
|
|
|
|
enableDiff,
|
|
enableDiff,
|
|
|
enableCheckpoints,
|
|
enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
@@ -962,11 +943,6 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
|
|
|
async updateCustomInstructions(instructions?: string) {
|
|
async updateCustomInstructions(instructions?: string) {
|
|
|
// User may be clearing the field.
|
|
// User may be clearing the field.
|
|
|
await this.updateGlobalState("customInstructions", instructions || undefined)
|
|
await this.updateGlobalState("customInstructions", instructions || undefined)
|
|
|
-
|
|
|
|
|
- if (this.getCurrentCline()) {
|
|
|
|
|
- this.getCurrentCline()!.customInstructions = instructions || undefined
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
await this.postStateToWebview()
|
|
await this.postStateToWebview()
|
|
|
}
|
|
}
|
|
|
|
|
|