Phase 0: Module Foundation
Related Issue: #199 - Enable Remote Debugging
Timeline: Week 1
Priority: Critical (Foundational)
Packages Modified: bushelkit, bushelapp
POC Focus: Create protocol modules and establish dependencies
Overview
Establish the foundational module structure and shared protocol definitions required by all subsequent phases. This phase creates the BushelHarvestProtocol module in BushelKit (shared between host and guest) and sets up the host-side module skeleton in BushelApp.
Goals
Dependencies
Requires: None (foundational phase)
Blocks:
Implementation Tasks
BushelKit - Shared Protocol Module
BushelApp - Host-Side Modules
HarvestBinKit - Guest-Side Dependencies
Package Generation
Integration
Success Criteria
Technical Details
Module Dependency Graph
BushelMachineViews (includes Harvest UI)
└── BushelHarvestHost
├── BushelHarvestHostCore
│ ├── BushelHarvestProtocol (BushelKit - shared)
│ ├── BushelGuestProfile (BushelKit)
│ └── BushelMachine (BushelKit)
└── BushelServiceClient
HarvestBinKit (guest-side)
└── BushelHarvestProtocol (BushelKit - shared)
PackageDSL Target Definition Example
// Packages/BushelApp/Package/Sources/Targets/BushelHarvestHostCore.swift
struct BushelHarvestHostCore: Target {
var dependencies: any Dependencies {
BushelFoundation()
BushelLogging()
BushelHarvestProtocol() // From BushelKit
BushelGuestProfile()
BushelMachine()
}
}
BushelHarvestProtocol Example Structure
// CommandProtocol.swift
public protocol HarvestCommand: Codable, Sendable {
var action: String { get }
var category: CommandCategory { get }
var payload: [String: Any] { get }
}
public enum CommandCategory: String, Codable, Sendable {
case system
case file
case network
case clipboard
case remote
}
Testing
References
Notes
- This phase establishes the foundation for all Harvest functionality
- No actual functionality is implemented, only structure
- Protocol definitions should be minimal and can be expanded in later phases
- Focus on getting the module structure correct before adding implementation
- Ensure shared protocol is truly shared (both host and guest use same definitions)
Related Issues:
- Main implementation: brightdigit/Bushel#285
Phase 0: Module Foundation
Related Issue: #199 - Enable Remote Debugging
Timeline: Week 1
Priority: Critical (Foundational)
Packages Modified:
bushelkit,bushelappPOC Focus: Create protocol modules and establish dependencies
Overview
Establish the foundational module structure and shared protocol definitions required by all subsequent phases. This phase creates the BushelHarvestProtocol module in BushelKit (shared between host and guest) and sets up the host-side module skeleton in BushelApp.
Goals
Dependencies
Requires: None (foundational phase)
Blocks:
Implementation Tasks
BushelKit - Shared Protocol Module
Create
BushelHarvestProtocoltarget in BushelKitPackages/BushelKit/Sources/BushelHarvestProtocol/BushelFoundation,BushelLoggingImplement protocol files:
CommandProtocol.swift- Message format and command type definitionsMessageTypes.swift- Request/response/event message structuresSecurityTypes.swift- Authentication and authorization typesHarvestCommand.swift- Command definitions and payload structuresExport BushelHarvestProtocol as BushelKit product
Packages/BushelKit/Package.swift.library(name: "BushelHarvestProtocol", targets: ["BushelHarvestProtocol"])BushelApp - Host-Side Modules
Create
BushelHarvestHostCoretarget using PackageDSLPackages/BushelApp/Package/Sources/Targets/BushelHarvestHostCore.swiftBushelFoundation,BushelLogging,BushelHarvestProtocol(from BushelKit),BushelGuestProfile,BushelMachineCreate
BushelHarvestHosttarget using PackageDSLPackages/BushelApp/Package/Sources/Targets/BushelHarvestHost.swiftBushelFoundation,BushelLogging,BushelHarvestProtocol(from BushelKit),BushelHarvestHostCore,BushelMachine,BushelServiceClientUpdate
BushelMachineViewstarget to depend onBushelHarvestHostPackages/BushelApp/Package/Sources/Targets/BushelMachineViews.swiftBushelHarvestHost()Create source directories:
Packages/BushelApp/Sources/BushelHarvestHostCore/Packages/BushelApp/Sources/BushelHarvestHost/Create placeholder files to verify structure:
BushelHarvestHostCore/VMDiscoveryService.swift(empty protocol)BushelHarvestHostCore/HarvestConnectionManager.swift(empty protocol)BushelHarvestHostCore/HarvestAuthenticationService.swift(empty protocol)BushelHarvestHost/HarvestManager.swift(empty protocol)BushelHarvestHost/CommandDispatcher.swift(empty protocol)BushelHarvestHost/HarvestCommandService.swift(empty protocol)HarvestBinKit - Guest-Side Dependencies
HarvestBinKitPackage.swift to depend on BushelHarvestProtocolPackages/HarvestBin/Packages/HarvestBinKit/Package.swift.package(path: "../../../../BushelKit").product(name: "BushelHarvestProtocol", package: "BushelKit")Package Generation
Regenerate BushelApp Package.swift
make generate-packagesRegenerate Xcode project
make xcodeprojectIntegration
Integrate modules into BushelApp product
BushelHarvestHostis accessible toBushelMachineViewsVerify build succeeds
BushelAppscheme in XcodeSuccess Criteria
Technical Details
Module Dependency Graph
PackageDSL Target Definition Example
BushelHarvestProtocol Example Structure
Testing
References
Notes
Related Issues: