web: templates gallery and template detail (P4)

This commit is contained in:
2026-10-19 02:30:39 +01:00
parent 4721b8af10
commit da3c488506
9 changed files with 586 additions and 2 deletions
+14
View File
@@ -43,6 +43,20 @@ export class PipelinesRepository {
return response.detail;
}
async listTemplates() {
return (await this.#client.call({ type: Protocol.LIST_TEMPLATES })).templates ?? [];
}
async validate(source) {
const response = await this.#client.call({ type: Protocol.VALIDATE, source });
// A server error envelope already rejects inside client.call, so a reply
// here is `validated`; a missing graph is still an unusable definition.
if (!response.graph) {
throw new ProtocolError("The server returned no graph.");
}
return response.graph;
}
async listRuns() {
const response = await this.#client.call({ type: Protocol.LIST_RUNS });
return { runs: response.runs ?? [], usage: response.usage ?? null };