@paged-media/plugin-api 0.2.25-canary.0 → 0.2.27-canary.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/host.d.ts CHANGED
@@ -707,6 +707,20 @@ export interface PartsSurface {
707
707
  * returned as relative paths. */
708
708
  list(prefix?: string): Promise<string[]>;
709
709
  }
710
+ export interface NativeDocumentSurface {
711
+ /** Read the core-owned native MODEL part (`paged/core/model/document.pgm`)
712
+ * bytes, or null if the document carries no native model part. */
713
+ readModel(): Promise<Uint8Array | null>;
714
+ /** Read the core-owned COMPOSITION part (`paged/core/composition/document.pgd`)
715
+ * bytes, or null if absent. */
716
+ readComposition(): Promise<Uint8Array | null>;
717
+ /** List the container's `paged/core/` native part paths (optionally under a
718
+ * relative prefix). Empty when the host wires no backend. */
719
+ listParts(prefix?: string): Promise<string[]>;
720
+ /** Replace the active document by loading a native/importable package
721
+ * (an importer plugin produces these bytes, e.g. from IDML). */
722
+ open(bytes: Uint8Array): Promise<void>;
723
+ }
710
724
  /** The per-origin outcome of a consent request. */
711
725
  export interface ConsentResult {
712
726
  /** Origins the user granted (a subset of the requested set). */
@@ -861,6 +875,17 @@ export interface BundleHost {
861
875
  * null/`[]`, writes reject, and `supports("storage.parts@1")` is false. The
862
876
  * part-types are declared in `contributes.partTypes`. */
863
877
  readonly parts: PartsSurface;
878
+ /** The isolate-safe NATIVE-DOCUMENT door (ADR-021): capability-gated read of
879
+ * the host document's CORE-OWNED native parts (`paged/core/` MODEL +
880
+ * COMPOSITION) + loading a plugin-produced native/importable package as the
881
+ * active document — the isolate-safe replacement for the `host.editor.client`
882
+ * escape hatch used by importers/exporters. Gated on
883
+ * `capabilities.document.readNative` (the reads) and
884
+ * `capabilities.document.openNative` (`open`). Always present; when the host
885
+ * wires no backend, reads answer null/`[]`, `open` rejects, and
886
+ * `supports("document.readNative@1")` / `supports("document.openNative@1")`
887
+ * are false. */
888
+ readonly nativeDocument: NativeDocumentSurface;
864
889
  /** The capability-gated NETWORK CONSENT door (D-03; base-idea §11). Always
865
890
  * present; gated on `capabilities.network` and per-origin user consent.
866
891
  * When the host injects no consent backend, every request is DENIED (the
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, WorkersCapability, SecretsCapability, GpuCapability, } from "./manifest";
2
2
  export type { BundleHandle, PagedBundle } from "./bundle";
3
- export type { BundleHost, ContributionSurface, SceneLayerSurface, ImagesSurface, ImageResourceClaimOptions, TileBytes, WorkersSurface, BundleWorker, SpawnWorkerOptions, SecretsSurface, SecretMaterial, DocumentSurface, SelectionSurface, ViewportSurface, TextSurface, TextMetrics, FrameChainLink, OverlaySurface, ShellSurface, FilePickerOptions, PickedFile, StorageSurface, BlobSurface, BlobUsage, PartsSurface, NetworkSurface, ConsentResult, DataProvidersSurface, DataProviderRegistration, DataProviderHandle, DataProviderInfo, DataProviderSnapshot, ProviderSchema, ProviderField, ProviderRecordSet, DiagnosticsSurface, BindingsSurface, Diagnostic, DocumentChangeEvent, MutationOutcome, Disposable, PluginLogger, EditContextContribution, ObjectTypeContribution, EditContextCandidate, EnteredEditContext, ContentPointerEvent, EditContextDescriptor, ObjectTypeDescriptor, PluginMetadataEnvelope, ObjectTypeBaker, BakeContext, } from "./host";
3
+ export type { BundleHost, ContributionSurface, SceneLayerSurface, ImagesSurface, ImageResourceClaimOptions, TileBytes, WorkersSurface, BundleWorker, SpawnWorkerOptions, SecretsSurface, SecretMaterial, DocumentSurface, SelectionSurface, ViewportSurface, TextSurface, TextMetrics, FrameChainLink, OverlaySurface, ShellSurface, FilePickerOptions, PickedFile, StorageSurface, BlobSurface, BlobUsage, PartsSurface, NativeDocumentSurface, NetworkSurface, ConsentResult, DataProvidersSurface, DataProviderRegistration, DataProviderHandle, DataProviderInfo, DataProviderSnapshot, ProviderSchema, ProviderField, ProviderRecordSet, DiagnosticsSurface, BindingsSurface, Diagnostic, DocumentChangeEvent, MutationOutcome, Disposable, PluginLogger, EditContextContribution, ObjectTypeContribution, EditContextCandidate, EnteredEditContext, ContentPointerEvent, EditContextDescriptor, ObjectTypeDescriptor, PluginMetadataEnvelope, ObjectTypeBaker, BakeContext, } from "./host";
4
4
  export type { PanelSchema, PanelSchemaSection, PanelSchemaRow, SchemaPanelContribution, SchemaPanelRenderer, SchemaPanelRendererProps, WidgetValueBinding, BindingRef, SchemaGate, } from "./panel-schema";
5
5
  export type { WidgetSurface, CodeEditorProps, CodeEditorDiagnostic, CodeEditorLanguage, } from "./widgets";
6
6
  export type { AssetSurface, AssetKind, FontFaceAsset, FontFaceFormat, } from "./assets";
@@ -27,6 +27,16 @@ export interface PluginCapabilities {
27
27
  document?: {
28
28
  read?: "broad" | "scoped";
29
29
  write?: "broad" | "scoped";
30
+ /** Privileged READ of the document's core-owned NATIVE parts
31
+ * (`host.nativeDocument.readModel/readComposition/listParts`, the
32
+ * `paged/core/` subtree — ADR-021). Gates the native read doors; an
33
+ * absent field denies them. */
34
+ readNative?: boolean;
35
+ /** Authorizes REPLACING the active document by loading a
36
+ * plugin-produced native/importable package
37
+ * (`host.nativeDocument.open` — an importer's door). Gates that write;
38
+ * an absent field denies it. */
39
+ openNative?: boolean;
30
40
  };
31
41
  /** Render-pipeline surfaces the bundle uses. `overlay` means the
32
42
  * shared TS overlay signals (tool previews) AND `contribute.overlay`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-api",
3
- "version": "0.2.25-canary.0",
3
+ "version": "0.2.27-canary.0",
4
4
  "description": "The Paged plugin contract: manifest, bundle lifecycle, the BundleHost surface, and the contribution + engine wire types. Type-only.",
5
5
  "license": "MPL-2.0 OR LicenseRef-PMEL",
6
6
  "type": "module",
@@ -51,6 +51,14 @@
51
51
  "broad",
52
52
  "scoped"
53
53
  ]
54
+ },
55
+ "readNative": {
56
+ "type": "boolean",
57
+ "description": "Privileged read of the document's core-owned native parts (host.nativeDocument reads; the paged/core/ subtree — ADR-021)."
58
+ },
59
+ "openNative": {
60
+ "type": "boolean",
61
+ "description": "Authorizes replacing the active document by loading a plugin-produced native/importable package (host.nativeDocument.open)."
54
62
  }
55
63
  }
56
64
  },