# NPM SemVer Range Comparator – Caret, Tilde & Prerelease Membership

> NPM SemVer Range Comparator – Caret, Tilde & Prerelease Membership is a paid API for AI agents from detect.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-12-01).

Evaluates a bounded npm version range (including caret, tilde, and prerelease modifiers) against a supplied list of SemVer releases and returns the highest satisfying version.

## Facts

- Endpoint: POST https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-02/npm-semver-comparator-set-caret-tilde-prerelease-membership?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-semver-range-comparator-caret-tilde-prerelease-membership-ef3bbcba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GzzRuaNSU2bDTJKsp1Imz

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability npm-semver-range-comparator-caret-tilde-prerelease-membership-ef3bbcba -d '<json body>'
```

Example prompt: Given these npm releases — ['1.2.0', '1.3.0', '1.4.0-beta.1', '2.0.0'] — which one is the highest version satisfying the range ^1.2.0, and does it include prereleases? Return the max satisfying version and whether each release matches.

## When to prefer this

Use this endpoint when you need a deterministic, server-side evaluation of an npm-compatible semver range (supporting caret ^, tilde ~, and prerelease flags) against a known list of release versions — especially when you need to verify a claimed resolution rather than trust a client-side library result, or when operating in an environment without a native semver library.

## Known failure modes

- Invalid or unparseable semver range string — returns error or null max_satisfying
- Empty or malformed versions array — validation error
- Version strings that are not valid SemVer — may be skipped or cause parse error
- Contradictory or null claim provided — claim verification may return mismatch
- Range too broad or too narrow yielding no satisfying version — max_satisfying returns null

## How this service works

Evaluate a bounded npm range against supplied SemVer releases and find the highest satisfying release.

## Output

Returns a structured result containing the highest version string satisfying the given npm range (max_satisfying), a list of each input version annotated with whether it matches the range (matches boolean), and optionally a verification of a pre-supplied claim against computed results.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "artifact": {
   "type": "object",
   "required": [
    "npmRanges"
   ],
   "properties": {
    "npmRanges": {
     "type": "object",
     "required": [
      "data",
      "claim"
     ],
     "properties": {
      "data": {
       "type": "object",
       "required": [
        "versions",
        "range",
        "include_prerelease"
       ],
       "properties": {
        "range": {
         "type": "string",
         "maxLength": 512
        },
        "versions": {
         "type": "array",
         "items": {
          "type": "string",
          "maxLength": 128
         },
         "maxItems": 24,
         "minItems": 1
        },
        "include_prerelease": {
         "type": "boolean"
        }
       },
       "additionalProperties": false
      },
      "claim": {
       "anyOf": [
        {
         "type": "null"
        },
        {
         "type": "object",
         "required": [
          "max_satisfying",
          "versions"
         ],
         "properties": {
          "versions": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "matches",
             "version"
            ],
            "properties": {
             "matches": {
              "type": "boolean"
             },
             "version": {
              "type": "string",
              "maxLength": 20000
             }
            },
            "additionalProperties": false
           },
           "maxItems": 4096
          },
          "max_satisfying": {
           "type": "string",
           "maxLength": 20000
          }
         },
         "additionalProperties": false
        }
       ]
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-semver-range-comparator-caret-tilde-prerelease-membership-ef3bbcba/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from detect.halowerk.com](https://www.zero.xyz/host/detect.halowerk.com/llms.txt)
