feat: add upload subcommand for Slack external file uploads#5
Merged
Conversation
Adds a `nori-slack upload` subcommand that drives Slack's three-step external upload flow (files.getUploadURLExternal -> raw byte POST -> files.completeUploadExternal). The byte POST goes directly to Slack's upload host, so it cannot ride the dynamic <method> dispatch path; the mint and completing calls ride the transport, so proxy-mode channel scoping is enforced by the broker at completion. Calls program.enablePositionalOptions() so the default command's --dry-run flag no longer shadows the upload subcommand's flag. Maps a proxy-mode ok:false mint response (HTTP 200) to the Slack platform-error shape so formatError surfaces a suggestion instead of a generic error. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
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
🤖 Generated with Nori
nori-slack uploadsubcommand that drives Slack's modern three-step external file upload flow:files.getUploadURLExternalmints an upload URL, the raw bytes are POSTed directly to Slack's upload host, andfiles.completeUploadExternalshares the file into a channel. The byte POST cannot ride the dynamic<method>dispatch path (it's a binary POST to a different host with no token), which is why uploads need their own subcommand. The mint and completing calls ride the transport, so in proxy mode the broker still enforces the session's channel scoping at completion.program.enablePositionalOptions()so the default command's--dry-runflag no longer shadows the upload subcommand's identically-named flag (Commander was attributing it to the program scope).ok:falsemint response (returned at HTTP 200, so the transport doesn't throw) to the Slackslack_webapi_platform_errorshape, soformatErrorsurfaces an actionable suggestion instead of a genericunknown_error— matching direct-mode behavior.Test Plan
npm run build(tsc typecheck) passes--file(exit 2, no network), mint failure mapped to a Slack code, byte-POST HTTP failure (exit 1), and--dry-runnori-slack upload --file ./report.pdf --channel C123 --dry-runpreviews the plan; a real upload in a Nori session shares the file into the channelShare Nori with your team: https://www.npmjs.com/package/nori-skillsets