UNPKG

@promptbook/remote-client

Version:

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

42 lines (41 loc) 1.35 kB
import type { string_book } from './string_book'; /** * Helper for manipulating agent books in-memory. * * @private internal helper for `@promptbook/core` */ export declare class BookEditable { private readonly lines; /** * Creates a mutable view over the supplied book content. * * @param book - Agent source text to work with. */ constructor(book: string_book); /** * Creates a new instance from the supplied book text. * * @param book - Agent source text to work with. * @returns Editable view over the book content. */ static from(book: string_book): BookEditable; /** * Returns the editable content as a string_book. * * @returns Current book content with original line breaks preserved. */ toString(): string_book; /** * Checks whether the book contains any non-empty lines. * * @returns `true` when the book has meaningful content beyond blank lines. */ hasNonEmptyContent(): boolean; /** * Finds the last line index whose trimmed text matches the commitment name. * * @param commitment - Commitment keyword to locate (for example `CLOSED`). * @returns Zero-based line index or `null` when the commitment is absent. */ findLastCommitmentLineIndex(commitment: string): number | null; }