MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / pickAgentWire

Function pickAgentWire

src/workspaces/credential-injection.ts:88–97  ·  view source on GitHub ↗
(
  wires: Partial<Record<CredentialWireShape, string>>,
  agentId: string,
)

Source from the content-addressed store, hash-verified

86
87/** Pick the wire an agent should use from a credential's capabilities (null = none compatible). */
88export function pickAgentWire(
89 wires: Partial<Record<CredentialWireShape, string>>,
90 agentId: string,
91): { shape: CredentialWireShape; baseUrl: string } | null {
92 const pref = AGENT_WIRE_PREFERENCE[agentId] ?? ['openai-chat', 'anthropic', 'openai-responses']
93 for (const shape of pref) {
94 if (shape in wires) return { shape, baseUrl: wires[shape] ?? '' }
95 }
96 return null
97}
98
99export interface CredentialInjectionOverrides {
100 /** Model id to run. Required in practice (a credential has none). */

Callers 2

compatibleCredentialsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected