@pygmalionjs/pygmalion 0.2.11 → 0.2.12

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
@@ -1,4 +1,10 @@
1
1
  import type { PluginOption } from 'vite';
2
+ import type {
3
+ QaCaptureRunner,
4
+ QaCaptureServiceOptions,
5
+ } from './qa';
6
+
7
+ export * from './qa';
2
8
 
3
9
  export interface PygmalionInventoryContext {
4
10
  sourceRoot: string;
@@ -14,6 +20,11 @@ export interface PygmalionInventoryConfig {
14
20
  args?: string[] | ((context: PygmalionInventoryContext) => string[]);
15
21
  cwd?: string;
16
22
  outputRoot?: string;
23
+ /**
24
+ * Generator-owned paths relative to the host application root. The dedicated
25
+ * mirror restores only these paths before checking for unexpected changes.
26
+ */
27
+ outputs?: string[];
17
28
  generate?: (context: PygmalionInventoryContext) => void | Promise<void>;
18
29
  }
19
30
 
@@ -51,6 +62,23 @@ export interface PygmalionPreviewConfig {
51
62
  viteBin?: string;
52
63
  mirrorPort?: number;
53
64
  sessionPort?: number;
65
+ artifactFile?: string;
66
+ artifactEndpoint?: string;
67
+ generateArtifact?: (request: {
68
+ namespace: string;
69
+ sourceRevision: string;
70
+ captureBaseUrl?: string;
71
+ }) => unknown | Promise<unknown>;
72
+ }
73
+
74
+ export interface PygmalionQaConfig
75
+ extends Omit<QaCaptureServiceOptions, 'root' | 'scriptPath'> {
76
+ /**
77
+ * Host-owned capture CLI, relative to the application root. Pygmalion owns
78
+ * orchestration, validation, baseline storage, and pixel comparison.
79
+ */
80
+ captureScript?: string;
81
+ captureRunner?: QaCaptureRunner;
54
82
  }
55
83
 
56
84
  export interface PygmalionProjectConfig {
@@ -77,6 +105,7 @@ export interface PygmalionProjectConfig {
77
105
  mirror?: false | PygmalionMirrorConfig;
78
106
  sessions?: false | PygmalionSessionConfig;
79
107
  preview?: PygmalionPreviewConfig;
108
+ qa?: false | PygmalionQaConfig;
80
109
  }
81
110
 
82
111
  export interface ResolvedPygmalionProject {
@@ -95,11 +124,14 @@ export interface ResolvedPygmalionProject {
95
124
  sessions: false | PygmalionSessionConfig;
96
125
  inspect: false | PygmalionInspectConfig;
97
126
  preview: PygmalionPreviewConfig;
127
+ qa: false | PygmalionQaConfig;
98
128
  dependencies: PygmalionDependencyConfig;
99
129
  inventory?: PygmalionInventoryConfig;
100
130
  }
101
131
 
102
- export declare function definePygmalionProject<T extends PygmalionProjectConfig>(config: T): T;
132
+ export declare function definePygmalionProject<
133
+ T extends PygmalionProjectConfig,
134
+ >(config: T): T;
103
135
  export declare function resolvePygmalionProject(
104
136
  config: PygmalionProjectConfig,
105
137
  ): ResolvedPygmalionProject;
@@ -107,15 +139,44 @@ export declare function createPygmalionVitePlugins(
107
139
  config: PygmalionProjectConfig,
108
140
  ): PluginOption[];
109
141
 
142
+ export declare const PYGMALION_PREVIEW_ARTIFACT_ENDPOINT: string;
143
+ export declare const DEFAULT_PYGMALION_PREVIEW_ARTIFACT_FILE: string;
144
+ export declare function pygmalionPreviewArtifactPlugin(options?: {
145
+ root?: string;
146
+ artifactFile?: string;
147
+ endpoint?: string;
148
+ disabled?: () => boolean;
149
+ generateArtifact?: (request: {
150
+ namespace: string;
151
+ sourceRevision: string;
152
+ captureBaseUrl?: string;
153
+ }) => unknown | Promise<unknown>;
154
+ }): PluginOption;
155
+ export interface PygmalionGitSourceState {
156
+ commit: string;
157
+ revision: string;
158
+ dirty: boolean;
159
+ fingerprint: string | null;
160
+ }
161
+ export declare function resolveGitSourceState(
162
+ root?: string,
163
+ ): PygmalionGitSourceState;
164
+
110
165
  export declare const PYGMALION_INSPECT_CONTROL: string;
111
166
  export declare const PYGMALION_DEV_PREFIX: string;
112
167
  export declare const PYGMALION_DEV_CONTROL: string;
113
168
  export declare const PYGMALION_SESSION_PREFIX: string;
114
169
  export declare const PYGMALION_SESSION_CONTROL: string;
115
170
 
116
- export declare function pygmalionInspectPlugin(options: Record<string, unknown>): PluginOption;
117
- export declare function pygmalionDevMirrorPlugin(options: Record<string, unknown>): PluginOption;
118
- export declare function pygmalionDesignSessionPlugin(options: Record<string, unknown>): PluginOption;
171
+ export declare function pygmalionInspectPlugin(
172
+ options: Record<string, unknown>,
173
+ ): PluginOption;
174
+ export declare function pygmalionDevMirrorPlugin(
175
+ options: Record<string, unknown>,
176
+ ): PluginOption;
177
+ export declare function pygmalionDesignSessionPlugin(
178
+ options: Record<string, unknown>,
179
+ ): PluginOption;
119
180
  export declare function writeStyleEdit(
120
181
  root: string,
121
182
  input: unknown,
@@ -181,9 +242,7 @@ export interface PygmalionSourceGraphOptions {
181
242
  }
182
243
 
183
244
  export type PygmalionStoryboardEnvironmentKind =
184
- | 'permission'
185
- | 'media-devices'
186
- | 'storage';
245
+ 'permission' | 'media-devices' | 'storage';
187
246
 
188
247
  export interface PygmalionStoryboardEnvironmentEvidence {
189
248
  id: string;
@@ -333,8 +392,12 @@ export interface PygmalionStoryboardCanonicalManifest {
333
392
  };
334
393
  }
335
394
 
336
- export declare function normalizeStoryboardSnapshot(snapshot: string): string | null;
337
- export declare function fingerprintStoryboardSnapshot(snapshot: string): string | null;
395
+ export declare function normalizeStoryboardSnapshot(
396
+ snapshot: string,
397
+ ): string | null;
398
+ export declare function fingerprintStoryboardSnapshot(
399
+ snapshot: string,
400
+ ): string | null;
338
401
  export declare function canonicalizeStoryboardExecutions(
339
402
  candidates: PygmalionStoryboardEnvironmentManifest['candidates'],
340
403
  executions: PygmalionStoryboardCandidateExecution[],
@@ -350,12 +413,10 @@ export declare function executeStoryboardCandidates(
350
413
  timeoutMs?: number;
351
414
  },
352
415
  ): Promise<PygmalionStoryboardCandidateExecution[]>;
353
- export declare function recommendedStoryboardExecutionConcurrency(
354
- capabilities?: {
355
- parallelism?: number;
356
- totalMemoryBytes?: number;
357
- },
358
- ): number;
416
+ export declare function recommendedStoryboardExecutionConcurrency(capabilities?: {
417
+ parallelism?: number;
418
+ totalMemoryBytes?: number;
419
+ }): number;
359
420
 
360
421
  export interface PygmalionRoutePreviewArtifactV1 {
361
422
  version: 1;
@@ -404,11 +465,15 @@ export declare const ROUTE_PREVIEW_ARTIFACT_V2_LIMITS: Readonly<
404
465
  export declare function isSafeFrozenRoutePreviewSnapshot(
405
466
  snapshot: unknown,
406
467
  ): snapshot is string;
407
- export declare function createRoutePreviewArtifactV2(input: {
408
- namespace: string;
409
- sourceRevision?: string;
410
- snapshots: Record<string, string>;
411
- } | PygmalionRoutePreviewArtifactV1): PygmalionRoutePreviewArtifactV2;
468
+ export declare function createRoutePreviewArtifactV2(
469
+ input:
470
+ | {
471
+ namespace: string;
472
+ sourceRevision?: string;
473
+ snapshots: Record<string, string>;
474
+ }
475
+ | PygmalionRoutePreviewArtifactV1,
476
+ ): PygmalionRoutePreviewArtifactV2;
412
477
  export declare function convertRoutePreviewArtifactV1ToV2(
413
478
  bundle: PygmalionRoutePreviewArtifactV1,
414
479
  ): PygmalionRoutePreviewArtifactV2;
@@ -426,6 +491,23 @@ export declare function reconstructRoutePreviewArtifactSnapshots(
426
491
  bundle: PygmalionRoutePreviewArtifactV2,
427
492
  ): Record<string, string>;
428
493
 
494
+ export {
495
+ ROUTE_PREVIEW_ARTIFACT_V3_LIMITS,
496
+ createRoutePreviewArtifactV3,
497
+ reconstructRoutePreviewArtifactScreenshotV3,
498
+ reconstructRoutePreviewArtifactSnapshotV3,
499
+ reconstructRoutePreviewArtifactSnapshotsV3,
500
+ validateRoutePreviewArtifactBundle,
501
+ validateRoutePreviewArtifactV3,
502
+ } from './storyboard';
503
+ export type {
504
+ RoutePreviewArtifactBundleV3,
505
+ RoutePreviewArtifactV3Capture,
506
+ StoryboardCaptureDiagnostic,
507
+ StoryboardCaptureStatus,
508
+ StoryboardCaptureViewport,
509
+ } from './storyboard';
510
+
429
511
  export declare function scanStoryboardEnvironment(
430
512
  root: string,
431
513
  options?: PygmalionStoryboardEnvironmentScanOptions,