MCPcopy Create free account
hub / github.com/Roy3838/Observer / getAgentConfig

Function getAgentConfig

app/src/utils/agent_database.ts:227–252  ·  view source on GitHub ↗
(agentId: string)

Source from the content-addressed store, hash-verified

225
226// Get agent configuration (for internal use)
227async function getAgentConfig(agentId: string): Promise<{
228 model_name: string;
229 system_prompt: string;
230 loop_interval_seconds: number;
231 only_on_significant_change?: boolean;
232} | null> {
233 const db = await openDB();
234
235 return new Promise((resolve, reject) => {
236 const tx = db.transaction(CONFIG_STORE, 'readonly');
237 const store = tx.objectStore(CONFIG_STORE);
238 const request = store.get(agentId);
239
240 request.onsuccess = () => {
241 const result = request.result;
242 if (result) {
243 // Remove id from the result to get just the config
244 const { id, ...configWithoutId } = result;
245 resolve(configWithoutId);
246 } else {
247 resolve(null);
248 }
249 };
250 request.onerror = () => reject(request.error);
251 });
252}
253
254// Get agent code
255export async function getAgentCode(agentId: string): Promise<string | null> {

Callers 2

listAgentsFunction · 0.85
getAgentFunction · 0.85

Calls 1

openDBFunction · 0.85

Tested by

no test coverage detected