Skip to content

Commit

Permalink
Merge branch 'main' into feature/continue2
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshedivy authored Oct 14, 2024
2 parents 03a97a1 + 58dfece commit 0febfde
Show file tree
Hide file tree
Showing 11 changed files with 927 additions and 890 deletions.
4 changes: 3 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
"type": "npm",
"script": "webpack-dev",
"problemMatcher": "$ts-webpack-watch",
"isBackground": false,

"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
"isDefault": true,
}
}
]
Expand Down
1,151 changes: 300 additions & 851 deletions package-lock.json

Large diffs are not rendered by default.

141 changes: 109 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "vscode-db2i",
"displayName": "Db2 for IBM i",
"description": "Db2 for IBM i tools in VS Code",
"version": "1.5.2",
"version": "1.6.0",
"engines": {
"vscode": "^1.70.0"
"vscode": "^1.90.0"
},
"icon": "media/logo.png",
"keywords": [
Expand Down Expand Up @@ -37,39 +37,31 @@
"language:test": "vitest",
"dsc": "npx tsx src/dsc",
"package": "vsce package",
"vscode:prepublish": "rm -rf dist && npm run webpack && npm run dsc",
"webpack": "vscd --clean && webpack --mode development",
"webpack-dev": "vscd --clean && webpack --mode development",
"vscode:prepublish": "rm -rf dist && webpack --mode production && npm run dsc",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development",
"typings": "npx -p typescript tsc ./src/extension.ts --declaration --allowJs --emitDeclarationOnly --outDir types --esModuleInterop -t es2019 --moduleResolution node"
},
"devDependencies": {
"@halcyontech/vscode-ibmi-types": "^2.12.1",
"@types/glob": "^7.1.3",
"@types/node": "14.x",
"@types/vscode": "^1.70.0",
"esbuild-loader": "^3.0.1",
"eslint": "^7.32.0",
"glob": "^7.1.7",
"octokit": "^3.1.2",
"raw-loader": "^4.0.2",
"ts-loader": "^9.3.1",
"typescript": "^4.3.2",
"vitest": "^0.33.0",
"vscd": "^1.0.0",
"vscode-test": "^1.5.2",
"webpack": "^5.91.0",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"@ibm/mapepire-js": "^0.3.0",
"chart.js": "^4.4.2",
"csv": "^6.1.3",
"json-to-markdown-table": "^1.0.0",
"node-fetch": "^3.3.1",
"showdown": "^2.1.0",
"sql-formatter": "^14.0.0"
},
"contributes": {
"chatParticipants": [
{
"id": "vscode-db2i.chat",
"name": "db2i",
"fullName": "Db2 for i",
"description": "Chat with the Db2 for i AI assistant",
"isSticky": true,
"commands": [
{
"name": "build",
"description": "Build an SQL statement"
},
{
"name": "activity",
"description": "Summarize the activity on the system"
}
]
}
],
"configuration": [
{
"id": "vscode-db2i",
Expand Down Expand Up @@ -128,6 +120,33 @@
}
}
},
{
"id": "vscode-db2i.ai",
"title": "Db2 for IBM i with AI",
"properties": {
"vscode-db2i.ai.provider": {
"order": 0,
"type": "string",
"description": "Model Provider",
"default": "none",
"enum": [
"none",
"Ollama",
"GitHub Copilot"
],
"enumDescriptions": [
"Ollama instance, with specific model",
"GitHub Copilot. Requires the GitHub Copilot extension to be installed"
]
},
"vscode-db2i.ai.model": {
"order": 1,
"type": "string",
"description": "Model to use with the provider",
"default": "ibm-granite"
}
}
},
{
"id": "vscode-db2i.resultsets",
"title": "Viewing Data",
Expand Down Expand Up @@ -306,6 +325,24 @@
]
},
"commands": [
{
"command": "vscode-db2i.ai.changeModel",
"title": "Change AI Model",
"category": "Db2 for i"
},
{
"command": "vscode-db2i.notebook.open",
"title": "New Notebook",
"category": "IBM i Notebooks",
"enablement": "code-for-ibmi:connected == true",
"icon": "$(notebook)"
},
{
"command": "vscode-db2i.notebook.fromSqlUri",
"title": "Open as Notebook",
"category": "IBM i Notebooks",
"icon": "$(notebook)"
},
{
"command": "vscode-db2i.json.pasteGenerator",
"title": "Paste JSON as SQL",
Expand Down Expand Up @@ -1242,6 +1279,18 @@
}
],
"snippets": [
{
"language": "sql",
"path": "snippets/scalars.code-snippets"
},
{
"language": "sql",
"path": "snippets/variables.code-snippets"
},
{
"language": "sql",
"path": "snippets/aggregates.code-snippets"
},
{
"language": "sql",
"path": "snippets/http.code-snippets"
Expand All @@ -1263,5 +1312,33 @@
"path": "snippets/aggregates.code-snippets"
}
]
},
"devDependencies": {
"@halcyontech/vscode-ibmi-types": "^2.0.0",
"@types/glob": "^7.1.3",
"@types/node": "14.x",
"@types/vscode": "^1.90.0",
"esbuild-loader": "^3.0.1",
"eslint": "^7.32.0",
"glob": "^7.1.7",
"octokit": "^3.1.2",
"raw-loader": "^4.0.2",
"ts-loader": "^9.3.1",
"typescript": "^4.3.2",
"vitest": "^0.33.0",
"vscode-test": "^1.5.2",
"webpack": "^5.91.0",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"@ibm/mapepire-js": "^0.3.0",
"chart.js": "^4.4.2",
"csv": "^6.1.3",
"json-to-markdown-table": "^1.0.0",
"lru-cache": "^6.0.0",
"node-fetch": "^3.3.1",
"ollama": "^0.5.2",
"showdown": "^2.1.0",
"sql-formatter": "^14.0.0"
}
}
25 changes: 25 additions & 0 deletions src/chat/aiConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Configuration from "../configuration";

/**
* Matches config vscode-db2i.ai.provider
*/
export type AiProvider = "none"|"Ollama"|"GitHub Copilot";

export class AiConfig {

static getProvider(): AiProvider {
return Configuration.get<AiProvider>(`ai.provider`);
}

static getModel(): string {
return Configuration.get<string>("ai.model");
}

static setProvider(provider: AiProvider) {
return Configuration.set(`ai.provider`, provider);
}

static setModel(model: string) {
return Configuration.set(`ai.model`, model);
}
}
Loading

0 comments on commit 0febfde

Please sign in to comment.