Open source CapCut alternative.
TypeScript
Donkey app: call /api/vision for hosted vision parse
David Le3f4c81ff9e08
diff --git a/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swift b/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swiftindex 193257a0..7b5b9713 100644--- a/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swift+++ b/apps/Donkey/Sources/Donkey/LocalUIElementDetection/DebugUIInspectionCoordinator.swift@@ -15,7 +15,7 @@ private enum DebugUIInspectionLog {}/// Which hosted backend supplies the "AI" evidence rendered on the overlay.-/// `vision` is the active path (RunPod OmniParser V2 via /api/inference/vision).+/// `vision` is the active path (RunPod OmniParser V2 via /api/vision)./// `screenshotParse` is the older streaming parser, kept compiled but disabled.private enum RemoteAIEngine {case visiondiff --git a/apps/Donkey/Sources/DonkeyAI/DonkeyBackendInferenceClient.swift b/apps/Donkey/Sources/DonkeyAI/DonkeyBackendInferenceClient.swiftindex 2f61e4a9..949667c8 100644--- a/apps/Donkey/Sources/DonkeyAI/DonkeyBackendInferenceClient.swift+++ b/apps/Donkey/Sources/DonkeyAI/DonkeyBackendInferenceClient.swift@@ -278,7 +278,7 @@ public struct DonkeyBackendInferenceClient: @unchecked Sendable {imageData: Data,options: RemoteVisionParseOptions? = nil) async throws -> RemoteVisionParseResponse {- var request = makeRequest(path: "/api/inference/vision")+ var request = makeRequest(path: "/api/vision")request.httpMethod = "POST"// OmniParser on a cold/slow RunPod worker can take ~60s, which sits right// on URLSession's default 60s request timeout. Give the parse room to landdiff --git a/apps/Donkey/Sources/DonkeyAI/RemoteVisionParse.swift b/apps/Donkey/Sources/DonkeyAI/RemoteVisionParse.swiftindex a1502670..8bae1a70 100644--- a/apps/Donkey/Sources/DonkeyAI/RemoteVisionParse.swift+++ b/apps/Donkey/Sources/DonkeyAI/RemoteVisionParse.swift@@ -1,6 +1,6 @@import Foundation-// Wire models for the hosted vision endpoint (POST /api/inference/vision), which+// Wire models for the hosted vision endpoint (POST /api/vision), which// fronts the RunPod OmniParser V2 worker. Coordinates in the response are pixels// relative to the uploaded image, origin top-left. See the contract in// site/src/lib/inference/vision/schema.ts.diff --git a/apps/Donkey/Sources/DonkeyRuntime/ParsedVisionStore.swift b/apps/Donkey/Sources/DonkeyRuntime/ParsedVisionStore.swiftindex b6c45c4f..824157aa 100644--- a/apps/Donkey/Sources/DonkeyRuntime/ParsedVisionStore.swift+++ b/apps/Donkey/Sources/DonkeyRuntime/ParsedVisionStore.swift@@ -2,7 +2,7 @@ import DonkeyContractsimport Foundation/// Process-wide cache of the most recent vision parse per app, so a typed command can reuse the-/// elements that were already detected instead of paying for another `/api/inference/vision` parse+/// elements that were already detected instead of paying for another `/api/vision` parse/// on every turn. Keyed by a stable app key (bundle identifier, falling back to app name).////// Reuse is gated by `ScreenshotSignature`: a fresh capture is fingerprinted and compared to the