native macOS codings agent orchestrator prowl.onev.cat
Something went wrong. Try again.
717 B · 19 lines
Swift
1234567891011121314151617181920// supacode/CLIService/CommandHandlerProtocol.swift// Protocol for command handlers on the app side.
import Foundation
/// Each CLI command has a corresponding handler that executes/// within the app's process context.protocol CommandHandler { /// Execute the command and return a structured response. func handle(envelope: CommandEnvelope) async -> CommandResponse /// Context-aware variant; handlers that need caller identity override this. func handle(envelope: CommandEnvelope, context: CLICommandContext) async -> CommandResponse}
extension CommandHandler { func handle(envelope: CommandEnvelope, context: CLICommandContext) async -> CommandResponse { await handle(envelope: envelope) }}