From 6fdad553b6ac7f64c1bb23617dbe313e16174a56 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 20 Jun 2024 18:35:18 -0500 Subject: [PATCH] fix(extensions): schema for db ctx provider (#1534) * fix(extensions): schema for db ctx provider * fix: invalid enum --- docs/static/schemas/config.json | 101 ++++++++------- .../src/main/resources/config_schema.json | 101 ++++++++------- extensions/vscode/config_schema.json | 108 ++++++++-------- extensions/vscode/continue_rc_schema.json | 115 ++++++++++-------- 4 files changed, 230 insertions(+), 195 deletions(-) diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index ba9304c8ed..6428abfed6 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -1318,7 +1318,8 @@ "code", "system", "currentFile", - "url" + "url", + "database" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", @@ -1341,7 +1342,8 @@ "Reference specific functions and classes from throughout your codebase", "Reference your operating system and cpu", "Reference the contents of the currently active file", - "Reference the contents of a page at a URL" + "Reference the contents of a page at a URL", + "Reference table schemas" ], "type": "string" }, @@ -1457,56 +1459,63 @@ } }, "then": { - "connections": { - "type": "array", - "description": "A list of database connections", - "items": { - "type": "object", + "properties": { + "params": { "properties": { - "name": { - "type": "string", - "description": "A unique name for this database connection" - }, - "connection_type": { - "type": "string", - "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": ["postgres", "mysql", "sqlite"] - }, - "connection": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "The database user name" - }, - "host": { - "type": "string", - "description": "The host address of the database server" - }, - "database": { - "type": "string", - "description": "The name of the database to connect to" - }, - "password": { - "type": "string", - "description": "The password for the database user" - }, - "port": { - "type": "integer", - "description": "The port number to connect to at the host" + "connections": { + "type": "array", + "description": "A list of database connections", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A unique name for this database connection" + }, + "connection_type": { + "type": "string", + "description": "The type of database (e.g., 'postgres', 'mysql')", + "enum": ["postgres", "mysql", "sqlite"] + }, + "connection": { + "type": "object", + "properties": { + "user": { + "type": "string", + "description": "The database user name" + }, + "host": { + "type": "string", + "description": "The host address of the database server" + }, + "database": { + "type": "string", + "description": "The name of the database to connect to" + }, + "password": { + "type": "string", + "description": "The password for the database user" + }, + "port": { + "type": "integer", + "description": "The port number to connect to at the host" + }, + "filename": { + "type": "string", + "description": "File location for simple file DB's" + } + }, + "required": [] + } }, - "filename": { - "type": "string", - "description": "File location for simple file DB's" - } - }, - "required": [] + "required": ["name", "connection_type", "connection"] + } } }, - "required": ["name", "type", "connection"] + "required": ["connections"] } }, - "required": ["connections"] + "required": ["params"] } }, { diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json index ba9304c8ed..6428abfed6 100644 --- a/extensions/intellij/src/main/resources/config_schema.json +++ b/extensions/intellij/src/main/resources/config_schema.json @@ -1318,7 +1318,8 @@ "code", "system", "currentFile", - "url" + "url", + "database" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", @@ -1341,7 +1342,8 @@ "Reference specific functions and classes from throughout your codebase", "Reference your operating system and cpu", "Reference the contents of the currently active file", - "Reference the contents of a page at a URL" + "Reference the contents of a page at a URL", + "Reference table schemas" ], "type": "string" }, @@ -1457,56 +1459,63 @@ } }, "then": { - "connections": { - "type": "array", - "description": "A list of database connections", - "items": { - "type": "object", + "properties": { + "params": { "properties": { - "name": { - "type": "string", - "description": "A unique name for this database connection" - }, - "connection_type": { - "type": "string", - "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": ["postgres", "mysql", "sqlite"] - }, - "connection": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "The database user name" - }, - "host": { - "type": "string", - "description": "The host address of the database server" - }, - "database": { - "type": "string", - "description": "The name of the database to connect to" - }, - "password": { - "type": "string", - "description": "The password for the database user" - }, - "port": { - "type": "integer", - "description": "The port number to connect to at the host" + "connections": { + "type": "array", + "description": "A list of database connections", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A unique name for this database connection" + }, + "connection_type": { + "type": "string", + "description": "The type of database (e.g., 'postgres', 'mysql')", + "enum": ["postgres", "mysql", "sqlite"] + }, + "connection": { + "type": "object", + "properties": { + "user": { + "type": "string", + "description": "The database user name" + }, + "host": { + "type": "string", + "description": "The host address of the database server" + }, + "database": { + "type": "string", + "description": "The name of the database to connect to" + }, + "password": { + "type": "string", + "description": "The password for the database user" + }, + "port": { + "type": "integer", + "description": "The port number to connect to at the host" + }, + "filename": { + "type": "string", + "description": "File location for simple file DB's" + } + }, + "required": [] + } }, - "filename": { - "type": "string", - "description": "File location for simple file DB's" - } - }, - "required": [] + "required": ["name", "connection_type", "connection"] + } } }, - "required": ["name", "type", "connection"] + "required": ["connections"] } }, - "required": ["connections"] + "required": ["params"] } }, { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index ba9304c8ed..dbb658fa11 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -1316,13 +1316,14 @@ "outline", "postgres", "code", - "system", "currentFile", - "url" + "url", + "database" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", "Reference the contents of the terminal", + "Reference the contents of the local variables with top n level (defaulting to 3) of call stack for that thread", "Reference the contents of all open or pinned files.", "Enter a search phrase and include the Google search results as context", "Reference the results of a ripgrep search in your codebase", @@ -1332,16 +1333,14 @@ "Include important files from a folder in the prompt, as determined by similarity search", "Reference GitHub issues from a repository", "Retrieve important pages from a documentation website, as determined by similarity search", - "Index and retrieve the contents of any documentation site, using embeddings to find important snippets", "Display a file tree of the current workspace", + "Include important highlighted sections from your code", "Include a repo map showing important code objects", - "Displays important snippets of code from the currently open files", - "Displays definition lines from the currently open files", "References Postgres table schema and sample rows", "Reference specific functions and classes from throughout your codebase", - "Reference your operating system and cpu", "Reference the contents of the currently active file", - "Reference the contents of a page at a URL" + "Reference the contents of a page at a URL", + "Reference table schemas" ], "type": "string" }, @@ -1457,56 +1456,63 @@ } }, "then": { - "connections": { - "type": "array", - "description": "A list of database connections", - "items": { - "type": "object", + "properties": { + "params": { "properties": { - "name": { - "type": "string", - "description": "A unique name for this database connection" - }, - "connection_type": { - "type": "string", - "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": ["postgres", "mysql", "sqlite"] - }, - "connection": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "The database user name" - }, - "host": { - "type": "string", - "description": "The host address of the database server" - }, - "database": { - "type": "string", - "description": "The name of the database to connect to" - }, - "password": { - "type": "string", - "description": "The password for the database user" - }, - "port": { - "type": "integer", - "description": "The port number to connect to at the host" + "connections": { + "type": "array", + "description": "A list of database connections", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A unique name for this database connection" + }, + "connection_type": { + "type": "string", + "description": "The type of database (e.g., 'postgres', 'mysql')", + "enum": ["postgres", "mysql", "sqlite"] + }, + "connection": { + "type": "object", + "properties": { + "user": { + "type": "string", + "description": "The database user name" + }, + "host": { + "type": "string", + "description": "The host address of the database server" + }, + "database": { + "type": "string", + "description": "The name of the database to connect to" + }, + "password": { + "type": "string", + "description": "The password for the database user" + }, + "port": { + "type": "integer", + "description": "The port number to connect to at the host" + }, + "filename": { + "type": "string", + "description": "File location for simple file DB's" + } + }, + "required": [] + } }, - "filename": { - "type": "string", - "description": "File location for simple file DB's" - } - }, - "required": [] + "required": ["name", "connection_type", "connection"] + } } }, - "required": ["name", "type", "connection"] + "required": ["connections"] } }, - "required": ["connections"] + "required": ["params"] } }, { diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index 9b0f6fc9fd..23ed8e9c64 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -1461,7 +1461,8 @@ "code", "system", "currentFile", - "url" + "url", + "database" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", @@ -1484,7 +1485,8 @@ "Reference specific functions and classes from throughout your codebase", "Reference your operating system and cpu", "Reference the contents of the currently active file", - "Reference the contents of a page at a URL" + "Reference the contents of a page at a URL", + "Reference table schemas" ], "type": "string" }, @@ -1623,65 +1625,74 @@ } }, "then": { - "connections": { - "type": "array", - "description": "A list of database connections", - "items": { - "type": "object", + "properties": { + "params": { "properties": { - "name": { - "type": "string", - "description": "A unique name for this database connection" - }, - "connection_type": { - "type": "string", - "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": [ - "postgres", - "mysql", - "sqlite" - ] - }, - "connection": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "The database user name" - }, - "host": { - "type": "string", - "description": "The host address of the database server" - }, - "database": { - "type": "string", - "description": "The name of the database to connect to" - }, - "password": { - "type": "string", - "description": "The password for the database user" - }, - "port": { - "type": "integer", - "description": "The port number to connect to at the host" + "connections": { + "type": "array", + "description": "A list of database connections", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A unique name for this database connection" + }, + "connection_type": { + "type": "string", + "description": "The type of database (e.g., 'postgres', 'mysql')", + "enum": [ + "postgres", + "mysql", + "sqlite" + ] + }, + "connection": { + "type": "object", + "properties": { + "user": { + "type": "string", + "description": "The database user name" + }, + "host": { + "type": "string", + "description": "The host address of the database server" + }, + "database": { + "type": "string", + "description": "The name of the database to connect to" + }, + "password": { + "type": "string", + "description": "The password for the database user" + }, + "port": { + "type": "integer", + "description": "The port number to connect to at the host" + }, + "filename": { + "type": "string", + "description": "File location for simple file DB's" + } + }, + "required": [] + } }, - "filename": { - "type": "string", - "description": "File location for simple file DB's" - } - }, - "required": [] + "required": [ + "name", + "connection_type", + "connection" + ] + } } }, "required": [ - "name", - "type", - "connection" + "connections" ] } }, "required": [ - "connections" + "params" ] } },