@pygmalionjs/pygmalion 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vite.d.ts CHANGED
@@ -71,6 +71,18 @@ export interface PygmalionPreviewCaptureWorkerConfig {
71
71
  jobTimeoutMs?: number;
72
72
  }
73
73
 
74
+ export interface PygmalionPreviewCaptureProgressEvent {
75
+ phase: 'queued' | 'preparing' | 'capturing' | 'retrying' | 'finalizing';
76
+ completed: number;
77
+ total: number;
78
+ frameId?: string;
79
+ captureStatus?: string;
80
+ }
81
+
82
+ export interface PygmalionPreviewCaptureGeneratorOptions {
83
+ onProgress?: (progress: PygmalionPreviewCaptureProgressEvent) => void;
84
+ }
85
+
74
86
  export interface PygmalionPreviewConfig {
75
87
  configFile?: string;
76
88
  viteConfig?: string;
@@ -88,12 +100,15 @@ export interface PygmalionPreviewConfig {
88
100
  sessionPort?: number;
89
101
  artifactFile?: string;
90
102
  artifactEndpoint?: string;
91
- generateArtifact?: (request: {
92
- namespace: string;
93
- sourceRevision: string;
94
- frames?: readonly { id: string; fingerprint?: string }[];
95
- captureBaseUrl?: string;
96
- }) => unknown | Promise<unknown>;
103
+ generateArtifact?: (
104
+ request: {
105
+ namespace: string;
106
+ sourceRevision: string;
107
+ frames?: readonly { id: string; fingerprint?: string }[];
108
+ captureBaseUrl?: string;
109
+ },
110
+ options?: PygmalionPreviewCaptureGeneratorOptions,
111
+ ) => unknown | Promise<unknown>;
97
112
  /**
98
113
  * Warm capture worker used to satisfy artifact generation requests when
99
114
  * `generateArtifact` is absent. When both are set, `generateArtifact` wins.
@@ -170,18 +185,22 @@ export declare function createPygmalionVitePlugins(
170
185
  ): PluginOption[];
171
186
 
172
187
  export declare const PYGMALION_PREVIEW_ARTIFACT_ENDPOINT: string;
188
+ export declare const PYGMALION_PREVIEW_CAPTURE_PROGRESS_SUFFIX: string;
173
189
  export declare const DEFAULT_PYGMALION_PREVIEW_ARTIFACT_FILE: string;
174
190
  export declare function pygmalionPreviewArtifactPlugin(options?: {
175
191
  root?: string;
176
192
  artifactFile?: string;
177
193
  endpoint?: string;
178
194
  disabled?: () => boolean;
179
- generateArtifact?: (request: {
180
- namespace: string;
181
- sourceRevision: string;
182
- frames?: readonly { id: string; fingerprint?: string }[];
183
- captureBaseUrl?: string;
184
- }) => unknown | Promise<unknown>;
195
+ generateArtifact?: (
196
+ request: {
197
+ namespace: string;
198
+ sourceRevision: string;
199
+ frames?: readonly { id: string; fingerprint?: string }[];
200
+ captureBaseUrl?: string;
201
+ },
202
+ options?: PygmalionPreviewCaptureGeneratorOptions,
203
+ ) => unknown | Promise<unknown>;
185
204
  acquireLease?: (
186
205
  reason: string,
187
206
  ) =>
@@ -190,12 +209,15 @@ export declare function pygmalionPreviewArtifactPlugin(options?: {
190
209
  | Promise<{ release(): void | Promise<void> } | null>;
191
210
  }): PluginOption;
192
211
  export interface PygmalionPreviewCaptureWorkerChannel {
193
- generateArtifact(request: {
194
- namespace: string;
195
- sourceRevision: string;
196
- frames?: readonly { id: string; fingerprint?: string }[];
197
- captureBaseUrl?: string;
198
- }): Promise<unknown>;
212
+ generateArtifact(
213
+ request: {
214
+ namespace: string;
215
+ sourceRevision: string;
216
+ frames?: readonly { id: string; fingerprint?: string }[];
217
+ captureBaseUrl?: string;
218
+ },
219
+ options?: PygmalionPreviewCaptureGeneratorOptions,
220
+ ): Promise<unknown>;
199
221
  dispose(): Promise<void>;
200
222
  }
201
223
  export declare function createPreviewCaptureWorkerChannel(