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

Function getAgentConfig

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

Source from the content-addressed store, hash-verified

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