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

Function getAgentCode

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

Source from the content-addressed store, hash-verified

253
254// Get agent code
255export async function getAgentCode(agentId: string): Promise<string | null> {
256 const db = await openDB();
257
258 return new Promise((resolve, reject) => {
259 const tx = db.transaction(CODE_STORE, 'readonly');
260 const store = tx.objectStore(CODE_STORE);
261 const request = store.get(agentId);
262
263 request.onsuccess = () => {
264 const result = request.result;
265 resolve(result ? result.code : null);
266 };
267 request.onerror = () => reject(request.error);
268 });
269}
270
271// Get agent memory
272export async function getAgentMemory(agentId: string): Promise<string> {

Callers 9

startAgentLoopFunction · 0.90
executeAgentIterationFunction · 0.90
fetchAgentReferenceDataFunction · 0.90
registry.tsFile · 0.90
AppContentFunction · 0.90
exportAgentToFileFunction · 0.85
downloadAgentFunction · 0.85

Calls 1

openDBFunction · 0.85

Tested by

no test coverage detected