Repository navigation
feat: WebCodecs media fast path, inline diff approval, local folder search (Wave M2) - #210
Merged
Merged
Conversation
…al folder search - ffmpeg tool: plan supported trim/remux/transcode/scale jobs (mp4/mov/webm/mkv) and run them through WebCodecs + mediabunny@1.65.2 before loading the ~31 MB FFmpeg WASM core; clean fallback to FFmpeg on unsupported args, missing WebCodecs, invalid conversions or dropped tracks. New optional engine param. - Permission dialog: XSS-safe (DOM/textContent only) unified before/after diff for write_file/create_file/edit_file with line numbers, +/- stats, new-file badge and WCAG-AA light/dark colours. Edit logic extracted to file-edits.ts. - Local Folder Search: opt-in, on-device semantic + keyword index in IndexedDB (idb-vector-style VectorDB, deterministic TF+trigram embeddings behind a pluggable provider, incremental reindex). Ctrl/Cmd+K panel and permission-gated search_folder_semantic agent tool. DB version 7. - Docs: README quickstart + Mermaid architecture, docs/local-folder-search.md, docs/webcodecs-fast-path.md; CLAUDE.md updates. - Tests: unit tests for fast-path planner/selector/fallback, diff generator and renderer XSS safety, vector store and folder index; a11y test for the panel. - CI: lean type-check + Vitest + build workflow; Playwright launches Chromium with --mute-audio --use-mock-keychain --password-store=basic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave M2 flagship upgrades for Co-do.
1. WebCodecs + mediabunny fast path for
ffmpegsrc/wasm-tools/adapters/webcodecs-fast-path.ts. It contains a pure planner (planFastPath,parseTimecode,parseBitrate,parseScaleFilter, …), plusdetectWebCodecsSupport,selectMediaEngine, andexecuteFastPath, which lazilyimport()smediabunny@1.65.2.ffmpeg-adapter.tsvalidates the input first, then tries the fast path for trim/remux/transcode/scale/fps jobs between MP4, MOV, WebM and MKV. When it succeeds, the ~31 MB FFmpeg WASM core is never instantiated.engineparam:auto(default),ffmpegorwebcodecs.ffmpeg-adapterimports, so it is not in the main bundle.2. Inline unified diff in the permission approval dialog
write_file,create_fileandedit_filepass a lazily computed{ diffPreview: { path, before, after } }context tocheckPermission. It is computed only when the permission level is ask.src/diff-preview.tsbuilds the model, using prefix/suffix trimming so small edits to big files still preview, plus row and cell caps.createElement/textContent/setAttribute(noinnerHTML). A unit test uses a fake DOM that throws oninnerHTMLand checks that a<script>/onerrorpayload stays text.src/file-edits.ts, so the preview and the actual write use exactly the same transform.3. Local Folder Search (opt-in, 100% client-side)
src/folder-search/contains:VectorDB, which follows theidb-vector-style contract (insert/update/delete/query → {object,key,similarity}) with pluggable backends. It is a small local store rather than an extra dependency.EmbeddingProvider: no model download, works offline, and can be swapped out.size:mtimesignatures and the provider id.co-do-dbv7,folder-indexstore), scoped per workspace.path:start-endinto the prompt. There is also a sidebar button that only appears once a folder is open.search_folder_semanticagent tool, gated by the existing permission system (default Ask, under the new Local Search group).4. Docs and housekeeping
docs/local-folder-search.mdanddocs/webcodecs-fast-path.md. CLAUDE.md is updated.deno.jsonwas already removed onmainandgit grep -i denofinds nothing, so nothing was left to remove..github/workflows/ci.yml, a lean type-check + Vitest +build:web-onlyjob. The existing Playwright visual workflow is still disabled as it was.--mute-audio --use-mock-keychain --password-store=basic.package-lock.jsonresolvedURL points athttps://registry.npmjs.org/, andnpm ci --ignore-scripts --dry-runexits 0.Verification
npm run type-check: passes.npm run test:unit: 456 tests across 12 files pass. 182 are new: 138 for the fast path, 16 for the diff preview/edits, 28 for folder search.npm run build: passes. It builds the WASM tools, runs tsc and vite, and copies 38 C-built WASM binaries.Ctrl+Kaccessibility test passes, including the axe scan. The other Playwright tests time out locally onwaitForLoadState('networkidle')because theversion-check-workerrequest never finishes. This happens onmaintoo, so this PR didn't cause it.