@iwsdk/vite-plugin-dev 1.1.0-rc.1 → 1.1.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.
- package/README.md +4 -3
- package/dist/bundle-feature-gates.d.ts +12 -0
- package/dist/editor/editor-workspace.d.ts +3 -0
- package/dist/editor/editor-workspace.js +55 -1
- package/dist/editor/editor-workspace.js.map +1 -1
- package/dist/editor/scene-editor-session.js +1 -1
- package/dist/index.js +1335 -140
- package/dist/index.js.map +1 -1
- package/dist/injection/chunks/{index-C3rlN7Lf.js → index-CMmj0avE.js} +1 -1
- package/dist/injection/chunks/{injection-template-9pnR-F15.js → injection-template-0HSd4CcE.js} +65 -65
- package/dist/injection/runtime.js +1 -1
- package/dist/managed-browser/session.d.ts +5 -1
- package/dist/managed-browser/tab-audio.d.ts +33 -0
- package/dist/mcp/ws-client.d.ts +16 -0
- package/dist/{patch-D24zp5ky.js → patch-4HakknH4.js} +14 -1
- package/dist/patch-4HakknH4.js.map +1 -0
- package/dist/runtime-session.d.ts +2 -0
- package/dist/types.d.ts +7 -0
- package/package.json +7 -7
- package/dist/patch-D24zp5ky.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export{s as startIwsdkDevRuntime}from"./chunks/injection-template-
|
|
1
|
+
export{s as startIwsdkDevRuntime}from"./chunks/injection-template-0HSd4CcE.js";
|
|
@@ -10,6 +10,7 @@ import { type BrowserInteractionRequest, type BrowserInteractionResult, type Bro
|
|
|
10
10
|
import { type ManagedBrowserAccess, type ManagedBrowserReadiness } from './launch.js';
|
|
11
11
|
import { type BrowserProfileRequest, type BrowserProfileResult } from './profiling.js';
|
|
12
12
|
import { type ManagedRuntimePreflightEvidence, type ManagedRuntimePreflightRequest, type ManagedRuntimePublishEvidence, type ManagedRuntimePublishRequest } from './runtime-evidence.js';
|
|
13
|
+
import { type ManagedTabAudioOptions } from './tab-audio.js';
|
|
13
14
|
export { describeElements, summarizeFrameTimes } from './page-probes.js';
|
|
14
15
|
export type { BrowserEnvironmentDescriptor } from './page-probes.js';
|
|
15
16
|
export type { BrowserApplicationMetadata } from './application-surface.js';
|
|
@@ -18,6 +19,7 @@ export type { BrowserProfileRequest, BrowserProfileResult, } from './profiling.j
|
|
|
18
19
|
export type { BrowserInteractionPoint, BrowserInteractionRequest, BrowserInteractionResult, BrowserInteractionStep, BrowserInteractionStepResult, BrowserScreenshotOptions, BrowserSemanticLocator, BrowserSnapshotElement, BrowserSnapshotRequest, BrowserSnapshotResult, } from './interaction.js';
|
|
19
20
|
export { MANAGED_WORKSPACE_QUERY } from './access-protocol.js';
|
|
20
21
|
export type { ManagedBrowserAccess, ManagedBrowserReadiness, } from './launch.js';
|
|
22
|
+
export type { ManagedTabAudioOptions } from './tab-audio.js';
|
|
21
23
|
export { collectRuntimePreflightEvidence, collectRuntimePublishEvidence, } from './runtime-evidence.js';
|
|
22
24
|
export type { ManagedHostPerformanceMeasurement, ManagedRuntimeNodeEvidence, ManagedRuntimePreflightEvidence, ManagedRuntimePreflightRequest, ManagedRuntimePublishEvidence, ManagedRuntimePublishRequest, } from './runtime-evidence.js';
|
|
23
25
|
export interface ManagedBrowser {
|
|
@@ -44,6 +46,8 @@ export interface ManagedBrowser {
|
|
|
44
46
|
interactApplication(request: BrowserInteractionRequest): Promise<BrowserInteractionResult>;
|
|
45
47
|
/** Start, stop, or inspect a bounded desktop-browser performance profile. */
|
|
46
48
|
profileApplication(request: BrowserProfileRequest): Promise<BrowserProfileResult>;
|
|
49
|
+
/** Mute or unmute every frame in the managed tab, across reloads. */
|
|
50
|
+
setAudioMuted(muted: boolean): Promise<boolean>;
|
|
47
51
|
/** Reload only the managed application surface. */
|
|
48
52
|
reloadApplication(): Promise<{
|
|
49
53
|
id: string | null;
|
|
@@ -79,4 +83,4 @@ export declare function launchManagedBrowser(url: string, headless: boolean, ver
|
|
|
79
83
|
} | null, screenshotSize?: {
|
|
80
84
|
width: number;
|
|
81
85
|
height: number;
|
|
82
|
-
}, traceMcp?: boolean, managedAccess?: ManagedBrowserAccess | null, readiness?: ManagedBrowserReadiness, workspaceRoot?: string, browserAutomation?: boolean, signal?: AbortSignal): Promise<ManagedBrowser>;
|
|
86
|
+
}, traceMcp?: boolean, managedAccess?: ManagedBrowserAccess | null, readiness?: ManagedBrowserReadiness, workspaceRoot?: string, browserAutomation?: boolean, signal?: AbortSignal, tabAudioOptions?: ManagedTabAudioOptions): Promise<ManagedBrowser>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { BrowserContext, Page } from 'playwright';
|
|
8
|
+
/** Page-callable binding the workspace UI uses to change the host state. */
|
|
9
|
+
export declare const TAB_AUDIO_BINDING = "__IWSDK_SET_TAB_AUDIO_MUTED";
|
|
10
|
+
/** Window event dispatched in every frame whose mute state changes. */
|
|
11
|
+
export declare const TAB_AUDIO_CHANGE_EVENT = "iwsdk:tab-audio-change";
|
|
12
|
+
export interface ManagedTabAudioOptions {
|
|
13
|
+
muted: boolean;
|
|
14
|
+
/** Invoked whenever an agent or the workspace UI changes the state. */
|
|
15
|
+
onMutedChange?: (muted: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface TabAudioController {
|
|
18
|
+
readonly muted: boolean;
|
|
19
|
+
apply(muted: boolean): boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Owns the managed browser's mute state and applies it to every frame. */
|
|
22
|
+
export declare class ManagedTabAudio {
|
|
23
|
+
private readonly context;
|
|
24
|
+
private readonly page;
|
|
25
|
+
private applyQueue;
|
|
26
|
+
private muted;
|
|
27
|
+
private readonly onMutedChange?;
|
|
28
|
+
private constructor();
|
|
29
|
+
/** Install the frame controller and UI binding before the first navigation. */
|
|
30
|
+
static install(context: BrowserContext, page: Page, options: ManagedTabAudioOptions): Promise<ManagedTabAudio>;
|
|
31
|
+
isMuted(): boolean;
|
|
32
|
+
setMuted(muted: unknown): Promise<boolean>;
|
|
33
|
+
}
|
package/dist/mcp/ws-client.d.ts
CHANGED
|
@@ -6,9 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
type MCPPageRole = 'app' | 'editor' | 'preview';
|
|
8
8
|
type MCPDeviceClass = 'managed' | 'physical';
|
|
9
|
+
/** IWER's TargetResolver: turns run_sequence target names into scene points. */
|
|
10
|
+
interface MCPTargetResolver {
|
|
11
|
+
resolve(target: unknown, context: unknown): unknown;
|
|
12
|
+
list?(): unknown[];
|
|
13
|
+
}
|
|
9
14
|
interface MCPDevice {
|
|
10
15
|
remote: {
|
|
11
16
|
dispatch(method: string, params: Record<string, unknown>): Promise<unknown> | unknown;
|
|
17
|
+
/** Registers how hand sequences resolve target names (IWER 2.7+). */
|
|
18
|
+
setTargetResolver?(resolver: MCPTargetResolver | null): void;
|
|
12
19
|
};
|
|
13
20
|
}
|
|
14
21
|
/**
|
|
@@ -26,6 +33,8 @@ interface FrameworkMCPRuntime {
|
|
|
26
33
|
* Dispatch a method call. Returns result or throws an error.
|
|
27
34
|
*/
|
|
28
35
|
dispatch(method: string, params: Record<string, unknown>): Promise<unknown>;
|
|
36
|
+
/** Resolves the target names of emulated hand sequences in the scene. */
|
|
37
|
+
targetResolver?: MCPTargetResolver;
|
|
29
38
|
}
|
|
30
39
|
declare global {
|
|
31
40
|
interface Window {
|
|
@@ -105,6 +114,13 @@ export declare function initMCPClient(device: MCPDevice, options?: {
|
|
|
105
114
|
port?: number;
|
|
106
115
|
verbose?: boolean;
|
|
107
116
|
}): MCPWebSocketClient;
|
|
117
|
+
/**
|
|
118
|
+
* IWER's hand sequences name their targets ("counter-button", "Map Pin 1"),
|
|
119
|
+
* but only the framework knows the scene. Hands IWER the framework runtime's
|
|
120
|
+
* resolver now, and again whenever a runtime starts (a new world after a
|
|
121
|
+
* reload or HMR).
|
|
122
|
+
*/
|
|
123
|
+
export declare function connectFrameworkTargetResolver(device: MCPDevice): void;
|
|
108
124
|
/**
|
|
109
125
|
* Connect a managed workspace/editor page without installing or requiring IWER.
|
|
110
126
|
* Framework-provided scene/workspace methods and page reload remain available;
|
|
@@ -2908,6 +2908,12 @@ function validateComponents(components, path, schemas, validateComponentFields,
|
|
|
2908
2908
|
addIssue(issues, childPath(componentPath, fieldName), `value does not match ${field.type}`, 'type');
|
|
2909
2909
|
}
|
|
2910
2910
|
}
|
|
2911
|
+
if (['ContactShadow', 'ShadowCatcher'].includes(componentId)) {
|
|
2912
|
+
const size = value.size ?? schema.fields.size?.default;
|
|
2913
|
+
if (isVec2(size) && (size[0] <= 0 || size[1] <= 0)) {
|
|
2914
|
+
addIssue(issues, childPath(componentPath, 'size'), 'size must be positive', 'range');
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2911
2917
|
if (['DirectionalLight', 'PointLight', 'SpotLight'].includes(componentId)) {
|
|
2912
2918
|
const near = value.shadowCameraNear ?? schema.fields.shadowCameraNear?.default;
|
|
2913
2919
|
const far = value.shadowCameraFar ?? schema.fields.shadowCameraFar?.default;
|
|
@@ -2915,6 +2921,13 @@ function validateComponents(components, path, schemas, validateComponentFields,
|
|
|
2915
2921
|
addIssue(issues, componentPath, 'shadow camera near must be less than shadow camera far', 'range');
|
|
2916
2922
|
}
|
|
2917
2923
|
}
|
|
2924
|
+
if (componentId === 'DomeFade') {
|
|
2925
|
+
const start = value.start ?? schema.fields.start?.default;
|
|
2926
|
+
const end = value.end ?? schema.fields.end?.default;
|
|
2927
|
+
if (isFiniteNumber(start) && isFiniteNumber(end) && start >= end) {
|
|
2928
|
+
addIssue(issues, componentPath, 'fade start must be less than fade end', 'range');
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2918
2931
|
}
|
|
2919
2932
|
}
|
|
2920
2933
|
function validateRootComponents(components, issues) {
|
|
@@ -4564,4 +4577,4 @@ function isMeaningfulTransform(transform) {
|
|
|
4564
4577
|
}
|
|
4565
4578
|
|
|
4566
4579
|
export { getSceneCompositionSourceHashes as A, parseSceneDocument as B, CURRENT_SCENE_VERSION as C, serializeSceneReview as D, resolveSceneAuthoringTransforms as E, parseSceneReview as F, MAX_SCENE_RESOURCES as M, SceneCommandHistory as S, assertValidSceneDocument as a, hashRuntimeSceneDocument as b, canonicalizeJson as c, MAX_SCENE_PATTERN_EXPANSION as d, MAX_SCENE_NODES as e, MAX_SCENE_COORDINATE as f, CURRENT_SCENE_REVIEW_VERSION as g, hashSceneDocument as h, applyScenePatch as i, serializeSceneDocument as j, SCENE_REVIEW_JSON_SCHEMA as k, SCENE_DOCUMENT_JSON_SCHEMA as l, findNode as m, getNodeWorldBounds as n, getScenePatternRequestedCount as o, resolveScenePrefabRoot as p, getSceneNodeCollisionRadius as q, resolveLookAtTransformInDocument as r, sha256 as s, MAX_SCENE_PATTERN_INSTANCES as t, getScenePatternInstanceCount as u, validateSceneDocument as v, deepClone as w, isPlainObject as x, SCENE_IMPORT_ID_PATTERN as y, validateSceneReview as z };
|
|
4567
|
-
//# sourceMappingURL=patch-
|
|
4580
|
+
//# sourceMappingURL=patch-4HakknH4.js.map
|