@markupai/sidebar-adapter 1.5.3 → 2.1.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 +45 -21
- package/asyncapi.json +47 -152
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/pluginAdapter.d.ts +5 -10
- package/dist/adapters/pluginAdapter.d.ts.map +1 -1
- package/dist/adapters/sidebarAdapter.d.ts +10 -1
- package/dist/adapters/sidebarAdapter.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/ipc/call-signatures.d.ts +6 -11
- package/dist/ipc/call-signatures.d.ts.map +1 -1
- package/dist/ipc/index.d.ts +8 -8
- package/dist/ipc/ipc-core.d.ts +2 -2
- package/dist/ipc/plugin-ipc-adapter.d.ts +6 -11
- package/dist/ipc/plugin-ipc-adapter.d.ts.map +1 -1
- package/dist/ipc/sidebar-build-info.d.ts +22 -0
- package/dist/ipc/sidebar-build-info.d.ts.map +1 -0
- package/dist/ipc/sidebar-ipc-adapter.d.ts +10 -2
- package/dist/ipc/sidebar-ipc-adapter.d.ts.map +1 -1
- package/dist/load-overlay/sidebarLoadOverlay.d.ts +11 -0
- package/dist/load-overlay/sidebarLoadOverlay.d.ts.map +1 -1
- package/dist/main.js +257 -245
- package/dist/main.umd.cjs +6 -6
- package/dist/types/common.d.ts +27 -14
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/pluginInterface.d.ts +15 -26
- package/dist/types/pluginInterface.d.ts.map +1 -1
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +3 -3
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. [
|
|
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
|
|
|
@@ -138,9 +139,6 @@ await adapter.replaceMultipleContents([
|
|
|
138
139
|
{ suggestion: "bar", range: { start: 20, end: 23 } },
|
|
139
140
|
]);
|
|
140
141
|
|
|
141
|
-
// Show a dialog
|
|
142
|
-
adapter.showDialog("<div>Custom dialog content</div>", 400, 300, "My Dialog");
|
|
143
|
-
|
|
144
142
|
// Request initialization
|
|
145
143
|
adapter.requestInit();
|
|
146
144
|
|
|
@@ -195,7 +193,6 @@ const pluginInterface: PluginInterface = {
|
|
|
195
193
|
integrationName: "My Editor",
|
|
196
194
|
integrationVersion: "1.0.0",
|
|
197
195
|
integrationId: "my-editor",
|
|
198
|
-
useCheckPreviewDialog: true,
|
|
199
196
|
supportCheckSelection: true,
|
|
200
197
|
// Optional. Allow the sidebar to run several agents in one check, each
|
|
201
198
|
// cancellable on its own. Defaults to false (Style agent only). The
|
|
@@ -237,18 +234,6 @@ const pluginInterface: PluginInterface = {
|
|
|
237
234
|
console.log("Replace multiple contents:", replacements);
|
|
238
235
|
replaceMultipleContentsInEditor(replacements);
|
|
239
236
|
},
|
|
240
|
-
|
|
241
|
-
// Show a dialog (optional — omit on hosts without dialog support)
|
|
242
|
-
showDialog: async (dialogHtml: string, width?: number, height?: number, title?: string) => {
|
|
243
|
-
console.log("Show dialog:", title);
|
|
244
|
-
showDialogInEditor(dialogHtml, width, height, title);
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
// Close the dialog (optional — omit on hosts without dialog support)
|
|
248
|
-
closeDialog: async () => {
|
|
249
|
-
console.log("Close dialog");
|
|
250
|
-
closeDialogInEditor();
|
|
251
|
-
},
|
|
252
237
|
};
|
|
253
238
|
|
|
254
239
|
// Create the adapter with an iframe reference
|
|
@@ -273,6 +258,8 @@ Use `setupSidebarLoadOverlay` when you manage the iframe yourself and only want
|
|
|
273
258
|
|
|
274
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.
|
|
275
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
|
+
|
|
276
263
|

|
|
277
264
|
|
|
278
265
|
```typescript
|
|
@@ -500,14 +487,12 @@ For agentic streaming callbacks, issue objects match the exported **`AgenticIssu
|
|
|
500
487
|
|
|
501
488
|
Implement these **on the host** as async functions. The sidebar calls them over IPC and waits on the returned promises (pull style):
|
|
502
489
|
|
|
503
|
-
- `getInitConfig(): Promise<SidebarConfig>` — Integration display name (`integrationName`), stable machine id (`integrationId`), version, feature flags,
|
|
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.
|
|
504
491
|
- `getContent(): Promise<ContentInfo>` — Full document (or main buffer) text; must include `documentReference`; `mimeType` optional
|
|
505
492
|
- `getSelectedContent(): Promise<ContentInfo>` — Current selection; same `ContentInfo` rules as `getContent`
|
|
506
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))
|
|
507
494
|
- `replaceContent(suggestion: string, range: ContentRange, documentReference?: string | null): Promise<void>` — Apply a single edit to `[range.start, range.end)`. Same `documentReference` rule as `selectContent`
|
|
508
495
|
- `replaceMultipleContents(replacements: ContentReplacement[]): Promise<void>` — Batch edits, always against the currently active document (no per-item `documentReference`)
|
|
509
|
-
- `showDialog?(dialogHtml: string, width?: number, height?: number, title?: string): Promise<void>` — Host-rendered dialog chrome around HTML from the sidebar. **Optional** — omit on hosts without dialog support (also leave `useCheckPreviewDialog: false`).
|
|
510
|
-
- `closeDialog?(): Promise<void>` — Dismiss that dialog. **Optional**, pairs with `showDialog`.
|
|
511
496
|
|
|
512
497
|
Optional (agentic / streaming flows):
|
|
513
498
|
|
|
@@ -822,7 +807,6 @@ const config: SidebarConfig = {
|
|
|
822
807
|
integrationName: "My Integration",
|
|
823
808
|
integrationVersion: "1.0.0",
|
|
824
809
|
integrationId: "my-integration",
|
|
825
|
-
useCheckPreviewDialog: false,
|
|
826
810
|
integrationSettings: {
|
|
827
811
|
title: "My integration",
|
|
828
812
|
fields: [
|
|
@@ -921,6 +905,46 @@ Updates are applied per-field with no coordination between user edits and host p
|
|
|
921
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.
|
|
922
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.
|
|
923
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
|
+
|
|
924
948
|
## Development
|
|
925
949
|
|
|
926
950
|
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": "1.
|
|
5
|
+
"version": "2.1.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": {
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
"replaceContent_response": { "$ref": "#/components/messages/replaceContent_response" },
|
|
23
23
|
"selectContent_call": { "$ref": "#/components/messages/selectContent_call" },
|
|
24
24
|
"selectContent_response": { "$ref": "#/components/messages/selectContent_response" },
|
|
25
|
-
"showDialog_call": { "$ref": "#/components/messages/showDialog_call" },
|
|
26
|
-
"showDialog_response": { "$ref": "#/components/messages/showDialog_response" },
|
|
27
|
-
"closeDialog_call": { "$ref": "#/components/messages/closeDialog_call" },
|
|
28
|
-
"closeDialog_response": { "$ref": "#/components/messages/closeDialog_response" },
|
|
29
25
|
"replaceMultipleContents_call": {
|
|
30
26
|
"$ref": "#/components/messages/replaceMultipleContents_call"
|
|
31
27
|
},
|
|
@@ -182,36 +178,6 @@
|
|
|
182
178
|
]
|
|
183
179
|
}
|
|
184
180
|
},
|
|
185
|
-
"showDialog": {
|
|
186
|
-
"action": "send",
|
|
187
|
-
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
188
|
-
"title": "showDialog",
|
|
189
|
-
"description": "Show a dialog in the editor.",
|
|
190
|
-
"x-optional": false,
|
|
191
|
-
"messages": [{ "$ref": "#/channels/sidebarToPlugin/messages/showDialog_call" }],
|
|
192
|
-
"reply": {
|
|
193
|
-
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
194
|
-
"messages": [
|
|
195
|
-
{ "$ref": "#/channels/sidebarToPlugin/messages/showDialog_response" },
|
|
196
|
-
{ "$ref": "#/channels/sidebarToPlugin/messages/ipc_error" }
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
"closeDialog": {
|
|
201
|
-
"action": "send",
|
|
202
|
-
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
203
|
-
"title": "closeDialog",
|
|
204
|
-
"description": "Close the editor dialog.",
|
|
205
|
-
"x-optional": false,
|
|
206
|
-
"messages": [{ "$ref": "#/channels/sidebarToPlugin/messages/closeDialog_call" }],
|
|
207
|
-
"reply": {
|
|
208
|
-
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
209
|
-
"messages": [
|
|
210
|
-
{ "$ref": "#/channels/sidebarToPlugin/messages/closeDialog_response" },
|
|
211
|
-
{ "$ref": "#/channels/sidebarToPlugin/messages/ipc_error" }
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
181
|
"replaceMultipleContents": {
|
|
216
182
|
"action": "send",
|
|
217
183
|
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
@@ -231,7 +197,7 @@
|
|
|
231
197
|
"action": "send",
|
|
232
198
|
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
233
199
|
"title": "getInitConfig",
|
|
234
|
-
"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).",
|
|
235
201
|
"x-optional": false,
|
|
236
202
|
"messages": [{ "$ref": "#/channels/sidebarToPlugin/messages/getInitConfig_call" }],
|
|
237
203
|
"reply": {
|
|
@@ -652,87 +618,6 @@
|
|
|
652
618
|
}
|
|
653
619
|
}
|
|
654
620
|
},
|
|
655
|
-
"showDialog_call": {
|
|
656
|
-
"name": "showDialog_call",
|
|
657
|
-
"title": "call showDialog",
|
|
658
|
-
"payload": {
|
|
659
|
-
"title": "showDialog_call",
|
|
660
|
-
"type": "object",
|
|
661
|
-
"additionalProperties": false,
|
|
662
|
-
"required": ["type", "id", "name", "data"],
|
|
663
|
-
"properties": {
|
|
664
|
-
"type": { "const": "call" },
|
|
665
|
-
"id": { "type": "integer" },
|
|
666
|
-
"name": { "const": "showDialog" },
|
|
667
|
-
"data": {
|
|
668
|
-
"type": "array",
|
|
669
|
-
"prefixItems": [
|
|
670
|
-
{ "type": "string" },
|
|
671
|
-
{ "type": "number" },
|
|
672
|
-
{ "type": "number" },
|
|
673
|
-
{ "type": "string" }
|
|
674
|
-
],
|
|
675
|
-
"minItems": 1,
|
|
676
|
-
"maxItems": 4,
|
|
677
|
-
"items": false
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
"showDialog_response": {
|
|
683
|
-
"name": "showDialog_response",
|
|
684
|
-
"title": "response showDialog",
|
|
685
|
-
"payload": {
|
|
686
|
-
"title": "showDialog_response",
|
|
687
|
-
"type": "object",
|
|
688
|
-
"additionalProperties": false,
|
|
689
|
-
"required": ["type", "id", "name", "data"],
|
|
690
|
-
"properties": {
|
|
691
|
-
"type": { "const": "response" },
|
|
692
|
-
"id": { "type": "integer" },
|
|
693
|
-
"name": { "const": "showDialog" },
|
|
694
|
-
"data": { "type": "null" }
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
},
|
|
698
|
-
"closeDialog_call": {
|
|
699
|
-
"name": "closeDialog_call",
|
|
700
|
-
"title": "call closeDialog",
|
|
701
|
-
"payload": {
|
|
702
|
-
"title": "closeDialog_call",
|
|
703
|
-
"type": "object",
|
|
704
|
-
"additionalProperties": false,
|
|
705
|
-
"required": ["type", "id", "name", "data"],
|
|
706
|
-
"properties": {
|
|
707
|
-
"type": { "const": "call" },
|
|
708
|
-
"id": { "type": "integer" },
|
|
709
|
-
"name": { "const": "closeDialog" },
|
|
710
|
-
"data": {
|
|
711
|
-
"type": "array",
|
|
712
|
-
"prefixItems": [],
|
|
713
|
-
"minItems": 0,
|
|
714
|
-
"maxItems": 0,
|
|
715
|
-
"items": false
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
},
|
|
720
|
-
"closeDialog_response": {
|
|
721
|
-
"name": "closeDialog_response",
|
|
722
|
-
"title": "response closeDialog",
|
|
723
|
-
"payload": {
|
|
724
|
-
"title": "closeDialog_response",
|
|
725
|
-
"type": "object",
|
|
726
|
-
"additionalProperties": false,
|
|
727
|
-
"required": ["type", "id", "name", "data"],
|
|
728
|
-
"properties": {
|
|
729
|
-
"type": { "const": "response" },
|
|
730
|
-
"id": { "type": "integer" },
|
|
731
|
-
"name": { "const": "closeDialog" },
|
|
732
|
-
"data": { "type": "null" }
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
},
|
|
736
621
|
"replaceMultipleContents_call": {
|
|
737
622
|
"name": "replaceMultipleContents_call",
|
|
738
623
|
"title": "call replaceMultipleContents",
|
|
@@ -787,9 +672,9 @@
|
|
|
787
672
|
"name": { "const": "getInitConfig" },
|
|
788
673
|
"data": {
|
|
789
674
|
"type": "array",
|
|
790
|
-
"prefixItems": [],
|
|
675
|
+
"prefixItems": [{ "$ref": "#/components/schemas/SidebarBuildInfo" }],
|
|
791
676
|
"minItems": 0,
|
|
792
|
-
"maxItems":
|
|
677
|
+
"maxItems": 1,
|
|
793
678
|
"items": false
|
|
794
679
|
}
|
|
795
680
|
}
|
|
@@ -1482,6 +1367,36 @@
|
|
|
1482
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",
|
|
1483
1368
|
"title": "PluginStatusType"
|
|
1484
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
|
+
},
|
|
1485
1400
|
"SidebarConfig": {
|
|
1486
1401
|
"type": "object",
|
|
1487
1402
|
"properties": {
|
|
@@ -1505,18 +1420,10 @@
|
|
|
1505
1420
|
"type": "boolean",
|
|
1506
1421
|
"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."
|
|
1507
1422
|
},
|
|
1508
|
-
"dialogClosingScript": {
|
|
1509
|
-
"type": "string",
|
|
1510
|
-
"description": "JavaScript source the sidebar runs inside a host-rendered dialog to close it (see {@link PluginInterface.showDialog } /`closeDialog`). Lets hosts that render dialog chrome themselves supply the exact close call for their environment (e.g. `google.script.host.close();`). Omit when the host closes dialogs through the normal `closeDialog` IPC."
|
|
1511
|
-
},
|
|
1512
1423
|
"pluginOrigin": {
|
|
1513
1424
|
"type": "string",
|
|
1514
1425
|
"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"
|
|
1515
1426
|
},
|
|
1516
|
-
"useCheckPreviewDialog": {
|
|
1517
|
-
"type": "boolean",
|
|
1518
|
-
"description": "Whether to use the check preview workflow dialog If true, the sidebar will show a check preview dialog where the user can apply issues to the content If false, the sidebar will not show a dialog, but there will be an issue tab on the sidebar from where the user can apply issues"
|
|
1519
|
-
},
|
|
1520
1427
|
"supportCheckSelection": {
|
|
1521
1428
|
"type": "boolean",
|
|
1522
1429
|
"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"
|
|
@@ -1542,7 +1449,7 @@
|
|
|
1542
1449
|
"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."
|
|
1543
1450
|
}
|
|
1544
1451
|
},
|
|
1545
|
-
"required": ["integrationName", "integrationVersion"
|
|
1452
|
+
"required": ["integrationName", "integrationVersion"],
|
|
1546
1453
|
"additionalProperties": false,
|
|
1547
1454
|
"description": "Configuration for the sidebar",
|
|
1548
1455
|
"title": "SidebarConfig"
|
|
@@ -1700,28 +1607,6 @@
|
|
|
1700
1607
|
},
|
|
1701
1608
|
"description": "Select or highlight content in the editor using document character offsets only."
|
|
1702
1609
|
},
|
|
1703
|
-
"showDialog": {
|
|
1704
|
-
"$comment": "(\n dialogHtml: string,\n width?: number,\n height?: number,\n title?: string) => Promise<void>",
|
|
1705
|
-
"type": "object",
|
|
1706
|
-
"properties": {
|
|
1707
|
-
"namedArgs": {
|
|
1708
|
-
"type": "object",
|
|
1709
|
-
"properties": {
|
|
1710
|
-
"dialogHtml": { "type": "string" },
|
|
1711
|
-
"width": { "type": "number" },
|
|
1712
|
-
"height": { "type": "number" },
|
|
1713
|
-
"title": { "type": "string" }
|
|
1714
|
-
},
|
|
1715
|
-
"required": ["dialogHtml"],
|
|
1716
|
-
"additionalProperties": false
|
|
1717
|
-
}
|
|
1718
|
-
},
|
|
1719
|
-
"description": "Show a dialog in the editor.\n\nOptional: not every host embedding the sidebar has dialog support. Hosts without a dialog surface should omit this method (and `closeDialog`). The sidebar gates dialog workflows behind `SidebarConfig.useCheckPreviewDialog`, so a host that omits these should also leave that flag `false`."
|
|
1720
|
-
},
|
|
1721
|
-
"closeDialog": {
|
|
1722
|
-
"$comment": "() => Promise<void>",
|
|
1723
|
-
"description": "Close the dialog in the editor.\n\nOptional: see `showDialog`. Omit on hosts without dialog support."
|
|
1724
|
-
},
|
|
1725
1610
|
"replaceMultipleContents": {
|
|
1726
1611
|
"$comment": "(replacements: ContentReplacement[]) => Promise<void>",
|
|
1727
1612
|
"type": "object",
|
|
@@ -1741,8 +1626,18 @@
|
|
|
1741
1626
|
"description": "Replace multiple contents in the editor"
|
|
1742
1627
|
},
|
|
1743
1628
|
"getInitConfig": {
|
|
1744
|
-
"$comment": "() => Promise<SidebarConfig>",
|
|
1745
|
-
"
|
|
1629
|
+
"$comment": "(sidebarBuildInfo?: SidebarBuildInfo) => Promise<SidebarConfig>",
|
|
1630
|
+
"type": "object",
|
|
1631
|
+
"properties": {
|
|
1632
|
+
"namedArgs": {
|
|
1633
|
+
"type": "object",
|
|
1634
|
+
"properties": {
|
|
1635
|
+
"sidebarBuildInfo": { "$ref": "#/components/schemas/SidebarBuildInfo" }
|
|
1636
|
+
},
|
|
1637
|
+
"additionalProperties": false
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
"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."
|
|
1746
1641
|
},
|
|
1747
1642
|
"onAgenticAgentResults": {
|
|
1748
1643
|
"$comment": "(\n agentName: string,\n issues: AgenticIssuePayload[],\n documentReference: string | null) => Promise<void>",
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { PluginAdapter } from "
|
|
2
|
-
export { SidebarAdapter, type SidebarAdapterOptions } from "
|
|
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,11 @@ 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>;
|
|
22
25
|
/**
|
|
23
26
|
* Request content from the editor in whatever format the integration supports
|
|
24
27
|
* @param options - Optional per-call overrides (e.g. timeout in ms; overrides default IPC timeout)
|
|
@@ -37,14 +40,6 @@ export declare class PluginAdapter {
|
|
|
37
40
|
* Select content in the editor
|
|
38
41
|
*/
|
|
39
42
|
selectContent(range: ContentRange, documentReference?: string | null): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Show a dialog in the editor
|
|
42
|
-
*/
|
|
43
|
-
showDialog(dialogHtml: string, width?: number, height?: number, title?: string): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Close the dialog in the editor
|
|
46
|
-
*/
|
|
47
|
-
closeDialog(): Promise<void>;
|
|
48
43
|
/**
|
|
49
44
|
* Replace multiple contents in the editor
|
|
50
45
|
*/
|
|
@@ -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,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AI,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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GAAG,IAAI,GAAG,OAAO,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
package/dist/index.d.ts.map
CHANGED
|
@@ -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, SidebarConfig, 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.
|
|
@@ -29,23 +29,18 @@ export interface CallSignatures {
|
|
|
29
29
|
* @throws {TextLookupError} When the requested text cannot be found or located
|
|
30
30
|
*/
|
|
31
31
|
selectContent(range: ContentRange, documentReference?: string | null): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Show a dialog in the editor
|
|
34
|
-
*/
|
|
35
|
-
showDialog(dialogHtml: string, width?: number, height?: number, title?: string): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Close the dialog in the editor
|
|
38
|
-
*/
|
|
39
|
-
closeDialog(): Promise<void>;
|
|
40
32
|
/**
|
|
41
33
|
* Replace multiple contents in the editor
|
|
42
34
|
*/
|
|
43
35
|
replaceMultipleContents(replacements: ContentReplacement[]): Promise<void>;
|
|
44
36
|
/**
|
|
45
37
|
* Get initialization configuration from the editor
|
|
46
|
-
* This is called by the sidebar when it's ready to initialize
|
|
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.
|
|
47
42
|
*/
|
|
48
|
-
getInitConfig(): Promise<SidebarConfig>;
|
|
43
|
+
getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
|
|
49
44
|
/**
|
|
50
45
|
* Notify plugin when one agent's agentic results are available (streaming).
|
|
51
46
|
* `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,OAA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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"}
|
package/dist/ipc/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { DeferredPromise } from "
|
|
2
|
-
export { IPCCore } from "
|
|
3
|
-
export type { ReceiverFn } from "
|
|
4
|
-
export { PluginIPCAdapter } from "
|
|
5
|
-
export { SidebarIPCAdapter } from "
|
|
6
|
-
export type { MessageBase, CallMessage, ResponseMessage, ErrorMessage, IPCMessage, IPCConfig, CallOptions, } from "
|
|
7
|
-
export { DEFAULT_IPC_CONFIG } from "
|
|
8
|
-
export type { CallSignatures } from "
|
|
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
|
package/dist/ipc/ipc-core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallSignatures } from "
|
|
2
|
-
import type { IPCMessage, IPCConfig, CallOptions } from "
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import type { CallOptions, IPCConfig } from "
|
|
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
|
/**
|
|
@@ -18,8 +18,11 @@ export declare class PluginIPCAdapter {
|
|
|
18
18
|
private registerReceivers;
|
|
19
19
|
/**
|
|
20
20
|
* Request initialization configuration from the editor
|
|
21
|
+
* @param sidebarBuildInfo - The executing sidebar build to report to the
|
|
22
|
+
* host. `adapterVersion` is filled in with {@link ADAPTER_VERSION} when
|
|
23
|
+
* the caller leaves it out. Omit to send no report.
|
|
21
24
|
*/
|
|
22
|
-
getInitConfig(): Promise<SidebarConfig>;
|
|
25
|
+
getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
|
|
23
26
|
/**
|
|
24
27
|
* Request content from the editor in whatever format the integration supports
|
|
25
28
|
* @param options - Optional per-call overrides (e.g. timeout in ms; overrides default IPC timeout)
|
|
@@ -38,14 +41,6 @@ export declare class PluginIPCAdapter {
|
|
|
38
41
|
* Select content in the editor
|
|
39
42
|
*/
|
|
40
43
|
selectContent(range: ContentRange, documentReference?: string | null): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Show a dialog in the editor
|
|
43
|
-
*/
|
|
44
|
-
showDialog(dialogHtml: string, width?: number, height?: number, title?: string): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Close the dialog in the editor
|
|
47
|
-
*/
|
|
48
|
-
closeDialog(): Promise<void>;
|
|
49
44
|
/**
|
|
50
45
|
* Replace multiple contents in the editor
|
|
51
46
|
*/
|
|
@@ -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;
|
|
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,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,gBAAgB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