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

Function list

packages/computer/src/artifacts/client.ts:134–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132 },
133
134 async list() {
135 const out: ArtifactRepoSummary[] = [];
136 let cursor: string | undefined;
137 let done = false;
138 const seenCursors = new Set<string>();
139 while (!done) {
140 const page = await binding.list({ limit: LIST_PAGE_SIZE, cursor });
141 for (const repo of page.repos) {
142 const local = unscopedName(sessionId, repo.name);
143 if (local !== undefined) out.push({ ...repo, name: local });
144 }
145 const next = page.cursor;
146 if (next === undefined) {
147 done = true;
148 } else {
149 if (seenCursors.has(next)) {
150 throw new Error(`artifacts list returned a non-advancing cursor: ${next}`);
151 }
152 seenCursors.add(next);
153 cursor = next;
154 }
155 }
156 return out;
157 },
158
159 async import(name, source, opts) {
160 const result = await binding.import({

Callers

nothing calls this directly

Calls 5

unscopedNameFunction · 0.85
hasMethod · 0.80
listMethod · 0.65
pushMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected