feat(sdk): attach files to contract create/comment/propose - #20
Merged
Conversation
- ContractClient.upload_file(): base64 upload via MCP upload-file,
returns the user_files record {id, name, url, size, disk}
- create()/comment()/propose()/progress() accept files[] — int ids
pass through, str/Path are uploaded first (_resolve_files)
- CLI: repeatable --file on create/comment/propose/edit/progress;
new `ceki contract upload-file` subcommand
- README: document --file / upload-file
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
Let agents attach files to contract events.
ContractClient.upload_file()uploads a file to the backend via the MCPupload-filetool (base64 over JSON-RPC) and returns theuser_filesrecord;create()/comment()/propose()/progress()accept afiles[]arg — integer ids pass through, local paths are uploaded first. The CLI exposes it as a repeatable--file PATHon the contract subcommands plus a dedicatedceki contract upload-filecommand.Fixes the half-committed state: the CLI was already wired for
--fileonfeature/docker-headless-providerbut the client methods never landed, so the committed tree would crash withTypeError: unexpected keyword 'files'.Changes
ceki_sdk/contract.py—upload_file(),_resolve_files(),files=on create/comment/propose/progressceki_sdk/cli.py— repeatable--fileon create/comment/propose/edit/progress;upload-filesubcommand (path /--filename/--mime)tests/test_contract.py— base64 payload shape, path→disk read, MIME guess, id pass-through, upload-then-attachREADME.md— document--file/upload-fileTesting
pytest tests/test_contract.py: 104 passed.