Expand description
Catalog lookup and package-resolution helpers.
This module turns a user-facing query or package reference into a concrete catalog package. It keeps the resolution rules close to the catalog database layer so callers can depend on a single, consistent interpretation of the catalog database.
Resolution follows a strict order:
- exact package ID lookups are resolved directly
- a single name match is returned immediately
- exact name matches win when multiple packages share the same query
- ambiguous name queries delegate the final choice to the caller
The goal is to keep search semantics predictable for the CLI while still allowing interactive disambiguation when multiple packages match a name.
Queries are trimmed before search, must not be empty, and are capped at 256 characters so obviously invalid input fails fast.
Constantsยง
- MAX_
QUERY_ ๐LENGTH
Functionsยง
- resolve_
catalog_ ๐package - Resolve a query into a single catalog package.
- resolve_
catalog_ ๐package_ by_ id - Resolve a package by exact catalog ID.
- resolve_
catalog_ ๐package_ ref - Resolve a package reference to a single catalog package.
- search_
packages ๐ - Search the shared catalog connection and return catalog results for the query.
- validate_
query ๐