From 90bbebd1d62bc60aea32f4668a06bec4e616a5e2 Mon Sep 17 00:00:00 2001 From: shanthan eddula Date: Sat, 29 Mar 2025 09:07:28 -0700 Subject: [PATCH 1/6] Initial setup: Project structure and GitHub configuration --- .github/CODEOWNERS | 18 +++++ .github/ISSUE_TEMPLATE/bug_report.md | 36 +++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.md | 23 ++++++ .github/branch-protection.yml | 38 +++++++++ .github/pull_request_template.md | 27 +++++++ .github/workflows/ci.yml | 64 +++++++++++++++ .github/workflows/dependency-update.yml | 41 ++++++++++ .github/workflows/dependency-updates.yml | 47 +++++++++++ .github/workflows/release.yml | 42 ++++++++++ .swift-version | 1 + .swiftformat | 14 ++++ Package.swift | 77 ++++++++----------- Sources/MinimalAIChat/Core/AppDelegate.swift | 57 ++++++++++++++ Sources/MinimalAIChat/UI/ContentView.swift | 51 ++++++++++++ Sources/MinimalAIChat/UI/Views/ChatView.swift | 68 ++++++++++++++++ .../MinimalAIChat/UI/Views/SettingsView.swift | 46 +++++++++++ Sources/MinimalAIChat/main.swift | 12 +++ Sources/MinimalAIChatCore/Core.swift | 19 +++++ Tests/Unit/CoreTests.swift | 12 +++ 20 files changed, 652 insertions(+), 46 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/branch-protection.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/dependency-update.yml create mode 100644 .github/workflows/dependency-updates.yml create mode 100644 .swift-version create mode 100644 .swiftformat create mode 100644 Sources/MinimalAIChat/Core/AppDelegate.swift create mode 100644 Sources/MinimalAIChat/UI/ContentView.swift create mode 100644 Sources/MinimalAIChat/UI/Views/ChatView.swift create mode 100644 Sources/MinimalAIChat/UI/Views/SettingsView.swift create mode 100644 Sources/MinimalAIChat/main.swift create mode 100644 Sources/MinimalAIChatCore/Core.swift create mode 100644 Tests/Unit/CoreTests.swift diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a5692cc --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,18 @@ +# This is a comment. Each line is a file pattern followed by one or more owners. + +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# @global-owner1 and @global-owner2 will be requested for +# review when someone opens a pull request. +* @shanthaneddula + +# Order is important; the last matching pattern takes the most +# precedence. When someone opens a pull request that only +# modifies JS files, only @js-owner and not the global +# owner(s) will be requested for a review. +*.swift @shanthaneddula + +# You can also use email addresses if you prefer. They'll be +# used to look up users just like we do for commit author +# emails. +# *.swift user@example.com \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..d963052 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,36 @@ +--- +name: 🐛 Bug Report +about: Create a report to help us improve +title: '[BUG] ' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment:** + - OS: [e.g. macOS 14.0] + - Swift Version: [e.g. 5.9] + - Xcode Version: [e.g. 15.0] + - Device: [e.g. MacBook Pro 2023] + +**Additional context** +Add any other context about the problem here. + +**Logs** +If applicable, please share relevant logs or error messages. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..beb08d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: GitHub Community Support + url: https://github.com/orgs/community/discussions + about: Please ask and answer questions here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..1f792d8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: ✨ Feature Request +about: Suggest an idea for this project +title: '[FEATURE] ' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. + +**Implementation Notes** +If you have any specific implementation ideas or requirements, please describe them here. \ No newline at end of file diff --git a/.github/branch-protection.yml b/.github/branch-protection.yml new file mode 100644 index 0000000..66cf7d7 --- /dev/null +++ b/.github/branch-protection.yml @@ -0,0 +1,38 @@ +# Branch Protection Rules + +branches: + - name: main + protection: + required_status_checks: + strict: true + contexts: + - "Build and Test" + - "Code Coverage" + required_pull_request_reviews: + required_approving_review_count: 1 + dismiss_stale_reviews: true + require_code_owner_reviews: true + enforce_admins: true + required_linear_history: true + allow_force_pushes: false + allow_deletions: false + block_creations: true + required_conversation_resolution: true + + - name: dev + protection: + required_status_checks: + strict: true + contexts: + - "Build and Test" + - "Code Coverage" + required_pull_request_reviews: + required_approving_review_count: 1 + dismiss_stale_reviews: true + require_code_owner_reviews: false + enforce_admins: true + required_linear_history: true + allow_force_pushes: false + allow_deletions: false + block_creations: true + required_conversation_resolution: true \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..4f62161 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,27 @@ +## Description +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. + +Fixes # (issue) + +## Type of change +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +## How Has This Been Tested? +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. + +## Checklist: +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes + +## Additional Notes +Add any additional notes or screenshots here. \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e69de29..7094124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: CI + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + +jobs: + build: + name: Build and Test + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Swift + uses: fwal/setup-swift@v1 + with: + swift-version: "5.9" + + - name: Build + run: swift build -v + + - name: Run Tests + run: swift test -v + + - name: Run SwiftLint + run: | + brew install swiftlint + swiftlint lint --reporter codeclimate-logger | tee swiftlint-report.json + + - name: Upload SwiftLint Report + uses: actions/upload-artifact@v4 + with: + name: swiftlint-report + path: swiftlint-report.json + retention-days: 7 + + codecov: + name: Upload Coverage + needs: build + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Swift + uses: fwal/setup-swift@v1 + with: + swift-version: "5.9" + + - name: Install Codecov + run: | + brew install codecov + + - name: Generate Coverage + run: | + swift test --enable-code-coverage + + - name: Upload Coverage + run: | + xcrun llvm-cov export -format="lcov" .build/debug/MinimalAIChatPackageTests.xctest/Contents/MacOS/MinimalAIChatPackageTests > coverage.lcov + codecov -f coverage.lcov -B main diff --git a/.github/workflows/dependency-update.yml b/.github/workflows/dependency-update.yml new file mode 100644 index 0000000..219f404 --- /dev/null +++ b/.github/workflows/dependency-update.yml @@ -0,0 +1,41 @@ +name: Dependency Update + +on: + schedule: + - cron: '0 0 * * 0' # Run weekly on Sunday at midnight + +jobs: + update: + name: Update Dependencies + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Swift + uses: fwal/setup-swift@v1 + with: + swift-version: "5.9" + + - name: Update Dependencies + run: | + swift package update + if git diff --quiet Package.resolved; then + echo "No dependency updates available" + else + echo "Dependencies have updates available" + git diff Package.resolved + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: "chore: update dependencies" + title: "chore: update dependencies" + body: | + Automated dependency update. + + This PR updates the project dependencies to their latest versions. + + Please review the changes and merge if appropriate. + branch: chore/dependency-update + delete-branch: true \ No newline at end of file diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml new file mode 100644 index 0000000..5077c3c --- /dev/null +++ b/.github/workflows/dependency-updates.yml @@ -0,0 +1,47 @@ +name: Dependency Updates + +on: + schedule: + - cron: '0 0 * * 0' # Run weekly on Sunday + +jobs: + update-dependencies: + name: Update Dependencies + runs-on: macos-14 + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Swift + uses: fwal/setup-swift@v1 + with: + swift-version: "5.9" + + - name: Update Dependencies + run: | + swift package update + if git diff --quiet Package.resolved; then + echo "No dependency updates available" + else + echo "Dependencies have updates available" + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add Package.resolved + git commit -m "Update dependencies" + git push + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: "Update dependencies" + title: "Update dependencies" + body: | + Automated dependency updates. + + This PR was created automatically by the dependency update workflow. + branch: dependency-updates + delete-branch: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e69de29..db313dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + name: Build Release + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Swift + uses: fwal/setup-swift@v1 + with: + swift-version: "5.9" + + - name: Build + run: swift build -c release + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: .build/release/MinimalAIChat + asset_name: MinimalAIChat-${{ github.ref_name }} + asset_content_type: application/octet-stream diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..4408def --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +5.9 \ No newline at end of file diff --git a/.swiftformat b/.swiftformat new file mode 100644 index 0000000..ffe05bf --- /dev/null +++ b/.swiftformat @@ -0,0 +1,14 @@ +--indent 4 +--allman false +--wraparguments before-first +--wrapcollections before-first +--closingparen same-line +--commas always +--comments indent +--semicolons never +--trimwhitespace always +--header strip +--maxwidth 120 +--wrapparameters before-first +--importgrouping testable-bottom +--xcodeindentation enabled \ No newline at end of file diff --git a/Package.swift b/Package.swift index 9e5b5c1..f8c936d 100644 --- a/Package.swift +++ b/Package.swift @@ -1,75 +1,60 @@ -// swift-tools-version: 5.9 -// The swift-tools-version declares the minimum version of Swift required to build this package. - +// swift-tools-version:5.9 import PackageDescription let package = Package( name: "MinimalAIChat", platforms: [ - .macOS(.v13) + .macOS(.v13), ], products: [ .executable( name: "MinimalAIChat", targets: ["MinimalAIChat"] - ) + ), + .library( + name: "MinimalAIChatCore", + targets: ["MinimalAIChatCore"] + ), ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"), - .package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"), + .package(url: "https://github.com/apple/swift-log.git", from: "0.5.0"), .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"), - .package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"), - .package(url: "https://github.com/apple/swift-asn1.git", from: "0.10.0"), - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.12.0"), - .package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"), - .package(url: "https://github.com/apple/swift-numerics.git", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"), - .package(url: "https://github.com/Quick/Quick.git", from: "7.3.0"), - .package(url: "https://github.com/Quick/Nimble.git", from: "13.2.0") + .package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"), ], targets: [ .executableTarget( name: "MinimalAIChat", dependencies: [ + "MinimalAIChatCore", .product(name: "Logging", package: "swift-log"), - .product(name: "AsyncAlgorithms", package: "swift-async-algorithms"), .product(name: "Collections", package: "swift-collections"), - .product(name: "ArgumentParser", package: "swift-argument-parser"), - .product(name: "Algorithms", package: "swift-algorithms"), - .product(name: "SwiftSyntax", package: "swift-syntax"), - .product(name: "SwiftASN1", package: "swift-asn1"), - .product(name: "SnapshotTesting", package: "swift-snapshot-testing"), - .product(name: "Crypto", package: "swift-crypto"), - .product(name: "Numerics", package: "swift-numerics"), - .product(name: "Atomics", package: "swift-atomics"), - .product(name: "Quick", package: "Quick"), - .product(name: "Nimble", package: "Nimble") + .product(name: "AsyncAlgorithms", package: "swift-async-algorithms"), ], - path: "App", - resources: [ - .process("UI/Localization") + path: "Sources/MinimalAIChat" + ), + .target( + name: "MinimalAIChatCore", + dependencies: [ + .product(name: "Logging", package: "swift-log"), + .product(name: "Collections", package: "swift-collections"), + .product(name: "AsyncAlgorithms", package: "swift-async-algorithms"), ], - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] + path: "Sources/MinimalAIChatCore" ), .testTarget( name: "MinimalAIChatTests", - dependencies: ["MinimalAIChat"], - path: "Tests/Unit", - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] + dependencies: ["MinimalAIChatCore"], + path: "Tests/Unit" ), .testTarget( - name: "MinimalAIChatUITests", - dependencies: ["MinimalAIChat"], - path: "Tests/UI", - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] - ) + name: "MinimalAIChatIntegrationTests", + dependencies: ["MinimalAIChatCore"], + path: "Tests/Integration" + ), + .testTarget( + name: "MinimalAIChatPerformanceTests", + dependencies: ["MinimalAIChatCore"], + path: "Tests/Performance" + ), ] ) diff --git a/Sources/MinimalAIChat/Core/AppDelegate.swift b/Sources/MinimalAIChat/Core/AppDelegate.swift new file mode 100644 index 0000000..3eb6412 --- /dev/null +++ b/Sources/MinimalAIChat/Core/AppDelegate.swift @@ -0,0 +1,57 @@ +import Logging +import SwiftUI + +/// The main application delegate responsible for managing the application lifecycle +/// and core services. +@main +final class AppDelegate: NSObject, NSApplicationDelegate { + // MARK: - Properties + + private let logger = Logger(label: "com.minimalaichat.app") + private var window: NSWindow? + + // MARK: - NSApplicationDelegate + + func applicationDidFinishLaunching(_: Notification) { + logger.info("Application launching...") + setupWindow() + setupServices() + } + + func applicationWillTerminate(_: Notification) { + logger.info("Application terminating...") + cleanupServices() + } + + // MARK: - Private Methods + + private func setupWindow() { + let contentView = ContentView() + window = NSWindow( + contentRect: NSRect(x: 0, y: 0, width: 800, height: 600), + styleMask: [ + .titled, + .closable, + .miniaturizable, + .resizable + ], + backing: .buffered, + defer: false + ) + + window?.center() + window?.setFrameAutosaveName("Main Window") + window?.contentView = NSHostingView(rootView: contentView) + window?.makeKeyAndOrderFront(nil) + } + + private func setupServices() { + // Initialize core services here + logger.info("Setting up core services...") + } + + private func cleanupServices() { + // Cleanup core services here + logger.info("Cleaning up core services...") + } +} diff --git a/Sources/MinimalAIChat/UI/ContentView.swift b/Sources/MinimalAIChat/UI/ContentView.swift new file mode 100644 index 0000000..44a5fbb --- /dev/null +++ b/Sources/MinimalAIChat/UI/ContentView.swift @@ -0,0 +1,51 @@ +import SwiftUI + +/// The main content view of the application. +struct ContentView: View { + // MARK: - Properties + + @State private var selectedTab: Tab = .chat + + // MARK: - Body + + var body: some View { + NavigationView { + List { + NavigationLink( + destination: ChatView(), + tag: Tab.chat, + selection: $selectedTab + ) { + Label("Chat", systemImage: "message") + } + + NavigationLink( + destination: SettingsView(), + tag: Tab.settings, + selection: $selectedTab + ) { + Label("Settings", systemImage: "gear") + } + } + .listStyle(SidebarListStyle()) + .frame(minWidth: 200) + + Text("Select a tab") + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + .frame(minWidth: 800, minHeight: 600) + } +} + +// MARK: - Tab Enum + +private enum Tab { + case chat + case settings +} + +// MARK: - Preview + +#Preview { + ContentView() +} diff --git a/Sources/MinimalAIChat/UI/Views/ChatView.swift b/Sources/MinimalAIChat/UI/Views/ChatView.swift new file mode 100644 index 0000000..12ff046 --- /dev/null +++ b/Sources/MinimalAIChat/UI/Views/ChatView.swift @@ -0,0 +1,68 @@ +import SwiftUI + +/// The main chat interface view. +struct ChatView: View { + // MARK: - Properties + + @State private var messageText = "" + + // MARK: - Body + + var body: some View { + VStack { + ScrollView { + LazyVStack(spacing: 12) { + ForEach(0 ..< 5) { _ in + MessageBubble(isUser: Bool.random()) + } + } + .padding() + } + + HStack { + TextField("Type a message...", text: $messageText) + .textFieldStyle(RoundedBorderTextFieldStyle()) + + Button(action: sendMessage) { + Image(systemName: "arrow.up.circle.fill") + .font(.title2) + } + .disabled(messageText.isEmpty) + } + .padding() + } + } + + // MARK: - Private Methods + + private func sendMessage() { + // TODO: Implement message sending + messageText = "" + } +} + +// MARK: - MessageBubble + +private struct MessageBubble: View { + let isUser: Bool + + var body: some View { + HStack { + if isUser { Spacer() } + + Text(isUser ? "User message" : "AI response") + .padding() + .background(isUser ? Color.blue : Color.gray.opacity(0.2)) + .foregroundColor(isUser ? .white : .primary) + .cornerRadius(12) + + if !isUser { Spacer() } + } + } +} + +// MARK: - Preview + +#Preview { + ChatView() +} diff --git a/Sources/MinimalAIChat/UI/Views/SettingsView.swift b/Sources/MinimalAIChat/UI/Views/SettingsView.swift new file mode 100644 index 0000000..4634b90 --- /dev/null +++ b/Sources/MinimalAIChat/UI/Views/SettingsView.swift @@ -0,0 +1,46 @@ +import SwiftUI + +/// The settings interface view. +struct SettingsView: View { + // MARK: - Properties + + @State private var apiKey = "" + @State private var selectedModel = "GPT-4" + @State private var enableLocalProcessing = false + + // MARK: - Body + + var body: some View { + Form { + Section("API Configuration") { + SecureField("API Key", text: $apiKey) + Picker("Model", selection: $selectedModel) { + Text("GPT-4").tag("GPT-4") + Text("GPT-3.5").tag("GPT-3.5") + Text("Claude").tag("Claude") + } + } + + Section("Processing") { + Toggle("Enable Local Processing", isOn: $enableLocalProcessing) + } + + Section("About") { + HStack { + Text("Version") + Spacer() + Text("1.0.0") + .foregroundColor(.secondary) + } + } + } + .padding() + .frame(maxWidth: .infinity, maxHeight: .infinity) + } +} + +// MARK: - Preview + +#Preview { + SettingsView() +} diff --git a/Sources/MinimalAIChat/main.swift b/Sources/MinimalAIChat/main.swift new file mode 100644 index 0000000..0652690 --- /dev/null +++ b/Sources/MinimalAIChat/main.swift @@ -0,0 +1,12 @@ +import Logging +import MinimalAIChatCore + +let logger = Logger(label: "com.minimalaichat.app") + +@main +struct MinimalAIChat { + static func main() { + logger.info("Starting MinimalAIChat application") + // TODO: Initialize and run the application + } +} \ No newline at end of file diff --git a/Sources/MinimalAIChatCore/Core.swift b/Sources/MinimalAIChatCore/Core.swift new file mode 100644 index 0000000..eb30c1c --- /dev/null +++ b/Sources/MinimalAIChatCore/Core.swift @@ -0,0 +1,19 @@ +import Foundation +import Logging + +/// Core module for MinimalAIChat application +public struct Core { + private let logger: Logger + + /// Initialize a new Core instance + /// - Parameter logger: The logger instance to use + public init(logger: Logger) { + self.logger = logger + } + + /// Initialize the core functionality + public func initialize() { + logger.info("Initializing MinimalAIChatCore") + // TODO: Add core initialization logic + } +} \ No newline at end of file diff --git a/Tests/Unit/CoreTests.swift b/Tests/Unit/CoreTests.swift new file mode 100644 index 0000000..2ba9a9b --- /dev/null +++ b/Tests/Unit/CoreTests.swift @@ -0,0 +1,12 @@ +import Logging +import XCTest +@testable import MinimalAIChatCore + +final class CoreTests: XCTestCase { + func testCoreInitialization() { + let logger = Logger(label: "com.minimalaichat.test") + let core = Core(logger: logger) + core.initialize() + // Add more assertions as we implement functionality + } +} \ No newline at end of file From 18d530030c3f47b96d5cb03a136bdcb65557a8aa Mon Sep 17 00:00:00 2001 From: shanthan eddula Date: Sat, 29 Mar 2025 10:21:29 -0700 Subject: [PATCH 2/6] Fix linting issues in UI views --- Sources/MinimalAIChat/UI/Views/ChatView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MinimalAIChat/UI/Views/ChatView.swift b/Sources/MinimalAIChat/UI/Views/ChatView.swift index 12ff046..effae56 100644 --- a/Sources/MinimalAIChat/UI/Views/ChatView.swift +++ b/Sources/MinimalAIChat/UI/Views/ChatView.swift @@ -12,7 +12,7 @@ struct ChatView: View { VStack { ScrollView { LazyVStack(spacing: 12) { - ForEach(0 ..< 5) { _ in + ForEach(0..<5) { _ in MessageBubble(isUser: Bool.random()) } } From e3bbabb6592e4f132b6adbf57686e93faca78d3b Mon Sep 17 00:00:00 2001 From: shanthan eddula Date: Sat, 29 Mar 2025 10:29:29 -0700 Subject: [PATCH 3/6] Update swift-log dependency version to 0.5.3 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index f8c936d..26db8df 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "0.5.0"), + .package(url: "https://github.com/apple/swift-log.git", from: "0.5.3"), .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"), ], From 7075f282d1b7db562001d664510d0743c310f5e9 Mon Sep 17 00:00:00 2001 From: shanthan eddula Date: Sat, 29 Mar 2025 10:36:36 -0700 Subject: [PATCH 4/6] Update swift-log dependency version to 0.5.2 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 26db8df..7e48618 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "0.5.3"), + .package(url: "https://github.com/apple/swift-log.git", from: "0.5.2"), .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"), ], From 92359482435fda98b132a039a42e8405b0cb0c14 Mon Sep 17 00:00:00 2001 From: shanthan eddula Date: Sat, 29 Mar 2025 11:00:40 -0700 Subject: [PATCH 5/6] Update swift-log dependency version to 0.5.4 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 7e48618..6983e86 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "0.5.2"), + .package(url: "https://github.com/apple/swift-log.git", from: "0.5.4"), .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"), ], From 379eae71f083d46ff383f54c9f0047bb65c4b516 Mon Sep 17 00:00:00 2001 From: shanthan eddula Date: Sat, 29 Mar 2025 11:07:25 -0700 Subject: [PATCH 6/6] Update swift-log dependency version to 1.0.0 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 6983e86..8177e1b 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "0.5.4"), + .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"), ],