feat: add Nori Sessions broker proxy transport (0.2.0)#3
Merged
Conversation
The CLI now supports two transports behind one interface: direct mode
(SLACK_BOT_TOKEN via @slack/web-api) and proxy mode (NORI_SLACK_PROXY_URL +
NORI_SLACK_CONTEXT_TOKEN, POSTing {method, args} to the session broker).
Proxy mode wins when both are configured, matching the sessions wrapper it
replaces. All CLI features — --json-input, --paginate, --dry-run,
kebab→snake conversion, type coercion, error suggestions — now behave
identically in both modes, which lets the sessions repo delete its
hand-rolled proxy client.
Pagination is a single transport-generic cursor loop, broker errors are
normalized into the standard error envelope (including extracting Slack
platform codes), --dry-run reports the selected transport, and the
accidental self-dependency is removed from package.json. Version 0.2.0.
🤖 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
src/transport.ts): direct mode (SLACK_BOT_TOKENvia@slack/web-api) and proxy mode (NORI_SLACK_PROXY_URL+NORI_SLACK_CONTEXT_TOKEN, POSTing{method, args}to the Nori Sessions broker's/methodendpoint). Proxy wins when both are configured, matching the sessions bash wrapper it replaces.--json-input,--paginate(now a single transport-generic cursor loop),--dry-run(reports the selectedtransport), kebab→snake conversion, type coercion, and error suggestions. Broker errors are normalized into the standard error envelope, including extracting Slack platform codes from broker messages.nori-slack-cli@^0.1.0) from package.json. Bumps to 0.2.0.Why
Nori Sessions currently ships a separate hand-rolled 74-line proxy client next to this CLI, selected by a branching bash wrapper. The two implementations diverged: in proxy mode (the managed-session default)
--json-inputfails outright, kebab-case flags are silently sent unconverted, and there is no coercion/pagination/discovery. This PR makes the real CLI speak the proxy wire protocol so the sessions repo can delete the duplicate (companion PR in nori-sessions).Test plan
test/proxy-mode.test.tsagainst a real local HTTP fake broker (wire format, precedence, trailing-slash URLs,--json-inputpass-through, coercion, error mapping incl. 401, cursor pagination, dry-run transport reporting, no-credentials envelope) — written red-firsttsc --noEmitcleannori-slack-cli@0.2.0to npm (@amol), then land the companion sessions PR that deletes the hand-rolled client and bumps base.lock.json