@iwsdk/vite-plugin-dev 0.5.3 → 1.0.0-rc.0

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.
@@ -4,141 +4,5 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import type { RuntimeCameraSnapshot, RuntimeFramingSnapshot } from './runtime-proof-parity.js';
8
- /**
9
- * Log types for the server-side console capture.
10
- */
11
- export type LogLevel = 'log' | 'info' | 'warn' | 'error' | 'debug' | 'trace';
12
- export interface CapturedLog {
13
- timestamp: number;
14
- level: LogLevel;
15
- message: string;
16
- args: string[];
17
- repeatCount?: number;
18
- }
19
- export interface LogQuery {
20
- count?: number;
21
- level?: LogLevel | LogLevel[];
22
- pattern?: string;
23
- since?: number;
24
- until?: number;
25
- }
26
- export interface ManagedBrowser {
27
- close(): Promise<void>;
28
- page: unknown;
29
- /** Switch to the application runtime when needed, then capture it. */
30
- captureRuntimeScreenshot(): Promise<Buffer>;
31
- /** Query captured console logs. */
32
- queryLogs(options?: LogQuery): CapturedLog[];
33
- /** Read the managed browser tab identity used by MCP metadata. */
34
- getTabMetadata(): Promise<{
35
- id: string | null;
36
- generation: number | null;
37
- }>;
38
- /** Reload the saved editor and workspace runtime, then collect publish evidence. */
39
- collectRuntimePublishEvidence(request: ManagedRuntimePublishRequest): Promise<ManagedRuntimePublishEvidence>;
40
- /** Inspect live scene binding, presentation, and host performance without formal review. */
41
- collectRuntimePreflightEvidence(request: ManagedRuntimePreflightRequest): Promise<ManagedRuntimePreflightEvidence>;
42
- /** Register a callback invoked when the page/browser closes unexpectedly. */
43
- onClose(callback: () => void): void;
44
- /** Whether the underlying Playwright page has been closed. */
45
- isClosed(): boolean;
46
- }
47
- export interface ManagedRuntimePublishRequest {
48
- expectedDocumentHash: string;
49
- expectedRuntimeHash: string;
50
- heroView?: string;
51
- nodeIds: string[];
52
- }
53
- export interface ManagedRuntimePreflightRequest {
54
- expectedDocumentHash: string;
55
- expectedRuntimeHash: string;
56
- sampleFrames: number;
57
- warmupFrames: number;
58
- }
59
- export interface ManagedHostPerformanceMeasurement {
60
- calibrated: false;
61
- classification: 'host-browser-diagnostic';
62
- droppedFrameCount: number;
63
- droppedFrameThresholdMs: number;
64
- frameTimeMs: {
65
- max: number | null;
66
- p50: number | null;
67
- p95: number | null;
68
- };
69
- sampleFrames: number;
70
- targetDevice: null;
71
- warmupFrames: number;
72
- }
73
- export interface ManagedRuntimePreflightEvidence {
74
- camera: RuntimeCameraSnapshot | null;
75
- collectedAt: number;
76
- editor: {
77
- dirty: boolean;
78
- documentHash: string | null;
79
- renderStats: Record<string, unknown>;
80
- runtimeHash: string | null;
81
- };
82
- environment: Record<string, unknown>;
83
- framing: RuntimeFramingSnapshot | null;
84
- hierarchyObjectCount: number;
85
- performance: ManagedHostPerformanceMeasurement;
86
- renderStats: Record<string, unknown>;
87
- runtimeHashes: string[];
88
- }
89
- export interface ManagedRuntimeNodeEvidence {
90
- components: unknown;
91
- hierarchy: Record<string, unknown> | null;
92
- nodeId: string;
93
- transform: unknown;
94
- }
95
- export interface ManagedRuntimePublishEvidence {
96
- camera: RuntimeCameraSnapshot | null;
97
- capture: ManagedPngCapture;
98
- editor: {
99
- beforeReload: {
100
- dirty: boolean;
101
- documentHash: string | null;
102
- runtimeHash: string | null;
103
- };
104
- capture: ManagedPngCapture;
105
- dirty: boolean;
106
- documentHash: string | null;
107
- logs: CapturedLog[];
108
- renderStats: Record<string, unknown>;
109
- runtimeHash: string | null;
110
- };
111
- renderStats: Record<string, unknown>;
112
- runtimeReloadStartedAt: number;
113
- collectedAt: number;
114
- environment: Record<string, unknown>;
115
- framing: RuntimeFramingSnapshot | null;
116
- hierarchy: Record<string, unknown>;
117
- hierarchyObjectCount: number;
118
- nodes: ManagedRuntimeNodeEvidence[];
119
- performance: ManagedHostPerformanceMeasurement;
120
- reloadStartedAt: number;
121
- runtimeHashes: string[];
122
- }
123
- interface ManagedPngCapture {
124
- bytes: Buffer;
125
- height: number;
126
- nonblank: boolean;
127
- sha256: string;
128
- width: number;
129
- }
130
- export interface ManagedBrowserAccess {
131
- headerName: string;
132
- pathnames: readonly string[];
133
- topLevelPathnames?: readonly string[];
134
- token: string;
135
- }
136
- export type ManagedBrowserReadiness = 'iwer' | 'workspace';
137
- export declare function launchManagedBrowser(url: string, headless: boolean, verbose: boolean, viewport?: {
138
- width: number;
139
- height: number;
140
- } | null, screenshotSize?: {
141
- width: number;
142
- height: number;
143
- }, traceMcp?: boolean, managedAccess?: ManagedBrowserAccess | null, readiness?: ManagedBrowserReadiness): Promise<ManagedBrowser>;
144
- export {};
7
+ export * from './managed-browser/session.js';
8
+ export { ensureChromiumInstalled } from './managed-browser/launch.js';
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { Plugin } from 'vite';
8
8
  import type { DevPluginOptions } from './types.js';
9
- export type { DevPluginOptions, AiOptions, AiMode, EmulatorOptions, DevelopmentHttpsOptions, WorkspaceOptions, ProcessedDevOptions, IWERPluginOptions, SEMOptions, } from './types.js';
9
+ export type { DevPluginOptions, AiOptions, AiMode, EmulatorOptions, DevelopmentHttpsOptions, ProductionBundleOptions, UIKitMLBundledFontName, WorkspaceOptions, ProcessedDevOptions, IWERPluginOptions, SEMOptions, } from './types.js';
10
10
  /**
11
11
  * Vite plugin for IWSDK development — XR emulation, AI agent tooling, and Playwright browser
12
12
  */