(agentId: string)
| 229 | |
| 230 | // Get agent configuration (for internal use) |
| 231 | async 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 |
| 260 | export async function getAgentCode(agentId: string): Promise<string | null> { |
no test coverage detected