Skip to content

braidio#10: asset upload/list/reference via dol.content - #14

Merged
thorwhalen merged 1 commit into
mainfrom
feature/asset-crud-dol-content
Aug 1, 2026
Merged

thorwhalen merged 1 commit into
mainfrom
feature/asset-crud-dol-content

Conversation

@thorwhalen

Copy link
Copy Markdown
Collaborator

Closes #10.

Lets a remote connector caller bring media into a project instead of needing a pre-existing server path — the missing half of "add assets, list them, and reference them in braidio's work."

What

  • workspace.py — per-project content store (dol.with_content_addressing over dol.Files, injectable → s3dol later) + a JSON metadata sidecar + asset_path() resolver. The asset layer drops raw pathlib.
  • tools.py — new FREE tools upload_asset (uri, SSRF-guarded via _docs.fetch_uri, or data_b64) / list_assets / get_asset, content-addressed (identical bytes dedupe), returning a dol.ContentRef. Segment sources now accept source.asset_id (a ContentRef itemId), resolved to a server-local path in save_script + weave_project.
  • _guide.py — help/instructions document the upload_asset → asset_id → weave flow.
  • pyproject.toml — dol>=0.3.57 pinned in the mcp extra (the asset tools use dol.content; pin the floor so installs don't resolve an older dol without it).

Design notes

  • Per-project, content-addressed. Assets live under {project}/assets/{hash} (dedup) with a JSON sidecar under {project}/assets_meta/ for list_assets (the CAS store only knows hashes — the content/metadata sidecar split).
  • Backend injected. Local Files now; the same tools work over an s3dol store later with no change. URLs (S3 presigned) resolve on demand via dol.content_url — never baked into a persisted ref.
  • Scope. One-shot renders (render_format/render_production) keep asset_path as-is; asset-by-reference is wired for the project-graph path (save_script/weave_project), which is the linked-artifact substrate.

Tests

3 new asset tests (dedup/list/get, project+source guards, asset_id→path resolution); full mcp suite 47 passed. Tool count 28 → 31 (COSTED still 7).

Depends on i2mint/dol#79 (dol.content, released as dol 0.3.57).

https://claude.ai/code/session_01Gw5RPgrQhC88Hc3DyACYWF

Closes the connector's asset gap: a remote caller can now bring media into a
project instead of needing a pre-existing server path.

- workspace.py: per-project content store (dol.with_content_addressing over
  dol.Files, injectable -> s3dol later) + a JSON metadata sidecar + asset_path()
  resolver. Drops raw pathlib for the asset layer.
- tools.py: new FREE tools upload_asset (uri, SSRF-guarded via _docs.fetch_uri, or
  data_b64) / list_assets / get_asset — content-addressed (dedup), returning a
  dol.ContentRef. Segment sources now accept `source.asset_id` (a ContentRef
  itemId), resolved to a server-local path in save_script + weave_project.
- _guide.py: help/INSTRUCTIONS document the upload -> asset_id -> weave flow.

Requires dol with dol.content (i2mint/dol #79). 3 asset tests; mcp suite 47 green.

Claude-Session: https://claude.ai/code/session_01Gw5RPgrQhC88Hc3DyACYWF
@thorwhalen
thorwhalen merged commit a86a718 into main Aug 1, 2026
8 checks passed
@thorwhalen
thorwhalen deleted the feature/asset-crud-dol-content branch August 1, 2026 20:27
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.

MCP connector: deliver produced audio to a remote caller + ingest remote media

1 participant