UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

118 lines • 4.47 kB
import { t as SchemaContract } from "./schema-contract-v05QRSzC.js"; import { t as ControlUiLinkReaderDescriptorSchema } from "./control-ui-link-reader-DRjVeQEq.js"; import { Static } from "typebox"; //#region src/shared/control-ui-link-reader.d.ts declare const LINK_READER_BADGE_TONES: readonly ["neutral", "positive", "negative", "attention", "accent"]; /** Passive link-reader models shared by plugins and the Control UI. */ type ControlUiLinkReaderMetadata = ControlUiLinkReaderDescriptor["linkReader"]; /** Scope-filtered descriptor advertised in hello.controlUiLinkReaders. */ type ControlUiLinkReaderDescriptor = SchemaContract<Static<typeof ControlUiLinkReaderDescriptorSchema>>; type ControlUiLinkReaderPreviewParams = { url: string; /** Selected agent hint; the receiving owner still authorizes identity selection. */ agentId?: string; /** Present only for a descriptor opting into the foreground session context. */ sessionKey?: string; /** Wait for a fresh response instead of returning last-known cached metadata. */ refresh?: boolean; }; type ControlUiLinkReaderDeferredSection = "checks" | "files" | "discussion"; type ControlUiLinkReaderSection = "overview" | ControlUiLinkReaderDeferredSection; type ControlUiLinkReaderDetailParams = ControlUiLinkReaderPreviewParams & { /** Omit for the complete document; supported only by progressive readers. */ section?: ControlUiLinkReaderSection; }; type ControlUiLinkReaderPreview = { /** Last-known metadata while its bounded refresh is in progress. */ stale?: boolean; /** Echo the validated requested URL; query parameters remain part of the resource identity. */ url: string; title: string; subtitle?: string; badge?: { label: string; tone: (typeof LINK_READER_BADGE_TONES)[number]; /** Timestamp of the event represented by the badge, displayed instead of creation time. */ timestamp?: string; }; author?: string; /** Optional HTTPS profile link on the source origin. */ authorUrl?: string; coAuthors?: Array<{ name: string; imageUrl?: string; }>; /** Total including authors omitted from the bounded coAuthors array. */ coAuthorCount?: number; createdAt?: string; updatedAt?: string; metadata?: Array<{ label: string; value: string; tone?: "positive" | "negative"; }>; imageUrl?: string; }; type ControlUiLinkReaderDocument = ControlUiLinkReaderPreview & { /** Markdown rendered through the host's safe passive Markdown renderer. */ body: string; /** Source revision shared by independently loaded sections. */ revision?: string; /** Sections intentionally omitted from an overview, not incomplete upstream data. */ deferredSections?: ControlUiLinkReaderDeferredSection[]; bodyTruncated?: boolean; partial?: boolean; /** Passive provider-reported checks, not a mergeability or approval decision. */ checks?: { state: "success" | "failure" | "pending" | "neutral" | "unavailable"; summary: string; /** Known total; may be incomplete when truncated or unavailable. */ total: number; items: Array<{ name: string; state: "success" | "failure" | "pending" | "neutral"; detail?: string; url?: string; }>; /** The item list is incomplete, including when a source could not be read. */ truncated?: boolean; url?: string; /** Exact source revision these checks describe, when available. */ commit?: string; }; comments?: Array<{ id: string; url: string; author: string; createdAt?: string; body: string; bodyTruncated?: boolean; label?: string; context?: { path?: string; lineLabel?: string; label?: string; diff?: string; diffTruncated?: boolean; replyUrl?: string; replyLabel?: string; }; }>; commentsTotal?: number; commentsTruncated?: boolean; files?: Array<{ path: string; previousPath?: string; status?: string; additions: number; deletions: number; patch?: string; patchTruncated?: boolean; }>; filesTotal?: number; filesTruncated?: boolean; /** Plugin-selected initial file view; the host does not interpret service URL paths. */ filesExpanded?: boolean; }; //#endregion export { ControlUiLinkReaderPreview as a, ControlUiLinkReaderMetadata as i, ControlUiLinkReaderDetailParams as n, ControlUiLinkReaderPreviewParams as o, ControlUiLinkReaderDocument as r, ControlUiLinkReaderDescriptor as t };