Agent 媒体桥:解 stub inspect_timeline(合成帧之眼)+ import_media(path/bytes)#182
Merged
Conversation
…P tools
Give the agent eyes and hands: a new injected MediaBridge trait carries the two
capabilities the agent crate deliberately cannot link (wgpu compositing lives in
opentake-render; the user-facing import path lives behind src-tauri MediaState),
keeping CoreHandle the narrow document surface and dispatch unit-testable with a
fake bridge (default trait methods return "not available", so non-Tauri builds
run bridge-less).
- inspect_timeline (upstream ToolExecutor+InspectTimeline.swift): renders the
composited frame at startFrame, or maxFrames (default 6, cap 12) evenly
sampled across [startFrame,endFrame) with upstream's exact center-of-bucket
formula; aspect-preserving downscale to 512 longest edge (never upscales);
JPEG q70 per frame + a meta block {fps,width,height,totalFrames,frameNumbers}.
All range/validation errors mirror upstream strings. TauriMediaBridge
composites via a self-contained RenderDevice per call (export.rs's isolation
discipline, not the preview's cached RenderState).
- import_media (upstream ToolExecutor+Import.swift): exactly-one-of url/path/
bytes with upstream's validation set (folderId existence, bytes<=15MB base64 +
required mimeType with the 1:1 MIME table, path missing/unsupported-ext
messages); path reuses the SAME import_one/mirror_dir path as the media panel
(posters/manifest/events consistent), directories mirror recursively; bytes
writes imported-<uuid8>.<ext> into bundle media/. url returns a structured
not-yet-supported error (no HTTP client dep chosen yet; flagged for follow-up
— upstream caps downloads at 1GB HTTPS-only).
Gates: fmt/clippy -D warnings clean; cargo test --workspace 1408 (agent 221);
pnpm build clean; pnpm test 330.
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.
新 MediaBridge 注入 trait(agent crate 不背 wgpu 依赖,dispatch 可用假桥单测;默认实现返回不可用)。inspect_timeline 1:1 上游(默认 6 帧/上限 12、bucket 中心采样公式、512 长边降采样、JPEG q70 + meta 块);import_media path/bytes 全通(path 复用媒体面板同一导入路径,目录递归镜像;bytes 写入 bundle media/),url 返回结构化未支持错误(HTTP 客户端依赖待选,follow-up)。门禁:workspace 1408 + web 330 全绿。