Merge branch 'continuedev:main' into nes-latest-diff-fix
This commit is contained in:
commit
14d935ddcb
201 changed files with 8104 additions and 3834 deletions
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -28,7 +28,7 @@ body:
|
|||
- **OS**: macOS
|
||||
- **Continue version**: v0.9.4
|
||||
- **IDE version**: VSCode 1.85.1
|
||||
- Model: Claude Sonnet 3.5
|
||||
- Model: Claude Sonnet 4.5
|
||||
- Agent configuration
|
||||
value: |
|
||||
- OS:
|
||||
|
|
|
|||
|
|
@ -111,8 +111,11 @@ runs:
|
|||
|
||||
- name: Prepackage the extension
|
||||
shell: bash
|
||||
env:
|
||||
CONTINUE_VSCODE_TARGET: ${{ steps.set-target.outputs.target }}
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
export CONTINUE_VSCODE_TARGET="${{ steps.set-target.outputs.target }}"
|
||||
npm run prepackage -- --target ${{ steps.set-target.outputs.target }}
|
||||
|
||||
- name: Re-install esbuild
|
||||
|
|
@ -146,14 +149,20 @@ runs:
|
|||
|
||||
- name: Package extension (build artifacts)
|
||||
shell: bash
|
||||
env:
|
||||
CONTINUE_VSCODE_TARGET: ${{ steps.set-target.outputs.target }}
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run package
|
||||
export CONTINUE_VSCODE_TARGET="${{ steps.set-target.outputs.target }}"
|
||||
npm run package -- --target ${{ steps.set-target.outputs.target }}
|
||||
|
||||
- name: Package extension (.vsix files)
|
||||
shell: bash
|
||||
env:
|
||||
CONTINUE_VSCODE_TARGET: ${{ steps.set-target.outputs.target }}
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
export CONTINUE_VSCODE_TARGET="${{ steps.set-target.outputs.target }}"
|
||||
if [ "${{ inputs.pre-release }}" = "true" ]; then
|
||||
npx vsce package --pre-release --no-dependencies --target ${{ steps.set-target.outputs.target }}
|
||||
else
|
||||
|
|
|
|||
4
.github/workflows/jetbrains-release.yaml
vendored
4
.github/workflows/jetbrains-release.yaml
vendored
|
|
@ -107,7 +107,7 @@ jobs:
|
|||
ref: ${{ github.event.release.tag_name }}
|
||||
|
||||
- name: Import Apple certificate
|
||||
uses: apple-actions/import-codesign-certs@v5
|
||||
uses: apple-actions/import-codesign-certs@v6
|
||||
with:
|
||||
keychain: ${{ github.run_id }}
|
||||
keychain-password: ${{ github.run_id }}
|
||||
|
|
@ -491,7 +491,7 @@ jobs:
|
|||
|
||||
# Run Qodana inspections
|
||||
- name: Qodana - Code Inspection
|
||||
uses: JetBrains/qodana-action@v2025.2.2
|
||||
uses: JetBrains/qodana-action@v2025.2.3
|
||||
with:
|
||||
cache-default-branch-only: true
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,29 @@
|
|||
{
|
||||
"name": "cn",
|
||||
"dockerfile": "FROM runloop:runloop/universal-ubuntu-24.04-x86_64-dnd",
|
||||
"system_setup_commands": [
|
||||
"npm i -g @continuedev/cli@latest",
|
||||
"sudo apt update",
|
||||
"sudo apt install -y ripgrep"
|
||||
]
|
||||
"printf '#!/bin/sh\\nexit 101\\n' | sudo tee /usr/sbin/policy-rc.d > /dev/null && sudo chmod +x /usr/sbin/policy-rc.d",
|
||||
"sudo apt install -y --no-install-recommends ripgrep chromium chromium-driver xvfb",
|
||||
"sudo rm /usr/sbin/policy-rc.d",
|
||||
"sudo mkdir -p /opt/google/chrome",
|
||||
"sudo ln -s /usr/bin/chromium /opt/google/chrome/chrome",
|
||||
"curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | sudo -E bash",
|
||||
"sudo apt-get install -y infisical",
|
||||
"curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg",
|
||||
"sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg",
|
||||
"echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main' | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null",
|
||||
"sudo apt update",
|
||||
"sudo apt install -y gh"
|
||||
],
|
||||
"launch_parameters": {
|
||||
"launch_commands": [
|
||||
"export DISPLAY=:99",
|
||||
"nohup Xvfb :99 -screen 0 1920x1080x24 > /tmp/xvfb.log 2>&1 &",
|
||||
"sleep 2",
|
||||
"sudo mkdir -p /home/user",
|
||||
"for dir in /root/*; do [ -d \"$dir\" ] && [ -d \"$dir/.git\" ] && sudo ln -sf \"$dir\" \"/home/user/$(basename \"$dir\")\"; done"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
59
.github/workflows/upload-runloop-blueprint.yml
vendored
Normal file
59
.github/workflows/upload-runloop-blueprint.yml
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
name: Upload Runloop Blueprint
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/workflows/runloop-blueprint-template.json'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
upload-blueprint:
|
||||
name: Upload Blueprint to Runloop
|
||||
runs-on: ubuntu-latest
|
||||
# Only run this workflow on the main repository (continuedev/continue)
|
||||
if: github.repository == 'continuedev/continue'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Publish Blueprint to Runloop
|
||||
env:
|
||||
RUNLOOP_API_KEY: ${{ secrets.RUNLOOP_API_KEY }}
|
||||
run: |
|
||||
echo "Publishing blueprint 'cn' to Runloop API"
|
||||
|
||||
# Use blueprint configuration from template file
|
||||
cp .github/workflows/runloop-blueprint-template.json blueprint.json
|
||||
|
||||
# Publish to Runloop API
|
||||
response=$(curl -X POST "https://api.runloop.ai/v1/blueprints" \
|
||||
-H "Authorization: Bearer $RUNLOOP_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @blueprint.json \
|
||||
-w "%{http_code}" \
|
||||
-s)
|
||||
|
||||
http_code=$(echo "$response" | tail -c 4)
|
||||
response_body=$(echo "$response" | head -c -4)
|
||||
|
||||
if [[ "$http_code" == "200" ]] || [[ "$http_code" == "201" ]]; then
|
||||
echo "✅ Successfully published blueprint to Runloop API"
|
||||
echo "Response: $response_body"
|
||||
|
||||
# Extract blueprint ID if available
|
||||
blueprint_id=$(echo "$response_body" | jq -r '.id // empty')
|
||||
if [[ -n "$blueprint_id" ]]; then
|
||||
echo "Blueprint ID: $blueprint_id"
|
||||
echo "blueprint_id=$blueprint_id" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "❌ Failed to publish blueprint to Runloop API"
|
||||
echo "HTTP Code: $http_code"
|
||||
echo "Response: $response_body"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -33,6 +33,13 @@
|
|||
|
||||
Get started in [Mission Control](https://hub.continue.dev/agents), [CLI (Headless Mode)](https://docs.continue.dev/cli/quick-start#headless-mode), or [CLI (TUI mode)](https://docs.continue.dev/cli/quick-start#tui-mode)
|
||||
|
||||
### Quick Install
|
||||
|
||||
```bash
|
||||
npm i -g @continuedev/cli
|
||||
cn
|
||||
```
|
||||
|
||||
## Cloud Agents
|
||||
|
||||
Set workflows to run automatically on [PR opens](https://docs.continue.dev/guides/continuous-ai#pattern-2-the-pr-review-agent), [schedules](https://docs.continue.dev/guides/continuous-ai#pattern-1-the-async-triage-bot), or [any event trigger](https://docs.continue.dev/cli/quick-start#headless-mode)
|
||||
|
|
|
|||
18
binary/package-lock.json
generated
18
binary/package-lock.json
generated
|
|
@ -22,7 +22,7 @@
|
|||
"tar": "^7.5.1",
|
||||
"undici": "^7.16.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.20",
|
||||
"vectordb": "0.4.20",
|
||||
"win-ca": "^3.5.1"
|
||||
},
|
||||
"bin": {
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
"tree-sitter-wasms": "^0.1.11",
|
||||
"untildify": "^6.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.20",
|
||||
"vectordb": "0.4.20",
|
||||
"web-tree-sitter": "^0.21.0",
|
||||
"win-ca": "^3.5.1",
|
||||
"wink-nlp-utils": "^2.1.0",
|
||||
|
|
@ -42082,15 +42082,15 @@
|
|||
},
|
||||
"../packages/openai-adapters": {
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.15.0",
|
||||
"version": "1.32.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.67.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.913.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.925.0",
|
||||
"@aws-sdk/credential-providers": "^3.929.0",
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@continuedev/fetch": "^1.5.0",
|
||||
"@continuedev/config-yaml": "^1.36.0",
|
||||
"@continuedev/fetch": "^1.6.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.4.1",
|
||||
"json-schema": "^0.4.0",
|
||||
|
|
@ -42104,14 +42104,14 @@
|
|||
"@semantic-release/commit-analyzer": "^13.0.1",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/github": "^11.0.3",
|
||||
"@semantic-release/npm": "^13.1.2",
|
||||
"@semantic-release/npm": "^12.0.2",
|
||||
"@semantic-release/release-notes-generator": "^14.0.3",
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/json-schema": "^7.0.15",
|
||||
"@types/node": "^24.3.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"semantic-release": "^25.0.2",
|
||||
"semantic-release": "^24.2.7",
|
||||
"ts-jest": "^29.2.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"vitest": "^3.2.4"
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
"tar": "^7.5.1",
|
||||
"undici": "^7.16.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.20",
|
||||
"vectordb": "0.4.20",
|
||||
"win-ca": "^3.5.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,15 @@ export function stringifyMcpPrompt(
|
|||
let stringified = "";
|
||||
for (const message of messages) {
|
||||
if (message.content.type === "text") {
|
||||
stringified += `<${message.content.role}/>\n${message.content.text}\n<${message.content.role}/>`;
|
||||
const role =
|
||||
"role" in message.content && typeof message.content.role === "string"
|
||||
? message.content.role
|
||||
: message.content._meta &&
|
||||
"role" in message.content._meta &&
|
||||
typeof message.content._meta.role === "string"
|
||||
? message.content._meta.role
|
||||
: "assistant";
|
||||
stringified += `<${role}/>\n${message.content.text}\n<${role}/>`;
|
||||
} else {
|
||||
console.warn(
|
||||
`MCP Prompt conversion warning: ${message.content.type} content is not yet supported, message skipped`,
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ function getContentsForNewBlock(blockType: BlockType): ConfigYaml {
|
|||
configYaml.models = [
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-7-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiKey: "${{ secrets.ANTHROPIC_API_KEY }}",
|
||||
name: "Claude 3.7 Sonnet",
|
||||
name: "Claude Sonnet 4.5",
|
||||
roles: ["chat", "edit"],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -80,17 +80,15 @@ class MCPContextProvider extends BaseContextProvider {
|
|||
|
||||
return await Promise.all(
|
||||
contents.map(async (resource) => {
|
||||
const content = resource.text;
|
||||
if (typeof content !== "string") {
|
||||
if (!("text" in resource) || typeof resource.text !== "string") {
|
||||
throw new Error(
|
||||
"Continue currently only supports text resources from MCP",
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
name: resource.uri,
|
||||
description: resource.uri,
|
||||
content,
|
||||
content: resource.text,
|
||||
uri: {
|
||||
type: "url",
|
||||
value: resource.uri,
|
||||
|
|
|
|||
|
|
@ -59,6 +59,25 @@ function trimmedMatch(
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Case-insensitive matching strategy
|
||||
*/
|
||||
function caseInsensitiveMatch(
|
||||
fileContent: string,
|
||||
searchContent: string,
|
||||
): BasicMatchResult | null {
|
||||
const lowerFileContent = fileContent.toLowerCase();
|
||||
const lowerSearchContent = searchContent.toLowerCase();
|
||||
const index = lowerFileContent.indexOf(lowerSearchContent);
|
||||
if (index !== -1) {
|
||||
return {
|
||||
startIndex: index,
|
||||
endIndex: index + searchContent.length,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whitespace-ignored matching strategy
|
||||
* Removes all whitespace from both content and search, then finds the match
|
||||
|
|
@ -284,6 +303,7 @@ function findFuzzyMatch(
|
|||
const matchingStrategies: Array<{ strategy: MatchStrategy; name: string }> = [
|
||||
{ strategy: exactMatch, name: "exactMatch" },
|
||||
{ strategy: trimmedMatch, name: "trimmedMatch" },
|
||||
{ strategy: caseInsensitiveMatch, name: "caseInsensitiveMatch" },
|
||||
{ strategy: whitespaceIgnoredMatch, name: "whitespaceIgnoredMatch" },
|
||||
// { strategy: findFuzzyMatch, name: "jaroWinklerFuzzyMatch" },
|
||||
];
|
||||
|
|
|
|||
|
|
@ -109,8 +109,11 @@ describe("findSearchMatch", () => {
|
|||
const searchContent = "hello";
|
||||
const result = findSearchMatch(fileContent, searchContent);
|
||||
|
||||
// Should not match due to case sensitivity, will fall through to other strategies
|
||||
expect(result).toBeNull();
|
||||
expect(result).toEqual({
|
||||
startIndex: 0,
|
||||
endIndex: 5,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -152,6 +155,32 @@ describe("findSearchMatch", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("Case insensitive match strategy fallback", () => {
|
||||
it("should match when case differs", () => {
|
||||
const result = findSearchMatch(
|
||||
"const myVariable = 42;",
|
||||
"const MYVARIABLE = 42;",
|
||||
);
|
||||
expect(result).toEqual({
|
||||
startIndex: 0,
|
||||
endIndex: 22,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
|
||||
it("should match mixed case in middle of file", () => {
|
||||
const result = findSearchMatch(
|
||||
"function HandleClick() {",
|
||||
"function handleclick() {",
|
||||
);
|
||||
expect(result).toEqual({
|
||||
startIndex: 0,
|
||||
endIndex: 24,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Whitespace ignored strategy fallback", () => {
|
||||
it("should match content with different whitespace formatting", () => {
|
||||
const fileContent = "function test() {\n return true;\n}";
|
||||
|
|
|
|||
|
|
@ -113,6 +113,98 @@ line 3 foo`;
|
|||
});
|
||||
});
|
||||
|
||||
describe("case insensitive match strategy", () => {
|
||||
it("should find multiple occurrences with different cases", () => {
|
||||
const content = "const Foo = 'FOO';";
|
||||
const search = "foo";
|
||||
const matches = findSearchMatches(content, search);
|
||||
|
||||
expect(matches).toHaveLength(2);
|
||||
expect(matches[0]).toEqual({
|
||||
startIndex: 6,
|
||||
endIndex: 9,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
expect(matches[1]).toEqual({
|
||||
startIndex: 13,
|
||||
endIndex: 16,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
|
||||
it("should handle mixed case patterns", () => {
|
||||
const content = "const MyVariable = 'value';";
|
||||
const search = "mYvArIaBlE";
|
||||
const matches = findSearchMatches(content, search);
|
||||
|
||||
expect(matches).toHaveLength(1);
|
||||
expect(matches[0]).toEqual({
|
||||
startIndex: 6,
|
||||
endIndex: 16,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
|
||||
it("should find multiple matches with varying cases", () => {
|
||||
const content = "Hello world, HELLO universe, HeLLo there";
|
||||
const search = "hello";
|
||||
const matches = findSearchMatches(content, search);
|
||||
|
||||
expect(matches).toHaveLength(3);
|
||||
expect(matches[0]).toEqual({
|
||||
startIndex: 0,
|
||||
endIndex: 5,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
expect(matches[1]).toEqual({
|
||||
startIndex: 13,
|
||||
endIndex: 18,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
expect(matches[2]).toEqual({
|
||||
startIndex: 29,
|
||||
endIndex: 34,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
|
||||
it("should handle multi-line content with case differences", () => {
|
||||
const content = `function Test() {
|
||||
return TRUE;
|
||||
}`;
|
||||
const search = "test";
|
||||
const matches = findSearchMatches(content, search);
|
||||
|
||||
expect(matches).toHaveLength(1);
|
||||
expect(matches[0]).toEqual({
|
||||
startIndex: 9,
|
||||
endIndex: 13,
|
||||
strategyName: "caseInsensitiveMatch",
|
||||
});
|
||||
});
|
||||
|
||||
it("should preserve original content length in match", () => {
|
||||
const content = "const VARIABLE = 'value';";
|
||||
const search = "variable";
|
||||
const matches = findSearchMatches(content, search);
|
||||
|
||||
expect(matches).toHaveLength(1);
|
||||
expect(matches[0].endIndex - matches[0].startIndex).toBe(8);
|
||||
expect(content.slice(matches[0].startIndex, matches[0].endIndex)).toBe(
|
||||
"VARIABLE",
|
||||
);
|
||||
});
|
||||
|
||||
it("should not match when exact and trimmed strategies succeed", () => {
|
||||
const content = "const foo = 'bar';";
|
||||
const search = "foo";
|
||||
const matches = findSearchMatches(content, search);
|
||||
|
||||
expect(matches).toHaveLength(1);
|
||||
expect(matches[0].strategyName).toBe("exactMatch");
|
||||
});
|
||||
});
|
||||
|
||||
describe("whitespace ignored match strategy", () => {
|
||||
it("should find matches ignoring internal whitespace", () => {
|
||||
const content = "const foo = bar;";
|
||||
|
|
|
|||
7
core/index.d.ts
vendored
7
core/index.d.ts
vendored
|
|
@ -267,6 +267,11 @@ export interface IContextProvider {
|
|||
get deprecationMessage(): string | null;
|
||||
}
|
||||
|
||||
export interface SessionUsage extends Usage {
|
||||
/** Total cumulative cost in USD for all LLM API calls in this session */
|
||||
totalCost: number;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
sessionId: string;
|
||||
title: string;
|
||||
|
|
@ -276,6 +281,8 @@ export interface Session {
|
|||
mode?: MessageModes;
|
||||
/** Optional: title of the selected chat model for this session */
|
||||
chatModelTitle?: string | null;
|
||||
/** Optional: cumulative usage and cost for all LLM API calls in this session */
|
||||
usage?: SessionUsage;
|
||||
}
|
||||
|
||||
export interface BaseSessionMetadata {
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ class Anthropic extends BaseLLM {
|
|||
const headers = getAnthropicHeaders(
|
||||
this.apiKey,
|
||||
shouldCacheSystemMessage || shouldCachePrompt,
|
||||
this.apiBase,
|
||||
);
|
||||
|
||||
const body: MessageCreateParams = {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ describe("Anthropic", () => {
|
|||
test("streamChat should send a valid request", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 8192,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -177,7 +177,7 @@ describe("Anthropic", () => {
|
|||
test("chat should send a valid request", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 8192,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -220,7 +220,7 @@ describe("Anthropic", () => {
|
|||
test("streamComplete should send a valid request", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 8192,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -260,7 +260,7 @@ describe("Anthropic", () => {
|
|||
test("complete should send a valid request", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 8192,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -301,7 +301,7 @@ describe("Anthropic", () => {
|
|||
test("should handle system message", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -325,7 +325,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 8192,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -347,7 +347,7 @@ describe("Anthropic", () => {
|
|||
test("should handle tool calls", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 8192,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -424,7 +424,7 @@ describe("Anthropic", () => {
|
|||
test("should handle custom max tokens", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "test-api-key",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
@ -446,7 +446,7 @@ describe("Anthropic", () => {
|
|||
"x-api-key": "test-api-key",
|
||||
},
|
||||
body: {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
max_tokens: 1000,
|
||||
stream: true,
|
||||
messages: [
|
||||
|
|
@ -470,7 +470,7 @@ describe("Anthropic", () => {
|
|||
test("should throw error when API key is missing", async () => {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: "",
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiBase: "https://api.anthropic.com/v1/",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { safeParseToolCallArgs } from "../../tools/parseArgs.js";
|
|||
import { renderChatMessage, stripImages } from "../../util/messageContent.js";
|
||||
import { extractBase64FromDataUrl } from "../../util/url.js";
|
||||
import { BaseLLM } from "../index.js";
|
||||
import { LlmApiRequestType } from "../openaiTypeConverters.js";
|
||||
import {
|
||||
GeminiChatContent,
|
||||
GeminiChatContentPart,
|
||||
|
|
@ -41,6 +42,15 @@ class Gemini extends BaseLLM {
|
|||
maxEmbeddingBatchSize: 100,
|
||||
};
|
||||
|
||||
protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = [
|
||||
"chat",
|
||||
"embed",
|
||||
"list",
|
||||
"rerank",
|
||||
"streamChat",
|
||||
"streamFim",
|
||||
];
|
||||
|
||||
// Function to convert completion options to Gemini format
|
||||
public convertArgs(options: CompletionOptions): GeminiGenerationConfig {
|
||||
// should be public for use within VertexAI
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ import OpenRouter from "./OpenRouter";
|
|||
describe("OpenRouter Anthropic Caching", () => {
|
||||
it("should detect Anthropic models correctly", () => {
|
||||
const openRouter = new OpenRouter({
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiKey: "test-key",
|
||||
});
|
||||
|
||||
// Test private method through modifyChatBody
|
||||
const body: ChatCompletionCreateParams = {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
messages: [],
|
||||
};
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
|
||||
it("should add cache_control to user messages when caching is enabled", () => {
|
||||
const openRouter = new OpenRouter({
|
||||
model: "anthropic/claude-3.5-sonnet",
|
||||
model: "anthropic/claude-sonnet-4.5",
|
||||
apiKey: "test-key",
|
||||
cacheBehavior: {
|
||||
cacheConversation: true,
|
||||
|
|
@ -31,7 +31,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
});
|
||||
|
||||
const body: ChatCompletionCreateParams = {
|
||||
model: "anthropic/claude-3.5-sonnet",
|
||||
model: "anthropic/claude-sonnet-4.5",
|
||||
messages: [
|
||||
{ role: "user", content: "First message" },
|
||||
{ role: "assistant", content: "Response" },
|
||||
|
|
@ -71,7 +71,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
|
||||
it("should correctly handle cache_control with system messages present", () => {
|
||||
const openRouter = new OpenRouter({
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiKey: "test-key",
|
||||
cacheBehavior: {
|
||||
cacheConversation: true,
|
||||
|
|
@ -80,7 +80,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
});
|
||||
|
||||
const body: ChatCompletionCreateParams = {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
messages: [
|
||||
{ role: "system", content: "You are a helpful assistant" },
|
||||
{ role: "user", content: "First user message" },
|
||||
|
|
@ -137,7 +137,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
|
||||
it("should add cache_control to system message when caching is enabled", () => {
|
||||
const openRouter = new OpenRouter({
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiKey: "test-key",
|
||||
cacheBehavior: {
|
||||
cacheConversation: false,
|
||||
|
|
@ -146,7 +146,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
});
|
||||
|
||||
const body: ChatCompletionCreateParams = {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
messages: [
|
||||
{ role: "system", content: "You are a helpful assistant" },
|
||||
{ role: "user", content: "Hello" },
|
||||
|
|
@ -176,7 +176,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
|
||||
it("should handle array content correctly", () => {
|
||||
const openRouter = new OpenRouter({
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
apiKey: "test-key",
|
||||
cacheBehavior: {
|
||||
cacheConversation: true,
|
||||
|
|
@ -185,7 +185,7 @@ describe("OpenRouter Anthropic Caching", () => {
|
|||
});
|
||||
|
||||
const body: ChatCompletionCreateParams = {
|
||||
model: "claude-3-5-sonnet-latest",
|
||||
model: "claude-sonnet-4-5",
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js";
|
|||
import { renderChatMessage, stripImages } from "../../util/messageContent.js";
|
||||
import { BaseLLM } from "../index.js";
|
||||
|
||||
import { LlmApiRequestType } from "../openaiTypeConverters.js";
|
||||
import Anthropic from "./Anthropic.js";
|
||||
import Gemini from "./Gemini.js";
|
||||
|
||||
|
|
@ -23,6 +24,15 @@ class VertexAI extends BaseLLM {
|
|||
|
||||
private clientPromise: Promise<AuthClient | void>;
|
||||
|
||||
protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = [
|
||||
"chat",
|
||||
"embed",
|
||||
"list",
|
||||
"rerank",
|
||||
"streamChat",
|
||||
"streamFim",
|
||||
];
|
||||
|
||||
/*
|
||||
Vertex Supports 3 different URL formats
|
||||
1. Standard VertexAI: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent
|
||||
|
|
|
|||
|
|
@ -179,17 +179,11 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
|
|||
});
|
||||
|
||||
it("should return undefined for Claude Haiku and Opus models", () => {
|
||||
expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(
|
||||
false,
|
||||
);
|
||||
expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(
|
||||
false,
|
||||
);
|
||||
expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(
|
||||
false,
|
||||
);
|
||||
expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(false);
|
||||
expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(false);
|
||||
expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(true);
|
||||
expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(true);
|
||||
expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(true);
|
||||
expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(true);
|
||||
expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(true);
|
||||
});
|
||||
|
||||
it("should return undefined for other unsupported models", () => {
|
||||
|
|
|
|||
|
|
@ -14,39 +14,17 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
|
|||
}
|
||||
} catch (e) {}
|
||||
|
||||
return [
|
||||
"claude-3-5",
|
||||
"claude-3.5",
|
||||
"claude-3-7",
|
||||
"claude-3.7",
|
||||
"claude-sonnet-4",
|
||||
"claude-4-sonnet",
|
||||
"gpt-4",
|
||||
"o3",
|
||||
"gemini",
|
||||
"claude-opus-4",
|
||||
"gemma",
|
||||
].some((part) => model.toLowerCase().startsWith(part));
|
||||
return ["claude", "gpt-4", "o3", "gemini", "gemma"].some((part) =>
|
||||
model.toLowerCase().startsWith(part),
|
||||
);
|
||||
},
|
||||
anthropic: (model) => {
|
||||
const lower = model.toLowerCase();
|
||||
if (
|
||||
[
|
||||
"claude-3-5",
|
||||
"claude-3.5",
|
||||
"claude-3-7",
|
||||
"claude-3.7",
|
||||
"claude-sonnet-4",
|
||||
"claude-4-sonnet",
|
||||
"claude-opus-4",
|
||||
].some((part) => lower.startsWith(part))
|
||||
) {
|
||||
if (model.includes("claude-2") || model.includes("claude-instant")) {
|
||||
return false;
|
||||
}
|
||||
if (["claude"].some((part) => model.toLowerCase().startsWith(part))) {
|
||||
return true;
|
||||
}
|
||||
if (lower.includes("claude") && lower.includes("4-5")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
azure: (model) => {
|
||||
|
|
@ -125,15 +103,12 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
|
|||
);
|
||||
},
|
||||
bedrock: (model) => {
|
||||
if (model.includes("claude-2") || model.includes("claude-instant")) {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
[
|
||||
"claude-3-5-sonnet",
|
||||
"claude-3.5-sonnet",
|
||||
"claude-3-7-sonnet",
|
||||
"claude-3.7-sonnet",
|
||||
"claude-sonnet-4",
|
||||
"claude-4-sonnet",
|
||||
"claude-opus-4",
|
||||
"claude",
|
||||
"nova-lite",
|
||||
"nova-pro",
|
||||
"nova-micro",
|
||||
|
|
@ -280,8 +255,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
|
|||
"openai/o3",
|
||||
"openai/o4",
|
||||
"openai/gpt-oss",
|
||||
"anthropic/claude-3",
|
||||
"anthropic/claude-4",
|
||||
"anthropic/claude",
|
||||
"microsoft/phi-3",
|
||||
"google/gemini-flash-1.5",
|
||||
"google/gemini-2",
|
||||
|
|
@ -391,7 +365,8 @@ export function isRecommendedAgentModel(modelName: string): boolean {
|
|||
const recs: RegExp[][] = [
|
||||
[/o[134]/],
|
||||
[/deepseek/, /r1|reasoner/],
|
||||
[/gemini/, /2\.5|3/, /pro/],
|
||||
[/gemini/, /2\.5/, /pro/],
|
||||
[/gemini/, /3-pro/],
|
||||
[/gpt/, /-5|5\.1/],
|
||||
[/claude/, /sonnet/, /3\.7|3-7|-4/],
|
||||
[/claude/, /opus/, /-4/],
|
||||
|
|
|
|||
|
|
@ -12,19 +12,21 @@ function calculateAnthropicCost(
|
|||
// Normalize model name to handle various formats
|
||||
const normalizedModel = model.toLowerCase();
|
||||
|
||||
// Define pricing per million tokens (MTok)
|
||||
// Define pricing per million tokens (MTok) by model family prefix
|
||||
const pricing: Record<
|
||||
string,
|
||||
{ input: number; output: number; cacheWrite: number; cacheRead: number }
|
||||
> = {
|
||||
// Claude Opus 4 (most intelligent model)
|
||||
"claude-3-opus": {
|
||||
input: 15,
|
||||
output: 75,
|
||||
cacheWrite: 18.75,
|
||||
cacheRead: 1.5,
|
||||
// Claude Opus 4.5 (most intelligent model)
|
||||
"claude-opus-4-5": {
|
||||
input: 5,
|
||||
output: 25,
|
||||
cacheWrite: 6.25,
|
||||
cacheRead: 0.5,
|
||||
},
|
||||
"claude-3-opus-20240229": {
|
||||
|
||||
// Claude Opus 4 (legacy)
|
||||
"claude-3-opus": {
|
||||
input: 15,
|
||||
output: 75,
|
||||
cacheWrite: 18.75,
|
||||
|
|
@ -38,18 +40,6 @@ function calculateAnthropicCost(
|
|||
cacheWrite: 3.75,
|
||||
cacheRead: 0.3,
|
||||
},
|
||||
"claude-3-5-sonnet-20241022": {
|
||||
input: 3,
|
||||
output: 15,
|
||||
cacheWrite: 3.75,
|
||||
cacheRead: 0.3,
|
||||
},
|
||||
"claude-3-5-sonnet-20240620": {
|
||||
input: 3,
|
||||
output: 15,
|
||||
cacheWrite: 3.75,
|
||||
cacheRead: 0.3,
|
||||
},
|
||||
|
||||
// Claude Haiku 3.5 (fastest, most cost-effective)
|
||||
"claude-3-5-haiku": {
|
||||
|
|
@ -58,12 +48,6 @@ function calculateAnthropicCost(
|
|||
cacheWrite: 1,
|
||||
cacheRead: 0.08,
|
||||
},
|
||||
"claude-3-5-haiku-20241022": {
|
||||
input: 0.8,
|
||||
output: 4,
|
||||
cacheWrite: 1,
|
||||
cacheRead: 0.08,
|
||||
},
|
||||
|
||||
// Legacy Claude 3 Haiku
|
||||
"claude-3-haiku": {
|
||||
|
|
@ -72,35 +56,16 @@ function calculateAnthropicCost(
|
|||
cacheWrite: 0.3,
|
||||
cacheRead: 0.03,
|
||||
},
|
||||
"claude-3-haiku-20240307": {
|
||||
input: 0.25,
|
||||
output: 1.25,
|
||||
cacheWrite: 0.3,
|
||||
cacheRead: 0.03,
|
||||
},
|
||||
};
|
||||
|
||||
// Find matching pricing model
|
||||
let modelPricing = pricing[normalizedModel];
|
||||
// Sort keys by length (longest first) to match most specific patterns first
|
||||
const sortedKeys = Object.keys(pricing).sort((a, b) => b.length - a.length);
|
||||
|
||||
// If exact match not found, try to find by partial match
|
||||
if (!modelPricing) {
|
||||
for (const [key, value] of Object.entries(pricing)) {
|
||||
if (normalizedModel.includes(key) || key.includes(normalizedModel)) {
|
||||
modelPricing = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If still no match, try common patterns
|
||||
if (!modelPricing) {
|
||||
if (normalizedModel.includes("opus")) {
|
||||
modelPricing = pricing["claude-3-opus"];
|
||||
} else if (normalizedModel.includes("sonnet")) {
|
||||
modelPricing = pricing["claude-3-5-sonnet"];
|
||||
} else if (normalizedModel.includes("haiku")) {
|
||||
modelPricing = pricing["claude-3-5-haiku"];
|
||||
let modelPricing = null;
|
||||
for (const prefix of sortedKeys) {
|
||||
if (normalizedModel.startsWith(prefix)) {
|
||||
modelPricing = pricing[prefix];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,14 +132,90 @@ function calculateAnthropicCost(
|
|||
};
|
||||
}
|
||||
|
||||
function calculateOpenAICost(
|
||||
model: string,
|
||||
usage: Usage,
|
||||
): CostBreakdown | null {
|
||||
// Normalize model name
|
||||
const normalizedModel = model.toLowerCase();
|
||||
|
||||
// Define pricing per million tokens (MTok) by model family prefix
|
||||
const pricing: Record<string, { input: number; output: number }> = {
|
||||
// GPT-4o models (most specific first)
|
||||
"gpt-4o-mini": { input: 0.15, output: 0.6 },
|
||||
"gpt-4o": { input: 2.5, output: 10 },
|
||||
|
||||
// GPT-4 Turbo models
|
||||
"gpt-4-turbo": { input: 10, output: 30 },
|
||||
|
||||
// GPT-3.5 Turbo models (most specific first)
|
||||
"gpt-3.5-turbo-0125": { input: 0.5, output: 1.5 },
|
||||
"gpt-3.5-turbo-1106": { input: 1, output: 2 },
|
||||
"gpt-3.5-turbo": { input: 1.5, output: 2 },
|
||||
|
||||
// Base GPT-4 (fallback for other gpt-4 variants)
|
||||
"gpt-4": { input: 30, output: 60 },
|
||||
};
|
||||
|
||||
// Sort keys by length (longest first) to match most specific patterns first
|
||||
const sortedKeys = Object.keys(pricing).sort((a, b) => b.length - a.length);
|
||||
|
||||
let modelPricing = null;
|
||||
for (const prefix of sortedKeys) {
|
||||
if (normalizedModel.startsWith(prefix)) {
|
||||
modelPricing = pricing[prefix];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!modelPricing) {
|
||||
return null; // Unknown model
|
||||
}
|
||||
|
||||
// Calculate costs
|
||||
const inputCost = (usage.promptTokens / 1_000_000) * modelPricing.input;
|
||||
const outputCost = (usage.completionTokens / 1_000_000) * modelPricing.output;
|
||||
|
||||
// Build breakdown components
|
||||
const breakdownParts: string[] = [];
|
||||
|
||||
if (usage.promptTokens > 0) {
|
||||
breakdownParts.push(
|
||||
`Input: ${usage.promptTokens.toLocaleString()} tokens × $${modelPricing.input}/MTok = $${inputCost.toFixed(6)}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (usage.completionTokens > 0) {
|
||||
breakdownParts.push(
|
||||
`Output: ${usage.completionTokens.toLocaleString()} tokens × $${modelPricing.output}/MTok = $${outputCost.toFixed(6)}`,
|
||||
);
|
||||
}
|
||||
|
||||
const totalCost = inputCost + outputCost;
|
||||
|
||||
// Build final breakdown string
|
||||
let breakdown = `Model: ${model}\n`;
|
||||
breakdown += breakdownParts.join("\n");
|
||||
if (breakdownParts.length > 1) {
|
||||
breakdown += `\nTotal: $${totalCost.toFixed(6)}`;
|
||||
}
|
||||
|
||||
return {
|
||||
cost: totalCost,
|
||||
breakdown,
|
||||
};
|
||||
}
|
||||
|
||||
export function calculateRequestCost(
|
||||
provider: string,
|
||||
model: string,
|
||||
usage: Usage,
|
||||
): CostBreakdown | null {
|
||||
switch (provider) {
|
||||
switch (provider.toLowerCase()) {
|
||||
case "anthropic":
|
||||
return calculateAnthropicCost(model, usage);
|
||||
case "openai":
|
||||
return calculateOpenAICost(model, usage);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
256
core/llm/utils/calculateRequestCost.vitest.ts
Normal file
256
core/llm/utils/calculateRequestCost.vitest.ts
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { Usage } from "../..";
|
||||
|
||||
import { calculateRequestCost, CostBreakdown } from "./calculateRequestCost";
|
||||
|
||||
interface TestCase {
|
||||
provider: string;
|
||||
model: string;
|
||||
promptTokens: number;
|
||||
completionTokens: number;
|
||||
cachedTokens?: number;
|
||||
cacheWriteTokens?: number;
|
||||
expectedCost: number | null;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
describe("calculateRequestCost", () => {
|
||||
const testCases: TestCase[] = [
|
||||
// Anthropic Claude 3.5 Sonnet
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0105,
|
||||
description: "Claude 3.5 Sonnet basic usage",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
cachedTokens: 2000,
|
||||
expectedCost: 0.0111,
|
||||
description: "Claude 3.5 Sonnet with cache reads",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
cacheWriteTokens: 300,
|
||||
expectedCost: 0.011625,
|
||||
description: "Claude 3.5 Sonnet with cache writes",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20240620",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0105,
|
||||
description: "Claude 3.5 Sonnet (older version)",
|
||||
},
|
||||
|
||||
// Anthropic Claude 3.5 Haiku
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-haiku-20241022",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0028,
|
||||
description: "Claude 3.5 Haiku",
|
||||
},
|
||||
|
||||
// Anthropic Claude 3 Haiku (legacy)
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-haiku-20240307",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.000875,
|
||||
description: "Claude 3 Haiku legacy",
|
||||
},
|
||||
|
||||
// Anthropic Claude 3 Opus
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-opus-20240229",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0525,
|
||||
description: "Claude 3 Opus",
|
||||
},
|
||||
|
||||
// Anthropic Claude Opus 4.5
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-opus-4-5-20251101",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0175,
|
||||
description: "Claude Opus 4.5 basic usage",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-opus-4-5-latest",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0175,
|
||||
description: "Claude Opus 4.5 latest (partial match)",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-opus-4-5-20251101",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
cachedTokens: 2000,
|
||||
expectedCost: 0.0185,
|
||||
description: "Claude Opus 4.5 with cache reads",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-opus-4-5-20251101",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
cacheWriteTokens: 300,
|
||||
expectedCost: 0.019375,
|
||||
description: "Claude Opus 4.5 with cache writes",
|
||||
},
|
||||
|
||||
// OpenAI GPT-4
|
||||
{
|
||||
provider: "openai",
|
||||
model: "gpt-4",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.06,
|
||||
description: "GPT-4 basic usage",
|
||||
},
|
||||
{
|
||||
provider: "openai",
|
||||
model: "gpt-4-turbo",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.025,
|
||||
description: "GPT-4 Turbo",
|
||||
},
|
||||
{
|
||||
provider: "openai",
|
||||
model: "gpt-4o",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0075,
|
||||
description: "GPT-4o",
|
||||
},
|
||||
{
|
||||
provider: "openai",
|
||||
model: "gpt-4o-mini",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.00045,
|
||||
description: "GPT-4o-mini",
|
||||
},
|
||||
|
||||
// OpenAI GPT-3.5
|
||||
{
|
||||
provider: "openai",
|
||||
model: "gpt-3.5-turbo-0125",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.00125,
|
||||
description: "GPT-3.5 Turbo",
|
||||
},
|
||||
|
||||
// Edge cases
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 0,
|
||||
completionTokens: 0,
|
||||
expectedCost: 0,
|
||||
description: "Zero tokens",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 0,
|
||||
expectedCost: 0.003,
|
||||
description: "Only input tokens",
|
||||
},
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 0,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0075,
|
||||
description: "Only output tokens",
|
||||
},
|
||||
|
||||
// Case insensitivity
|
||||
{
|
||||
provider: "ANTHROPIC",
|
||||
model: "claude-3-5-sonnet-20241022",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: 0.0105,
|
||||
description: "Provider name case insensitive",
|
||||
},
|
||||
|
||||
// Unknown models/providers
|
||||
{
|
||||
provider: "anthropic",
|
||||
model: "claude-unknown-model",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: null,
|
||||
description: "Unknown Anthropic model",
|
||||
},
|
||||
{
|
||||
provider: "google",
|
||||
model: "gemini-pro",
|
||||
promptTokens: 1000,
|
||||
completionTokens: 500,
|
||||
expectedCost: null,
|
||||
description: "Unknown provider",
|
||||
},
|
||||
];
|
||||
|
||||
testCases.forEach(
|
||||
({
|
||||
provider,
|
||||
model,
|
||||
promptTokens,
|
||||
completionTokens,
|
||||
cachedTokens,
|
||||
cacheWriteTokens,
|
||||
expectedCost,
|
||||
description,
|
||||
}) => {
|
||||
it(description || `${provider}/${model}`, () => {
|
||||
const usage: Usage = {
|
||||
promptTokens,
|
||||
completionTokens,
|
||||
promptTokensDetails:
|
||||
cachedTokens || cacheWriteTokens
|
||||
? {
|
||||
cachedTokens,
|
||||
cacheWriteTokens,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const result = calculateRequestCost(provider, model, usage);
|
||||
|
||||
if (expectedCost === null) {
|
||||
expect(result).toBeNull();
|
||||
} else {
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.cost).toBeCloseTo(expectedCost, 6);
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
194
core/package-lock.json
generated
194
core/package-lock.json
generated
|
|
@ -19,7 +19,7 @@
|
|||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@continuedev/terminal-security": "file:../packages/terminal-security",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@modelcontextprotocol/sdk": "^1.24.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"@sentry/cli": "^2.50.2",
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
"tree-sitter-wasms": "^0.1.11",
|
||||
"untildify": "^6.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.20",
|
||||
"vectordb": "0.4.20",
|
||||
"web-tree-sitter": "^0.21.0",
|
||||
"win-ca": "^3.5.1",
|
||||
"wink-nlp-utils": "^2.1.0",
|
||||
|
|
@ -221,11 +221,12 @@
|
|||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.67.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.913.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.929.0",
|
||||
"@aws-sdk/credential-providers": "^3.929.0",
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@continuedev/fetch": "^1.5.0",
|
||||
"@continuedev/config-yaml": "^1.36.0",
|
||||
"@continuedev/fetch": "^1.6.0",
|
||||
"@google/genai": "^1.30.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.4.1",
|
||||
"json-schema": "^0.4.0",
|
||||
|
|
@ -4350,34 +4351,64 @@
|
|||
]
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.12.0.tgz",
|
||||
"integrity": "sha512-m//7RlINx1F3sz3KqwY1WWzVgTcYX52HYk4bJ1hkBXV3zccAEth+jRvG8DBRrdaQuRsPAJOx2MH3zaHNCKL7Zg==",
|
||||
"version": "1.24.1",
|
||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.24.1.tgz",
|
||||
"integrity": "sha512-YTg4v6bKSst8EJM8NXHC3nGm8kgHD08IbIBbognUeLAgGLVgLpYrgQswzLQd4OyTL4l614ejhqsDrV1//t02Qw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.6",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"content-type": "^1.0.5",
|
||||
"cors": "^2.8.5",
|
||||
"cross-spawn": "^7.0.5",
|
||||
"eventsource": "^3.0.2",
|
||||
"eventsource-parser": "^3.0.0",
|
||||
"express": "^5.0.1",
|
||||
"express-rate-limit": "^7.5.0",
|
||||
"jose": "^6.1.1",
|
||||
"pkce-challenge": "^5.0.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"zod": "^3.23.8",
|
||||
"zod-to-json-schema": "^3.24.1"
|
||||
"zod": "^3.25 || ^4.0",
|
||||
"zod-to-json-schema": "^3.25.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cfworker/json-schema": "^4.1.1",
|
||||
"zod": "^3.25 || ^4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@cfworker/json-schema": {
|
||||
"optional": true
|
||||
},
|
||||
"zod": {
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema": {
|
||||
"version": "3.24.1",
|
||||
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz",
|
||||
"integrity": "sha512-3h08nf3Vw3Wl3PK+q3ow/lIil81IT2Oa7YpQyUUDsEWbXveMesdfK1xBd2RhCkynwZndAxixji/7SYJJowr62w==",
|
||||
"peerDependencies": {
|
||||
"zod": "^3.24.1"
|
||||
"node_modules/@modelcontextprotocol/sdk/node_modules/ajv": {
|
||||
"version": "8.17.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
||||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"fast-uri": "^3.0.1",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"require-from-string": "^2.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@mozilla/readability": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@mozilla/readability/-/readability-0.5.0.tgz",
|
||||
|
|
@ -7772,6 +7803,45 @@
|
|||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
|
||||
"integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ajv": "^8.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"ajv": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats/node_modules/ajv": {
|
||||
"version": "8.17.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
||||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"fast-uri": "^3.0.1",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"require-from-string": "^2.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats/node_modules/json-schema-traverse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ansi-escapes": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
|
||||
|
|
@ -8584,7 +8654,8 @@
|
|||
"node_modules/buffer-equal-constant-time": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
|
||||
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="
|
||||
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
"version": "1.1.2",
|
||||
|
|
@ -11237,6 +11308,22 @@
|
|||
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
||||
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
|
||||
},
|
||||
"node_modules/fast-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
|
||||
"integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fastify"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fastify"
|
||||
}
|
||||
],
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/fast-xml-parser": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz",
|
||||
|
|
@ -14018,6 +14105,15 @@
|
|||
"jinjajs": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/jose": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz",
|
||||
"integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/panva"
|
||||
}
|
||||
},
|
||||
"node_modules/js-md4": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz",
|
||||
|
|
@ -14183,21 +14279,23 @@
|
|||
}
|
||||
},
|
||||
"node_modules/jsonwebtoken/node_modules/jwa": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
|
||||
"integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz",
|
||||
"integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"buffer-equal-constant-time": "1.0.1",
|
||||
"buffer-equal-constant-time": "^1.0.1",
|
||||
"ecdsa-sig-formatter": "1.0.11",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/jsonwebtoken/node_modules/jws": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
|
||||
"integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz",
|
||||
"integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^1.4.1",
|
||||
"jwa": "^1.4.2",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
|
|
@ -14227,21 +14325,23 @@
|
|||
}
|
||||
},
|
||||
"node_modules/jwa": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
|
||||
"integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",
|
||||
"integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"buffer-equal-constant-time": "1.0.1",
|
||||
"buffer-equal-constant-time": "^1.0.1",
|
||||
"ecdsa-sig-formatter": "1.0.11",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/jws": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
|
||||
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
|
||||
"integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^2.0.0",
|
||||
"jwa": "^2.0.1",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
|
|
@ -14678,9 +14778,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/mdast-util-to-hast": {
|
||||
"version": "13.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz",
|
||||
"integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==",
|
||||
"version": "13.2.1",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz",
|
||||
"integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -17245,6 +17345,15 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-from-string": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-in-the-middle": {
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz",
|
||||
|
|
@ -20398,6 +20507,15 @@
|
|||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
},
|
||||
"node_modules/zod-to-json-schema": {
|
||||
"version": "3.25.0",
|
||||
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.0.tgz",
|
||||
"integrity": "sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ==",
|
||||
"license": "ISC",
|
||||
"peerDependencies": {
|
||||
"zod": "^3.25 || ^4"
|
||||
}
|
||||
},
|
||||
"node_modules/zwitch": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@continuedev/terminal-security": "file:../packages/terminal-security",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@modelcontextprotocol/sdk": "^1.24.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"@sentry/cli": "^2.50.2",
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
"tree-sitter-wasms": "^0.1.11",
|
||||
"untildify": "^6.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.20",
|
||||
"vectordb": "0.4.20",
|
||||
"web-tree-sitter": "^0.21.0",
|
||||
"win-ca": "^3.5.1",
|
||||
"wink-nlp-utils": "^2.1.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { expect, test, vi } from "vitest";
|
||||
import { ToolExtras } from "../..";
|
||||
import { readFileRangeImpl } from "./readFileRange";
|
||||
import { MAX_CHAR_POSITION, readFileRangeImpl } from "./readFileRange";
|
||||
|
||||
// Mock the dependencies
|
||||
vi.mock("../../util/ideUtils", () => ({
|
||||
|
|
@ -76,7 +76,7 @@ test("readFileRangeImpl handles out-of-bounds ranges gracefully", async () => {
|
|||
"file:///test.txt",
|
||||
{
|
||||
start: { line: 99, character: 0 }, // 100 - 1
|
||||
end: { line: 104, character: Number.MAX_SAFE_INTEGER }, // 105 - 1
|
||||
end: { line: 104, character: MAX_CHAR_POSITION }, // 105 - 1
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ test("readFileRangeImpl handles out-of-bounds ranges gracefully", async () => {
|
|||
"file:///test.txt",
|
||||
{
|
||||
start: { line: 4, character: 0 }, // 5 - 1
|
||||
end: { line: 99, character: Number.MAX_SAFE_INTEGER }, // 100 - 1
|
||||
end: { line: 99, character: MAX_CHAR_POSITION }, // 100 - 1
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
@ -199,6 +199,6 @@ test("readFileRangeImpl handles normal ranges correctly", async () => {
|
|||
// Verify correct 0-based conversion
|
||||
expect(mockIde.readRangeInFile).toHaveBeenCalledWith("file:///test.txt", {
|
||||
start: { line: 1, character: 0 }, // 2 - 1
|
||||
end: { line: 3, character: Number.MAX_SAFE_INTEGER }, // 4 - 1
|
||||
end: { line: 3, character: MAX_CHAR_POSITION }, // 4 - 1
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ import { getNumberArg, getStringArg } from "../parseArgs";
|
|||
import { throwIfFileExceedsHalfOfContext } from "./readFileLimit";
|
||||
import { ContinueError, ContinueErrorReason } from "../../util/errors";
|
||||
|
||||
// Use Int.MAX_VALUE from Java/Kotlin (2^31 - 1) instead of JavaScript's Number.MAX_SAFE_INTEGER
|
||||
// to ensure compatibility with IntelliJ's Kotlin Position type which uses Int for character field
|
||||
export const MAX_CHAR_POSITION = 2147483647;
|
||||
|
||||
export const readFileRangeImpl: ToolImpl = async (args, extras) => {
|
||||
const filepath = getStringArg(args, "filepath");
|
||||
const startLine = getNumberArg(args, "startLine");
|
||||
|
|
@ -52,7 +56,7 @@ export const readFileRangeImpl: ToolImpl = async (args, extras) => {
|
|||
},
|
||||
end: {
|
||||
line: endLine - 1, // Convert from 1-based to 0-based
|
||||
character: Number.MAX_SAFE_INTEGER, // Read to end of line
|
||||
character: MAX_CHAR_POSITION, // Read to end of line
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import iconv from "iconv-lite";
|
||||
import childProcess from "node:child_process";
|
||||
import os from "node:os";
|
||||
import util from "node:util";
|
||||
import { ContinueError, ContinueErrorReason } from "../../util/errors";
|
||||
// Automatically decode the buffer according to the platform to avoid garbled Chinese
|
||||
function getDecodedOutput(data: Buffer): string {
|
||||
|
|
@ -44,7 +43,25 @@ import {
|
|||
} from "../../util/processTerminalStates";
|
||||
import { getBooleanArg, getStringArg } from "../parseArgs";
|
||||
|
||||
const asyncExec = util.promisify(childProcess.exec);
|
||||
/**
|
||||
* Resolves the working directory from workspace dirs.
|
||||
* Falls back to home directory or temp directory if no workspace is available.
|
||||
*/
|
||||
function resolveWorkingDirectory(workspaceDirs: string[]): string {
|
||||
const fileWorkspaceDir = workspaceDirs.find((dir) =>
|
||||
dir.startsWith("file:/"),
|
||||
);
|
||||
if (fileWorkspaceDir) {
|
||||
return fileURLToPath(fileWorkspaceDir);
|
||||
}
|
||||
// Default to user's home directory with fallbacks
|
||||
try {
|
||||
return process.env.HOME || process.env.USERPROFILE || process.cwd();
|
||||
} catch {
|
||||
// Final fallback if even process.cwd() fails - use system temp directory
|
||||
return os.tmpdir();
|
||||
}
|
||||
}
|
||||
|
||||
// Add color-supporting environment variables
|
||||
const getColorEnv = () => ({
|
||||
|
|
@ -82,20 +99,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
|
|||
if (extras.onPartialOutput) {
|
||||
try {
|
||||
const workspaceDirs = await extras.ide.getWorkspaceDirs();
|
||||
|
||||
// Handle case where no workspace is available
|
||||
let cwd: string;
|
||||
if (workspaceDirs.length > 0) {
|
||||
cwd = fileURLToPath(workspaceDirs[0]);
|
||||
} else {
|
||||
// Default to user's home directory with fallbacks
|
||||
try {
|
||||
cwd = process.env.HOME || process.env.USERPROFILE || process.cwd();
|
||||
} catch (error) {
|
||||
// Final fallback if even process.cwd() fails - use system temp directory
|
||||
cwd = os.tmpdir();
|
||||
}
|
||||
}
|
||||
const cwd = resolveWorkingDirectory(workspaceDirs);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let terminalOutput = "";
|
||||
|
|
@ -281,23 +285,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
|
|||
} else {
|
||||
// Fallback to non-streaming for older clients
|
||||
const workspaceDirs = await extras.ide.getWorkspaceDirs();
|
||||
|
||||
// Handle case where no workspace is available
|
||||
let cwd: string;
|
||||
const fileWorkspaceDir = workspaceDirs.find((dir) =>
|
||||
dir.startsWith("file:/"),
|
||||
);
|
||||
if (fileWorkspaceDir) {
|
||||
cwd = fileURLToPath(fileWorkspaceDir);
|
||||
} else {
|
||||
// Default to user's home directory with fallbacks
|
||||
try {
|
||||
cwd = process.env.HOME || process.env.USERPROFILE || process.cwd();
|
||||
} catch (error) {
|
||||
// Final fallback if even process.cwd() fails - use system temp directory
|
||||
cwd = os.tmpdir();
|
||||
}
|
||||
}
|
||||
const cwd = resolveWorkingDirectory(workspaceDirs);
|
||||
|
||||
if (waitForCompletion) {
|
||||
// Standard execution, waiting for completion
|
||||
|
|
|
|||
|
|
@ -18,15 +18,38 @@ export function getStringArg(
|
|||
argName: string,
|
||||
allowEmpty = false,
|
||||
): string {
|
||||
if (!args || !(argName in args) || typeof args[argName] !== "string") {
|
||||
if (!args || !(argName in args)) {
|
||||
throw new Error(
|
||||
`\`${argName}\` argument is required${allowEmpty ? "" : " and must not be empty or whitespace-only"}. (type string)`,
|
||||
);
|
||||
}
|
||||
if (!allowEmpty && !args[argName].trim()) {
|
||||
|
||||
let value = args[argName];
|
||||
|
||||
// Handle case where JSON was parsed into an object by the tool call parser.
|
||||
// If the arguments to the tool call are valid JSON (e.g. the model attempts to create a .json file)
|
||||
// the earlier call to JSON.parse() will have deeply parsed the returned arguments.
|
||||
// If that has happened, convert back to string.
|
||||
if (typeof value === "object" && value !== null) {
|
||||
try {
|
||||
value = JSON.stringify(value);
|
||||
return value;
|
||||
} catch (e) {
|
||||
//Swallow this, because it might be fine later.
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof value !== "string") {
|
||||
throw new Error(
|
||||
`\`${argName}\` argument is required${allowEmpty ? "" : " and must not be empty or whitespace-only"}. (type string)`,
|
||||
);
|
||||
}
|
||||
|
||||
if (!allowEmpty && !value.trim()) {
|
||||
throw new Error(`Argument ${argName} must not be empty or whitespace-only`);
|
||||
}
|
||||
return args[argName];
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
export function getOptionalStringArg(
|
||||
|
|
|
|||
|
|
@ -144,6 +144,50 @@ describe("getStringArg", () => {
|
|||
"`name` argument is required and must not be empty or whitespace-only. (type string)",
|
||||
);
|
||||
});
|
||||
|
||||
it("should convert parsed JSON object to string for contents parameter", () => {
|
||||
// This simulates the case where JSON.parse() has converted a JSON string into an object
|
||||
const args = { contents: { key: "value", number: 123 } };
|
||||
const result = getStringArg(args, "contents");
|
||||
expect(result).toBe('{"key":"value","number":123}');
|
||||
});
|
||||
|
||||
it("should convert nested JSON object to string for contents parameter", () => {
|
||||
const args = {
|
||||
contents: {
|
||||
user: {
|
||||
name: "John",
|
||||
details: {
|
||||
age: 30,
|
||||
preferences: ["coding", "reading"],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
const result = getStringArg(args, "contents");
|
||||
const expected =
|
||||
'{"user":{"name":"John","details":{"age":30,"preferences":["coding","reading"]}}}';
|
||||
expect(result).toBe(expected);
|
||||
});
|
||||
|
||||
it("should convert JSON array to string for contents parameter", () => {
|
||||
const args = { contents: ["item1", "item2", { key: "value" }] };
|
||||
const result = getStringArg(args, "contents");
|
||||
expect(result).toBe('["item1","item2",{"key":"value"}]');
|
||||
});
|
||||
|
||||
it("should handle contents parameter that is already a string", () => {
|
||||
const args = { contents: "already a string" };
|
||||
const result = getStringArg(args, "contents");
|
||||
expect(result).toBe("already a string");
|
||||
});
|
||||
|
||||
it("should handle contents parameter that is null", () => {
|
||||
const args = { contents: null };
|
||||
expect(() => getStringArg(args, "contents")).toThrowError(
|
||||
"`contents` argument is required and must not be empty or whitespace-only. (type string)",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getOptionalStringArg", () => {
|
||||
|
|
|
|||
|
|
@ -114,6 +114,9 @@ export class HistoryManager {
|
|||
if (session.chatModelTitle !== undefined) {
|
||||
orderedSession.chatModelTitle = session.chatModelTitle;
|
||||
}
|
||||
if (session.usage !== undefined) {
|
||||
orderedSession.usage = session.usage;
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
getSessionFilePath(session.sessionId),
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ If you want to have the best autocomplete experience, we recommend using Codestr
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Codestral
|
||||
provider: mistral
|
||||
|
|
@ -68,6 +72,10 @@ Then, add the model to your configuration:
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen 1.5b Autocomplete Model
|
||||
provider: ollama
|
||||
|
|
@ -104,6 +112,10 @@ For example:
|
|||
<Tab title="YAML">
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen3 without Thinking for Autocomplete
|
||||
provider: ollama
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ The SambaNova Cloud is a cloud platform for running large AI models with the wor
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: GPT OSS 120B
|
||||
provider: sambanova
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ Add your Ask Sage model to your Continue configuration file.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: GPT-4 gov
|
||||
provider: askSage
|
||||
|
|
@ -66,6 +70,10 @@ For secure environments, specify your DoD CA bundle path:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: GPT-4 gov
|
||||
provider: askSage
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ Cerebras Inference uses specialized silicon to provides fast inference.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Cerebras Llama 3.1 70B
|
||||
provider: cerebras
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ Cloudflare Workers AI can be used for both chat and tab autocompletion in Contin
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama 3 8B
|
||||
provider: cloudflare
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ We recommend configuring **Command A** as your chat model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Command A 03-2025
|
||||
provider: cohere
|
||||
|
|
@ -48,6 +52,10 @@ We recommend configuring **embed-v4.0** as your embeddings model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Cohere Embed v4.0
|
||||
provider: cohere
|
||||
|
|
@ -77,6 +85,10 @@ We recommend configuring **rerank-v3.5** as your reranking model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Cohere Rerank v3.5
|
||||
provider: cohere
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ description: "Configure DeepInfra with Continue to access low-cost inference for
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: deepinfra
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ slug: ../deepseek
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: deepseek
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ description: "Configure Flowise with Continue to integrate with this low-code/no
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Flowise
|
||||
provider: flowise
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ Function Network supports a number of models for chat. We recommend using LLama
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama 3.1 70b
|
||||
provider: function-network
|
||||
|
|
@ -52,6 +56,10 @@ Function Network supports a number of models for autocomplete. We recommend usin
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Deepseek Coder 6.7b
|
||||
provider: function-network
|
||||
|
|
@ -82,6 +90,10 @@ Function Network supports a number of models for embeddings. We recommend using
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: BGE Base En
|
||||
provider: function-network
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ sidebarTitle: "Groq"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: groq
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
---
|
||||
title: "Hugging Face"
|
||||
---
|
||||
|
||||
<Info>
|
||||
Get started with [Hugging Face Inference Endpoints](https://endpoints.huggingface.co/)
|
||||
</Info>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: huggingface-inference-api
|
||||
model: <MODEL_ID>
|
||||
apiKey: <YOUR_HF_TOKEN>
|
||||
apiBase: <YOUR_HF_INFERENCE_API_ENDPOINT_URL>
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="JSON (Deprecated)">
|
||||
```json title="config.json"
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"title": "<MODEL_NAME>",
|
||||
"provider": "huggingface-inference-api",
|
||||
"model": "<MODEL_ID>",
|
||||
"apiKey": "<YOUR_HF_TOKEN>",
|
||||
"apiBase": "<YOUR_HF_INFERENCE_API_ENDPOINT_URL>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
|
@ -14,6 +14,10 @@ IPEX-LLM supports accelerated Ollama backend to be hosted on Intel GPU. Refer to
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: IPEX-LLM
|
||||
provider: ollama
|
||||
|
|
@ -40,6 +44,10 @@ If you would like to reach the Ollama service from another machine, make sure yo
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: IPEX-LLM
|
||||
provider: ollama
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ Kindo offers centralized control over your organization's AI operations, ensurin
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Claude 3.5 Sonnet
|
||||
provider: kindo
|
||||
|
|
@ -38,6 +42,10 @@ Kindo offers centralized control over your organization's AI operations, ensurin
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: WhiteRabbitNeo
|
||||
provider: kindo
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ If you need custom settings, you can manually configure Lemonade:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Lemonade
|
||||
provider: lemonade
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ title: "Llama.cpp"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: llama.cpp
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ A [llamafile](https://github.com/Mozilla-Ocho/llamafile#readme) is a self-contai
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llamafile
|
||||
provider: llamafile
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ keywords: [llama, stack, local, api, inference]
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: llamastack
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ slug: ../mistral
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: mistral
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ To use Moonshot AI models, you need to:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Moonshot
|
||||
provider: moonshot
|
||||
|
|
@ -61,6 +65,10 @@ Here's a complete configuration example:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Moonshot-8K
|
||||
provider: moonshot
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ Morph provides a fast apply model that helps you quickly and accurately apply co
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- uses: morphllm/morph-v0
|
||||
with:
|
||||
|
|
@ -15,6 +19,10 @@ Morph provides a fast apply model that helps you quickly and accurately apply co
|
|||
```
|
||||
or
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
- name: Morph Fast Apply
|
||||
provider: openai
|
||||
model: morph-v2
|
||||
|
|
@ -54,6 +62,10 @@ We recommend configuring **morph-embedding-v2** as your embeddings model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Morph Embeddings
|
||||
provider: openai
|
||||
|
|
@ -85,6 +97,10 @@ We recommend configuring **morph-rerank-v2** as your reranking model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Morph Reranker
|
||||
provider: cohere
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ description: "Configure Msty with Continue to easily run both online and local o
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Msty
|
||||
provider: msty
|
||||
|
|
@ -47,6 +51,10 @@ If you need to send custom headers for authentication, you may use the `requestO
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Msty
|
||||
provider: msty
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ Available models can be found on the [Nebius AI Studio models page](https://stud
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: DeepSeek R1
|
||||
provider: nebius
|
||||
|
|
@ -44,6 +48,10 @@ Available models can be found on the [Nebius AI Studio embeddings page](https://
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: BAAI Embedder
|
||||
provider: nebius
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ description: "Configure Novita AI with Continue to access their affordable and r
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama 3.1 8B
|
||||
provider: novita
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ title: "NVIDIA"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: nvidia
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ OpenVINO™ Mode Server supports text generation via OpenAI Chat Completions API
|
|||
Example configuration once OVMS is launched:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: OVMS CodeLlama-7b-Instruct-hf
|
||||
provider: openai
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ Check our [catalog](https://endpoints.ai.cloud.ovh.net/catalog) to see all of ou
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen2.5-Coder-32B-Instruct
|
||||
provider: ovhcloud
|
||||
|
|
@ -50,6 +54,10 @@ We recommend configuring **bge-multilingual-gemma2** as your embeddings model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: BGE Multilingual Gemma2
|
||||
provider: ovhcloud
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ Replicate is a great option for newly released language models or models that yo
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Replicate CodeLLama
|
||||
provider: replicate
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ Here is an example Sagemaker configuration setup:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: deepseek-6.7b-instruct
|
||||
provider: sagemaker
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ We recommend configuring **Qwen2.5-Coder-32B-Instruct** as your chat model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen2.5-Coder-32B-Instruct
|
||||
provider: scaleway
|
||||
|
|
@ -56,6 +60,10 @@ We recommend configuring **BGE-Multilingual-Gemma2** as your embeddings model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: BGE Multilingual Gemma2
|
||||
provider: scaleway
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ We recommend configuring **Qwen/Qwen2.5-Coder-32B-Instruct** as your chat model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen
|
||||
provider: siliconflow
|
||||
|
|
@ -47,6 +51,10 @@ We recommend configuring **Qwen/Qwen2.5-Coder-7B-Instruct** as your autocomplete
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen
|
||||
provider: siliconflow
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ TextGenWebUI is a comprehensive, open-source language model UI and local server.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Text Generation WebUI
|
||||
provider: text-gen-webui
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ sidebarTitle: "Together AI"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: together
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ We recommend configuring **Llama3.1 8B** as your chat model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama3.1 8B Instruct
|
||||
provider: vllm
|
||||
|
|
@ -46,6 +50,10 @@ We recommend configuring **Qwen2.5-Coder 1.5B** as your autocomplete model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Qwen2.5-Coder 1.5B
|
||||
provider: vllm
|
||||
|
|
@ -76,6 +84,10 @@ We recommend configuring **Nomic Embed Text** as your embeddings model.
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: VLLM Nomad Embed Text
|
||||
provider: vllm
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ Add the following configuration:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: watsonx - Model Name
|
||||
provider: watsonx
|
||||
|
|
@ -83,6 +87,10 @@ If you are using a custom deployment endpoint, set `deploymentID` to the model's
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: watsonx - Model Name
|
||||
provider: watsonx
|
||||
|
|
@ -121,6 +129,10 @@ You can also configure generation parameters, such as temperature, topP, topK, f
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Granite Code 20b
|
||||
provider: watsonx
|
||||
|
|
@ -180,6 +192,10 @@ Granite models are recommended for tab auto complete. The configuration is simil
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Granite Code 8b
|
||||
provider: watsonx
|
||||
|
|
@ -217,6 +233,10 @@ To view the list of available embeddings models, visit [this page](https://datap
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Watsonx Embedder
|
||||
provider: watsonx
|
||||
|
|
@ -250,6 +270,10 @@ To view the list of available embeddings models, visit [this page](https://datap
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Watsonx Reranker
|
||||
provider: watsonx
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ slug: ../xai
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: xai
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ These are the most commonly used model providers that offer a wide range of capa
|
|||
| [xAI](/customize/model-providers/more/xAI) | Grok models from xAI | Chat, Edit, Apply |
|
||||
| [Vertex AI](/customize/model-providers/top-level/vertexai) | Google Cloud's machine learning platform | Chat, Edit, Apply, Embeddings |
|
||||
| [Inception](/customize/model-providers/top-level/inception) | On-premises open-source model runners | Chat, Edit, Apply |
|
||||
| [HuggingFace](/customize/model-providers/top-level/huggingfaceinference) | Platform for open source models with inference providers and endpoints | Chat, Edit, Apply, Embeddings |
|
||||
|
||||
## Additional Model Providers
|
||||
|
||||
|
|
@ -37,7 +38,6 @@ Beyond the top-level providers, Continue supports many other options:
|
|||
| [Cohere](/customize/model-providers/more/cohere) | Models specialized for semantic search and text generation |
|
||||
| [NVIDIA](/customize/model-providers/more/nvidia) | GPU-accelerated model hosting |
|
||||
| [Cloudflare](/customize/model-providers/more/cloudflare) | Edge-based AI inference services |
|
||||
| [HuggingFace](/customize/model-providers/more/huggingfaceinferenceapi) | Platform for open source models |
|
||||
|
||||
### Local Model Options
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ sidebarTitle: "Anthropic"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: anthropic
|
||||
|
|
@ -41,7 +45,7 @@ sidebarTitle: "Anthropic"
|
|||
</Tabs>
|
||||
|
||||
<Info>
|
||||
**Check out a more advanced configuration [here](https://hub.continue.dev/anthropic/claude-4-sonnet?view=config)**
|
||||
**Check out a more advanced configuration [here](https://hub.continue.dev/anthropic/claude-sonnet-4-5?view=config)**
|
||||
</Info>
|
||||
|
||||
## How to Enable Prompt Caching with Claude
|
||||
|
|
@ -53,6 +57,10 @@ To enable caching of the system message and the turn-by-turn conversation, updat
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: anthropic
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ sidebarTitle: "Azure AI Foundry"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <Model_NAME>
|
||||
provider: azure
|
||||
|
|
@ -55,6 +59,10 @@ For example, a Target URI of `https://just-an-example.openai.azure.com/openai/de
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
model: <MODEL_ID>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ sidebarTitle: "Amazon Bedrock"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: bedrock
|
||||
|
|
@ -57,6 +61,10 @@ messages between requests. Enable this behavior by adding
|
|||
configuration.
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: bedrock
|
||||
|
|
@ -84,6 +92,10 @@ You can also use an AWS `accessKeyId` and `secretAccessKey` for authentication i
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: bedrock
|
||||
|
|
@ -121,6 +133,10 @@ To setup Bedrock using custom imported models, add the following to your config
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: bedrockimport
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ sidebarTitle: "Gemini"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: gemini
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
---
|
||||
title: "Hugging Face"
|
||||
---
|
||||
|
||||
Hugging Face is the main platform for sharing open AI models. It provides inference in two ways. [Inference Providers](https://huggingface.co/docs/inference-providers/index) and [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index).
|
||||
|
||||
## Inference Providers
|
||||
|
||||
Inference Providers is a serverless service powered by external inference providers and routed through Hugging Face and paid per token.
|
||||
|
||||
<Info>
|
||||
|
||||
You can access your access token from [Hugging Face](https://huggingface.co/settings/tokens) and prioritize your [providers in settings](https://huggingface.co/settings/inference-providers/overview).
|
||||
|
||||
</Info>
|
||||
|
||||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: deepseek
|
||||
provider: huggingface-inference-providers
|
||||
model: deepseek-ai/DeepSeek-V3.2-Exp
|
||||
apiKey: <YOUR_HF_TOKEN>
|
||||
apiBase: https://router.huggingface.co/v1
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="JSON (Deprecated)">
|
||||
```json title="config.json"
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"title": "deepseek",
|
||||
"provider": "huggingface-inference-providers",
|
||||
"model": "deepseek-ai/DeepSeek-V3.2-Exp",
|
||||
"apiKey": "<YOUR_HF_TOKEN>",
|
||||
"apiBase": "https://router.huggingface.co/v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Inference Endpoints
|
||||
|
||||
Inference Endpoints is a dedicated service that allows you to run your open models dedicated hardware. It is a more advanced way to get inference from Hugging Face models where you have more control over the whole process.
|
||||
|
||||
<Info>
|
||||
|
||||
Before you can use Inference Endpoints, you need to create an endpoint. You can do this by going to [Inference Endpoints](https://endpoints.huggingface.co/burtenshaw/endpoints/dedicated) and clicking on "Create Endpoint".
|
||||
|
||||
</Info>
|
||||
|
||||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: deepseek
|
||||
provider: huggingface-inference-endpoints
|
||||
model: <ENDPOINT_ID>
|
||||
apiKey: <YOUR_HF_TOKEN>
|
||||
apiBase: https://<YOUR_ENDPOINT_ID>.aws.endpoints.huggingface.cloud
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="JSON (Deprecated)">
|
||||
```json title="config.json"
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"title": "deepseek",
|
||||
"provider": "huggingface-inference-endpoints",
|
||||
"model": "<ENDPOINT_ID>",
|
||||
"apiKey": "<YOUR_HF_TOKEN>",
|
||||
"apiBase": "https://<YOUR_ENDPOINT_ID>.aws.endpoints.huggingface.cloud"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
|
@ -17,6 +17,10 @@ sidebarTitle: "Inception"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: inception
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ title: "LM Studio"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: lmstudio
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ sidebarTitle: "Ollama"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: ollama
|
||||
|
|
@ -51,6 +55,10 @@ Ollama models usually have their capabilities auto-detected correctly. However,
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <CUSTOM_MODEL_NAME>
|
||||
provider: ollama
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ sidebarTitle: "OpenAI"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: openai
|
||||
|
|
@ -63,6 +67,10 @@ If you are using an OpenAI API compatible providers, you can change the `apiBase
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <OPENAI_API_COMPATIBLE_PROVIDER_MODEL>
|
||||
provider: openai
|
||||
|
|
@ -95,6 +103,10 @@ To force usage of `completions` instead of `chat/completions` endpoint you can s
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <OPENAI_API_COMPATIBLE_PROVIDER_MODEL>
|
||||
provider: openai
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ sidebarTitle: "OpenRouter"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: openrouter
|
||||
|
|
@ -52,6 +56,10 @@ For example, to prevent extra long prompts from being compressed, you can explic
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: openrouter
|
||||
|
|
@ -97,6 +105,10 @@ If you're experiencing issues with Agent mode or tools not working, you can add
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: openrouter
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ sidebarTitle: "Vertex AI"
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: vertexai
|
||||
|
|
@ -47,6 +51,10 @@ You can use Vertex AI in [express mode](https://cloud.google.com/vertex-ai/gener
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: <MODEL_NAME>
|
||||
provider: vertexai
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ Our current top recommendations are Claude Opus 4.5 and Claude Sonnet 4 from [An
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Claude Opus 4.5
|
||||
provider: anthropic
|
||||
|
|
@ -57,6 +61,10 @@ If you prefer to use an open-weight model, then the Gemma family of Models from
|
|||
<Tabs>
|
||||
<Tab title="Ollama">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: "Gemma 3 27B"
|
||||
provider: "ollama"
|
||||
|
|
@ -65,6 +73,10 @@ If you prefer to use an open-weight model, then the Gemma family of Models from
|
|||
</Tab>
|
||||
<Tab title="Together">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: "Gemma 3 27B"
|
||||
provider: "together"
|
||||
|
|
@ -86,6 +98,10 @@ If you prefer to use a model from [OpenAI](../model-providers/top-level/openai),
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: GPT-5.1
|
||||
provider: openai
|
||||
|
|
@ -105,6 +121,10 @@ If you prefer to use a model from [xAI](../model-providers/more/xAI), then we re
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Grok-4.1
|
||||
provider: xAI
|
||||
|
|
@ -124,6 +144,10 @@ If you prefer to use a model from [Google](../model-providers/top-level/gemini),
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Gemini 3 Pro
|
||||
provider: gemini
|
||||
|
|
@ -157,6 +181,10 @@ If your local machine can run an 8B parameter model, then we recommend running L
|
|||
<Tabs>
|
||||
<Tab title="Ollama">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama 3.1 8B
|
||||
provider: ollama
|
||||
|
|
@ -165,6 +193,10 @@ If your local machine can run an 8B parameter model, then we recommend running L
|
|||
</Tab>
|
||||
<Tab title="LM Studio">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama 3.1 8B
|
||||
provider: lmstudio
|
||||
|
|
@ -173,6 +205,10 @@ If your local machine can run an 8B parameter model, then we recommend running L
|
|||
</Tab>
|
||||
<Tab title="Msty">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Llama 3.1 8B
|
||||
provider: msty
|
||||
|
|
@ -203,6 +239,10 @@ If your local machine can run a 16B parameter model, then we recommend running D
|
|||
<Tabs>
|
||||
<Tab title="Ollama">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: DeepSeek Coder 2 16B
|
||||
provider: ollama
|
||||
|
|
@ -211,6 +251,10 @@ If your local machine can run a 16B parameter model, then we recommend running D
|
|||
</Tab>
|
||||
<Tab title="LM Studio">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: DeepSeek Coder 2 16B
|
||||
provider: lmstudio
|
||||
|
|
@ -219,6 +263,10 @@ If your local machine can run a 16B parameter model, then we recommend running D
|
|||
</Tab>
|
||||
<Tab title="Msty">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: DeepSeek Coder 2 16B
|
||||
provider: msty
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ It's often useful to select a different model to respond to Edit instructions th
|
|||
In Continue, you can add `edit` to a model's roles to specify that it can be used for Edit requests. If no edit models are specified, the selected `chat` model is used.
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Claude 4 Sonnet
|
||||
provider: anthropic
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ After obtaining an API key from [here](https://www.voyageai.com/), you can confi
|
|||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Voyage Code 3
|
||||
provider: voyage
|
||||
|
|
@ -70,6 +74,10 @@ See [here](../model-providers/top-level/ollama#embeddings-model) for instruction
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: default-transformers
|
||||
provider: transformers.js
|
||||
|
|
@ -99,6 +107,10 @@ See [here](../model-providers/top-level/ollama#embeddings-model) for instruction
|
|||
</Tab> */}
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Huggingface TEI Embedder
|
||||
provider: huggingface-tei
|
||||
|
|
|
|||
|
|
@ -24,12 +24,20 @@ Voyage AI offers the best reranking model for code with their `rerank-2` model.
|
|||
<Tabs>
|
||||
<Tab title="Hub">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- uses: voyageai/rerank-2
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: My Voyage Reranker
|
||||
provider: voyage
|
||||
|
|
@ -52,6 +60,10 @@ See Cohere's documentation for rerankers [here](https://docs.cohere.com/docs/rer
|
|||
</Tab> */}
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Cohere Reranker
|
||||
provider: cohere
|
||||
|
|
@ -74,6 +86,10 @@ If you only have access to a single LLM, then you can use it as a reranker. This
|
|||
</Tab> */}
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: LLM Reranker
|
||||
provider: openai
|
||||
|
|
@ -97,6 +113,10 @@ If you only have access to a single LLM, then you can use it as a reranker. This
|
|||
</Tab> */}
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: Huggingface-tei Reranker
|
||||
provider: huggingface-tei
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ Read more about [model roles](/customize/model-roles), [model capabilities](/cus
|
|||
|
||||
# Frontier Models
|
||||
|
||||
[Claude 4 Sonnet](https://hub.continue.dev/anthropic/claude-4-sonnet) from Anthropic
|
||||
[Claude Sonnet 4.5](https://hub.continue.dev/anthropic/claude-sonnet-4-5) from Anthropic
|
||||
|
||||
1. Get your API key from [Anthropic](https://console.anthropic.com/)
|
||||
2. Add [Claude 4 Sonnet](https://hub.continue.dev/anthropic/claude-4-sonnet) to a config on Continue Mission Control
|
||||
2. Add[Claude Sonnet 4.5](https://hub.continue.dev/anthropic/claude-sonnet-4-5) to a config on Continue Mission Control
|
||||
3. Add `ANTHROPIC_API_KEY` as a [User Secret](https://docs.continue.dev/mission-control/secrets/secret-types#user-secrets) on Continue Mission Control [here](https://hub.continue.dev/settings/secrets)
|
||||
4. Click `Reload config` in the config selector in the Continue IDE extension
|
||||
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@
|
|||
"customize/model-providers/top-level/azure",
|
||||
"customize/model-providers/top-level/bedrock",
|
||||
"customize/model-providers/top-level/gemini",
|
||||
"customize/model-providers/top-level/huggingfaceinference",
|
||||
"customize/model-providers/top-level/inception",
|
||||
"customize/model-providers/top-level/lmstudio",
|
||||
"customize/model-providers/top-level/ollama",
|
||||
|
|
@ -200,7 +201,6 @@
|
|||
"customize/model-providers/more/deepseek",
|
||||
"customize/model-providers/more/deepinfra",
|
||||
"customize/model-providers/more/groq",
|
||||
"customize/model-providers/more/huggingfaceinferenceapi",
|
||||
"customize/model-providers/more/llamacpp",
|
||||
"customize/model-providers/more/llamastack",
|
||||
"customize/model-providers/more/mistral",
|
||||
|
|
|
|||
|
|
@ -141,6 +141,10 @@ For all options, first:
|
|||
Install from Hub (recommended) or add YAML manually. Minimal YAML example:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
mcpServers:
|
||||
- name: Atlassian Rovo MCP
|
||||
type: sse
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@ After ensuring you meet the **Prerequisites** above, you have two paths to get s
|
|||
Install from Hub (recommended) or add YAML manually. Minimal YAML example:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
mcpServers:
|
||||
- name: GitHub MCP
|
||||
command: npx
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ description: "Create, run, and automate AI agents across Mission Control, termin
|
|||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npm install -g @continuedev/cli
|
||||
npm i -g @continuedev/cli
|
||||
```
|
||||
|
||||
```bash yarn
|
||||
|
|
|
|||
48
docs/package-lock.json
generated
48
docs/package-lock.json
generated
|
|
@ -7063,40 +7063,40 @@
|
|||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.21.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
|
||||
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
|
||||
"version": "4.22.0",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.22.0.tgz",
|
||||
"integrity": "sha512-c2iPh3xp5vvCLgaHK03+mWLFPhox7j1LwyxcZwFVApEv5i0X+IjPpbT50SJJwwLpdBVfp45AkK/v+AFgv/XlfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "1.20.3",
|
||||
"content-disposition": "0.5.4",
|
||||
"body-parser": "~1.20.3",
|
||||
"content-disposition": "~0.5.4",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "0.7.1",
|
||||
"cookie-signature": "1.0.6",
|
||||
"cookie": "~0.7.1",
|
||||
"cookie-signature": "~1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"finalhandler": "1.3.1",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "2.0.0",
|
||||
"finalhandler": "~1.3.1",
|
||||
"fresh": "~0.5.2",
|
||||
"http-errors": "~2.0.0",
|
||||
"merge-descriptors": "1.0.3",
|
||||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"on-finished": "~2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.12",
|
||||
"path-to-regexp": "~0.1.12",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.13.0",
|
||||
"qs": "~6.14.0",
|
||||
"range-parser": "~1.2.1",
|
||||
"safe-buffer": "5.2.1",
|
||||
"send": "0.19.0",
|
||||
"serve-static": "1.16.2",
|
||||
"send": "~0.19.0",
|
||||
"serve-static": "~1.16.2",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"statuses": "~2.0.1",
|
||||
"type-is": "~1.6.18",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "~1.1.2"
|
||||
|
|
@ -7126,6 +7126,22 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/express/node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@ The top-level properties in the `config.yaml` configuration file are:
|
|||
The `name` property specifies the name of your project or configuration.
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: MyProject
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -149,6 +151,9 @@ The `models` section defines the language models used in your configuration. Mod
|
|||
**Example:**
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
models:
|
||||
- name: GPT-4o
|
||||
provider: openai
|
||||
|
|
@ -198,6 +203,9 @@ More information about usage/params for each context provider can be found [here
|
|||
**Example:**
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
context:
|
||||
- provider: file
|
||||
- provider: code
|
||||
|
|
@ -218,6 +226,9 @@ Rules are concatenated into the system message for all [Agent](/ide-extensions/a
|
|||
Confiugration example:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
rules:
|
||||
- uses: sanity/sanity-opinionated # rules file stored on Continue Mission Control
|
||||
- uses: file://user/Desktop/rules.md # rules file stored on local computer
|
||||
|
|
@ -244,6 +255,9 @@ Prompts can be invoked with a <kbd>/</kbd> command.
|
|||
Configuration example:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
prompts:
|
||||
- uses: supabase/create-functions # prompts file stored on Continue Mission Control
|
||||
- uses: file://user/Desktop/prompts.md # prompts file stored on local computer
|
||||
|
|
@ -278,6 +292,9 @@ List of documentation sites to index.
|
|||
**Example:**
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
docs:
|
||||
- name: Continue
|
||||
startUrl: https://docs.continue.dev/intro
|
||||
|
|
@ -303,6 +320,9 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a
|
|||
**Example:**
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
mcpServers:
|
||||
- name: My MCP Server
|
||||
command: uvx
|
||||
|
|
@ -334,6 +354,9 @@ Destinations to which [development data](/customize/deep-dives/development-data)
|
|||
**Example:**
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
data:
|
||||
- name: Local Data Bank
|
||||
destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
|
||||
|
|
@ -355,8 +378,8 @@ data:
|
|||
Putting it all together, here's a complete example of a `config.yaml` configuration file:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
name: MyProject
|
||||
version: 0.0.1
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
models:
|
||||
- uses: anthropic/claude-3.5-sonnet
|
||||
|
|
@ -430,8 +453,8 @@ You can also use node anchors to avoid duplication of properties. To do so, addi
|
|||
```yaml title="config.yaml"
|
||||
%YAML 1.1
|
||||
---
|
||||
name: MyProject
|
||||
version: 0.0.1
|
||||
name: My Config
|
||||
version: 1.0.0
|
||||
schema: v1
|
||||
model_defaults: &model_defaults
|
||||
provider: openai
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@ There are a few options that let you configure the behavior of the `@codebase` c
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
context:
|
||||
- provider: codebase
|
||||
params:
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ To enable the `@Docs` context provider, add it to the list of context providers
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
context:
|
||||
- provider: docs
|
||||
```
|
||||
|
|
@ -90,6 +94,10 @@ For bulk documentation site adds or edits, we recommend editing your global conf
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
docs:
|
||||
- title: Nest.js
|
||||
startUrl: https://docs.nestjs.com/
|
||||
|
|
@ -128,6 +136,10 @@ As with [@Codebase context provider configuration](./deprecated-codebase#configu
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
context:
|
||||
- provider: docs
|
||||
params:
|
||||
|
|
@ -161,6 +173,10 @@ The GitHub API rate limits public requests to 60 per hour. If you want to reliab
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
context:
|
||||
- provider: docs
|
||||
params:
|
||||
|
|
@ -192,6 +208,10 @@ If your documentation is private, you can skip the default crawler and use a loc
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
docs:
|
||||
- title: My Private Docs
|
||||
startUrl: http://10.2.1.2/docs
|
||||
|
|
@ -255,6 +275,10 @@ The following configuration example works out of the box for VS Code. This uses
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
context:
|
||||
- provider: docs
|
||||
|
||||
|
|
@ -289,6 +313,10 @@ Here is the equivalent minimal example for Jetbrains, which requires setting up
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: LMStudio embedder
|
||||
provider: lmstudio
|
||||
|
|
@ -337,6 +365,10 @@ The following configuration example includes:
|
|||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
name: My Config
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
|
||||
models:
|
||||
- name: LMStudio Nomic Text
|
||||
provider: lmstudio
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ Specifies options for tab autocompletion behavior.
|
|||
- `debounceDelay`: Delay (in ms) before triggering autocomplete (default: `350`).
|
||||
- `maxSuffixPercentage`: Maximum percentage of prompt for suffix (default: `0.2`).
|
||||
- `prefixPercentage`: Percentage of input for prefix (default: `0.3`).
|
||||
- `template`: Template string for autocomplete, using Mustache templating. You can use the `{{{ prefix }}}`, `{{{ suffix }}}`, `{{{ filename }}}`, `{{{ reponame }}}`, and `{{{ language }}}` variables.
|
||||
- `template`: Template string for autocomplete, using Mustache templating. You can use the `{{{prefix}}}`, `{{{suffix}}}`, `{{{filename}}}`, `{{{reponame}}}`, and `{{{language}}}` variables.
|
||||
- `onlyMyCode`: If `true`, only includes code within the repository (default: `true`).
|
||||
|
||||
Example
|
||||
|
|
|
|||
|
|
@ -36,15 +36,15 @@ Alternatively in VS Code, you can disable telemetry through your VS Code setting
|
|||
|
||||
### CLI
|
||||
|
||||
For `cn`, the Continue CLI, set the environment variable `CONTINUE_ALLOW_ANONYMOUS_TELEMETRY=0` before running commands:
|
||||
For `cn`, the Continue CLI, set the environment variable `CONTINUE_TELEMETRY_ENABLED=0` before running commands:
|
||||
|
||||
```bash
|
||||
export CONTINUE_ALLOW_ANONYMOUS_TELEMETRY=0
|
||||
export CONTINUE_TELEMETRY_ENABLED=0
|
||||
cn <your prompt>
|
||||
```
|
||||
|
||||
Or run it inline:
|
||||
|
||||
```bash
|
||||
CONTINUE_ALLOW_ANONYMOUS_TELEMETRY=0 cn <your prompt>
|
||||
```
|
||||
CONTINUE_TELEMETRY_ENABLED=0 cn <your prompt>
|
||||
```
|
||||
335
extensions/cli/docs/artifact-uploads.md
Normal file
335
extensions/cli/docs/artifact-uploads.md
Normal file
|
|
@ -0,0 +1,335 @@
|
|||
# Artifact Upload Architecture
|
||||
|
||||
## Overview
|
||||
|
||||
The artifact upload feature enables Continue agents running in devboxes to upload arbitrary files (screenshots, videos, logs) to agent session storage for review and debugging purposes. The architecture uses a two-step presigned URL pattern for secure, performant uploads.
|
||||
|
||||
## Architecture Pattern: Presigned URLs
|
||||
|
||||
### Why Presigned URLs?
|
||||
|
||||
The artifact upload system uses **presigned URLs** for direct client-to-S3 uploads rather than proxying files through the backend. This design provides several benefits:
|
||||
|
||||
1. **Security**: The backend controls who can upload, validates file types/sizes, and enforces storage limits before issuing a presigned URL. The agent cannot bypass these validations.
|
||||
|
||||
2. **Performance**: Files upload directly from the devbox to S3, avoiding bandwidth costs and latency of routing through the backend API server.
|
||||
|
||||
3. **Scalability**: The backend doesn't become a bottleneck for file uploads. S3 handles the heavy lifting of data transfer.
|
||||
|
||||
4. **Simplicity**: Presigned URLs are time-limited (15 minutes), self-contained credentials that require no complex token management.
|
||||
|
||||
## Two-Step Upload Flow
|
||||
|
||||
### Step 1: Request Presigned URL
|
||||
|
||||
The agent requests a presigned upload URL from the backend:
|
||||
|
||||
**Request:**
|
||||
|
||||
```http
|
||||
POST /agents/artifacts/upload-url
|
||||
Authorization: Bearer <CONTINUE_API_KEY>
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"agentSessionId": "<session-id>",
|
||||
"filename": "screenshot.png",
|
||||
"contentType": "image/png",
|
||||
"fileSize": 1048576
|
||||
}
|
||||
```
|
||||
|
||||
**Backend Validation:**
|
||||
|
||||
- Authenticates the API key and verifies session ownership
|
||||
- Validates filename (no path traversal, allowed extension)
|
||||
- Validates file size against per-file limit (50MB default)
|
||||
- Validates content type against allowlist
|
||||
- Checks total session storage against limit (500MB default)
|
||||
|
||||
**Response (if validation passes):**
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://s3.amazonaws.com/bucket/sessions/org/abc123/artifacts/screenshot.png?X-Amz-...",
|
||||
"key": "sessions/org/abc123/artifacts/screenshot.png",
|
||||
"expiresIn": 900
|
||||
}
|
||||
```
|
||||
|
||||
**Response (if validation fails):**
|
||||
|
||||
```http
|
||||
400 Bad Request
|
||||
|
||||
{
|
||||
"error": "File size exceeds maximum allowed (50MB)"
|
||||
}
|
||||
```
|
||||
|
||||
### Step 2: Upload to S3
|
||||
|
||||
The agent uploads the file directly to S3 using the presigned URL:
|
||||
|
||||
**Request:**
|
||||
|
||||
```http
|
||||
PUT <presigned-url>
|
||||
Content-Type: image/png
|
||||
<file-contents>
|
||||
```
|
||||
|
||||
S3 validates the presigned URL signature and accepts the upload. The backend is not involved in this step.
|
||||
|
||||
## Storage Organization
|
||||
|
||||
Artifacts are stored in S3 with the following path structure:
|
||||
|
||||
```
|
||||
sessions/
|
||||
user/
|
||||
<userId>/
|
||||
<sessionId>/
|
||||
artifacts/
|
||||
screenshot.png
|
||||
video.mp4
|
||||
debug.log
|
||||
session.json # Session state (existing)
|
||||
diff.txt # Git diff (existing)
|
||||
org/
|
||||
<organizationId>/
|
||||
<sessionId>/
|
||||
artifacts/
|
||||
...
|
||||
```
|
||||
|
||||
This structure:
|
||||
|
||||
- Maintains backward compatibility with existing `session.json` and `diff.txt` files
|
||||
- Isolates user/org data for security
|
||||
- Groups all session-related files together
|
||||
- Allows simple recursive deletion when a session is removed
|
||||
|
||||
## File Type and Size Limits
|
||||
|
||||
### Allowed File Types
|
||||
|
||||
The system validates both file extensions and MIME types:
|
||||
|
||||
**Images:** `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`
|
||||
**Videos:** `.mp4`, `.mov`, `.avi`, `.webm`
|
||||
**Text/Logs:** `.log`, `.txt`, `.json`, `.xml`, `.csv`, `.html`
|
||||
|
||||
Content types are validated against an allowlist to prevent uploading executable files or other potentially dangerous content.
|
||||
|
||||
### Size Limits
|
||||
|
||||
Two limits are enforced:
|
||||
|
||||
1. **Per-File Limit:** 50MB (configurable via `ARTIFACT_MAX_FILE_SIZE_MB`)
|
||||
2. **Total Session Storage:** 500MB (configurable via `ARTIFACT_MAX_TOTAL_SIZE_MB`)
|
||||
|
||||
The backend calculates total storage by summing all files under the session's S3 prefix before issuing presigned URLs. This prevents a single session from consuming excessive storage.
|
||||
|
||||
## CLI Usage
|
||||
|
||||
### Using the UploadArtifact Tool (Recommended)
|
||||
|
||||
The `UploadArtifact` tool is available when running with the beta flag:
|
||||
|
||||
```bash
|
||||
cn serve --id <agentSessionId> --beta-upload-artifact-tool
|
||||
```
|
||||
|
||||
Agents can then use the built-in `UploadArtifact` tool to upload files:
|
||||
|
||||
```typescript
|
||||
// The agent calls this tool with the file path
|
||||
{
|
||||
"name": "UploadArtifact",
|
||||
"parameters": {
|
||||
"filePath": "/tmp/screenshot.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The tool will:
|
||||
|
||||
- Validate the file exists and is an allowed type
|
||||
- Check file size limits (50MB max per file)
|
||||
- Upload to session storage
|
||||
- Return success message or detailed error
|
||||
|
||||
**Tool Description:** "Upload a file (screenshot, video, log) to the session artifacts for user review. Supported formats: images (png, jpg, jpeg, gif, webp), videos (mp4, mov, avi, webm), and text files (log, txt, json, xml, csv, html). Maximum file size: 50MB. **If an artifact with the same filename already exists, it will be overwritten with the new file.**"
|
||||
|
||||
**Requirements:**
|
||||
|
||||
- Must run with `--id <agentSessionId>` (agent mode)
|
||||
- Must enable `--beta-upload-artifact-tool` flag
|
||||
- User must be authenticated (`cn login`)
|
||||
|
||||
### Programmatic Upload (Service API)
|
||||
|
||||
For custom implementations, use the service directly:
|
||||
|
||||
```typescript
|
||||
import { services } from "./services/index.js";
|
||||
|
||||
const result = await services.artifactUpload.uploadArtifact({
|
||||
agentSessionId: process.env.AGENT_SESSION_ID,
|
||||
filePath: "/tmp/screenshot.png",
|
||||
accessToken: process.env.CONTINUE_API_KEY,
|
||||
});
|
||||
|
||||
if (result.success) {
|
||||
console.log(`Uploaded: ${result.filename}`);
|
||||
} else {
|
||||
console.error(`Failed: ${result.error}`);
|
||||
}
|
||||
```
|
||||
|
||||
### Multiple Files
|
||||
|
||||
```typescript
|
||||
const results = await services.artifactUpload.uploadArtifacts(
|
||||
process.env.AGENT_SESSION_ID,
|
||||
["/tmp/screenshot1.png", "/tmp/screenshot2.png", "/tmp/debug.log"],
|
||||
process.env.CONTINUE_API_KEY,
|
||||
);
|
||||
|
||||
results.forEach((result) => {
|
||||
console.log(`${result.filename}: ${result.success ? "✓" : "✗"}`);
|
||||
});
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
The CLI requires these environment variables for artifact uploads:
|
||||
|
||||
- `CONTINUE_API_KEY`: Bearer token for backend authentication
|
||||
- `CONTINUE_API_BASE`: API base URL (defaults to `https://api.continue.dev/`)
|
||||
- `AGENT_SESSION_ID`: The current agent session identifier
|
||||
|
||||
These are automatically provided when running in Continue's devbox environment.
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Validation Errors (400)
|
||||
|
||||
- Invalid filename (path traversal, disallowed extension)
|
||||
- File too large (exceeds per-file limit)
|
||||
- Storage limit exceeded (session total > 500MB)
|
||||
- Invalid content type
|
||||
|
||||
### Authentication Errors (401/403)
|
||||
|
||||
- Missing or invalid API key
|
||||
- User doesn't own the agent session
|
||||
|
||||
### Upload Errors (S3)
|
||||
|
||||
- Network failure during upload
|
||||
- Presigned URL expired (15-minute timeout)
|
||||
- S3 service error
|
||||
|
||||
All errors are logged and returned with descriptive messages. Failed uploads don't crash the agent - they return an error result that the agent can handle gracefully.
|
||||
|
||||
## Frontend Access
|
||||
|
||||
The frontend can list and download artifacts using:
|
||||
|
||||
**List artifacts:**
|
||||
|
||||
```http
|
||||
GET /agents/{agentSessionId}/artifacts
|
||||
Authorization: Bearer <API_KEY>
|
||||
|
||||
Response:
|
||||
{
|
||||
"artifacts": [
|
||||
{
|
||||
"filename": "screenshot.png",
|
||||
"size": 1048576,
|
||||
"sizeFormatted": "1.0 MB",
|
||||
"lastModified": "2025-12-08T10:30:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Download artifact:**
|
||||
|
||||
```http
|
||||
GET /agents/{agentSessionId}/artifacts/{filename}/download
|
||||
Authorization: Bearer <API_KEY>
|
||||
|
||||
Response:
|
||||
{
|
||||
"url": "https://s3.amazonaws.com/...",
|
||||
"expiresIn": 3600
|
||||
}
|
||||
```
|
||||
|
||||
The frontend then uses the presigned download URL to fetch the artifact directly from S3.
|
||||
|
||||
## Security Considerations
|
||||
|
||||
1. **Authentication**: All endpoints require valid API keys tied to user/org accounts
|
||||
2. **Authorization**: Session ownership is verified before issuing presigned URLs
|
||||
3. **Path Traversal Prevention**: Filenames are validated to prevent `../` attacks
|
||||
4. **Content Validation**: File types are restricted via extension and MIME type checks
|
||||
5. **Rate Limiting**: Storage limits prevent abuse (per-file and total session limits)
|
||||
6. **Time-Limited URLs**: Presigned URLs expire after 15 minutes for uploads, 1 hour for downloads
|
||||
7. **Storage Isolation**: Files are scoped to user/org prefixes, preventing cross-tenant access
|
||||
|
||||
## Design Trade-offs
|
||||
|
||||
### Chosen: No Database Tracking
|
||||
|
||||
**Decision:** Store artifacts as files in S3 without tracking individual files in the database.
|
||||
|
||||
**Rationale:**
|
||||
|
||||
- Simpler implementation (no new database tables)
|
||||
- Files are the source of truth (no sync issues between DB and S3)
|
||||
- Fast listing via S3 API (ListObjects)
|
||||
- Automatic cleanup when deleting session folder
|
||||
|
||||
**Trade-off:** Cannot query artifacts across sessions or track metadata without scanning S3.
|
||||
|
||||
### Chosen: Overwrite on Name Collision
|
||||
|
||||
**Decision:** If the same filename is uploaded twice, the last upload wins.
|
||||
|
||||
**Rationale:**
|
||||
|
||||
- Simpler than versioning or auto-renaming
|
||||
- Common use case: agent re-uploading updated screenshot
|
||||
- Reduces storage consumption
|
||||
|
||||
**Trade-off:** No version history for artifacts.
|
||||
|
||||
### Chosen: Direct S3 Upload (Presigned URLs)
|
||||
|
||||
**Decision:** Use presigned URLs instead of proxying files through backend.
|
||||
|
||||
**Rationale:**
|
||||
|
||||
- Better performance (no backend bottleneck)
|
||||
- Lower cost (no backend bandwidth charges)
|
||||
- Proven pattern (already used in StorageSyncService)
|
||||
|
||||
**Trade-off:** Backend cannot inspect file contents before upload (relies on validation at URL generation).
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
- **Compression**: Automatically compress screenshots/videos before upload
|
||||
- **Retention Policies**: Auto-delete artifacts after N days
|
||||
- **Artifact Types**: Support more file types (PDFs, archives)
|
||||
- **Preview Generation**: Generate thumbnails for images/videos
|
||||
- **Streaming**: Support large file uploads with multipart upload
|
||||
- **Metadata**: Attach custom metadata to artifacts (tags, descriptions)
|
||||
|
||||
---
|
||||
|
||||
This document describes the initial artifact upload implementation. Update it when the architecture evolves.
|
||||
291
extensions/cli/package-lock.json
generated
291
extensions/cli/package-lock.json
generated
|
|
@ -23,7 +23,7 @@
|
|||
"@continuedev/openai-adapters": "file:../../packages/openai-adapters",
|
||||
"@continuedev/sdk": "^0.0.13",
|
||||
"@continuedev/terminal-security": "file:../../packages/terminal-security",
|
||||
"@modelcontextprotocol/sdk": "^1.17.2",
|
||||
"@modelcontextprotocol/sdk": "^1.24.0",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.203.0",
|
||||
"@opentelemetry/exporter-metrics-otlp-http": "^0.203.0",
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@continuedev/terminal-security": "file:../packages/terminal-security",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@modelcontextprotocol/sdk": "^1.24.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"@sentry/cli": "^2.50.2",
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
"tree-sitter-wasms": "^0.1.11",
|
||||
"untildify": "^6.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vectordb": "^0.4.20",
|
||||
"vectordb": "0.4.20",
|
||||
"web-tree-sitter": "^0.21.0",
|
||||
"win-ca": "^3.5.1",
|
||||
"wink-nlp-utils": "^2.1.0",
|
||||
|
|
@ -268,16 +268,17 @@
|
|||
},
|
||||
"../../packages/openai-adapters": {
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.15.0",
|
||||
"version": "1.32.0",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.67.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.913.0",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.929.0",
|
||||
"@aws-sdk/credential-providers": "^3.929.0",
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-yaml": "^1.33.0",
|
||||
"@continuedev/fetch": "^1.5.0",
|
||||
"@continuedev/config-yaml": "^1.36.0",
|
||||
"@continuedev/fetch": "^1.6.0",
|
||||
"@google/genai": "^1.30.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.4.1",
|
||||
"json-schema": "^0.4.0",
|
||||
|
|
@ -1634,13 +1635,14 @@
|
|||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk": {
|
||||
"version": "1.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.4.tgz",
|
||||
"integrity": "sha512-zq24hfuAmmlNZvik0FLI58uE5sriN0WWsQzIlYnzSuKDAHFqJtBFrl/LfB1NLgJT5Y7dEBzaX4yAKqOPrcetaw==",
|
||||
"version": "1.24.1",
|
||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.24.1.tgz",
|
||||
"integrity": "sha512-YTg4v6bKSst8EJM8NXHC3nGm8kgHD08IbIBbognUeLAgGLVgLpYrgQswzLQd4OyTL4l614ejhqsDrV1//t02Qw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.6",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"content-type": "^1.0.5",
|
||||
"cors": "^2.8.5",
|
||||
"cross-spawn": "^7.0.5",
|
||||
|
|
@ -1648,15 +1650,62 @@
|
|||
"eventsource-parser": "^3.0.0",
|
||||
"express": "^5.0.1",
|
||||
"express-rate-limit": "^7.5.0",
|
||||
"jose": "^6.1.1",
|
||||
"pkce-challenge": "^5.0.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"zod": "^3.23.8",
|
||||
"zod-to-json-schema": "^3.24.1"
|
||||
"zod": "^3.25 || ^4.0",
|
||||
"zod-to-json-schema": "^3.25.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cfworker/json-schema": "^4.1.1",
|
||||
"zod": "^3.25 || ^4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@cfworker/json-schema": {
|
||||
"optional": true
|
||||
},
|
||||
"zod": {
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk/node_modules/ajv": {
|
||||
"version": "8.17.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
||||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"fast-uri": "^3.0.1",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"require-from-string": "^2.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk/node_modules/jose": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz",
|
||||
"integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/panva"
|
||||
}
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@mswjs/interceptors": {
|
||||
"version": "0.39.6",
|
||||
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.39.6.tgz",
|
||||
|
|
@ -6330,6 +6379,48 @@
|
|||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
|
||||
"integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ajv": "^8.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"ajv": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats/node_modules/ajv": {
|
||||
"version": "8.17.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
||||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"fast-uri": "^3.0.1",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"require-from-string": "^2.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats/node_modules/json-schema-traverse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ansi-escapes": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz",
|
||||
|
|
@ -6656,24 +6747,45 @@
|
|||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz",
|
||||
"integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz",
|
||||
"integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^1.0.5",
|
||||
"debug": "^4.4.0",
|
||||
"debug": "^4.4.3",
|
||||
"http-errors": "^2.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.14.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"type-is": "^2.0.0"
|
||||
"raw-body": "^3.0.1",
|
||||
"type-is": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/iconv-lite": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/bottleneck": {
|
||||
|
|
@ -8021,9 +8133,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
|
||||
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
|
||||
"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"
|
||||
|
|
@ -9410,19 +9522,20 @@
|
|||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",
|
||||
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
|
||||
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.0",
|
||||
"body-parser": "^2.2.1",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
|
|
@ -9543,6 +9656,23 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
|
||||
"integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fastify"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fastify"
|
||||
}
|
||||
],
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/fastq": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
|
||||
|
|
@ -10487,30 +10617,24 @@
|
|||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"toidentifier": "1.0.1"
|
||||
"depd": "~2.0.0",
|
||||
"inherits": "~2.0.4",
|
||||
"setprototypeof": "~1.2.0",
|
||||
"statuses": "~2.0.2",
|
||||
"toidentifier": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors/node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
|
||||
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-agent": {
|
||||
|
|
@ -16353,19 +16477,36 @@
|
|||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz",
|
||||
"integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==",
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
|
||||
"integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.6.3",
|
||||
"unpipe": "1.0.0"
|
||||
"bytes": "~3.1.2",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.7.0",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body/node_modules/iconv-lite": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/rc": {
|
||||
|
|
@ -16395,9 +16536,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react": {
|
||||
"version": "19.1.1",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz",
|
||||
"integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==",
|
||||
"version": "19.2.1",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz",
|
||||
"integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
|
@ -16405,19 +16546,27 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react-dom": {
|
||||
"version": "19.1.1",
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz",
|
||||
"integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==",
|
||||
"version": "19.2.1",
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.1.tgz",
|
||||
"integrity": "sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"scheduler": "^0.26.0"
|
||||
"scheduler": "^0.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^19.1.1"
|
||||
"react": "^19.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-dom/node_modules/scheduler": {
|
||||
"version": "0.27.0",
|
||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
|
||||
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/react-is": {
|
||||
"version": "17.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
||||
|
|
@ -16583,6 +16732,16 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-from-string": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-in-the-middle": {
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz",
|
||||
|
|
@ -19660,13 +19819,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/zod-to-json-schema": {
|
||||
"version": "3.24.6",
|
||||
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.6.tgz",
|
||||
"integrity": "sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg==",
|
||||
"version": "3.25.0",
|
||||
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.0.tgz",
|
||||
"integrity": "sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"peerDependencies": {
|
||||
"zod": "^3.24.1"
|
||||
"zod": "^3.25 || ^4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
"@continuedev/openai-adapters": "file:../../packages/openai-adapters",
|
||||
"@continuedev/sdk": "^0.0.13",
|
||||
"@continuedev/terminal-security": "file:../../packages/terminal-security",
|
||||
"@modelcontextprotocol/sdk": "^1.17.2",
|
||||
"@modelcontextprotocol/sdk": "^1.24.0",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.203.0",
|
||||
"@opentelemetry/exporter-metrics-otlp-http": "^0.203.0",
|
||||
|
|
|
|||
|
|
@ -17,17 +17,18 @@ The Continue CLI should emit metrics that provide insights into:
|
|||
|
||||
### Environment Variables
|
||||
|
||||
| Environment Variable | Description | Example Values |
|
||||
| ------------------------------- | --------------------------------------------------------- | ------------------------------------ |
|
||||
| `CONTINUE_CLI_ENABLE_TELEMETRY` | Enables OTEL telemetry collection (required) | `1` |
|
||||
| `OTEL_METRICS_EXPORTER` | Metrics exporter type(s) (comma-separated) | `console`, `otlp`, `prometheus` |
|
||||
| `OTEL_LOGS_EXPORTER` | Logs/events exporter type(s) (comma-separated) | `console`, `otlp` |
|
||||
| `OTEL_EXPORTER_OTLP_PROTOCOL` | Protocol for OTLP exporter (all signals) | `grpc`, `http/json`, `http/protobuf` |
|
||||
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint (all signals) | `http://localhost:4317` |
|
||||
| `OTEL_EXPORTER_OTLP_HEADERS` | Authentication headers for OTLP | `Authorization=Bearer token` |
|
||||
| `OTEL_METRIC_EXPORT_INTERVAL` | Export interval in milliseconds (default: 60000) | `5000`, `60000` |
|
||||
| `OTEL_LOGS_EXPORT_INTERVAL` | Logs export interval in milliseconds (default: 5000) | `1000`, `10000` |
|
||||
| `OTEL_LOG_USER_PROMPTS` | Enable logging of user prompt content (default: disabled) | `1` to enable |
|
||||
| Environment Variable | Description | Example Values |
|
||||
| ------------------------------- | --------------------------------------------------------------- | ------------------------------------ |
|
||||
| `CONTINUE_METRICS_ENABLED` | Enables OTEL telemetry collection (preferred, takes precedence) | `0` to disable, `1` to enable |
|
||||
| `CONTINUE_CLI_ENABLE_TELEMETRY` | Enables OTEL telemetry collection (legacy, lower precedence) | `0` to disable, `1` to enable |
|
||||
| `OTEL_METRICS_EXPORTER` | Metrics exporter type(s) (comma-separated) | `console`, `otlp`, `prometheus` |
|
||||
| `OTEL_LOGS_EXPORTER` | Logs/events exporter type(s) (comma-separated) | `console`, `otlp` |
|
||||
| `OTEL_EXPORTER_OTLP_PROTOCOL` | Protocol for OTLP exporter (all signals) | `grpc`, `http/json`, `http/protobuf` |
|
||||
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint (all signals) | `http://localhost:4317` |
|
||||
| `OTEL_EXPORTER_OTLP_HEADERS` | Authentication headers for OTLP | `Authorization=Bearer token` |
|
||||
| `OTEL_METRIC_EXPORT_INTERVAL` | Export interval in milliseconds (default: 60000) | `5000`, `60000` |
|
||||
| `OTEL_LOGS_EXPORT_INTERVAL` | Logs export interval in milliseconds (default: 5000) | `1000`, `10000` |
|
||||
| `OTEL_LOG_USER_PROMPTS` | Enable logging of user prompt content (default: disabled) | `1` to enable |
|
||||
|
||||
### Metrics Cardinality Control
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ Interaction with other input helpers
|
|||
- "/" slash command UI is disabled.
|
||||
- When in slash command mode (input starts with /):
|
||||
- "@" file search suggestions are disabled.
|
||||
- Enter submits the highlighted slash command directly (except /title, which requires Tab to select first).
|
||||
- Tab selects the highlighted command without submitting.
|
||||
|
||||
Submission behavior
|
||||
|
||||
|
|
@ -44,8 +46,8 @@ Output handling
|
|||
- Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success.
|
||||
- If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown.
|
||||
- Output is truncated to the first 5000 lines if exceeded.
|
||||
- Timeout behavior: If no output is received for 30 seconds (configurable in tests), the process is terminated and the result includes a note like:
|
||||
"[Command timed out after 30 seconds of no output]".
|
||||
- Timeout behavior: If no output is received for 120 seconds (configurable in tests), the process is terminated and the result includes a note like:
|
||||
"[Command timed out after 120 seconds of no output]".
|
||||
|
||||
Keyboard behaviors (summary)
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue