Merge branch 'main' of https://github.com/continuedev/continue into AlanNggg/fix-6749-template-helper-error
This commit is contained in:
commit
8f00f538a3
36 changed files with 58071 additions and 2085 deletions
2
.github/workflows/cli-pr-checks.yml
vendored
2
.github/workflows/cli-pr-checks.yml
vendored
|
|
@ -3,6 +3,8 @@ name: CLI PR Checks
|
|||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
15
.github/workflows/pr-checks.yaml
vendored
15
.github/workflows/pr-checks.yaml
vendored
|
|
@ -5,10 +5,14 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
|
||||
jobs:
|
||||
track-rerun:
|
||||
|
|
@ -334,6 +338,17 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Free disk space
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
tool-cache: false
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
large-packages: false
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- name: Run JetBrains tests
|
||||
uses: ./.github/actions/run-jetbrains-tests
|
||||
|
|
|
|||
59029
binary/package-lock.json
generated
59029
binary/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,13 +1,13 @@
|
|||
import {
|
||||
BlockType,
|
||||
ConfigYaml,
|
||||
createRuleMarkdown,
|
||||
createPromptMarkdown,
|
||||
RULE_FILE_EXTENSION,
|
||||
createRuleMarkdown,
|
||||
} from "@continuedev/config-yaml";
|
||||
import * as YAML from "yaml";
|
||||
import { IDE } from "../..";
|
||||
import { getContinueGlobalPath } from "../../util/paths";
|
||||
import { localPathToUri } from "../../util/pathToUri";
|
||||
import { joinPathsToUri } from "../../util/uri";
|
||||
|
||||
const BLOCK_TYPE_CONFIG: Record<
|
||||
|
|
@ -165,7 +165,7 @@ export async function createNewWorkspaceBlockFile(
|
|||
|
||||
export async function createNewGlobalRuleFile(ide: IDE): Promise<void> {
|
||||
try {
|
||||
const globalDir = getContinueGlobalPath();
|
||||
const globalDir = localPathToUri(getContinueGlobalPath());
|
||||
|
||||
// Create the rules subdirectory within the global directory
|
||||
const rulesDir = joinPathsToUri(globalDir, "rules");
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const RULES = [
|
|||
`Whenever any part of the code is the same as before, you may simply indicate this with a comment that says "${UNCHANGED_CODE}" instead of rewriting.`,
|
||||
"You must keep at least one line above and below from the original code, so that we can identify what the previous code was.",
|
||||
`Do not place miscellaneous "${UNCHANGED_CODE}" comments at the top or bottom of the file when there is nothing to replace them.`,
|
||||
"Leave existing comments in place unless changes require modifying them.",
|
||||
// `You should write "${UNCHANGED_CODE}" at least for each function that is unchanged, rather than grouping them into a single comment.`,
|
||||
// `You should lean toward using a smaller number of these comments rather than rewriting it for every function if all of them are unchanged.`,
|
||||
// `You may do this for imports as well if needed.`,
|
||||
|
|
@ -21,7 +22,7 @@ const RULES = [
|
|||
"The code should always be syntactically valid, even with the comments.",
|
||||
];
|
||||
|
||||
function claude35SonnetLazyApplyPrompt(
|
||||
function claudeSonnetLazyApplyPrompt(
|
||||
...args: Parameters<LazyApplyPrompt>
|
||||
): ReturnType<LazyApplyPrompt> {
|
||||
const userContent = dedent`
|
||||
|
|
@ -55,7 +56,7 @@ export function lazyApplyPromptForModel(
|
|||
provider: string,
|
||||
): LazyApplyPrompt | undefined {
|
||||
if (model.includes("sonnet")) {
|
||||
return claude35SonnetLazyApplyPrompt;
|
||||
return claudeSonnetLazyApplyPrompt;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
|
|
|||
|
|
@ -7,19 +7,7 @@ const simplifiedEditPrompt = `Consider the following code:
|
|||
\`\`\`
|
||||
Edit the code to perfectly satisfy the following user request:
|
||||
{{{userInput}}}
|
||||
Output nothing except for the code. No code block, no English explanation, no start/end tags.`;
|
||||
|
||||
const simplestEditPrompt = `Here is the code before editing:
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
\`\`\`
|
||||
|
||||
Here is the edit requested:
|
||||
"{{{userInput}}}"
|
||||
|
||||
Here is the code after editing:`;
|
||||
|
||||
const codellamaInfillEditPrompt = "{{filePrefix}}<FILL>{{fileSuffix}}";
|
||||
Output nothing except for the code. No code block, no English explanation, no start/end tags. Leave existing comments in place unless changes require modifying them.`;
|
||||
|
||||
const START_TAG = "<START EDITING HERE>";
|
||||
const osModelsEditPrompt: PromptTemplate = (history, otherData) => {
|
||||
|
|
@ -55,7 +43,7 @@ ${otherData.codeToEdit}
|
|||
${suffixTag}
|
||||
\`\`\`
|
||||
|
||||
Please rewrite the entire code block above in order to satisfy the following request: "${otherData.userInput}". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.${suffixExplanation}`,
|
||||
Please rewrite the entire code block above in order to satisfy the following request: "${otherData.userInput}". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before. Leave existing comments in place unless changes require modifying them.${suffixExplanation}`,
|
||||
},
|
||||
{
|
||||
role: "assistant",
|
||||
|
|
@ -75,7 +63,7 @@ ${otherData.codeToEdit}
|
|||
${suffixTag}
|
||||
\`\`\`
|
||||
|
||||
Please rewrite the entire code block above, editing the portion below "${START_TAG}" in order to satisfy the following request: "${otherData.userInput}". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.${suffixExplanation}
|
||||
Please rewrite the entire code block above, editing the portion below "${START_TAG}" in order to satisfy the following request: "${otherData.userInput}". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before. Leave existing comments in place unless changes require modifying them.${suffixExplanation}
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
@ -93,12 +81,12 @@ const mistralEditPrompt = `[INST] You are a helpful code assistant. Your task is
|
|||
{{{codeToEdit}}}
|
||||
\`\`\`
|
||||
|
||||
Just rewrite the code without explanations: [/INST]
|
||||
Leave existing comments in place unless changes require modifying them. Just rewrite the code without explanations: [/INST]
|
||||
\`\`\`{{{language}}}`;
|
||||
|
||||
const alpacaEditPrompt = `Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
||||
|
||||
### Instruction: Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
### Instruction: Leave existing comments in place unless changes require modifying them. Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
|
||||
### Input:
|
||||
|
||||
|
|
@ -116,7 +104,7 @@ const phindEditPrompt = `### System Prompt
|
|||
You are an expert programmer and write code on the first attempt without any errors or fillers.
|
||||
|
||||
### User Message:
|
||||
Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
Leave existing comments in place unless changes require modifying them. Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
|
|
@ -131,7 +119,7 @@ Sure! Here's the code you requested:
|
|||
const deepseekEditPrompt = `### System Prompt
|
||||
You are an AI programming assistant, utilizing the DeepSeek Coder model, developed by DeepSeek Company, and your role is to assist with questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will not answer.
|
||||
### Instruction:
|
||||
Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
Leave existing comments in place unless changes require modifying them. Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
|
|
@ -145,7 +133,7 @@ Sure! Here's the code you requested:
|
|||
const zephyrEditPrompt = `<|system|>
|
||||
You are an expert programmer and write code on the first attempt without any errors or fillers.</s>
|
||||
<|user|>
|
||||
Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
Leave existing comments in place unless changes require modifying them. Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
|
|
@ -160,12 +148,12 @@ const openchatEditPrompt = `GPT4 Correct User: You are an expert programmer and
|
|||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
\`\`\`
|
||||
Please only respond with code and put it inside of a markdown code block. Do not give any explanation, but your code should perfectly satisfy the user request.<|end_of_turn|>GPT4 Correct Assistant: Sure thing! Here is the rewritten code that you requested:
|
||||
Please only respond with code and put it inside of a markdown code block. Do not give any explanation, but your code should perfectly satisfy the user request. Leave existing comments in place unless changes require modifying them.<|end_of_turn|>GPT4 Correct Assistant: Sure thing! Here is the rewritten code that you requested:
|
||||
\`\`\`{{{language}}}
|
||||
`;
|
||||
|
||||
const xWinCoderEditPrompt = `<system>: You are an AI coding agent that helps people with programming. Write a response that appropriately completes the user's request.
|
||||
<user>: Please rewrite the following code with these instructions: "{{{userInput}}}"
|
||||
<user>: Please rewrite the following code (without changing existing code comments) with these instructions: "{{{userInput}}}"
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
\`\`\`
|
||||
|
|
@ -177,7 +165,7 @@ Just rewrite the code without explanations:
|
|||
const neuralChatEditPrompt = `### System:
|
||||
You are an expert programmer and write code on the first attempt without any errors or fillers.
|
||||
### User:
|
||||
Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
Rewrite the code (without changing existing code comments) to satisfy this request: "{{{userInput}}}"
|
||||
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
|
|
@ -188,7 +176,7 @@ Sure! Here's the code you requested:
|
|||
\`\`\`{{{language}}}
|
||||
`;
|
||||
|
||||
const codeLlama70bEditPrompt = `<s>Source: system\n\n You are an expert programmer and write code on the first attempt without any errors or fillers. <step> Source: user\n\n Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
const codeLlama70bEditPrompt = `<s>Source: system\n\n You are an expert programmer and write code on the first attempt without any errors or fillers. <step> Source: user\n\n Rewrite the code (without changing existing code comments) to satisfy this request: "{{{userInput}}}"
|
||||
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
|
|
@ -209,7 +197,7 @@ You are an expert programmer. You will rewrite the above code to do the followin
|
|||
|
||||
${otherData.userInput}
|
||||
|
||||
Output only a code block with the rewritten code:
|
||||
Leave existing comments in place unless changes require modifying them. Output only a code block with the rewritten code:
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
@ -224,12 +212,12 @@ const llama3EditPrompt: PromptTemplate = `<|begin_of_text|><|start_header_id|>us
|
|||
{{{codeToEdit}}}
|
||||
\`\`\`
|
||||
|
||||
Rewrite the above code to satisfy this request: "{{{userInput}}}"<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
||||
Rewrite the above code to satisfy this request (without changing existing code comments): "{{{userInput}}}"<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
||||
Sure! Here's the code you requested:
|
||||
\`\`\`{{{language}}}`;
|
||||
|
||||
const gemmaEditPrompt = `<start_of_turn>user
|
||||
You are an expert programmer and write code on the first attempt without any errors or fillers. Rewrite the code to satisfy this request: "{{{userInput}}}"
|
||||
You are an expert programmer and write code on the first attempt without any errors or fillers. Rewrite the code to satisfy this request (without changing existing code comments): "{{{userInput}}}"
|
||||
|
||||
\`\`\`{{{language}}}
|
||||
{{{codeToEdit}}}
|
||||
|
|
@ -244,7 +232,6 @@ export {
|
|||
alpacaEditPrompt,
|
||||
claudeEditPrompt,
|
||||
codeLlama70bEditPrompt,
|
||||
codellamaInfillEditPrompt,
|
||||
deepseekEditPrompt,
|
||||
gemmaEditPrompt,
|
||||
gptEditPrompt,
|
||||
|
|
@ -254,7 +241,6 @@ export {
|
|||
openchatEditPrompt,
|
||||
osModelsEditPrompt,
|
||||
phindEditPrompt,
|
||||
simplestEditPrompt,
|
||||
simplifiedEditPrompt,
|
||||
xWinCoderEditPrompt,
|
||||
zephyrEditPrompt,
|
||||
|
|
|
|||
|
|
@ -76,5 +76,5 @@ export const defaultApplyPrompt: PromptTemplateFunction = (
|
|||
history,
|
||||
otherData,
|
||||
) => {
|
||||
return `${otherData.original_code}\n\nThe following code was suggested as an edit:\n\`\`\`\n${otherData.new_code}\n\`\`\`\nPlease apply it to the previous code. Do not change comments unless explicitly requested.`;
|
||||
return `${otherData.original_code}\n\nThe following code was suggested as an edit:\n\`\`\`\n${otherData.new_code}\n\`\`\`\nPlease apply it to the previous code. Leave existing comments in place unless changes require modifying them.`;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -461,9 +461,13 @@ export class NextEditProvider {
|
|||
// prompts[1] extracts the user prompt from the system-user prompt pair.
|
||||
// NOTE: Stream is currently set to false, but this should ideally be a per-model flag.
|
||||
// Mercury Coder currently does not support streaming.
|
||||
const msg: ChatMessage = await llm.chat([prompts[1]], token, {
|
||||
stream: false,
|
||||
});
|
||||
const msg: ChatMessage = await llm.chat(
|
||||
this.endpointType === "fineTuned" ? [prompts[1]] : prompts,
|
||||
token,
|
||||
{
|
||||
stream: false,
|
||||
},
|
||||
);
|
||||
|
||||
if (typeof msg.content !== "string") {
|
||||
return undefined;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"theme": "mint",
|
||||
"name": "Continue",
|
||||
"banner": {
|
||||
"content": "Continue CLI v1.5.1 is live 🚀 Learn how you can leverage the CLI with our [MCP Cookbooks](https://docs.continue.dev/guides/overview#mcp-integration-cookbooks)",
|
||||
"content": "Check out our new look in Mission Control. It's now easier than ever to create [Workflows](https://hub.continue.dev/workflows), [Integrate with the tools you use](https://hub.continue.dev/integrations), and to create a one-off Task.",
|
||||
"dismissable": true
|
||||
},
|
||||
"colors": {
|
||||
|
|
@ -48,6 +48,7 @@
|
|||
"mission-control/integrations",
|
||||
"mission-control/integrations/github",
|
||||
"mission-control/integrations/sentry",
|
||||
"mission-control/integrations/snyk",
|
||||
"mission-control/integrations/slack-agent"
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,6 +4,24 @@ description: "Build an AI-powered error monitoring workflow that analyzes Sentry
|
|||
sidebarTitle: "Sentry Automated Error Analysis with MCP"
|
||||
---
|
||||
|
||||
<Note>
|
||||
|
||||
**🚀 New: Sentry Mission Control Integration with Continuous AI**
|
||||
|
||||
The new [Sentry Mission Control Integration](/mission-control/integrations/sentry) enables **[Continuous AI](/guides/continuous-ai)** for error monitoring - where AI agents autonomously detect, analyze, and fix production errors. When Sentry detects an issue, your agent automatically analyzes it, generates a fix, creates a PR, and validates the solution without manual intervention.
|
||||
|
||||
**Mission Control Benefits:**
|
||||
- **Webhook-based triggers** - Automatically respond when new errors occur in production
|
||||
- **Centralized error workflows** - Manage all error monitoring Tasks from one dashboard
|
||||
- **Dedicated inbox view** - Monitor all Sentry-related agent activity at [hub.continue.dev/inbox?view=sentry](https://hub.continue.dev/inbox?view=sentry)
|
||||
- **Metrics & intervention rates** - Track how often agents successfully fix errors without human help
|
||||
|
||||
This represents **[Level 2 Continuous AI](/guides/continuous-ai#the-continuous-ai-maturity-model)**: AI handles routine error analysis and fixes autonomously while developers focus on complex problems. As outlined in our [Continuous AI guide](/guides/continuous-ai#best-practices-for-sustainable-continuous-ai), this reduces mean time to resolution (MTTR) and improves application reliability.
|
||||
|
||||
**Get Started:** Use this cookbook to understand error monitoring fundamentals, then [enable Mission Control](/mission-control/integrations/sentry) to deploy autonomous error-fixing agents across your organization.
|
||||
|
||||
</Note>
|
||||
|
||||
<Card title="What You'll Build" icon="bug">
|
||||
An automated error monitoring system that uses Continue CLI with Sentry MCP to analyze production errors, identify root causes with AI, and create detailed GitHub issues with suggested fixes.
|
||||
</Card>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,24 @@ description: "Set up an AI-powered security workflow that automatically scans yo
|
|||
sidebarTitle: "Snyk Security Scanning with Continue"
|
||||
---
|
||||
|
||||
<Note>
|
||||
|
||||
**🚀 New: Snyk Mission Control Integration with Continuous AI**
|
||||
|
||||
The new [Snyk Mission Control Integration](/mission-control/integrations/snyk) enables **[Continuous AI](/guides/continuous-ai)** - where AI agents autonomously detect, analyze, and fix vulnerabilities. When Snyk detects an issue, your agent automatically generates a fix, creates a PR, and validates the solution without manual intervention.
|
||||
|
||||
**Mission Control Benefits:**
|
||||
- **One-click OAuth** - No tokens, no configuration files, just connect and go
|
||||
- **Centralized workflows** - Manage all security Tasks and automations from one dashboard
|
||||
- **Webhook triggers** - Automatically respond to new vulnerabilities as they're discovered
|
||||
- **Metrics & intervention rates** - Track how often agents successfully fix issues without human help
|
||||
|
||||
This represents **[Level 2 Continuous AI](/guides/continuous-ai#the-continuous-ai-maturity-model)**: AI handles routine security work autonomously while developers focus on complex problems. As outlined in our [Continuous AI guide](/guides/continuous-ai#best-practices-for-sustainable-continuous-ai), this reduces intervention rates and accelerates secure development.
|
||||
|
||||
**Get Started:** Use this cookbook to understand the fundamentals, then [enable Mission Control](/mission-control/integrations/snyk) to deploy autonomous security agents across your organization.
|
||||
|
||||
</Note>
|
||||
|
||||
<Card title="What You'll Build" icon="shield-halved">
|
||||
An automated security scanning system that uses Continue's AI agent with Snyk
|
||||
MCP to identify vulnerabilities in code, dependencies, infrastructure, and
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ description: "Create, run, and automate AI agents across Mission Control, termin
|
|||
Connect Continue to your existing developer tools to power Tasks and Workflows.
|
||||
</Note>
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<CardGroup cols={2}>
|
||||
<Card title="GitHub" icon="github" href="/mission-control/integrations/github">
|
||||
Enable repository access for Agents to read and create PRs.
|
||||
</Card>
|
||||
|
|
@ -43,6 +43,9 @@ description: "Create, run, and automate AI agents across Mission Control, termin
|
|||
<Card title="Sentry" icon="alert-triangle" href="/mission-control/integrations/sentry">
|
||||
Automatically generate PRs to fix new issues from Sentry alerts.
|
||||
</Card>
|
||||
<Card title="Snyk" icon="shield-check" href="/mission-control/integrations/snyk">
|
||||
Detect and fix security vulnerabilities automatically.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
|
|
@ -139,6 +142,6 @@ description: "Create, run, and automate AI agents across Mission Control, termin
|
|||
icon="plug"
|
||||
href="/mission-control/integrations"
|
||||
>
|
||||
Connect GitHub, Slack, and Sentry to power your automations.
|
||||
Connect GitHub, Slack, Sentry, and Snyk to power your automations.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ description: "Custom configuration options include Models, MCP Servers, Rules, P
|
|||
sidebarTitle: "Configs"
|
||||
---
|
||||
|
||||
<Info>
|
||||
**New UI Update: The Hub is now Mission Control.**
|
||||
If you're returning after the redesign, you can now find and manage configs in your [Mission Control Settings](https://hub.continue.dev/settings/configs).
|
||||
</Info>
|
||||
|
||||
## What Are Configs?
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: "Overview"
|
||||
description: "Connect GitHub, Slack, and Sentry to power richer Agents, Tasks, and Workflows."
|
||||
description: "Connect GitHub, Slack, Sentry, and Snyk to power richer Agents, Tasks, and Workflows."
|
||||
sidebarTitle: "Overview"
|
||||
---
|
||||
|
||||
|
|
@ -8,9 +8,9 @@ sidebarTitle: "Overview"
|
|||
Integrations let Continue connect to the tools you already use, so Agents can read code, open pull requests, send messages, react to real-world events, and more.
|
||||
</Info>
|
||||
|
||||
Mission Control currently supports three first-class integrations:
|
||||
Mission Control currently supports four first-class integrations:
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<CardGroup cols={2}>
|
||||
|
||||
<Card title="GitHub" icon="github" href="/mission-control/integrations/github">
|
||||
Required for PR creation, repo access, diffs, and workflow triggers.
|
||||
|
|
@ -24,6 +24,10 @@ Mission Control currently supports three first-class integrations:
|
|||
Trigger Agents automatically when new Sentry issues appear.
|
||||
</Card>
|
||||
|
||||
<Card title="Snyk" icon="shield-check" href="/mission-control/integrations/snyk">
|
||||
Detect and fix security vulnerabilities automatically.
|
||||
</Card>
|
||||
|
||||
</CardGroup>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -249,10 +249,10 @@ Combine Sentry with GitHub integration for a complete workflow:
|
|||
|
||||
Track your agent's error resolution performance:
|
||||
|
||||
1. **View in Mission Control**: See all agent runs and their outcomes
|
||||
2. **Check Sentry**: Verify that issues are being resolved
|
||||
3. **Review PRs**: Ensure quality of generated fixes
|
||||
4. **Monitor Metrics**: Track resolution time and success rate
|
||||
1. **View in Inbox**: Navigate to the [Sentry view](https://hub.continue.dev/inbox?view=sentry) to see all Sentry-related agent activity
|
||||
2. **Check Sentry Dashboard**: Verify that issues are being resolved in your Sentry account
|
||||
3. **Review PRs**: Ensure quality of generated fixes in GitHub
|
||||
4. **Monitor Metrics**: Track mean time to resolution (MTTR) and intervention rates
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
|
|
|||
316
docs/mission-control/integrations/snyk.mdx
Normal file
316
docs/mission-control/integrations/snyk.mdx
Normal file
|
|
@ -0,0 +1,316 @@
|
|||
---
|
||||
title: "Snyk Integration"
|
||||
description: "Automatically detect and fix vulnerabilities with Continue Agents connected to Snyk"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Connect Snyk to Continue Mission Control to enable agents to automatically detect, analyze, and resolve security vulnerabilities. When Snyk is enabled, Continue can generate PRs to fix vulnerabilities, analyze security patterns, and maintain application security posture.
|
||||
|
||||
<Card title="What You Can Do with Snyk Integration" icon="shield-check">
|
||||
|
||||
- Automatically generate PRs to fix security vulnerabilities
|
||||
- Analyze dependency risks and suggest updates
|
||||
- Monitor security posture across projects
|
||||
- Create detailed vulnerability reports with remediation steps
|
||||
- Track vulnerability trends and compliance status
|
||||
|
||||
</Card>
|
||||
|
||||
## Setup
|
||||
|
||||
<Steps>
|
||||
|
||||
<Step title="Navigate to Integrations">
|
||||
|
||||
Go to your [Integrations Settings](https://hub.continue.dev/integrations).
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Connect Snyk">
|
||||
|
||||
Click "Connect" next to Snyk integration.
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Authorize with Snyk">
|
||||
|
||||
Click the "Connect with Snyk" button to authorize Continue Mission Control:
|
||||
|
||||
- You'll be redirected to Snyk's OAuth authorization page
|
||||
- Review and approve the requested permissions
|
||||
- You'll be automatically redirected back to the [Snyk inbox view](https://hub.continue.dev/inbox?view=snyk)
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Verify Connection">
|
||||
|
||||
Once redirected back, you'll see:
|
||||
- A confirmation that Snyk is connected
|
||||
- Your Snyk projects available for monitoring
|
||||
- Any active vulnerability alerts
|
||||
|
||||
</Step>
|
||||
|
||||
</Steps>
|
||||
|
||||
<Info>
|
||||
|
||||
**OAuth Authorization**: No manual token configuration needed! Simply click the authorization button and Continue will securely handle the authentication flow with Snyk.
|
||||
|
||||
</Info>
|
||||
|
||||
## Use Cases
|
||||
|
||||
### Code Vulnerability Scanning (SAST)
|
||||
|
||||
Scan your source code for security vulnerabilities:
|
||||
|
||||
<Card title="Code Security Agent" icon="code">
|
||||
|
||||
**Task Example**: "Run a Snyk Code scan on this repo with severity threshold medium. Summarize issues with file:line locations and propose minimal fixes for the top 3 critical issues."
|
||||
|
||||
**What the Agent Does**:
|
||||
- Performs static application security testing on your code
|
||||
- Identifies security vulnerabilities with exact file and line numbers
|
||||
- Prioritizes issues by severity and exploitability
|
||||
- Generates minimal, targeted fixes for critical issues
|
||||
- Re-runs scans to verify fixes resolve the vulnerabilities
|
||||
|
||||
**Run in Mission Control**: Set up as pre-commit hook or PR check
|
||||
|
||||
</Card>
|
||||
|
||||
### Dependency Scanning (SCA)
|
||||
|
||||
Check open source dependencies for known vulnerabilities:
|
||||
|
||||
<Card title="Dependency Security Agent" icon="cube">
|
||||
|
||||
**Task Example**: "Run Snyk Open Source scan including dev dependencies. Summarize vulnerable dependency paths and propose a minimal-risk upgrade plan."
|
||||
|
||||
**What the Agent Does**:
|
||||
- Performs software composition analysis on all dependencies
|
||||
- Maps vulnerability paths through dependency tree
|
||||
- Identifies minimal-risk upgrade strategies
|
||||
- Creates dependency update plans with compatibility checks
|
||||
- Re-tests after proposed changes to confirm resolution
|
||||
|
||||
**Run in Mission Control**: Schedule weekly or trigger on package updates
|
||||
|
||||
</Card>
|
||||
|
||||
### Infrastructure as Code (IaC) Security
|
||||
|
||||
Scan Terraform, CloudFormation, and Kubernetes configs:
|
||||
|
||||
<Card title="IaC Security Agent" icon="cloud">
|
||||
|
||||
**Task Example**: "Scan ./infra directory with Snyk IaC. Report high/critical misconfigurations with exact files and lines. Provide corrected configurations."
|
||||
|
||||
**What the Agent Does**:
|
||||
- Scans infrastructure code for security misconfigurations
|
||||
- Identifies exposed secrets and overly permissive policies
|
||||
- Reports exact file locations and line numbers
|
||||
- Provides secure configuration alternatives
|
||||
- Re-scans to confirm misconfigurations are resolved
|
||||
|
||||
**Run in Mission Control**: Run before infrastructure deployments
|
||||
|
||||
</Card>
|
||||
|
||||
### Container Security Scanning
|
||||
|
||||
Analyze Docker images for vulnerabilities:
|
||||
|
||||
<Card title="Container Security Agent" icon="docker">
|
||||
|
||||
**Task Example**: "Scan Docker image my-api:latest excluding base image vulnerabilities. Show dependency tree and recommend safer base images."
|
||||
|
||||
**What the Agent Does**:
|
||||
- Scans container images for OS and application vulnerabilities
|
||||
- Analyzes complete dependency tree in containers
|
||||
- Recommends security-hardened base images
|
||||
- Creates optimized Dockerfiles with security improvements
|
||||
- Re-tests after changes to verify vulnerability reduction
|
||||
|
||||
**Run in Mission Control**: Trigger on container builds or before deployments
|
||||
|
||||
</Card>
|
||||
|
||||
### Pull Request Security Scanning
|
||||
|
||||
Focus scanning on modified files:
|
||||
|
||||
<Card title="PR Security Agent" icon="code-branch">
|
||||
|
||||
**Task Example**: "Scan only files changed since origin/main with Snyk Code. Block if new high severity issues would be introduced."
|
||||
|
||||
**What the Agent Does**:
|
||||
- Targets security scanning to changed files only
|
||||
- Compares security posture before and after changes
|
||||
- Identifies newly introduced vulnerabilities
|
||||
- Shows security impact delta for the PR
|
||||
- Blocks merge if critical issues are detected
|
||||
|
||||
**Run in Mission Control**: Set up as PR check automation
|
||||
|
||||
</Card>
|
||||
|
||||
### Security Learning Integration
|
||||
|
||||
Access contextual security education:
|
||||
|
||||
<Card title="Security Education Agent" icon="graduation-cap">
|
||||
|
||||
**Task Example**: "Open Snyk Learn lessons related to the top CWE vulnerabilities from this scan."
|
||||
|
||||
**What the Agent Does**:
|
||||
- Maps vulnerabilities to Common Weakness Enumeration (CWE) categories
|
||||
- Retrieves relevant Snyk Learn educational content
|
||||
- Provides contextual security training based on actual issues
|
||||
- Links to remediation guides and best practices
|
||||
- Tracks security knowledge gaps across the team
|
||||
|
||||
**Run in Mission Control**: Run after security scans for team education
|
||||
|
||||
</Card>
|
||||
|
||||
## Running Snyk Agents in Mission Control
|
||||
|
||||
You can run Snyk-connected agents in two ways:
|
||||
|
||||
### 1. Manual Tasks
|
||||
|
||||
Trigger agents on-demand for vulnerability analysis:
|
||||
|
||||
1. Go to [Mission Control Agents](https://hub.continue.dev/agents)
|
||||
2. Select or create a Snyk-enabled agent
|
||||
3. Click "Run Agent" and provide your task description
|
||||
4. Monitor progress and review results in real-time
|
||||
|
||||
**Example Tasks:**
|
||||
- "Scan all projects for critical vulnerabilities and prioritize fixes"
|
||||
- "Update all npm dependencies with known vulnerabilities"
|
||||
- "Generate a security report for the last sprint"
|
||||
|
||||
### 2. Automated Workflows
|
||||
|
||||
Set up agents to run automatically:
|
||||
|
||||
- **Webhook-triggered**: Execute when new vulnerabilities are detected
|
||||
- **Scheduled**: Run daily or weekly security scans
|
||||
- **PR-triggered**: Scan new dependencies before merge
|
||||
|
||||
<Tip>
|
||||
|
||||
Start with manual tasks to understand your vulnerability patterns, then automate the most common remediation workflows for continuous security.
|
||||
|
||||
</Tip>
|
||||
|
||||
## Integration with GitHub
|
||||
|
||||
Combine Snyk with GitHub integration for a complete security workflow:
|
||||
|
||||
<Steps>
|
||||
|
||||
<Step title="Connect Both Integrations">
|
||||
|
||||
Enable both Snyk and GitHub integrations in Mission Control
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Create a Security Agent">
|
||||
|
||||
Build an agent that:
|
||||
- Receives Snyk vulnerability alerts
|
||||
- Analyzes the security issue in your codebase
|
||||
- Creates a PR with the security fix
|
||||
- Adds security impact analysis to the PR
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Set Up Automated Security Workflow">
|
||||
|
||||
Configure the agent to run automatically on new critical vulnerabilities
|
||||
|
||||
</Step>
|
||||
|
||||
</Steps>
|
||||
|
||||
## Monitoring Agent Activity
|
||||
|
||||
Track your agent's security remediation performance:
|
||||
|
||||
1. **View in Inbox**: Navigate to the [Snyk view](https://hub.continue.dev/inbox?view=snyk) to see all Snyk-related agent activity
|
||||
2. **Check Snyk Dashboard**: Verify that vulnerabilities are being addressed
|
||||
3. **Review PRs**: Ensure quality and security of generated fixes
|
||||
4. **Monitor Metrics**: Track mean time to remediation (MTTR) and fix rate
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
<Accordion title="OAuth authorization fails">
|
||||
|
||||
**Problem**: Can't complete the Snyk authorization flow
|
||||
|
||||
**Solutions**:
|
||||
- Ensure you have appropriate permissions in your Snyk organization
|
||||
- Check if your organization allows OAuth integrations
|
||||
- Try logging out and back into Snyk before authorizing
|
||||
- Clear browser cookies and try again
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Projects not appearing">
|
||||
|
||||
**Problem**: Snyk projects aren't visible after connection
|
||||
|
||||
**Solutions**:
|
||||
- Verify you have access to projects in Snyk
|
||||
- Check that projects are properly imported in Snyk
|
||||
- Refresh the integration connection
|
||||
- Ensure the OAuth scope includes project access
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Agent can't access vulnerability data">
|
||||
|
||||
**Problem**: Agent returns errors when trying to fetch Snyk data
|
||||
|
||||
**Solutions**:
|
||||
- Verify the OAuth connection is still valid
|
||||
- Re-authorize if the token has expired
|
||||
- Check that the agent has the necessary Snyk context provider
|
||||
- Review agent logs for specific error messages
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Webhooks not triggering">
|
||||
|
||||
**Problem**: Agent isn't running when new vulnerabilities are found
|
||||
|
||||
**Solutions**:
|
||||
- Verify webhook configuration in Snyk settings
|
||||
- Check that webhook URL points to Continue Mission Control
|
||||
- Ensure webhook events include vulnerability detection
|
||||
- Review webhook delivery logs in Snyk
|
||||
|
||||
</Accordion>
|
||||
|
||||
## Support & Resources
|
||||
|
||||
<CardGroup cols={2}>
|
||||
|
||||
<Card title="Snyk MCP Cookbook" icon="book-open" href="/guides/snyk-mcp-continue-cookbook">
|
||||
|
||||
Complete guide with security scanning recipes, CI/CD integration, and automated remediation workflows
|
||||
|
||||
</Card>
|
||||
|
||||
<Card title="GitHub Integration" icon="github" href="/mission-control/integrations/github">
|
||||
|
||||
Combine Snyk with GitHub for complete security automation
|
||||
|
||||
</Card>
|
||||
|
||||
</CardGroup>
|
||||
|
|
@ -103,6 +103,7 @@ export async function compactChatHistory(
|
|||
llmApi,
|
||||
controller,
|
||||
streamCallbacks,
|
||||
true,
|
||||
);
|
||||
|
||||
// Create the compacted history with a special marker
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import type {
|
|||
ChatCompletionTool,
|
||||
} from "openai/resources.mjs";
|
||||
|
||||
import { pruneLastMessage } from "../compaction.js";
|
||||
import { services } from "../services/index.js";
|
||||
import { posthogService } from "../telemetry/posthogService.js";
|
||||
import { telemetryService } from "../telemetry/telemetryService.js";
|
||||
|
|
@ -130,6 +131,7 @@ interface ProcessStreamingResponseOptions {
|
|||
}
|
||||
|
||||
// Process a single streaming response and return whether we need to continue
|
||||
// eslint-disable-next-line max-statements
|
||||
export async function processStreamingResponse(
|
||||
options: ProcessStreamingResponseOptions,
|
||||
): Promise<{
|
||||
|
|
@ -138,18 +140,22 @@ export async function processStreamingResponse(
|
|||
toolCalls: ToolCall[];
|
||||
shouldContinue: boolean;
|
||||
}> {
|
||||
const {
|
||||
chatHistory,
|
||||
model,
|
||||
llmApi,
|
||||
abortController,
|
||||
callbacks,
|
||||
isHeadless,
|
||||
tools,
|
||||
} = options;
|
||||
const { model, llmApi, abortController, callbacks, isHeadless, tools } =
|
||||
options;
|
||||
|
||||
let chatHistory = options.chatHistory;
|
||||
|
||||
// Validate context length before making the request
|
||||
const validation = validateContextLength(chatHistory, model);
|
||||
let validation = validateContextLength(chatHistory, model);
|
||||
|
||||
// Prune last messages until valid
|
||||
while (chatHistory.length > 1 && !validation.isValid) {
|
||||
const prunedChatHistory = pruneLastMessage(chatHistory);
|
||||
if (prunedChatHistory.length === chatHistory.length) break;
|
||||
chatHistory = prunedChatHistory;
|
||||
validation = validateContextLength(chatHistory, model);
|
||||
}
|
||||
|
||||
if (!validation.isValid) {
|
||||
throw new Error(`Context length validation failed: ${validation.error}`);
|
||||
}
|
||||
|
|
@ -323,13 +329,14 @@ export async function processStreamingResponse(
|
|||
}
|
||||
|
||||
// Main function that handles the conversation loop
|
||||
// eslint-disable-next-line complexity
|
||||
// eslint-disable-next-line complexity, max-params
|
||||
export async function streamChatResponse(
|
||||
chatHistory: ChatHistoryItem[],
|
||||
model: ModelConfig,
|
||||
llmApi: BaseLlmApi,
|
||||
abortController: AbortController,
|
||||
callbacks?: StreamCallbacks,
|
||||
isCompacting = false,
|
||||
) {
|
||||
logger.debug("streamChatResponse called", {
|
||||
model,
|
||||
|
|
@ -350,33 +357,43 @@ export async function streamChatResponse(
|
|||
chatHistorySvc.isReady()
|
||||
) {
|
||||
try {
|
||||
chatHistory = chatHistorySvc.getHistory();
|
||||
// use chat history from params when isCompacting is true
|
||||
// otherwise use the full history
|
||||
if (!isCompacting) {
|
||||
chatHistory = chatHistorySvc.getHistory();
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
logger.debug("Starting conversation iteration");
|
||||
|
||||
// Pre-API auto-compaction checkpoint
|
||||
const { wasCompacted: preCompacted, chatHistory: preCompactHistory } =
|
||||
await handleAutoCompaction(chatHistory, model, llmApi, {
|
||||
isHeadless,
|
||||
callbacks: {
|
||||
onSystemMessage: callbacks?.onSystemMessage,
|
||||
onContent: callbacks?.onContent,
|
||||
},
|
||||
});
|
||||
logger.debug("debug1 streamChatResponse history", { chatHistory });
|
||||
|
||||
if (preCompacted) {
|
||||
logger.debug("Pre-API compaction occurred, updating chat history");
|
||||
// Update chat history after pre-compaction
|
||||
const chatHistorySvc2 = services.chatHistory;
|
||||
if (
|
||||
typeof chatHistorySvc2?.isReady === "function" &&
|
||||
chatHistorySvc2.isReady()
|
||||
) {
|
||||
chatHistorySvc2.setHistory(preCompactHistory);
|
||||
chatHistory = chatHistorySvc2.getHistory();
|
||||
} else {
|
||||
chatHistory = [...preCompactHistory];
|
||||
// avoid pre-compaction when compaction is in progress
|
||||
// this also avoids infinite compaction call stacks
|
||||
if (!isCompacting) {
|
||||
// Pre-API auto-compaction checkpoint
|
||||
const { wasCompacted: preCompacted, chatHistory: preCompactHistory } =
|
||||
await handleAutoCompaction(chatHistory, model, llmApi, {
|
||||
isHeadless,
|
||||
callbacks: {
|
||||
onSystemMessage: callbacks?.onSystemMessage,
|
||||
onContent: callbacks?.onContent,
|
||||
},
|
||||
});
|
||||
|
||||
if (preCompacted) {
|
||||
logger.debug("Pre-API compaction occurred, updating chat history");
|
||||
// Update chat history after pre-compaction
|
||||
const chatHistorySvc2 = services.chatHistory;
|
||||
if (
|
||||
typeof chatHistorySvc2?.isReady === "function" &&
|
||||
chatHistorySvc2.isReady()
|
||||
) {
|
||||
chatHistorySvc2.setHistory(preCompactHistory);
|
||||
chatHistory = chatHistorySvc2.getHistory();
|
||||
} else {
|
||||
chatHistory = [...preCompactHistory];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,18 @@ import { writeFileTool } from "./writeFile.js";
|
|||
|
||||
export type { Tool, ToolCall, ToolParametersSchema };
|
||||
|
||||
/**
|
||||
* Extract the agent ID from the --id command line flag
|
||||
*/
|
||||
function getAgentIdFromArgs(): string | undefined {
|
||||
const args = process.argv;
|
||||
const idIndex = args.indexOf("--id");
|
||||
if (idIndex !== -1 && idIndex + 1 < args.length) {
|
||||
return args[idIndex + 1];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Base tools that are always available
|
||||
const BASE_BUILTIN_TOOLS: Tool[] = [
|
||||
readFileTool,
|
||||
|
|
@ -58,6 +70,21 @@ export async function getAllAvailableTools(
|
|||
): Promise<Tool[]> {
|
||||
const tools = [...BASE_BUILTIN_TOOLS];
|
||||
|
||||
// Filter out ReportFailure tool if no agent ID is present
|
||||
// (it requires --id to function and will confuse the agent if unavailable)
|
||||
const agentId = getAgentIdFromArgs();
|
||||
if (!agentId) {
|
||||
const reportFailureIndex = tools.findIndex(
|
||||
(t) => t.name === reportFailureTool.name,
|
||||
);
|
||||
if (reportFailureIndex !== -1) {
|
||||
tools.splice(reportFailureIndex, 1);
|
||||
logger.debug(
|
||||
`Filtered out ${reportFailureTool.name} tool - no agent ID present (--id flag not provided)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If model is capable, exclude editTool in favor of multiEditTool
|
||||
const modelState = await serviceContainer.get<ModelServiceState>(
|
||||
SERVICE_NAMES.MODEL,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,18 @@
|
|||
import * as nodeUtil from "util";
|
||||
|
||||
import { vi } from "vitest";
|
||||
|
||||
const execMock: any = vi.fn();
|
||||
(execMock as any)[(nodeUtil as any).promisify.custom] = (cmd: any) =>
|
||||
new Promise((resolve, reject) => {
|
||||
execMock(cmd, (err: any, stdout: any, stderr: any) => {
|
||||
if (err) reject(err);
|
||||
else resolve({ stdout, stderr });
|
||||
});
|
||||
});
|
||||
|
||||
vi.mock("child_process", () => ({ exec: execMock }));
|
||||
|
||||
// Since we want to test just the interface and not the internals,
|
||||
// let's create a simplified version of the run function to test the truncation logic
|
||||
describe("searchCodeTool", () => {
|
||||
|
|
@ -51,4 +66,30 @@ describe("searchCodeTool", () => {
|
|||
// Check that we have the expected number of lines (header + 50 content lines)
|
||||
expect(nonEmptyLines.length).toBe(51);
|
||||
});
|
||||
|
||||
describe("searchCodeTool line-length filtering", () => {
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
it("filters out lines longer than 1000 characters", async () => {
|
||||
const childProc = await import("child_process");
|
||||
const long = "a".repeat(1001);
|
||||
|
||||
vi.mocked(childProc.exec as any).mockImplementation((...args: any[]) => {
|
||||
// exec callback signature: (error, stdout, stderr)
|
||||
const cb = args[args.length - 1];
|
||||
cb(null, `path/file.ts:1:${long}\npath/file.ts:2:match`, "");
|
||||
return {} as any;
|
||||
});
|
||||
|
||||
const { searchCodeTool } = await import("./searchCode.js");
|
||||
const result = await searchCodeTool.run({ pattern: "match", path: "." });
|
||||
|
||||
expect(result).toContain("path/file.ts:2:match");
|
||||
expect(result).not.toContain(long);
|
||||
expect(result).not.toContain("[Results truncated:");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ const execPromise = util.promisify(child_process.exec);
|
|||
|
||||
// Default maximum number of results to display
|
||||
const DEFAULT_MAX_RESULTS = 100;
|
||||
const MAX_LINE_LENGTH = 1000;
|
||||
|
||||
export const searchCodeTool: Tool = {
|
||||
name: "Search",
|
||||
|
|
@ -84,7 +85,13 @@ export const searchCodeTool: Tool = {
|
|||
}
|
||||
|
||||
// Split the results into lines and limit the number of results
|
||||
const lines = stdout.split("\n");
|
||||
const splitLines = stdout.split("\n");
|
||||
const lines = splitLines.filter((line) => line.length <= MAX_LINE_LENGTH);
|
||||
if (lines.length === 0) {
|
||||
return `No matches found for pattern "${args.pattern}"${
|
||||
args.file_pattern ? ` in files matching "${args.file_pattern}"` : ""
|
||||
}.`;
|
||||
}
|
||||
const truncated = lines.length > DEFAULT_MAX_RESULTS;
|
||||
const limitedLines = lines.slice(0, DEFAULT_MAX_RESULTS);
|
||||
const resultText = limitedLines.join("\n");
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class ApplyToFileHandler(
|
|||
}
|
||||
|
||||
private fun buildApplyPrompt(): String {
|
||||
return "The following code was suggested as an edit:\n```\n${params.text}\n```\nPlease apply it to the previous code."
|
||||
return "The following code was suggested as an edit:\n```\n${params.text}\n```\nPlease apply it to the previous code. Leave existing comments in place unless changes require modifying them."
|
||||
}
|
||||
|
||||
private fun createDiffStreamHandler(
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ export class ApplyManager {
|
|||
* Creates a prompt for applying code edits
|
||||
*/
|
||||
private getApplyPrompt(text: string): string {
|
||||
return `The following code was suggested as an edit:\n\`\`\`\n${text}\n\`\`\`\nPlease apply it to the previous code.`;
|
||||
return `The following code was suggested as an edit:\n\`\`\`\n${text}\n\`\`\`\nPlease apply it to the previous code. Leave existing comments in place unless changes require modifying them.`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,138 +0,0 @@
|
|||
import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/solid";
|
||||
import { ChatHistoryItem } from "core";
|
||||
import { stripImages } from "core/util/messageContent";
|
||||
import { useEffect, useState } from "react";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
defaultBorderRadius,
|
||||
lightGray,
|
||||
vscBackground,
|
||||
vscQuickInputBackground,
|
||||
} from "..";
|
||||
import { getFontSize } from "../../util";
|
||||
import StyledMarkdownPreview from "../StyledMarkdownPreview";
|
||||
|
||||
interface ReasoningProps {
|
||||
item: ChatHistoryItem;
|
||||
index: number;
|
||||
isLast: boolean;
|
||||
}
|
||||
|
||||
const SpoilerButton = styled.div`
|
||||
margin: 8px 6px 16px 6px;
|
||||
background-color: ${vscBackground};
|
||||
width: fit-content;
|
||||
font-size: ${getFontSize() - 2}px;
|
||||
border: 0.5px solid ${lightGray};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
padding: 4px 8px;
|
||||
color: ${lightGray};
|
||||
cursor: pointer;
|
||||
box-shadow:
|
||||
0 4px 6px rgba(0, 0, 0, 0.1),
|
||||
0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
transition: box-shadow 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
box-shadow:
|
||||
0 6px 8px rgba(0, 0, 0, 0.15),
|
||||
0 3px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
`;
|
||||
|
||||
const ButtonContent = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
`;
|
||||
|
||||
const ContentDiv = styled.div<{ fontSize?: number }>`
|
||||
margin: 4px;
|
||||
padding: 4px;
|
||||
padding-bottom: 8px;
|
||||
font-size: ${getFontSize()}px;
|
||||
overflow: hidden;
|
||||
border-left: 4px solid ${lightGray};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
background-color: ${vscQuickInputBackground};
|
||||
`;
|
||||
|
||||
const ThinkingText = styled.span`
|
||||
position: relative;
|
||||
padding-right: 12px;
|
||||
|
||||
&:after {
|
||||
content: "...";
|
||||
position: absolute;
|
||||
animation: ellipsis 1s steps(4, end) infinite;
|
||||
width: 0px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@keyframes ellipsis {
|
||||
0%,
|
||||
100% {
|
||||
width: 0px;
|
||||
}
|
||||
33% {
|
||||
width: 8px;
|
||||
}
|
||||
66% {
|
||||
width: 16px;
|
||||
}
|
||||
90% {
|
||||
width: 24px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default function Reasoning(props: ReasoningProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [reasoningTime, setReasoningTime] = useState("");
|
||||
const isThinking = !props.item.reasoning?.endAt;
|
||||
|
||||
useEffect(() => {
|
||||
if (!props.item.reasoning) return;
|
||||
if (!props.item.reasoning?.endAt) return;
|
||||
|
||||
const startAt = props.item.reasoning?.startAt || Date.now();
|
||||
const endAt = props.item.reasoning?.endAt || Date.now();
|
||||
const diff = endAt - startAt;
|
||||
const diffString = `${(diff / 1000).toFixed(1)}s`;
|
||||
setReasoningTime(diffString);
|
||||
}, [props.item.reasoning?.startAt, props.item.reasoning?.endAt]);
|
||||
|
||||
if (!props.item.reasoning?.text) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SpoilerButton onClick={() => setOpen(!open)}>
|
||||
<ButtonContent>
|
||||
{isThinking ? (
|
||||
<ThinkingText>Thinking</ThinkingText>
|
||||
) : (
|
||||
`Thought for ${reasoningTime}`
|
||||
)}
|
||||
{open ? (
|
||||
<ChevronUpIcon className="h-3 w-3" />
|
||||
) : (
|
||||
<ChevronDownIcon className="h-3 w-3" />
|
||||
)}
|
||||
</ButtonContent>
|
||||
</SpoilerButton>
|
||||
{open && (
|
||||
<ContentDiv>
|
||||
<StyledMarkdownPreview
|
||||
isRenderingInStepContainer
|
||||
source={stripImages(props.item.reasoning.text)}
|
||||
itemIndex={props.index}
|
||||
useParentBackgroundColor
|
||||
/>
|
||||
</ContentDiv>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -5,9 +5,9 @@ import { useDispatch } from "react-redux";
|
|||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { selectUIConfig } from "../../redux/slices/configSlice";
|
||||
import { deleteMessage } from "../../redux/slices/sessionSlice";
|
||||
import ThinkingBlockPeek from "../mainInput/belowMainInput/ThinkingBlockPeek";
|
||||
import StyledMarkdownPreview from "../StyledMarkdownPreview";
|
||||
import ConversationSummary from "./ConversationSummary";
|
||||
import Reasoning from "./Reasoning";
|
||||
import ResponseActions from "./ResponseActions";
|
||||
import ThinkingIndicator from "./ThinkingIndicator";
|
||||
|
||||
|
|
@ -85,7 +85,14 @@ export default function StepContainer(props: StepContainerProps) {
|
|||
</pre>
|
||||
) : (
|
||||
<>
|
||||
<Reasoning {...props} />
|
||||
{props.item.reasoning?.text && (
|
||||
<ThinkingBlockPeek
|
||||
content={props.item.reasoning.text}
|
||||
index={props.index}
|
||||
prevItem={props.index > 0 ? props.item : null}
|
||||
inProgress={!props.item.reasoning?.endAt}
|
||||
/>
|
||||
)}
|
||||
|
||||
<StyledMarkdownPreview
|
||||
isRenderingInStepContainer
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ interface ToggleProps {
|
|||
title: React.ReactNode;
|
||||
icon?: ComponentType<React.SVGProps<SVGSVGElement>>;
|
||||
testId?: string;
|
||||
defaultOpen?: boolean;
|
||||
}
|
||||
|
||||
function ToggleDiv({
|
||||
|
|
@ -14,8 +15,9 @@ function ToggleDiv({
|
|||
title,
|
||||
icon: Icon,
|
||||
testId = "context-items-peek",
|
||||
defaultOpen = false,
|
||||
}: ToggleProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [open, setOpen] = useState(defaultOpen);
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -178,9 +178,14 @@ describe("UnifiedTerminalCommand", () => {
|
|||
expect(container.textContent).toMatch(/Bold text/);
|
||||
expect(container.textContent).toMatch(/Underlined text/);
|
||||
|
||||
// Verify ANSI processing created styled spans
|
||||
const styledSpans = container.querySelectorAll('span[class*="sc-esYiGF"]');
|
||||
expect(styledSpans.length).toBeGreaterThan(0);
|
||||
// Verify ANSI processing created span elements within the code block
|
||||
// The AnsiRenderer creates spans for each ANSI segment
|
||||
const codeElement = container.querySelector("code");
|
||||
expect(codeElement).toBeInTheDocument();
|
||||
|
||||
// Count all spans inside the code element (ANSI creates multiple spans)
|
||||
const spans = codeElement?.querySelectorAll("span");
|
||||
expect(spans?.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test("handles links in output", async () => {
|
||||
|
|
|
|||
|
|
@ -5,17 +5,8 @@ import { ChatHistoryItem } from "core";
|
|||
import { useEffect, useState } from "react";
|
||||
import styled from "styled-components";
|
||||
|
||||
import { vscBackground } from "../..";
|
||||
import { AnimatedEllipsis } from "../../AnimatedEllipsis";
|
||||
import StyledMarkdownPreview from "../../StyledMarkdownPreview";
|
||||
import { ButtonContent, SpoilerButton } from "../../ui/SpoilerButton";
|
||||
|
||||
const ThinkingTextContainer = styled.span`
|
||||
display: inline-block;
|
||||
min-width: fit-content;
|
||||
|
||||
padding-right: 1em; /* Reserve space for the ellipsis animation */
|
||||
`;
|
||||
|
||||
const MarkdownWrapper = styled.div`
|
||||
& > div > *:first-child {
|
||||
|
|
@ -39,7 +30,6 @@ function ThinkingBlockPeek({
|
|||
index,
|
||||
prevItem,
|
||||
inProgress,
|
||||
signature,
|
||||
tokens,
|
||||
}: ThinkingBlockPeekProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
|
@ -66,58 +56,53 @@ function ThinkingBlockPeek({
|
|||
|
||||
return duplicateRedactedThinkingBlock ? null : (
|
||||
<div className="thread-message">
|
||||
<div className="" style={{ backgroundColor: vscBackground }}>
|
||||
<div
|
||||
className="flex items-center justify-start pl-2 text-xs text-gray-300"
|
||||
data-testid="thinking-block-peek"
|
||||
>
|
||||
<SpoilerButton onClick={() => setOpen(!open)}>
|
||||
<ButtonContent>
|
||||
{inProgress ? (
|
||||
<span>
|
||||
{redactedThinking ? "Redacted Thinking" : "Thinking"}
|
||||
<AnimatedEllipsis />
|
||||
</span>
|
||||
) : redactedThinking ? (
|
||||
"Redacted Thinking"
|
||||
) : (
|
||||
"Thought" +
|
||||
(elapsedTime ? ` for ${elapsedTime}` : "") +
|
||||
(tokens ? ` (${tokens} tokens)` : "")
|
||||
)}
|
||||
{open ? (
|
||||
<ChevronUpIcon className="h-3 w-3" />
|
||||
) : (
|
||||
<ChevronDownIcon className="h-3 w-3" />
|
||||
)}
|
||||
</ButtonContent>
|
||||
</SpoilerButton>
|
||||
<div className="mt-1 flex flex-col px-4">
|
||||
<div className="flex min-w-0 flex-row items-center justify-between gap-2">
|
||||
<button
|
||||
type="button"
|
||||
className="text-description flex min-w-0 cursor-pointer flex-row items-center gap-1.5 text-xs transition-colors duration-200 ease-in-out hover:brightness-125"
|
||||
data-testid="thinking-block-peek"
|
||||
aria-expanded={open}
|
||||
aria-controls={`thinking-block-content-${index}`}
|
||||
onClick={() => setOpen(!open)}
|
||||
>
|
||||
{inProgress ? (
|
||||
<span>
|
||||
{redactedThinking ? "Redacted Thinking" : "Thinking"}
|
||||
<AnimatedEllipsis />
|
||||
</span>
|
||||
) : redactedThinking ? (
|
||||
"Redacted Thinking"
|
||||
) : (
|
||||
"Thought" +
|
||||
(elapsedTime ? ` for ${elapsedTime}` : "") +
|
||||
(tokens ? ` (${tokens} tokens)` : "")
|
||||
)}
|
||||
{open ? (
|
||||
<ChevronUpIcon className="h-3 w-3" />
|
||||
) : (
|
||||
<ChevronDownIcon className="h-3 w-3" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
className={`ml-2 mt-2 overflow-y-auto transition-none duration-300 ease-in-out ${
|
||||
open ? "mb-2 mt-5 opacity-100" : "max-h-0 border-0 opacity-0"
|
||||
id={`thinking-block-content-${index}`}
|
||||
className={`mt-2 overflow-y-auto transition-all duration-300 ease-in-out ${
|
||||
open ? "max-h-[50vh] opacity-100" : "max-h-0 opacity-0"
|
||||
}`}
|
||||
style={{
|
||||
borderLeft:
|
||||
open && !redactedThinking
|
||||
? "2px solid var(--vscode-input-border, #606060)"
|
||||
: "none",
|
||||
}}
|
||||
>
|
||||
{redactedThinking ? (
|
||||
<div className="text-description-muted pl-4 text-xs">
|
||||
<div className="text-description pl-5 text-xs italic">
|
||||
Thinking content redacted due to safety reasons.
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<MarkdownWrapper className="-mt-1 px-0 pl-1">
|
||||
<StyledMarkdownPreview
|
||||
isRenderingInStepContainer
|
||||
source={content}
|
||||
itemIndex={index}
|
||||
/>
|
||||
</MarkdownWrapper>
|
||||
</>
|
||||
<MarkdownWrapper>
|
||||
<StyledMarkdownPreview
|
||||
isRenderingInStepContainer
|
||||
source={content}
|
||||
itemIndex={index}
|
||||
/>
|
||||
</MarkdownWrapper>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -250,7 +250,11 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => {
|
|||
{/* Expandable technical details using ToggleDiv */}
|
||||
{message && (
|
||||
<div className="mb-2">
|
||||
<ToggleDiv title="View error output" testId="error-output-toggle">
|
||||
<ToggleDiv
|
||||
title="View error output"
|
||||
testId="error-output-toggle"
|
||||
defaultOpen
|
||||
>
|
||||
<div className="flex flex-col gap-0 rounded-sm">
|
||||
<code className="text-editor-foreground block max-h-48 overflow-y-auto p-3 font-mono text-xs">
|
||||
{parsedError}
|
||||
|
|
|
|||
179
packages/continue-sdk/package-lock.json
generated
179
packages/continue-sdk/package-lock.json
generated
|
|
@ -9,8 +9,8 @@
|
|||
"version": "0.0.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "file:../config-yaml",
|
||||
"@openapitools/openapi-generator-cli": "^2.24.0",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@openapitools/openapi-generator-cli": "^2.25.1",
|
||||
"express": "^4.18.2",
|
||||
"swagger-ui-express": "^5.0.0"
|
||||
},
|
||||
|
|
@ -18,33 +18,6 @@
|
|||
"typescript": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"../config-yaml": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.23.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"bin": {
|
||||
"config-yaml": "dist/cli.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/github": "^9.2.6",
|
||||
"@semantic-release/npm": "^10.0.6",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^20.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"jest": "^29.7.0",
|
||||
"semantic-release": "^21.1.2",
|
||||
"ts-jest": "^29.2.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"zod-to-json-schema": "^3.24.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@borewit/text-codec": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz",
|
||||
|
|
@ -55,9 +28,28 @@
|
|||
"url": "https://github.com/sponsors/Borewit"
|
||||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-types": {
|
||||
"version": "1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
|
||||
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"zod": "^3.23.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"resolved": "../config-yaml",
|
||||
"link": true
|
||||
"version": "1.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.33.0.tgz",
|
||||
"integrity": "sha512-riMSmuQ3HhLMKXeQ6L55pXzo/CZUVbEMallg09Pq3GNl8nddV6+7eHhzr1bThLO1COvKNLmo+3kQg52ROv+syA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"bin": {
|
||||
"config-yaml": "dist/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@inquirer/external-editor": {
|
||||
"version": "1.0.2",
|
||||
|
|
@ -234,14 +226,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@nestjs/common": {
|
||||
"version": "11.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.6.tgz",
|
||||
"integrity": "sha512-krKwLLcFmeuKDqngG2N/RuZHCs2ycsKcxWIDgcm7i1lf3sQ0iG03ci+DsP/r3FcT/eJDFsIHnKtNta2LIi7PzQ==",
|
||||
"version": "11.1.9",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz",
|
||||
"integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"file-type": "21.0.0",
|
||||
"file-type": "21.1.0",
|
||||
"iterare": "1.2.1",
|
||||
"load-esm": "1.0.2",
|
||||
"load-esm": "1.0.3",
|
||||
"tslib": "2.8.1",
|
||||
"uid": "2.0.2"
|
||||
},
|
||||
|
|
@ -265,16 +257,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@nestjs/core": {
|
||||
"version": "11.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.6.tgz",
|
||||
"integrity": "sha512-siWX7UDgErisW18VTeJA+x+/tpNZrJewjTBsRPF3JVxuWRuAB1kRoiJcxHgln8Lb5UY9NdvklITR84DUEXD0Cg==",
|
||||
"version": "11.1.9",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.9.tgz",
|
||||
"integrity": "sha512-a00B0BM4X+9z+t3UxJqIZlemIwCQdYoPKrMcM+ky4z3pkqqG1eTWexjs+YXpGObnLnjtMPVKWlcZHp3adDYvUw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nuxt/opencollective": "0.4.1",
|
||||
"fast-safe-stringify": "2.1.1",
|
||||
"iterare": "1.2.1",
|
||||
"path-to-regexp": "8.2.0",
|
||||
"path-to-regexp": "8.3.0",
|
||||
"tslib": "2.8.1",
|
||||
"uid": "2.0.2"
|
||||
},
|
||||
|
|
@ -344,24 +336,24 @@
|
|||
"integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw=="
|
||||
},
|
||||
"node_modules/@openapitools/openapi-generator-cli": {
|
||||
"version": "2.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.24.0.tgz",
|
||||
"integrity": "sha512-VS0sfW46oe/hQq7g1YZU1cJJebAQIwKhKqjsDY1/QFmcJMXYfe339yjMDTv02kMbsx621cSH46HIdvmW+i+7mg==",
|
||||
"version": "2.25.1",
|
||||
"resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.25.1.tgz",
|
||||
"integrity": "sha512-IY0Vgnv//v2X7+gqAj+jE+CoygdeIx15ZaF2SK+/kQR/sHBJTgxOOc0V+ti2tfxv4pkOILcTcPhmuZIobxPQhg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@nestjs/axios": "4.0.1",
|
||||
"@nestjs/common": "11.1.6",
|
||||
"@nestjs/core": "11.1.6",
|
||||
"@nestjs/common": "11.1.9",
|
||||
"@nestjs/core": "11.1.9",
|
||||
"@nuxtjs/opencollective": "0.3.2",
|
||||
"axios": "1.12.2",
|
||||
"axios": "1.13.2",
|
||||
"chalk": "4.1.2",
|
||||
"commander": "8.3.0",
|
||||
"compare-versions": "6.1.1",
|
||||
"concurrently": "9.2.1",
|
||||
"console.table": "0.10.0",
|
||||
"fs-extra": "11.3.2",
|
||||
"glob": "11.0.3",
|
||||
"glob": "12.0.0",
|
||||
"inquirer": "8.2.7",
|
||||
"proxy-agent": "6.5.0",
|
||||
"reflect-metadata": "0.2.2",
|
||||
|
|
@ -386,12 +378,12 @@
|
|||
"hasInstallScript": true
|
||||
},
|
||||
"node_modules/@tokenizer/inflate": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz",
|
||||
"integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==",
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.3.1.tgz",
|
||||
"integrity": "sha512-4oeoZEBQdLdt5WmP/hx1KZ6D3/Oid/0cUb2nk4F0pTDAWy+KCH3/EnAkZF/bvckWo8I33EqBm01lIPgmgc8rCA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"debug": "^4.4.1",
|
||||
"fflate": "^0.8.2",
|
||||
"token-types": "^6.0.0"
|
||||
},
|
||||
|
|
@ -495,9 +487,9 @@
|
|||
"license": "MIT"
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
|
||||
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
|
||||
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
|
|
@ -888,9 +880,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
|
|
@ -1211,13 +1204,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/file-type": {
|
||||
"version": "21.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-type/-/file-type-21.0.0.tgz",
|
||||
"integrity": "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg==",
|
||||
"version": "21.1.0",
|
||||
"resolved": "https://registry.npmjs.org/file-type/-/file-type-21.1.0.tgz",
|
||||
"integrity": "sha512-boU4EHmP3JXkwDo4uhyBhTt5pPstxB6eEXKJBu2yu2l7aAMMm7QQYQEzssJmKReZYrFdFOJS8koVo6bXIBGDqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tokenizer/inflate": "^0.2.7",
|
||||
"strtok3": "^10.2.2",
|
||||
"@tokenizer/inflate": "^0.3.1",
|
||||
"strtok3": "^10.3.1",
|
||||
"token-types": "^6.0.0",
|
||||
"uint8array-extras": "^1.4.0"
|
||||
},
|
||||
|
|
@ -1406,14 +1399,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "11.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
|
||||
"integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==",
|
||||
"license": "ISC",
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-12.0.0.tgz",
|
||||
"integrity": "sha512-5Qcll1z7IKgHr5g485ePDdHcNQY0k2dtv/bjYy0iuyGxQw2qSOiiXUXJ+AYQpg3HNoUMHqAruX478Jeev7UULw==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"foreground-child": "^3.3.1",
|
||||
"jackspeak": "^4.1.1",
|
||||
"minimatch": "^10.0.3",
|
||||
"minimatch": "^10.1.1",
|
||||
"minipass": "^7.1.2",
|
||||
"package-json-from-dist": "^1.0.0",
|
||||
"path-scurry": "^2.0.0"
|
||||
|
|
@ -1689,9 +1682,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/load-esm": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.2.tgz",
|
||||
"integrity": "sha512-nVAvWk/jeyrWyXEAs84mpQCYccxRqgKY4OznLuJhJCa0XsPSfdOIr2zvBZEj3IHEHbX97jjscKRRV539bW0Gpw==",
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.3.tgz",
|
||||
"integrity": "sha512-v5xlu8eHD1+6r8EHTg6hfmO97LN8ugKtiXcy5e6oN72iD2r6u0RPfLl6fxM+7Wnh2ZRq15o0russMst44WauPA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
|
|
@ -1810,10 +1803,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz",
|
||||
"integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==",
|
||||
"license": "ISC",
|
||||
"version": "10.1.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
|
||||
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/brace-expansion": "^5.0.0"
|
||||
},
|
||||
|
|
@ -1993,9 +1986,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/path-scurry": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
|
||||
"integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz",
|
||||
"integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"lru-cache": "^11.0.0",
|
||||
|
|
@ -2009,12 +2002,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz",
|
||||
"integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==",
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
|
||||
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
|
|
@ -2761,6 +2755,18 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
|
||||
"integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.6"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
|
|
@ -2787,6 +2793,15 @@
|
|||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.25.76",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
|
||||
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@
|
|||
"author": "Continue Dev, Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "file:../config-yaml",
|
||||
"@openapitools/openapi-generator-cli": "^2.24.0",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@openapitools/openapi-generator-cli": "^2.25.1",
|
||||
"express": "^4.18.2",
|
||||
"swagger-ui-express": "^5.0.0"
|
||||
},
|
||||
|
|
|
|||
8
packages/hub/package-lock.json
generated
8
packages/hub/package-lock.json
generated
|
|
@ -9,7 +9,7 @@
|
|||
"version": "0.0.7",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "^1.29.0"
|
||||
"@continuedev/config-yaml": "^1.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
|
|
@ -544,9 +544,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.29.0.tgz",
|
||||
"integrity": "sha512-vNHS5RGiPInqfNJItK5PRJX7Q8RzzGAUER3qHj45nQxQKySidqknQr80NTWre3AtHYJCR8IejYPM6PQ1IDYSgA==",
|
||||
"version": "1.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.33.0.tgz",
|
||||
"integrity": "sha512-riMSmuQ3HhLMKXeQ6L55pXzo/CZUVbEMallg09Pq3GNl8nddV6+7eHhzr1bThLO1COvKNLmo+3kQg52ROv+syA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
"author": "Continue Dev, Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-yaml": "^1.29.0"
|
||||
"@continuedev/config-yaml": "^1.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
|
|
|
|||
8
packages/openai-adapters/package-lock.json
generated
8
packages/openai-adapters/package-lock.json
generated
|
|
@ -13,7 +13,7 @@
|
|||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.913.0",
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-yaml": "^1.29.0",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@continuedev/fetch": "^1.5.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.1.0",
|
||||
|
|
@ -2362,9 +2362,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.29.0.tgz",
|
||||
"integrity": "sha512-vNHS5RGiPInqfNJItK5PRJX7Q8RzzGAUER3qHj45nQxQKySidqknQr80NTWre3AtHYJCR8IejYPM6PQ1IDYSgA==",
|
||||
"version": "1.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.33.0.tgz",
|
||||
"integrity": "sha512-riMSmuQ3HhLMKXeQ6L55pXzo/CZUVbEMallg09Pq3GNl8nddV6+7eHhzr1bThLO1COvKNLmo+3kQg52ROv+syA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.913.0",
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-yaml": "^1.29.0",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@continuedev/fetch": "^1.5.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.1.0",
|
||||
|
|
|
|||
|
|
@ -158,7 +158,35 @@ export function customFetch(
|
|||
if (process.env.FEATURE_FLAG_DISABLE_CUSTOM_FETCH) {
|
||||
return patchedFetch;
|
||||
}
|
||||
|
||||
function letRequestOptionsOverrideAuthorizationHeader(init: any): any {
|
||||
if (
|
||||
!init ||
|
||||
!init.headers ||
|
||||
!requestOptions ||
|
||||
!requestOptions.headers ||
|
||||
(!requestOptions.headers["Authorization"] &&
|
||||
!requestOptions.headers["authorization"])
|
||||
) {
|
||||
return init;
|
||||
}
|
||||
|
||||
if (init.headers instanceof Headers) {
|
||||
init.headers.delete("Authorization");
|
||||
} else if (Array.isArray(init.headers)) {
|
||||
init.headers = init.headers.filter(
|
||||
(header: [string, string]) =>
|
||||
(header[0] ?? "").toLowerCase() !== "authorization",
|
||||
);
|
||||
} else if (typeof init.headers === "object") {
|
||||
delete init.headers["Authorization"];
|
||||
delete init.headers["authorization"];
|
||||
}
|
||||
return init;
|
||||
}
|
||||
|
||||
return (req: URL | string | Request, init?: any) => {
|
||||
init = letRequestOptionsOverrideAuthorizationHeader(init);
|
||||
if (typeof req === "string" || req instanceof URL) {
|
||||
return fetchwithRequestOptions(req, init, requestOptions);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue