MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / ClassProvider

Class ClassProvider

packages/core/sdk/src/provider-call-timeout.test.ts:133–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 // is an object literal and cannot notice; a provider written as a class — exactly
132 // what "wrap any provider" invites — throws TypeError on the first optional call.
133 class ClassProvider {
134 readonly key = STORE;
135 readonly writable = true;
136 private readonly items = new Map<string, string>();
137 get(id: ProviderItemId) {
138 return Effect.sync(() => this.items.get(String(id)) ?? null);
139 }
140 set(id: ProviderItemId, value: string) {
141 // `this` is the whole point: bare invocation makes this line throw.
142 return Effect.sync(() => void this.items.set(String(id), value));
143 }
144 }
145
146 const executor = yield* createExecutor(
147 makeTestConfig({ plugins: [plugin(new ClassProvider() as CredentialProvider)] as const }),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected