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

Function stubAdapter

src/workspaces/credential-injection.spec.ts:96–109  ·  view source on GitHub ↗
(id: string, calls: WriteCall[], writeable = true)

Source from the content-addressed store, hash-verified

94interface WriteCall { id: string; dir: string; cred: WorkspaceAiCred }
95
96function stubAdapter(id: string, calls: WriteCall[], writeable = true): CliAdapter {
97 const adapter: CliAdapter = {
98 id,
99 displayName: id,
100 capabilities: { parallelPerCwd: true, resumeLast: false, resumeById: false, transcriptDiscovery: 'none' },
101 composeCommand: (base) => base,
102 }
103 if (writeable) {
104 ;(adapter as { writeAiConfig?: CliAdapter['writeAiConfig'] }).writeAiConfig = async (dir, cred) => {
105 calls.push({ id, dir, cred })
106 }
107 }
108 return adapter
109}
110
111function fakeLogger(): { logger: Logger; warns: string[] } {
112 const warns: string[] = []

Callers 1

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected