MCPcopy Create free account
hub / github.com/anomalyco/opencode / loadCatalog

Function loadCatalog

packages/opencode/src/cli/cmd/run/runtime.ts:371–400  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369 }
370
371 const loadCatalog = async (): Promise<void> => {
372 if (footer.isClosed) {
373 return
374 }
375
376 const [agents, resources, commands] = await Promise.all([
377 ctx.sdk.app
378 .agents({ directory: ctx.directory })
379 .then((x) => x.data ?? [])
380 .catch(() => []),
381 ctx.sdk.experimental.resource
382 .list({ directory: ctx.directory })
383 .then((x) => Object.values(x.data ?? {}))
384 .catch(() => []),
385 ctx.sdk.command
386 .list({ directory: ctx.directory })
387 .then((x) => x.data ?? [])
388 .catch(() => []),
389 ])
390 if (footer.isClosed) {
391 return
392 }
393
394 footer.event({
395 type: "catalog",
396 agents,
397 resources,
398 commands,
399 })
400 }
401
402 void footer
403 .idle()

Callers

nothing calls this directly

Calls 5

listMethod · 0.65
allMethod · 0.45
agentsMethod · 0.45
valuesMethod · 0.45
eventMethod · 0.45

Tested by

no test coverage detected