/** * Renders the deployed-service catalog the model reads before deciding whether * to retrieve, plus the notice for a workspace that deploys nothing at all. * * These are pure functions on purpose: the selection branches below are the * whole routing policy, and they are far easier to pin down in tests than * through a live pre-step. * * Rendering conventions (settled): * - English frame, service names verbatim — same language as the tool * descriptions, so the model is not switched between languages mid-prompt. * - Truncation is always stated. Silently cutting the list makes the model treat * it as complete and flatly answer "there is no such knowledge base". * - An empty scene omits its whole section. `no chat services` is pure noise and * invites the model to handle a case that does not exist. An empty CATALOG is * the opposite case and does get a message: see {@link buildNoServiceNotice}. * - `bl` is only ever recommended together with how to get it. The retrieval tools talk * to the API directly, so a retrieval-only deployment * can have no `bl` on PATH at all. */ import type { ServiceScene } from "./api-types.js"; import type { ServiceEntry } from "./services.js"; /** Entries rendered per scene before switching to "most recently modified" mode. */ export declare const CATALOG_ENTRY_LIMIT = 10; export interface CatalogInput { entries: readonly ServiceEntry[]; /** Server-reported total, which may exceed `entries` when the fetch itself was capped. */ total: number; /** True when the fetch stopped before the server ran out of rows. */ truncated: boolean; defaultRetrieveAgentId?: string; defaultChatAgentId?: string; } /** * The notice injected when the workspace is reachable but deploys nothing the * tools can call. * * This deliberately contradicts the "omit what does not exist" rule above, and * the cases are not symmetric: an empty SECTION is noise because the other * section still hands the model ids, whereas an empty CATALOG leaves it with no * id at all while `agent_id` stays required. With nothing said, the model either * invents an id — earning a raw server rejection — or silently drops the * retrieval; both read to the user as a broken plugin when the real answer is * "deploy a service". Naming the fix is the only way out that does not require * the model to already have loaded the management skill. * @returns the model-facing notice text. */ export declare function buildNoServiceNotice(): string; /** * The service list appended to a call the server rejected, rendered from a * just-refreshed cache. * * Lives here rather than at the call site so every model-facing rendering obeys * the one set of conventions documented at the top of this file — in particular * that a shortfall is stated and that `bl` never appears without its install * line. * @param scene - the scene the failed call targeted. * @param entries - that scene's entries as of the refresh, newest first. * @returns the text to append to the failure. */ export declare function buildRefreshedSceneList(scene: ServiceScene, entries: readonly ServiceEntry[]): string; /** * Build the catalog text for one cached service list. * @param input - the cached entries plus the deployment's configured defaults. * @returns the model-facing text, or undefined when there is nothing worth injecting. */ export declare function buildServiceCatalog(input: CatalogInput): string | undefined;