Support video issue attachments

This commit is contained in:
Dotta 2026-05-30 18:01:22 +00:00
parent 911a1e8b0d
commit 75f88c588c
12 changed files with 262 additions and 11 deletions

View file

@ -411,6 +411,7 @@ export type {
DocumentTextProjection,
DocumentTextRange,
UpdateDocumentAnnotationThreadRequest,
AttachmentArtifactWorkProductMetadata,
Issue,
IssueAssigneeAdapterOverrides,
IssueBlockerAttention,
@ -921,6 +922,7 @@ export {
createIssueAttachmentMetadataSchema,
createIssueWorkProductSchema,
updateIssueWorkProductSchema,
attachmentArtifactWorkProductMetadataSchema,
issueWorkProductTypeSchema,
issueWorkProductStatusSchema,
issueWorkProductReviewStateSchema,

View file

@ -172,6 +172,7 @@ export type {
IssueWorkProductProvider,
IssueWorkProductStatus,
IssueWorkProductReviewState,
AttachmentArtifactWorkProductMetadata,
} from "./work-product.js";
export type {
Issue,

View file

@ -845,4 +845,6 @@ export interface IssueAttachment {
createdAt: Date;
updatedAt: Date;
contentPath: string;
openPath?: string;
downloadPath?: string;
}

View file

@ -53,3 +53,13 @@ export interface IssueWorkProduct {
createdAt: Date;
updatedAt: Date;
}
export interface AttachmentArtifactWorkProductMetadata {
attachmentId: string;
contentType: string;
byteSize: number;
contentPath: string;
openPath: string;
downloadPath: string;
originalFilename?: string | null;
}

View file

@ -282,6 +282,7 @@ export {
export {
createIssueWorkProductSchema,
updateIssueWorkProductSchema,
attachmentArtifactWorkProductMetadataSchema,
issueWorkProductTypeSchema,
issueWorkProductStatusSchema,
issueWorkProductReviewStateSchema,

View file

@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { attachmentArtifactWorkProductMetadataSchema } from "./work-product.js";
describe("attachmentArtifactWorkProductMetadataSchema", () => {
it("accepts the attachment-backed artifact metadata contract", () => {
const parsed = attachmentArtifactWorkProductMetadataSchema.parse({
attachmentId: "11111111-1111-4111-8111-111111111111",
contentType: "video/mp4",
byteSize: 1234,
contentPath: "/api/attachments/11111111-1111-4111-8111-111111111111/content",
openPath: "/api/attachments/11111111-1111-4111-8111-111111111111/content",
downloadPath: "/api/attachments/11111111-1111-4111-8111-111111111111/content?download=1",
originalFilename: "demo.mp4",
});
expect(parsed.contentType).toBe("video/mp4");
expect(parsed.downloadPath).toContain("download=1");
});
});

View file

@ -29,6 +29,18 @@ export const issueWorkProductReviewStateSchema = z.enum([
"changes_requested",
]);
export const attachmentArtifactWorkProductMetadataSchema = z.object({
attachmentId: z.string().uuid(),
contentType: z.string().min(1),
byteSize: z.number().int().nonnegative(),
contentPath: z.string().min(1),
openPath: z.string().min(1),
downloadPath: z.string().min(1),
originalFilename: z.string().optional().nullable(),
});
export type AttachmentArtifactWorkProductMetadata = z.infer<typeof attachmentArtifactWorkProductMetadataSchema>;
export const createIssueWorkProductSchema = z.object({
projectId: z.string().uuid().optional().nullable(),
executionWorkspaceId: z.string().uuid().optional().nullable(),