@markupai/sidebar-adapter 2.0.0 → 2.2.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 CHANGED
@@ -18,7 +18,8 @@ You do **not** need prior knowledge of how the sidebar is built internally. As a
18
18
  10. [Sidebar load overlay (standalone)](#sidebarloadoverlay-editor-ui)
19
19
  11. [Agentic issue lifecycle](#agentic-issue-lifecycle) · [Document references](#document-references)
20
20
  12. [Multi-document hosts](#multi-document-hosts)
21
- 13. [API reference](#api-reference) · [Development](#development)
21
+ 13. [Sidebar build reporting](#sidebar-build-reporting) (which sidebar build is running)
22
+ 14. [API reference](#api-reference) · [Development](#development)
22
23
 
23
24
  ## Features
24
25
 
@@ -257,6 +258,8 @@ Use `setupSidebarLoadOverlay` when you manage the iframe yourself and only want
257
258
 
258
259
  The overlay listens for the first qualifying **`message`** from **`iframe.contentWindow`** to treat the sidebar as loaded. By default it attaches to the global **`window`**. If the iframe’s **`parent`** is not that window (popup, separate host document), pass **`messageListenWindow`** in options so it matches the iframe’s parent—otherwise the timeout may fire even when the sidebar is healthy.
259
260
 
261
+ > **Still relevant after the sidebar’s service worker.** The sidebar now registers a service worker that precaches its app shell, so once a host has opened it successfully once, later opens paint from the local cache with no network round-trip — the load timeout and auto-retry then almost never fire. It is **not** redundant, though: the overlay is still the recovery path for the **first-ever open in a host** (cold, nothing cached yet — exactly when a slow or flaky host-machine network hurts most), a host where the service worker cannot register (restricted iframe sandbox, non-secure context), and a genuine origin outage or misconfiguration. The "loaded" signal is unchanged — a cached shell still boots the app and posts the same first `message`. Keep `setupSidebarLoadOverlay` wired up; you may relax `timeoutMs` / `retryIntervalMs` now that warm opens are fast, but don't remove it.
262
+
260
263
  ![Sidebar failed to load overlay](./.docs/sidebar_failed_to_load_overlay.png)
261
264
 
262
265
  ```typescript
@@ -484,7 +487,7 @@ For agentic streaming callbacks, issue objects match the exported **`AgenticIssu
484
487
 
485
488
  Implement these **on the host** as async functions. The sidebar calls them over IPC and waits on the returned promises (pull style):
486
489
 
487
- - `getInitConfig(): Promise<SidebarConfig>` — Integration display name (`integrationName`), stable machine id (`integrationId`), version, feature flags, dialog closing script, etc. See the `integrationName` vs `integrationId` note above.
490
+ - `getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>` — Integration display name (`integrationName`), stable machine id (`integrationId`), version, feature flags, etc. See the `integrationName` vs `integrationId` note above. Called once per sidebar load; `sidebarBuildInfo` is the sidebar build that is executing (see [Sidebar build reporting](#sidebar-build-reporting)) — declaring the parameter is optional. On the wire the reply is an `InitConfigResponse` (your `SidebarConfig` plus a `hostAdapterVersion` the adapter stamps itself, see [Host adapter version, sidebar side](#host-adapter-version-sidebar-side)).
488
491
  - `getContent(): Promise<ContentInfo>` — Full document (or main buffer) text; must include `documentReference`; `mimeType` optional
489
492
  - `getSelectedContent(): Promise<ContentInfo>` — Current selection; same `ContentInfo` rules as `getContent`
490
493
  - `selectContent(range: ContentRange, documentReference?: string | null): Promise<void>` — Focus/highlight the document span `[range.start, range.end)`. `documentReference` names the target document for multi-document hosts; omitted/`null` means "whichever document is currently active" (the single-document default — see [Multi-document hosts](#multi-document-hosts))
@@ -902,6 +905,66 @@ Updates are applied per-field with no coordination between user edits and host p
902
905
  - This means a reactive host that calls `applyIntegrationSettings` from inside `onIntegrationSettingsChange` (e.g. "if annotations are off, lock viewMode to original") can briefly visually revert a user click if the IPC round-trip lands after the user's own state change has rendered. This is a feature, not a bug — the host's business rule is meant to override — but make sure to apply your rules narrowly so unrelated user edits aren't silently undone.
903
906
  - Use `getIntegrationSettings()` rather than caching last-known values when you need to be sure you're reconciling against the sidebar's actual current state.
904
907
 
908
+ ## Sidebar build reporting
909
+
910
+ The sidebar caches its app shell in a service worker, so the build running in your iframe can be **behind** the build the sidebar server currently publishes — a warm load serves the cached bundle while a newer one waits to activate. To make logs and bug reports attributable to an exact build, the sidebar sends a `SidebarBuildInfo` with every `getInitConfig` request:
911
+
912
+ ```ts
913
+ interface SidebarBuildInfo {
914
+ version: string; // package version of the executing bundle, e.g. "2.0.2"
915
+ commitHash: string; // short commit hash of the executing bundle, e.g. "abc1234"
916
+ swControlled?: boolean; // true when served through the service-worker cache
917
+ pwaUpdateMode?: "auto" | "prompt"; // how the sidebar activates a newer build
918
+ adapterVersion?: string; // @markupai/sidebar-adapter version inside the sidebar
919
+ }
920
+ ```
921
+
922
+ **Log it yourself.** The published adapter strips all of its own console output, so it does not log the build for you. Declare the parameter on your handler, or read the report later from the adapter:
923
+
924
+ ```ts
925
+ import { ADAPTER_VERSION, type PluginInterface } from "@markupai/sidebar-adapter";
926
+
927
+ const pluginInterface: PluginInterface = {
928
+ getInitConfig: async (sidebarBuildInfo) => {
929
+ myLogger.info("Sidebar build", {
930
+ sidebar: sidebarBuildInfo ?? "unknown (sidebar predates build reporting)",
931
+ hostAdapterVersion: ADAPTER_VERSION, // compare with sidebarBuildInfo?.adapterVersion
932
+ });
933
+ telemetry.setTag("sidebar_version", sidebarBuildInfo?.version ?? "unknown");
934
+ return { integrationName: "My Editor", integrationVersion: "1.0.0" };
935
+ },
936
+ // …
937
+ };
938
+
939
+ // Any time after the sidebar has initialized — e.g. when the user files a bug report:
940
+ const build = sidebarAdapter.getSidebarBuildInfo(); // SidebarBuildInfo | null
941
+ ```
942
+
943
+ - The report is sanitized before you see it: unknown fields are dropped, strings are capped at 64 characters, and a report without a usable `version` and `commitHash` is treated as absent (`undefined` in the handler, `null` from the getter).
944
+ - It is replaced on every sidebar reload. When `auto` update mode activates a newer build, expect two `getInitConfig` requests in quick succession: the cached build, then the new one.
945
+ - `swControlled: true` alone does not mean "stale" — compare `version`/`commitHash` with the server's `/sidebar-info.json` if you need that verdict.
946
+ - Fully backward compatible: handlers declared without the parameter keep compiling, older adapters ignore the argument, and older sidebars simply don't send it.
947
+
948
+ ### Host adapter version, sidebar side
949
+
950
+ The report also flows the other way. The host-side adapter stamps its own compiled version onto every `getInitConfig` reply, so the sidebar can tell which `@markupai/sidebar-adapter` your integration bundles and attribute analytics (adapter adoption, sidebar-vs-host version skew) to it. **You do nothing**: your `getInitConfig` handler keeps returning a plain `SidebarConfig`, and the adapter adds the stamp on the wire — always with its own version, overwriting any `hostAdapterVersion` an integration might return.
951
+
952
+ ```ts
953
+ // Wire shape of the reply (you never construct this yourself)
954
+ interface InitConfigResponse extends SidebarConfig {
955
+ hostAdapterVersion?: string; // @markupai/sidebar-adapter version inside the host, e.g. "2.2.0"
956
+ }
957
+ ```
958
+
959
+ On the sidebar side, `PluginAdapter` sanitizes the stamp (non-empty string, capped at 64 characters), strips it from the config it resolves, and exposes it separately:
960
+
961
+ ```ts
962
+ const config = await pluginAdapter.getInitConfig(buildInfo); // plain SidebarConfig
963
+ const hostAdapter = pluginAdapter.getHostAdapterVersion(); // string | null
964
+ ```
965
+
966
+ `null` means no valid stamp arrived — the host adapter predates 2.2.0. Non-JS host ports set `hostAdapterVersion` on their own reply; the field is described in `asyncapi.json` as the `getInitConfig` response payload.
967
+
905
968
  ## Development
906
969
 
907
970
  The commands below are for **contributors** working on this npm package’s source. If you only consume **`@markupai/sidebar-adapter`** from your app, you do not need to run them.
package/asyncapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "asyncapi": "3.0.0",
3
3
  "info": {
4
4
  "title": "Markup AI Sidebar IPC contract",
5
- "version": "2.0.0",
5
+ "version": "2.2.0",
6
6
  "description": "Bidirectional RPC-over-postMessage contract between the Markup AI sidebar and its host. Generated from the @markupai/sidebar-adapter TypeScript types — do not hand-edit."
7
7
  },
8
8
  "channels": {
@@ -197,7 +197,7 @@
197
197
  "action": "send",
198
198
  "channel": { "$ref": "#/channels/sidebarToPlugin" },
199
199
  "title": "getInitConfig",
200
- "description": "Get initialization configuration from the editor.",
200
+ "description": "Get initialization configuration from the editor. sidebarBuildInfo reports the sidebar build that is executing (absent from sidebars that predate build reporting). The reply is the integration's SidebarConfig plus hostAdapterVersion, stamped by the host adapter itself (absent from host adapters that predate version stamping).",
201
201
  "x-optional": false,
202
202
  "messages": [{ "$ref": "#/channels/sidebarToPlugin/messages/getInitConfig_call" }],
203
203
  "reply": {
@@ -672,9 +672,9 @@
672
672
  "name": { "const": "getInitConfig" },
673
673
  "data": {
674
674
  "type": "array",
675
- "prefixItems": [],
675
+ "prefixItems": [{ "$ref": "#/components/schemas/SidebarBuildInfo" }],
676
676
  "minItems": 0,
677
- "maxItems": 0,
677
+ "maxItems": 1,
678
678
  "items": false
679
679
  }
680
680
  }
@@ -692,7 +692,7 @@
692
692
  "type": { "const": "response" },
693
693
  "id": { "type": "integer" },
694
694
  "name": { "const": "getInitConfig" },
695
- "data": { "$ref": "#/components/schemas/SidebarConfig" }
695
+ "data": { "$ref": "#/components/schemas/InitConfigResponse" }
696
696
  }
697
697
  }
698
698
  },
@@ -1367,6 +1367,36 @@
1367
1367
  "description": "Severity of a plugin status notification surfaced by the sidebar.\n\nMaps one-to-one onto the sidebar's message-box variants:\n- `\"error\"` — error icon, destructive color\n- `\"warning\"` — warning triangle icon\n- `\"info\"` — info icon; the default applied when the type is omitted",
1368
1368
  "title": "PluginStatusType"
1369
1369
  },
1370
+ "SidebarBuildInfo": {
1371
+ "type": "object",
1372
+ "properties": {
1373
+ "version": {
1374
+ "type": "string",
1375
+ "description": "Package version compiled into the executing sidebar bundle, e.g. `\"2.0.2\"`."
1376
+ },
1377
+ "commitHash": {
1378
+ "type": "string",
1379
+ "description": "Short git commit hash compiled into the executing sidebar bundle, e.g. `\"abc1234\"`."
1380
+ },
1381
+ "swControlled": {
1382
+ "type": "boolean",
1383
+ "description": "`true` when the sidebar document is controlled by an active service worker (the bundle came through the service-worker cache), `false` when it was loaded from the network or service workers are unavailable."
1384
+ },
1385
+ "pwaUpdateMode": {
1386
+ "type": "string",
1387
+ "enum": ["auto", "prompt"],
1388
+ "description": "Update model the executing bundle was built with."
1389
+ },
1390
+ "adapterVersion": {
1391
+ "type": "string",
1392
+ "description": "Version of `@markupai/sidebar-adapter` compiled into the sidebar."
1393
+ }
1394
+ },
1395
+ "required": ["version", "commitHash"],
1396
+ "additionalProperties": false,
1397
+ "description": "Identity of the sidebar build that is **executing** in the iframe, sent by the sidebar as the argument of `PluginInterface.getInitConfig`.\n\nThis is the bundle actually running, which can be behind the build the sidebar server currently publishes (`/sidebar-info.json`): a warm load can be served from the service-worker cache while a newer build waits to activate. Compare `version`/`commitHash` against the server's build to tell the two apart. Carries build identity only — never user content or credentials.",
1398
+ "title": "SidebarBuildInfo"
1399
+ },
1370
1400
  "SidebarConfig": {
1371
1401
  "type": "object",
1372
1402
  "properties": {
@@ -1486,6 +1516,67 @@
1486
1516
  "description": "A single option in an {@link IntegrationSettingEnumField } dropdown. `value` is the stable persisted key; `label` is the user-visible display text.",
1487
1517
  "title": "IntegrationSettingEnumOption"
1488
1518
  },
1519
+ "InitConfigResponse": {
1520
+ "type": "object",
1521
+ "properties": {
1522
+ "integrationName": {
1523
+ "type": "string",
1524
+ "description": "Human-readable name of the underlying integration. **Display only** — shown verbatim to the user (e.g. on the sidebar's About page). Never derive a machine identifier from this string; use {@link SidebarConfig.integrationId } for that. Example: `\"Madcap Flare Desktop\"`."
1525
+ },
1526
+ "integrationVersion": {
1527
+ "type": "string",
1528
+ "description": "Version string of the host integration (the plugin/add-in build, not the sidebar or this adapter). Display only — e.g. shown on the sidebar's About page next to {@link SidebarConfig.integrationName } . Free-form; hosts typically pass their own package/build version such as `\"1.4.2\"`."
1529
+ },
1530
+ "hostAppVersion": {
1531
+ "type": "string",
1532
+ "description": "Version string of the host application/editor itself — the surrounding app the plugin/add-in runs inside (e.g. the Figma desktop app build, or the Madcap Flare version), not the plugin's own version ( {@link SidebarConfig.integrationVersion } ) or the sidebar's/adapter's. Display only — appended to the integration name/version line on the sidebar's About page when present. Omit when the host cannot report its own version; the About page leaves it out rather than showing a placeholder."
1533
+ },
1534
+ "integrationId": {
1535
+ "type": "string",
1536
+ "description": "Stable, machine-readable identifier for the integration. Used for everything non-display: the Auth0 mediation login provider, PostHog analytics keys, the `x-integration-id` API header, and per-integration settings storage. Should be a stable slug (lowercase, hyphenated, no spaces) that does not change between releases. Example: `\"madcap-flare-desktop\"`.\n\nOptional for backward compatibility: when omitted the sidebar falls back to `DEFAULT_SIDEBAR_CONFIG.integrationId` (`\"markupai-sidebar-app\"`). Hosts that use mediation login or want per-integration analytics/storage should set it."
1537
+ },
1538
+ "hideBanner": {
1539
+ "type": "boolean",
1540
+ "description": "Hide the promotional/upsell banner the sidebar shows by default. Set `true` for embedded hosts where the banner is inappropriate (e.g. Figma, Office task pane). Defaults to `false` when omitted."
1541
+ },
1542
+ "pluginOrigin": {
1543
+ "type": "string",
1544
+ "description": "Origin of the plugin/editor window where messages should be sent This is the origin where the plugin is listening for messages from the sidebar"
1545
+ },
1546
+ "supportCheckSelection": {
1547
+ "type": "boolean",
1548
+ "description": "Whether to support selection-based check and rewrite functionality If true or undefined (default), the selection toggle UI will be shown and users can toggle between full content and selection modes If false, the selection toggle UI will be hidden and checkSelectionEnabled will be forced to false"
1549
+ },
1550
+ "multiAgent": {
1551
+ "type": "boolean",
1552
+ "description": "Whether the sidebar may run several agents concurrently in one check.\n\nWhen `false` or omitted (the default), only the Style agent is offered and run, and a check is dispatched as a single-agent run. When `true`, the sidebar offers every agent the organization is entitled to and fans the selected ones out through the parallel executor, streaming results per agent; each agent can then be cancelled independently of the others.\n\nThe host flag and the organization's entitlement **intersect**: enabling this never grants access to an agent the organization does not have, and an entitled agent is never offered while this is `false`."
1553
+ },
1554
+ "multiDocument": {
1555
+ "type": "boolean",
1556
+ "description": "Whether the sidebar retains check results and issue decisions separately per document, for hosts that let a user switch between several open documents (e.g. a tabbed editor).\n\nWhen `false` or omitted (the default), the sidebar holds a single shared check state regardless of any `onActiveDocumentChanged` calls the host makes. When `true`, switching the active document preserves the outgoing document's results and restores the incoming document's previously retained results, if any."
1557
+ },
1558
+ "initialActiveDocumentReference": {
1559
+ "type": ["string", "null"],
1560
+ "description": "The document the host considers active at the moment it responds to `getInitConfig()` — `null` if none is checkable right now, or omitted if the host doesn't know or doesn't support reporting it yet.\n\nThis is a **one-time snapshot resolved at init**, not a live-updating field — `SidebarConfig` is fetched once per session, so later changes to the active document must still go through `notifyActiveDocumentChanged`. Only meaningful when `multiDocument` is `true`; ignored otherwise.\n\nSupplying this lets the sidebar show its \"nothing to check\" state immediately on load instead of only after a subsequent `notifyActiveDocumentChanged` call. Omit it if the host cannot answer the question at init time — the sidebar falls back to waiting for that later call (or its own passive detection from the first `getContent()` response) exactly as it does today."
1561
+ },
1562
+ "auth": {
1563
+ "$ref": "#/components/schemas/AuthConfig",
1564
+ "description": "How the sidebar should run the Auth0 login flow. When omitted, the sidebar falls back to heuristic strategy selection (iframe context, secure origin, etc.) for backwards compatibility. New integrations should set this explicitly; `\"mediation\"` is the correct choice for hosts that embed the sidebar in an iframe (Figma, Office task pane).\n\nIn dev builds, the sidebar also honors a `localStorage` override at the key exported as `AUTH_CONFIG_OVERRIDE_STORAGE_KEY` — see `getAuthConfigWithOverride` in `sidebar-host`."
1565
+ },
1566
+ "integrationSettings": {
1567
+ "$ref": "#/components/schemas/IntegrationSettingsSchema",
1568
+ "description": "Optional declarative schema of host-supplied settings rendered in the sidebar's Settings surface. When omitted, no integration-settings section is rendered and no related IPC traffic is emitted.\n\nSee `@markupai/sidebar-adapter` README → \"Integration settings\" for the shape and lifecycle."
1569
+ },
1570
+ "hostAdapterVersion": {
1571
+ "type": "string",
1572
+ "description": "Version of `@markupai/sidebar-adapter` compiled into the host, e.g. `\"2.2.0\"`."
1573
+ }
1574
+ },
1575
+ "additionalProperties": false,
1576
+ "required": ["integrationName", "integrationVersion"],
1577
+ "description": "The `getInitConfig` reply as it crosses the IPC boundary: the integration's {@link SidebarConfig } plus the host adapter's own version stamp.\n\n`hostAdapterVersion` is written by the host-side adapter itself from its compiled-in {@link ADAPTER_VERSION } ; it always overwrites whatever the integration returned. Integrations never set it — their {@link PluginInterface.getInitConfig } keeps returning a plain `SidebarConfig`. The sidebar-side adapter strips it again before handing the config to the sidebar app and exposes it through `PluginAdapter.getHostAdapterVersion()`. Non-JS host ports set it themselves from their own version.",
1578
+ "title": "InitConfigResponse"
1579
+ },
1489
1580
  "AgenticIssuePosition": {
1490
1581
  "type": "object",
1491
1582
  "properties": {
@@ -1596,8 +1687,18 @@
1596
1687
  "description": "Replace multiple contents in the editor"
1597
1688
  },
1598
1689
  "getInitConfig": {
1599
- "$comment": "() => Promise<SidebarConfig>",
1600
- "description": "Get initialization configuration from the editor Called by the sidebar when it's ready to initialize"
1690
+ "$comment": "(sidebarBuildInfo?: SidebarBuildInfo) => Promise<SidebarConfig>",
1691
+ "type": "object",
1692
+ "properties": {
1693
+ "namedArgs": {
1694
+ "type": "object",
1695
+ "properties": {
1696
+ "sidebarBuildInfo": { "$ref": "#/components/schemas/SidebarBuildInfo" }
1697
+ },
1698
+ "additionalProperties": false
1699
+ }
1700
+ },
1701
+ "description": "Get initialization configuration from the editor Called by the sidebar when it's ready to initialize — once per sidebar document load, so again after every sidebar reload.\n\nDeclare the parameter to log or forward the sidebar build with your own logging — the published adapter strips its own console output, so it does not log it for you. The adapter also keeps it for `SidebarAdapter.getSidebarBuildInfo()`. A handler declared with no parameters keeps compiling."
1601
1702
  },
1602
1703
  "onAgenticAgentResults": {
1603
1704
  "$comment": "(\n agentName: string,\n issues: AgenticIssuePayload[],\n documentReference: string | null) => Promise<void>",
@@ -1,3 +1,3 @@
1
- export { PluginAdapter } from "../adapters/pluginAdapter";
2
- export { SidebarAdapter, type SidebarAdapterOptions } from "../adapters/sidebarAdapter";
1
+ export { PluginAdapter } from "./pluginAdapter";
2
+ export { SidebarAdapter, type SidebarAdapterOptions } from "./sidebarAdapter";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { CallOptions, IPCConfig } from "../ipc/message-types";
2
- import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarInterface, AgenticIssuePayload, IntegrationSettingsValues, IntegrationSettingsChangeMeta } from "../types";
2
+ import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarBuildInfo, SidebarInterface, AgenticIssuePayload, IntegrationSettingsValues, IntegrationSettingsChangeMeta } from "../types";
3
3
  /**
4
4
  * PluginAdapter - Use in the Sidebar to communicate with the Plugin in the editor
5
5
  * This is a wrapper around PluginIPCAdapter for backwards compatibility and ease of use
@@ -17,8 +17,20 @@ export declare class PluginAdapter {
17
17
  destroy(): void;
18
18
  /**
19
19
  * Request initialization configuration from the editor
20
+ * @param sidebarBuildInfo - The executing sidebar build to report to the
21
+ * host (see {@link SidebarBuildInfo}); `adapterVersion` is filled in
22
+ * automatically. Omit to send no report.
20
23
  */
21
- getInitConfig(): Promise<SidebarConfig>;
24
+ getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
25
+ /**
26
+ * The `@markupai/sidebar-adapter` version the host stamped onto its most
27
+ * recent `getInitConfig` reply — the adapter compiled into the host, not a
28
+ * value the integration chose. Compare it with the sidebar's own
29
+ * {@link ADAPTER_VERSION} to spot contract skew. `null` before the first
30
+ * reply, and when the host adapter predates version stamping (below 2.2.0).
31
+ * Replaced on every reply, so it tracks host reloads.
32
+ */
33
+ getHostAdapterVersion(): string | null;
22
34
  /**
23
35
  * Request content from the editor in whatever format the integration supports
24
36
  * @param options - Optional per-call overrides (e.g. timeout in ms; overrides default IPC timeout)
@@ -1 +1 @@
1
- {"version":3,"file":"pluginAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/pluginAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAEjB;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ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,IAAI,CAAC;IAIhB;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIlD;;OAEG;IACI,eAAe,IAAI,MAAM;CAGjC"}
@@ -1,5 +1,5 @@
1
1
  import type { IPCConfig } from "../ipc/message-types";
2
- import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot, PluginInterface, PluginStatusType } from "../types";
2
+ import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot, PluginInterface, PluginStatusType, SidebarBuildInfo } from "../types";
3
3
  /**
4
4
  * Options for SidebarAdapter constructor
5
5
  */
@@ -86,6 +86,15 @@ export declare class SidebarAdapter {
86
86
  * currently active. No-op if the sidebar has not registered a handler.
87
87
  */
88
88
  notifyActiveDocumentChanged(documentReference: string | null): Promise<void>;
89
+ /**
90
+ * The sidebar build that is executing in the iframe, as reported with its
91
+ * most recent `getInitConfig` request — which can be behind the build the
92
+ * sidebar server publishes when a warm load came from the service-worker
93
+ * cache. Use it to attach the precise sidebar version to your own logs or
94
+ * telemetry. `null` before the sidebar's first request, and when the
95
+ * sidebar predates build reporting. Updated on every sidebar reload.
96
+ */
97
+ getSidebarBuildInfo(): SidebarBuildInfo | null;
89
98
  /**
90
99
  * Update IPC configuration
91
100
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/sidebarAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB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AAO,CAAC,IAAI,CAAC;IAIzF;;;;;;;OAOG;IACI,mBAAmB,IAAI,gBAAgB,GAAG,IAAI;IAIrD;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAG1C"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./types";
2
+ export * from "./version";
2
3
  export * from "./errors";
3
4
  export * from "./document-reference";
4
5
  export * from "./adapters";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AAGzB,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAG3B,cAAc,OAAO,CAAC;AAGtB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAG3B,cAAc,OAAO,CAAC;AAGtB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, AgenticIssuePayload, PluginStatusType } from "../types/common";
1
+ import type { ContentRange, ContentReplacement, ContentInfo, InitConfigResponse, SidebarBuildInfo, AgenticIssuePayload, PluginStatusType } from "../types/common";
2
2
  import type { IntegrationSettingsValues, IntegrationSettingsChangeMeta, IntegrationSettingsPatch, IntegrationSettingsSnapshot } from "../types/integrationSettings";
3
3
  /**
4
4
  * Call signatures for all bidirectional IPC communication.
@@ -35,9 +35,14 @@ export interface CallSignatures {
35
35
  replaceMultipleContents(replacements: ContentReplacement[]): Promise<void>;
36
36
  /**
37
37
  * Get initialization configuration from the editor
38
- * This is called by the sidebar when it's ready to initialize
39
- */
40
- getInitConfig(): Promise<SidebarConfig>;
38
+ * This is called by the sidebar when it's ready to initialize.
39
+ * `sidebarBuildInfo` reports the sidebar build that is executing — see
40
+ * {@link PluginInterface.getInitConfig}. Optional so an older sidebar that
41
+ * sends no argument, and a host receiver declared with none, keep working.
42
+ * The reply is the integration's `SidebarConfig` plus the host adapter's own
43
+ * `hostAdapterVersion` stamp — see {@link InitConfigResponse}.
44
+ */
45
+ getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<InitConfigResponse>;
41
46
  /**
42
47
  * Notify plugin when one agent's agentic results are available (streaming).
43
48
  * `documentReference` is the run's originating document (`null` when
@@ -1 +1 @@
1
- {"version":3,"file":"call-signatures.d.ts","sourceRoot":"","sources":["../../src/ipc/call-signatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAK7B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,YAAY,EACnB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErF;;OAEG;IACH,uBA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MG;IACH,oBAAoB,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;;;;;OAOG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExF;;OAEG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD;;;;;OAKG;IACH,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzE;;;OAGG;IACH,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E"}
@@ -1,9 +1,9 @@
1
- export { DeferredPromise } from "../ipc/deferred-promise";
2
- export { IPCCore } from "../ipc/ipc-core";
3
- export type { ReceiverFn } from "../ipc/ipc-core";
4
- export { PluginIPCAdapter } from "../ipc/plugin-ipc-adapter";
5
- export { SidebarIPCAdapter } from "../ipc/sidebar-ipc-adapter";
6
- export type { MessageBase, CallMessage, ResponseMessage, ErrorMessage, IPCMessage, IPCConfig, CallOptions, } from "../ipc/message-types";
7
- export { DEFAULT_IPC_CONFIG } from "../ipc/message-types";
8
- export type { CallSignatures } from "../ipc/call-signatures";
1
+ export { DeferredPromise } from "./deferred-promise";
2
+ export { IPCCore } from "./ipc-core";
3
+ export type { ReceiverFn } from "./ipc-core";
4
+ export { PluginIPCAdapter } from "./plugin-ipc-adapter";
5
+ export { SidebarIPCAdapter } from "./sidebar-ipc-adapter";
6
+ export type { MessageBase, CallMessage, ResponseMessage, ErrorMessage, IPCMessage, IPCConfig, CallOptions, } from "./message-types";
7
+ export { DEFAULT_IPC_CONFIG } from "./message-types";
8
+ export type { CallSignatures } from "./call-signatures";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { CallSignatures } from "../ipc/call-signatures";
2
- import type { IPCMessage, IPCConfig, CallOptions } from "../ipc/message-types";
1
+ import type { CallSignatures } from "./call-signatures";
2
+ import type { IPCMessage, IPCConfig, CallOptions } from "./message-types";
3
3
  export type ReceiverFn<R extends keyof CallSignatures> = (...data: Parameters<NonNullable<CallSignatures[R]>>) => ReturnType<NonNullable<CallSignatures[R]>>;
4
4
  /**
5
5
  * Core IPC system managing bidirectional communication
@@ -1 +1 @@
1
- {"version":3,"file":"ipc-core.d.ts","sourceRoot":"","sources":["../../src/ipc/ipc-core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAGV,UAAU,EAEV,SAAS,EACT,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAK7B,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,cAAc,IAAI,CACvD,GAAG,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAChD,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AA6BhD;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,YAAY,CAA+C;IACnE,OAAO,CAAC,eAAe,CAAoE;IAC3F,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgC;gBA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AS,MAAM,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI;IAKhF;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMjC;;;OAGG;IACU,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB9D;;OAEG;YACW,UAAU;IAgDxB;;OAEG;IACH,OAAO,CAAC,cAAc;IActB;;OAEG;IACH,OAAO,CAAC,WAAW;IAuBnB;;OAEG;IACI,OAAO,IAAI,IAAI;CAWvB"}
@@ -1,5 +1,5 @@
1
- import type { CallOptions, IPCConfig } from "../ipc/message-types";
2
- import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, AgenticIssuePayload } from "../types/common";
1
+ import type { CallOptions, IPCConfig } from "./message-types";
2
+ import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarBuildInfo, AgenticIssuePayload } from "../types/common";
3
3
  import type { IntegrationSettingsValues, IntegrationSettingsChangeMeta } from "../types/integrationSettings";
4
4
  import type { SidebarInterface } from "../types/sidebarInterface";
5
5
  /**
@@ -13,13 +13,24 @@ export declare class PluginIPCAdapter {
13
13
  private readonly ipc;
14
14
  private readonly sidebar;
15
15
  private targetOrigin;
16
+ private latestHostAdapterVersion;
16
17
  constructor(sidebar?: SidebarInterface, config?: IPCConfig, targetOrigin?: string);
17
18
  private readonly handleMessage;
18
19
  private registerReceivers;
19
20
  /**
20
21
  * Request initialization configuration from the editor
22
+ * @param sidebarBuildInfo - The executing sidebar build to report to the
23
+ * host. `adapterVersion` is filled in with {@link ADAPTER_VERSION} when
24
+ * the caller leaves it out. Omit to send no report.
21
25
  */
22
- getInitConfig(): Promise<SidebarConfig>;
26
+ getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
27
+ /**
28
+ * The `@markupai/sidebar-adapter` version the host stamped onto its most
29
+ * recent `getInitConfig` reply, sanitized. `null` before the first reply,
30
+ * and when the host adapter predates version stamping. Replaced on every
31
+ * reply.
32
+ */
33
+ getHostAdapterVersion(): string | null;
23
34
  /**
24
35
  * Request content from the editor in whatever format the integration supports
25
36
  * @param options - Optional per-call overrides (e.g. timeout in ms; overrides default IPC timeout)
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-ipc-adapter.d.ts","sourceRoot":"","sources":["../../src/ipc/plugin-ipc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,mBAAmB,EAEpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAS;gBAEjB,OAAO,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,GAAE,MAAY;IAkBtF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAqB5B;IAEF,OAAO,CAAC,iBAAiB;IAgFzB;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAKpD;;;OAGG;IACU,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAKpE;;;OAGG;IACU,kBAAkB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAK5E;;OAEG;IACU,cAAc,CACzB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,YAAY,E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hC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
@@ -0,0 +1,32 @@
1
+ import type { SidebarBuildInfo } from "../types/common";
2
+ /** Longest string kept from a sidebar build report; longer values are truncated. */
3
+ export declare const SIDEBAR_BUILD_INFO_MAX_STRING_LENGTH = 64;
4
+ /**
5
+ * Validate the build report a sidebar sent with `getInitConfig`. It crosses a
6
+ * frame boundary, so it is treated as untrusted: only a plain object is
7
+ * accepted, fields of the wrong type are dropped, strings are truncated to
8
+ * {@link SIDEBAR_BUILD_INFO_MAX_STRING_LENGTH} characters, and unknown fields
9
+ * are discarded.
10
+ *
11
+ * @returns The sanitized report, or `null` when there is no report or it lacks
12
+ * a usable `version` or `commitHash`.
13
+ */
14
+ export declare function sanitizeSidebarBuildInfo(raw: unknown): SidebarBuildInfo | null;
15
+ /**
16
+ * Validate the `hostAdapterVersion` a host stamped onto its `getInitConfig`
17
+ * reply. It crosses a frame boundary, so it is treated as untrusted: only a
18
+ * non-empty string is accepted, truncated to
19
+ * {@link SIDEBAR_BUILD_INFO_MAX_STRING_LENGTH} characters.
20
+ *
21
+ * @returns The sanitized version, or `null` when absent or invalid (a host
22
+ * adapter that predates version stamping sends none).
23
+ */
24
+ export declare function sanitizeHostAdapterVersion(raw: unknown): string | null;
25
+ /**
26
+ * The adapter's development/test log line for one `getInitConfig` request
27
+ * (stripped from the published build), e.g.
28
+ * `getInitConfig from sidebar v2.0.2 (abc1234, sw-controlled, auto update mode,
29
+ * sidebar adapter 2.1.0, host adapter 2.1.0)`.
30
+ */
31
+ export declare function describeSidebarBuildInfo(info: SidebarBuildInfo | null, hostAdapterVersion: string): string;
32
+ //# sourceMappingURL=sidebar-build-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-build-info.d.ts","sourceRoot":"","sources":["../../src/ipc/sidebar-build-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,oFAAoF;AACpF,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAUvD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAgB9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGtE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,kBAAkB,EAAE,MAAM,GACzB,MAAM,CAYR"}
@@ -1,5 +1,5 @@
1
- import type { IPCConfig } from "../ipc/message-types";
2
- import type { PluginStatusType } from "../types/common";
1
+ import type { IPCConfig } from "./message-types";
2
+ import type { PluginStatusType, SidebarBuildInfo } from "../types/common";
3
3
  import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot } from "../types/integrationSettings";
4
4
  import type { PluginInterface } from "../types/pluginInterface";
5
5
  /**
@@ -12,6 +12,7 @@ export declare class SidebarIPCAdapter {
12
12
  private readonly iframe;
13
13
  private readonly window;
14
14
  private readonly targetOrigin;
15
+ private latestSidebarBuildInfo;
15
16
  constructor(plugin: PluginInterface, iframe: HTMLIFrameElement, win?: Window, config?: IPCConfig, targetOrigin?: string);
16
17
  private readonly handleMessage;
17
18
  private registerReceivers;
@@ -55,6 +56,13 @@ export declare class SidebarIPCAdapter {
55
56
  * currently active. No-op if the sidebar has not registered a handler.
56
57
  */
57
58
  notifyActiveDocumentChanged(documentReference: string | null): Promise<void>;
59
+ /**
60
+ * The sidebar build reported with the most recent `getInitConfig` request,
61
+ * sanitized. `null` before the sidebar's first request, and when the latest
62
+ * request carried no valid report (a sidebar that predates build
63
+ * reporting). Replaced on every request, so it tracks sidebar reloads.
64
+ */
65
+ getSidebarBuildInfo(): SidebarBuildInfo | null;
58
66
  /**
59
67
  * Update IPC configuration
60
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-ipc-adapter.d.ts","s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CAAC,iBAAiB;IA6KzB;;;;;;;OAOG;IACU,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,GAAG,IAAW,GACtC,OAAO,CAAC,IAAI,CAAC;IAKhB;;OAEG;IACU,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnE;;OAEG;IACU,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrE;;OAEG;IACU,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhE;;;OAGG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvF;;OAEG;IACU,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrF;;OAEG;IACU,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAK3E;;;;OAIG;IACU,2BAA2B,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzF;;;;;OAKG;IACI,mBAAmB,IAAI,gBAAgB,GAAG,IAAI;IAIrD;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
@@ -10,5 +10,16 @@ export type SidebarLoadOverlayOptions = {
10
10
  */
11
11
  messageListenWindow?: Window;
12
12
  };
13
+ /**
14
+ * Mounts the sidebar "failed to load / retry" overlay: shows it if no
15
+ * `message` arrives from the iframe within `timeoutMs`, auto-retries every
16
+ * `retryIntervalMs`, and exposes a manual retry button.
17
+ *
18
+ * The sidebar precaches its app shell in a service worker, so warm opens
19
+ * (any host that has loaded it once) rarely trip the timeout. Keep this wired
20
+ * up anyway — it is the recovery path for the first cold open in a host, a
21
+ * host where the service worker cannot register, and a real origin outage.
22
+ * See the adapter README, "SidebarLoadOverlay (Editor UI)".
23
+ */
13
24
  export declare const setupSidebarLoadOverlay: (container: HTMLElement, iframe: HTMLIFrameElement, options?: SidebarLoadOverlayOptions) => () => void;
14
25
  //# sourceMappingURL=sidebarLoadOverlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarLoadOverlay.d.ts","sourceRoot":"","sources":["../../src/load-overlay/sidebarLoadOverlay.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,uBAAuB,GAClC,WAAW,WAAW,EACtB,QAAQ,iBAAiB,EACzB,UAAS,yBAA8B,eAoHxC,CAAC"}
1
+ {"version":3,"file":"sidebarLoadOverlay.d.ts","sourceRoot":"","sources":["../../src/load-overlay/sidebarLoadOverlay.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,WAAW,WAAW,EACtB,QAAQ,iBAAiB,EACzB,UAAS,yBAA8B,eAoHxC,CAAC"}