chore: Sprachmittler OpenCode starter kit

This commit is contained in:
schihei committed 2026-11-26 11:59:38 +01:00
commit 374085ec2f
94 files changed
+4563

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import AppKit
import SprachmittlerCore
/// Lifecycle glue: composition root, Services provider, double-copy watcher, termination.
@MainActor
final class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
// Build AppEnvironment here (composition root): settings, Ollama services, session,
// double-copy watcher and panel controller. Start the watcher only after explicit consent.
//
// The Services provider is wired here once SprachmittlerCapture.ServicesProvider exists:
// NSApp.servicesProvider = servicesProvider
// NSUpdateDynamicServices()
}
func applicationWillTerminate(_ notification: Notification) {
// Cancel in-flight translations, stop the pasteboard watcher and close the panel.
}
}
+65
View File
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Sprachmittler</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<!-- Menu-bar agent: no Dock icon, no main menu. -->
<key>LSUIElement</key>
<true/>
<!-- Permits http:// to localhost / 127.0.0.1 only. Remote endpoints must use HTTPS (SP-5). -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<!-- No-permission entry point: Services ▸ Translate with Sprachmittler (docs/SELECTION_AND_CLIPBOARD.md). -->
<key>NSServices</key>
<array>
<dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Translate with Sprachmittler</string>
</dict>
<key>NSMessage</key>
<string>translateSelection</string>
<key>NSPortName</key>
<string>Sprachmittler</string>
<key>NSSendTypes</key>
<array>
<string>public.utf8-plain-text</string>
<string>NSStringPboardType</string>
</array>
<key>NSRequiredContext</key>
<dict/>
</dict>
</array>
<!-- Intentionally NO usage-description keys for microphone, camera, screen recording,
Input Monitoring or Apple Events (SP-10). Accessibility has no Info.plist key. -->
</dict>
</plist>
+5
View File
@@ -0,0 +1,5 @@
# MenuBar
The status item and its menu: translate clipboard text, target language, last translation actions,
Settings, Setup, Diagnostics, Quit. Created in milestone tasks; see `docs/ARCHITECTURE.md` §11 and
`docs/IMPLEMENTATION_PLAN.md`.
+5
View File
@@ -0,0 +1,5 @@
# Onboarding
First-run window, reopenable from the menu bar: Ollama reachable, Hy-MT3 model installed, target
language chosen, optional Accessibility permission for Replace. Each check has a fix button. Created
in milestone tasks.
+5
View File
@@ -0,0 +1,5 @@
# Panel
The non-activating floating translation panel: source preview, target language, streaming
translation, Copy and the explicit Replace button in the lower right. Never replaces text by
default. Created in milestone tasks; see `docs/ARCHITECTURE.md` §11 and `docs/DECISIONS.md` ADR-005.
+4
View File
@@ -0,0 +1,4 @@
# Settings
General, Model, Translation, Privacy and Diagnostics tabs. Backed by `AppSettings` (ARCHITECTURE §12).
Stores no source text and no translations. Created in milestone tasks.
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ADR-003: App Sandbox is disabled because replacing another app's selection requires
Accessibility trust, which App Sandbox does not allow for this use. Hardened Runtime is
enabled via ENABLE_HARDENED_RUNTIME in project.yml. No hardened-runtime exceptions. -->
<key>com.apple.security.app-sandbox</key>
<false/>
</dict>
</plist>
+35
View File
@@ -0,0 +1,35 @@
import AppKit
import SwiftUI
/// Entry point. Keep this file thin: scenes only, no business logic (ARCHITECTURE §3).
@main
struct SprachmittlerApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
var body: some Scene {
MenuBarExtra("Sprachmittler", systemImage: "translate") {
// Replaced by MenuBar/StatusMenu.swift.
Button("Translate Clipboard Text") {}
.disabled(true)
Divider()
Button("Set up Sprachmittler…") {}
.disabled(true)
SettingsLink {
Text("Settings…")
}
Divider()
Button("Quit Sprachmittler") {
NSApplication.shared.terminate(nil)
}
.keyboardShortcut("q")
}
.menuBarExtraStyle(.menu)
Settings {
// Replaced by Settings/SettingsView.swift.
Text("Settings")
.padding()
.frame(width: 480, height: 320)
}
}
}