|
| 1 | +import type { UploadableSkillSource } from "@posthog/shared"; |
| 2 | + |
1 | 3 | export interface CloudArtifactUploadRequest { |
2 | 4 | name: string; |
3 | | - type: "user_attachment"; |
| 5 | + type: "user_attachment" | "skill_bundle"; |
4 | 6 | size: number; |
5 | 7 | content_type?: string; |
6 | 8 | source?: string; |
| 9 | + metadata?: { |
| 10 | + skill_name: string; |
| 11 | + skill_source: UploadableSkillSource; |
| 12 | + content_sha256: string; |
| 13 | + bundle_format: "zip"; |
| 14 | + schema_version: number; |
| 15 | + }; |
7 | 16 | } |
8 | 17 |
|
9 | 18 | export interface CloudArtifactPresignedPost { |
@@ -41,9 +50,32 @@ export interface CloudArtifactClient { |
41 | 50 | ): Promise<FinalizedCloudArtifact[]>; |
42 | 51 | } |
43 | 52 |
|
| 53 | +export interface CloudSkillBundleRef { |
| 54 | + name: string; |
| 55 | + source: UploadableSkillSource; |
| 56 | + path: string; |
| 57 | +} |
| 58 | + |
| 59 | +export interface LocalSkillBundle { |
| 60 | + name: string; |
| 61 | + source: UploadableSkillSource; |
| 62 | + fileName: string; |
| 63 | + contentType: "application/zip"; |
| 64 | + contentBase64: string; |
| 65 | + contentSha256: string; |
| 66 | + size: number; |
| 67 | +} |
| 68 | + |
| 69 | +export type BundleLocalSkill = ( |
| 70 | + skillBundleRef: CloudSkillBundleRef, |
| 71 | +) => Promise<LocalSkillBundle>; |
| 72 | + |
44 | 73 | export const CLOUD_ARTIFACT_SERVICE = Symbol.for( |
45 | 74 | "posthog.core.sessions.cloudArtifactService", |
46 | 75 | ); |
47 | 76 | export const CLOUD_ARTIFACT_READ_FILE_AS_BASE64 = Symbol.for( |
48 | 77 | "posthog.core.sessions.cloudArtifactReadFileAsBase64", |
49 | 78 | ); |
| 79 | +export const CLOUD_ARTIFACT_BUNDLE_LOCAL_SKILL = Symbol.for( |
| 80 | + "posthog.core.sessions.cloudArtifactBundleLocalSkill", |
| 81 | +); |
0 commit comments