Open source CapCut alternative.
TypeScript
Add local voice transcription model routing
David Le21d13a54de28
diff --git a/apps/Donkey/Sources/DonkeyAI/AIModelRegistry.swift b/apps/Donkey/Sources/DonkeyAI/AIModelRegistry.swiftindex 8a316d20..420e4254 100644--- a/apps/Donkey/Sources/DonkeyAI/AIModelRegistry.swift+++ b/apps/Donkey/Sources/DonkeyAI/AIModelRegistry.swift@@ -4,10 +4,12 @@ import Foundationpublic enum AIModelProvider: String, Codable, Equatable, Sendable {case openAIcase ollama+ case localRuntime}public enum AIModelRole: String, Codable, Equatable, Sendable {case taskIntent+ case voiceTranscriptioncase plannerHintcase traceSummarycase recovery@@ -15,6 +17,7 @@ public enum AIModelRole: String, Codable, Equatable, Sendable {public enum AIModelCapability: String, Codable, Equatable, Hashable, Sendable {case textInput+ case audioInputcase structuredOutputscase imageInput}@@ -117,6 +120,53 @@ public struct AIModelRegistry: Codable, Equatable, Sendable {"docsSource": "official Ollama API docs"]),+ AIModelRegistryEntry(+ id: "local-voice-transcription-parakeet-tdt-0.6b-v3",+ role: .voiceTranscription,+ provider: .localRuntime,+ modelID: "nvidia/parakeet-tdt-0.6b-v3",+ endpoint: URL(string: "local://nvidia/parakeet-tdt-0.6b-v3")!,+ capabilities: [.audioInput],+ timeoutMS: 2_000,+ promptVersion: "voice-transcription-v1",+ evalStatus: .candidate,+ docsURL: URL(string: "https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3")!,+ rollbackID: "local-voice-transcription-whisper-large-v3-turbo",+ metadata: [+ "local": "true",+ "runtime": "nvidia-nemo",+ "language": "25 languages with automatic detection",+ "inputFormat": "16kHz mono wav or flac",+ "parameters": "600M",+ "features": "punctuation,capitalization,wordTimestamps,segmentTimestamps",+ "license": "CC-BY-4.0",+ "selectedReason": "current Parakeet TDT 0.6B default for local ASR with punctuation, timestamps, and multilingual support",+ "lastVerifiedAt": "2026-05-17",+ "docsSource": "official NVIDIA Hugging Face model card",+ "fallbackModelID": "openai/whisper-large-v3-turbo"+ ]+ ),+ AIModelRegistryEntry(+ id: "local-voice-transcription-whisper-large-v3-turbo",+ role: .voiceTranscription,+ provider: .localRuntime,+ modelID: "openai/whisper-large-v3-turbo",+ endpoint: URL(string: "local://openai/whisper-large-v3-turbo")!,+ capabilities: [.audioInput],+ timeoutMS: 4_000,+ promptVersion: "voice-transcription-v1",+ evalStatus: .candidate,+ docsURL: URL(string: "https://huggingface.co/openai/whisper-large-v3-turbo")!,+ rollbackID: nil,+ metadata: [+ "local": "true",+ "runtime": "transformers-or-whispercpp",+ "language": "multilingual",+ "selectedReason": "fallback local ASR when Parakeet runtime is unavailable or non-supported language quality wins",+ "lastVerifiedAt": "2026-05-17",+ "docsSource": "official OpenAI Hugging Face model card"+ ]+ ),AIModelRegistryEntry(id: "ollama-planner-hint-local",role: .plannerHint,@@ -157,6 +207,7 @@ public struct AIModelRegistry: Codable, Equatable, Sendable {public enum AIModelJobType: String, Codable, Equatable, Sendable {case taskIntent+ case voiceTranscriptioncase plannerHintcase traceSummarycase recovery@@ -257,6 +308,8 @@ public struct AIModelRouter: Sendable {switch jobType {case .taskIntent:return .taskIntent+ case .voiceTranscription:+ return .voiceTranscriptioncase .plannerHint:return .plannerHintcase .traceSummary:@@ -283,6 +336,8 @@ public struct AIModelRouter: Sendable {if request.latencyTolerance == .interactive { value -= entry.timeoutMS / 1_000 }if request.privacyMode == .privacySensitive {switch entry.provider {+ case .localRuntime:+ value += 4case .ollama:value += 4case .openAI:diff --git a/apps/Donkey/Sources/DonkeyAI/OllamaPlannerHintAdapter.swift b/apps/Donkey/Sources/DonkeyAI/OllamaPlannerHintAdapter.swiftindex df58cba3..b7133d3e 100644--- a/apps/Donkey/Sources/DonkeyAI/OllamaPlannerHintAdapter.swift+++ b/apps/Donkey/Sources/DonkeyAI/OllamaPlannerHintAdapter.swift@@ -216,6 +216,11 @@ public struct ProviderBackedSlowPlannerHintGenerator: SlowPlannerHintGeneratingfor provider in providerOrder {let result: PlannerHintAdapterResultswitch provider {+ case .localRuntime:+ metadata["\(provider.rawValue).status"] = "unsupportedForPlanner"+ metadata["\(provider.rawValue).validationStatus"] = "notAttempted"+ metadata["lastProvider"] = provider.rawValue+ continuecase .ollama:result = await localAdapter.generatePlannerHint(request)case .openAI:diff --git a/apps/Donkey/Tests/DonkeyRuntimeTests/AIHarnessAdapterTests.swift b/apps/Donkey/Tests/DonkeyRuntimeTests/AIHarnessAdapterTests.swiftindex eb6e7d54..58e131ff 100644--- a/apps/Donkey/Tests/DonkeyRuntimeTests/AIHarnessAdapterTests.swift+++ b/apps/Donkey/Tests/DonkeyRuntimeTests/AIHarnessAdapterTests.swift@@ -84,6 +84,49 @@ struct AIHarnessAdapterTests {#expect(selected.provider == .ollama)}+ @Test+ func voiceTranscriptionRouteSelectsLocalParakeetModel() throws {+ let router = AIModelRouter(registry: .defaultHybridPlanner)++ let selected = try router.route(+ AIModelRouteRequest(+ jobType: .voiceTranscription,+ privacyMode: .privacySensitive,+ requiredCapabilities: [.audioInput]+ )+ )++ #expect(selected.id == "local-voice-transcription-parakeet-tdt-0.6b-v3")+ #expect(selected.role == .voiceTranscription)+ #expect(selected.provider == .localRuntime)+ #expect(selected.modelID == "nvidia/parakeet-tdt-0.6b-v3")+ #expect(selected.endpoint.absoluteString == "local://nvidia/parakeet-tdt-0.6b-v3")+ #expect(selected.docsURL.absoluteString == "https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3")+ #expect(selected.capabilities == [.audioInput])+ #expect(selected.rollbackID == "local-voice-transcription-whisper-large-v3-turbo")+ #expect(selected.metadata["runtime"] == "nvidia-nemo")+ #expect(selected.metadata["local"] == "true")+ #expect(selected.metadata["fallbackModelID"] == "openai/whisper-large-v3-turbo")+ }++ @Test+ func voiceTranscriptionRouteFallsBackToWhisperWhenParakeetFailed() throws {+ let router = AIModelRouter(registry: .defaultHybridPlanner)++ let selected = try router.route(+ AIModelRouteRequest(+ jobType: .voiceTranscription,+ privacyMode: .privacySensitive,+ failedModelEntryIDs: ["local-voice-transcription-parakeet-tdt-0.6b-v3"],+ requiredCapabilities: [.audioInput]+ )+ )++ #expect(selected.id == "local-voice-transcription-whisper-large-v3-turbo")+ #expect(selected.provider == .localRuntime)+ #expect(selected.modelID == "openai/whisper-large-v3-turbo")+ }+@Testfunc ollamaTaskIntentAdapterBuildsLocalRequestAndDecodesValidatedIntent() async throws {let httpClient = FakeAIHTTPClient(@@ -381,12 +424,21 @@ struct AIHarnessAdapterTests {timeoutMS: timeoutMS,promptVersion: promptVersion,evalStatus: evalStatus,- docsURL: provider == .openAI- ? URL(string: "https://platform.openai.com/docs/api-reference/responses/create")!- : URL(string: "https://docs.ollama.com/api")!+ docsURL: docsURL(for: provider))}+ private func docsURL(for provider: AIModelProvider) -> URL {+ switch provider {+ case .openAI:+ return URL(string: "https://platform.openai.com/docs/api-reference/responses/create")!+ case .ollama:+ return URL(string: "https://docs.ollama.com/api")!+ case .localRuntime:+ return URL(string: "local://test-model")!+ }+ }+private func responseData(outputText: String) -> Data {let escaped = outputText.replacingOccurrences(of: "\\", with: "\\\\")diff --git a/docs/README.md b/docs/README.mdindex 70883684..fb2d4727 100644--- a/docs/README.md+++ b/docs/README.md@@ -4,7 +4,7 @@ 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, installed-app/task resolution, local-model command parsing with catalog validation, local navigation, guarded input, result verification, latency reporting, and optional slow planner recovery. Weather lookup is the first benchmark definition for this generic system, not a Weather-specific architecture.+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, installed-app/task resolution, local-model command parsing with catalog validation, local voice-transcription model selection, local navigation, guarded input, result verification, latency reporting, and optional slow planner recovery. Weather lookup is the first benchmark definition for this generic system, not a Weather-specific architecture.## Product Guidesdiff --git a/docs/guides/minimal-run-coordinator.md b/docs/guides/minimal-run-coordinator.mdindex 18d68d0e..b1ad8ed8 100644--- a/docs/guides/minimal-run-coordinator.md+++ b/docs/guides/minimal-run-coordinator.md@@ -42,7 +42,7 @@ Donkey also supports slow-path planner hint contracts. `StructuredPlannerHint` cDonkey also supports the first slow-planner sidecar beside the dry-run reflex loop. `DryRunSlowPlannerSidecar` can trigger on scene changes, low confidence, repeated fallback/failure, already-complete local-navigation goals, or explicit user instruction. It builds compact planner snapshots from the latest world state, action, bounded trace summaries, optional screenshot artifact references, and run memory. Planner work is notified from the dry-run loop after reflex trace publication in a fire-and-forget task, so model latency is not included in reflex p95. `ValidatedPlannerHintBus` publishes only validated hints, and `PlannerHintAwareControllerPolicy` can expose the latest still-valid hint to a controller without letting planner output become direct input.-Donkey also supports the first AI harness model registry and router boundary. `AIModelRegistry` stores model roles, providers, literal model ids, endpoints, capabilities, timeouts, prompt versions, eval status, docs URLs, and rollback ids as registry data. `AIModelRouter` routes slow-path jobs by job type, risk, privacy mode, latency tolerance, capabilities, failed-model history, and allowed providers. Privacy-sensitive planner routes prefer local Ollama-compatible entries when they are available. Literal provider model ids should stay in registry entries, not planner/controller logic.+Donkey also supports the first AI harness model registry and router boundary. `AIModelRegistry` stores model roles, providers, literal model ids, endpoints, capabilities, timeouts, prompt versions, eval status, docs URLs, and rollback ids as registry data. `AIModelRouter` routes slow-path jobs by job type, risk, privacy mode, latency tolerance, capabilities, failed-model history, and allowed providers. Privacy-sensitive planner routes prefer local Ollama-compatible entries when they are available. Privacy-sensitive voice-transcription routes prefer local runtime entries and currently select NVIDIA Parakeet TDT 0.6B v3, with Whisper large-v3-turbo as a local rollback candidate. Literal provider model ids should stay in registry entries, not planner/controller logic.Donkey also supports the first provider-neutral planner-hint adapter boundary using OpenAI's Responses API. `OpenAIPlannerHintAdapter` reads `OPENAI_API_KEY` from the environment, routes through the model registry, sends a structured-output Responses request with `store: false`, decodes a strict planner-hint JSON response, and records a model-call trace with role, provider, model id, prompt version, schema id, latency, timeout, validation status, and source trace/state ids. Missing credentials, cancellation, timeout, rate limit, invalid output, and provider outage return traceable failures without stopping the reflex loop. Official OpenAI docs were rechecked on May 16, 2026 for the Responses API, `text.format` JSON schema structured outputs, `store: false`, and current model registry default guidance.@@ -73,7 +73,7 @@ Donkey supports a runtime-level manual target context capture service that wiresThe installed executable also supports a developer-only launch-argument entrypoint for manual verification. `--list-window-candidates` prints the current candidate-list labels and durable `windowID` values. `--manual-capture` runs one manual capture, optionally with `--window-id <id>`, `--run-id <safe-id>`, and `--trace-id <safe-id>`, then prints the run folder and artifact paths. These commands are non-interactive and exit before showing the pointer prompt overlay.-This is a coordination, in-memory reflex trace, hot-loop contract, deterministic dry-run skeleton, bounded target-window frame-source, cheap metadata perception, recorded off-the-shelf local vision evidence, screenshot segmentation model-candidate catalog, deterministic controller, local-navigation dry-run, generic local-app task catalog/intent/dry-run adapter, guarded live-action smoke boundary, slow-planner sidecar, action-engine guardrail, latency-report, planner-hint contract, model-registry/router, OpenAI and Ollama-compatible planner adapters, memory, replay/eval, target-metadata, single-screenshot artifact, read-only Accessibility snapshot, and manual capture orchestration foundation only. It does not run live vision models or OCR over captured pixels, ship a default OS input backend, perform Accessibility actions, provide a manual capture UI, persist high-volume reflex traces to disk, provide continuous streaming capture, or make model calls required for reflex ticks.+This is a coordination, in-memory reflex trace, hot-loop contract, deterministic dry-run skeleton, bounded target-window frame-source, cheap metadata perception, recorded off-the-shelf local vision evidence, screenshot segmentation model-candidate catalog, deterministic controller, local-navigation dry-run, generic local-app task catalog/intent/dry-run adapter, guarded live-action smoke boundary, slow-planner sidecar, action-engine guardrail, latency-report, planner-hint contract, model-registry/router, local voice-transcription model selection, OpenAI and Ollama-compatible planner adapters, memory, replay/eval, target-metadata, single-screenshot artifact, read-only Accessibility snapshot, and manual capture orchestration foundation only. It does not run live transcription, live vision models, or OCR over captured pixels, ship a default OS input backend, perform Accessibility actions, provide a manual capture UI, persist high-volume reflex traces to disk, provide continuous streaming capture, or make model calls required for reflex ticks.## Technical Guidelines@@ -109,6 +109,7 @@ This is a coordination, in-memory reflex trace, hot-loop contract, deterministic- Treat planner hints as validated, expiring advice. Controllers may use the latest valid hint, but planner output must never become direct input.- Keep slow planner work beside the reflex loop. Trigger it from compact state, trace, memory, and artifact references; never await model calls from the hot tick before recording the reflex trace.- Keep model selection in `AIModelRegistry` data. Do not scatter provider model ids through planner code.+- Keep local voice transcription as a model-routed local runtime job. The pointer prompt can capture microphone levels today, but speech-to-text still needs an adapter that consumes bounded audio buffers, calls the selected local runtime model, and emits validated transcript text before it enters command parsing.- Keep privacy-sensitive Responses API calls configured with `store: false` unless an explicit later policy changes that default.- Treat provider failures as sidecar failures. Missing credentials, timeout, rate limit, invalid output, or outage should leave the controller running on local state and existing valid hints.- Keep memory writes source-linked and scoped. Model-proposed memory writes must pass the deterministic approver before storage; target and user records require TTL or explicit durable retention.@@ -125,7 +126,7 @@ From `apps/Donkey/`:swift test```-The runtime tests should cover lifecycle ordering, abort and timeout safety, latest-session queue drops, tool permission denial, event-store ordering, context compaction, reflex trace latency math, bounded in-memory reflex trace retention, reflex event publication, hot-loop contract Codable round trips, coordinate conversion, stale-signal marking, deterministic dry-run trace publication, queue-depth-1 dropped-frame counting, bounded target-window frame capture, target-frame safety and overlap refusal, target-frame no-artifact/no-encoding metadata, cheap perception signal projection, recorded off-the-shelf vision evidence projection, screenshot segmentation model-candidate selection, controller confidence/staleness fallback, controller p95 replay timing under 20ms, local-navigation metadata projection and action selection, local-navigation browser-tab metadata projection, loop-integrated local-navigation dry-run action selection, local-model task intent request shaping and validation, deterministic local-app task parsing fallback and alias expansion, local-app catalog resolution and app availability checks, local-app navigation request construction, generic dry-run step projection, guarded keyboard command templates, observed visible-text verification, guarded local-navigation live-smoke gating and trace evidence, abort/timeout release traces, slow-planner trigger/snapshot/validated-hint publication, planner-latency isolation from reflex reports, action-engine permission/focus/rate/hold/release guardrails, latency report percentiles and replay benchmark formatting, planner hint validation/expiry/latest-selection, model registry routing, OpenAI Responses request shaping and failure handling, memory approval/storage/list/delete/context snapshots, replay/eval metric aggregation and model update checklist fields, artifact path validation, trace folder layout, JSONL event persistence, summary updates, deterministic window resolver behavior through fixture providers, candidate-list label snapshots, screenshot artifact metadata, bounded Accessibility serialization, missing Accessibility trust partial events, unsafe target refusal, overlap-sensitive capture refusal, manual capture event ordering through persisted coordinator events, and debug launch-argument parsing/formatting.+The runtime tests should cover lifecycle ordering, abort and timeout safety, latest-session queue drops, tool permission denial, event-store ordering, context compaction, reflex trace latency math, bounded in-memory reflex trace retention, reflex event publication, hot-loop contract Codable round trips, coordinate conversion, stale-signal marking, deterministic dry-run trace publication, queue-depth-1 dropped-frame counting, bounded target-window frame capture, target-frame safety and overlap refusal, target-frame no-artifact/no-encoding metadata, cheap perception signal projection, recorded off-the-shelf vision evidence projection, screenshot segmentation model-candidate selection, controller confidence/staleness fallback, controller p95 replay timing under 20ms, local-navigation metadata projection and action selection, local-navigation browser-tab metadata projection, loop-integrated local-navigation dry-run action selection, local-model task intent request shaping and validation, deterministic local-app task parsing fallback and alias expansion, local-app catalog resolution and app availability checks, local-app navigation request construction, generic dry-run step projection, guarded keyboard command templates, observed visible-text verification, guarded local-navigation live-smoke gating and trace evidence, abort/timeout release traces, slow-planner trigger/snapshot/validated-hint publication, planner-latency isolation from reflex reports, action-engine permission/focus/rate/hold/release guardrails, latency report percentiles and replay benchmark formatting, planner hint validation/expiry/latest-selection, model registry routing, local voice-transcription model routing, OpenAI Responses request shaping and failure handling, memory approval/storage/list/delete/context snapshots, replay/eval metric aggregation and model update checklist fields, artifact path validation, trace folder layout, JSONL event persistence, summary updates, deterministic window resolver behavior through fixture providers, candidate-list label snapshots, screenshot artifact metadata, bounded Accessibility serialization, missing Accessibility trust partial events, unsafe target refusal, overlap-sensitive capture refusal, manual capture event ordering through persisted coordinator events, and debug launch-argument parsing/formatting.Manual smoke commands:diff --git a/docs/guides/pointer-prompt-overlay.md b/docs/guides/pointer-prompt-overlay.mdindex df14c776..adab4e4e 100644--- a/docs/guides/pointer-prompt-overlay.md+++ b/docs/guides/pointer-prompt-overlay.md@@ -19,7 +19,7 @@ Donkey supports a floating macOS pointer prompt overlay:- keeps that fixed offset at screen edges instead of flipping or clamping to the visible screen bounds- keeps runtime and AI harness behavior behind explicit integration boundaries-This is a visual and microphone-level UI capability. It does not capture the screen, send input, call models, or require Accessibility permission. It does request microphone permission so the waveform can reflect live local audio levels.+This is a visual and microphone-level UI capability. It does not capture the screen, send input, call models, transcribe speech, or require Accessibility permission. It does request microphone permission so the waveform can reflect live local audio levels. The AI harness now has a local voice-transcription model route, but the overlay has not yet wired microphone buffers into a speech-to-text adapter.## Technical Guidelines@@ -43,6 +43,7 @@ This is a visual and microphone-level UI capability. It does not capture the scr- Double-Command prompt activation should require two clean Command down/up taps within 450ms. Any intervening key press, mouse press, extra modifier, or overlong Command hold should reset the sequence so normal shortcuts do not summon the modal.- Holding the second clean Command press for the shortcut's configured hold duration should activate the prompt modal and start microphone level capture instead of waiting for the second release.- Keep the overlay non-invasive: no screen capture loop, input execution, Accessibility prompt, or LLM call in this feature.+- Keep voice capture separate from transcription. The overlay may publish bounded local audio buffers to a future transcription adapter, but model execution and command parsing should remain outside the SwiftUI view/controller rendering path.## Verificationdiff --git a/plans/19-ai-harness.md b/plans/19-ai-harness.mdindex e3dccd0d..32d21944 100644--- a/plans/19-ai-harness.md+++ b/plans/19-ai-harness.md@@ -1,6 +1,6 @@# AI Harness-> Active status: not complete. The current repo now has OpenAI and Ollama-compatible planner adapters, model routing, memory scaffolding, and a provider-backed slow-planner generator, but semantic retrieval, redaction, aggregate model observability, and provider-decoded memory write proposals still remain.+> Active status: not complete. The current repo now has OpenAI and Ollama-compatible planner adapters, model routing, local task-intent parsing, local voice-transcription model selection, memory scaffolding, and a provider-backed slow-planner generator, but live transcription, semantic retrieval, redaction, aggregate model observability, and provider-decoded memory write proposals still remain.## Goal@@ -28,6 +28,7 @@ If the harness is slow, offline, rate-limited, or wrong, the controller continue- connect to model providers- choose the right model for each slow-path job+- route local voice transcription before command parsing- parse ambiguous natural commands into validated task intents when deterministic parsing is insufficient- build compact model inputs from world state, traces, screenshots, DOM summaries, and user goals- retrieve useful memory before a planner call@@ -258,6 +259,7 @@ generate_text(request)generate_structured(request, schema)analyze_image(request, schema)embed_text(request)+transcribe_audio(request)stream_events(request)cancel(request_id)```@@ -341,6 +343,14 @@ Local reasoning models are candidates for the AI harness, not the reflex policy.These models can support objectives, coaching, memory, strategy adaptation, and trace review. They should never emit direct input. Their outputs must still become validated planner hints.+## Local Voice Transcription Candidate++Voice input should become plain transcript text before it enters command parsing. Treat transcription as a local runtime job, not as an Ollama chat task and not as direct action authority.++The current default candidate is NVIDIA Parakeet TDT 0.6B v3 through a local NeMo-style runtime. It is selected because the official model card describes a current 600M-parameter ASR model with automatic language detection across 25 languages, punctuation/capitalization, word and segment timestamps, 16kHz mono `.wav`/`.flac` input, and a permissive CC BY 4.0 license. Whisper large-v3-turbo remains the local rollback candidate because it is widely supported in Transformers and local speech stacks.++The next implementation slice should add an adapter that accepts bounded local microphone buffers, normalizes the audio format, invokes the selected local runtime model, emits transcript text plus timing/confidence metadata, and then passes the transcript to the same validated `TaskIntent` path used by typed commands.+## Model RolesDo not hardcode one model everywhere. Assign models by role.@@ -348,6 +358,7 @@ Do not hardcode one model everywhere. Assign models by role.| Role | Default Candidate | Use || --- | --- | --- || `intent_local` | small local structured-output model, with deterministic parser as fallback/validator | common command-to-intent parsing before local app execution |+| `voice_transcription_local` | `nvidia/parakeet-tdt-0.6b-v3`, rollback `openai/whisper-large-v3-turbo` | local speech-to-text before command parsing; never direct input || `planner_default` | `gpt-5.4-mini` | routine slow planning, recovery hints, target reasoning || `planner_strong` | `gpt-5.5` | hard recovery, unfamiliar screens, complex strategy, plan generation || `planner_deep_eval` | `gpt-5.5-pro` | offline trace critique or high-value evaluation only |@@ -369,6 +380,9 @@ Route by job type, risk, latency tolerance, and failure history.if job is common app command parsing:prefer intent_local with a strict timeout and validate output against app-task definitions+if job is voice transcription:+ prefer voice_transcription_local through a local runtime and route the transcript through normal intent validation+if intent_local is unavailable or invalid:use deterministic parser only as fallback for known commandsdiff --git a/plans/20-off-the-shelf-run-loop.md b/plans/20-off-the-shelf-run-loop.mdindex 8f832308..1461d0d1 100644--- a/plans/20-off-the-shelf-run-loop.md+++ b/plans/20-off-the-shelf-run-loop.md@@ -1,6 +1,6 @@# Off-The-Shelf Run Loop-> Active status: not complete. The current repo supports metadata-only local-navigation dry-run scaffolding, generic local-app task catalog parsing/adaptation, local-model command parsing, target-app availability checks, and guarded live-action smoke, but not a live fast-navigation agent for a concrete command such as "show me the weather for SF".+> Active status: not complete. The current repo supports metadata-only local-navigation dry-run scaffolding, generic local-app task catalog parsing/adaptation, local-model command parsing, local voice-transcription model selection, target-app availability checks, and guarded live-action smoke, but not a live fast-navigation agent for a concrete command such as "show me the weather for SF".## Goal@@ -28,7 +28,7 @@ Reasoning LLM<-> Ambiguous Intent / UI Understanding / Memory / Recovery```-The hot path is local and bounded. A small model can help interpret unusual phrasing, but app navigation and action timing come from deterministic logic over structured state.+The hot path is local and bounded. A small model can help interpret unusual phrasing, but app navigation and action timing come from deterministic logic over structured state. Voice commands should enter this same path as transcript text. The selected local ASR model belongs in the model registry; the run loop should only consume validated transcript text and should never let an audio model emit actions directly.## Core Rule@@ -37,6 +37,7 @@ Do not build a custom model pipeline for the first version.The first version should prove:- local-model command-to-intent parsing is reliable for common tasks and validated against known app-task definitions+- local voice transcription, when wired, produces transcript text before the same command-to-intent validation path- macOS app launch/focus is reliable- Accessibility/window metadata can extract useful app state- local visual fallback is available only when Accessibility and metadata are insufficient@@ -52,6 +53,7 @@ The first version should prove:Use existing, swappable components:- local-model command parser for common local commands using app-task definitions+- local voice transcription adapter for microphone commands before command parsing- deterministic parser only as fallback, validator, and test scaffold- installed-app and task-knowledge lookup for target app identity, workflows, controls, and verification rules- small local model or planner hint only for ambiguous command parsingdiff --git a/plans/master-plan.md b/plans/master-plan.mdindex 741b03e4..ac600d1c 100644--- a/plans/master-plan.md+++ b/plans/master-plan.md@@ -56,9 +56,9 @@ The normal Weather benchmark path should work without a remote model call. A tin## Supported Boundary- Runtime shell: minimal run coordination, ordered events, bounded context assembly, local run artifacts, manual target context capture, in-memory reflex trace retention, and stage-split latency reports are supported.-- Fast navigation hot path: typed frame/world-state/action contracts, deterministic dry-run loop, bounded target-window frame source, cheap metadata perception, recorded off-the-shelf detector/template/OCR/segmentation evidence projection, screenshot segmentation model-candidate catalog with Ultralytics YOLO26 nano segmentation (`yolo26n-seg.pt`), swappable world-state projection, deterministic controller, loop-integrated metadata-only local-navigation dry-run action selection, optional caller-supplied browser-tab metadata, dry-run action projection, generic local-app task intent contracts, data-driven task definitions, Ollama-compatible local-model command parsing to validated `TaskIntent`, deterministic parsing as fallback/validator, catalog command resolution, target-app availability checks, generic dry-run task adaptation, local-navigation request construction, step projection, guarded keyboard command templates, visible-text verification, and built-in Weather benchmark data are supported. This is not yet a live fast-navigation agent: there is no default app launch/focus/type backend, no Accessibility action execution, no live local-model UI-understanding fallback, no live YOLO screenshot segmentation runner, and no verified live command-to-result loop.+- Fast navigation hot path: typed frame/world-state/action contracts, deterministic dry-run loop, bounded target-window frame source, cheap metadata perception, recorded off-the-shelf detector/template/OCR/segmentation evidence projection, screenshot segmentation model-candidate catalog with Ultralytics YOLO26 nano segmentation (`yolo26n-seg.pt`), swappable world-state projection, deterministic controller, loop-integrated metadata-only local-navigation dry-run action selection, optional caller-supplied browser-tab metadata, dry-run action projection, generic local-app task intent contracts, data-driven task definitions, Ollama-compatible local-model command parsing to validated `TaskIntent`, deterministic parsing as fallback/validator, catalog command resolution, target-app availability checks, generic dry-run task adaptation, local-navigation request construction, step projection, guarded keyboard command templates, visible-text verification, and built-in Weather benchmark data are supported. This is not yet a live fast-navigation agent: there is no default app launch/focus/type backend, no Accessibility action execution, no live local-model UI-understanding fallback, no live YOLO screenshot segmentation runner, no live voice-transcription adapter, and no verified live command-to-result loop.- Safety boundary: action-engine command contracts, permission/focus/rate/hold/release guardrails, guarded live-action smoke with an injected backend, and replayable command traces are supported before any default OS input or Accessibility-action backend exists.-- Slow AI boundary: local-model task-intent parsing, structured planner hints, validation/expiry/latest-valid selection, loop-adjacent slow-planner trigger/snapshot sidecar, model registry/router, OpenAI Responses and Ollama-compatible planner adapters, provider-backed local/online planner fallback, source-linked memory, and replay/eval scaffolding are supported as optional sidecar pieces. This is not yet the complete AI harness because semantic retrieval, redaction, aggregate model observability, live local visual UI understanding, and provider-decoded memory write proposals remain active.+- Slow AI boundary: local-model task-intent parsing, local voice-transcription model routing, structured planner hints, validation/expiry/latest-valid selection, loop-adjacent slow-planner trigger/snapshot sidecar, model registry/router, OpenAI Responses and Ollama-compatible planner adapters, provider-backed local/online planner fallback, source-linked memory, and replay/eval scaffolding are supported as optional sidecar pieces. NVIDIA Parakeet TDT 0.6B v3 is the selected local voice-transcription default, with Whisper large-v3-turbo as a local rollback candidate. This is not yet the complete AI harness because semantic retrieval, redaction, aggregate model observability, live microphone transcription, live local visual UI understanding, and provider-decoded memory write proposals remain active.- Source of truth: detailed supported behavior lives in `docs/guides/minimal-run-coordinator.md`; active unfinished work lives in this plan and its primary/supporting plans.## Non-Negotiable Rules@@ -84,7 +84,7 @@ Recent commits completed these pieces:- current slice: generic local-app task catalog, local-model command parser, deterministic fallback parser, app availability check, and dry-run adapter boundary, with Weather lookup represented as built-in benchmark data.- `d6e48c9`: archived plans, which was premature for this milestone.-The code now includes the first generic local-app task catalog, Ollama-compatible local-model command parser, deterministic fallback parser, app availability check, dry-run adapter boundary, and YOLO26 screenshot segmentation model-candidate metadata. It does not yet include default app launch/focus/type execution, Accessibility action execution, live local-model UI understanding over bounded screenshots/crops, live YOLO screenshot segmentation inference, live result verification, semantic memory retrieval, remote-input redaction hooks, aggregate model observability, or provider-decoded memory write proposals.+The code now includes the first generic local-app task catalog, Ollama-compatible local-model command parser, deterministic fallback parser, app availability check, dry-run adapter boundary, YOLO26 screenshot segmentation model-candidate metadata, and local voice-transcription model routing. It does not yet include default app launch/focus/type execution, Accessibility action execution, live local-model UI understanding over bounded screenshots/crops, live YOLO screenshot segmentation inference, live microphone transcription, live result verification, semantic memory retrieval, remote-input redaction hooks, aggregate model observability, or provider-decoded memory write proposals.## What Should Be Done Next@@ -92,8 +92,9 @@ The code now includes the first generic local-app task catalog, Ollama-compatibl2. Add the default local action backend needed for this narrow first benchmark: app launch/activation plus guarded keyboard typing/clicking or Accessibility actions, with emergency release and focus checks.3. Add a local model UI-understanding fallback for bounded screenshot/crop context when Accessibility and metadata are insufficient. Prefer this before OCR-specific extraction; OCR can remain a measured optional adapter.4. Add a measured local screenshot segmentation runner for the YOLO26 candidate only after choosing export/runtime format and crop size; keep it outside live control until p95 latency and mask quality are recorded.-5. Add benchmark/reporting evidence for command-to-result latency, local navigation/action latency, verification confidence, visual fallback latency, and comparison against manual/chat-style workflows.-6. Keep the current dry-run/guarded-live safety boundary: local or online LLM output can only become validated intent, task definitions, app-knowledge updates, observation summaries, or planner hints, never direct input.+5. Wire pointer-prompt voice input to a local transcription adapter: capture bounded microphone buffers, run the selected local runtime ASR model, emit transcript text, and pass that transcript through the same validated command-intent path as typed input.+6. Add benchmark/reporting evidence for command-to-result latency, local navigation/action latency, verification confidence, visual fallback latency, voice transcription latency/accuracy, and comparison against manual/chat-style workflows.+7. Keep the current dry-run/guarded-live safety boundary: local or online LLM output can only become validated intent, task definitions, app-knowledge updates, observation summaries, transcripts, or planner hints, never direct input.## Completion Gates@@ -103,6 +104,7 @@ Do not move the primary/supporting plans back to `plans/done/` until:- Dry-run traces and guarded live traces explain intent parsing, app launch/focus, observation, selected rule, input/backend calls, verification, and guardrail decisions.- The task is measurably faster than a documented manual baseline on the same machine, or the report clearly identifies which stage prevents that.- The broader AI harness can retrieve bounded semantic memory, redact remote-bound visual/DOM context, aggregate model-call observability, and route provider-decoded memory proposals through deterministic approval.+- Voice commands, when enabled, produce local transcript text through the model-routed transcription boundary before command parsing, with no remote dependency.- The hot loop continues to run when the slow AI harness is disabled or failing.- p50/p95/p99 reports cover intent parse, app launch/focus, observation, controller decision, action projection, input execution, result verification, and any capture/perception fallback.- The relevant guide in `docs/guides/` documents the supported behavior and boundaries.