MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / resolveExplicitPluginTargetHints

Function resolveExplicitPluginTargetHints

src/core/bridge_coordinator.ts:16829–16847  ·  view source on GitHub ↗
(event: InboundTextEvent | null | undefined)

Source from the content-addressed store, hash-verified

16827}
16828
16829function resolveExplicitPluginTargetHints(event: InboundTextEvent | null | undefined): ExplicitPluginTargetHint[] {
16830 const metadata = event?.metadata;
16831 if (!metadata || typeof metadata !== 'object') {
16832 return [];
16833 }
16834 const codexbridge = (metadata as Record<string, unknown>).codexbridge;
16835 if (!codexbridge || typeof codexbridge !== 'object') {
16836 return [];
16837 }
16838 const hints = (codexbridge as Record<string, unknown>).explicitPluginTargets;
16839 if (Array.isArray(hints)) {
16840 return hints.filter((entry) => entry && typeof entry === 'object') as ExplicitPluginTargetHint[];
16841 }
16842 const hint = (codexbridge as Record<string, unknown>).explicitPluginTarget;
16843 if (!hint || typeof hint !== 'object') {
16844 return [];
16845 }
16846 return [hint as ExplicitPluginTargetHint];
16847}
16848
16849function withCodexbridgeMetadata(event: InboundTextEvent, updates: Record<string, unknown>) {
16850 const metadata = event?.metadata && typeof event.metadata === 'object'

Calls

no outgoing calls

Tested by

no test coverage detected