Repository navigation
braidio#10: asset upload/list/reference via dol.content - #14
Merged
Merged
Conversation
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
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.
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_addressingoverdol.Files, injectable →s3dollater) + a JSON metadata sidecar +asset_path()resolver. The asset layer drops rawpathlib.tools.py— new FREE toolsupload_asset(uri, SSRF-guarded via_docs.fetch_uri, ordata_b64) /list_assets/get_asset, content-addressed (identical bytes dedupe), returning adol.ContentRef. Segment sources now acceptsource.asset_id(a ContentRefitemId), resolved to a server-local path insave_script+weave_project._guide.py—help/instructions document theupload_asset → asset_id → weaveflow.pyproject.toml—dol>=0.3.57pinned in themcpextra (the asset tools usedol.content; pin the floor so installs don't resolve an older dol without it).Design notes
{project}/assets/{hash}(dedup) with a JSON sidecar under{project}/assets_meta/forlist_assets(the CAS store only knows hashes — the content/metadata sidecar split).Filesnow; the same tools work over ans3dolstore later with no change. URLs (S3 presigned) resolve on demand viadol.content_url— never baked into a persisted ref.render_format/render_production) keepasset_pathas-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