cadrumo.entrypoints.tui.search module

Command-palette projections over admitted workbench search and navigation.

The application search service owns the safe snapshot, matching, ranking, and stable result identity. The navigation catalogue owns destination and action admission. This module only adapts those already-authoritative answers to Textual command-palette hits; selecting a hit asks the injected root host to navigate and cannot invoke a business action.

class WorkbenchSearchDoorV1(*args, **kwargs)[source]

Bases: Protocol

The application-owned search door consumed by the palette.

search(request, /)[source]

Return the authoritative bounded result page for a transient query.

Return type:

WorkbenchSearchResponse

Parameters:

request (WorkbenchSearchRequest)

class TuiSearchHostV1(*args, **kwargs)[source]

Bases: Protocol

The root seam through which palette hits request navigation.

property workbench_search_service: WorkbenchSearchDoorV1

Return the already-composed application search service.

property workbench_search_refusal_code: str | None

Return why search is unavailable, or None when it is composed.

property destination_catalogue: TuiDestinationCatalogueV1

Return the already-admitted destination catalogue.

navigate_to(target, /)[source]

Navigate to an already-admitted semantic target.

Return type:

None

Parameters:

target (TuiNavigationTargetV1)

exception TuiSearchHostError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when a palette provider is mounted outside the workbench root.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
workbench_action_label(action_id, *, locale=None)[source]

Render one catalogue action without exposing its internal identifier.

This is the single naming authority for an operator action across the workbench: the palette and Home resolve the same identifier to the same words, so a suggested task and the command that performs it cannot be described differently.

An identifier this build has no wording for renders as explicitly unknown rather than as a plausible label: it still renders, because a table row is not the place to raise, but it never claims to be a named action.

Return type:

str

Parameters:
  • action_id (str)

  • locale (str | None)

class WorkbenchSearchProviderV1(screen, match_style=None)[source]

Bases: Provider

Expose application-ranked workbench results in the command palette.

Parameters:
  • screen (Screen[Any])

  • match_style (Style | None)

async search(query)[source]

Yield only results that still resolve through the current catalogue.

Return type:

AsyncIterator[DiscoveryHit | Hit]

Parameters:

query (str)

class WorkbenchCommandProviderV1(screen, match_style=None)[source]

Bases: Provider

Expose admitted destinations and registered action identities as commands.

Parameters:
  • screen (Screen[Any])

  • match_style (Style | None)

async search(query)[source]

Fuzzy-match the current catalogue’s admitted routes and actions.

Return type:

AsyncIterator[DiscoveryHit | Hit]

Parameters:

query (str)

async discover()[source]

List the current admitted destinations and actions before typing.

Return type:

AsyncIterator[DiscoveryHit | Hit]