MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getPromptMap

Method getPromptMap

aitc/aitc.ts:121–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 return {};
120 }
121 }
122
123 static getPromptMap(): Record<string, string> {
124 const raw = this.get(
125 CONFIG_KEYS.PROMPT_MAP,
126 DEFAULT_CONFIG[CONFIG_KEYS.PROMPT_MAP],
127 );
128 try {
129 const parsed = JSON.parse(raw);
130 if (!parsed || typeof parsed !== "object") return {};
131 const result: Record<string, string> = {};
132 for (const [key, value] of Object.entries(parsed)) {
133 if (typeof key === "string" && typeof value === "string") {
134 result[key] = value;
135 }
136 }
137 return result;
138 } catch (error) {
139 console.error("aitc plugin failed to parse prompt map", error);
140 return {};
141 }
142 }
143

Callers 2

setPromptMethod · 0.95
handleAitcCommandFunction · 0.80

Calls 2

getMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected