Merge pull request #4922 from continuedev/dallin/context-block-name

Optional context block name
This commit is contained in:
Dallin Romney 2025-04-18 14:09:58 -07:00 • committed by GitHub
commit 86fc2ee435
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 11 deletions

View file

@ -395,7 +395,10 @@ async function configYamlToContinueConfig({
}
return undefined;
}
const instance: IContextProvider = new cls(context.params ?? {});
const instance: IContextProvider = new cls({
name: context.name,
...context.params,
});
return instance;
})
.filter((p) => !!p) ?? []) as IContextProvider[];

View file

@ -24,6 +24,7 @@ class ContinueProxyContextProvider extends BaseContextProvider {
this.options.title || ContinueProxyContextProvider.description.title,
displayTitle:
this.options.displayTitle ||
this.options.name ||
ContinueProxyContextProvider.description.displayTitle,
description:
this.options.description ||

View file

@ -16,18 +16,20 @@ class HttpContextProvider extends BaseContextProvider {
override get description(): ContextProviderDescription {
return {
title: this.options.title || "http",
displayTitle: this.options.displayTitle || "HTTP",
title: this.options.title || HttpContextProvider.description.title,
displayTitle:
this.options.displayTitle ||
this.options.name ||
HttpContextProvider.description.displayTitle,
description:
this.options.description ||
"Retrieve a context item from a custom server",
type: "normal",
this.options.description || HttpContextProvider.description.description,
type: HttpContextProvider.description.type,
renderInlineAs:
this.options.renderInlineAs ||
HttpContextProvider.description.renderInlineAs,
};
}
async getContextItems(
query: string,
extras: ContextProviderExtras,

View file

@ -237,7 +237,8 @@ More information about usage/params for each context provider can be found [here
**Properties:**
- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`).
- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`)
- `name`: Optional name for the provider
- `params`: Optional parameters to configure the context provider's behavior.
**Example:**
@ -251,6 +252,10 @@ context:
nFinal: 10
- provider: docs
- provider: diff
- provider: http
name: Context Server 1
params:
url: "https://api.example.com/server1"
- provider: folder
- provider: terminal
```

View file

@ -1,12 +1,12 @@
{
"name": "@continuedev/config-yaml",
"version": "1.0.78",
"version": "1.0.87",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@continuedev/config-yaml",
"version": "1.0.78",
"version": "1.0.87",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.14",

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/config-yaml",
"version": "1.0.78",
"version": "1.0.87",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View file

@ -4,6 +4,7 @@ import { dataSchema } from "./data/index.js";
import { modelSchema, partialModelSchema } from "./models.js";
export const contextSchema = z.object({
name: z.string().optional(),
provider: z.string(),
params: z.any().optional(),
});