Skip to content

Open source CapCut alternative.

TypeScript

refactor(app): remove remaining orphaned types

David Le2f18f024f7ac
diff --git a/apps/Donkey/Sources/DonkeyAI/LocalModelPriorityWorker.swift b/apps/Donkey/Sources/DonkeyAI/LocalModelPriorityWorker.swift
index fc704bba..96453747 100644
--- a/apps/Donkey/Sources/DonkeyAI/LocalModelPriorityWorker.swift
+++ b/apps/Donkey/Sources/DonkeyAI/LocalModelPriorityWorker.swift
@@ -189,7 +189,3 @@ public actor LocalModelPriorityWorker {
continuation?.resume()
}
}
-
-public enum LocalModelWorkScheduling {
- public static let shared = LocalModelPriorityWorker()
-}
diff --git a/apps/Donkey/Sources/DonkeyAI/LocalTaskFollowUpResolver.swift b/apps/Donkey/Sources/DonkeyAI/LocalTaskFollowUpResolver.swift
index 86f084c5..689a0a60 100644
--- a/apps/Donkey/Sources/DonkeyAI/LocalTaskFollowUpResolver.swift
+++ b/apps/Donkey/Sources/DonkeyAI/LocalTaskFollowUpResolver.swift
@@ -74,162 +74,6 @@ public protocol UserQueryFollowUpResolving: Sendable {
func resolveFollowUp(_ request: UserQueryFollowUpResolverRequest) async -> UserQueryFollowUpResolverResult
}
-public struct ProcessBackedLocalLLMTaskFollowUpResolver: UserQueryFollowUpResolving {
- public static let schemaID = "task_followup_resolution_v1"
-
- public var router: AIModelRouter
- public var sidecarRunner: any LocalJSONSidecarRunning
- public var encoder: JSONEncoder
- public var decoder: JSONDecoder
-
- public init(
- router: AIModelRouter = AIModelRouter(registry: .defaultHybridPlanner),
- sidecarRunner: any LocalJSONSidecarRunning = ProcessBackedLocalJSONSidecarRunner(),
- encoder: JSONEncoder = JSONEncoder(),
- decoder: JSONDecoder = JSONDecoder()
- ) {
- self.router = router
- self.sidecarRunner = sidecarRunner
- self.encoder = encoder
- self.decoder = decoder
- }
-
- public func resolveFollowUp(
- _ request: UserQueryFollowUpResolverRequest
- ) async -> UserQueryFollowUpResolverResult {
- let entry: AIModelRegistryEntry
- do {
- entry = try router.route(request.routeRequest.limitingProviders([.localRuntime]))
- } catch {
- return result(
- entry: nil,
- request: request,
- status: .invalidOutput,
- validationStatus: "routingFailed",
- latencyMS: nil,
- metadata: ["error": String(describing: error)]
- )
- }
-
- let input = LocalLLMTaskFollowUpSidecarRequest(
- command: request.text,
- candidates: request.candidates,
- sourceTraceID: request.sourceTraceID,
- modelID: entry.modelID,
- cacheDirectory: LocalModelRuntimeExecutableResolver().modelCacheDirectoryPath(
- environmentVariableName: "DONKEY_LOCAL_LLM_RUNNER"
- ),
- metadata: [
- "schemaID": Self.schemaID,
- "promptVersion": entry.promptVersion
- ]
- )
- let sidecarResult = await sidecarRunner.run(
- LocalJSONSidecarRequest(
- environmentVariableName: "DONKEY_LOCAL_LLM_RUNNER",
- inputData: (try? encoder.encode(input)) ?? Data(),
- timeoutMS: entry.timeoutMS,
- metadata: [
- "sidecar.role": "taskFollowUpResolution",
- "modelID": entry.modelID
- ]
- )
- )
-
- guard sidecarResult.status == .completed else {
- return result(
- entry: entry,
- request: request,
- status: sidecarResult.status == .timedOut ? .timeout : .providerOutage,
- validationStatus: "notValidated",
- latencyMS: sidecarResult.latencyMS,
- metadata: sidecarResult.metadata.merging([
- "sidecar.stderr": sidecarResult.stderrText
- ]) { current, _ in current }
- )
- }
-
- do {
- let response = try decoder.decode(LocalLLMTaskFollowUpSidecarResponse.self, from: sidecarResult.outputData)
- let decisionData = Data(response.outputText.utf8)
- let decision = try decoder.decode(LocalLLMTaskFollowUpDecision.self, from: decisionData)
- let validCandidateIDs = Set(request.candidates.map(\.taskID))
- let taskID = decision.isFollowUp && validCandidateIDs.contains(decision.taskID) ? decision.taskID : nil
- return UserQueryFollowUpResolverResult(
- taskID: taskID,
- confidence: min(max(decision.confidence, 0), 1),
- reason: decision.reason,
- trace: trace(
- entry: entry,
- request: request,
- status: .completed,
- validationStatus: taskID == nil ? "newTask" : "matchedTask",
- latencyMS: sidecarResult.latencyMS,
- metadata: sidecarResult.metadata.merging(response.metadata) { current, _ in current }
- )
- )
- } catch {
- return result(
- entry: entry,
- request: request,
- status: .invalidOutput,
- validationStatus: "invalid",
- latencyMS: sidecarResult.latencyMS,
- metadata: sidecarResult.metadata.merging([
- "error": String(describing: error)
- ]) { current, _ in current }
- )
- }
- }
-
- private func result(
- entry: AIModelRegistryEntry?,
- request: UserQueryFollowUpResolverRequest,
- status: AIModelCallStatus,
- validationStatus: String,
- latencyMS: Double?,
- metadata: [String: String] = [:]
- ) -> UserQueryFollowUpResolverResult {
- UserQueryFollowUpResolverResult(
- taskID: nil,
- confidence: 0,
- reason: metadata["error"] ?? metadata["reason"] ?? "",
- trace: trace(
- entry: entry,
- request: request,
- status: status,
- validationStatus: validationStatus,
- latencyMS: latencyMS,
- metadata: metadata
- )
- )
- }
-
- private func trace(
- entry: AIModelRegistryEntry?,
- request: UserQueryFollowUpResolverRequest,
- status: AIModelCallStatus,
- validationStatus: String,
- latencyMS: Double?,
- metadata: [String: String] = [:]
- ) -> AIModelCallTrace {
- AIModelCallTrace(
- id: "model-call-\(request.sourceTraceID)",
- role: entry?.role ?? .taskIntent,
- provider: entry?.provider ?? .localRuntime,
- modelID: entry?.modelID ?? "unrouted",
- promptVersion: entry?.promptVersion ?? "unrouted",
- schemaID: Self.schemaID,
- latencyMS: latencyMS,
- timeoutMS: entry?.timeoutMS ?? 0,
- status: status,
- validationStatus: validationStatus,
- sourceTraceID: request.sourceTraceID,
- metadata: metadata
- )
- }
-}
-
public struct HostedTaskFollowUpResolver: UserQueryFollowUpResolving {
public static let schemaID = "task_followup_resolution_v1"
@@ -513,20 +357,6 @@ public struct HostedTaskFollowUpResolver: UserQueryFollowUpResolving {
}
}
-private struct LocalLLMTaskFollowUpSidecarRequest: Codable, Equatable, Sendable {
- var command: String
- var candidates: [UserQueryFollowUpCandidate]
- var sourceTraceID: String
- var modelID: String
- var cacheDirectory: String?
- var metadata: [String: String]
-}
-
-private struct LocalLLMTaskFollowUpSidecarResponse: Codable, Equatable, Sendable {
- var outputText: String
- var metadata: [String: String]
-}
-
private struct LocalLLMTaskFollowUpDecision: Codable, Equatable, Sendable {
var isFollowUp: Bool
var taskID: String
diff --git a/apps/Donkey/Sources/DonkeyAI/PointerCoachCursorGuideResolver.swift b/apps/Donkey/Sources/DonkeyAI/PointerCoachCursorGuideResolver.swift
index 8bfa998d..3cf7b37d 100644
--- a/apps/Donkey/Sources/DonkeyAI/PointerCoachCursorGuideResolver.swift
+++ b/apps/Donkey/Sources/DonkeyAI/PointerCoachCursorGuideResolver.swift
@@ -311,41 +311,6 @@ public struct ProcessBackedLocalLLMAgentVisualizationPlanResolver: AgentVisualiz
}
}
-public struct DisabledAgentVisualizationPlanResolver: AgentVisualizationPlanResolving {
- public static let schemaID = "agent_visualization_disabled"
-
- public var reason: String
-
- public init(reason: String = "hostedVisualizationResolverNotConfigured") {
- self.reason = reason
- }
-
- public func resolveVisualizationPlan(
- _ request: AgentVisualizationPlanResolverRequest
- ) async -> AgentVisualizationPlanResolverResult {
- AgentVisualizationPlanResolverResult(
- visualizationPlan: nil,
- cursorRequest: nil,
- confidence: 0,
- reason: reason,
- trace: AIModelCallTrace(
- id: "model-call-\(request.sourceTraceID)",
- role: .taskIntent,
- provider: .donkeyBackend,
- modelID: "disabled",
- promptVersion: "disabled",
- schemaID: Self.schemaID,
- latencyMS: nil,
- timeoutMS: 0,
- status: .completed,
- validationStatus: "disabled",
- sourceTraceID: request.sourceTraceID,
- metadata: ["reason": reason]
- )
- )
- }
-}
-
private struct LocalLLMAgentVisualizationPlanSidecarRequest: Codable, Equatable, Sendable {
var command: String
var runtimeCapabilities: [String]
diff --git a/apps/Donkey/Sources/DonkeyAI/RemoteScreenshotParsingUIUnderstandingAdapter.swift b/apps/Donkey/Sources/DonkeyAI/RemoteScreenshotParsingUIUnderstandingAdapter.swift
index 0e98b43e..bd59b973 100644
--- a/apps/Donkey/Sources/DonkeyAI/RemoteScreenshotParsingUIUnderstandingAdapter.swift
+++ b/apps/Donkey/Sources/DonkeyAI/RemoteScreenshotParsingUIUnderstandingAdapter.swift
@@ -289,23 +289,3 @@ public struct RemoteFallbackLocalUIUnderstandingAdapter: LocalUIUnderstandingRun
SHA256.hash(data: data).map { String(format: "%02x", $0) }.joined()
}
}
-
-public enum DonkeyUIUnderstandingRunnerFactory {
- public static func defaultRunner(
- environment: [String: String] = ProcessInfo.processInfo.environment,
- bundle: Bundle = .main
- ) -> any LocalUIUnderstandingRunning {
- guard let configuration = try? DonkeyBackendInferenceConfiguration.fromEnvironment(
- environment,
- bundle: bundle
- ) else {
- return ProcessBackedLocalUIUnderstandingAdapter()
- }
-
- return RemoteFallbackLocalUIUnderstandingAdapter(
- remote: RemoteScreenshotParsingLocalUIUnderstandingAdapter(
- client: DonkeyBackendInferenceClient(configuration: configuration)
- )
- )
- }
-}
diff --git a/apps/Donkey/Sources/DonkeyContracts/AppHarnessContracts.swift b/apps/Donkey/Sources/DonkeyContracts/AppHarnessContracts.swift
index 08c3fbd6..ae4b8cbe 100644
--- a/apps/Donkey/Sources/DonkeyContracts/AppHarnessContracts.swift
+++ b/apps/Donkey/Sources/DonkeyContracts/AppHarnessContracts.swift
@@ -100,70 +100,3 @@ public struct AppHarnessTurn: Codable, Equatable, Sendable {
self.createdAt = createdAt
}
}
-
-public struct AppHarnessContextEvent: Codable, Equatable, Sendable {
- public var role: UserQueryTaskEventRole
- public var text: String
- public var sequence: Int
-
- public init(role: UserQueryTaskEventRole, text: String, sequence: Int) {
- self.role = role
- self.text = text
- self.sequence = sequence
- }
-}
-
-public struct AppHarnessContextAsset: Codable, Equatable, Sendable {
- public var displayName: String
- public var contentType: String
- public var byteCount: Int64?
-
- public init(displayName: String, contentType: String, byteCount: Int64? = nil) {
- self.displayName = displayName
- self.contentType = contentType
- self.byteCount = byteCount
- }
-}
-
-public struct AppHarnessContextPacket: Codable, Equatable, Sendable {
- public var traceID: String
- public var currentTurn: AppHarnessTurn
- public var recentEvents: [AppHarnessContextEvent]
- public var assets: [AppHarnessContextAsset]
- public var runtimeCapabilities: [String]
- public var targetState: [String: String]
- public var memory: [String]
- public var policy: [String: String]
- public var promptText: String
- public var redactionCount: Int
- public var compactionRecords: [AppHarnessContextCompactionRecord]
- public var metadata: [String: String]
-
- public init(
- traceID: String,
- currentTurn: AppHarnessTurn,
- recentEvents: [AppHarnessContextEvent] = [],
- assets: [AppHarnessContextAsset] = [],
- runtimeCapabilities: [String] = [],
- targetState: [String: String] = [:],
- memory: [String] = [],
- policy: [String: String] = [:],
- promptText: String,
- redactionCount: Int = 0,
- compactionRecords: [AppHarnessContextCompactionRecord] = [],
- metadata: [String: String] = [:]
- ) {
- self.traceID = traceID
- self.currentTurn = currentTurn
- self.recentEvents = recentEvents
- self.assets = assets
- self.runtimeCapabilities = runtimeCapabilities
- self.targetState = targetState
- self.memory = memory
- self.policy = policy
- self.promptText = promptText
- self.redactionCount = redactionCount
- self.compactionRecords = compactionRecords
- self.metadata = metadata
- }
-}
diff --git a/apps/Donkey/Sources/DonkeyContracts/TaskIntentContracts.swift b/apps/Donkey/Sources/DonkeyContracts/TaskIntentContracts.swift
index 2b31d7ca..7128b0ee 100644
--- a/apps/Donkey/Sources/DonkeyContracts/TaskIntentContracts.swift
+++ b/apps/Donkey/Sources/DonkeyContracts/TaskIntentContracts.swift
@@ -76,62 +76,6 @@ public struct LocalAppFinderCatalogEntry: Codable, Equatable, Sendable {
}
}
-public enum LocalAppTaskWorkflowStage: String, Codable, CaseIterable, Equatable, Sendable {
- case parseIntent
- case resolveApp
- case observe
- case evidencePlan = "evidence-plan"
- case approval
- case execute
- case verify
-}
-
-public enum LocalAppTaskWorkflowStageStatus: String, Codable, Equatable, Sendable {
- case pending
- case started
- case completed
- case waiting
- case skipped
- case blocked
- case failed
-}
-
-public struct LocalAppTaskWorkflowStageState: Codable, Equatable, Sendable {
- public var stage: LocalAppTaskWorkflowStage
- public var status: LocalAppTaskWorkflowStageStatus
- public var summary: String
- public var metadata: [String: String]
-
- public init(
- stage: LocalAppTaskWorkflowStage,
- status: LocalAppTaskWorkflowStageStatus = .pending,
- summary: String = "",
- metadata: [String: String] = [:]
- ) {
- self.stage = stage
- self.status = status
- self.summary = summary
- self.metadata = metadata
- }
-}
-
-public struct LocalAppTaskWorkflowProgress: Codable, Equatable, Sendable {
- public var stages: [LocalAppTaskWorkflowStageState]
- public var metadata: [String: String]
-
- public init(
- stages: [LocalAppTaskWorkflowStageState] = [],
- metadata: [String: String] = [:]
- ) {
- self.stages = stages
- self.metadata = metadata
- }
-
- public func state(for stage: LocalAppTaskWorkflowStage) -> LocalAppTaskWorkflowStageState? {
- stages.first { $0.stage == stage }
- }
-}
-
public struct LocalAppTaskObservation: Codable, Equatable, Sendable {
public var appIsRunning: Bool
public var appIsFocused: Bool
diff --git a/apps/Donkey/Sources/DonkeyHarness/GenericHarnessContracts.swift b/apps/Donkey/Sources/DonkeyHarness/GenericHarnessContracts.swift
index 2997bc3d..f6ada002 100644
--- a/apps/Donkey/Sources/DonkeyHarness/GenericHarnessContracts.swift
+++ b/apps/Donkey/Sources/DonkeyHarness/GenericHarnessContracts.swift
@@ -31,17 +31,6 @@ public enum HarnessTaskStatus: String, Codable, CaseIterable, Equatable, Sendabl
}
}
-public enum HarnessTurnRelationship: String, Codable, Equatable, Sendable {
- case startsNewTask
- case modifiesCurrentTask
- case cancelsTask
- case pausesTask
- case resumesTask
- case answersClarification
- case grantsPermission
- case conversation
-}
-
public enum HarnessAmbiguityClass: String, Codable, Equatable, Sendable {
case safe
case recoverable
diff --git a/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskContext.swift b/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskContext.swift
index 2a8b7a0e..9e12fe35 100644
--- a/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskContext.swift
+++ b/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskContext.swift
@@ -1,6 +1,3 @@
-@preconcurrency import ApplicationServices
-import AppKit
-import DonkeyContracts
import Foundation
public struct LocalDocumentFormField: Codable, Equatable, Sendable {
@@ -24,139 +21,3 @@ public struct LocalDocumentFormField: Codable, Equatable, Sendable {
self.metadata = metadata
}
}
-
-public struct LocalAppTaskContext: Equatable, Sendable {
- public var focusedAppName: String?
- public var focusedBundleIdentifier: String?
- public var focusedWindowTitle: String?
- public var focusedWindowID: UInt32?
- public var clipboardText: String?
- public var attachedFileURLs: [URL]
- public var structuredData: [String: String]
- public var observedFormFields: [LocalDocumentFormField]
- public var metadata: [String: String]
-
- public init(
- focusedAppName: String? = nil,
- focusedBundleIdentifier: String? = nil,
- focusedWindowTitle: String? = nil,
- focusedWindowID: UInt32? = nil,
- clipboardText: String? = nil,
- attachedFileURLs: [URL] = [],
- structuredData: [String: String] = [:],
- observedFormFields: [LocalDocumentFormField] = [],
- metadata: [String: String] = [:]
- ) {
- self.focusedAppName = focusedAppName
- self.focusedBundleIdentifier = focusedBundleIdentifier
- self.focusedWindowTitle = focusedWindowTitle
- self.focusedWindowID = focusedWindowID
- self.clipboardText = clipboardText
- self.attachedFileURLs = attachedFileURLs
- self.structuredData = structuredData
- self.observedFormFields = observedFormFields
- self.metadata = metadata
- }
-}
-
-public protocol LocalAppTaskContextProviding: Sendable {
- @MainActor
- func snapshot() -> LocalAppTaskContext
-}
-
-public struct StaticLocalAppTaskContextProvider: LocalAppTaskContextProviding {
- public var context: LocalAppTaskContext
-
- public init(context: LocalAppTaskContext) {
- self.context = context
- }
-
- @MainActor
- public func snapshot() -> LocalAppTaskContext {
- context
- }
-}
-
-public struct MacLocalAppTaskContextProvider: LocalAppTaskContextProviding {
- public init() {}
-
- @MainActor
- public func snapshot() -> LocalAppTaskContext {
- let focusedWindow = try? MacWindowResolver().selectTarget()
- let clipboardText = NSPasteboard.general.string(forType: .string)
- let structuredData = Self.structuredData(from: clipboardText)
- let observedFormFields = Self.observedFormFields(from: focusedWindow)
-
- return LocalAppTaskContext(
- focusedAppName: focusedWindow?.appName,
- focusedBundleIdentifier: focusedWindow?.bundleIdentifier,
- focusedWindowTitle: focusedWindow?.title,
- focusedWindowID: focusedWindow?.windowID,
- clipboardText: clipboardText,
- structuredData: structuredData,
- observedFormFields: observedFormFields,
- metadata: [
- "provider": "mac-local-app-task-context",
- "clipboard.hasText": String(clipboardText?.isEmpty == false),
- "focusedWindow.resolved": String(focusedWindow != nil),
- "observedFormFieldCount": String(observedFormFields.count)
- ]
- )
- }
-
- @MainActor
- private static func observedFormFields(
- from focusedWindow: MacWindowTargetCandidate?
- ) -> [LocalDocumentFormField] {
- guard let focusedWindow,
- AXIsProcessTrusted()
- else {
- return []
- }
-
- let capturer = ApplicationServicesMacAccessibilitySnapshotCapturer()
- guard let tree = try? capturer.captureTree(
- target: focusedWindow,
- limits: MacAccessibilitySnapshotLimits(maxDepth: 6, maxChildrenPerNode: 80, maxTotalNodes: 500)
- ) else {
- return []
- }
-
- let snapshot = MacAccessibilitySnapshot(
- target: focusedWindow,
- limits: MacAccessibilitySnapshotLimits(maxDepth: 6, maxChildrenPerNode: 80, maxTotalNodes: 500),
- root: tree.root,
- totalNodeCount: tree.totalNodeCount,
- isTreeTruncated: tree.isTreeTruncated
- )
- return LocalAppAccessibilityControlDiscovery().observedFormFields(in: snapshot)
- }
-
- private static func structuredData(from text: String?) -> [String: String] {
- guard let text, !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else {
- return [:]
- }
-
- if let jsonData = text.data(using: .utf8),
- let object = try? JSONSerialization.jsonObject(with: jsonData) as? [String: Any] {
- return object.reduce(into: [:]) { result, item in
- if let value = item.value as? String {
- result[item.key] = value
- } else if let value = item.value as? NSNumber {
- result[item.key] = value.stringValue
- }
- }
- }
-
- return text
- .split(whereSeparator: \.isNewline)
- .reduce(into: [:]) { result, line in
- let parts = line.split(separator: ":", maxSplits: 1)
- guard parts.count == 2 else { return }
- let key = parts[0].trimmingCharacters(in: .whitespacesAndNewlines)
- let value = parts[1].trimmingCharacters(in: .whitespacesAndNewlines)
- guard !key.isEmpty, !value.isEmpty else { return }
- result[key] = value
- }
- }
-}
diff --git a/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskStepTracker.swift b/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskStepTracker.swift
deleted file mode 100644
index 78dc5779..00000000
--- a/apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskStepTracker.swift
+++ /dev/null
@@ -1,114 +0,0 @@
-import DonkeyContracts
-import Foundation
-
-public struct LocalAppTaskStepTracker: Sendable {
- private var states: [LocalAppTaskWorkflowStage: LocalAppTaskWorkflowStageState]
- private var metadata: [String: String]
-
- public init(metadata: [String: String] = [:]) {
- self.metadata = metadata
- self.states = Dictionary(
- uniqueKeysWithValues: LocalAppTaskWorkflowStage.allCases.map { stage in
- (
- stage,
- LocalAppTaskWorkflowStageState(
- stage: stage,
- status: .pending,
- summary: Self.defaultSummary(for: stage)
- )
- )
- }
- )
- }
-
- public mutating func start(
- _ stage: LocalAppTaskWorkflowStage,
- summary: String? = nil,
- metadata: [String: String] = [:]
- ) {
- update(stage, status: .started, summary: summary, metadata: metadata)
- }
-
- public mutating func complete(
- _ stage: LocalAppTaskWorkflowStage,
- summary: String? = nil,
- metadata: [String: String] = [:]
- ) {
- update(stage, status: .completed, summary: summary, metadata: metadata)
- }
-
- public mutating func wait(
- _ stage: LocalAppTaskWorkflowStage,
- summary: String? = nil,
- metadata: [String: String] = [:]
- ) {
- update(stage, status: .waiting, summary: summary, metadata: metadata)
- }
-
- public mutating func skip(
- _ stage: LocalAppTaskWorkflowStage,
- summary: String? = nil,
- metadata: [String: String] = [:]
- ) {
- update(stage, status: .skipped, summary: summary, metadata: metadata)
- }
-
- public mutating func block(
- _ stage: LocalAppTaskWorkflowStage,
- summary: String? = nil,
- metadata: [String: String] = [:]
- ) {
- update(stage, status: .blocked, summary: summary, metadata: metadata)
- }
-
- public mutating func fail(
- _ stage: LocalAppTaskWorkflowStage,
- summary: String? = nil,
- metadata: [String: String] = [:]
- ) {
- update(stage, status: .failed, summary: summary, metadata: metadata)
- }
-
- public mutating func mergeMetadata(_ values: [String: String]) {
- metadata.merge(values) { current, _ in current }
- }
-
- public func snapshot(metadata extraMetadata: [String: String] = [:]) -> LocalAppTaskWorkflowProgress {
- LocalAppTaskWorkflowProgress(
- stages: LocalAppTaskWorkflowStage.allCases.compactMap { states[$0] },
- metadata: metadata.merging(extraMetadata) { current, _ in current }
- )
- }
-
- private mutating func update(
- _ stage: LocalAppTaskWorkflowStage,
- status: LocalAppTaskWorkflowStageStatus,
- summary: String?,
- metadata newMetadata: [String: String]
- ) {
- var state = states[stage] ?? LocalAppTaskWorkflowStageState(stage: stage)
- state.status = status
- state.summary = summary ?? state.summary
- state.metadata.merge(newMetadata) { current, _ in current }
- states[stage] = state
- }
-
- private static func defaultSummary(for stage: LocalAppTaskWorkflowStage) -> String {
- switch stage {
- case .parseIntent:
- return "Parse task intent"
- case .resolveApp:
- return "Resolve task and target app"
- case .observe:
- return "Observe target app state"
- case .evidencePlan:
- return "Build evidence-backed action plan"
- case .approval:
- return "Check user review or approval boundary"
- case .execute:
- return "Execute guarded local-app actions"
- case .verify:
- return "Verify local-app task result"
- }
- }
-}
diff --git a/apps/Donkey/Sources/DonkeyRuntime/OffTheShelfRunLoopBoundary.swift b/apps/Donkey/Sources/DonkeyRuntime/OffTheShelfRunLoopBoundary.swift
deleted file mode 100644
index 0e738537..00000000
--- a/apps/Donkey/Sources/DonkeyRuntime/OffTheShelfRunLoopBoundary.swift
+++ /dev/null
@@ -1,24 +0,0 @@
-import DonkeyContracts
-import Foundation
-
-public protocol RuntimeStatusProviding: Sendable {
- func snapshot() -> RuntimeStatusSnapshot
-}
-
-public struct OffTheShelfRunLoopBoundary: RuntimeStatusProviding {
- public init() {}
-
- public func snapshot() -> RuntimeStatusSnapshot {
- RuntimeStatusSnapshot(
- isReady: false,
- summary: "Run coordinator ready to create sessions",
- lifecycleState: .idle
- )
- }
-
- public func makeCoordinator(
- contextAssembler: RunContextAssembler = RunContextAssembler()
- ) -> RunCoordinator {
- RunCoordinator(contextAssembler: contextAssembler)
- }
-}
diff --git a/apps/Donkey/Sources/DonkeyRuntime/ReflexLatencyReport.swift b/apps/Donkey/Sources/DonkeyRuntime/ReflexLatencyReport.swift
index d66820bc..41b9fcd9 100644
--- a/apps/Donkey/Sources/DonkeyRuntime/ReflexLatencyReport.swift
+++ b/apps/Donkey/Sources/DonkeyRuntime/ReflexLatencyReport.swift
@@ -95,22 +95,6 @@ public struct ReflexLatencyReport: Codable, Equatable, Sendable {
}
}
-public struct ReflexBenchmarkBaseline: Codable, Equatable, Sendable {
- public var targetID: String
- public var machineClass: String
- public var report: ReflexLatencyReport
-
- public init(
- targetID: String,
- machineClass: String,
- report: ReflexLatencyReport
- ) {
- self.targetID = targetID
- self.machineClass = machineClass
- self.report = report
- }
-}
-
public enum ReflexLatencyReportBuilder {
public static func build(
from traces: [ReflexTraceRecord],