feat: add LexAI status bar and suggestion panel
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled

- Implemented a status bar item for LexAI with dynamic status updates (ready, processing, notReady).
- Created a suggestion panel for displaying and interacting with AI-generated suggestions.
- Added functionality for accepting, regenerating, and discarding suggestions within the suggestion zone.
- Introduced configuration options for writing style, prompt patterns, personas, and formats.
- Integrated progress indicators for long-running tasks and improved user feedback.
- Established TypeScript configuration for the vscode package.
This commit is contained in:
john kevin asprec
2026-08-13 18:06:45 +08:00
parent fc19ead0a7
commit 8bc529ef2d
84 changed files with 10025 additions and 662 deletions

View File

@@ -0,0 +1,381 @@
{
"name": "lexai-vscode",
"displayName": "LexAI — AI Writing & Code Assist",
"description": "BYO-LLM writing + workspace-aware Code Assist: Fix, Rephrase, Shorten, Expand, Explain, Make Prompt, inline assist, sidebar, settings. Twin of the LexAI Chrome extension.",
"version": "1.0.0",
"publisher": "JuanKibin",
"license": "MIT",
"icon": "media/icon-128.png",
"private": false,
"homepage": "https://chromewebstore.google.com/detail/bagpcheidbkfgijnnmolnkgagibbjfnk",
"repository": {
"type": "git",
"url": "https://git.juankibin.space/kibin/LexAI.git"
},
"engines": {
"vscode": "^1.85.0",
"node": ">=22"
},
"categories": [
"Programming Languages",
"Machine Learning",
"Other"
],
"keywords": [
"lexai",
"ai",
"writing",
"grammar",
"code assist",
"refactor",
"llm",
"openai",
"anthropic",
"chrome extension",
"byok"
],
"activationEvents": [
"onStartupFinished"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "lexai.fix",
"title": "LexAI: Fix Grammar"
},
{
"command": "lexai.rephrase",
"title": "LexAI: Rephrase"
},
{
"command": "lexai.shorten",
"title": "LexAI: Shorten"
},
{
"command": "lexai.expand",
"title": "LexAI: Expand"
},
{
"command": "lexai.explain",
"title": "LexAI: Explain"
},
{
"command": "lexai.prompt",
"title": "LexAI: Make Prompt"
},
{
"command": "lexai.codeAssist",
"title": "LexAI: Code Assist"
},
{
"command": "lexai.codeAssist.submit",
"title": "Ask LexAI",
"enablement": "commentController == lexaiAssist && commentThread == lexaiCodeAssistPrompt"
},
{
"command": "lexai.codeAssist.cancel",
"title": "Cancel Code Assist",
"enablement": "commentController == lexaiAssist && commentThread == lexaiCodeAssistPrompt"
},
{
"command": "lexai.openSidebar",
"title": "LexAI: Open Sidebar"
},
{
"command": "lexai.openSettings",
"title": "LexAI: Open Settings"
},
{
"command": "lexai.setApiKey",
"title": "LexAI: Set API Key"
},
{
"command": "lexai.clearApiKey",
"title": "LexAI: Clear API Key"
},
{
"command": "lexai.showStatus",
"title": "LexAI: Show Configuration Status"
},
{
"command": "lexai.showSelectionActions",
"title": "LexAI: Show Actions"
},
{
"command": "lexai.zone.accept",
"title": "LexAI: Accept Suggestion",
"enablement": "commentController == lexai"
},
{
"command": "lexai.zone.regenerate",
"title": "LexAI: Regenerate Suggestion",
"enablement": "commentController == lexai"
},
{
"command": "lexai.zone.discard",
"title": "LexAI: Discard Suggestion",
"enablement": "commentController == lexai"
},
{
"command": "lexai.zone.openPanel",
"title": "LexAI: Open Suggestion Panel",
"enablement": "commentController == lexai"
}
],
"submenus": [
{
"id": "lexai.submenu",
"label": "LexAI"
}
],
"menus": {
"editor/context": [
{
"submenu": "lexai.submenu",
"when": "editorHasSelection",
"group": "1_modification@9"
}
],
"editor/lineNumber/context": [
{
"submenu": "lexai.submenu",
"when": "lexai.hasSelection",
"group": "navigation@1"
}
],
"lexai.submenu": [
{
"command": "lexai.showSelectionActions",
"group": "0_pick@1"
},
{
"command": "lexai.codeAssist",
"group": "0_pick@2",
"when": "editorHasSelection"
},
{
"command": "lexai.fix",
"group": "1_actions@1"
},
{
"command": "lexai.rephrase",
"group": "1_actions@2"
},
{
"command": "lexai.shorten",
"group": "1_actions@3"
},
{
"command": "lexai.expand",
"group": "1_actions@4"
},
{
"command": "lexai.explain",
"group": "1_actions@5"
},
{
"command": "lexai.prompt",
"group": "1_actions@6"
},
{
"command": "lexai.openSettings",
"group": "9_settings@1"
}
],
"comments/commentThread/title": [
{
"command": "lexai.codeAssist.cancel",
"group": "inline@1",
"when": "commentController == lexaiAssist && commentThread == lexaiCodeAssistPrompt"
},
{
"command": "lexai.zone.accept",
"group": "inline@1",
"when": "commentController == lexai && commentThread == lexaiSuggestion"
},
{
"command": "lexai.zone.regenerate",
"group": "inline@2",
"when": "commentController == lexai && commentThread == lexaiSuggestion"
},
{
"command": "lexai.zone.discard",
"group": "inline@3",
"when": "commentController == lexai && commentThread == lexaiSuggestion"
}
],
"comments/commentThread/context": [
{
"command": "lexai.codeAssist.submit",
"group": "inline@1",
"when": "commentController == lexaiAssist && commentThread == lexaiCodeAssistPrompt"
}
],
"commandPalette": [
{
"command": "lexai.openSidebar"
},
{
"command": "lexai.openSettings"
},
{
"command": "lexai.codeAssist",
"when": "editorHasSelection"
},
{
"command": "lexai.codeAssist.submit",
"when": "false"
},
{
"command": "lexai.codeAssist.cancel",
"when": "false"
},
{
"command": "lexai.showSelectionActions",
"when": "lexai.hasSelection"
},
{
"command": "lexai.fix"
},
{
"command": "lexai.rephrase"
},
{
"command": "lexai.shorten"
},
{
"command": "lexai.expand"
},
{
"command": "lexai.explain"
},
{
"command": "lexai.prompt"
},
{
"command": "lexai.setApiKey"
},
{
"command": "lexai.clearApiKey"
},
{
"command": "lexai.showStatus"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "lexai",
"title": "LexAI",
"icon": "media/lexai-activity.svg"
}
]
},
"views": {
"lexai": [
{
"type": "webview",
"id": "lexai.sidebar",
"name": "Workspace",
"contextualTitle": "LexAI"
}
]
},
"configuration": {
"title": "LexAI",
"properties": {
"lexai.provider": {
"type": "string",
"enum": [
"openai",
"anthropic",
"groq",
"openrouter"
],
"default": "openai",
"description": "LLM provider. Prefer LexAI: Open Settings; change the API key when switching providers."
},
"lexai.model": {
"type": "string",
"default": "",
"description": "Model id for the selected provider. Leave empty to use the provider default."
},
"lexai.writingStyle": {
"type": "string",
"enum": [
"Default",
"Formal",
"Casual",
"Academic",
"Creative",
"Concise"
],
"default": "Default",
"description": "Writing style applied to Fix / Rephrase / Shorten / Expand / Explain."
},
"lexai.promptPattern": {
"type": "string",
"default": "auto",
"description": "Prompt Builder structural pattern id (auto, zero-shot, role, few-shot, …)."
},
"lexai.promptPersona": {
"type": "string",
"default": "Auto",
"description": "Prompt Builder persona preset."
},
"lexai.customPersona": {
"type": "string",
"default": "",
"description": "Custom persona text when promptPersona is Custom…"
},
"lexai.promptFormat": {
"type": "string",
"default": "Auto",
"description": "Prompt Builder preferred output format."
},
"lexai.promptModel": {
"type": "string",
"default": "",
"description": "Optional model override for Make Prompt only."
},
"lexai.previewBeforeReplace": {
"type": "boolean",
"default": true,
"description": "When true, preview the suggestion before replacing the selection."
},
"lexai.suggestionUi": {
"type": "string",
"enum": [
"zone",
"panel",
"both"
],
"default": "zone",
"description": "Where to show suggestions: in-editor zone (comment widget), side panel, or both."
},
"lexai.askOptionsBeforeGenerate": {
"type": "boolean",
"default": false,
"description": "Ask for writing-style / Prompt Builder options in Quick Picks before each generation."
}
}
}
},
"scripts": {
"compile": "node esbuild.mjs",
"build": "node esbuild.mjs",
"watch": "node esbuild.mjs --watch",
"typecheck": "tsc --noEmit",
"package": "npm run compile && vsce package --no-dependencies --baseContentUrl https://git.juankibin.space/kibin/LexAI/src/branch/main/packages/vscode --baseImagesUrl https://git.juankibin.space/kibin/LexAI/raw/branch/main/packages/vscode",
"vscode:prepublish": "npm run compile"
},
"devDependencies": {
"@types/node": "^22.13.4",
"@types/vscode": "^1.85.0",
"@vscode/vsce": "^3.2.2",
"esbuild": "^0.25.0",
"typescript": "^5.7.3"
}
}