UNPKG

@promptbook/vercel

Version:

Promptbook: Turn your company's scattered knowledge into AI ready books

59 lines (58 loc) 2.45 kB
import type { SupabaseClient } from '@supabase/supabase-js'; 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_name } from '../../../../types/typeAliases'; import { AgentCollectionInSupabaseOptions } from './AgentCollectionInSupabaseOptions'; import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema'; /** * Agent collection stored in Supabase table * * Note: This object can work both from Node.js and browser environment depending on the Supabase client provided * * @public exported from `@promptbook/core` * <- TODO: [🐱‍🚀] Move to `@promptbook/supabase` package */ export declare class AgentCollectionInSupabase { private readonly supabaseClient; readonly options?: AgentCollectionInSupabaseOptions | undefined; /** * @param rootPath - path to the directory with agents * @param tools - Execution tools to be used in [🐱‍🚀] `Agent` itself and listing the agents * @param options - Options for the collection creation */ constructor(supabaseClient: SupabaseClient<AgentsDatabaseSchema>, options?: AgentCollectionInSupabaseOptions | undefined); /** * Gets all agents in the collection */ listAgents(): Promise<ReadonlyArray<AgentBasicInformation>>; /** * [🐱‍🚀]@@@ */ getAgentSource(agentName: string_agent_name): Promise<string_book>; /** * Creates a new agent in the collection * * Note: You can set 'PARENT' in the agent source to inherit from another agent in the collection. */ createAgent(agentSource: string_book): Promise<AgentBasicInformation>; /** * Updates an existing agent in the collection */ updateAgentSource(agentName: string_agent_name, agentSource: string_book): Promise<void>; /** * Deletes an agent from the collection */ deleteAgent(agentName: string_agent_name): Promise<void>; /** * Get the Supabase table name with prefix * * @param tableName - The original table name * @returns The prefixed table name */ private getTableName; } /** * TODO: [🐱‍🚀] Implement it here correctly and update JSDoc comments here, and on interface + other implementations * TODO: Write unit test * TODO: [🧠][🚙] `AgentXxx` vs `AgentsXxx` naming convention */