Skip to content

Agent 媒体桥:解 stub inspect_timeline(合成帧之眼)+ import_media(path/bytes)#182

Merged
appergb merged 1 commit into
mainfrom
feat/agent-media-bridge
Jul 2, 2026
Merged

Agent 媒体桥:解 stub inspect_timeline(合成帧之眼)+ import_media(path/bytes)#182
appergb merged 1 commit into
mainfrom
feat/agent-media-bridge

Conversation

@appergb

@appergb appergb commented Jul 2, 2026

Copy link
Copy Markdown
Owner

新 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 全绿。

…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.
@appergb appergb merged commit 04de569 into main Jul 2, 2026
2 checks passed
@appergb appergb deleted the feat/agent-media-bridge branch July 2, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant