@paged-media/plugin-api 0.2.33-canary.0 → 0.2.35-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
@@ -1235,6 +1235,40 @@ export interface DiagnosticsSurface {
1235
1235
  get(key: string): Diagnostic[];
1236
1236
  onDidChange(listener: (key: string) => void): Disposable;
1237
1237
  }
1238
+ /** One entry a bundle contributes to the host's journal.
1239
+ *
1240
+ * The host stamps `plugin`, `seq`, `t` and `origin` — a bundle cannot forge
1241
+ * attribution, the same provenance rule `contribute.panel` already applies. */
1242
+ export interface JournalRecord {
1243
+ /** Dotted, and MUST be namespaced under the manifest id — the same
1244
+ * chokepoint as every other contribution id, so an entry is always
1245
+ * attributable. e.g. `media.paged.draw.boolean.union`. */
1246
+ code: string;
1247
+ severity?: "debug" | "info" | "warn" | "error";
1248
+ durMs?: number;
1249
+ /** Bounded scalars. String values MUST match
1250
+ * `/^[a-z0-9][a-z0-9._:-]{0,63}$/` — a sentence, a file path, a font
1251
+ * family or any user text CANNOT pass, BY DESIGN. There is deliberately no
1252
+ * free-text field anywhere on this type: that is the field through which
1253
+ * PII leaks in every telemetry system ever built. A rejected value is
1254
+ * dropped and COUNTED, never silently truncated (a truncated path is still
1255
+ * a path). Keep the human sentence in `host.log`, which goes to the
1256
+ * console and is not part of any exported artifact. */
1257
+ data?: Record<string, number | boolean | string>;
1258
+ }
1259
+ /** The JOURNAL door — a local, in-memory flight recorder.
1260
+ *
1261
+ * With no host buffer wired this surface is INERT and
1262
+ * `supports("journal@1")` is false. That means "recording goes nowhere",
1263
+ * never "calling this throws": an instrumentation door that can break the
1264
+ * plugin it instruments is worse than no door. */
1265
+ export interface JournalSurface {
1266
+ record(entry: JournalRecord): void;
1267
+ /** Time a thunk (sync or async) and record one entry carrying `durMs` and
1268
+ * `data.ok`. The thunk's own result and exceptions pass through unchanged
1269
+ * — instrumenting a call must not alter what it returns or hide a throw. */
1270
+ time<T>(code: string, fn: () => T | Promise<T>): Promise<T>;
1271
+ }
1238
1272
  export interface BindingsSurface {
1239
1273
  /** Publish (or update) a named reactive value. Schema rows reading
1240
1274
  * `{ bind: name }` re-render on every change. JSON only. */
@@ -1310,6 +1344,9 @@ export interface BundleHost {
1310
1344
  * `supports("dataProviders@1")` is false (the honest no-registry posture). */
1311
1345
  readonly dataProviders: DataProvidersSurface;
1312
1346
  readonly diagnostics: DiagnosticsSurface;
1347
+ /** ADR 025 — the local flight recorder. Probe `supports("journal@1")`
1348
+ * before relying on it reaching a buffer; calling it is always safe. */
1349
+ readonly journal: JournalSurface;
1313
1350
  /** Published reactive values (W3.1) — the dynamic half of schema
1314
1351
  * panels: a bundle publishes named booleans (and JSON values) that
1315
1352
  * schema rows reference for `visible`/`enabled`. The plugin owns 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, TextCaret, FrameChainLink, PlanarFace, PlanarRegionsResult, StoryContent, ParagraphContent, RunContent, OverlaySurface, ShellSurface, FilePickerOptions, PickedFile, SaveFileOptions, 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, MenuContribution, } from "./host";
3
+ export type { BundleHost, ContributionSurface, SceneLayerSurface, ImagesSurface, ImageResourceClaimOptions, TileBytes, WorkersSurface, BundleWorker, SpawnWorkerOptions, SecretsSurface, SecretMaterial, DocumentSurface, SelectionSurface, ViewportSurface, TextSurface, TextMetrics, TextCaret, FrameChainLink, PlanarFace, PlanarRegionsResult, StoryContent, ParagraphContent, RunContent, OverlaySurface, ShellSurface, FilePickerOptions, PickedFile, SaveFileOptions, StorageSurface, BlobSurface, BlobUsage, PartsSurface, NativeDocumentSurface, NetworkSurface, ConsentResult, DataProvidersSurface, DataProviderRegistration, DataProviderHandle, DataProviderInfo, DataProviderSnapshot, ProviderSchema, ProviderField, ProviderRecordSet, DiagnosticsSurface, JournalSurface, JournalRecord, BindingsSurface, Diagnostic, DocumentChangeEvent, MutationOutcome, Disposable, PluginLogger, EditContextContribution, ObjectTypeContribution, EditContextCandidate, EnteredEditContext, ContentPointerEvent, EditContextDescriptor, ObjectTypeDescriptor, PluginMetadataEnvelope, ObjectTypeBaker, BakeContext, MenuContribution, } from "./host";
4
4
  export type { PanelSchema, PanelSchemaSection, PanelSchemaRow, SchemaPanelContribution, SchemaPanelRenderer, SchemaPanelRendererProps, WidgetValueBinding, BindingRef, SchemaGate, WidgetCollectionBinding, SchemaRowAction, SchemaListAction, SchemaListSpec, } from "./panel-schema";
5
5
  export type { WidgetSurface, CodeEditorProps, CodeEditorDiagnostic, CodeEditorLanguage, } from "./widgets";
6
6
  export type { BindingTarget, BindingPropertyRequest, BindingPropertyWrite, BindingCollectionRequest, BindingRead, BindingResolved, BindingDecline, BindingWrite, BindingCollection, BindingOp, BindingProvider, BindingProviderScope, BindingProviderHandle, BindingReadResult, BindingWriteResult, BindingCollectionResult, ActiveBindingProvider, } from "./binding-provider";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-api",
3
- "version": "0.2.33-canary.0",
3
+ "version": "0.2.35-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",