You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(attachments): support uploading files on replies and thread creation (#13)
* feat(attachments): support uploading files on replies and thread creation
Ports the twist-cli attachment feature to comms-cli, backed by the
`attachments` client in @doist/comms-sdk 0.4.1.
- Bump @doist/comms-sdk 0.3.0 -> 0.4.1
- `src/lib/local-file.ts` (`openLocalFileAsBlob`) reads a path into a
file-backed Blob with structured FILE_NOT_FOUND / FILE_READ_ERROR errors
- `src/lib/attachments.ts` (`uploadAttachments`) validates every path up
front, then uploads each concurrently (order preserved)
- `tdc thread reply`, `tdc conversation reply`, and `tdc thread create`
gain a repeatable `--file`; a file-only post (no text) is allowed
- `conversation reply` preflights the conversation before uploading so an
invalid/forbidden target fails before orphaning an upload
- `--file` + `--close`/`--reopen` on thread reply -> CONFLICTING_OPTIONS
- Add an `attachments.upload` spinner entry so uploads route through
`wrapResult` for the 403 -> INSUFFICIENT_SCOPE re-login prompt
- Add `attachments:read` / `attachments:write` to the OAuth scopes
- Skill content + regenerated SKILL.md; tests for all of the above
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(attachments): address review feedback on #13
- thread reply: build a `satisfies`-typed createComment request so the
`attachments` contract is compiler-checked again; only `recipients`
(EVERYONE sentinels) keeps the assertion
- local-file: try `openAsBlob` first (happy path = one open, no TOCTOU);
fall back to an `fs.open` probe only on failure to recover the real
errno (openAsBlob masks it as ERR_INVALID_ARG_VALUE)
- attachments: cap upload concurrency (4) while preserving input order
- options: `collect` defaults `previous` to `[]` so the contract holds
even if a caller forgets the Commander default
- dry-run now validates attachment paths (without uploading) so the
preview fails on a bad path exactly as a real run would
- tests: attachments.upload exercised through the mutating write-guard
(incl. read-only block), local-file FILE_READ_ERROR branch, and a
conversation preflight-failure-skips-upload case
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: avoid new Array() in concurrency helper (oxlint no-new-array)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments