@floegence/redevplugin-ui 2.0.10 → 3.0.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/dist/contracts.gen.d.ts +1 -288
- package/dist/contracts.gen.js +2 -325
- package/dist/error-codes.gen.d.ts +3 -3
- package/dist/error-codes.gen.js +1 -7
- package/dist/opaque-surface-policy.gen.js +1 -1
- package/dist/openapi.gen.d.ts +193 -349
- package/dist/platform.d.ts +0 -6
- package/dist/platform.js +0 -5
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +1 -1
- package/dist/surface.d.ts +0 -5
- package/dist/surface.js +4 -17
- package/package.json +2 -2
package/dist/platform.d.ts
CHANGED
|
@@ -16,9 +16,6 @@ type PlatformSchemas = components["schemas"];
|
|
|
16
16
|
export type PluginCatalogResult = PlatformSchemas["PluginCatalogResult"];
|
|
17
17
|
export type PluginCatalogRecord = PluginCatalogResult["plugins"][number];
|
|
18
18
|
export type PluginFeatures = PlatformSchemas["PluginFeaturesSuccessResponse"]["data"];
|
|
19
|
-
export type PluginCompatibilityManifest = PlatformSchemas["PluginCompatibilityManifest"];
|
|
20
|
-
export type PluginCompatibilityMatrix = PluginCompatibilityManifest["matrix"];
|
|
21
|
-
export type PluginContractArtifact = PluginCompatibilityManifest["contracts"][number];
|
|
22
19
|
export type PluginTrustState = PlatformSchemas["TrustState"];
|
|
23
20
|
export type PluginTrustHashSet = PlatformSchemas["TrustHashSet"];
|
|
24
21
|
export type PluginVerifiedSignature = PlatformSchemas["VerifiedSignature"];
|
|
@@ -114,7 +111,6 @@ export type PluginDataBinding = PlatformSchemas["PluginDataBinding"];
|
|
|
114
111
|
export type PluginRetainedDataListOptions = PlatformSchemas["ListRetainedDataQueryRequest"];
|
|
115
112
|
export type PluginRetainedDataList = PlatformSchemas["RetainedDataList"];
|
|
116
113
|
export type PluginRetainedDataDeleteRequest = PlatformSchemas["DeleteRetainedDataRequest"];
|
|
117
|
-
export type PluginRetainedDataBindRequest = PlatformSchemas["BindRetainedDataRequest"];
|
|
118
114
|
export type PluginRetainedDataCleanupRequest = PlatformSchemas["CleanupExpiredRetainedDataRequest"];
|
|
119
115
|
export type PluginRetainedDataCleanupResult = PlatformSchemas["RetainedDataCleanupResult"];
|
|
120
116
|
export type PluginSecretRefRequest = PlatformSchemas["SecretRefRequest"];
|
|
@@ -132,7 +128,6 @@ export declare class PluginPlatformClient {
|
|
|
132
128
|
constructor(options?: PluginPlatformClientOptions);
|
|
133
129
|
catalog(options?: PluginRequestOptions): Promise<PluginCatalogResult>;
|
|
134
130
|
features(options?: PluginRequestOptions): Promise<PluginFeatures>;
|
|
135
|
-
getCompatibility(options?: PluginRequestOptions): Promise<PluginCompatibilityManifest>;
|
|
136
131
|
installReleaseRef(request: PluginInstallReleaseRefRequest, options?: PluginRequestOptions): Promise<PluginRecord>;
|
|
137
132
|
inspectReleasePackage(request: PluginInspectReleasePackageRequest, options?: PluginRequestOptions): Promise<PluginReleasePackageInspection>;
|
|
138
133
|
inspectExternalPackage(request: PluginInspectExternalPackageRequest, options?: PluginRequestOptions): Promise<PluginExternalPackageInspection>;
|
|
@@ -165,7 +160,6 @@ export declare class PluginPlatformClient {
|
|
|
165
160
|
importData(request: PluginDataImportRequest, options?: PluginRequestOptions): Promise<PluginRecord>;
|
|
166
161
|
listRetainedData(options?: PluginRetainedDataListOptions, requestOptions?: PluginRequestOptions): Promise<PluginRetainedDataList>;
|
|
167
162
|
deleteRetainedData(request: PluginRetainedDataDeleteRequest, options?: PluginRequestOptions): Promise<PluginDataBinding>;
|
|
168
|
-
bindRetainedData(request: PluginRetainedDataBindRequest, options?: PluginRequestOptions): Promise<PluginDataBinding>;
|
|
169
163
|
cleanupExpiredRetainedData(request?: PluginRetainedDataCleanupRequest, options?: PluginRequestOptions): Promise<PluginRetainedDataCleanupResult>;
|
|
170
164
|
listPermissions(options?: PluginPermissionListOptions, requestOptions?: PluginRequestOptions): Promise<PluginPermissionList>;
|
|
171
165
|
getPermissionRequirements(request: PluginPermissionRequirementsRequest, options?: PluginRequestOptions): Promise<PluginPermissionRequirements>;
|
package/dist/platform.js
CHANGED
|
@@ -7,7 +7,6 @@ function toPluginSurfaceHostBootstrap(value) {
|
|
|
7
7
|
pluginId: value.plugin_id,
|
|
8
8
|
pluginInstanceId: value.plugin_instance_id,
|
|
9
9
|
pluginVersion: value.plugin_version,
|
|
10
|
-
uiProtocolVersion: value.ui_protocol_version,
|
|
11
10
|
surfaceId: value.surface_id,
|
|
12
11
|
surfaceInstanceId: value.surface_instance_id,
|
|
13
12
|
activeFingerprint: value.active_fingerprint,
|
|
@@ -37,7 +36,6 @@ export class PluginPlatformClient {
|
|
|
37
36
|
}
|
|
38
37
|
catalog(options = {}) { return this.#requestQuery("/_redevplugin/api/plugins/catalog/query", {}, options); }
|
|
39
38
|
features(options = {}) { return this.#requestQuery("/_redevplugin/api/plugins/features/query", {}, options); }
|
|
40
|
-
getCompatibility(options = {}) { return this.#requestQuery("/_redevplugin/api/plugins/platform/compatibility/query", {}, options); }
|
|
41
39
|
installReleaseRef(request, options = {}) {
|
|
42
40
|
return this.#requestMutation("POST", "/_redevplugin/api/plugins/install-release-ref", request, options);
|
|
43
41
|
}
|
|
@@ -202,9 +200,6 @@ export class PluginPlatformClient {
|
|
|
202
200
|
deleteRetainedData(request, options = {}) {
|
|
203
201
|
return this.#requestMutation("POST", "/_redevplugin/api/plugins/retained-data/delete", request, options);
|
|
204
202
|
}
|
|
205
|
-
bindRetainedData(request, options = {}) {
|
|
206
|
-
return this.#mutatePluginAt("POST", "/_redevplugin/api/plugins/retained-data/bind", request.target_plugin_instance_id, request, options);
|
|
207
|
-
}
|
|
208
203
|
cleanupExpiredRetainedData(request = {}, options = {}) {
|
|
209
204
|
return this.#requestMutation("POST", "/_redevplugin/api/plugins/retained-data/cleanup-expired", request, options);
|
|
210
205
|
}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PluginBridgeClient } from "./surface.js";
|
|
2
2
|
export { PluginBridgeError } from "./errors.js";
|
|
3
|
-
export {
|
|
3
|
+
export { pluginAPIMajor } from "./contracts.gen.js";
|
|
4
4
|
export { callCapabilityOperation, callCapabilityStream, callCapabilitySync, isCapabilityBusinessError, } from "./capability-client.js";
|
|
5
5
|
export type { BridgeLifecycleEvent, MessagePortLike, PluginBridgeClientOptions, PluginBridgeRequestOptions, PluginCanvasAccessibilityState, PluginCanvasInputEvent, PluginCanvasKeyEvent, PluginCanvasPointerEvent, PluginCanvasResizeEvent, PluginCanvasSurface, PluginJSONObject, PluginJSONValue, PluginMethodResult, PluginExecutionFailureCode, PluginExecutionSnapshot, PluginExecutionProgress, PluginExecutionEvent, PluginExecutionEventList, PluginSurfaceContext, PluginUIActionEvent, PluginUIAttributeValue, PluginUIElementVNode, PluginUIPatchOperation, PluginUIVNode, } from "./surface.js";
|
|
6
6
|
export type { PluginCapabilitySchema, PluginCapabilityEffect, PluginCapabilityOperationContract, PluginCapabilityStreamContract, PluginCapabilitySyncContract, PluginCapabilityStreamEvent, PluginCapabilityStreamReadResult, PluginExecution, PluginExecutionTerminalStatus, PluginExecutionWaitOptions, PluginStream, } from "./capability-client.js";
|
package/dist/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { PluginBridgeClient } from "./surface.js";
|
|
2
2
|
export { PluginBridgeError } from "./errors.js";
|
|
3
|
-
export {
|
|
3
|
+
export { pluginAPIMajor } from "./contracts.gen.js";
|
|
4
4
|
export { callCapabilityOperation, callCapabilityStream, callCapabilitySync, isCapabilityBusinessError, } from "./capability-client.js";
|
package/dist/surface.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PluginBridgeError, type PluginMutationOutcome } from "./errors.js";
|
|
2
|
-
import { pluginUIProtocolVersion } from "./contracts.gen.js";
|
|
3
2
|
import { type FetchLike } from "./http.js";
|
|
4
3
|
import { type PluginSurfaceScope } from "./surface-scope.js";
|
|
5
4
|
import { type PluginUIVNode } from "./ui-reconciler.js";
|
|
@@ -10,7 +9,6 @@ export type PluginJSONValue = null | boolean | number | string | PluginJSONValue
|
|
|
10
9
|
export type PluginJSONObject = {
|
|
11
10
|
[key: string]: PluginJSONValue;
|
|
12
11
|
};
|
|
13
|
-
export type PluginUIProtocolVersion = typeof pluginUIProtocolVersion;
|
|
14
12
|
export declare const pluginSurfaceContextSchemaVersion: "redevplugin.surface_context.v1";
|
|
15
13
|
export type PluginSurfaceContext = Readonly<{
|
|
16
14
|
schema_version: typeof pluginSurfaceContextSchemaVersion;
|
|
@@ -47,7 +45,6 @@ export type TrustedParentBridgeHandshake = {
|
|
|
47
45
|
asset_session_nonce: string;
|
|
48
46
|
management_revision: number;
|
|
49
47
|
revoke_epoch: number;
|
|
50
|
-
ui_protocol_version: PluginUIProtocolVersion;
|
|
51
48
|
};
|
|
52
49
|
export type TrustedParentBridgeTokenRequest = {
|
|
53
50
|
bridge_channel_id: string;
|
|
@@ -389,7 +386,6 @@ export type PluginSurfaceHostBootstrap = {
|
|
|
389
386
|
pluginId: string;
|
|
390
387
|
pluginInstanceId: string;
|
|
391
388
|
pluginVersion: string;
|
|
392
|
-
uiProtocolVersion: PluginUIProtocolVersion;
|
|
393
389
|
surfaceId: string;
|
|
394
390
|
surfaceInstanceId: string;
|
|
395
391
|
activeFingerprint: string;
|
|
@@ -466,7 +462,6 @@ export type ReDevPluginSurfaceTransportOptions = {
|
|
|
466
462
|
export declare function createReDevPluginSurfaceTransport(options?: ReDevPluginSurfaceTransportOptions): ReDevPluginSurfaceTransport;
|
|
467
463
|
export type OpaquePluginBootstrapHTMLOptions = {
|
|
468
464
|
scriptNonce?: string;
|
|
469
|
-
uiProtocolVersion?: PluginUIProtocolVersion;
|
|
470
465
|
};
|
|
471
466
|
export type PluginSurfaceQuiesceResult = {
|
|
472
467
|
outcome: "acknowledged" | "not_ready" | "timed_out";
|
package/dist/surface.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginBridgeError, PluginPlatformRequestError, PluginTransportError, pluginBridgeErrorCodes, } from "./errors.js";
|
|
2
2
|
import { pluginBridgeCapabilityEffect, } from "./bridge-capability.js";
|
|
3
|
-
import { pluginUIProtocolVersion } from "./contracts.gen.js";
|
|
4
3
|
import { opaqueSurfaceAllowedTags, opaqueSurfaceGlobalAttributes, opaqueSurfaceRenderLimits, opaqueSurfaceSafeInputTypes, opaqueSurfaceTagAttributes, } from "./opaque-surface-policy.gen.js";
|
|
5
4
|
import { defaultFetch, hasAllowedKeys, hasExactKeys, hasRequiredKeys, isRecord, readMutationPlatformResponse, readPlatformResponse, } from "./http.js";
|
|
6
5
|
import { defaultPluginSurfaceScope, registerPluginSurface, } from "./surface-scope.js";
|
|
@@ -627,7 +626,6 @@ export async function trustedParentBridgeHandshakeTranscriptSHA256(handshake, br
|
|
|
627
626
|
handshake.asset_session_nonce,
|
|
628
627
|
String(handshake.management_revision),
|
|
629
628
|
String(handshake.revoke_epoch),
|
|
630
|
-
handshake.ui_protocol_version,
|
|
631
629
|
bridgeChannelID,
|
|
632
630
|
];
|
|
633
631
|
const chunks = [];
|
|
@@ -713,10 +711,6 @@ export function createOpaquePluginBootstrapHTML(options = {}) {
|
|
|
713
711
|
if (!/^[A-Za-z0-9_-]{8,128}$/.test(scriptNonce)) {
|
|
714
712
|
throw new Error("scriptNonce must contain 8-128 URL-safe characters");
|
|
715
713
|
}
|
|
716
|
-
const uiProtocolVersion = options.uiProtocolVersion ?? pluginUIProtocolVersion;
|
|
717
|
-
if (uiProtocolVersion !== pluginUIProtocolVersion) {
|
|
718
|
-
throw new Error(`uiProtocolVersion must be ${pluginUIProtocolVersion}`);
|
|
719
|
-
}
|
|
720
714
|
const csp = [
|
|
721
715
|
"default-src 'none'",
|
|
722
716
|
`script-src 'nonce-${scriptNonce}'`,
|
|
@@ -735,7 +729,6 @@ export function createOpaquePluginBootstrapHTML(options = {}) {
|
|
|
735
729
|
].join("; ");
|
|
736
730
|
const bootstrapScript = `(() => {
|
|
737
731
|
"use strict";
|
|
738
|
-
const protocolVersion = ${JSON.stringify(uiProtocolVersion)};
|
|
739
732
|
const documentSchema = ${JSON.stringify(opaqueSurfaceDocumentSchemaVersion)};
|
|
740
733
|
const workerGlobalKey = ${JSON.stringify(opaquePluginBridgeGlobalKey)};
|
|
741
734
|
const scriptNonce = ${JSON.stringify(scriptNonce)};
|
|
@@ -1810,7 +1803,7 @@ export function createOpaquePluginBootstrapHTML(options = {}) {
|
|
|
1810
1803
|
'const __rpTimer = setTimeout(() => close(), 30000);',
|
|
1811
1804
|
'const __rpListener = (event) => {',
|
|
1812
1805
|
' const value = event.data;',
|
|
1813
|
-
' if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).sort().join(",") !== "port_roles,surface_handle,type
|
|
1806
|
+
' if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).sort().join(",") !== "port_roles,surface_handle,type" || value.type !== "redevplugin.worker.initialize" || typeof value.surface_handle !== "string" || !Array.isArray(value.port_roles) || value.port_roles.join(",") !== "runtime_control,plugin_bridge" || !event.ports || event.ports.length !== 2) return;',
|
|
1814
1807
|
' clearTimeout(__rpTimer); removeEventListener("message", __rpListener);',
|
|
1815
1808
|
' const __rpSurfaceHandle = value.surface_handle;',
|
|
1816
1809
|
' const __rpControlPort = event.ports[0];',
|
|
@@ -1977,7 +1970,7 @@ export function createOpaquePluginBootstrapHTML(options = {}) {
|
|
|
1977
1970
|
workerPort = pluginChannel.port1;
|
|
1978
1971
|
workerPort.addEventListener("message", onWorkerMessage);
|
|
1979
1972
|
workerPort.start();
|
|
1980
|
-
worker.postMessage({ type: "redevplugin.worker.initialize", surface_handle: surfaceHandle,
|
|
1973
|
+
worker.postMessage({ type: "redevplugin.worker.initialize", surface_handle: surfaceHandle, port_roles: ["runtime_control", "plugin_bridge"] }, [controlChannel.port2, pluginChannel.port2]);
|
|
1981
1974
|
if (currentContext) sendWorker({ type: "redevplugin.bridge.context", context: currentContext });
|
|
1982
1975
|
};
|
|
1983
1976
|
const validCall = (value) => exactKeys(value, ["type", "request"]) && value.type === "redevplugin.bridge.call" && isRecord(value.request) && Object.keys(value.request).every((key) => ["id", "method", "params"].includes(key)) && typeof value.request.id === "string" && value.request.id.length <= 128 && typeof value.request.method === "string" && /^[A-Za-z0-9._:-]{1,256}$/.test(value.request.method) && (value.request.params === undefined || isRecord(value.request.params));
|
|
@@ -2390,7 +2383,7 @@ export function createOpaquePluginBootstrapHTML(options = {}) {
|
|
|
2390
2383
|
const onWindowMessage = (event) => {
|
|
2391
2384
|
if (accepted || event.source !== parent || !event.ports || event.ports.length !== 1) return;
|
|
2392
2385
|
const message = event.data;
|
|
2393
|
-
if (!exactKeys(message, ["type", "frame_generation_id"
|
|
2386
|
+
if (!exactKeys(message, ["type", "frame_generation_id"]) || message.type !== "redevplugin.surface.port" || !validOpaqueHandle(message.frame_generation_id, "frame")) return;
|
|
2394
2387
|
accepted = true;
|
|
2395
2388
|
frameGenerationID = message.frame_generation_id;
|
|
2396
2389
|
removeEventListener("message", onWindowMessage);
|
|
@@ -2522,7 +2515,7 @@ class PluginSurfaceHostImplementation {
|
|
|
2522
2515
|
this.#initialFrameLoad = initialFrameLoad;
|
|
2523
2516
|
this.#iframe.addEventListener("load", this.#onFrameLoad);
|
|
2524
2517
|
hardenPluginSurfaceFrame(this.#iframe);
|
|
2525
|
-
this.#iframe.srcdoc = createOpaquePluginBootstrapHTML({ scriptNonce
|
|
2518
|
+
this.#iframe.srcdoc = createOpaquePluginBootstrapHTML({ scriptNonce });
|
|
2526
2519
|
try {
|
|
2527
2520
|
await withTimeout(this.#completeOpening(signals, initialFrameLoad.promise), this.#loadTimeoutMs, "Plugin surface opening timed out");
|
|
2528
2521
|
}
|
|
@@ -2561,7 +2554,6 @@ class PluginSurfaceHostImplementation {
|
|
|
2561
2554
|
iframeWindow.postMessage({
|
|
2562
2555
|
type: "redevplugin.surface.port",
|
|
2563
2556
|
frame_generation_id: this.frameGenerationId,
|
|
2564
|
-
ui_protocol_version: this.bootstrap.uiProtocolVersion,
|
|
2565
2557
|
}, "*", [channel.port2]);
|
|
2566
2558
|
await signals.portAcknowledged.promise;
|
|
2567
2559
|
this.#assertActive();
|
|
@@ -3028,7 +3020,6 @@ class PluginSurfaceHostImplementation {
|
|
|
3028
3020
|
asset_session_nonce: this.bootstrap.assetSessionNonce,
|
|
3029
3021
|
management_revision: this.bootstrap.managementRevision,
|
|
3030
3022
|
revoke_epoch: this.bootstrap.revokeEpoch,
|
|
3031
|
-
ui_protocol_version: this.bootstrap.uiProtocolVersion,
|
|
3032
3023
|
};
|
|
3033
3024
|
}
|
|
3034
3025
|
async #postJSON(path, body, signal) {
|
|
@@ -3843,7 +3834,6 @@ function validateHostBootstrap(bootstrap) {
|
|
|
3843
3834
|
bootstrap.pluginId,
|
|
3844
3835
|
bootstrap.pluginInstanceId,
|
|
3845
3836
|
bootstrap.pluginVersion,
|
|
3846
|
-
bootstrap.uiProtocolVersion,
|
|
3847
3837
|
bootstrap.surfaceId,
|
|
3848
3838
|
bootstrap.surfaceInstanceId,
|
|
3849
3839
|
bootstrap.activeFingerprint,
|
|
@@ -3858,9 +3848,6 @@ function validateHostBootstrap(bootstrap) {
|
|
|
3858
3848
|
throw new PluginBridgeError("PLUGIN_CONTRACT_MISMATCH", "Plugin surface bootstrap is incomplete");
|
|
3859
3849
|
}
|
|
3860
3850
|
}
|
|
3861
|
-
if (bootstrap.uiProtocolVersion !== pluginUIProtocolVersion) {
|
|
3862
|
-
throw new PluginBridgeError("PLUGIN_CONTRACT_MISMATCH", "Plugin surface UI protocol is unsupported");
|
|
3863
|
-
}
|
|
3864
3851
|
if (!Number.isSafeInteger(bootstrap.managementRevision) || bootstrap.managementRevision < 1 ||
|
|
3865
3852
|
!Number.isSafeInteger(bootstrap.revokeEpoch) || bootstrap.revokeEpoch < 1) {
|
|
3866
3853
|
throw new PluginBridgeError("PLUGIN_CONTRACT_MISMATCH", "Plugin surface revision is invalid");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floegence/redevplugin-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@floegence/redevplugin-contracts": "
|
|
43
|
+
"@floegence/redevplugin-contracts": "3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|