feat!: parse Comms URLs with the SDK - #55
Merged
Merged
Conversation
The SDK holds the shared Comms route rules, so parseCommsUrl hands the
URL to it rather than walking path segments here. Both the /a/{id}/ and
bare /{id}/ prefixes, the staging and local hosts, and the inbox and
saved thread routes are all covered by it.
A bare workspace URL names no entity, so the SDK does not recognise it;
that case is still read here, and a malformed route still falls through
to workspace-only rather than being misrouted as a thread, comment, or
conversation ref.
The search fallback link now comes from getFullCommsURL too, rather than
being the one hand-built URL left in the CLI.
Test IDs were short placeholders that the shared rules reject, so the
URL fixtures now use real base58-encoded UUIDv7 values.
BREAKING CHANGE: a Comms URL whose entity ID is not a base58-encoded
UUIDv7 is no longer recognised. Comms only issues IDs in that format, so
this rejects malformed links rather than passing them to the API.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
doistbot
reviewed
Aug 26, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
Comms URL parsing now goes through the SDK, with the CLI keeping only the workspace-only and malformed-route fallbacks.
Few things worth tightening:
- Add a workspace-only case for a well-formed path whose ID is not a base58 UUIDv7 (e.g.
/a/12345/ch/CH1), so that breaking contract cannot silently regress.
Every parse case now uses a valid base58-encoded UUIDv7, so the contract this change introduces — a well-formed path whose id is not that shape names no entity and reads as workspace-only — could regress without a failure. Covers the channel, thread and conversation routes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
doist-release-bot Bot
added a commit
that referenced
this pull request
Aug 26, 2026
## [3.0.0](v2.0.4...v3.0.0) (2026-08-26) ### ⚠ BREAKING CHANGES * a Comms URL whose entity ID is not a base58-encoded UUIDv7 is no longer recognised. Comms only issues IDs in that format, so this rejects malformed links rather than passing them to the API. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * test: pin the non-base58 id contract Every parse case now uses a valid base58-encoded UUIDv7, so the contract this change introduces — a well-formed path whose id is not that shape names no entity and reads as workspace-only — could regress without a failure. Covers the channel, thread and conversation routes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> ### Features * parse Comms URLs with the SDK ([#55](#55)) ([6fbd645](6fbd645))
Contributor
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What
Takes
@doist/comms-sdk3.0.0 and moves the CLI's Comms URL parsing onto it. The SDK now holds the shared route rules (backed by@doist/sdk-kmp), soparseCommsUrlhands the URL over instead of walking path segments here.The SDK covers everything the CLI's own parser did — both the
/a/{workspaceId}/and bare/{workspaceId}/prefixes, the staging and local hosts, and the inbox and saved-thread routes — which removed about 900 characters of segment-walking including theparseInboxOrSavedThreadRoutehelper.Two things stay local:
null; that case is still read here.null.The search fallback link now comes from
getFullCommsURLtoo, rather than being the one hand-built URL left in the CLI.Breaking
A Comms URL whose entity ID is not a base58-encoded UUIDv7 is no longer recognised. The old parser accepted any string in an ID position; the shared rules validate the format.
Comms only ever issues IDs in that format — the SDK's own
generateIdandisValidUuidV7Base58are the source — so this rejects malformed links up front rather than passing them to the API and reporting "not found". The CLI's ownlooksLikeOpaqueCommsIdalready assumed the same shape.Test fixtures
46 tests failed on this, purely because their fixture IDs were short placeholders (
100,200,CH1,TH1,7YpL3oZ4kZ9vP7Q1tR2sX3z) that the shared rules reject. Left alone they would have quietly exercised the workspace-only fallback and proven nothing, so the URL fixtures now use real base58-encoded UUIDv7 values.Verification
858 tests pass,
type-check,lint:checkandbuildall clean.🤖 Generated with Claude Code