/** * Web view of the agent capability registry (`@opengeni/contracts` * agent-config). Every screen that shows or edits what an agent can do (the * workspace defaults page, the composer's Capabilities panel, the session * Agent panel and the schedule form) reads its groups, labels and request * shapes from here, so they cannot drift from the server's meaning. * * A "draft" is what a picker edits: a starting point plus the full value of * every capability. `requestFromDraft` turns it back into the smallest * `AgentCapabilities` request (a starting point plus only the toggles that * differ from it), which is what the server stores and what people read in * the API. */ import { type AgentCapabilities, type AgentCapabilityId, type AgentCapabilityStartingPoint, type AgentSkillsCapability, type ClientAgentConfig, type ResolvedAgentCapabilities, type ResolvedAgentConfig } from "@opengeni/contracts"; export type { AgentCapabilityId, ResolvedAgentCapabilities }; export type AgentCapabilityGroup = { id: "conversation" | "work" | "workspace"; label: string; capabilities: readonly AgentCapabilityId[]; }; /** Three groups, in the order people scan them. Every capability appears once. */ export declare const AGENT_CAPABILITY_GROUPS: readonly AgentCapabilityGroup[]; export declare function capabilityLabel(id: AgentCapabilityId): string; export declare function capabilityDescription(id: AgentCapabilityId): string; /** The two starting points, in product words, each with its consequence. */ export declare const AGENT_STARTING_POINTS: readonly { value: AgentCapabilityStartingPoint; title: string; description: string; }[]; export declare const SKILLS_OPTIONS: readonly { value: "off" | "read" | "manage"; label: string; }[]; export declare function skillsOptionValue(value: AgentSkillsCapability): "off" | "read" | "manage"; export declare function skillsFromOption(value: "off" | "read" | "manage"): AgentSkillsCapability; export declare const UNAVAILABLE_CAPABILITY_REASON = "Not enabled on this server"; /** Capabilities this deployment offers. Unknown ids (an older server) count as available. */ export type CapabilityAvailability = { isAvailable: (id: AgentCapabilityId) => boolean; unavailable: ReadonlySet; }; export declare function capabilityAvailability(config: Pick | null | undefined, alsoUnavailable?: readonly AgentCapabilityId[]): CapabilityAvailability; export declare function baseCapabilities(from: AgentCapabilityStartingPoint): ResolvedAgentCapabilities; export type AgentCapabilityDraft = { from: AgentCapabilityStartingPoint; values: ResolvedAgentCapabilities; }; /** * The editable form of a request. Omitted means "everything". A workspace's * older "Ask questions" setting (off) still turns the default off unless the * request says otherwise, matching the server's resolution. */ export declare function draftFromRequest(capabilities: AgentCapabilities | undefined, options?: { legacyHumanInputOff?: boolean | undefined; }): AgentCapabilityDraft; /** A frozen session configuration as a draft (for editing a running session). */ export declare function draftFromResolved(config: ResolvedAgentConfig): AgentCapabilityDraft; /** * The smallest request for a draft: its starting point, plus only the * capabilities that differ from it. A capability this server does not offer * is never sent as on (the server would refuse it). */ export declare function requestFromDraft(draft: AgentCapabilityDraft, availability?: CapabilityAvailability): AgentCapabilities; /** Switch the starting point: every capability takes that starting point's value. */ export declare function withStartingPoint(draft: AgentCapabilityDraft, from: AgentCapabilityStartingPoint): AgentCapabilityDraft; export declare function withCapability(draft: AgentCapabilityDraft, id: AgentCapabilityId, value: boolean | AgentSkillsCapability): AgentCapabilityDraft; export declare function capabilityOn(values: ResolvedAgentCapabilities, id: AgentCapabilityId): boolean; /** What actually runs: a capability the server doesn't offer is off. */ export declare function effectiveCapabilityOn(values: ResolvedAgentCapabilities, id: AgentCapabilityId, availability: CapabilityAvailability): boolean; export declare function draftsEqual(left: AgentCapabilityDraft, right: AgentCapabilityDraft): boolean; /** * One short line for a chip or a muted row value: "All capabilities", * "9 of 13 capabilities". Counts only what this server offers. */ export declare function capabilitySummary(values: ResolvedAgentCapabilities, availability: CapabilityAvailability): string; /** The workspace's saved defaults, or null when it follows Opengeni's defaults. */ export declare function workspaceAgentDefaultsDraft(input: { capabilities: AgentCapabilities | undefined; legacyHumanInputOff: boolean; }): AgentCapabilityDraft; /** Tool owner in product words, for the Technical details list. */ export declare function toolOwnerLabel(owner: AgentCapabilityId | "runtime" | "sandbox" | "product"): string; /** * Agent-setting failures in product words: what happened and what to do. * The raw API text (with its reference) is only a last resort. */ export declare function agentConfigErrorText(error: unknown, fallback: string): string;