Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [main, dev]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

- name: Lint
run: npm run lint

- name: Compile
run: npm run compile
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags: ["v*"]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Sync version from tag
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
npm version "$TAG_VERSION" --no-git-tag-version

- run: npm ci

- name: Lint
run: npm run lint

- name: Compile
run: npm run compile

- name: Package extension
run: npx @vscode/vsce package -o lorebyte.vsix

- name: Publish to VS Code Marketplace
run: npx @vscode/vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: lorebyte.vsix
generate_release_notes: true
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
"lorebyte.model": {
"type": "string",
"default": "kimi-k2.5-free",
"description": "Model ID to use for generating commit messages"
"default": "minimax-m2.5-free",
"description": "Model ID to use for generating commit messages. Use 'Lorebyte: List Available Models' command to browse and select."
},
"lorebyte.apiKey": {
"type": "string",
Expand Down
19 changes: 13 additions & 6 deletions src/commands/listModels.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import * as vscode from "vscode";
import { providerRegistry } from "../providers/providerRegistry";
import { OpenCodeZenProvider } from "../providers/openCodeZenProvider";
import { getConfig } from "../config/configuration";

export async function listModels(): Promise<void> {
const config = getConfig();
const provider = providerRegistry.get(config.provider);

if (!(provider instanceof OpenCodeZenProvider)) {
vscode.window.showErrorMessage("Lorebyte: Current provider does not support listing models.");
if (!provider) {
vscode.window.showErrorMessage(
`Lorebyte: Unknown provider "${config.provider}".`
);
return;
}

if (!config.apiKey) {
vscode.window.showErrorMessage("Lorebyte: API key is required to list models.");
vscode.window.showErrorMessage(
"Lorebyte: API key is required to list models."
);
return;
}

Expand All @@ -27,7 +30,9 @@ export async function listModels(): Promise<void> {
);

if (models.length === 0) {
vscode.window.showWarningMessage("Lorebyte: No models returned from API.");
vscode.window.showWarningMessage(
"Lorebyte: No models returned from API."
);
return;
}

Expand All @@ -39,7 +44,9 @@ export async function listModels(): Promise<void> {
await vscode.workspace
.getConfiguration("lorebyte")
.update("model", picked, vscode.ConfigurationTarget.Global);
vscode.window.showInformationMessage(`Lorebyte: Model set to "${picked}"`);
vscode.window.showInformationMessage(
`Lorebyte: Model set to "${picked}"`
);
}
} catch (err) {
vscode.window.showErrorMessage(
Expand Down
2 changes: 1 addition & 1 deletion src/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getConfig(): LorebyteConfig {
const cfg = vscode.workspace.getConfiguration("lorebyte");
return {
provider: cfg.get<string>("provider", "opencode-zen"),
model: cfg.get<string>("model", "kimi-k2.5-free"),
model: cfg.get<string>("model", "minimax-m2.5-free"),
apiKey: cfg.get<string>("apiKey", ""),
apiBaseUrl: cfg.get<string>(
"apiBaseUrl",
Expand Down
10 changes: 0 additions & 10 deletions src/providers/openCodeZenProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ export class OpenCodeZenProvider implements LLMProvider {
readonly id = "opencode-zen";
readonly displayName = "OpenCode Zen";

getModels(): string[] {
return [
"kimi-k2.5-free",
"kimi-k2.5",
"gpt-5.2-codex",
"gpt-5.1-codex",
"minimax-m2.5-free",
];
}

validateConfig(apiKey: string, baseUrl: string): string | undefined {
if (!apiKey) {
return "API key is required. Set it in Settings → Lorebyte → Api Key.";
Expand Down
2 changes: 1 addition & 1 deletion src/providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export interface ChatCompletionResponse {
export interface LLMProvider {
readonly id: string;
readonly displayName: string;
getModels(): string[];
chatCompletion(
options: ChatCompletionOptions,
apiKey: string,
baseUrl: string
): Promise<ChatCompletionResponse>;
fetchRemoteModels(apiKey: string, baseUrl: string): Promise<string[]>;
validateConfig(apiKey: string, baseUrl: string): string | undefined;
}