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

Function memoryProvider

packages/core/execution/src/description.test.ts:18–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16import { buildExecuteDescription } from "./description";
17
18const memoryProvider = (): CredentialProvider => {
19 const store = new Map<string, string>();
20 return {
21 key: ProviderKey.make("memory"),
22 writable: true,
23 get: (id) => Effect.sync(() => store.get(String(id)) ?? null),
24 set: (id, value) => Effect.sync(() => void store.set(String(id), value)),
25 has: (id) => Effect.sync(() => store.has(String(id))),
26 list: () =>
27 Effect.sync(() =>
28 Array.from(store.keys()).map((key) => ({
29 id: ProviderItemId.make(key),
30 name: key,
31 })),
32 ),
33 };
34};
35
36const GITHUB = IntegrationSlug.make("github");
37const SLACK = IntegrationSlug.make("slack");

Callers 1

Calls 3

setMethod · 0.80
syncMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected