Merge branch 'main' of https://github.com/continuedev/continue into dallin/auto-apply-fix

This commit is contained in:
Dallin Romney 2025-06-25 15:46:20 -07:00
commit ec0c5a40d9
44 changed files with 9238 additions and 416 deletions

View file

@ -130,6 +130,7 @@ jobs:
# Tests are currently failing, commenting out for now
# npm test
npm run build
install-core:
needs: install-root
runs-on: ubuntu-latest
@ -289,6 +290,12 @@ jobs:
path: gui/node_modules
key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
- uses: actions/cache@v4
id: openai-adapters-cache
with:
path: packages/openai-adapters/node_modules
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
- uses: actions/cache@v4
id: config-yaml-cache
with:
@ -300,6 +307,11 @@ jobs:
cd packages/config-yaml
npm run build
- name: Build openai-adapters
run: |
cd packages/openai-adapters
npm run build
- name: Type check and lint
run: |
cd gui
@ -399,11 +411,22 @@ jobs:
path: packages/config-yaml/node_modules
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
- uses: actions/cache@v4
id: openai-adapters-cache
with:
path: packages/openai-adapters/node_modules
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
- name: Build config-yaml
run: |
cd packages/config-yaml
npm run build
- name: Build openai-adapters
run: |
cd packages/openai-adapters
npm run build
- name: Install vscode dependencies
if: steps.vscode-cache.outputs.cache-hit != 'true'
run: |
@ -444,11 +467,22 @@ jobs:
path: packages/config-yaml/node_modules
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
- uses: actions/cache@v4
id: openai-adapters-cache
with:
path: packages/openai-adapters/node_modules
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
- name: Build config-yaml
run: |
cd packages/config-yaml
npm run build
- name: Build openai-adapters
run: |
cd packages/openai-adapters
npm run build
- name: Type check and lint
run: |
cd extensions/vscode

View file

@ -9,38 +9,10 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: |
cd packages/config-yaml
npm ci
- name: Build
run: |
cd packages/config-yaml
npm run build
- name: Run tests
run: |
cd packages/config-yaml
npm test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/config-yaml
npx semantic-release
uses: ./.github/workflows/reusable-release.yml
with:
package-name: "config-yaml"
package-path: "packages/config-yaml"
secrets:
SEMANTIC_RELEASE_GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
SEMANTIC_RELEASE_NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}

18
.github/workflows/release-fetch.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Release @continuedev/fetch
on:
push:
branches:
- main
paths:
- "packages/fetch/**"
jobs:
release:
uses: ./.github/workflows/reusable-release.yml
with:
package-name: "fetch"
package-path: "packages/fetch"
secrets:
SEMANTIC_RELEASE_GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
SEMANTIC_RELEASE_NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}

18
.github/workflows/release-llm-info.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Release @continuedev/llm-info
on:
push:
branches:
- main
paths:
- "packages/llm-info/**"
jobs:
release:
uses: ./.github/workflows/reusable-release.yml
with:
package-name: "llm-info"
package-path: "packages/llm-info"
secrets:
SEMANTIC_RELEASE_GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
SEMANTIC_RELEASE_NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}

View file

@ -0,0 +1,18 @@
name: Release @continuedev/openai-adapters
on:
push:
branches:
- main
paths:
- "packages/openai-adapters/**"
jobs:
release:
uses: ./.github/workflows/reusable-release.yml
with:
package-name: "openai-adapters"
package-path: "packages/openai-adapters"
secrets:
SEMANTIC_RELEASE_GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
SEMANTIC_RELEASE_NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}

55
.github/workflows/reusable-release.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: Reusable Release Workflow
on:
workflow_call:
inputs:
package-name:
required: true
type: string
package-path:
required: true
type: string
secrets:
SEMANTIC_RELEASE_GITHUB_TOKEN:
required: true
SEMANTIC_RELEASE_NPM_TOKEN:
required: true
permissions:
contents: write
issues: write
pull-requests: write
jobs:
release:
name: Release ${{ inputs.package-name }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.package-path }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
run: npx semantic-release

View file

@ -39,7 +39,7 @@ import { GlobalContext } from "../../util/GlobalContext";
import { modifyAnyConfigWithSharedConfig } from "../sharedConfig";
import { getControlPlaneEnvSync } from "../../control-plane/env";
import { baseToolDefinitions } from "../../tools";
import { getToolsForIde } from "../../tools";
import { getCleanUriPath } from "../../util/uri";
import { getAllDotContinueDefinitionFiles } from "../loadLocalAssistants";
import { LocalPlatformClient } from "./LocalPlatformClient";
@ -187,7 +187,7 @@ async function configYamlToContinueConfig(options: {
const continueConfig: ContinueConfig = {
slashCommands: [],
tools: [...baseToolDefinitions],
tools: await getToolsForIde(ide),
mcpServerStatuses: [],
contextProviders: [],
modelsByRole: {

2
core/index.d.ts vendored
View file

@ -731,6 +731,8 @@ export interface IDE {
isTelemetryEnabled(): Promise<boolean>;
isWorkspaceRemote(): Promise<boolean>;
getUniqueId(): Promise<string>;
getTerminalContents(): Promise<string>;

View file

@ -124,14 +124,6 @@ describe("CodebaseIndexer", () => {
return updates;
}
async function refreshIndexFiles(files: string[]) {
const updates = [];
for await (const update of codebaseIndexer.refreshFiles(files)) {
updates.push(update);
}
return updates;
}
async function getAllIndexedFiles() {
const files = await testIndex.getIndexedFilesForTags(
await testIde.getTags(testIndex.artifactId),
@ -197,7 +189,7 @@ describe("CodebaseIndexer", () => {
test("should successfuly re-index specific files", async () => {
// Could add more specific tests for this but uses similar logic
const before = await getAllIndexedFiles();
await refreshIndexFiles(before);
await codebaseIndexer.refreshCodebaseIndexFiles(before);
const after = await getAllIndexedFiles();
expect(after.length).toBe(before.length);

View file

@ -43,7 +43,7 @@ export class CodebaseIndexer {
* - To limit memory usage for indexes that perform computations locally, e.g. FTS
* - To make as few requests as possible to the embeddings providers
*/
filesPerBatch = 500;
filesPerBatch = 200;
private indexingCancellationController: AbortController | undefined;
private codebaseIndexingState: IndexingProgressUpdate;
private readonly pauseToken: PauseToken;
@ -75,16 +75,10 @@ export class CodebaseIndexer {
this.pauseToken = new PauseToken(initialPaused);
}
/**
* Set the paused state of the indexer
*/
set paused(value: boolean) {
this.pauseToken.paused = value;
}
/**
* Get the current paused state of the indexer
*/
get paused(): boolean {
return this.pauseToken.paused;
}
@ -235,7 +229,9 @@ export class CodebaseIndexer {
}
}
async *refreshFiles(files: string[]): AsyncGenerator<IndexingProgressUpdate> {
private async *refreshFiles(
files: string[],
): AsyncGenerator<IndexingProgressUpdate> {
let progress = 0;
if (files.length === 0) {
yield {
@ -525,7 +521,7 @@ export class CodebaseIndexer {
repoName,
)) {
yield {
progress: progress,
progress,
desc,
status: "indexing",
};

View file

@ -292,6 +292,7 @@ export abstract class BaseLLM implements ILLM {
apiKey: this.apiKey ?? "",
apiBase: this.apiBase,
requestOptions: this.requestOptions,
env: this._llmOptions.env,
});
}

View file

@ -546,7 +546,7 @@ class Bedrock extends BaseLLM {
}
// EMBED //
async embed(chunks: string[]): Promise<number[][]> {
async _embed(chunks: string[]): Promise<number[][]> {
const credentials = await this._getCredentials();
const client = new BedrockRuntimeClient({
region: this.region,

View file

@ -25,16 +25,7 @@ class HuggingFaceTEIEmbeddingsProvider extends BaseLLM {
});
}
async embed(chunks: string[]) {
const batchedChunks = this.getBatchedChunks(chunks);
const results = await Promise.all(
batchedChunks.map((batch) => this.doEmbedRequest(batch)),
);
return results.flat();
}
async doEmbedRequest(batch: string[]): Promise<number[][]> {
async _embed(batch: string[]): Promise<number[][]> {
const headers: Record<string, string> = {
"Content-Type": "application/json",
};

View file

@ -405,7 +405,6 @@ class Ollama extends BaseLLM implements ModelInstaller {
parameters: tool.function.parameters,
},
}));
chatOptions.stream = false; // Cannot set stream = true for tools calls
}
const headers: Record<string, string> = {
"Content-Type": "application/json",

View file

@ -141,7 +141,7 @@ class SageMaker extends BaseLLM {
}
}
async embed(chunks: string[]) {
async _embed(chunks: string[]) {
const credentials = await this._getCredentials();
const client = new SageMakerRuntimeClient({
region: this.region,

54
core/package-lock.json generated
View file

@ -16,7 +16,7 @@
"@continuedev/config-yaml": "file:../packages/config-yaml",
"@continuedev/fetch": "^1.0.14",
"@continuedev/llm-info": "^1.0.8",
"@continuedev/openai-adapters": "^1.0.32",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@modelcontextprotocol/sdk": "^1.12.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",
@ -159,6 +159,30 @@
"zod-to-json-schema": "^3.24.5"
}
},
"../packages/openai-adapters": {
"name": "@continuedev/openai-adapters",
"version": "1.0.40",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.51",
"@continuedev/fetch": "^1.0.11",
"dotenv": "^16.5.0",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^4.76.0",
"uuid": "^11.1.0",
"zod": "^3.24.2"
},
"devDependencies": {
"@types/follow-redirects": "^1.14.4",
"@types/jest": "^29.5.14",
"@types/json-schema": "^7.0.15",
"cross-env": "^7.0.3",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2"
}
},
"node_modules/@75lb/deep-merge": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz",
@ -2901,32 +2925,8 @@
"integrity": "sha512-/htL7p4li3zQSwn9bXkI23WRpZNklWTPzRSSG3Fd5gvYW8cizjhlf7OzeDdKxBfi1S0lpqMm0VwHlx3KjMKLpw=="
},
"node_modules/@continuedev/openai-adapters": {
"version": "1.0.32",
"resolved": "https://registry.npmjs.org/@continuedev/openai-adapters/-/openai-adapters-1.0.32.tgz",
"integrity": "sha512-teNzbpcsa7Y0eBk+dxlLDo0m43sWI5txTYMIk6ezyS0cZAKFJODDB0Gkp3aEHXbD8mDE7H5dDSlM23ohKCirAA==",
"dependencies": {
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.51",
"@continuedev/fetch": "^1.0.11",
"dotenv": "^16.5.0",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^4.76.0",
"uuid": "^11.1.0",
"zod": "^3.24.2"
}
},
"node_modules/@continuedev/openai-adapters/node_modules/uuid": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"bin": {
"uuid": "dist/esm/bin/uuid"
}
"resolved": "../packages/openai-adapters",
"link": true
},
"node_modules/@dabh/diagnostics": {
"version": "2.0.3",

View file

@ -53,7 +53,7 @@
"@continuedev/config-yaml": "file:../packages/config-yaml",
"@continuedev/fetch": "^1.0.14",
"@continuedev/llm-info": "^1.0.8",
"@continuedev/openai-adapters": "^1.0.32",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@modelcontextprotocol/sdk": "^1.12.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",

View file

@ -70,6 +70,7 @@ export type ToIdeFromWebviewOrCoreProtocol = {
];
getAvailableThreads: [undefined, Thread[]];
isTelemetryEnabled: [undefined, boolean];
isWorkspaceRemote: [undefined, boolean];
getUniqueId: [undefined, string];
getTags: [string, IndexTag[]];
readSecrets: [{ keys: string[] }, Record<string, string>];

View file

@ -106,6 +106,10 @@ export class MessageIde implements IDE {
return this.request("isTelemetryEnabled", undefined);
}
isWorkspaceRemote(): Promise<boolean> {
return this.request("isWorkspaceRemote", undefined);
}
getUniqueId(): Promise<string> {
return this.request("getUniqueId", undefined);
}

View file

@ -1,4 +1,4 @@
import { ConfigDependentToolParams, Tool } from "..";
import { ConfigDependentToolParams, IDE, Tool } from "..";
import { createNewFileTool } from "./definitions/createNewFile";
import { createRuleBlock } from "./definitions/createRuleBlock";
import { editFileTool } from "./definitions/editFile";
@ -13,12 +13,14 @@ import { runTerminalCommandTool } from "./definitions/runTerminalCommand";
import { searchWebTool } from "./definitions/searchWeb";
import { viewDiffTool } from "./definitions/viewDiff";
// missing support for remote os calls: https://github.com/microsoft/vscode/issues/252269
export const localOnlyToolDefinitions = [grepSearchTool];
export const baseToolDefinitions = [
readFileTool,
editFileTool,
createNewFileTool,
runTerminalCommandTool,
grepSearchTool,
globSearchTool,
searchWebTool,
viewDiffTool,
@ -34,3 +36,8 @@ export const baseToolDefinitions = [
export const getConfigDependentToolDefinitions = (
params: ConfigDependentToolParams,
): Tool[] => [requestRuleTool(params)];
export const getToolsForIde = async (ide: IDE) =>
(await ide.isWorkspaceRemote())
? baseToolDefinitions
: [...baseToolDefinitions, ...localOnlyToolDefinitions];

View file

@ -48,6 +48,10 @@ class FileSystemIde implements IDE {
return;
}
isWorkspaceRemote(): Promise<boolean> {
return Promise.resolve(false);
}
async getIdeSettings(): Promise<IdeSettings> {
return {
remoteConfigServerUrl: undefined,

View file

@ -5,93 +5,54 @@ title: Prompts
Prompts are reusable instructions that can be referenced at any time during chat. They are especially useful as context for repetitive and/or complex tasks.
:::info
Visit the Hub to [explore prompts](https://hub.continue.dev/explore/prompts) or [create your own](https://hub.continue.dev/new?type=block&blockType=prompts)
Prompts were previously defined in a `.prompt` file format, but for consistency we now recommend using the same Markdown format as [rules](./rules.mdx) and adding `alwaysApply: false` to the frontmatter so that they are manually triggered.
:::
## Examples
Below are some examples to get you started.
### Security review
```text title="Security best practices review"
@open - Review these files for the following security best practices:
- Does the architecture follow security-by-design principles?
- Are there potential security vulnerabilities in the system design?
- Is sensitive data handled appropriately throughout the lifecycle?
```
### Reference best practice guides
```text title="Redux best practices review"
@https://redux.js.org/style-guide/
@currentFile
Review this code for adherence to Redux best practices.
```
### Pull in commonly used files for tasks
```text title="Generate a new TypeORM entity"
@src/db/dataSource.ts @src/db/entity/SampleEntity.ts
Use these files to generate a new TypeORM entity based on the following requirements:
```
## Including Context Providers in your prompts
Many [context providers](../context-providers.mdx) can be referenced by typing "@" followed by the name of the context provider. The currently supported list is:
- `@terminal` - The contents of the terminal
- `@currentFile` - The currently active file
- `@open` - All open files
- `@os` - Information about the operating system
- `@problems` - Problems reported by the language server in the active file
- `@repo-map` - A map of files in the repository
- `@tree` - A tree view of the repository structure
Or you can directly type URLs and file paths:
- `@https://github.com/continuedev/continue` - The contents of a URL
- `@src/index.ts` - The contents of a file (VS Code only)
All references will be attached as context items, rather than injected directly inline.
## Local `.prompt` files
In addition to Prompt blocks on the Hub, you can also define prompts in local `.prompt` files, located in the `.continue/prompts` folder at the top level of your workspace. This is useful for quick iteration on prompts to test them out before pushing up to the Hub.
### Quick Start
Below is a quick example of setting up a prompt file:
1. Create a folder called `.continue/prompts` at the top level of your workspace
2. Add a file called `test.prompt` to this folder.
3. Write the following contents to `test.prompt` and save.
1. Create a folder called `.continue/rules` at the top level of your workspace
2. Add a file called `review-prompt.md` to this folder.
3. Write the following contents to `review-prompt.md` and save.
```.prompt
name: Current file prompt
description: A test prompt using the current file context provider
```md title="review-prompt.md"
---
@currentFile
name: Redux best practices review
alwaysApply: false
---
Review the currently open file for adherence to Redux best practices, as explained in their style guide at https://redux.js.org/style-guide/.
```
Now to use this prompt, you can open Chat, type <kbd>/</kbd>, select the prompt, and add type out some additional text such as "Review the code for any issues".
Now to use this prompt, you can open Chat, type <kbd>/</kbd>, select the prompt, and type out any additional instructions you'd like to add.
### Format
## Further Examples
The format is inspired by [HumanLoops's .prompt file](https://docs.humanloop.com/docs/prompt-file-format), with additional templating to reference files, URLs, and context providers.
Below are more examples to get you started. You can also visit the Hub to [explore prompts](https://hub.continue.dev/explore/prompts) or [create your own](https://hub.continue.dev/new?type=block&blockType=prompts).
:::info
The current state of this format is experimental and subject to change
:::
### Security review
### Preamble
```md title="security-review.md"
---
name: Security best practices review
alwaysApply: false
---
The "preamble" is everything above the `---` separator, and lets you specify model parameters. It uses YAML syntax and currently supports the following parameters:
Review the changes in the current git diff for these security best practices:
- `name` - The display title
- `description` - The description you will see in the dropdown
- `version` - Can be either "1" (for legacy prompt files) or "2" (this is the default and does not need to be set)
- Does the architecture follow security-by-design principles?
- Are there potential security vulnerabilities in the system design?
- Is sensitive data handled appropriately throughout the lifecycle?
```
If you don't need any of these parameters, you can leave out the preamble and do not need to include the `---` separator.
### Pull in commonly used files for tasks
```md title="typeorm-entity-generator.md"
---
name: Generate a new TypeORM entity
alwaysApply: false
---
Referencing `src/db/dataSource.ts` and `src/db/entity/SampleEntity.ts`, generate a new TypeORM entity based on the following requirements:
```

View file

@ -55,19 +55,26 @@ For example, you can say "Create a rule for this", and a rule will be created fo
Rules can also be added to an Assistant on the Continue Hub.
Explore available rules [here](https://hub.continue.dev/explore/rules), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub. These blocks are defined using the [`config.yaml` syntax](../../reference.md#rules) and can also be created locally.
Explore available rules [here](https://hub.continue.dev), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub.
### Syntax
:::info
Rules were originally defined in YAML format (demonstrated below), but we introduced Markdown for easier editing. While both are still supported, we recommend Markdown.
:::
Rules blocks can be simple text, written in YAML configuration files, or as Markdown (`.md`) files. They can have the following properties:
- `name` (**required** for YAML): A display name/title for the rule
- `globs` (optional): When files are provided as context that match this glob pattern, the rule will be included. This can be either a single pattern (e.g., `"**/*.{ts,tsx}"`) or an array of patterns (e.g., `["src/**/*.ts", "tests/**/*.ts"]`).
- `regex` (optional): When files are provided as context and their content matches this regex pattern, the rule will be included. This can be either a single pattern (e.g., `"^import .* from '.*';$"`) or an array of patterns (e.g., `["^import .* from '.*';$", "^export .* from '.*';$"]`).
- `description` (optional): A description for the rule. Agents may read this description when `alwaysApply` is false to determine whether the rule should be pulled into context.
- `alwaysApply`: true - Always include the rule, regardless of file context
- `alwaysApply`: false - Included if globs exist AND match file context, or the agent decides to pull the rule into context based on it's description
- `alwaysApply`: undefined - Default behavior: include if no globs exist OR globs exist and match
- `alwaysApply`: Determines whether the rule is always included. Behavior is described below:
- `true`: Always included, regardless of file context
- `false`: Included if globs exist AND match file context, or the agent decides to pull the rule into context based on it's description
- `undefined` (default behavior): Included if no globs exist OR globs exist and match
<Tabs groupId="rules-example">
<TabItem value="md" label="Markdown">
@ -97,10 +104,13 @@ Rules blocks can be simple text, written in YAML configuration files, or as Mark
```yaml title="doc-standards.yaml"
name: Documentation Standards
globs: docs/**/*.{md,mdx}
alwaysApply: false
version: 1.0.0
schema: v1
rules:
- name: Documentation Standards
globs: docs/**/*.{md,mdx}
alwaysApply: false
rule: >
- Follow Docusaurus documentation standards
- Include YAML frontmatter with title, description, and keywords
@ -164,7 +174,7 @@ Whenever you are writing React code, make sure to
Continue includes a simple default system message for [Chat](../../chat/how-to-use-it.md) and [Agent](../../agent/how-to-use-it.md) requests, to help the model provide reliable codeblock formats in its output.
This can be viewed in the rules section of the toolbar (see above), or visit the source code [here](https://github.com/continuedev/continue/blob/main/core/llm/constructMessages.ts#L4)
This can be viewed in the rules section of the toolbar (see above), or in the source code [here](https://github.com/continuedev/continue/blob/main/core/llm/constructMessages.ts#L4).
Advanced users can override this system message for a specific model if needed by using `chatOptions.baseSystemMessage`. See the [`config.yaml` reference](../../reference.md#models).
@ -172,7 +182,7 @@ Advanced users can override this system message for a specific model if needed b
:::warning
`.contninuerules` will be deprecated in a future release. Please use the `.continue/rules` folder instead.
`.continuerules` will be deprecated in a future release. Please use the `.continue/rules` folder instead.
:::

View file

@ -211,6 +211,15 @@ const config = {
enableInDevelopment: false,
},
],
[
"docusaurus-plugin-llms-txt",
{
// Optional configuration
outputPath: "static/llms.txt",
includePatterns: ["docs/**"],
excludePatterns: ["**/node_modules/**"],
},
],
[
"@docusaurus/plugin-client-redirects",
{

18
docs/package-lock.json generated
View file

@ -14,6 +14,7 @@
"@docusaurus/preset-classic": "^3.7.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.1.0",
"docusaurus-plugin-llms-txt": "^0.1.3",
"posthog-docusaurus": "^2.0.4",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
@ -7604,6 +7605,23 @@
"node": ">=6"
}
},
"node_modules/docusaurus-plugin-llms-txt": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/docusaurus-plugin-llms-txt/-/docusaurus-plugin-llms-txt-0.1.3.tgz",
"integrity": "sha512-X/Dqf1/soHFjvELWXtfa9C023498HsWWwNPdVZEu0OoznI2Gzf+VCB/4obwpBSV9OeDeI8D94/dK/ETq534k9A==",
"license": "MIT",
"dependencies": {
"fs-extra": "^11.2.0",
"gray-matter": "^4.0.3"
},
"engines": {
"node": ">=16.14"
},
"peerDependencies": {
"@docusaurus/core": ">=2.0.0",
"react": ">=16.8.0"
}
},
"node_modules/dom-converter": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz",

View file

@ -22,6 +22,7 @@
"@docusaurus/preset-classic": "^3.7.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.1.0",
"docusaurus-plugin-llms-txt": "^0.1.3",
"posthog-docusaurus": "^2.0.4",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",

View file

@ -2,9 +2,9 @@ package com.github.continuedev.continueintellijextension.auth
import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
import com.github.continuedev.continueintellijextension.utils.Desktop
import com.google.gson.Gson
import com.intellij.credentialStore.Credentials
import com.intellij.ide.BrowserUtil
import com.intellij.ide.passwordSafe.PasswordSafe
import com.intellij.ide.util.PropertiesComponent
import com.intellij.openapi.application.ApplicationManager
@ -165,7 +165,7 @@ class ContinueAuthService {
// Still open the URL in the browser (keeping existing behavior)
if (authUrl != null) {
Desktop.browse(java.net.URI(authUrl))
BrowserUtil.open(authUrl!!)
}
return authUrl

View file

@ -10,6 +10,7 @@ import com.github.continuedev.continueintellijextension.utils.*
import com.intellij.codeInsight.daemon.impl.HighlightInfo
import com.intellij.execution.configurations.GeneralCommandLine
import com.intellij.execution.util.ExecUtil
import com.intellij.ide.BrowserUtil
import com.intellij.ide.plugins.PluginManager
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.lang.annotation.HighlightSeverity
@ -125,6 +126,10 @@ class IntelliJIDE(
return true
}
override suspend fun isWorkspaceRemote(): Boolean {
return this.getIdeInfo().remoteName != "local"
}
override suspend fun getUniqueId(): String {
return getMachineUniqueID()
}
@ -211,7 +216,7 @@ class IntelliJIDE(
override suspend fun openUrl(url: String) {
withContext(Dispatchers.IO) {
Desktop.browse(URI(url))
BrowserUtil.browse(url)
}
}

View file

@ -102,6 +102,8 @@ interface IDE {
suspend fun isTelemetryEnabled(): Boolean
suspend fun isWorkspaceRemote(): Boolean
suspend fun getUniqueId(): String
suspend fun getTerminalContents(): String

View file

@ -1,214 +0,0 @@
/*
* Copyright © 2017 jjYBdx4IL (https://github.com/jjYBdx4IL)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.continuedev.continueintellijextension.utils
import org.apache.commons.lang3.SystemUtils
import org.slf4j.LoggerFactory
import java.io.File
import java.io.IOException
import java.net.URI
object Desktop {
private val LOG = LoggerFactory.getLogger(Desktop::class.java)
fun browse(uri: URI): Boolean {
if (browseDESKTOP(uri)) {
return true
}
if (openSystemSpecific(uri.toString())) {
return true
}
LOG.warn("failed to browse {}", uri)
return false
}
fun open(file: File): Boolean {
if (openDESKTOP(file)) {
return true
}
if (openSystemSpecific(file.path)) {
return true
}
LOG.warn("failed to open {}", file.absolutePath)
return false
}
fun edit(file: File): Boolean {
if (editDESKTOP(file)) {
return true
}
if (openSystemSpecific(file.path)) {
return true
}
LOG.warn("failed to edit {}", file.absolutePath)
return false
}
private fun openSystemSpecific(what: String): Boolean {
if (SystemUtils.IS_OS_LINUX) {
if (isXDG() && runCommand("xdg-open", "%s", what)) {
return true
}
if (isKDE() && runCommand("kde-open", "%s", what)) {
return true
}
if (isGNOME() && runCommand("gnome-open", "%s", what)) {
return true
}
if (runCommand("kde-open", "%s", what)) {
return true
}
if (runCommand("gnome-open", "%s", what)) {
return true
}
}
if (SystemUtils.IS_OS_MAC && runCommand("open", "%s", what)) {
return true
}
if (SystemUtils.IS_OS_WINDOWS && runCommand("explorer", "%s", what)) {
return true
}
return false
}
private fun browseDESKTOP(uri: URI): Boolean {
return try {
if (!java.awt.Desktop.isDesktopSupported()) {
LOG.debug("Platform is not supported.")
return false
}
if (!java.awt.Desktop.getDesktop().isSupported(java.awt.Desktop.Action.BROWSE)) {
LOG.debug("BROWSE is not supported.")
return false
}
LOG.info("Trying to use Desktop.getDesktop().browse() with {}", uri.toString())
java.awt.Desktop.getDesktop().browse(uri)
true
} catch (t: Throwable) {
LOG.error("Error using desktop browse.", t)
false
}
}
private fun openDESKTOP(file: File): Boolean {
return try {
if (!java.awt.Desktop.isDesktopSupported()) {
LOG.debug("Platform is not supported.")
return false
}
if (!java.awt.Desktop.getDesktop().isSupported(java.awt.Desktop.Action.OPEN)) {
LOG.debug("OPEN is not supported.")
return false
}
LOG.info("Trying to use Desktop.getDesktop().open() with {}", file.toString())
java.awt.Desktop.getDesktop().open(file)
true
} catch (t: Throwable) {
LOG.error("Error using desktop open.", t)
false
}
}
private fun editDESKTOP(file: File): Boolean {
return try {
if (!java.awt.Desktop.isDesktopSupported()) {
LOG.debug("Platform is not supported.")
return false
}
if (!java.awt.Desktop.getDesktop().isSupported(java.awt.Desktop.Action.EDIT)) {
LOG.debug("EDIT is not supported.")
return false
}
LOG.info("Trying to use Desktop.getDesktop().edit() with {}", file)
java.awt.Desktop.getDesktop().edit(file)
true
} catch (t: Throwable) {
LOG.error("Error using desktop edit.", t)
false
}
}
private fun runCommand(command: String, args: String, file: String): Boolean {
LOG.info("Trying to exec:\n cmd = {}\n args = {}\n %s = {}", command, args, file)
val parts = prepareCommand(command, args, file)
return try {
val p = Runtime.getRuntime().exec(parts)
if (p == null) {
false
} else {
try {
val retval = p.exitValue()
if (retval == 0) {
LOG.error("Process ended immediately.")
false
} else {
LOG.error("Process crashed.")
false
}
} catch (itse: IllegalThreadStateException) {
LOG.error("Process is running.")
true
}
}
} catch (e: IOException) {
LOG.error("Error running command.", e)
false
}
}
private fun prepareCommand(command: String, args: String?, file: String): Array<String> {
val parts = mutableListOf<String>()
parts.add(command)
args?.split(" ")?.forEach { s ->
parts.add(String.format(s, file).trim())
}
return parts.toTypedArray()
}
private fun isXDG(): Boolean {
val xdgSessionId = System.getenv("XDG_SESSION_ID")
return !xdgSessionId.isNullOrEmpty()
}
private fun isGNOME(): Boolean {
val gdmSession = System.getenv("GDMSESSION")
return gdmSession?.lowercase()?.contains("gnome") == true
}
private fun isKDE(): Boolean {
val gdmSession = System.getenv("GDMSESSION")
return gdmSession?.lowercase()?.contains("kde") == true
}
}

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "1.1.49",
"version": "1.1.50",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "1.1.49",
"version": "1.1.50",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
@ -110,7 +110,7 @@
"@continuedev/config-yaml": "file:../packages/config-yaml",
"@continuedev/fetch": "^1.0.13",
"@continuedev/llm-info": "^1.0.8",
"@continuedev/openai-adapters": "^1.0.32",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@modelcontextprotocol/sdk": "^1.12.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",

View file

@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "1.1.50",
"version": "1.1.51",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"

View file

@ -200,6 +200,10 @@ class VsCodeIde implements IDE {
return globalEnabled && continueEnabled;
}
isWorkspaceRemote(): Promise<boolean> {
return Promise.resolve(vscode.env.remoteName !== undefined);
}
getUniqueId(): Promise<string> {
return Promise.resolve(vscode.env.machineId);
}

2
gui/package-lock.json generated
View file

@ -116,7 +116,7 @@
"@continuedev/config-yaml": "file:../packages/config-yaml",
"@continuedev/fetch": "^1.0.13",
"@continuedev/llm-info": "^1.0.8",
"@continuedev/openai-adapters": "^1.0.32",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@modelcontextprotocol/sdk": "^1.12.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",

View file

@ -1,6 +1,7 @@
import { createAsyncThunk, unwrapResult } from "@reduxjs/toolkit";
import { ContextItem } from "core";
import { CLIENT_TOOLS_IMPLS } from "core/tools/builtIn";
import posthog from "posthog-js";
import { callClientTool } from "../../util/clientTools/callClientTool";
import { selectCurrentToolCall } from "../selectors/selectCurrentToolCall";
import { selectSelectedChatModel } from "../slices/configSlice";
@ -45,6 +46,9 @@ export const callCurrentTool = createAsyncThunk<void, undefined, ThunkApiType>(
let errorMessage: string | undefined = undefined;
let streamResponse: boolean;
// Check if telemetry is enabled
const allowAnonymousTelemetry = state.config.config.allowAnonymousTelemetry;
// IMPORTANT:
// Errors that occur while calling tool call implementations
// Are caught and passed in output as context items
@ -110,6 +114,17 @@ export const callCurrentTool = createAsyncThunk<void, undefined, ThunkApiType>(
);
}
// Because we don't have access to use hooks, we check `allowAnonymousTelemetry`
// directly rather than using `CustomPostHogProvider`
if (allowAnonymousTelemetry) {
// Capture telemetry for tool calls
posthog.capture("gui_tool_call_outcome", {
succeeded: errorMessage === undefined,
toolName: toolCallState.toolCall.function.name,
errorMessage: errorMessage,
});
}
if (streamResponse) {
if (errorMessage) {
dispatch(

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/config-yaml",
"version": "1.0.94",
"version": "1.0.95",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@ -13,7 +13,7 @@
}
},
"bin": {
"@continuedev/config-yaml": "./dist/cli.js"
"config-yaml": "./dist/cli.js"
},
"scripts": {
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
@ -34,6 +34,11 @@
"jest": "^29.7.0",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"zod-to-json-schema": "^3.24.5"
"zod-to-json-schema": "^3.24.5",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.6",
"@semantic-release/npm": "^10.0.6",
"semantic-release": "^21.1.2"
}
}

View file

@ -1,9 +1,3 @@
export default {
branches: ["main"],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
],
};
import createReleaseConfig from "../shared-release.config.js";
export default createReleaseConfig("config-yaml");

View file

@ -0,0 +1,3 @@
import createReleaseConfig from "../shared-release.config.js";
export default createReleaseConfig("fetch");

View file

@ -0,0 +1,3 @@
import createReleaseConfig from "../shared-release.config.js";
export default createReleaseConfig("llm-info");

View file

@ -0,0 +1,3 @@
import createReleaseConfig from "../shared-release.config.js";
export default createReleaseConfig("openai-adapters");

View file

@ -0,0 +1,34 @@
export default function createReleaseConfig(packageName) {
return {
branches: ["main"],
tagFormat: `@continuedev/${packageName}@\${version}`,
plugins: [
[
"@semantic-release/commit-analyzer",
{
releaseRules: [
{ scope: `packages/${packageName}`, release: "patch" },
{ scope: `packages/${packageName}`, type: "fix", release: "patch" },
{ scope: "packages/config-yaml", type: "feat", release: "minor" },
{
scope: `packages/${packageName}`,
breaking: true,
release: "major",
},
],
},
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json"],
message: `chore(release): @continuedev/${packageName}@\${nextRelease.version} [skip ci]`,
},
],
"@semantic-release/github",
],
};
}

View file

@ -0,0 +1,35 @@
# create the docker file
cat > Dockerfile << 'EOF'
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
# Install SSH server
RUN apt-get update && apt-get install -y openssh-server
# Configure SSH
RUN mkdir /var/run/sshd
RUN echo 'root:my_password' | chpasswd
# Allow root login
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
EOF
docker build -t continue-ubuntu-ssh . # build the image
rm Dockerfile # remove the created Dockerfile
container_name="continue-ssh-container"
docker run -d -p 2222:22 --name $container_name continue-ubuntu-ssh # run the container
echo "docker container ${container_name} running on port 2222"
# add the instructions
bold=$(tput bold)
normal=$(tput sgr0)
echo "\n--------------------------------------"
echo "now ssh into vscode (using remote explorer) with the following command: ${bold}ssh root@localhost -p 2222${normal}"
echo "use the following password - \"${bold}my_password${normal}\""