MCPcopy Create free account
hub / github.com/cloudflare/computer / backend

Function backend

packages/computer/src/stub.test.ts:87–97  ·  view source on GitHub ↗
(rpc?: Partial<import("@cloudflare/computer-rpc").WorkspaceRPC>)

Source from the content-addressed store, hash-verified

85}
86
87function backend(rpc?: Partial<import("@cloudflare/computer-rpc").WorkspaceRPC>): WorkspaceBackend {
88 return {
89 id: "test",
90 type: "test",
91 async connect(): Promise<BackendHandle> {
92 const sync = rpc?.sync ?? fakeSync();
93 const shell = rpc?.shell as Partial<import("@cloudflare/computer-rpc").ShellRPC> | undefined;
94 return { rpc: composite(sync, shell), close: async () => {} };
95 },
96 };
97}
98
99function streamOf(bytes: Uint8Array): ReadableStream<Uint8Array> {
100 return new ReadableStream<Uint8Array>({

Callers 2

withStubFunction · 0.70
stub.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected