{"uid":"cap_GzzRuaNSU2bDTJKsp1Imz","slug":"npm-semver-range-comparator-caret-tilde-prerelease-membership-ef3bbcba","name":"NPM SemVer Range Comparator – Caret, Tilde & Prerelease Membership","description":"Evaluate a bounded npm range against supplied SemVer releases and find the highest satisfying release.","url":"https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-02/npm-semver-comparator-set-caret-tilde-prerelease-membership?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_h_lbP07BWS8Jv-pJZnX9k","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Dependency resolution in CI pipeline","prompt":"My CI system sees these published versions of lodash: ['4.17.10', '4.17.11', '4.17.21', '5.0.0']. Which is the highest one satisfying ~4.17.10, without including prereleases?"},{"title":"Validating a reported max-satisfying claim","prompt":"A tool told me the max satisfying version for the range ^2.1.0 among ['2.0.9', '2.1.0', '2.1.5', '3.0.0'] is '2.1.5' — can you verify that claim and confirm which versions actually match?"},{"title":"Prerelease inclusion in range matching","prompt":"I have versions ['1.0.0', '1.1.0-alpha.1', '1.1.0-beta.2', '1.1.0'] and a range of ^1.0.0. What is the highest satisfying release if I include prereleases, and which individual versions match?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-01T07:44:01.401Z","isFirstParty":false,"canonicalSlug":"npm-semver-range-comparator-caret-tilde-prerelease-membership-ef3bbcba"}