@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
37 lines (36 loc) • 1.53 kB
TypeScript
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
import type { string_agent_permanent_id } from '../../../../types/string_agent_name';
/**
* Prepared agent source payload ready for database persistence.
*
* The original source may contain `META ID`, which should not be stored verbatim
* because clones and imports must receive a fresh local permanent id.
*
* @private shared persistence helper for `AgentCollectionInSupabase`
*/
export type PreparedAgentSourceForPersistence = {
/**
* Parsed profile based on the normalized source that will be stored.
*/
readonly agentProfile: AgentBasicInformation;
/**
* Source normalized for persistence, with any `META ID` lines removed.
*/
readonly agentSource: string_book;
/**
* Permanent id extracted from the original source before stripping `META ID`.
*/
readonly permanentId: string_agent_permanent_id | undefined;
};
/**
* Normalizes one agent source before persistence.
*
* This keeps create/update flows aligned when a source includes `META ID`.
*
* @param agentSource - Raw agent source about to be stored.
* @returns Parsed profile, normalized source, and extracted permanent id.
*
* @private shared persistence helper for `AgentCollectionInSupabase`
*/
export declare function prepareAgentSourceForPersistence(agentSource: string_book): PreparedAgentSourceForPersistence;