From a94c178126709c0109c631f99a012f4d1cbee746 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 31 Mar 2025 16:15:40 -0700 Subject: [PATCH 1/3] optional-context-name --- core/config/yaml/loadYaml.ts | 5 ++++- .../providers/ContinueProxyContextProvider.ts | 1 + core/context/providers/HttpContextProvider.ts | 14 ++++++++------ docs/docs/reference.md | 7 ++++++- packages/config-yaml/src/schemas/index.ts | 1 + 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index f2fefbb39..55db94692 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -374,7 +374,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[]; diff --git a/core/context/providers/ContinueProxyContextProvider.ts b/core/context/providers/ContinueProxyContextProvider.ts index 278a12678..77e47c9f3 100644 --- a/core/context/providers/ContinueProxyContextProvider.ts +++ b/core/context/providers/ContinueProxyContextProvider.ts @@ -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 || diff --git a/core/context/providers/HttpContextProvider.ts b/core/context/providers/HttpContextProvider.ts index 067035806..bcca31177 100644 --- a/core/context/providers/HttpContextProvider.ts +++ b/core/context/providers/HttpContextProvider.ts @@ -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, diff --git a/docs/docs/reference.md b/docs/docs/reference.md index 69f301366..217c460dd 100644 --- a/docs/docs/reference.md +++ b/docs/docs/reference.md @@ -220,7 +220,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:** @@ -234,6 +235,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 ``` diff --git a/packages/config-yaml/src/schemas/index.ts b/packages/config-yaml/src/schemas/index.ts index 1ca03b0b6..c33d02fc4 100644 --- a/packages/config-yaml/src/schemas/index.ts +++ b/packages/config-yaml/src/schemas/index.ts @@ -3,6 +3,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(), }); From c59c834790011d27558fb983d40171f70e522b59 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 31 Mar 2025 20:42:17 -0700 Subject: [PATCH 2/3] bump config-yaml --- core/package-lock.json | 8 ++++---- core/package.json | 2 +- gui/package-lock.json | 10 +++++----- gui/package.json | 2 +- packages/config-yaml/package.json | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index 50df2a6f3..3283e219e 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13,7 +13,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.67", + "@continuedev/config-yaml": "^1.0.68", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "^1.0.18", @@ -2974,9 +2974,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.67", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.67.tgz", - "integrity": "sha512-RbJXSH2Z9XmaN1h9Dm0Qfru7UeAdCAEWMiEgJ9A2FGHysR9oxbQDqptk1Y61oDSpYeX+lWsxkz/SFIc2PjNnKg==", + "version": "1.0.68", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.68.tgz", + "integrity": "sha512-rCegSGkv7Ws7LLnYVVGwXsoVZFpNFJnG6b1dVrj/u+2ZsFdA2leQUNtFGoeE/ixyfhUfBpMlgjEyPrmmy7gLjw==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/core/package.json b/core/package.json index 205e3b778..b6193d221 100644 --- a/core/package.json +++ b/core/package.json @@ -47,7 +47,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.67", + "@continuedev/config-yaml": "^1.0.68", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "^1.0.18", diff --git a/gui/package-lock.json b/gui/package-lock.json index 78eb2e61d..23fd77734 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -7,7 +7,7 @@ "name": "gui", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-yaml": "^1.0.67", + "@continuedev/config-yaml": "^1.0.68", "@headlessui/react": "^2.2.0", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -111,7 +111,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.67", + "@continuedev/config-yaml": "^1.0.68", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "^1.0.18", @@ -554,9 +554,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.67", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.67.tgz", - "integrity": "sha512-RbJXSH2Z9XmaN1h9Dm0Qfru7UeAdCAEWMiEgJ9A2FGHysR9oxbQDqptk1Y61oDSpYeX+lWsxkz/SFIc2PjNnKg==", + "version": "1.0.68", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.68.tgz", + "integrity": "sha512-rCegSGkv7Ws7LLnYVVGwXsoVZFpNFJnG6b1dVrj/u+2ZsFdA2leQUNtFGoeE/ixyfhUfBpMlgjEyPrmmy7gLjw==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/gui/package.json b/gui/package.json index 3210a55f5..4df8cbec8 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.67", + "@continuedev/config-yaml": "^1.0.68", "@headlessui/react": "^2.2.0", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index d7d96c4f0..e3d62aeef 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.67", + "version": "1.0.68", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", From 397be9daa24dd8c86e5a9514186ddc7bf308db96 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 14 Apr 2025 15:20:51 -0700 Subject: [PATCH 3/3] bump version number --- packages/config-yaml/package-lock.json | 4 ++-- packages/config-yaml/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/config-yaml/package-lock.json b/packages/config-yaml/package-lock.json index 4e5b8df05..58250c2d5 100644 --- a/packages/config-yaml/package-lock.json +++ b/packages/config-yaml/package-lock.json @@ -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", diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index f32235580..ab9bbd2af 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -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",