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

Function detectWorkspaceCredential

ui/src/components/workspace/api.ts:636–645  ·  view source on GitHub ↗
(
  wsId: string,
  agent: string,
)

Source from the content-addressed store, hash-verified

634
635/** Which vault credential a workspace's agent is currently configured with (null = none/hand-edited). */
636export async function detectWorkspaceCredential(
637 wsId: string,
638 agent: string,
639): Promise<{ slug: string | null; model: string | null }> {
640 const res = await fetch(
641 `/api/workspaces/${encodeURIComponent(wsId)}/agent-config/${encodeURIComponent(agent)}/credential`,
642 );
643 if (!res.ok) return { slug: null, model: null };
644 return (await res.json()) as { slug: string | null; model: string | null };
645}
646
647/** Persist a hand-entered provider as a reusable central credential. Returns the slug. */
648export async function saveCredential(input: {

Callers 1

ChatLandingPageFunction · 0.90

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected