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

Method getArtifacts

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

Source from the content-addressed store, hash-verified

173 // captures the returned capability once and the command talks to
174 // that target, instead of binding a method directly off HOST.
175 async getArtifacts(): Promise<ArtifactsCLITarget> {
176 const stub = this.#hostStub<{
177 getArtifacts?: () => Promise<ArtifactsCLITarget>;
178 artifactsCLI?: (input: ArtifactsCLIInput) => Promise<ArtifactsCLIResult>;
179 }>();
180 if (typeof stub.getArtifacts === "function") return stub.getArtifacts();
181 if (typeof stub.artifactsCLI === "function") {
182 return new ArtifactsCLITarget(
183 (input) => stub.artifactsCLI?.(input) as Promise<ArtifactsCLIResult>,
184 );
185 }
186 return new ArtifactsCLITarget(async () => ({
187 stdout: "",
188 stderr: "artifacts: host does not expose an Artifacts CLI\n",
189 exitCode: 1,
190 }));
191 }
192
193 // Back-compat direct hook. New shell code calls getArtifacts()
194 // and captures the returned target instead.

Callers 1

artifactsCLIMethod · 0.95

Calls 2

#hostStubMethod · 0.95
artifactsCLIMethod · 0.45

Tested by

no test coverage detected