Skip to content

feat(client): support service version ranges - #42023

Merged
thdxr merged 5 commits into
anomalyco:v2from
mattrobrob:service-version-ranges
Aug 12, 2026
Merged

feat(client): support service version ranges#42023
thdxr merged 5 commits into
anomalyco:v2from
mattrobrob:service-version-ranges

Conversation

@mattrobrob

Copy link
Copy Markdown

Issue for this PR

Closes #42010

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Allows the existing version option in Service.discover() and Service.ensure() to accept npm semver ranges as well as exact values.

await Service.ensure({ version: ">=2.0.0 <3.0.0" })

Valid semver expressions are matched as ranges, including prereleases. Non-semver values such as local and test keep their existing exact-string behavior. Promise and Effect service clients use the same matcher.

How did you verify your code works?

  • cd packages/client && bun test (57 passed)
  • cd packages/client && bun run typecheck
  • cd packages/client && bun run build
  • Repository pre-push typecheck (32 packages passed)
  • Prettier and git diff --check

Repository-wide lint still has one unrelated existing error in packages/session-ui/src/v2/components/prompt-input/index.tsx:163; targeted lint for the changed client files has zero errors.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@mattrobrob
mattrobrob force-pushed the service-version-ranges branch 2 times, most recently from b2ab031 to 4ec80c0 Compare August 12, 2026 13:22
@mattrobrob
mattrobrob force-pushed the service-version-ranges branch from 4ec80c0 to 4537896 Compare August 12, 2026 13:25
@thdxr

thdxr commented Aug 12, 2026

Copy link
Copy Markdown
Member

Tweaked this a bit to keep the client dependency-free: version can now be either the existing exact string or a compatibility predicate. That lets callers bring whatever range logic they need without us baking npm semver parsing into the client. I updated the tests/docs and pushed the change to this branch.

@thdxr thdxr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the service compatibility changes and follow-up updates. Looks good.

@thdxr
thdxr merged commit f06a86e into anomalyco:v2 Aug 12, 2026
2 checks 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.

2 participants