@floegence/redevplugin-ui 3.2.0 → 3.3.1
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/dist/openapi.gen.d.ts +17 -98
- package/dist/platform.d.ts +6 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/surface.d.ts +37 -143
- package/dist/surface.js +325 -2554
- package/dist/testing.d.ts +20 -34
- package/dist/testing.js +46 -12
- package/dist/trusted-parent.d.ts +2 -2
- package/dist/trusted-parent.js +1 -1
- package/package.json +4 -12
- package/dist/jsx-dev-runtime.d.ts +0 -2
- package/dist/jsx-dev-runtime.js +0 -1
- package/dist/jsx-runtime.d.ts +0 -27
- package/dist/jsx-runtime.js +0 -84
- package/dist/opaque-surface-policy.gen.d.ts +0 -47
- package/dist/opaque-surface-policy.gen.js +0 -233
- package/dist/surface-integrity.gen.d.ts +0 -1
- package/dist/surface-integrity.gen.js +0 -2
- package/dist/ui-patch-validator.d.ts +0 -67
- package/dist/ui-patch-validator.js +0 -128
- package/dist/ui-reconciler.d.ts +0 -10
- package/dist/ui-reconciler.js +0 -283
package/dist/openapi.gen.d.ts
CHANGED
|
@@ -281,22 +281,6 @@ export interface paths {
|
|
|
281
281
|
patch?: never;
|
|
282
282
|
trace?: never;
|
|
283
283
|
};
|
|
284
|
-
"/_redevplugin/api/plugins/surfaces/{surface_instance_id}/assets/read": {
|
|
285
|
-
parameters: {
|
|
286
|
-
query?: never;
|
|
287
|
-
header?: never;
|
|
288
|
-
path?: never;
|
|
289
|
-
cookie?: never;
|
|
290
|
-
};
|
|
291
|
-
get?: never;
|
|
292
|
-
put?: never;
|
|
293
|
-
post: operations["readPreparedSurfaceAsset"];
|
|
294
|
-
delete?: never;
|
|
295
|
-
options?: never;
|
|
296
|
-
head?: never;
|
|
297
|
-
patch?: never;
|
|
298
|
-
trace?: never;
|
|
299
|
-
};
|
|
300
284
|
"/_redevplugin/api/plugins/surfaces/{surface_instance_id}/confirmations/reject": {
|
|
301
285
|
parameters: {
|
|
302
286
|
query?: never;
|
|
@@ -918,11 +902,6 @@ export interface components {
|
|
|
918
902
|
ok: true;
|
|
919
903
|
data: components["schemas"]["BridgeTokenResult"];
|
|
920
904
|
};
|
|
921
|
-
SurfaceAssetSuccessResponse: {
|
|
922
|
-
/** @constant */
|
|
923
|
-
ok: true;
|
|
924
|
-
data: components["schemas"]["SurfaceAssetResult"];
|
|
925
|
-
};
|
|
926
905
|
SurfaceDisposeSuccessResponse: {
|
|
927
906
|
/** @constant */
|
|
928
907
|
ok: true;
|
|
@@ -2191,7 +2170,7 @@ export interface components {
|
|
|
2191
2170
|
issued_at: string;
|
|
2192
2171
|
/** Format: date-time */
|
|
2193
2172
|
expires_at: string;
|
|
2194
|
-
document: components["schemas"]["
|
|
2173
|
+
document: components["schemas"]["WebSurfaceDocument"];
|
|
2195
2174
|
};
|
|
2196
2175
|
TrustedParentBridgeHandshake: {
|
|
2197
2176
|
/** @constant */
|
|
@@ -2222,17 +2201,6 @@ export interface components {
|
|
|
2222
2201
|
/** Format: date-time */
|
|
2223
2202
|
expires_at: string;
|
|
2224
2203
|
};
|
|
2225
|
-
ReadSurfaceAssetRequest: {
|
|
2226
|
-
asset_session: string;
|
|
2227
|
-
asset_session_id: string;
|
|
2228
|
-
binding_id: string;
|
|
2229
|
-
};
|
|
2230
|
-
SurfaceAssetResult: {
|
|
2231
|
-
path: string;
|
|
2232
|
-
sha256: string;
|
|
2233
|
-
content_type: string;
|
|
2234
|
-
content_base64: string;
|
|
2235
|
-
};
|
|
2236
2204
|
ListExecutionEventsRequest: {
|
|
2237
2205
|
after_cursor: number;
|
|
2238
2206
|
limit?: number;
|
|
@@ -2612,6 +2580,10 @@ export interface components {
|
|
|
2612
2580
|
};
|
|
2613
2581
|
/** @description Methods required to open this surface. Omitted retains aggregate authorization. An empty array allows opening without method grants; calls remain individually authorized. Requires authorization.scoped.v1. */
|
|
2614
2582
|
required_methods?: string[];
|
|
2583
|
+
web: {
|
|
2584
|
+
root: string;
|
|
2585
|
+
spa: boolean;
|
|
2586
|
+
};
|
|
2615
2587
|
}[];
|
|
2616
2588
|
capability_bindings?: {
|
|
2617
2589
|
binding_id: string;
|
|
@@ -2831,41 +2803,17 @@ export interface components {
|
|
|
2831
2803
|
HostCapabilityPinV1Id: string;
|
|
2832
2804
|
HostCapabilityPinV1Semver: string;
|
|
2833
2805
|
HostCapabilityPinV1Sha256: string;
|
|
2834
|
-
|
|
2806
|
+
WebSurfaceDocument: {
|
|
2835
2807
|
/** @constant */
|
|
2836
|
-
schema_version: "redevplugin.
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
assets: components["schemas"]["OpaqueSurfaceDocumentV3Asset"][];
|
|
2846
|
-
critical_bytes: number;
|
|
2847
|
-
};
|
|
2848
|
-
OpaqueSurfaceDocumentV3Sha256: string;
|
|
2849
|
-
OpaqueSurfaceDocumentV3PackagePath: string;
|
|
2850
|
-
OpaqueSurfaceDocumentV3Style: {
|
|
2851
|
-
path: components["schemas"]["OpaqueSurfaceDocumentV3PackagePath"];
|
|
2852
|
-
sha256: components["schemas"]["OpaqueSurfaceDocumentV3Sha256"];
|
|
2853
|
-
content: string;
|
|
2854
|
-
};
|
|
2855
|
-
OpaqueSurfaceDocumentV3Worker: {
|
|
2856
|
-
path: components["schemas"]["OpaqueSurfaceDocumentV3PackagePath"];
|
|
2857
|
-
sha256: components["schemas"]["OpaqueSurfaceDocumentV3Sha256"];
|
|
2858
|
-
/** @constant */
|
|
2859
|
-
type: "classic";
|
|
2860
|
-
content: string;
|
|
2861
|
-
};
|
|
2862
|
-
OpaqueSurfaceDocumentV3Asset: {
|
|
2863
|
-
binding_id: string;
|
|
2864
|
-
logical_ids: string[];
|
|
2865
|
-
path: components["schemas"]["OpaqueSurfaceDocumentV3PackagePath"];
|
|
2866
|
-
sha256: components["schemas"]["OpaqueSurfaceDocumentV3Sha256"];
|
|
2867
|
-
size: number;
|
|
2868
|
-
content_type: string;
|
|
2808
|
+
schema_version: "redevplugin.web_surface.v1";
|
|
2809
|
+
/** Format: uri */
|
|
2810
|
+
origin: string;
|
|
2811
|
+
/** Format: uri */
|
|
2812
|
+
parent_origin: string;
|
|
2813
|
+
/** Format: uri */
|
|
2814
|
+
bootstrap_url: string;
|
|
2815
|
+
/** Format: uri */
|
|
2816
|
+
entry_url: string;
|
|
2869
2817
|
};
|
|
2870
2818
|
};
|
|
2871
2819
|
responses: {
|
|
@@ -2896,7 +2844,7 @@ export interface components {
|
|
|
2896
2844
|
"application/json": components["schemas"]["RPCSuccessResponse"];
|
|
2897
2845
|
};
|
|
2898
2846
|
};
|
|
2899
|
-
/** @description Trusted-parent surface bootstrap. Capability-bearing fields are never forwarded into the
|
|
2847
|
+
/** @description Trusted-parent surface bootstrap. Capability-bearing fields are never forwarded into the isolated Web application. */
|
|
2900
2848
|
SurfaceBootstrapResponse: {
|
|
2901
2849
|
headers: {
|
|
2902
2850
|
[name: string]: unknown;
|
|
@@ -2905,7 +2853,7 @@ export interface components {
|
|
|
2905
2853
|
"application/json": components["schemas"]["SurfaceBootstrapSuccessResponse"];
|
|
2906
2854
|
};
|
|
2907
2855
|
};
|
|
2908
|
-
/** @description Trusted-parent asset-session exchange and
|
|
2856
|
+
/** @description Trusted-parent asset-session exchange and verified Web surface origin binding. */
|
|
2909
2857
|
SurfacePreparationResponse: {
|
|
2910
2858
|
headers: {
|
|
2911
2859
|
[name: string]: unknown;
|
|
@@ -2923,15 +2871,6 @@ export interface components {
|
|
|
2923
2871
|
"application/json": components["schemas"]["BridgeTokenSuccessResponse"];
|
|
2924
2872
|
};
|
|
2925
2873
|
};
|
|
2926
|
-
/** @description Trusted-parent package asset response. The plugin receives only a renderer-created blob URL. */
|
|
2927
|
-
SurfaceAssetResponse: {
|
|
2928
|
-
headers: {
|
|
2929
|
-
[name: string]: unknown;
|
|
2930
|
-
};
|
|
2931
|
-
content: {
|
|
2932
|
-
"application/json": components["schemas"]["SurfaceAssetSuccessResponse"];
|
|
2933
|
-
};
|
|
2934
|
-
};
|
|
2935
2874
|
/** @description Surface revocation response. */
|
|
2936
2875
|
SurfaceDisposeResponse: {
|
|
2937
2876
|
headers: {
|
|
@@ -3366,11 +3305,6 @@ export interface components {
|
|
|
3366
3305
|
"application/json": components["schemas"]["TrustedParentBridgeTokenRequest"];
|
|
3367
3306
|
};
|
|
3368
3307
|
};
|
|
3369
|
-
ReadSurfaceAssetRequest: {
|
|
3370
|
-
content: {
|
|
3371
|
-
"application/json": components["schemas"]["ReadSurfaceAssetRequest"];
|
|
3372
|
-
};
|
|
3373
|
-
};
|
|
3374
3308
|
ListExecutionEventsRequest: {
|
|
3375
3309
|
content: {
|
|
3376
3310
|
"application/json": components["schemas"]["ListExecutionEventsRequest"];
|
|
@@ -3760,21 +3694,6 @@ export interface operations {
|
|
|
3760
3694
|
default: components["responses"]["MutationPlatformErrorResponse"];
|
|
3761
3695
|
};
|
|
3762
3696
|
};
|
|
3763
|
-
readPreparedSurfaceAsset: {
|
|
3764
|
-
parameters: {
|
|
3765
|
-
query?: never;
|
|
3766
|
-
header?: never;
|
|
3767
|
-
path: {
|
|
3768
|
-
surface_instance_id: components["parameters"]["SurfaceInstanceID"];
|
|
3769
|
-
};
|
|
3770
|
-
cookie?: never;
|
|
3771
|
-
};
|
|
3772
|
-
requestBody: components["requestBodies"]["ReadSurfaceAssetRequest"];
|
|
3773
|
-
responses: {
|
|
3774
|
-
200: components["responses"]["SurfaceAssetResponse"];
|
|
3775
|
-
default: components["responses"]["PlatformErrorResponse"];
|
|
3776
|
-
};
|
|
3777
|
-
};
|
|
3778
3697
|
rejectSurfacePluginConfirmation: {
|
|
3779
3698
|
parameters: {
|
|
3780
3699
|
query?: never;
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FetchLike } from "./http.js";
|
|
2
2
|
import type { components } from "./openapi.gen.js";
|
|
3
|
-
import { type PluginConfirmationHandler, type PluginSurfaceHost, type PluginSurfaceContext, type PluginSurfaceOpeningProgress, type PluginSurfaceInteractionEvent, type PluginSurfaceFileExportHandler, type PluginSurfaceReloadLimiter, type PluginSurfaceSlot, type PluginMethodResult, type ReDevPluginSurfaceTransport } from "./surface.js";
|
|
3
|
+
import { type PluginConfirmationHandler, type PluginWebOriginPreparationHandler, type PluginSurfaceHost, type PluginSurfaceContext, type PluginSurfaceOpeningProgress, type PluginSurfaceInteractionEvent, type PluginSurfaceFileExportHandler, type PluginSurfaceReloadLimiter, type PluginSurfaceSlot, type PluginMethodResult, type ReDevPluginSurfaceTransport } from "./surface.js";
|
|
4
4
|
import { type PluginSurfaceScope } from "./surface-scope.js";
|
|
5
5
|
export type PluginPlatformClientOptions = {
|
|
6
6
|
fetch?: FetchLike;
|
|
@@ -47,9 +47,14 @@ export type PluginOpenSurfaceInSlotOptions = PluginRequestOptions & {
|
|
|
47
47
|
leaseRenewalLeadMs?: number;
|
|
48
48
|
reloadLimiter?: PluginSurfaceReloadLimiter;
|
|
49
49
|
confirm?: PluginConfirmationHandler;
|
|
50
|
+
prepareWebOrigin?: PluginWebOriginPreparationHandler;
|
|
50
51
|
onOpeningProgress?: (progress: PluginSurfaceOpeningProgress) => void;
|
|
51
52
|
onInteraction?: (event: PluginSurfaceInteractionEvent) => void;
|
|
52
53
|
onFileExport?: PluginSurfaceFileExportHandler;
|
|
54
|
+
confirmClose?: (request: {
|
|
55
|
+
reason: "unsaved" | "unresponsive";
|
|
56
|
+
signal: AbortSignal;
|
|
57
|
+
}) => boolean | Promise<boolean>;
|
|
53
58
|
onError?: (error: import("./errors.js").PluginBridgeError) => void;
|
|
54
59
|
surfaceContext?: PluginSurfaceContext;
|
|
55
60
|
};
|
package/dist/plugin.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { pluginAPIMajor } from "./contracts.gen.js";
|
|
|
4
4
|
export { createPluginProcessClient } from "./process.js";
|
|
5
5
|
export type { PluginProcessExitResult, PluginProcessMethodContracts, PluginProcessReadResult, PluginProcessResourceLimits, PluginProcessStartRequest, PluginProcessStatus, } from "./process.js";
|
|
6
6
|
export { callCapabilityOperation, callCapabilityStream, callCapabilitySync, isCapabilityBusinessError, } from "./capability-client.js";
|
|
7
|
-
export type { BridgeLifecycleEvent, MessagePortLike, PluginBridgeClientOptions,
|
|
7
|
+
export type { BridgeLifecycleEvent, MessagePortLike, PluginBridgeClientOptions, PluginBridgeClock, PluginBridgeRequestOptions, PluginFileExportRequest, PluginJSONObject, PluginJSONValue, PluginMethodResult, PluginExecutionFailureCode, PluginExecutionSnapshot, PluginExecutionProgress, PluginExecutionEvent, PluginExecutionEventList, PluginSurfaceContext, PluginSurfaceFileExportMediaType, } from "./surface.js";
|
|
8
8
|
export type { PluginCapabilitySchema, PluginCapabilityEffect, PluginCapabilityOperationContract, PluginCapabilityStreamContract, PluginCapabilitySyncContract, PluginCapabilityStreamEvent, PluginCapabilityStreamReadResult, PluginExecution, PluginExecutionTerminalStatus, PluginExecutionWaitOptions, PluginStream, } from "./capability-client.js";
|
package/dist/surface.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { PluginBridgeError, type PluginMutationOutcome } from "./errors.js";
|
|
2
2
|
import { type FetchLike } from "./http.js";
|
|
3
3
|
import { type PluginSurfaceScope } from "./surface-scope.js";
|
|
4
|
-
|
|
5
|
-
export type { PluginUIAttributeValue, PluginUIElementVNode, PluginUIPatchOperation, PluginUIVNode, } from "./ui-reconciler.js";
|
|
6
|
-
export declare const opaqueSurfaceDocumentSchemaVersion: "redevplugin.opaque_surface_document.v3";
|
|
4
|
+
export declare const webSurfaceDocumentSchemaVersion: "redevplugin.web_surface.v1";
|
|
7
5
|
export declare const pluginRiskPlanSchemaVersion: "redevplugin.capability.risk_plan.v1";
|
|
8
6
|
export type PluginJSONValue = null | boolean | number | string | PluginJSONValue[] | PluginJSONObject;
|
|
9
7
|
export type PluginJSONObject = {
|
|
@@ -84,25 +82,7 @@ export type PluginBridgeLifecycleAckMessage = {
|
|
|
84
82
|
type: "redevplugin.bridge.lifecycle_ack";
|
|
85
83
|
quiesce_id: string;
|
|
86
84
|
};
|
|
87
|
-
export type PluginUIActionEvent = {
|
|
88
|
-
action: string;
|
|
89
|
-
event: "click" | "input" | "change" | "submit" | "escape";
|
|
90
|
-
targetKey: string;
|
|
91
|
-
editRevision: number;
|
|
92
|
-
isComposing: boolean;
|
|
93
|
-
value?: string;
|
|
94
|
-
checked?: boolean;
|
|
95
|
-
form_data?: Record<string, string>;
|
|
96
|
-
};
|
|
97
|
-
export type PluginCanvasSurface = {
|
|
98
|
-
canvas: OffscreenCanvas;
|
|
99
|
-
canvasId: string;
|
|
100
|
-
cssWidth: number;
|
|
101
|
-
cssHeight: number;
|
|
102
|
-
devicePixelRatio: number;
|
|
103
|
-
};
|
|
104
85
|
export declare const pluginSurfaceFileExportMaxBytes: number;
|
|
105
|
-
export declare const pluginSurfaceFileExportActionWindowMs = 30000;
|
|
106
86
|
export declare const pluginSurfaceFileExportMediaTypes: readonly ["image/png", "image/jpeg", "image/webp", "image/svg+xml", "text/plain"];
|
|
107
87
|
export type PluginSurfaceFileExportMediaType = (typeof pluginSurfaceFileExportMediaTypes)[number];
|
|
108
88
|
export type PluginFileExportRequest = {
|
|
@@ -113,83 +93,8 @@ export type PluginFileExportRequest = {
|
|
|
113
93
|
export type PluginSurfaceFileExport = Readonly<PluginFileExportRequest & {
|
|
114
94
|
signal: AbortSignal;
|
|
115
95
|
}>;
|
|
96
|
+
/** The host must obtain an explicit destination/confirmation before writing exported bytes. */
|
|
116
97
|
export type PluginSurfaceFileExportHandler = (request: PluginSurfaceFileExport) => Promise<void> | void;
|
|
117
|
-
export type PluginCanvasAccessibilityState = {
|
|
118
|
-
label: string;
|
|
119
|
-
description: string;
|
|
120
|
-
};
|
|
121
|
-
export type PluginCanvasFocusEvent = {
|
|
122
|
-
type: "focus" | "blur";
|
|
123
|
-
};
|
|
124
|
-
export type PluginCanvasResizeEvent = {
|
|
125
|
-
type: "resize";
|
|
126
|
-
cssWidth: number;
|
|
127
|
-
cssHeight: number;
|
|
128
|
-
devicePixelRatio: number;
|
|
129
|
-
};
|
|
130
|
-
export type PluginCanvasKeyEvent = {
|
|
131
|
-
type: "key";
|
|
132
|
-
event: "keydown" | "keyup";
|
|
133
|
-
code: string;
|
|
134
|
-
key: string;
|
|
135
|
-
repeat: boolean;
|
|
136
|
-
altKey: boolean;
|
|
137
|
-
ctrlKey: boolean;
|
|
138
|
-
metaKey: boolean;
|
|
139
|
-
shiftKey: boolean;
|
|
140
|
-
};
|
|
141
|
-
export type PluginCanvasPointerEvent = {
|
|
142
|
-
type: "pointer";
|
|
143
|
-
event: "pointerdown" | "pointermove" | "pointerup" | "pointercancel";
|
|
144
|
-
pointerId: number;
|
|
145
|
-
pointerType: "mouse" | "pen" | "touch" | "unknown";
|
|
146
|
-
buttons: number;
|
|
147
|
-
button: number;
|
|
148
|
-
x: number;
|
|
149
|
-
y: number;
|
|
150
|
-
pressure: number;
|
|
151
|
-
};
|
|
152
|
-
export type PluginCanvasWheelEvent = {
|
|
153
|
-
type: "wheel";
|
|
154
|
-
x: number;
|
|
155
|
-
y: number;
|
|
156
|
-
deltaX: number;
|
|
157
|
-
deltaY: number;
|
|
158
|
-
deltaMode: 0 | 1 | 2;
|
|
159
|
-
altKey: boolean;
|
|
160
|
-
ctrlKey: boolean;
|
|
161
|
-
metaKey: boolean;
|
|
162
|
-
shiftKey: boolean;
|
|
163
|
-
};
|
|
164
|
-
export type PluginCanvasInputEvent = PluginCanvasFocusEvent | PluginCanvasResizeEvent | PluginCanvasKeyEvent | PluginCanvasPointerEvent | PluginCanvasWheelEvent;
|
|
165
|
-
export type PluginSurfaceKeyboardTargetKind = "canvas" | "editable" | "control" | "surface";
|
|
166
|
-
export type PluginSurfaceKeyboardBinding = {
|
|
167
|
-
id: string;
|
|
168
|
-
event: "keydown" | "keyup";
|
|
169
|
-
code: string;
|
|
170
|
-
repeat: boolean;
|
|
171
|
-
altKey: boolean;
|
|
172
|
-
ctrlKey: boolean;
|
|
173
|
-
metaKey: boolean;
|
|
174
|
-
shiftKey: boolean;
|
|
175
|
-
targetKey: string | null;
|
|
176
|
-
targetKind: PluginSurfaceKeyboardTargetKind;
|
|
177
|
-
};
|
|
178
|
-
export type PluginSurfaceKeyboardEvent = {
|
|
179
|
-
event: "keydown" | "keyup";
|
|
180
|
-
code: string;
|
|
181
|
-
key: string;
|
|
182
|
-
repeat: boolean;
|
|
183
|
-
altKey: boolean;
|
|
184
|
-
ctrlKey: boolean;
|
|
185
|
-
metaKey: boolean;
|
|
186
|
-
shiftKey: boolean;
|
|
187
|
-
isComposing: boolean;
|
|
188
|
-
targetKey: string | null;
|
|
189
|
-
targetKind: PluginSurfaceKeyboardTargetKind;
|
|
190
|
-
defaultPrevented: boolean;
|
|
191
|
-
bindingId: string | null;
|
|
192
|
-
};
|
|
193
98
|
export type PluginMethodResult<T = unknown> = {
|
|
194
99
|
data: T;
|
|
195
100
|
execution_id?: string;
|
|
@@ -323,8 +228,12 @@ export type MessageChannelLike = {
|
|
|
323
228
|
port1: MessagePortLike;
|
|
324
229
|
port2: MessagePortLike;
|
|
325
230
|
};
|
|
231
|
+
export type PluginBridgeClock = {
|
|
232
|
+
schedule(callback: () => void, delayMs: number): () => void;
|
|
233
|
+
};
|
|
326
234
|
export type PluginBridgeClientOptions = {
|
|
327
235
|
timeoutMs?: number;
|
|
236
|
+
clock?: PluginBridgeClock;
|
|
328
237
|
port?: MessagePortLike;
|
|
329
238
|
surfaceHandle?: string;
|
|
330
239
|
};
|
|
@@ -343,15 +252,9 @@ export declare class PluginBridgeClient {
|
|
|
343
252
|
executionSnapshot(executionID: string, options?: PluginBridgeRequestOptions): Promise<PluginExecutionSnapshot>;
|
|
344
253
|
context(): PluginSurfaceContext | undefined;
|
|
345
254
|
onContext(handler: (context: PluginSurfaceContext) => void): () => void;
|
|
346
|
-
render(tree: PluginUIVNode): Promise<void>;
|
|
347
|
-
openCanvas(canvasId: string): Promise<PluginCanvasSurface>;
|
|
348
|
-
updateCanvasAccessibility(canvasId: string, state: PluginCanvasAccessibilityState): Promise<void>;
|
|
349
|
-
setKeyboardBindings(bindings: readonly PluginSurfaceKeyboardBinding[]): Promise<void>;
|
|
350
|
-
onKeyboardInput(handler: (event: PluginSurfaceKeyboardEvent) => void): () => void;
|
|
351
|
-
loadImageAsset(assetId: string): Promise<ImageBitmap>;
|
|
352
255
|
exportFile(request: PluginFileExportRequest, options?: PluginBridgeRequestOptions): Promise<void>;
|
|
353
|
-
|
|
354
|
-
|
|
256
|
+
/** Return false when saving failed or the application still has unsaved work. */
|
|
257
|
+
onBeforeClose(handler: () => boolean | Promise<boolean>): () => void;
|
|
355
258
|
onLifecycle(handler: (event: BridgeLifecycleEvent) => Promise<void> | void): () => void;
|
|
356
259
|
dispose(): void;
|
|
357
260
|
}
|
|
@@ -394,37 +297,12 @@ export declare class PluginSurfaceReloadLimiter {
|
|
|
394
297
|
export declare function isPluginRiskPlan(plan: unknown): plan is PluginRiskPlan;
|
|
395
298
|
export declare function decodePluginEventText(event: PluginExecutionEvent): string;
|
|
396
299
|
export declare function trustedParentBridgeHandshakeTranscriptSHA256(handshake: TrustedParentBridgeHandshake, bridgeChannelID: string): Promise<string>;
|
|
397
|
-
export type
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
path: string;
|
|
404
|
-
sha256: string;
|
|
405
|
-
type: "classic";
|
|
406
|
-
content: string;
|
|
407
|
-
};
|
|
408
|
-
export type OpaqueSurfaceAsset = {
|
|
409
|
-
binding_id: string;
|
|
410
|
-
logical_ids: string[];
|
|
411
|
-
path: string;
|
|
412
|
-
sha256: string;
|
|
413
|
-
size: number;
|
|
414
|
-
content_type: string;
|
|
415
|
-
};
|
|
416
|
-
export type OpaqueSurfaceDocument = {
|
|
417
|
-
schema_version: typeof opaqueSurfaceDocumentSchemaVersion;
|
|
418
|
-
entry_path: string;
|
|
419
|
-
entry_sha256: string;
|
|
420
|
-
title?: string;
|
|
421
|
-
language?: string;
|
|
422
|
-
direction?: string;
|
|
423
|
-
body_html: string;
|
|
424
|
-
styles: OpaqueSurfaceStyle[];
|
|
425
|
-
worker: OpaqueSurfaceWorker;
|
|
426
|
-
assets: OpaqueSurfaceAsset[];
|
|
427
|
-
critical_bytes: number;
|
|
300
|
+
export type WebSurfaceDocument = {
|
|
301
|
+
schema_version: typeof webSurfaceDocumentSchemaVersion;
|
|
302
|
+
origin: string;
|
|
303
|
+
parent_origin: string;
|
|
304
|
+
bootstrap_url: string;
|
|
305
|
+
entry_url: string;
|
|
428
306
|
};
|
|
429
307
|
export type PluginSurfacePreparationResult = {
|
|
430
308
|
asset_session: string;
|
|
@@ -436,7 +314,7 @@ export type PluginSurfacePreparationResult = {
|
|
|
436
314
|
revoke_epoch: number;
|
|
437
315
|
issued_at: string;
|
|
438
316
|
expires_at: string;
|
|
439
|
-
document:
|
|
317
|
+
document: WebSurfaceDocument;
|
|
440
318
|
};
|
|
441
319
|
export type PluginSurfaceHostBootstrap = {
|
|
442
320
|
pluginId: string;
|
|
@@ -455,8 +333,8 @@ export type PluginSurfaceHostBootstrap = {
|
|
|
455
333
|
runtimeGenerationId: string;
|
|
456
334
|
};
|
|
457
335
|
export type PluginSurfaceHostContext = PluginSurfaceContext;
|
|
458
|
-
export type PluginSurfaceOpeningStage = "preparing" | "connecting" | "authorizing" | "initializing"
|
|
459
|
-
export type PluginSurfaceOpeningMilestone = "
|
|
336
|
+
export type PluginSurfaceOpeningStage = "preparing" | "connecting" | "authorizing" | "initializing";
|
|
337
|
+
export type PluginSurfaceOpeningMilestone = "prepare" | "origin" | "entry_ready" | "port_ack" | "token" | "app_ready";
|
|
460
338
|
export type PluginSurfaceOpeningProgress = {
|
|
461
339
|
phase: "opening";
|
|
462
340
|
elapsedMs: number;
|
|
@@ -480,6 +358,7 @@ export type PluginSurfaceHost = {
|
|
|
480
358
|
type: "ready" | "dispose";
|
|
481
359
|
}>): void;
|
|
482
360
|
updateContext(context: PluginSurfaceContext): void;
|
|
361
|
+
requestClose(): Promise<PluginSurfaceCloseResult | undefined>;
|
|
483
362
|
close(): Promise<PluginSurfaceCloseResult>;
|
|
484
363
|
dispose(): Promise<void>;
|
|
485
364
|
};
|
|
@@ -490,6 +369,16 @@ export type PreparedPluginSurfaceHost = PluginSurfaceHost & {
|
|
|
490
369
|
readonly surfaceHandle: string;
|
|
491
370
|
open(): Promise<void>;
|
|
492
371
|
};
|
|
372
|
+
/** Trusted host routing preparation. The signal remains active for the surface lifetime. */
|
|
373
|
+
export type PluginWebOriginPreparation = Readonly<{
|
|
374
|
+
origin: string;
|
|
375
|
+
parentOrigin: string;
|
|
376
|
+
pluginInstanceId: string;
|
|
377
|
+
surfaceInstanceId: string;
|
|
378
|
+
signal: AbortSignal;
|
|
379
|
+
}>;
|
|
380
|
+
/** Prepare only the allocated route; return no URL, token, or alternate bootstrap. */
|
|
381
|
+
export type PluginWebOriginPreparationHandler = (request: PluginWebOriginPreparation) => void | Promise<void>;
|
|
493
382
|
export type PluginSurfaceHostOptions = {
|
|
494
383
|
bootstrap: PluginSurfaceHostBootstrap;
|
|
495
384
|
hostTransport: ReDevPluginSurfaceTransport;
|
|
@@ -500,9 +389,14 @@ export type PluginSurfaceHostOptions = {
|
|
|
500
389
|
leaseRenewalLeadMs?: number;
|
|
501
390
|
reloadLimiter?: PluginSurfaceReloadLimiter;
|
|
502
391
|
confirm?: PluginConfirmationHandler;
|
|
392
|
+
prepareWebOrigin?: PluginWebOriginPreparationHandler;
|
|
503
393
|
onOpeningProgress?: (progress: PluginSurfaceOpeningProgress) => void;
|
|
504
394
|
onInteraction?: (event: PluginSurfaceInteractionEvent) => void;
|
|
505
395
|
onFileExport?: PluginSurfaceFileExportHandler;
|
|
396
|
+
confirmClose?: (request: {
|
|
397
|
+
reason: "unsaved" | "unresponsive";
|
|
398
|
+
signal: AbortSignal;
|
|
399
|
+
}) => boolean | Promise<boolean>;
|
|
506
400
|
onError?: (error: PluginBridgeError) => void;
|
|
507
401
|
surfaceContext?: PluginSurfaceContext;
|
|
508
402
|
};
|
|
@@ -522,9 +416,6 @@ export type ReDevPluginSurfaceTransportOptions = {
|
|
|
522
416
|
apiBaseURL?: string;
|
|
523
417
|
};
|
|
524
418
|
export declare function createReDevPluginSurfaceTransport(options?: ReDevPluginSurfaceTransportOptions): ReDevPluginSurfaceTransport;
|
|
525
|
-
export type OpaquePluginBootstrapHTMLOptions = {
|
|
526
|
-
scriptNonce?: string;
|
|
527
|
-
};
|
|
528
419
|
export type PluginSurfaceQuiesceResult = {
|
|
529
420
|
outcome: "acknowledged" | "not_ready" | "timed_out";
|
|
530
421
|
durationMs: number;
|
|
@@ -541,7 +432,6 @@ export type PluginSurfaceRevocationReconciliation = {
|
|
|
541
432
|
previous_state: "active" | "closed" | "absent";
|
|
542
433
|
revoked: boolean;
|
|
543
434
|
};
|
|
544
|
-
export declare function createOpaquePluginBootstrapHTML(options?: OpaquePluginBootstrapHTMLOptions): string;
|
|
545
435
|
export declare function createPreparedPluginSurfaceHost(options: PluginSurfaceHostOptions): PreparedPluginSurfaceHost;
|
|
546
436
|
export type PluginSurfaceSlotState = "empty" | "opening" | "ready" | "error" | "disposed";
|
|
547
437
|
export type PluginSurfaceSlotOptions = {
|
|
@@ -556,7 +446,11 @@ export declare class PluginSurfaceSlot {
|
|
|
556
446
|
readonly element: HTMLElement;
|
|
557
447
|
static create(options: PluginSurfaceSlotOptions): PluginSurfaceSlot;
|
|
558
448
|
private constructor();
|
|
449
|
+
/** Ask before removing a user-owned application; forced scope invalidation bypasses this. */
|
|
450
|
+
requestClose(): Promise<PluginSurfaceCloseResult | undefined>;
|
|
559
451
|
close(): Promise<PluginSurfaceCloseResult | undefined>;
|
|
560
452
|
dispose(): Promise<void>;
|
|
561
453
|
}
|
|
454
|
+
export declare function isWebSurfaceDocument(value: unknown): value is WebSurfaceDocument;
|
|
562
455
|
export declare function normalizePluginSurfaceContext(value: unknown): PluginSurfaceContext;
|
|
456
|
+
export {};
|