()
| 309 | } |
| 310 | |
| 311 | async function getOpenCodeAgents(): Promise<any[] | undefined> { |
| 312 | try { |
| 313 | if (!cachedAgents) { |
| 314 | const response = await ctx.client.app.agents({ |
| 315 | query: { directory: ctx.directory }, |
| 316 | }); |
| 317 | cachedAgents = response.data ?? []; |
| 318 | } |
| 319 | return cachedAgents; |
| 320 | } catch { |
| 321 | return undefined; |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | async function getBridgeContext(): Promise<OpenCodeBridgeContext> { |
| 326 | return { |