Skip to content

feat: add download subcommand for Slack files (0.4.0)#6

Merged
CSRessel merged 1 commit into
mainfrom
feat/file-download
Jun 24, 2026
Merged

feat: add download subcommand for Slack files (0.4.0)#6
CSRessel merged 1 commit into
mainfrom
feat/file-download

Conversation

@nori-sessions

@nori-sessions nori-sessions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

🤖 Generated with Nori

  • Adds a first-class nori-slack download --id <F123> --output <path> subcommand that resolves a file and writes its raw bytes to disk, replacing the old base64 files.download proxy hack. (Uses --id, deliberately not --file, to avoid colliding with upload --file.)
  • Transport gains downloadFile() with proxy- and direct-mode implementations. Proxy mode hits the broker's new GET /slack-proxy/download (the session has no bot token); direct mode resolves files.info then fetches url_private_download with the bot token.
  • Direct mode guards against Slack's HTTP-200 HTML sign-in page, which would otherwise be written to disk as a "successful" download when the token is rejected.
  • Serializes test runs (--no-file-parallelism) to stop subprocess-based CLI tests flaking under vitest concurrency.

Note: this should be published to npm before the companion broker change (tilework-tech/nori-sessions#1140) deploys, since the broker's rewritten attached-files prompt instructs sessions to run nori-slack download.

Test Plan

  • npm test (proxy-mode happy path + 403/404/401 error mapping + arg validation; direct-mode byte fetch + HTML-login-page rejection)
  • npx tsc --noEmit clean
  • Manual: nori-slack download --id F123 --output ./out.bin against a real broker proxy and a direct bot token

Adds a first-class `nori-slack download --id <F123> --output <path>`
subcommand that resolves a file and writes its raw bytes to disk,
replacing the base64 `files.download` proxy hack.

- Transport gains `downloadFile()` with proxy- and direct-mode impls.
- Direct mode guards against Slack's HTTP-200 HTML sign-in page, which
  would otherwise be written to disk as a "successful" download.
- Test runs are serialized (--no-file-parallelism) to stop subprocess
  CLI tests flaking under vitest concurrency.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
@CSRessel CSRessel merged commit a960018 into main Jun 24, 2026
1 check 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