feat(plugins): add document CRUD methods to Plugin SDK

Wire issue document list/get/upsert/delete operations through the
JSON-RPC protocol so plugins can manage issue documents with the same
capabilities available via the REST API.

Fixes #940
This commit is contained in:
Justin Miller
2026-03-16 15:53:50 -06:00
parent 3dc3347a58
commit 0d4dd50b35
7 changed files with 216 additions and 1 deletions

View File

@@ -612,6 +612,32 @@ export function startWorkerRpcHost(options: WorkerRpcHostOptions): WorkerRpcHost
async createComment(issueId: string, body: string, companyId: string) {
return callHost("issues.createComment", { issueId, body, companyId });
},
documents: {
async list(issueId: string, companyId: string) {
return callHost("issues.documents.list", { issueId, companyId });
},
async get(issueId: string, key: string, companyId: string) {
return callHost("issues.documents.get", { issueId, key, companyId });
},
async upsert(input) {
return callHost("issues.documents.upsert", {
issueId: input.issueId,
key: input.key,
body: input.body,
companyId: input.companyId,
title: input.title,
format: input.format,
changeSummary: input.changeSummary,
});
},
async delete(issueId: string, key: string, companyId: string) {
return callHost("issues.documents.delete", { issueId, key, companyId });
},
},
},
agents: {