Skip to content

Commit 8442055

Browse files
committed
Add example-llm plugin to test CI pipeline
Minimal LLM provider plugin that echoes back user text. Demonstrates TypeWhisperPluginSDK usage with Swift 6 Sendable conformance.
1 parent 96038a2 commit 8442055

7 files changed

Lines changed: 159 additions & 2 deletions

File tree

plugin-index.json

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
{
22
"schemaVersion": 1,
3-
"generatedAt": "2026-03-12T00:00:00Z",
4-
"plugins": []
3+
"generatedAt": "2026-03-12T20:28:45.180Z",
4+
"plugins": [
5+
{
6+
"id": "com.typewhisper.example-llm",
7+
"slug": "example-llm",
8+
"name": "Example LLM",
9+
"author": "TypeWhisper",
10+
"authorUrl": null,
11+
"version": "1.0.0",
12+
"description": "A minimal example LLM plugin demonstrating the TypeWhisperPluginSDK.",
13+
"categories": [
14+
"llm"
15+
],
16+
"platforms": [
17+
"mac"
18+
],
19+
"minAppVersion": "1.0.0",
20+
"license": "GPL-3.0-only",
21+
"homepage": null,
22+
"sourceUrl": "https://github.com/TypeWhisper/typewhisper-plugins/tree/main/plugins/example-llm",
23+
"icon": "Sparkles",
24+
"iconUrl": null,
25+
"apiDocsUrl": null,
26+
"readmeUrl": "https://github.com/TypeWhisper/typewhisper-plugins/raw/main/plugins/example-llm/README.md",
27+
"downloads": {
28+
"mac": {
29+
"url": "https://github.com/TypeWhisper/typewhisper-plugins/releases/download/example-llm-v1.0.0/example-llm-1.0.0-mac.bundle.zip",
30+
"sha256": "",
31+
"size": 0
32+
}
33+
},
34+
"publishedAt": "2026-03-12T20:28:45.166Z",
35+
"principalClass": "ExampleLLMPlugin"
36+
}
37+
]
538
}

plugins/example-llm/LICENSE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This plugin is part of the TypeWhisper community plugins repository
2+
and is licensed under the GNU General Public License v3.0.
3+
4+
See the LICENSE file in the repository root for the full license text.

plugins/example-llm/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Example LLM Plugin
2+
3+
A minimal example plugin that demonstrates how to build an LLM provider for TypeWhisper using the TypeWhisperPluginSDK.
4+
5+
## What it does
6+
7+
This plugin echoes back the user's text with a prefix, serving as a starting point for building your own LLM provider plugin.
8+
9+
## Setup
10+
11+
No configuration required. The plugin works out of the box.
12+
13+
## Usage
14+
15+
1. Install the plugin
16+
2. Select "Example LLM" as your LLM provider in TypeWhisper settings
17+
3. Any transcribed text will be echoed back with an "[Example]" prefix
18+
19+
## Building from Source
20+
21+
```bash
22+
cd src
23+
swift build
24+
```

plugins/example-llm/manifest.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"id": "com.typewhisper.example-llm",
3+
"slug": "example-llm",
4+
"name": "Example LLM",
5+
"author": "TypeWhisper",
6+
"version": "1.0.0",
7+
"description": "A minimal example LLM plugin demonstrating the TypeWhisperPluginSDK.",
8+
"categories": ["llm"],
9+
"platforms": ["mac"],
10+
"minAppVersion": "1.0.0",
11+
"license": "GPL-3.0-only",
12+
"principalClass": "ExampleLLMPlugin",
13+
"icon": "Sparkles"
14+
}

plugins/example-llm/src/Package.resolved

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// swift-tools-version: 6.0
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "ExampleLLM",
6+
platforms: [.macOS(.v14)],
7+
products: [
8+
.library(name: "ExampleLLM", type: .dynamic, targets: ["ExampleLLM"])
9+
],
10+
dependencies: [
11+
.package(
12+
url: "https://github.com/TypeWhisper/TypeWhisperPluginSDK.git",
13+
from: "1.0.0"
14+
)
15+
],
16+
targets: [
17+
.target(
18+
name: "ExampleLLM",
19+
dependencies: [
20+
.product(name: "TypeWhisperPluginSDK", package: "TypeWhisperPluginSDK")
21+
]
22+
)
23+
]
24+
)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import Foundation
2+
import TypeWhisperPluginSDK
3+
import SwiftUI
4+
5+
@objc(ExampleLLMPlugin)
6+
final class ExampleLLMPlugin: NSObject, LLMProviderPlugin {
7+
static let pluginId = "com.typewhisper.example-llm"
8+
static let pluginName = "Example LLM"
9+
10+
private nonisolated(unsafe) var host: HostServices?
11+
12+
let providerName = "Example LLM"
13+
let supportedModels = [
14+
PluginModelInfo(
15+
id: "echo-v1",
16+
displayName: "Echo V1",
17+
sizeDescription: "Local",
18+
languageCount: 0
19+
)
20+
]
21+
22+
var isAvailable: Bool { true }
23+
24+
override init() {
25+
super.init()
26+
}
27+
28+
func activate(host: HostServices) {
29+
self.host = host
30+
}
31+
32+
func deactivate() {
33+
host = nil
34+
}
35+
36+
func process(
37+
systemPrompt: String,
38+
userText: String,
39+
model: String?
40+
) async throws -> String {
41+
return "[Example] \(userText)"
42+
}
43+
}

0 commit comments

Comments
 (0)