Module search

Module search 

Source
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 ๐Ÿ”’