Open source CapCut alternative.
TypeScript
Remove local model install path
David Lee6b0371959e7
diff --git a/apps/Donkey/Sources/DonkeyRuntime/LocalModelRuntimeSetup.swift b/apps/Donkey/Sources/DonkeyRuntime/LocalModelRuntimeSetup.swiftindex c0b71ce6..030c9a4b 100644--- a/apps/Donkey/Sources/DonkeyRuntime/LocalModelRuntimeSetup.swift+++ b/apps/Donkey/Sources/DonkeyRuntime/LocalModelRuntimeSetup.swift@@ -417,71 +417,7 @@ public struct LocalModelRuntimeSetupManager: Sendable {self.requiresCryptographicManifestSignatures = requiresCryptographicManifestSignatures}- public static let defaultSpecs: [LocalModelRuntimeSpec] = [- LocalModelRuntimeSpec(- id: .parakeetTranscriber,- displayName: "Parakeet voice transcription",- environmentVariableName: "DONKEY_PARAKEET_TRANSCRIBER",- expectedExecutableRelativePath: "bin/donkey-parakeet-transcriber",- modelName: "nvidia/parakeet-tdt-0.6b-v3",- downloadPageURL: URL(string: "https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3"),- manifestURL: Self.defaultPackageManifestURL(for: .parakeetTranscriber),- installSteps: [- "Click Set Up in Donkey after installing the app.",- "Donkey downloads and verifies the compatible Parakeet runtime package.",- "Donkey records bin/donkey-parakeet-transcriber in Application Support."- ],- metadata: ["sidecar.role": "voiceTranscription"]- ),- LocalModelRuntimeSpec(- id: .yoloSegmenter,- displayName: "YOLO26 screenshot segmentation",- environmentVariableName: "DONKEY_YOLO_SEGMENTER",- expectedExecutableRelativePath: "bin/donkey-yolo-segmenter",- modelName: "ultralytics/yolo26n-seg",- downloadPageURL: URL(string: "https://docs.ultralytics.com/models/yolo26/"),- manifestURL: Self.defaultPackageManifestURL(for: .yoloSegmenter),- installSteps: [- "Click Set Up in Donkey after installing the app.",- "Donkey downloads and verifies the compatible YOLO26 segmentation runtime package.",- "Donkey records bin/donkey-yolo-segmenter in Application Support."- ],- metadata: ["sidecar.role": "screenshotSegmentation"]- ),- LocalModelRuntimeSpec(- id: .uiUnderstander,- displayName: "Local UI understanding",- environmentVariableName: "DONKEY_UI_UNDERSTANDER",- expectedExecutableRelativePath: "bin/donkey-ui-understander",- modelName: "apple-vision-text-recognition",- downloadPageURL: nil,- manifestURL: Self.defaultPackageManifestURL(for: .uiUnderstander),- installSteps: [- "Click Set Up in Donkey after installing the app.",- "Donkey downloads and verifies the compatible UI-understanding runtime package.",- "Donkey records bin/donkey-ui-understander in Application Support."- ],- metadata: ["sidecar.role": "uiUnderstanding"]- ),- LocalModelRuntimeSpec(- id: .localLLM,- displayName: "Local command parser LLM",- environmentVariableName: "DONKEY_LOCAL_LLM_RUNNER",- expectedExecutableRelativePath: "bin/donkey-local-llm",- modelName: "qwen2.5-0.5b-instruct-q4_k_m",- downloadPageURL: nil,- manifestURL: Self.defaultPackageManifestURL(for: .localLLM),- installSteps: [- "Click Set Up in Donkey after installing the app.",- "Donkey downloads and verifies the configured local command-parser model weights.",- "Donkey records bin/donkey-local-llm in Application Support."- ],- metadata: [- "sidecar.role": "localLLM",- "modelWeights.provider": "donkey-managed-download"- ]- )- ]+ public static let defaultSpecs: [LocalModelRuntimeSpec] = []public static func defaultBaseDirectory() throws -> URL {try FileManager.defaultdiff --git a/apps/Donkey/Tests/DonkeyRuntimeTests/LocalModelRuntimeSetupTests.swift b/apps/Donkey/Tests/DonkeyRuntimeTests/LocalModelRuntimeSetupTests.swiftindex 55c906ed..622b5812 100644--- a/apps/Donkey/Tests/DonkeyRuntimeTests/LocalModelRuntimeSetupTests.swift+++ b/apps/Donkey/Tests/DonkeyRuntimeTests/LocalModelRuntimeSetupTests.swift@@ -6,21 +6,14 @@ import Testing@Suitestruct LocalModelRuntimeSetupTests {@Test- func setupInstructionsDescribeDownloadThenAppRegistration() throws {+ func setupInstructionsAreEmptyWhenHostedModelsAreDefault() throws {let root = temporaryDirectory()defer { try? FileManager.default.removeItem(at: root) }let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)let instructions = manager.instructions()- #expect(instructions.count == 4)- #expect(instructions.map(\.spec.id).contains(.parakeetTranscriber))- #expect(instructions.map(\.spec.id).contains(.localLLM))- #expect(instructions.first { $0.spec.id == .parakeetTranscriber }?.spec.environmentVariableName == "DONKEY_PARAKEET_TRANSCRIBER")- #expect(instructions.first { $0.spec.id == .yoloSegmenter }?.spec.environmentVariableName == "DONKEY_YOLO_SEGMENTER")- #expect(instructions.first { $0.spec.id == .uiUnderstander }?.spec.environmentVariableName == "DONKEY_UI_UNDERSTANDER")- #expect(instructions.first { $0.spec.id == .localLLM }?.spec.environmentVariableName == "DONKEY_LOCAL_LLM_RUNNER")- #expect(instructions.first?.spec.installSteps.first?.contains("Set Up") == true)+ #expect(instructions.isEmpty)}@Test@@ -35,7 +28,7 @@ struct LocalModelRuntimeSetupTests {root: download,relativePath: "bin/donkey-yolo-segmenter")- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)let installation = try manager.registerDownloadedRuntime(runtimeID: .yoloSegmenter,@@ -58,7 +51,7 @@ struct LocalModelRuntimeSetupTests {try? FileManager.default.removeItem(at: root)try? FileManager.default.removeItem(at: download)}- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)#expect(throws: LocalModelRuntimeSetupError.missingDownloadedExecutable(runtimeID: .parakeetTranscriber,@@ -95,14 +88,14 @@ struct LocalModelRuntimeSetupTests {try? FileManager.default.removeItem(at: download)}let executableURL = URL(fileURLWithPath: "/bin/cat")- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)try manager.registerExecutable(runtimeID: .parakeetTranscriber,executableURL: executableURL,downloadedDirectory: download)let resolver = LocalModelRuntimeExecutableResolver {- try LocalModelRuntimeSetupManager(baseDirectory: root)+ try runtimeManager(baseDirectory: root)}let runner = ProcessBackedLocalJSONSidecarRunner(environment: [:],@@ -151,7 +144,7 @@ struct LocalModelRuntimeSetupTests {signature: "signed-for-test",signingKeyID: "test-key")- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)let result = try await manager.downloadAndInstall(manifest: manifest,@@ -194,7 +187,7 @@ struct LocalModelRuntimeSetupTests {)let payload = try LocalModelRuntimeSetupManager.signaturePayloadData(for: manifest)manifest.signature = try privateKey.signature(for: payload).base64EncodedString()- let manager = try LocalModelRuntimeSetupManager(+ let manager = try runtimeManager(baseDirectory: root,trustedManifestSigningKeys: [LocalModelRuntimeManifestSigningKey(@@ -238,7 +231,7 @@ struct LocalModelRuntimeSetupTests {)let payload = try LocalModelRuntimeSetupManager.signaturePayloadData(for: manifest)manifest.signature = try privateKey.signature(for: payload).base64EncodedString()- let manager = try LocalModelRuntimeSetupManager(+ let manager = try runtimeManager(baseDirectory: root,requiresCryptographicManifestSignatures: true)@@ -252,7 +245,7 @@ struct LocalModelRuntimeSetupTests {)}- let trustedManager = try LocalModelRuntimeSetupManager(+ let trustedManager = try runtimeManager(baseDirectory: root,trustedManifestSigningKeys: [LocalModelRuntimeManifestSigningKey(@@ -280,7 +273,7 @@ struct LocalModelRuntimeSetupTests {let root = temporaryDirectory()defer { try? FileManager.default.removeItem(at: root) }let data = Data("#!/bin/sh\necho ok\n".utf8)- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)let unsigned = LocalModelRuntimePackageManifest(runtimeID: .yoloSegmenter,runtimeVersion: "1.0.0",@@ -343,7 +336,7 @@ struct LocalModelRuntimeSetupTests {runtimeVersion: "1.2.3",modelID: "nvidia/parakeet-tdt-0.6b-v3")- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)try manager.registerExecutable(runtimeID: .parakeetTranscriber,executableURL: healthExecutable,@@ -376,7 +369,7 @@ struct LocalModelRuntimeSetupTests {modelID: "qwen2.5-0.5b-instruct-q4_k_m",metadataJSON: #"{"modelWeights.status":"missing","modelWeights.provider":"donkey-managed-download"}"#)- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)try manager.registerExecutable(runtimeID: .localLLM,executableURL: healthExecutable,@@ -406,7 +399,7 @@ struct LocalModelRuntimeSetupTests {runtimeID: "ui-understander",modelID: "local-ui-understander")- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)try manager.registerExecutable(runtimeID: .uiUnderstander,executableURL: executable,@@ -438,7 +431,7 @@ struct LocalModelRuntimeSetupTests {root: download,relativePath: "bin/donkey-yolo-segmenter")- let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)+ let manager = try runtimeManager(baseDirectory: root)try manager.registerExecutable(runtimeID: .yoloSegmenter,executableURL: executable,@@ -456,7 +449,7 @@ struct LocalModelRuntimeSetupTests {}@Test- func supportExportOmitsUserDataAndIncludesRuntimeStatus() throws {+ func supportExportOmitsUserDataAndHasNoDefaultLocalModelStatus() throws {let root = temporaryDirectory()defer { try? FileManager.default.removeItem(at: root) }let manager = try LocalModelRuntimeSetupManager(baseDirectory: root)@@ -465,11 +458,69 @@ struct LocalModelRuntimeSetupTests {let exportData = try manager.supportExportData()let exportText = String(decoding: exportData, as: UTF8.self)- #expect(snapshot.statuses.count == 4)- #expect(exportText.contains("parakeet-transcriber"))+ #expect(snapshot.statuses.isEmpty)+ #expect(!exportText.contains("parakeet-transcriber"))#expect(!exportText.contains(root.path))}+ private func runtimeManager(+ baseDirectory: URL,+ trustedManifestSigningKeys: [LocalModelRuntimeManifestSigningKey] = [],+ requiresCryptographicManifestSignatures: Bool = false+ ) throws -> LocalModelRuntimeSetupManager {+ try LocalModelRuntimeSetupManager(+ baseDirectory: baseDirectory,+ specs: fixtureRuntimeSpecs,+ trustedManifestSigningKeys: trustedManifestSigningKeys,+ requiresCryptographicManifestSignatures: requiresCryptographicManifestSignatures+ )+ }++ private var fixtureRuntimeSpecs: [LocalModelRuntimeSpec] {+ [+ LocalModelRuntimeSpec(+ id: .parakeetTranscriber,+ displayName: "Parakeet voice transcription",+ environmentVariableName: "DONKEY_PARAKEET_TRANSCRIBER",+ expectedExecutableRelativePath: "bin/donkey-parakeet-transcriber",+ modelName: "nvidia/parakeet-tdt-0.6b-v3",+ downloadPageURL: nil,+ manifestURL: nil,+ installSteps: []+ ),+ LocalModelRuntimeSpec(+ id: .yoloSegmenter,+ displayName: "YOLO26 screenshot segmentation",+ environmentVariableName: "DONKEY_YOLO_SEGMENTER",+ expectedExecutableRelativePath: "bin/donkey-yolo-segmenter",+ modelName: "ultralytics/yolo26n-seg",+ downloadPageURL: nil,+ manifestURL: nil,+ installSteps: []+ ),+ LocalModelRuntimeSpec(+ id: .uiUnderstander,+ displayName: "Local UI understanding",+ environmentVariableName: "DONKEY_UI_UNDERSTANDER",+ expectedExecutableRelativePath: "bin/donkey-ui-understander",+ modelName: "local-ui-understander",+ downloadPageURL: nil,+ manifestURL: nil,+ installSteps: []+ ),+ LocalModelRuntimeSpec(+ id: .localLLM,+ displayName: "Local LLM",+ environmentVariableName: "DONKEY_LOCAL_LLM_RUNNER",+ expectedExecutableRelativePath: "bin/donkey-local-llm",+ modelName: "qwen2.5-0.5b-instruct-q4_k_m",+ downloadPageURL: nil,+ manifestURL: nil,+ installSteps: []+ )+ ]+ }+private func makeExecutable(root: URL,relativePath: Stringdiff --git a/docs/README.md b/docs/README.mdindex b0ff0d0c..96714841 100644--- a/docs/README.md+++ b/docs/README.md@@ -4,7 +4,10 @@ This folder is the product and engineering source of truth for capabilities thatPlans describe what we might build. Guides describe what Donkey currently supports and how to maintain it.-There is an active milestone plan in `plans/master-plan.md`. It tracks the unfinished work needed before the fast local navigation and AI-harness roadmap can be considered complete: generic local-app task knowledge, local JSON/JSONL task-definition loading, installed-app/task resolution, local-model command parsing with catalog validation, local task-context intake, Accessibility control discovery and action planning, review-first document form-fill planning, Parakeet-only local voice transcription, YOLO screenshot segmentation and local UI-understanding sidecar boundaries, post-install local runtime setup without bundled model weights, setup-managed command-parser LLM weight download, semantic memory retrieval, provider memory proposals, redaction/model-observability scaffolding, local navigation, guarded input, result verification, latency reporting, and optional slow planner recovery. Weather lookup, media playback, and document form-fill are benchmark definitions for this generic system, not source-specific architectures.+There is an active sequencing file in `plans/master-plan.md`. When its Current+Sequence is empty, do not invent milestone work. The supported harness boundary+uses hosted model routes for model-backed decisions; local model packages and+local model weight setup are not part of the supported install path.## Guidesdiff --git a/docs/architecture.md b/docs/architecture.mdindex d002c605..205861e4 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -49,8 +49,9 @@ source of truth for behavior and boundaries remains```The app shell owns entrypoints, durable task threads, setup, shared agent-memory, and per-task runtime coordination. Capture, observation, model sidecars,-task adaptation, and input execution stay behind narrow runtime boundaries.+memory, and per-task runtime coordination. Capture, observation, hosted model+adapters, task adaptation, and input execution stay behind narrow runtime+boundaries.## Pointer Prompt Task Threads@@ -189,7 +190,7 @@ format for support and debugging. Retrieval always applies scope/kind filters,prompt budgets, and availability validation before a record influences planningor execution.-## Local Stack And Model Sidecars+## Local Stack And Hosted Models```text+--------------------------------------------------------------------------------+@@ -197,44 +198,39 @@ or execution.+--------------------------------------------------------------------------------+| || +----------------------+ +----------------------+ +---------------+ |-| | Donkey Swift Runtime |----->| JSON Sidecar Runner |----->| Runtime Store | |-| | contracts/controllers| | stdin/stdout process | | App Support | |+| | Donkey Swift Runtime |----->| Donkey Backend Proxy |----->| Hosted Models | |+| | contracts/controllers| | typed HTTPS requests | | providers | || +----------+-----------+ +----------+-----------+ +-------+-------+ || | | | || | v | || | +----------------------+ | |-| | | App-Managed Registry |<-------------+ |-| | | executable paths | |+| | | Provider Config |<-------------+ |+| | | model selection | || | +----------+-----------+ || | | || v v || +----------------------+ +----------------------+ +---------------+ |-| | macOS Services | | Local Command LLM | | Parakeet ASR | |-| | AX/SCK/LaunchServices| | TaskIntent JSON | | transcript | |+| | macOS Services | | TaskIntent JSON | | Voice Input | |+| | AX/SCK/LaunchServices| | structured outputs | | transcription | || +----------+-----------+ +----------------------+ +---------------+ || | || v || +----------------------+ +----------------------+ +---------------+ |-| | Target Apps | | YOLO Segmentation | | UI Understand | |-| | Weather/Music/docs | | bounded screenshots | | screenshot obs| |+| | Target Apps | | Computer Use | | UI Context | |+| | Weather/Music/docs | | hosted decisions | | evidence | || +----------------------+ +----------------------+ +---------------+ || |+--------------------------------------------------------------------------------+```-Runtime setup installs or validates sidecar packages after app install; model-weights are not bundled in `Donkey.app`. Developer environment variables can-override sidecar paths, while normal installs resolve through the app-managed-runtime registry under Application Support.--The supported setup boundary includes bundled runner packages, manifest,-checksum, and configured release-key signature validation, Application Support-registration, health checks, model-prep hooks, retryable first-run setup,-settings access, repair/remove lifecycle helpers, support status export, and-package-local Python wheelhouses built for the release target. The UI-understanding backend is a packaged Swift sidecar using Apple Vision, and the-command parser LLM uses an app-managed `local-llm` sidecar with setup-downloaded-model weights instead of a user-managed Ollama prerequisite.+Runtime setup does not install model sidecars or model weights after app+install. Model-backed behavior uses authenticated backend routes; the backend+owns provider credentials, provider selection, and concrete model selection.+The Mac app keeps local execution, permissions, Accessibility, screenshot+capture, and target-app control, but not local model hosting.+Gemini computer-use support is exposed as two backend tool registrations:+`donkey_gemini_browser_interaction` for browser control and+`donkey_gemini_mac_desktop_interaction` for guarded macOS desktop control.## Slower AI Harnessdiff --git a/docs/guides/agent-harness.md b/docs/guides/agent-harness.mdindex ce192833..b768859b 100644--- a/docs/guides/agent-harness.md+++ b/docs/guides/agent-harness.md@@ -49,8 +49,8 @@ The harness loop looks like this:| |v v+-------------------+ +--------------------------+- | user-visible turn | | local model call |- +-------------------+ | Parakeet transcription |+ | user-visible turn | | hosted model call |+ +-------------------+ | voice transcription || +--------------------------+| || transcript turn@@ -71,7 +71,7 @@ The harness loop looks like this:| | |v v v+--------------------+ +--------------------+ +----------------------+-| deterministic | | local LLM call | | provider LLM call |+| deterministic | | hosted model call | | provider LLM call || parser/fallback | | intent/follow-up | | response/planner/ || | | classifier | | memory proposals |+--------------------+ +--------------------+ +----------------------+@@ -95,9 +95,9 @@ The harness loop looks like this:| || v| +------------------------+- | | local model calls |- | | YOLO screenshot seg |- | | UI understanding |+ | | hosted/tool calls |+ | | screenshot/context |+ | | understanding || +------------------------+| || v@@ -119,18 +119,19 @@ The harness loop looks like this:The harness should make conversation feel continuous even when execution happensinside the thread. The user should not need to know whether a turn was answered-by a chat response, a local model classifier, a typed runtime artifact, or a+by a chat response, a hosted model classifier, a typed runtime artifact, or aguarded runtime path.-Model calls live behind typed harness boundaries. Voice transcription is a local-model call before intake and produces a transcript turn. The local LLM call,-provider LLM call, memory helpers, and explicit metadata helpers each consume-the bounded context packet and return typed decisions or helper artifacts.-Observation models such as screenshot segmentation and UI understanding run-inside the local-task branch and produce observation evidence, not direct input-actions. Any semantic user-intent distinction, including whether a turn is a-visual-only agent visualization request, belongs behind one of these typed model-or catalog boundaries.+Model calls live behind typed harness boundaries. Voice transcription,+task-intent classification, follow-up classification, computer-use decisions,+and planner/helper calls go through authenticated hosted model routes. The Mac+app selects only the supported Donkey capability route and sends the typed job+context; it must not name hosted providers, provider API endpoints, or concrete+model ids for normal hosted calls. The backend chooses the provider and model+for that route. Observation helpers inside the local-task branch produce+evidence, not direct input actions. Any semantic user-intent distinction,+including whether a turn is a visual-only agent visualization request, belongs+behind one of these typed model or catalog boundaries.Routing outcomes carry a structured `AppHarnessDecision`. The decision names thenext supported harness action:@@ -148,8 +149,9 @@ model/runtime boundary first. Once structured output exists, deterministic codemay validate and match typed fields.User intent must not be inferred with ad hoc phrase, prefix, suffix, substring,-or regex checks against natural-language command text. Donkey has local LLMs,-task definitions, runtime catalogs, and agent memory context for this job. Use them.+or regex checks against natural-language command text. Donkey has hosted+classifiers, task definitions, runtime catalogs, and agent memory context for+this job. Use them.The fast classifier may know typed capability buckets such as task ids,capability ids, agent memory entry kinds, and model output statuses. It must notrecover those buckets by reading natural-language words out of the user's@@ -232,7 +234,7 @@ the harness should ask for that exact entity or invite an upload. The promptshould name the missing detail rather than using generic copy like "Need moredetail".-Action execution is for validated, supported tasks. The local model classifier+Action execution is for validated, supported tasks. The hosted model classifieror explicit runtime metadata produces a `TaskIntent`. Execution may onlycontinue after catalog validation confirms the target app/task, requiredentities, app availability, and safety policy. The default runtime@@ -296,21 +298,29 @@ allowed backend, then execute it through the AppleScript backend. Adding abug, even if the script happens to work on one machine.Observation prefers Accessibility and app/window metadata. Bounded screenshots-and local UI understanding are fallback observation context only; they do not-emit direct input actions. Captured screenshots, Accessibility snapshots, and-manual capture artifacts are trace evidence, not a general live vision loop.+are fallback observation context only; they do not emit direct input actions.+Captured screenshots, Accessibility snapshots, and manual capture artifacts are+trace evidence, not a general live vision loop.Verification and screenshot fallback behavior should be derived from taskmetadata and runtime item metadata, not one-off branches for individual apps.-The fast local path must keep working without remote model calls. Local sidecars-can classify actionable turns, transcribe voice, segment screenshots, or-summarize UI observations. Provider-backed planners and memory proposals remain-slow-path helpers that write through deterministic approval into agent memory-and must fail without stopping local control on existing validated state.--Local model work that shares the same runtime capacity should enter a priority-worker. Interactive task-intent parsing runs at user-interactive priority and-can cooperatively preempt lower-priority planner, memory, or replay jobs.+Prompt understanding is hosted by default. The Mac app sends redacted,+bounded context to the Donkey backend Responses proxy and never stores provider+API keys locally. Supported prompt handling must not depend on local model+packages, local model weights, or `DONKEY_LOCAL_LLM_RUNNER`. Provider-backed+planners and memory proposals remain helper paths that write through+deterministic approval into agent memory and must fail without stopping local+control on existing validated state.++Computer-use decisions are hosted too. Browser interaction and Mac desktop+interaction are separate Gemini-backed tool registrations at the backend API+boundary: `donkey_gemini_browser_interaction` for browser environments and+`donkey_gemini_mac_desktop_interaction` for guarded macOS desktop actions.+OpenRouter remains a hosted text and structured-output option, but it is not a+supported computer-use provider.+Gemini may propose normalized coordinate actions or a custom desktop function+call, but the Mac client still owns execution, confirmation gates, focus checks,+permission policy, screenshots, and function-response feedback.## State And Observabilitydiff --git a/docs/guides/decision-system.md b/docs/guides/decision-system.mdindex abfa0ce3..f8c28358 100644--- a/docs/guides/decision-system.md+++ b/docs/guides/decision-system.md@@ -17,7 +17,7 @@ For document-writing plans, Donkey also validates the model output itself: a sho## Decision Flow-The pointer prompt records the user-visible turn, builds a bounded context packet, and routes it through the harness. Empty input can be handled directly. Semantic decisions go through typed model boundaries.+The pointer prompt records the user-visible turn, builds a bounded context packet, and routes it through the harness. Empty input can be handled directly. Semantic decisions go through typed model boundaries. By default, task-intent and follow-up decisions use the authenticated Donkey backend Responses proxy with `store=false`; the Mac app does not send a concrete hosted model, because backend configuration chooses it. Local model adapters are not part of the supported decision path.For local app work, the model receives:@@ -95,6 +95,6 @@ Weather, Music, and document form-fill fixtures remain useful for tests and repl- Prompt command handling starts in `apps/Donkey/Sources/Donkey/PointerPromptCommandHandler.swift`.- Harness routing and context packet assembly live in `apps/Donkey/Sources/DonkeyRuntime/AppHarnessTurnRouter.swift`.-- Task-intent parsing protocol and the process-backed local runtime adapter live in `apps/Donkey/Sources/DonkeyAI/LocalGenerateTaskIntentAdapter.swift`; the local-generate adapter in that file is an explicit adapter for Ollama-compatible providers, not the default runtime path.+- Task-intent parsing protocol and the hosted Responses adapter live in `apps/Donkey/Sources/DonkeyAI/LocalGenerateTaskIntentAdapter.swift`.- Catalog validation and generic local-app interaction materialization live in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskCatalog.swift`.- Guarded execution lives in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskLiveRunner.swift` and the action-engine backends.diff --git a/docs/guides/install-donkey.md b/docs/guides/install-donkey.mdindex efbcdeea..dc4606c5 100644--- a/docs/guides/install-donkey.md+++ b/docs/guides/install-donkey.md@@ -74,91 +74,27 @@ DONKEY_SPARKLE_FEED_URL="file:///Users/me/donkey-updates/appcast.xml"When Sparkle finds a valid signed update, the expanded notch task panel shows an update button in its header. Clicking it invokes Sparkle's standard update UI.-The package script also creates Donkey-compatible sidecar runner packages under:+## Hosted Models-```text-dist/LocalRuntimePackages/-```--These package folders are release artifacts to host outside the app. App packages do not include local runtime packages. On setup, Donkey downloads the configured manifest-backed package, installs it fresh into Application Support, then the sidecar creates a managed virtual environment and installs manifest-tracked Python requirements from the Python package index.--Configure hosted runtime manifest URLs when packaging:--```bash-DONKEY_RUNTIME_PACKAGE_BASE_URL="https://example.com/donkey/runtimes" \-DONKEY_RUNTIME_PACKAGE_MANIFEST_URLS="parakeet-transcriber=https://example.com/donkey/runtimes/parakeet-transcriber/manifest.json,yolo-segmenter=https://example.com/donkey/runtimes/yolo-segmenter/manifest.json,ui-understander=https://example.com/donkey/runtimes/ui-understander/manifest.json,local-llm=https://example.com/donkey/runtimes/local-llm/manifest.json" \-./scripts/package-donkey-app.sh-```--On first launch, Donkey opens setup and starts installing required local runtimes. Setup downloads the configured sidecar packages, verifies their manifests/checksums/signatures, registers them in Application Support, asks them to prepare model weights, and health-checks them. The packages do not include model weights; they contain protocol-speaking runner entrypoints for the local command parser, Parakeet voice transcription, and YOLO screenshot segmentation. UI understanding ships as a local Swift sidecar that uses Apple's on-device Vision text recognition and does not need downloaded model weights. If setup fails, clicking the same button retries failed or not-yet-attempted runtimes while keeping completed installs. The setup window can also be reopened from the app settings.--Each sidecar supports setup-time model weight preparation. During setup, Donkey calls the sidecar with `prepareModelWeights`; the sidecar downloads or warms the configured model cache and reports cached/downloaded status before health check. The local command-parser LLM is setup-managed too: Donkey packages a `local-llm` sidecar whose release manifest must include a model-weight download URL, checksum, and local inference backend requirement. The default package uses a Donkey-managed GGUF weight download with a source-built CPU `llama-cpp-python` backend so command parsing does not depend on Metal availability, and its health check loads a real model context rather than only importing the Python package. Actionable prompt turns are parsed through `DONKEY_LOCAL_LLM_RUNNER`; if that local runtime is unavailable, task-intent parsing fails clearly. Donkey does not fall back to a user-managed Ollama daemon. The Parakeet runner can fetch the Hugging Face snapshot when `huggingface_hub` is available and transcribes through NVIDIA NeMo when the local Python backend is installed.--The packaged local command-parser model lives in-`config/local-llm-models.json`. Change that file when updating the product-default; packaging and dev runtime refresh both read it. Eval-only candidate-lists live with the eval fixtures under `evals/task-intent/`. Set-`DONKEY_LOCAL_LLM_MODEL_CONFIG` to test a different runtime-default config file.--Override model-weight URLs when packaging:--```bash-DONKEY_PARAKEET_MODEL_URL="https://..." \-DONKEY_PARAKEET_MODEL_SHA256="..." \-DONKEY_YOLO_MODEL_URL="https://..." \-DONKEY_YOLO_MODEL_SHA256="..." \-DONKEY_LOCAL_LLM_MODEL_ID="qwen2.5-0.5b-instruct-q4_k_m" \-DONKEY_LOCAL_LLM_MODEL_URL="https://..." \-DONKEY_LOCAL_LLM_MODEL_SHA256="..." \-./scripts/package-donkey-app.sh-```--Release runtime manifests can be verified with Curve25519 signing keys embedded-in the app bundle. Provide trusted public keys as comma-separated-`key-id=base64-public-key` pairs and set strict verification when packaging a-release build:--```bash-DONKEY_RUNTIME_MANIFEST_PUBLIC_KEYS="runtime-release-v1=..." \-DONKEY_RUNTIME_REQUIRE_CRYPTO_SIGNATURES="1" \-./scripts/package-donkey-app.sh-```+The packaged Mac app does not bundle, download, install, or configure local+model weights. Model-backed behavior is routed through the authenticated Donkey+backend, which owns provider credentials, provider selection, and concrete model+selection. The Mac client sends typed requests to the backend and does not need+OpenAI, OpenRouter, Gemini, or other provider API keys.-If a model URL/backend is missing for a sidecar or Parakeet's local Python backend is missing, setup or runtime calls fail clearly with a retryable needs-attention state instead of pretending the runtime is usable.+First launch setup is therefore an account and permission setup flow, not a+local model installer. There are no supported release manifest URLs, model+weight override URLs, local LLM packages, or local model repair steps in the+hosted-model install path.-## Dev Runtime Manifests+## Local Development-For local development, `scripts/run-donkey-dev.sh` bootstraps local runtime packages and manifest files from `dist/LocalRuntimePackages/` before launching the debug app:+For local development, `scripts/run-donkey-dev.sh` builds and launches the debug app:```bash./scripts/run-donkey-dev.sh```-If runtime packages are missing, stale, or still have the old local-LLM package without a model URL/checksum/backend requirement, the dev runner calls `scripts/package-donkey-app.sh` first. It then regenerates the dev manifest env file and loads it for the debug launch.--The dev runner automatically creates and loads:--```text-dist/donkey-dev-runtime-manifests.env-```--That env file points `DONKEY_RUNTIME_PACKAGE_MANIFEST_URLS` at generated `file://` manifests under `dist/LocalRuntimeDevManifests/`. Those dev manifests rewrite each runtime file entry to a local `file://` download URL, so the debug app can install runtimes into Application Support without first installing `/Applications/Donkey.app`.--After building the debug executable, `run-donkey-dev.sh` runs `scripts/setup-dev-local-runtimes.py`. The helper installs any missing, invalid, or stale-version local runtime packages into Application Support, then asks newly installed sidecars to prepare model weights and run a health check. For `local-llm`, that first prepare pass may create a managed Python environment, install `llama-cpp-python`, and download the configured GGUF model file; this is foreground work, not a silent background repair. Already-current runtime registrations are left alone, so the setup pass is a one-time dev bootstrap unless local packages change. Runtime setup failures are reported as warnings and the debug app still launches.--To regenerate the env file manually:--```bash-scripts/create-dev-runtime-manifests.py-```--Set `DONKEY_DEV_RUNTIME_AUTO_PACKAGE=0` to skip automatic package refresh. Set `DONKEY_DEV_RUNTIME_PACKAGE_REFRESH=1` to force a package refresh before launch. Set `DONKEY_DEV_RUNTIME_MANIFESTS=0` to make `run-donkey-dev.sh` skip manifest generation. Set `DONKEY_DEV_RUNTIME_SETUP=0` to skip the missing-runtime setup pass. Set `DONKEY_DEV_RUNTIME_PREPARE=0` to install/register missing packages without running model preparation or health checks. Set `DONKEY_DEV_RUNTIME_FORCE_SETUP=1` to reinstall from the dev manifests even when the registry already points at the same runtime version. Set `DONKEY_DEV_RUNTIME_ENV_FILE`, `DONKEY_DEV_RUNTIME_PACKAGE_DIR`, or `DONKEY_DEV_RUNTIME_BASE_DIR` to use different local paths.--Developer diagnostics:--```bash-swift run Donkey -- --local-runtime-status-swift run Donkey -- --local-runtime-support-swift run Donkey -- --repair-local-runtime --runtime-id yolo-segmenter-swift run Donkey -- --remove-local-runtime --runtime-id yolo-segmenter-```+Development builds use the same hosted-model boundary as packaged builds. If a+developer needs to test provider behavior, configure the site/backend+environment and keep provider credentials out of the Mac app.diff --git a/docs/guides/pointer-prompt-overlay.md b/docs/guides/pointer-prompt-overlay.mdindex 5881b90d..ff772fbd 100644--- a/docs/guides/pointer-prompt-overlay.md+++ b/docs/guides/pointer-prompt-overlay.md@@ -39,9 +39,9 @@ quick local-app actions:- `PointerPromptNotchLayout` is the shared source for notch surface frames, content frames, corner radii, and notch-safe offsets. `canRenderTextInTopRow` describes whether text can draw in the top row, not whether that row exists.- The prompt is a compact black composer: single-line text is pill-shaped, multiline text becomes a bounded rounded rectangle, Return submits, Shift-Return inserts a newline, Escape and outside clicks dismiss, and non-input capsule areas can drag the modal.- The centered composer keeps text and voice modes on the same input surface. Double-Command release opens focused text input, double-Command hold opens the same input with voice active, and typed text promotes the send button while the microphone affordance becomes secondary.-- Voice capture and transcription remain separate. The controller records bounded local audio and publishes levels; transcription uses the Parakeet-only adapter before submitting transcript text through the agent-harness turn path.+- Voice capture and transcription remain separate. The controller records bounded local audio and publishes levels; transcription is model-backed through the hosted agent-harness boundary before transcript text enters the turn path.- Local item prewarming must run off the main actor. Agent memory is stored in SQLite under Application Support and uses FTS5 plus deterministic local embeddings for retrieval; JSONL is only an explicit export/debug format. Cached local-item hits must still point to an existing path or bundle before they are used as an execution target. Runtime task definitions are loaded from agent memory; Weather, Music, and Preview definitions are benchmark fixtures unless a generated/user-reviewed definition for them is present in memory.-- For scriptable apps, prefer app-native AppleScript task commands before falling back to Accessibility or keyboard input. Bounded screenshots and local UI understanding may supplement observation/verification according to task metadata, but screenshots remain context evidence and do not directly drive input.+- For scriptable apps, prefer app-native AppleScript task commands before falling back to Accessibility or keyboard input. Bounded screenshots may supplement observation/verification according to task metadata, but screenshots remain context evidence and do not directly drive input.- Agent visualization overlays are non-interactive, non-activating panels. They may point, explain, and replay what the agent is doing or would do, but they do not synthesize mouse movement. Live keyboard or Accessibility actions remain separate guarded runtime actions.- Task actions in the notch, including follow-up submission and pause/resume, must cross the model/controller command boundary with the selected task ID.- Pointer prompt command handling should emit actionable `com.donkey.app` route/result logs for submitted commands, routing decisions, intent resolution, unsupported requests, unavailable apps, and final task status.diff --git a/scripts/package-donkey-app.sh b/scripts/package-donkey-app.shindex 88d569e9..f7b4669c 100755--- a/scripts/package-donkey-app.sh+++ b/scripts/package-donkey-app.sh@@ -6,75 +6,29 @@ APP_DIR="$ROOT_DIR/dist/Donkey.app"DMG_PATH="$ROOT_DIR/dist/Donkey.dmg"DMG_ROOT="$ROOT_DIR/dist/DonkeyInstaller"RUNTIME_PACKAGE_DIR="$ROOT_DIR/dist/LocalRuntimePackages"-RUNTIME_PACKAGE_VERSION="${DONKEY_RUNTIME_PACKAGE_VERSION:-0.3.0-runner}"-RUNTIME_PACKAGE_BASE_URL="${DONKEY_RUNTIME_PACKAGE_BASE_URL:-}"-RUNTIME_PACKAGE_MANIFEST_URLS="${DONKEY_RUNTIME_PACKAGE_MANIFEST_URLS:-}"APP_VERSION="${DONKEY_APP_VERSION:-0.1.0}"APP_BUILD="${DONKEY_APP_BUILD:-1}"WEB_BASE_URL="${DONKEY_WEB_BASE_URL:-https://donkeyuse.com}"AUTH_CALLBACK_SCHEME="${DONKEY_AUTH_CALLBACK_SCHEME:-donkey}"SPARKLE_FEED_URL="${DONKEY_SPARKLE_FEED_URL:-}"SPARKLE_PUBLIC_ED_KEY="${DONKEY_SPARKLE_PUBLIC_ED_KEY:-}"-RUNTIME_MANIFEST_PUBLIC_KEYS="${DONKEY_RUNTIME_MANIFEST_PUBLIC_KEYS:-}"-RUNTIME_REQUIRE_CRYPTO_SIGNATURES="${DONKEY_RUNTIME_REQUIRE_CRYPTO_SIGNATURES:-0}"-LOCAL_LLM_MODEL_CONFIG="${DONKEY_LOCAL_LLM_MODEL_CONFIG:-$ROOT_DIR/config/local-llm-models.json}"CONTENTS_DIR="$APP_DIR/Contents"MACOS_DIR="$CONTENTS_DIR/MacOS"RESOURCES_DIR="$CONTENTS_DIR/Resources"FRAMEWORKS_DIR="$CONTENTS_DIR/Frameworks"BUILD_DIR="$ROOT_DIR/apps/Donkey"EXECUTABLE="$BUILD_DIR/.build/release/Donkey"-UI_UNDERSTANDER_EXECUTABLE="$BUILD_DIR/.build/release/DonkeyUIUnderstandingSidecar"CACHE_DIR="$BUILD_DIR/.build/package-cache"APP_ICON_SOURCE="$BUILD_DIR/Sources/Donkey/Resources/Donkey.icns"-RUNTIME_RUNNER_SOURCE="$ROOT_DIR/scripts/local-runtime-runners/donkey_runtime_runner.py"mkdir -p "$CACHE_DIR/clang" "$CACHE_DIR/swiftpm" "$CACHE_DIR/home"export CLANG_MODULE_CACHE_PATH="$CACHE_DIR/clang"export SWIFTPM_CACHE_PATH="$CACHE_DIR/swiftpm"export HOME="$CACHE_DIR/home"-load_local_llm_model_defaults() {- local config_path="$1"- python3 - "$config_path" <<'PY'-import json-import shlex-import sys-from pathlib import Path--config_path = Path(sys.argv[1])-config = json.loads(config_path.read_text())-model = config.get("defaultModel")-if not isinstance(model, dict):- raise SystemExit(f"defaultModel not found in {config_path}")-requirements = config.get("runtimeRequirements") if isinstance(config.get("runtimeRequirements"), list) else []-requirements_text = "\n".join(str(item) for item in requirements if str(item).strip())-values = {- "LOCAL_LLM_MODEL_ID_DEFAULT": str(model.get("modelID") or ""),- "LOCAL_LLM_MODEL_URL_DEFAULT": str(model.get("downloadURL") or ""),- "LOCAL_LLM_MODEL_SHA256_DEFAULT": str(model.get("sha256") or model.get("expectedSHA256") or ""),- "LOCAL_LLM_MODEL_FILENAME_DEFAULT": str(model.get("filename") or "model.gguf"),- "LOCAL_LLM_RUNTIME_REQUIREMENTS": requirements_text,-}-for key, value in values.items():- print(f"{key}={shlex.quote(value)}")-PY-}--eval "$(load_local_llm_model_defaults "$LOCAL_LLM_MODEL_CONFIG")"--manifest_download_url_entry() {- local runtime_id="$1"- local relative_path="$2"- if [ -n "$RUNTIME_PACKAGE_BASE_URL" ]; then- printf ',\n "downloadURL" : "%s/%s/%s"' "${RUNTIME_PACKAGE_BASE_URL%/}" "$runtime_id" "$relative_path"- fi-}-cd "$BUILD_DIR"echo "Compiling Donkey for Mac ..."swift build -c release --product Donkey-swift build -c release --product DonkeyUIUnderstandingSidecarrm -rf "$APP_DIR"mkdir -p "$MACOS_DIR" "$RESOURCES_DIR" "$FRAMEWORKS_DIR"@@ -87,161 +41,7 @@ if ! otool -l "$MACOS_DIR/Donkey" | grep -q "@executable_path/../Frameworks"; thinstall_name_tool -add_rpath "@executable_path/../Frameworks" "$MACOS_DIR/Donkey"fi-make_runtime_package() {- local runtime_id="$1"- local executable_name="$2"- local model_id="$3"- local role="$4"- local model_url="${5:-}"- local model_sha256="${6:-}"- local model_filename="${7:-model.bin}"- local requirements="${8:-}"- local package_dir="$RUNTIME_PACKAGE_DIR/$runtime_id"- local bin_dir="$package_dir/bin"- local lib_dir="$package_dir/lib"- local executable_path="$bin_dir/$executable_name"- local runner_path="$lib_dir/donkey_runtime_runner.py"- local requirements_path="$package_dir/requirements.txt"-- mkdir -p "$bin_dir" "$lib_dir"- cp "$RUNTIME_RUNNER_SOURCE" "$runner_path"- chmod 755 "$runner_path"- cat > "$executable_path" <<EOF_RUNTIME-#!/usr/bin/env sh-SCRIPT_DIR="\$(CDPATH= cd -- "\$(dirname -- "\$0")" && pwd)"-PYTHON="\${DONKEY_RUNTIME_PYTHON:-python3}"-PACKAGE_DIR="\$(CDPATH= cd -- "\$SCRIPT_DIR/.." && pwd)"-export DONKEY_RUNTIME_ID="$runtime_id"-export DONKEY_RUNTIME_VERSION="$RUNTIME_PACKAGE_VERSION"-export DONKEY_MODEL_ID="$model_id"-export DONKEY_RUNTIME_ROLE="$role"-export DONKEY_MODEL_URL="$model_url"-export DONKEY_MODEL_SHA256="$model_sha256"-export DONKEY_MODEL_FILENAME="$model_filename"-export DONKEY_RUNTIME_PACKAGE_DIR="\$PACKAGE_DIR"-export DONKEY_RUNTIME_STATE_DIR="\${DONKEY_RUNTIME_STATE_DIR:-\$HOME/Library/Application Support/Donkey/LocalModelRuntimes/RuntimePython/$runtime_id}"-if ! command -v "\$PYTHON" >/dev/null 2>&1; then- printf '{"status":"error","runtimeID":"%s","modelID":"%s","metadata":{"reason":"pythonRuntimeUnavailable","dependency":"python3"}}' "$runtime_id" "$model_id"- exit 0-fi-exec "\$PYTHON" "\$SCRIPT_DIR/../lib/donkey_runtime_runner.py"-EOF_RUNTIME- chmod 755 "$executable_path"- if [ -n "$requirements" ]; then- printf '%s\n' "$requirements" > "$requirements_path"- fi-- local executable_sha- local runner_sha- local requirements_sha=""- local requirements_manifest_entry=""- executable_sha="$(shasum -a 256 "$executable_path" | awk '{print $1}')"- runner_sha="$(shasum -a 256 "$runner_path" | awk '{print $1}')"- local executable_download_url_entry- local runner_download_url_entry- executable_download_url_entry="$(manifest_download_url_entry "$runtime_id" "bin/$executable_name")"- runner_download_url_entry="$(manifest_download_url_entry "$runtime_id" "lib/donkey_runtime_runner.py")"- if [ -f "$requirements_path" ]; then- requirements_sha="$(shasum -a 256 "$requirements_path" | awk '{print $1}')"- local requirements_download_url_entry- requirements_download_url_entry="$(manifest_download_url_entry "$runtime_id" "requirements.txt")"- requirements_manifest_entry=",- {- \"relativePath\" : \"requirements.txt\"$requirements_download_url_entry,- \"sha256\" : \"$requirements_sha\",- \"isExecutable\" : false- }"- fi- cat > "$package_dir/manifest.json" <<EOF_MANIFEST-{- "runtimeID" : "$runtime_id",- "runtimeVersion" : "$RUNTIME_PACKAGE_VERSION",- "modelID" : "$model_id",- "platform" : "macos",- "architecture" : "$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x86_64/')",- "sidecarProtocolVersion" : "v1",- "minimumDonkeyVersion" : "0.1.0",- "executableRelativePath" : "bin/$executable_name",- "files" : [- {- "relativePath" : "bin/$executable_name"$executable_download_url_entry,- "sha256" : "$executable_sha",- "isExecutable" : true- },- {- "relativePath" : "lib/donkey_runtime_runner.py"$runner_download_url_entry,- "sha256" : "$runner_sha",- "isExecutable" : true- }$requirements_manifest_entry- ],- "signature" : "donkey-runner-package",- "signingKeyID" : "donkey-runner",- "metadata" : {- "runtime.package" : "donkey-runner-package",- "modelWeightsBundled" : "false",- "modelWeights.downloadURL" : "$model_url",- "modelWeights.sha256" : "$model_sha256",- "modelWeights.filename" : "$model_filename",- "sidecar.role" : "$role"- }-}-EOF_MANIFEST-}--make_binary_runtime_package() {- local runtime_id="$1"- local executable_name="$2"- local source_executable="$3"- local model_id="$4"- local role="$5"- local package_dir="$RUNTIME_PACKAGE_DIR/$runtime_id"- local bin_dir="$package_dir/bin"- local executable_path="$bin_dir/$executable_name"-- mkdir -p "$bin_dir"- cp "$source_executable" "$executable_path"- chmod 755 "$executable_path"-- local executable_sha- executable_sha="$(shasum -a 256 "$executable_path" | awk '{print $1}')"- local executable_download_url_entry- executable_download_url_entry="$(manifest_download_url_entry "$runtime_id" "bin/$executable_name")"- cat > "$package_dir/manifest.json" <<EOF_MANIFEST-{- "runtimeID" : "$runtime_id",- "runtimeVersion" : "$RUNTIME_PACKAGE_VERSION",- "modelID" : "$model_id",- "platform" : "macos",- "architecture" : "$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x86_64/')",- "sidecarProtocolVersion" : "v1",- "minimumDonkeyVersion" : "0.1.0",- "executableRelativePath" : "bin/$executable_name",- "files" : [- {- "relativePath" : "bin/$executable_name"$executable_download_url_entry,- "sha256" : "$executable_sha",- "isExecutable" : true- }- ],- "signature" : "donkey-runner-package",- "signingKeyID" : "donkey-runner",- "metadata" : {- "runtime.package" : "donkey-binary-runtime-package",- "modelWeightsBundled" : "false",- "modelWeights.status" : "notRequired",- "modelWeights.provider" : "system",- "sidecar.role" : "$role"- }-}-EOF_MANIFEST-}-rm -rf "$RUNTIME_PACKAGE_DIR"-mkdir -p "$RUNTIME_PACKAGE_DIR"-make_runtime_package "parakeet-transcriber" "donkey-parakeet-transcriber" "nvidia/parakeet-tdt-0.6b-v3" "voiceTranscription" "${DONKEY_PARAKEET_MODEL_URL:-}" "${DONKEY_PARAKEET_MODEL_SHA256:-}" "${DONKEY_PARAKEET_MODEL_FILENAME:-parakeet-model.bin}" $'huggingface_hub>=0.25,<1'-make_runtime_package "yolo-segmenter" "donkey-yolo-segmenter" "ultralytics/yolo26n-seg" "screenshotSegmentation" "${DONKEY_YOLO_MODEL_URL:-}" "${DONKEY_YOLO_MODEL_SHA256:-}" "${DONKEY_YOLO_MODEL_FILENAME:-yolo26n-seg.pt}" $'ultralytics>=8.3,<9\nopencv-python-headless>=4.10,<5'-make_binary_runtime_package "ui-understander" "donkey-ui-understander" "$UI_UNDERSTANDER_EXECUTABLE" "apple-vision-text-recognition" "uiUnderstanding"-make_runtime_package "local-llm" "donkey-local-llm" "${DONKEY_LOCAL_LLM_MODEL_ID:-$LOCAL_LLM_MODEL_ID_DEFAULT}" "localLLM" "${DONKEY_LOCAL_LLM_MODEL_URL:-$LOCAL_LLM_MODEL_URL_DEFAULT}" "${DONKEY_LOCAL_LLM_MODEL_SHA256:-$LOCAL_LLM_MODEL_SHA256_DEFAULT}" "${DONKEY_LOCAL_LLM_MODEL_FILENAME:-$LOCAL_LLM_MODEL_FILENAME_DEFAULT}" "$LOCAL_LLM_RUNTIME_REQUIREMENTS"RESOURCE_BUNDLE="$(find "$BUILD_DIR/.build" -path "*/release/Donkey_Donkey.bundle" -type d | head -n 1 || true)"if [ -n "$RESOURCE_BUNDLE" ]; then@@ -273,59 +73,6 @@ if [ -n "$SPARKLE_FEED_URL" ] && [ -n "$SPARKLE_PUBLIC_ED_KEY" ]; then<string>$SPARKLE_PUBLIC_ED_KEY</string>"fi-RUNTIME_SIGNATURE_PLIST_KEYS=""-if [ -n "$RUNTIME_MANIFEST_PUBLIC_KEYS" ]; then- RUNTIME_SIGNATURE_PLIST_KEYS=" <key>DonkeyRuntimeRequiresCryptographicManifestSignatures</key>- <$( [ "$RUNTIME_REQUIRE_CRYPTO_SIGNATURES" = "1" ] && printf true || printf false )/>- <key>DonkeyRuntimeManifestPublicKeys</key>- <dict>"- IFS=',' read -r -a runtime_key_pairs <<< "$RUNTIME_MANIFEST_PUBLIC_KEYS"- for pair in "${runtime_key_pairs[@]}"; do- key_id="${pair%%=*}"- public_key="${pair#*=}"- if [ -n "$key_id" ] && [ -n "$public_key" ] && [ "$key_id" != "$public_key" ]; then- RUNTIME_SIGNATURE_PLIST_KEYS="$RUNTIME_SIGNATURE_PLIST_KEYS- <key>$key_id</key>- <string>$public_key</string>"- fi- done- RUNTIME_SIGNATURE_PLIST_KEYS="$RUNTIME_SIGNATURE_PLIST_KEYS- </dict>"-fi--RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS=""-append_runtime_package_manifest_url() {- local runtime_id="$1"- local manifest_url="$2"- if [ -z "$runtime_id" ] || [ -z "$manifest_url" ]; then- return- fi- RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS="$RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS- <key>$runtime_id</key>- <string>$manifest_url</string>"-}--if [ -n "$RUNTIME_PACKAGE_MANIFEST_URLS" ]; then- IFS=',' read -r -a manifest_url_pairs <<< "$RUNTIME_PACKAGE_MANIFEST_URLS"- for pair in "${manifest_url_pairs[@]}"; do- runtime_id="${pair%%=*}"- manifest_url="${pair#*=}"- if [ "$runtime_id" != "$manifest_url" ]; then- append_runtime_package_manifest_url "$runtime_id" "$manifest_url"- fi- done-fi-append_runtime_package_manifest_url "parakeet-transcriber" "${DONKEY_PARAKEET_RUNTIME_MANIFEST_URL:-}"-append_runtime_package_manifest_url "yolo-segmenter" "${DONKEY_YOLO_RUNTIME_MANIFEST_URL:-}"-append_runtime_package_manifest_url "ui-understander" "${DONKEY_UI_UNDERSTANDER_RUNTIME_MANIFEST_URL:-}"-append_runtime_package_manifest_url "local-llm" "${DONKEY_LOCAL_LLM_RUNTIME_MANIFEST_URL:-}"--if [ -n "$RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS" ]; then- RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS=" <key>DonkeyRuntimePackageManifestURLs</key>- <dict>$RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS- </dict>"-fi-cat > "$CONTENTS_DIR/Info.plist" <<PLIST<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">@@ -365,14 +112,12 @@ cat > "$CONTENTS_DIR/Info.plist" <<PLIST</dict></array><key>NSMicrophoneUsageDescription</key>- <string>Donkey uses the microphone for local voice commands.</string>+ <string>Donkey uses the microphone for user-requested voice input.</string><key>NSScreenCaptureUsageDescription</key>- <string>Donkey captures bounded screenshots so local runtimes can understand app UI.</string>+ <string>Donkey captures bounded screenshots for user-requested app context.</string><key>NSAppleEventsUsageDescription</key><string>Donkey uses local app automation only for user-requested actions.</string>$SPARKLE_PLIST_KEYS-$RUNTIME_PACKAGE_MANIFEST_PLIST_KEYS-$RUNTIME_SIGNATURE_PLIST_KEYS</dict></plist>PLISTdiff --git a/scripts/run-donkey-dev.sh b/scripts/run-donkey-dev.shindex f0bd21ca..cd80c107 100755--- a/scripts/run-donkey-dev.sh+++ b/scripts/run-donkey-dev.sh@@ -5,12 +5,6 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"APP_DIR="$ROOT_DIR/apps/Donkey"LOG_SCRIPT="$ROOT_DIR/scripts/tail-donkey-logs.sh"DONKEY_BIN="$APP_DIR/.build/debug/Donkey"-DEV_RUNTIME_MANIFEST_SCRIPT="$ROOT_DIR/scripts/create-dev-runtime-manifests.py"-DEV_RUNTIME_SETUP_SCRIPT="$ROOT_DIR/scripts/setup-dev-local-runtimes.py"-PACKAGE_SCRIPT="$ROOT_DIR/scripts/package-donkey-app.sh"-DEV_RUNTIME_PACKAGE_DIR="${DONKEY_DEV_RUNTIME_PACKAGE_DIR:-$ROOT_DIR/dist/LocalRuntimePackages}"-DEV_RUNTIME_ENV_FILE="${DONKEY_DEV_RUNTIME_ENV_FILE:-$ROOT_DIR/dist/donkey-dev-runtime-manifests.env}"-LOCAL_LLM_MODEL_CONFIG="${DONKEY_LOCAL_LLM_MODEL_CONFIG:-$ROOT_DIR/config/local-llm-models.json}"LOG_PID=""cleanup() {@@ -56,150 +50,11 @@ start_logger() {LOG_PID="$!"}-runtime_manifest_env_is_configured() {- [ -n "${DONKEY_RUNTIME_PACKAGE_MANIFEST_URLS:-}" ] \- || [ -n "${DONKEY_PARAKEET_RUNTIME_MANIFEST_URL:-}" ] \- || [ -n "${DONKEY_YOLO_RUNTIME_MANIFEST_URL:-}" ] \- || [ -n "${DONKEY_UI_UNDERSTANDER_RUNTIME_MANIFEST_URL:-}" ] \- || [ -n "${DONKEY_LOCAL_LLM_RUNTIME_MANIFEST_URL:-}" ]-}--dev_runtime_packages_need_refresh() {- if [ "${DONKEY_DEV_RUNTIME_PACKAGE_REFRESH:-0}" = "1" ]; then- return 0- fi- if [ ! -d "$DEV_RUNTIME_PACKAGE_DIR" ]; then- return 0- fi- python3 - "$DEV_RUNTIME_PACKAGE_DIR" "$LOCAL_LLM_MODEL_CONFIG" <<'PY'-import json-import os-import sys-from pathlib import Path--package_dir = Path(sys.argv[1])-config_path = Path(sys.argv[2])-expected_runtimes = {"local-llm", "parakeet-transcriber", "ui-understander", "yolo-segmenter"}-for runtime_id in expected_runtimes:- if not (package_dir / runtime_id / "manifest.json").exists():- raise SystemExit(0)-manifest_path = package_dir / "local-llm" / "manifest.json"-if not manifest_path.exists():- raise SystemExit(0)-try:- manifest = json.loads(manifest_path.read_text())-except Exception:- raise SystemExit(0)-metadata = manifest.get("metadata") if isinstance(manifest.get("metadata"), dict) else {}-files = manifest.get("files") if isinstance(manifest.get("files"), list) else []-requirements_path = package_dir / "local-llm" / "requirements.txt"-try:- config = json.loads(config_path.read_text())-except Exception:- raise SystemExit(0)-model = config.get("defaultModel")-if not isinstance(model, dict):- raise SystemExit(0)-expected_model_id = os.environ.get("DONKEY_LOCAL_LLM_MODEL_ID") or str(model.get("modelID") or "")-expected_model_url = os.environ.get("DONKEY_LOCAL_LLM_MODEL_URL") or str(model.get("downloadURL") or "")-expected_model_sha256 = (- os.environ.get("DONKEY_LOCAL_LLM_MODEL_SHA256")- or str(model.get("sha256") or model.get("expectedSHA256") or "")-)-expected_model_filename = os.environ.get("DONKEY_LOCAL_LLM_MODEL_FILENAME") or str(model.get("filename") or "")-expected_requirements = config.get("runtimeRequirements") if isinstance(config.get("runtimeRequirements"), list) else []-expected_requirements_text = "\n".join(str(item) for item in expected_requirements if str(item).strip()).strip()-if str(manifest.get("modelID") or "") != expected_model_id:- raise SystemExit(0)-if str(metadata.get("modelWeights.downloadURL") or "") != expected_model_url:- raise SystemExit(0)-if str(metadata.get("modelWeights.sha256") or "") != expected_model_sha256:- raise SystemExit(0)-if str(metadata.get("modelWeights.filename") or "") != expected_model_filename:- raise SystemExit(0)-if not str(metadata.get("modelWeights.downloadURL") or "").strip():- raise SystemExit(0)-if not str(metadata.get("modelWeights.sha256") or "").strip():- raise SystemExit(0)-if not requirements_path.exists():- raise SystemExit(0)-actual_requirements_text = requirements_path.read_text().strip()-if actual_requirements_text != expected_requirements_text:- raise SystemExit(0)-if not files:- raise SystemExit(0)-raise SystemExit(1)-PY-}--refresh_dev_runtime_packages_if_needed() {- if runtime_manifest_env_is_configured; then- return- fi- if [ "${DONKEY_DEV_RUNTIME_AUTO_PACKAGE:-1}" = "0" ]; then- return- fi- if ! dev_runtime_packages_need_refresh; then- return- fi-- echo "Refreshing local runtime packages for dev setup..."- "$PACKAGE_SCRIPT"-}--load_dev_runtime_manifests() {- if runtime_manifest_env_is_configured; then- echo "Using runtime manifest URLs from environment."- return- fi-- if [ "${DONKEY_DEV_RUNTIME_MANIFESTS:-1}" = "0" ]; then- echo "Skipping dev runtime manifest setup because DONKEY_DEV_RUNTIME_MANIFESTS=0."- return- fi-- if [ -d "$DEV_RUNTIME_PACKAGE_DIR" ]; then- echo "Refreshing local runtime manifest env from $DEV_RUNTIME_PACKAGE_DIR..."- DONKEY_DEV_RUNTIME_PACKAGE_DIR="$DEV_RUNTIME_PACKAGE_DIR" \- DONKEY_DEV_RUNTIME_ENV_FILE="$DEV_RUNTIME_ENV_FILE" \- python3 "$DEV_RUNTIME_MANIFEST_SCRIPT" || true- fi-- if [ -f "$DEV_RUNTIME_ENV_FILE" ]; then- echo "Loading local runtime manifest env from $DEV_RUNTIME_ENV_FILE..."- # shellcheck source=/dev/null- source "$DEV_RUNTIME_ENV_FILE"- return- fi-- echo "No local runtime manifest env found. Check package output above, or set DONKEY_RUNTIME_PACKAGE_MANIFEST_URLS."-}--setup_missing_local_runtimes() {- if [ "${DONKEY_DEV_RUNTIME_SETUP:-1}" = "0" ]; then- echo "Skipping local runtime setup because DONKEY_DEV_RUNTIME_SETUP=0."- return- fi-- if ! runtime_manifest_env_is_configured; then- echo "Skipping local runtime setup because no runtime manifest URLs are configured."- return- fi-- echo "Setting up missing local runtimes..."- if ! python3 "$DEV_RUNTIME_SETUP_SCRIPT"; then- echo "Warning: dev local runtime setup failed; continuing to launch Donkey." >&2- fi-}-trap cleanup EXITecho "Stopping any running Donkey app..."killall Donkey >/dev/null 2>&1 || true-refresh_dev_runtime_packages_if_needed-load_dev_runtime_manifests-cd "$APP_DIR"echo "Building Donkey..."@@ -210,8 +65,6 @@ if [ ! -x "$DONKEY_BIN" ]; thenexit 1fi-setup_missing_local_runtimes-echo "Starting Donkey..."start_logger"$DONKEY_BIN"