Check SemVer Range
code.check_semver_range
Overview
When you need a yes-or-no answer on version compatibility, we parse your version and range under the grammar you pick — strict SemVer 2.0.0 comparators or npm-style caret, tilde, hyphen, and x-ranges. Build metadata never affects precedence; you control whether prereleases count. We do not resolve dependency trees or pick versions from a registry — do not use this when you need installation or resolution.
SemVer and npm range rules are easy to get wrong by hand. We apply the same precedence rules every time so your gates stay consistent.
Reliability
STRICT and deterministic for identical inputs. Domain errors (not retryable; fix the input — unchanged retry will not succeed): INVALID_SEMVER (version is not valid SemVer — send a well-formed version); INVALID_SEMVER_RANGE (range cannot be parsed — fix the range syntax); SEMVER_RANGE_TOO_COMPLEX (range exceeds complexity limits — simplify the range); SEMVER_GRAMMAR_UNSUPPORTED (grammar is not semver_2 or npm — pick a supported grammar).
Context footprint
Returns satisfies, normalized version/range, an optional reason, and small _meta. A successful call costs 1 execution credit.
When to use it
When you have a concrete version and range and need a deterministic satisfies answer.
When you need to resolve, install, or pick versions from a registry.
Scope
Non-goals
- Does not guess the grammar
- Does not resolve dependency trees
- Does not fetch registries
- Does not pick a best matching version
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| version | string | Yes | Version value to test. |
| range | string | Yes | Range expression under the selected grammar. |
| grammar | string | No | Range grammar; omit it for npm. |
| includePrerelease | boolean | No | Whether prereleases may satisfy stable comparators; omit it for false. |
| loose | boolean | No | Whether leading markers and partial versions are accepted; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| satisfies | boolean | Yes | Whether the version satisfies the range. |
| normalizedVersion | string | Yes | Canonical rendering of the tested version. |
| normalizedRange | string | Yes | Canonical comparator-set rendering of the range. |
| reason | string | No | Stable negative-verdict reason; omitted when satisfied. |
| comparatorSetCount | integer | Yes | Number of OR-separated comparator sets. |
| _meta | object | Yes | Closed applied grammar-version receipt naming npm-compatible-1 or semver-2.0.0. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"code.check_semver_range","input":{"version":"1.4.0","range":"^1.2.0","grammar":"npm"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("code.check_semver_range", {"range":"^1.2.0","grammar":"npm","version":"1.2.3-beta.1"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| INVALID_SEMVER | 400 | No | The request payload failed this skill's input validation. |
| INVALID_SEMVER_RANGE | 400 | No | The request payload failed this skill's input validation. |
| SEMVER_RANGE_TOO_COMPLEX | 429 | No | A size, quota, rate, or time limit was exceeded. |
| SEMVER_GRAMMAR_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not guess the grammar
- Does not resolve dependency trees
- Does not fetch registries
- Does not pick a best matching version
- Full dependency resolution
- Registry lookups or version picking
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "code.check_semver_range",
"input": {
"range": "^1.2.0",
"grammar": "npm",
"version": "1.2.3-beta.1"
}
}Examples
Caret range excludes prerelease by default
{
"range": "^1.2.0",
"grammar": "npm",
"version": "1.2.3-beta.1"
}{
"reason": "PRERELEASE_EXCLUDED",
"satisfies": false,
"normalizedVersion": "1.2.3-beta.1",
"normalizedRange": ">=1.2.0 <2.0.0-0",
"_meta": {
"grammarVersion": "npm-compatible-1"
},
"comparatorSetCount": 1
}Stable version satisfies npm caret range
{
"range": "^1.2.0",
"grammar": "npm",
"version": "1.4.0"
}{
"_meta": {
"grammarVersion": "npm-compatible-1"
},
"normalizedVersion": "1.4.0",
"comparatorSetCount": 1,
"normalizedRange": ">=1.2.0 <2.0.0-0",
"satisfies": true
}Recommended use cases
- Gate a dependency version against an allowed range in CI
- Validate release candidates against npm caret constraints
- Check strict SemVer comparator sets deterministically
Avoid for
- Full dependency resolution
- Registry lookups or version picking
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.