MCPcopy Create free account
hub / github.com/cloudflare/computer / #hostStub

Method #hostStub

packages/computer/src/proxy.ts:199–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 }
198
199 #hostStub<T extends object>(): Rpc.DurableObjectBranded & T {
200 const { binding, id } = this.ctx.props;
201 const ns = (this.env as Record<string, unknown>)[binding] as
202 | DurableObjectNamespace<Rpc.DurableObjectBranded & T>
203 | undefined;
204 if (!ns) {
205 throw new Error(`WorkspaceServiceProxy: env.${binding} is not a DurableObjectNamespace`);
206 }
207 return ns.get(ns.idFromString(id)) as unknown as Rpc.DurableObjectBranded & T;
208 }
209}

Callers 2

getWorkspaceMethod · 0.95
getArtifactsMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected