MCPcopy
hub / github.com/nanbingxyz/5ire / IPromptStore

Interface IPromptStore

src/stores/usePromptStore.ts:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10const debug = Debug('5ire:stores:usePromptStore');
11
12export interface IPromptStore {
13 prompt: IPromptDef | null;
14 prompts: IPromptDef[];
15 createPrompt: (prompt: Partial<IPromptDef>) => Promise<IPromptDef>;
16 updatePrompt: (
17 prompt: { id: string } & Partial<IPromptDef>,
18 ) => Promise<boolean>;
19 deletePrompt: (id: string) => Promise<boolean>;
20 setPrompt: (prompt: IPromptDef | null) => void;
21 getPrompt: (id: string) => Promise<IPromptDef>;
22 fetchPrompts: ({
23 limit, // to fetch all prompts practically
24 offset,
25 keyword,
26 }: {
27 limit?: number;
28 offset?: number;
29 keyword?: string;
30 }) => Promise<IPromptDef[]>;
31}
32
33const usePromptStore = create<IPromptStore>((set, get) => ({
34 prompt: null,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected