()
| 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. |
no test coverage detected