-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
230 changed files
with
2,479 additions
and
2,393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Input variables | ||
LLAMA_CPP_VERSION=${LLAMA_CPP_VERSION:-b3571} | ||
LLAMA_CPP_PLATFORM=${LLAMA_CPP_PLATFORM:-cuda-cu11.7.1-x64} | ||
OUTPUT_NAME=${OUTPUT_NAME:-tabby_x86_64-windows-msvc-cuda117} | ||
|
||
NAME=llama-${LLAMA_CPP_VERSION}-bin-win-${LLAMA_CPP_PLATFORM} | ||
ZIP_FILE=${NAME}.zip | ||
|
||
curl https://github.com/ggerganov/llama.cpp/releases/download/${LLAMA_CPP_VERSION}/${ZIP_FILE} -L -o ${ZIP_FILE} | ||
unzip ${ZIP_FILE} -d ${OUTPUT_NAME} | ||
|
||
pushd ${OUTPUT_NAME} | ||
rm $(ls *.exe | grep -v "llama-server") | ||
cp ../tabby_x86_64-windows-msvc.exe/tabby_x86_64-windows-msvc.exe tabby.exe | ||
popd | ||
|
||
zip -r ${OUTPUT_NAME}.zip ${OUTPUT_NAME} | ||
rm -rf ${OUTPUT_NAME} | ||
|
||
mkdir -p dist | ||
mv ${OUTPUT_NAME}.zip dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# CONTRIBUTING | ||
|
||
## Development | ||
|
||
Thank you for considering contributing to Tabby VSCode Extension, to get started, use the following commands: | ||
|
||
```bash | ||
|
||
# Install dependencies | ||
pnpm install | ||
|
||
# Start VSCode in development mode, with the extension loaded | ||
pnpm dev | ||
|
||
# Start VSCode Webview in development mode, with the extension loaded | ||
pnpm dev:browser | ||
``` | ||
|
||
## Architecture | ||
|
||
On a high level the extension is divided into the following components: | ||
|
||
+---------------------+ | ||
| Tabby Server | | ||
+------------------+ | +-----------------+ | | ||
| VSCode Extension | ---->| | | | ||
+------------------+ | | Chat UI | | | ||
| | | | | | ||
| | +-----------------+ | | ||
| | | | ||
v | +-----------------+ | | ||
+------------------+ | | | | | ||
| Tabby Agent | ---->| API | | | ||
+------------------+ | | | | | ||
| +-----------------+ | | ||
+---------------------+ | ||
|
||
- **Tabby Server**: The server component of Tabby, responsible for managing user accounts, code completions, and chat functionality. | ||
- **Chat UI**: The web-based UI for Tabby Chat, which is embedded as a webview in the VSCode extension. It is distributed together with the Tabby Server. | ||
- **Tabby Agent**: The LSP server of Tabby, responsible for providing code completions and other language services to the VSCode extension. It communicates with the Tabby Server via the API. For VSCode, the Tabby Agent is a library, thus it is embedded in the extension. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import { commands, QuickPick, QuickPickItem, QuickPickItemKind, ThemeIcon, window } from "vscode"; | ||
import { State as LanguageClientState } from "vscode-languageclient"; | ||
import { Client } from "./lsp/Client"; | ||
import { Config } from "./Config"; | ||
import { Issues } from "./Issues"; | ||
|
||
export default class CommandPalette { | ||
quickPick: QuickPick<CommandPaletteItem>; | ||
|
||
constructor( | ||
private readonly client: Client, | ||
private readonly config: Config, | ||
private readonly issues: Issues, | ||
) { | ||
this.quickPick = window.createQuickPick(); | ||
this.quickPick.title = "Tabby Command Palette"; | ||
|
||
let items: CommandPaletteItem[] = [this.itemForStatus()]; | ||
|
||
if (this.client.chat.isAvailable) { | ||
items.push({ | ||
label: "Chat", | ||
command: "tabby.chatView.focus", | ||
iconPath: new ThemeIcon("comment"), | ||
}); | ||
} | ||
|
||
items = items.concat([ | ||
{ | ||
label: "", | ||
kind: QuickPickItemKind.Separator, | ||
}, | ||
{ | ||
label: this.config.inlineCompletionTriggerMode === "manual" ? "Enable Completions" : "Disable Completions", | ||
command: "tabby.toggleInlineCompletionTriggerMode", | ||
}, | ||
{ | ||
label: "", | ||
kind: QuickPickItemKind.Separator, | ||
}, | ||
{ | ||
label: "Set Credentials", | ||
command: "tabby.setApiToken", | ||
iconPath: new ThemeIcon("key"), | ||
}, | ||
{ | ||
label: "Settings...", | ||
command: "tabby.openSettings", | ||
iconPath: new ThemeIcon("extensions-manage"), | ||
}, | ||
{ | ||
label: "Agent Settings...", | ||
command: "tabby.openTabbyAgentSettings", | ||
iconPath: new ThemeIcon("console"), | ||
}, | ||
{ | ||
label: "Show Logs...", | ||
command: "tabby.outputPanel.focus", | ||
}, | ||
{ | ||
label: "", | ||
kind: QuickPickItemKind.Separator, | ||
}, | ||
{ | ||
label: "Help", | ||
command: "tabby.openOnlineHelp", | ||
iconPath: new ThemeIcon("question"), | ||
}, | ||
]); | ||
|
||
this.quickPick.items = items; | ||
this.quickPick.onDidAccept(this.onDidAccept, this); | ||
this.quickPick.show(); | ||
} | ||
|
||
onDidAccept() { | ||
this.quickPick.hide(); | ||
const item = this.quickPick.activeItems[0]; | ||
if (item?.command) { | ||
if (typeof item.command === "function") { | ||
item.command(); | ||
} else { | ||
commands.executeCommand(item.command); | ||
} | ||
} | ||
} | ||
|
||
private itemForStatus(): CommandPaletteItem { | ||
const lspState = this.client.languageClient.state; | ||
const agentStatus = this.client.agent.status; | ||
const item: CommandPaletteItem = { | ||
label: "Status", | ||
iconPath: new ThemeIcon("warning"), | ||
}; | ||
if (lspState === LanguageClientState.Starting || agentStatus === "notInitialized") { | ||
item.label = "Starting..."; | ||
item.iconPath = new ThemeIcon("sync"); | ||
} else if (lspState === LanguageClientState.Stopped || agentStatus === "finalized") { | ||
item.label = "Disabled"; | ||
item.iconPath = new ThemeIcon("circle-slash"); | ||
} else if (agentStatus === "disconnected" || this.issues.first === "connectionFailed") { | ||
item.label = "Disconnected"; | ||
item.description = "Cannot connect to Tabby Server"; | ||
item.command = "tabby.openSettings"; | ||
} else if (agentStatus === "unauthorized") { | ||
item.label = "Unauthorized"; | ||
item.description = "Your credentials are invalid"; | ||
item.command = "tabby.setApiToken"; | ||
} else if (this.issues.length > 0) { | ||
switch (this.issues.first) { | ||
case "highCompletionTimeoutRate": | ||
item.label = "Timeout"; | ||
item.description = "Most completion requests timed out."; | ||
break; | ||
case "slowCompletionResponseTime": | ||
item.label = "Slow Response"; | ||
item.description = "Completion requests appear to take too much time."; | ||
break; | ||
} | ||
item.command = () => this.issues.showHelpMessage(); | ||
} else if (agentStatus === "ready") { | ||
item.label = "Ready"; | ||
item.iconPath = new ThemeIcon("check"); | ||
item.command = "tabby.outputPanel.focus"; | ||
} | ||
|
||
return item; | ||
} | ||
} | ||
|
||
interface CommandPaletteItem extends QuickPickItem { | ||
command?: string | CallbackCommand; | ||
} | ||
|
||
type CallbackCommand = () => void; |
Oops, something went wrong.