UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

64 lines (63 loc) 2.37 kB
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements'; import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition'; /** * META commitment definition * * The META commitment handles all meta-information about the agent such as: * - META AVATAR: Sets the agent's built-in default avatar visual * - META IMAGE: Sets the agent's avatar/profile image URL * - META LINK: Provides profile/source links for the person the agent models * - META DOMAIN: Sets the canonical custom domain/host of the agent * - META TITLE: Sets the agent's display title * - META DESCRIPTION: Sets the agent's description * - META INPUT PLACEHOLDER: Sets chat input placeholder text * - META [ANYTHING]: Any other meta information in uppercase format * * These commitments are special because they don't affect the system message, * but are handled separately in the parsing logic for profile display. * * Example usage in agent source: * * ```book * META AVATAR pixel-art * META IMAGE https://example.com/avatar.jpg * META LINK https://twitter.com/username * META DOMAIN my-agent.com * META TITLE Professional Assistant * META DESCRIPTION An AI assistant specialized in business tasks * META INPUT PLACEHOLDER Write a message... * META AUTHOR John Doe * META VERSION 1.0 * ``` * * @private [🪔] Maybe export the commitments through some package */ export declare class MetaCommitmentDefinition extends BaseCommitmentDefinition<`META${string}`> { constructor(); /** * Short one-line description of META commitments. */ get description(): string; /** * Icon for this commitment. */ get icon(): string; /** * Markdown documentation for META commitment. */ get documentation(): string; applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements; /** * Extracts meta information from the content based on the meta type * This is used by the parsing logic */ extractMetaValue(metaType: string, content: string): string | null; /** * Validates if the provided content is a valid URL (for IMAGE and LINK types) */ isValidUrl(content: string): boolean; /** * Checks if this is a known meta type */ isKnownMetaType(metaType: string): boolean; }