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

Function get

packages/computer/src/artifacts/client.ts:119–132  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

117 },
118
119 async get(name) {
120 const handle = await binding.get(scopedName(sessionId, name));
121 // The handle is a live Workers-RPC stub (ArtifactsRepo extends
122 // RpcTarget). The published `@cloudflare/workers-types` shape is
123 // wrong in both directions: it models the metadata as inherited
124 // `ArtifactsRepoInfo` properties (which the runtime stub does
125 // not expose — reading `handle.remote` yields an RpcPromise for
126 // a nonexistent method) and omits `info()` (which the runtime
127 // does have, returning the metadata by value). Reach `info()`
128 // through a typed view until the published types are corrected.
129 const view = handle as unknown as { info(): Promise<ArtifactsRepoInfo> };
130 const info = await view.info();
131 return repoInfo(info, name);
132 },
133
134 async list() {
135 const out: ArtifactRepoSummary[] = [];

Callers

nothing calls this directly

Calls 4

scopedNameFunction · 0.85
repoInfoFunction · 0.85
getMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected