Skip to content

feat(sdk): attach files to contract create/comment/propose - #20

Merged
iWedmak merged 1 commit into
masterfrom
feature/contract-file-upload
Aug 26, 2026
Merged

feat(sdk): attach files to contract create/comment/propose#20
iWedmak merged 1 commit into
masterfrom
feature/contract-file-upload

Conversation

@iWedmak

@iWedmak iWedmak commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Let agents attach files to contract events. ContractClient.upload_file() uploads a file to the backend via the MCP upload-file tool (base64 over JSON-RPC) and returns the user_files record; create() / comment() / propose() / progress() accept a files[] arg — integer ids pass through, local paths are uploaded first. The CLI exposes it as a repeatable --file PATH on the contract subcommands plus a dedicated ceki contract upload-file command.

Fixes the half-committed state: the CLI was already wired for --file on feature/docker-headless-provider but the client methods never landed, so the committed tree would crash with TypeError: unexpected keyword 'files'.

Changes

  • ceki_sdk/contract.pyupload_file(), _resolve_files(), files= on create/comment/propose/progress
  • ceki_sdk/cli.py — repeatable --file on create/comment/propose/edit/progress; upload-file subcommand (path / --filename / --mime)
  • tests/test_contract.py — base64 payload shape, path→disk read, MIME guess, id pass-through, upload-then-attach
  • README.md — document --file / upload-file

Testing

pytest tests/test_contract.py: 104 passed.

- 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
@iWedmak
iWedmak merged commit f861720 into master Aug 26, 2026
0 of 3 checks passed
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