Open source CapCut alternative.
TypeScript
Consolidate repo docs and trim README
David Lee737c946635e
diff --git a/AGENTS.md b/AGENTS.mdindex fd4a145b..b0ce4b65 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -11,6 +11,14 @@ Use `plans/master-plan.md` as the active implementation driver when it exists anUse other `plans/` files only for background unless the user explicitly asks to plan from them or the master plan names them as cleanup targets. Do not let older plans override the current master plan.+## Site Project++Before changing `site/` UI, routes, API handlers, or data access patterns:++- Read the relevant Next.js guide in `site/node_modules/next/dist/docs/`; this version may differ from your training data.+- Read the applicable site guidance in `docs/guides/`.+- Do not run database migrations, including `prisma migrate`, `prisma db push`, or any command that applies schema changes to Supabase or another database.+## Working Rules- Ask before creating any new plan document.diff --git a/READ.ME b/READ.MEdeleted file mode 100644index 8ee2742a..00000000--- a/READ.ME+++ /dev/null@@ -1,93 +0,0 @@-# Low-Latency Desktop Gaming Agent--## Goal--Build a desktop AI agent that can play games in real time.--Gaming is the first proof point because it makes latency obvious. If the agent can understand the screen, make decisions, and control the game quickly, the same architecture can later operate normal desktop software.--## Core Positioning--> A real-time desktop agent that sees your screen and controls your computer with low latency.--Gaming is the first production proving ground.-Desktop automation is the larger platform.-------# Product Principles--## 1. Latency First--The agent must feel instant.--Target loop:--- Screen capture: 5–15ms-- Perception: 10–50ms-- Action decision: 1–20ms-- Input execution: 1–5ms-- Total reflex loop: under 100ms--Do not call a large LLM every frame.-------## 2. Hybrid Intelligence--Use two brains:--### Fast Controller--Runs many times per second.--Handles:-- movement-- aiming/clicking-- dodging-- combat reactions-- menu navigation-- repeated game loops--This should be local and small.--### Slow Planner--Runs occasionally.--Handles:-- strategy-- goals-- “what should I do next?”-- quests-- resource planning-- inventory choices-- recovery from confusion--This can use a larger VLM/LLM.-------# High-Level Architecture--```text-Game Screen- ↓-Screen Capture- ↓-Perception Pipeline- ↓-World State- ↓-Planner + Controller- ↓-Action Engine- ↓-Keyboard / Mouse / Controller Input- ↓-Game-```--## Supported Product Guides--Implemented and supported capabilities are documented in [docs/README.md](docs/README.md). Plans are exploratory; docs are the maintained guide layer for completed product behavior and technical rules.diff --git a/README.md b/README.mdnew file mode 100644index 00000000..5e6bb8c4--- /dev/null+++ b/README.md@@ -0,0 +1,32 @@+# Donkey++Donkey is a low-latency desktop agent for macOS that sees the screen, understands local context, and controls apps quickly.++## More Info++- `docs/README.md`: supported product behavior and engineering guidance.+- `docs/guides/`: focused guides for maintained capabilities and project conventions.+- `plans/master-plan.md`: active implementation driver when present.+- `plans/`: exploratory, active, and historical planning context.++## Build++Build and run the macOS app:++```sh+cd apps/Donkey+swift build+swift run Donkey+```++Build and run the site:++```sh+cd site+npm install+npm run db:generate+npm run build+npm run dev+```++The site uses Supabase Postgres through Prisma. Keep local credentials in `.env` and do not commit them.diff --git a/apps/Donkey/README.md b/apps/Donkey/README.mddeleted file mode 100644index a9699065..00000000--- a/apps/Donkey/README.md+++ /dev/null@@ -1,19 +0,0 @@-# Donkey--SwiftUI macOS app for the production pointer prompt UI.--This slice renders a compact prompt modal with a live voice waveform. Double-tap Command and release to show and focus the prompt modal near the current pointer location, where the modal stays pinned while live microphone levels drive the waveform. The prompt starts as a wide pill, expands into a rounded rectangle for multiline text, and moves the waveform into a bottom toolbar that blends with the input background without a divider or inactive controls. Clicking outside the modal dismisses it, and a small gray circular x button at the top-right outside corner closes it directly. The overlay opens near the mouse on a 45-degree bottom-right diagonal by default.--It requests microphone permission for local waveform visualization. It does not request Accessibility, Screen Recording, model access, screen capture-loop, or input-control permissions.--Guides:--- [Pointer Prompt Overlay](../../docs/guides/pointer-prompt-overlay.md)-- [Swift MVC Guide](../../docs/guides/swift-mvc.md)--```sh-swift build-swift run Donkey-```--Pointer theme resources are retained for future pointer rendering work in [Sources/Donkey/Resources/theme.json](Sources/Donkey/Resources/theme.json).diff --git a/docs/README.md b/docs/README.mdindex 13d2a93f..cb026e12 100644--- a/docs/README.md+++ b/docs/README.md@@ -6,22 +6,18 @@ Plans describe what we might build. Guides describe what Donkey currently supporThere 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/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.-## Product Guides+## Guides-- [Pointer Prompt Overlay](guides/pointer-prompt-overlay.md): double-Command standard macOS-style `Make this so` composer that opens near the mouse at a fixed offset.-- [Install Donkey Locally](guides/install-donkey.md): package the SwiftPM executable into a clickable local macOS app bundle for manual testing.+Supported product and engineering guides live in `docs/guides/`.-## Engineering Guides--- [Swift MVC Guide](guides/swift-mvc.md): Swift/AppKit/SwiftUI organization rules for model-view-controller boundaries.-- [Minimal Run Coordinator](guides/minimal-run-coordinator.md): in-memory run lifecycle, events, policy checks, session queueing, context compaction, manual capture orchestration, and reflex trace boundary.+Add or update a guide there when behavior becomes supported. Do not maintain duplicate guide indexes in subdirectories or app folders; use descriptive filenames and link directly from related docs only when the relationship helps a maintainer.## Navigation Rules-- Add a guide here when a plan moves to `plans/done/`.- Treat `plans/done/` as background only; do not use archived plans as active implementation instructions.- Ask before creating a new active plan.- Move active plans to `plans/done/` only after the behavior is implemented, documented, and verified.- Product guides should explain supported behavior, boundaries, and verification.- Engineering guides should explain patterns current code must follow, not speculative architecture.- Guides should not duplicate implementation. Prefer intent, rules, and concise source entrypoints over code listings or long file inventories.+- New docs do not need to be registered in multiple places. Prefer one canonical file in `docs/` and selective cross-links only where they carry context.diff --git a/docs/architecture.md b/docs/architecture.mdnew file mode 100644index 00000000..9c7960b9--- /dev/null+++ b/docs/architecture.md@@ -0,0 +1,182 @@+# Donkey Architecture++This document is a compact map of Donkey's supported runtime architecture. The+source of truth for behavior and boundaries remains+[`docs/guides/minimal-run-coordinator.md`](guides/minimal-run-coordinator.md).++## App-Level Components++```text++--------------------------------------------------------------------------------++| Donkey.app |+| |+| +----------------------+ +----------------------+ +---------------+ |+| | Pointer Prompt UI | | Runtime Setup UI | | Debug CLI | |+| | typed/voice command | | install runtimes | | smoke tools | |+| +----------+-----------+ +----------+-----------+ +-------+-------+ |+| | | | |+| v v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Command Intake | | Local Runtime Setup | | Manual Target | |+| | text/transcript | | manifests/cache | | Capture | |+| +----------+-----------+ +----------+-----------+ +-------+-------+ |+| | | | |+| v v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Task Intent Resolver |<---->| Runtime Registry | | Artifact Store| |+| | validated TaskIntent | | sidecar executables | | traces/files | |+| +----------+-----------+ +----------------------+ +-------+-------+ |+| | ^ |+| v | |+| +----------------------+ +----------------------+ +-------+-------+ |+| | RunCoordinator |----->| Event Stream |----->| Status/Reports| |+| | lifecycle + policy | | assistant/tool/etc. | | latency/replay| |+| +----------+-----------+ +----------------------+ +---------------+ |+| | |+| v |+| +----------------------+ +----------------------+ +---------------+ |+| | Local App Runner |----->| Capture/Observation |----->| Action Engine | |+| | dry-run or guarded | | AX/window/screenshot | | keyboard/AX | |+| +----------------------+ +----------------------+ +---------------+ |+| |++--------------------------------------------------------------------------------++```++The app shell owns user entrypoints and setup. `RunCoordinator` owns lifecycle,+event ordering, permission policy, bounded context assembly, and reflex trace+publication. Capture, observation, model sidecars, task adaptation, and input+execution stay behind narrow runtime boundaries.++## Fast Local Runloop++```text++--------------------------------------------------------------------------------++| Fast Local Navigation Hot Path |++--------------------------------------------------------------------------------++| |+| user command or transcript |+| | |+| v |+| +----------------------+ +----------------------+ +---------------+ |+| | Task Definitions |----->| Local LLM Parser |----->| TaskIntent | |+| | built-in + JSON/JSONL| | sidecar JSON schema | | validated | |+| +----------+-----------+ +----------------------+ +-------+-------+ |+| | | |+| v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Catalog Resolution |----->| Local App Adapter |----->| Run Request | |+| | app/task available | | steps + verification | | target + plan | |+| +----------------------+ +----------+-----------+ +-------+-------+ |+| | | |+| v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Launch / Focus |----->| Observation |----->| World State | |+| | target app/window | | AX + metadata + UI | | typed compact | |+| +----------------------+ +----------+-----------+ +-------+-------+ |+| | | |+| v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Reflex Frame Source |----->| Perception Projector |----->| Controller | |+| | latest frame wins | | typed affordances | | semantic act | |+| +----------------------+ +----------------------+ +-------+-------+ |+| | |+| v |+| +----------------------+ +----------------------+ +---------------+ |+| | Action Projection |----->| Guardrails |----->| Input Backend | |+| | dry-run or live | | policy/focus/rate | | keyboard/AX | |+| +----------+-----------+ +----------------------+ +-------+-------+ |+| | | |+| v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Reflex Trace |----->| Latency Report |<-----| Verification | |+| | monotonic timings | | p50/p95/p99 | | visible text | |+| +----------------------+ +----------------------+ +---------------+ |+| |++--------------------------------------------------------------------------------++```++The hot path must keep working without a remote model call. Local model output is+validated into typed contracts before execution, controller output is semantic,+and the action engine is the only boundary allowed to issue guarded OS input.++## Local Stack And Model Sidecars++```text++--------------------------------------------------------------------------------++| Local Machine Stack |++--------------------------------------------------------------------------------++| |+| +----------------------+ +----------------------+ +---------------+ |+| | Donkey Swift Runtime |----->| JSON Sidecar Runner |----->| Runtime Store | |+| | contracts/controllers| | stdin/stdout process | | App Support | |+| +----------+-----------+ +----------+-----------+ +-------+-------+ |+| | | | |+| | v | |+| | +----------------------+ | |+| | | App-Managed Registry |<-------------+ |+| | | executable paths | |+| | +----------+-----------+ |+| | | |+| v v |+| +----------------------+ +----------------------+ +---------------+ |+| | macOS Services | | Local Command LLM | | Parakeet ASR | |+| | AX/SCK/LaunchServices| | TaskIntent JSON | | transcript | |+| +----------+-----------+ +----------------------+ +---------------+ |+| | |+| v |+| +----------------------+ +----------------------+ +---------------+ |+| | Target Apps | | YOLO Segmentation | | UI Understand | |+| | Weather/Music/docs | | bounded screenshots | | screenshot obs| |+| +----------------------+ +----------------------+ +---------------+ |+| |++--------------------------------------------------------------------------------++```++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.++## Slower AI Harness++```text++--------------------------------------------------------------------------------++| Slow Models And Advisory Sidecars |++--------------------------------------------------------------------------------++| |+| +----------------------+ +----------------------+ +---------------+ |+| | Reflex Loop |----->| Slow Planner Trigger |----->| Snapshot | |+| | does not await model | | scene/failure/etc. | | compact state | |+| +----------+-----------+ +----------------------+ +-------+-------+ |+| | | |+| | v |+| | +----------------------+ +---------------+ |+| | | Run Memory |----->| Redaction | |+| | | bounded/source-linked| | remote-bound | |+| | +----------+-----------+ +-------+-------+ |+| | | | |+| | v v |+| | +----------------------+ +---------------+ |+| | | AI Model Router |----->| Providers | |+| | | role/privacy/risk | | local/online | |+| | +----------+-----------+ +-------+-------+ |+| | | | |+| | v v |+| | +----------------------+ +---------------+ |+| | | Planner Hint |<-----| Model Trace | |+| | | structured JSON | | latency/cost | |+| | +----------+-----------+ +---------------+ |+| | | |+| v v |+| +----------------------+ +----------------------+ +---------------+ |+| | Existing Controller |<-----| Hint Validator/Bus |----->| Replay/Eval | |+| | can run without hint | | expiry + safety | | promotion | |+| +----------------------+ +----------------------+ +---------------+ |+| |++--------------------------------------------------------------------------------++```++Slow models can help with ambiguous commands, recovery, planner hints, memory+proposals, and observability. Their outputs remain advisory: planner hints expire+and are validated, memory writes pass deterministic approval, and provider+failure leaves the fast local loop running on existing state.diff --git a/docs/guides/README.md b/docs/guides/README.mddeleted file mode 100644index 578219d6..00000000--- a/docs/guides/README.md+++ /dev/null@@ -1,12 +0,0 @@-# Guides--Guides explain what Donkey supports and how to maintain it. They should stay readable and avoid duplicating code.--## Product Support--- [Pointer Prompt Overlay](pointer-prompt-overlay.md)--## Technical Guidelines--- [Swift MVC Guide](swift-mvc.md)-- [Minimal Run Coordinator](minimal-run-coordinator.md)diff --git a/site/docs/frontend-nextjs-guidelines.md b/docs/guides/frontend-nextjs-guidelines.mdsimilarity index 100%rename from site/docs/frontend-nextjs-guidelines.mdrename to docs/guides/frontend-nextjs-guidelines.mddiff --git a/site/AGENTS.md b/site/AGENTS.mddeleted file mode 100644index 09d33dd0..00000000--- a/site/AGENTS.md+++ /dev/null@@ -1,11 +0,0 @@-<!-- BEGIN:nextjs-agent-rules -->-# This is NOT the Next.js you know--This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.-<!-- END:nextjs-agent-rules -->--Also read `docs/frontend-nextjs-guidelines.md` before changing the site UI, routes, API handlers, or data access patterns.--## Database Migrations--Database migrations must be handled manually by the developer. Agents are not allowed to run database migrations, including `prisma migrate`, `prisma db push`, or any command that applies schema changes to Supabase or another database.diff --git a/site/README.md b/site/README.mddeleted file mode 100644index c985249d..00000000--- a/site/README.md+++ /dev/null@@ -1,71 +0,0 @@-# Site--Next.js site and API project for Vercel, backed by Supabase Postgres through Prisma.--## Getting Started--Install dependencies and generate the Prisma client:--```bash-npm install-npm run db:generate-```--Create a Supabase project, copy `.env.example` to `.env`, and set:--```bash-DATABASE_URL="postgresql://postgres:[PASSWORD]@[PROJECT-REF].pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"-DIRECT_URL="postgresql://postgres:[PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres"-```--Run the development server:--```bash-npm run dev-```--Open [http://localhost:3000](http://localhost:3000). The public health route is available at [http://localhost:3000/api/health](http://localhost:3000/api/health).--## Stack--- Next.js App Router with TypeScript and Tailwind CSS.-- shadcn/ui initialized with the `base-nova` style and `@/components` aliases.-- Prisma 7 configured for Supabase Postgres.-- Vercel-compatible `build`, `start`, and `postinstall` scripts.--## Guidelines--Read [Frontend and Next.js Guidelines](docs/frontend-nextjs-guidelines.md) before changing the site UI, routes, API handlers, or data access patterns.--## Database--Prisma is configured in `prisma/schema.prisma` and `prisma.config.ts`. The starter schema includes a `WaitlistEntry` model as a first writable table.--Do not commit `.env`. Set `DATABASE_URL` and `DIRECT_URL` in Vercel before deploying. Database access must go through API/server code; do not expose database configuration with `NEXT_PUBLIC_`.--Use Supabase's pooled connection string for `DATABASE_URL` in serverless runtime code. Use the direct, non-pooled connection string for `DIRECT_URL`; Prisma CLI commands use it through `prisma.config.ts` for migrations and schema pushes.--For local Supabase, run CLI commands from this `site` directory. The local Supabase project id is `donkey`, and the database listens on port `54332` so it can run alongside another local Supabase project using the default ports.--```bash-supabase start-supabase status-```--Use the local database URL for both Prisma variables during development:--```bash-DATABASE_URL="postgresql://postgres:[email protected]:54332/postgres"-DIRECT_URL="postgresql://postgres:[email protected]:54332/postgres"-```--## Scripts--- `npm run dev`: run the app locally.-- `npm run build`: build for production.-- `npm run start`: serve a production build.-- `npm run lint`: run ESLint.-- `npm run db:generate`: generate the Prisma client.-- `npm run db:pull`: introspect an existing Supabase database.--No migrations have been run. When you are ready to create tables, choose the migration workflow deliberately for the Supabase project.