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

Function makeRemoteAdd

packages/computer/src/artifacts/cli.test.ts:377–390  ·  view source on GitHub ↗
(options: { existing?: string[] } = {})

Source from the content-addressed store, hash-verified

375 }
376
377 function makeRemoteAdd(options: { existing?: string[] } = {}) {
378 const calls: RemoteCall[] = [];
379 const existing = new Set(options.existing ?? []);
380 const remoteAdd = async (opts: { name: string; url: string; force?: boolean }) => {
381 const force = opts.force === true;
382 calls.push({ name: opts.name, url: opts.url, force });
383 if (existing.has(opts.name) && !force) {
384 return { ok: false, exists: true, message: `remote ${opts.name} already exists` };
385 }
386 existing.add(opts.name);
387 return { ok: true };
388 };
389 return { remoteAdd, calls };
390 }
391
392 it("creates the repo, mints a token, and registers a credentialed remote", async () => {
393 const { remoteAdd, calls } = makeRemoteAdd();

Callers 1

cli.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected