Files
Sprachmittler/Packages/SprachmittlerKit/Package.swift
T
schihei 26b493e7e5 feat(m1): Ollama client, catalog, streaming chat and CLI (T1.1-T1.6)
Add endpoint policy and redirect-safe ephemeral HTTP client, error mapping, catalog cache and version checks, streaming chat with phase timeouts/cancellation, provisional Hy-MT3 prompt/language/request factory, warm-up policy, and sprachmittler-cli models/show/translate. Recapture the 7B fixtures; defer the 1.8B VERIFY items; document ADR-016. Also fix the signature checker's pipefail SIGPIPE issue.
2026-11-26 13:04:22 +01:00

109 lines
4.4 KiB
Swift

// swift-tools-version: 6.0
// SprachmittlerKit — all testable logic for Sprachmittler. The macOS app target (App/) is generated by
// XcodeGen from project.yml and links the library products below. See docs/ARCHITECTURE.md §3–§4.
import PackageDescription
let strictSettings: [SwiftSetting] = [
.enableUpcomingFeature("ExistentialAny"),
]
let package = Package(
name: "SprachmittlerKit",
platforms: [.macOS(.v14)],
products: [
.library(name: "SprachmittlerCore", targets: ["SprachmittlerCore"]),
.library(name: "SprachmittlerCapture", targets: ["SprachmittlerCapture"]),
.executable(name: "sprachmittler-cli", targets: ["sprachmittler-cli"]),
],
dependencies: [
// CLI harness only (ARCHITECTURE §4). The app target must not depend on it.
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
],
targets: [
// Leaf modules — must not depend on each other or on any other package module.
// SprachmittlerText: pure Foundation + NaturalLanguage.
.target(name: "SprachmittlerText", swiftSettings: strictSettings),
// SprachmittlerOllama: the only URLSession user.
.target(name: "SprachmittlerOllama", swiftSettings: strictSettings),
// The only module that knows model names, prompts, language names and dialects (ADR-002, ADR-012).
.target(
name: "SprachmittlerEngines",
dependencies: ["SprachmittlerText", "SprachmittlerOllama"],
swiftSettings: strictSettings
),
// Composition through protocols; no model-specific branches.
.target(
name: "SprachmittlerCore",
dependencies: ["SprachmittlerText", "SprachmittlerOllama", "SprachmittlerEngines"],
swiftSettings: strictSettings
),
// The only module that imports Accessibility and touches NSPasteboard (ADR-004, ADR-005).
.target(name: "SprachmittlerCapture", dependencies: ["SprachmittlerCore"], swiftSettings: strictSettings),
// Evaluation harness — linked into the CLI only, never into the app.
.target(name: "SprachmittlerEval", dependencies: ["SprachmittlerCore"], swiftSettings: strictSettings),
// Fakes shared by tests (FakePasteboard, FakeClock, FakeOllamaTransport, FakeTextInserter, …).
.target(
name: "SprachmittlerTestSupport",
dependencies: ["SprachmittlerCore", "SprachmittlerOllama"],
swiftSettings: strictSettings
),
.executableTarget(
name: "sprachmittler-cli",
dependencies: [
"SprachmittlerCore",
"SprachmittlerEngines",
"SprachmittlerEval",
"SprachmittlerOllama",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
swiftSettings: strictSettings
),
.testTarget(
name: "SprachmittlerTextTests",
dependencies: ["SprachmittlerText"],
resources: [.copy("Fixtures")]
),
.testTarget(
name: "SprachmittlerOllamaTests",
dependencies: ["SprachmittlerOllama", "SprachmittlerTestSupport"],
resources: [.copy("Fixtures")]
),
.testTarget(
name: "SprachmittlerEnginesTests",
dependencies: ["SprachmittlerEngines"],
resources: [.copy("Fixtures")]
),
.testTarget(
name: "SprachmittlerCoreTests",
dependencies: ["SprachmittlerCore", "SprachmittlerOllama", "SprachmittlerTestSupport"]
),
.testTarget(
name: "SprachmittlerCaptureTests",
dependencies: ["SprachmittlerCapture", "SprachmittlerTestSupport"]
),
.testTarget(
name: "SprachmittlerEvalTests",
dependencies: ["SprachmittlerEval", "SprachmittlerTestSupport"]
),
.testTarget(
name: "SprachmittlerCLITests",
dependencies: [
"sprachmittler-cli",
"SprachmittlerEngines",
"SprachmittlerOllama",
"SprachmittlerTestSupport",
]
),
// Opt-in tests against a real local Ollama: SPRACHMITTLER_LIVE=1 swift test --filter SprachmittlerLiveTests
.testTarget(name: "SprachmittlerLiveTests", dependencies: ["SprachmittlerCore"]),
]
)