/** * The canvas app catalog — interactive-canvas-apps Part F. * * publish canvas bytes → pinned artifact app-.html on the session * manifest + armed contract + source → SHARED fact apps/ * find ranked search over the `apps` namespace (hybrid on an enhanced * store; a listing with a term-overlap rank on a base store) * * Pure functions over injected stores, so the session bridge, tests and * scripts all run the SAME code. The card is derived from the DOCUMENT's * manifest, never from a model's memory of it, and an app without an * `interface` block is refused: the card is what another agent drives the * app from, and a card that only says "a board" cannot be driven. */ import type { SessionCatalog } from "./cms.js"; import type { ArtifactStore } from "./session-store.js"; import type { FactStore } from "./facts-store.js"; export interface CanvasAppCatalogDeps { artifactStore: ArtifactStore | null | undefined; catalog: SessionCatalog | null | undefined; factStore: FactStore | null | undefined; /** The publishing session (stamped as publishedBy and the fact's sessionId). */ sessionId: string; agentIdentity?: string | null; workerNodeId?: string; } export interface PublishCanvasAppArgs { name?: string; description?: string; tags?: string[]; slot: number; /** The session whose canvas is published (self or a resolved ancestor). */ target: string; } export interface CanvasAppHit { key: string; name: string; description: string; version: string | null; tags: string[]; kv: unknown; source: unknown; score?: number; } export declare const CANVAS_APP_DESCRIPTION_MIN = 20; export declare function publishCanvasApp(deps: CanvasAppCatalogDeps, args: PublishCanvasAppArgs): Promise | { error: string; }>; /** Rank catalog hits by how many query terms the name/description/tags contain. Exported for the base-store path and its tests. */ export declare function rankCanvasAppHits(hits: CanvasAppHit[], query: string, limit: number): CanvasAppHit[]; export declare function findCanvasApp(deps: Pick, args: { query?: string; limit?: number; }): Promise<{ count: number; apps: CanvasAppHit[]; next: string; } | { error: string; }>; //# sourceMappingURL=canvas-app-catalog.d.ts.map