@markupai/sidebar-adapter 1.2.1 → 1.3.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
@@ -16,7 +16,8 @@ You do **not** need prior knowledge of how the sidebar is built internally. As a
16
16
  8. [createSidebarHost](#createsidebarhost) (iframe + overlay + adapter in one step)
17
17
  9. [Authentication](#authentication-optional) (declaring an Auth0 login strategy)
18
18
  10. [Sidebar load overlay (standalone)](#sidebarloadoverlay-editor-ui)
19
- 11. [API reference](#api-reference) · [Development](#development)
19
+ 11. [Agentic issue lifecycle](#agentic-issue-lifecycle)
20
+ 12. [API reference](#api-reference) · [Development](#development)
20
21
 
21
22
  ## Features
22
23
 
@@ -43,7 +44,7 @@ Use this if you are **embedding Markup AI’s sidebar** in your product for the
43
44
  5. **Test the basics** — After load, the sidebar will request **`getInitConfig`** and **`getContent`**. Confirm your app returns sensible values before testing edits and dialogs.
44
45
  6. **Tear down on exit** — Call **`destroy()`** on the host returned by `createSidebarHost`, or on your `SidebarAdapter`, when the user leaves the screen or you remove the iframe.
45
46
 
46
- If you use the **agentic** layout, implement the optional hooks **`onAgenticAgentResults`** and **`onAgenticStreamComplete`** on `PluginInterface` when you need streaming results or completion signals in your host UI (see [PluginInterface](#plugininterface)).
47
+ If you use the **agentic** layout, implement the optional hooks **`onAgenticAgentResults`** and **`onAgenticStreamComplete`** on `PluginInterface` when you need streaming results or completion signals in your host UI (see [PluginInterface](#plugininterface)). To stay in sync with per-issue lifecycle changes (Open / Resolved / Dismissed), also implement **`onAgenticIssueStatusChanged`** — the sidebar emits it after every transition so you can update annotations or other host UI. Hosts may also drive transitions programmatically via **`markAgenticIssueResolved`** and **`restoreAgenticIssue`** (paralleling the existing **`invalidateAgenticIssue`** dismiss RPC). See [Agentic issue lifecycle](#agentic-issue-lifecycle).
47
48
 
48
49
  ## How the pieces fit together
49
50
 
@@ -474,6 +475,7 @@ Optional (agentic / streaming flows):
474
475
 
475
476
  - `onAgenticAgentResults?(agentName: string, issues: AgenticIssuePayload[]): Promise<void>` — Per-agent results as they stream
476
477
  - `onAgenticStreamComplete?(): Promise<void>` — Stream finished (success or terminal state)
478
+ - `onAgenticIssueStatusChanged?(issueId: string, status: "active" | "resolved" | "dismissed", source: "user" | "host"): Promise<void>` — Fired after every successful per-issue status transition. `source` is `"user"` for sidebar-card-driven transitions and `"host"` for transitions driven by the inbound `SidebarInterface` RPCs (`invalidateAgenticIssue` / `markAgenticIssueResolved` / `restoreAgenticIssue`). Best-effort: an absent or throwing handler MUST NOT block sidebar UI transitions. No-op RPC calls do not re-emit this notification.
477
479
 
478
480
  Optional (authentication):
479
481
 
@@ -541,6 +543,101 @@ The adapter uses a promise-based IPC system with automatic request/response corr
541
543
  }
542
544
  ```
543
545
 
546
+ ## Agentic issue lifecycle
547
+
548
+ The agentic layout surfaces an audit trail for every scan — each issue moves between three states: **Open** (`status: "active"`), **Resolved**, and **Dismissed**. Sidebar users transition issues with card buttons; hosts can mirror or drive the same transitions through the adapter.
549
+
550
+ ### Listening for transitions (sidebar → host)
551
+
552
+ Implement **`onAgenticIssueStatusChanged`** on your `PluginInterface` to react to every successful transition — including user actions in the sidebar **and** transitions caused by your own RPC calls. Use it to clear or update host-side annotations, refresh your own state, or feed analytics.
553
+
554
+ ```typescript
555
+ import type { PluginInterface } from "@markupai/sidebar-adapter";
556
+
557
+ const plugin: PluginInterface = {
558
+ // ...other methods omitted...
559
+
560
+ onAgenticIssueStatusChanged: async (issueId, status, source) => {
561
+ // status: "active" | "resolved" | "dismissed"
562
+ // source: "user" — sidebar card click | "host" — your own RPC
563
+ switch (status) {
564
+ case "resolved":
565
+ case "dismissed":
566
+ clearAnnotationForIssue(issueId);
567
+ break;
568
+ case "active":
569
+ // The issue was un-resolved or un-dismissed and is back in the working set.
570
+ repaintAnnotationForIssue(issueId);
571
+ break;
572
+ }
573
+ },
574
+ };
575
+ ```
576
+
577
+ Notes:
578
+
579
+ - The hook is **best-effort**: an absent or throwing implementation does **not** block the sidebar's own UI transition. Errors thrown from the handler are logged and swallowed.
580
+ - No-op RPCs (e.g. marking an already-resolved issue, restoring an open issue) MUST NOT emit a duplicate notification.
581
+ - Applied-suggestion resolves are reported the same way as manual ones (`status: "resolved"`), but they are terminal — see "Restoring issues" below.
582
+
583
+ ### Driving transitions (host → sidebar)
584
+
585
+ `SidebarAdapter` exposes three host-driven RPCs, all idempotent and optional on the sidebar side:
586
+
587
+ ```typescript
588
+ await sidebarAdapter.invalidateAgenticIssue(issueId); // → status: "dismissed"
589
+ await sidebarAdapter.markAgenticIssueResolved(issueId); // → status: "resolved"
590
+ await sidebarAdapter.restoreAgenticIssue(issueId); // → status: "active"
591
+ ```
592
+
593
+ - **`invalidateAgenticIssue(issueId)`** — Existing dismiss RPC. Use after the host clears the underlying range from its document, or to programmatically dismiss in response to host UI.
594
+ - **`markAgenticIssueResolved(issueId)`** — Marks an open issue resolved **without applying a suggestion**. The resulting issue is restorable via `restoreAgenticIssue`. Silent no-op for ids that are already in a non-open state or unknown.
595
+ - **`restoreAgenticIssue(issueId)`** — Moves a manually-resolved or dismissed issue back to the open state. Silent no-op for ids that are already open, **resolved via an applied suggestion** (terminal — see below), or unknown.
596
+
597
+ ### Restoring issues — what is and isn't reversible
598
+
599
+ The sidebar treats reversibility asymmetrically:
600
+
601
+ | Prior state | Reversible by `restoreAgenticIssue`? | Why |
602
+ | -------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
603
+ | Dismissed (any reason) | Yes | No document edit was made. |
604
+ | Manually resolved | Yes | No document edit was made. |
605
+ | Resolved via **applying a suggestion** | No | The applied text has already been written into the host document — restoring would desync the UI from the document. |
606
+
607
+ A `restoreAgenticIssue` call on a non-restorable resolved issue is a silent no-op (no error, no notification). If your host needs to fully undo an applied suggestion, do it on the host side first (your own undo stack) and then call `markAgenticIssueResolved`/`restoreAgenticIssue` as appropriate to keep the sidebar in sync.
608
+
609
+ ### End-to-end example
610
+
611
+ ```typescript
612
+ import { SidebarAdapter, type PluginInterface } from "@markupai/sidebar-adapter";
613
+
614
+ const plugin: PluginInterface = {
615
+ // ... getContent, replaceContent, etc.
616
+
617
+ onAgenticIssueStatusChanged: async (issueId, status, source) => {
618
+ syncAnnotation(issueId, status);
619
+ if (source === "host") {
620
+ // Echo from our own RPC; skip downstream work that's already done.
621
+ return;
622
+ }
623
+ notifyTelemetry({ issueId, status });
624
+ },
625
+ };
626
+
627
+ const sidebarAdapter = new SidebarAdapter(plugin, iframe);
628
+
629
+ // Host UI button "Accept in document"
630
+ async function onHostAcceptClicked(issueId: string) {
631
+ await acceptInDocument(issueId);
632
+ await sidebarAdapter.markAgenticIssueResolved(issueId);
633
+ }
634
+
635
+ // Host UI button "Reopen"
636
+ async function onHostReopenClicked(issueId: string) {
637
+ await sidebarAdapter.restoreAgenticIssue(issueId);
638
+ }
639
+ ```
640
+
544
641
  ## Integration settings
545
642
 
546
643
  A host MAY declare a small schema of settings it wants the sidebar to render and persist on its behalf. The sidebar shows a section in its Settings surface, persists user choices per-`integrationId` in `localStorage`, and notifies the host on user edits. The host can also push values and per-field UI state (`disabled`, `hidden`, `allowedValues`) to enforce its own rules — for example, "annotations off ⇒ view mode locked to `original`".
@@ -57,6 +57,13 @@ export declare class PluginAdapter {
57
57
  * Notify plugin that the agentic stream has finished.
58
58
  */
59
59
  onAgenticStreamComplete(): Promise<void>;
60
+ /**
61
+ * Notify plugin after a successful agentic-issue status transition.
62
+ * Optional on the host side — the returned promise rejects if the host
63
+ * has not implemented `onAgenticIssueStatusChanged`. Callers should
64
+ * swallow that error since the handler is documented as best-effort.
65
+ */
66
+ onAgenticIssueStatusChanged(issueId: string, status: "active" | "resolved" | "dismissed", source: "user" | "host"): Promise<void>;
60
67
  /**
61
68
  * Ask the host plugin to open an external URL during an auth flow.
62
69
  * The returned promise rejects if the host has not implemented the handler;
@@ -1 +1 @@
1
- {"version":3,"file":"pluginAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/p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arAdapter {
35
35
  * Request sidebar to invalidate (dismiss) the card for the given issue.
36
36
  */
37
37
  invalidateAgenticIssue(issueId: string): Promise<void>;
38
+ /**
39
+ * Request sidebar to mark an open issue as resolved without applying a
40
+ * suggestion. Silent no-op in the sidebar for ids already in a non-open
41
+ * state or unknown.
42
+ */
43
+ markAgenticIssueResolved(issueId: string): Promise<void>;
44
+ /**
45
+ * Request sidebar to transition an issue back to the open state. Silent
46
+ * no-op in the sidebar for ids that are already open, resolved via an
47
+ * applied suggestion, or unknown.
48
+ */
49
+ restoreAgenticIssue(issueId: string): Promise<void>;
38
50
  /**
39
51
  * Apply a host-driven patch to the sidebar's integration-settings form
40
52
  * values and/or per-field UI state. Use this to push values and
@@ -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,EAChB,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,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAW/F;;OAEG;IACI,OAAO,IAAI,IAAI;IAKtB;;;OAGG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D;;OAEG;IACU,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC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AAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;;OAIG;IACU,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE;;;;;;;;;;OAUG;IACU,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrF;;;;;;;;;OASG;IACU,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAI3E;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAG1C"}
@@ -48,6 +48,12 @@ export interface CallSignatures {
48
48
  * Notify plugin when the agentic stream has finished.
49
49
  */
50
50
  onAgenticStreamComplete(): Promise<void>;
51
+ /**
52
+ * Notify plugin after every successful agentic-issue status transition.
53
+ * Optional on the plugin side; absent handler is a no-op. See
54
+ * {@link PluginInterface.onAgenticIssueStatusChanged}.
55
+ */
56
+ onAgenticIssueStatusChanged?(issueId: string, status: "active" | "resolved" | "dismissed", source: "user" | "host"): Promise<void>;
51
57
  /**
52
58
  * Ask the plugin to open an external URL during an auth flow.
53
59
  * See {@link PluginInterface.openAuthUrl}.
@@ -72,6 +78,20 @@ export interface CallSignatures {
72
78
  * Request sidebar to invalidate (dismiss) the card for the given issue id.
73
79
  */
74
80
  invalidateAgenticIssue(issueId: string): Promise<void>;
81
+ /**
82
+ * Request sidebar to mark an open issue as resolved (no applied suggestion).
83
+ * Optional on the sidebar side; absent handler returns the standard
84
+ * "No receiver registered" error which callers may swallow.
85
+ * See {@link SidebarInterface.markAgenticIssueResolved}.
86
+ */
87
+ markAgenticIssueResolved(issueId: string): Promise<void>;
88
+ /**
89
+ * Request sidebar to transition an issue back to the open state.
90
+ * Optional on the sidebar side; absent handler returns the standard
91
+ * "No receiver registered" error which callers may swallow.
92
+ * See {@link SidebarInterface.restoreAgenticIssue}.
93
+ */
94
+ restoreAgenticIssue(issueId: string): Promise<void>;
75
95
  /**
76
96
  * Apply a host-driven patch to the integration-settings form values and/or
77
97
  * per-field UI state. See {@link SidebarInterface.applyIntegrationSettings}.
@@ -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,EACpB,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;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvE;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/F;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;OAEG;IACH,uBAAuB,CAAC,YAAY,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAExC;;OAEG;IACH,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,IAAI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oB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;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;CAChE"}
@@ -58,6 +58,12 @@ export declare class PluginIPCAdapter {
58
58
  * Notify plugin that the agentic stream has finished.
59
59
  */
60
60
  onAgenticStreamComplete(): Promise<void>;
61
+ /**
62
+ * Notify plugin after a successful agentic-issue status transition.
63
+ * Hosts may not have registered a handler — callers swallow the resulting
64
+ * "No receiver registered" error since the notification is best-effort.
65
+ */
66
+ onAgenticIssueStatusChanged(issueId: string, status: "active" | "resolved" | "dismissed", source: "user" | "host"): Promise<void>;
61
67
  /**
62
68
  * Ask the plugin to open an external URL during an auth flow.
63
69
  * Throws if the plugin has not registered a handler, so callers can fall
@@ -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,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,O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CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAkBlD;;OAEG;IACI,eAAe,IAAI,MAAM;IAIhC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
@@ -22,6 +22,14 @@ export declare class SidebarIPCAdapter {
22
22
  * Request sidebar to invalidate (dismiss) the card for the given issue.
23
23
  */
24
24
  invalidateAgenticIssue(issueId: string): Promise<void>;
25
+ /**
26
+ * Request sidebar to mark the given open issue as resolved.
27
+ */
28
+ markAgenticIssueResolved(issueId: string): Promise<void>;
29
+ /**
30
+ * Request sidebar to transition the given issue back to the open state.
31
+ */
32
+ restoreAgenticIssue(issueId: string): Promise<void>;
25
33
  /**
26
34
  * Notify sidebar of plugin status changes
27
35
  * Example method demonstrating Plugin → Sidebar communication
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-ipc-adapter.d.ts","sourceRoot":"","sources":["../../src/ipc/sidebar-ipc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAGV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAGpC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,iBAAiB,EACzB,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,SAAS,EAClB,YAAY,GAAE,MAAY;I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AClB,YAAY,GAAE,MAAY;IAqB5B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAqB5B;IAEF,OAAO,CAAC,iBAAiB;IAgIzB;;OAEG;IACU,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjE;;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,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D;;OAEG;IACU,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrF;;OAEG;IACU,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAK3E;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
package/dist/main.js CHANGED
@@ -1,10 +1,10 @@
1
- var y = /* @__PURE__ */ (function(e) {
1
+ var I = /* @__PURE__ */ (function(e) {
2
2
  return e.TEXT_PLAIN = "text/plain", e.TEXT_MARKDOWN = "text/markdown", e.TEXT_HTML = "text/html", e.APPLICATION_DITA_XML = "application/dita+xml", e;
3
3
  })({}), ae = [
4
- y.TEXT_PLAIN,
5
- y.TEXT_MARKDOWN,
6
- y.TEXT_HTML,
7
- y.APPLICATION_DITA_XML
4
+ I.TEXT_PLAIN,
5
+ I.TEXT_MARKDOWN,
6
+ I.TEXT_HTML,
7
+ I.APPLICATION_DITA_XML
8
8
  ], oe = {
9
9
  integrationName: "unknown",
10
10
  integrationVersion: "unknown",
@@ -16,10 +16,10 @@ var y = /* @__PURE__ */ (function(e) {
16
16
  }, se = (e) => typeof e != "object" || e === null ? !1 : Array.isArray(e.fields), le = (e) => {
17
17
  if (typeof e != "object" || e === null) return !1;
18
18
  const t = e;
19
- return typeof t.id != "string" || t.id.length === 0 || typeof t.label != "string" ? !1 : t.type === "boolean" ? typeof t.default == "boolean" : t.type === "enum" ? typeof t.default != "string" || !Array.isArray(t.options) || t.options.length === 0 ? !1 : t.options.every((r) => {
20
- if (typeof r != "object" || r === null) return !1;
21
- const i = r;
22
- return typeof i.value == "string" && typeof i.label == "string";
19
+ return typeof t.id != "string" || t.id.length === 0 || typeof t.label != "string" ? !1 : t.type === "boolean" ? typeof t.default == "boolean" : t.type === "enum" ? typeof t.default != "string" || !Array.isArray(t.options) || t.options.length === 0 ? !1 : t.options.every((i) => {
20
+ if (typeof i != "object" || i === null) return !1;
21
+ const r = i;
22
+ return typeof r.value == "string" && typeof r.label == "string";
23
23
  }) : !1;
24
24
  }, D = class _ extends Error {
25
25
  name = "TextLookupError";
@@ -32,15 +32,15 @@ function ce(e) {
32
32
  }
33
33
  var E = { TextLookupError: (e) => new D(e) };
34
34
  function H(e) {
35
- const t = e.message ?? "", r = e.name, i = typeof r == "string" && r in E ? E[r] : void 0;
36
- return i ? i(t, e) : Object.assign(new Error(t), r ? { name: r } : {});
35
+ const t = e.message ?? "", i = e.name, r = typeof i == "string" && i in E ? E[i] : void 0;
36
+ return r ? r(t, e) : Object.assign(new Error(t), i ? { name: i } : {});
37
37
  }
38
- var O = () => {
38
+ var R = () => {
39
39
  }, U = class {
40
40
  _promise;
41
41
  [Symbol.toStringTag] = "Promise";
42
- resolve = O;
43
- reject = O;
42
+ resolve = R;
43
+ reject = R;
44
44
  constructor() {
45
45
  this._promise = new Promise((e, t) => {
46
46
  this.resolve = e, this.reject = t;
@@ -76,22 +76,22 @@ var O = () => {
76
76
  call(e, ...t) {
77
77
  return this.callWithOptions(e, {}, ...t);
78
78
  }
79
- callWithOptions(e, t, ...r) {
80
- const i = this.currentID++, a = new U(), n = t.timeout ?? this.config.timeout, o = setTimeout(() => {
81
- if (i in this.promisesByID) {
79
+ callWithOptions(e, t, ...i) {
80
+ const r = this.currentID++, a = new U(), n = t.timeout ?? this.config.timeout, o = setTimeout(() => {
81
+ if (r in this.promisesByID) {
82
82
  const l = /* @__PURE__ */ new Error(`IPC call timeout: "${e}" did not respond within ${String(n)}ms`);
83
- a.reject(l), Reflect.deleteProperty(this.promisesByID, i);
83
+ a.reject(l), Reflect.deleteProperty(this.promisesByID, r);
84
84
  }
85
85
  }, n);
86
- this.promisesByID[i] = {
86
+ this.promisesByID[r] = {
87
87
  promise: a,
88
88
  timeoutId: o
89
89
  };
90
90
  const s = {
91
91
  type: "call",
92
- id: i,
92
+ id: r,
93
93
  name: e,
94
- data: r
94
+ data: i
95
95
  };
96
96
  return this.postMessage(s), a;
97
97
  }
@@ -116,15 +116,15 @@ var O = () => {
116
116
  }
117
117
  }
118
118
  async handleCall(e) {
119
- const { id: t, name: r, data: i } = e;
120
- if (r in this.receiversByName) {
121
- const a = this.receiversByName[r];
119
+ const { id: t, name: i, data: r } = e;
120
+ if (i in this.receiversByName) {
121
+ const a = this.receiversByName[i];
122
122
  try {
123
- if (!Array.isArray(i)) throw new Error(`IPC: Expected array of arguments but got ${typeof i}`);
124
- const n = await a(...i), o = {
123
+ if (!Array.isArray(r)) throw new Error(`IPC: Expected array of arguments but got ${typeof r}`);
124
+ const n = await a(...r), o = {
125
125
  type: "response",
126
126
  id: t,
127
- name: r,
127
+ name: i,
128
128
  data: n
129
129
  };
130
130
  this.postMessage(o);
@@ -138,16 +138,16 @@ var O = () => {
138
138
  const l = {
139
139
  type: "error",
140
140
  id: t,
141
- name: r,
141
+ name: i,
142
142
  errorJSON: o
143
143
  };
144
144
  this.postMessage(l);
145
145
  }
146
146
  } else {
147
- const a = /* @__PURE__ */ new Error(`No receiver registered for: ${r}`), n = {
147
+ const a = /* @__PURE__ */ new Error(`No receiver registered for: ${i}`), n = {
148
148
  type: "error",
149
149
  id: t,
150
- name: r,
150
+ name: i,
151
151
  errorJSON: JSON.stringify({
152
152
  message: a.message,
153
153
  name: a.name
@@ -159,20 +159,20 @@ var O = () => {
159
159
  handleResponse(e) {
160
160
  const { id: t } = e;
161
161
  if (t in this.promisesByID) {
162
- const { promise: r, timeoutId: i } = this.promisesByID[t];
163
- clearTimeout(i), r.resolve(e.data), Reflect.deleteProperty(this.promisesByID, t);
162
+ const { promise: i, timeoutId: r } = this.promisesByID[t];
163
+ clearTimeout(r), i.resolve(e.data), Reflect.deleteProperty(this.promisesByID, t);
164
164
  }
165
165
  }
166
166
  handleError(e) {
167
- const { id: t, errorJSON: r } = e;
167
+ const { id: t, errorJSON: i } = e;
168
168
  if (t in this.promisesByID) {
169
- const { promise: i, timeoutId: a } = this.promisesByID[t];
169
+ const { promise: r, timeoutId: a } = this.promisesByID[t];
170
170
  clearTimeout(a);
171
171
  try {
172
- const n = H(JSON.parse(r));
173
- i.reject(n);
172
+ const n = H(JSON.parse(i));
173
+ r.reject(n);
174
174
  } catch {
175
- i.reject(/* @__PURE__ */ new Error("Failed to parse error from IPC"));
175
+ r.reject(/* @__PURE__ */ new Error("Failed to parse error from IPC"));
176
176
  }
177
177
  Reflect.deleteProperty(this.promisesByID, t);
178
178
  }
@@ -186,14 +186,14 @@ var O = () => {
186
186
  ipc;
187
187
  sidebar;
188
188
  targetOrigin;
189
- constructor(e, t, r = "*") {
190
- this.sidebar = e || {}, this.targetOrigin = r, this.ipc = new L((i) => {
191
- window.parent.postMessage(i, this.targetOrigin);
189
+ constructor(e, t, i = "*") {
190
+ this.sidebar = e || {}, this.targetOrigin = i, this.ipc = new L((r) => {
191
+ window.parent.postMessage(r, this.targetOrigin);
192
192
  }, t), window.addEventListener("message", this.handleMessage), this.registerReceivers();
193
193
  }
194
194
  handleMessage = (e) => {
195
- const t = globalThis.window.location.origin, r = this.targetOrigin;
196
- e.origin !== t && (r !== "*" && e.origin !== r || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
195
+ const t = globalThis.window.location.origin, i = this.targetOrigin;
196
+ e.origin !== t && (i !== "*" && e.origin !== i || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
197
197
  };
198
198
  registerReceivers() {
199
199
  if (this.sidebar.onPluginStatusChange) {
@@ -214,6 +214,18 @@ var O = () => {
214
214
  await e(t);
215
215
  });
216
216
  }
217
+ if (this.sidebar.markAgenticIssueResolved) {
218
+ const e = this.sidebar.markAgenticIssueResolved;
219
+ this.ipc.receive("markAgenticIssueResolved", async (t) => {
220
+ await e(t);
221
+ });
222
+ }
223
+ if (this.sidebar.restoreAgenticIssue) {
224
+ const e = this.sidebar.restoreAgenticIssue;
225
+ this.ipc.receive("restoreAgenticIssue", async (t) => {
226
+ await e(t);
227
+ });
228
+ }
217
229
  if (this.sidebar.applyIntegrationSettings) {
218
230
  const e = this.sidebar.applyIntegrationSettings;
219
231
  this.ipc.receive("applyIntegrationSettings", async (t) => {
@@ -240,8 +252,8 @@ var O = () => {
240
252
  async selectContent(e) {
241
253
  await this.ipc.call("selectContent", e);
242
254
  }
243
- async showDialog(e, t, r, i) {
244
- await this.ipc.call("showDialog", e, t, r, i);
255
+ async showDialog(e, t, i, r) {
256
+ await this.ipc.call("showDialog", e, t, i, r);
245
257
  }
246
258
  async closeDialog() {
247
259
  await this.ipc.call("closeDialog");
@@ -255,6 +267,9 @@ var O = () => {
255
267
  async onAgenticStreamComplete() {
256
268
  await this.ipc.call("onAgenticStreamComplete");
257
269
  }
270
+ async onAgenticIssueStatusChanged(e, t, i) {
271
+ await this.ipc.call("onAgenticIssueStatusChanged", e, t, i);
272
+ }
258
273
  async openAuthUrl(e) {
259
274
  await this.ipc.call("openAuthUrl", e);
260
275
  }
@@ -282,8 +297,8 @@ var O = () => {
282
297
  }
283
298
  }, ge = class {
284
299
  ipcAdapter;
285
- constructor(e, t, r) {
286
- this.ipcAdapter = new F(e, t, r);
300
+ constructor(e, t, i) {
301
+ this.ipcAdapter = new F(e, t, i);
287
302
  }
288
303
  destroy() {
289
304
  this.ipcAdapter.destroy();
@@ -303,8 +318,8 @@ var O = () => {
303
318
  async selectContent(e) {
304
319
  await this.ipcAdapter.selectContent(e);
305
320
  }
306
- async showDialog(e, t, r, i) {
307
- await this.ipcAdapter.showDialog(e, t, r, i);
321
+ async showDialog(e, t, i, r) {
322
+ await this.ipcAdapter.showDialog(e, t, i, r);
308
323
  }
309
324
  async closeDialog() {
310
325
  await this.ipcAdapter.closeDialog();
@@ -318,6 +333,9 @@ var O = () => {
318
333
  onAgenticStreamComplete() {
319
334
  return this.ipcAdapter.onAgenticStreamComplete();
320
335
  }
336
+ onAgenticIssueStatusChanged(e, t, i) {
337
+ return this.ipcAdapter.onAgenticIssueStatusChanged(e, t, i);
338
+ }
321
339
  openAuthUrl(e) {
322
340
  return this.ipcAdapter.openAuthUrl(e);
323
341
  }
@@ -339,22 +357,22 @@ var O = () => {
339
357
  iframe;
340
358
  window;
341
359
  targetOrigin;
342
- constructor(e, t, r, i, a = "*") {
343
- this.plugin = e, this.iframe = t, this.window = r ?? window, this.targetOrigin = a, this.ipc = new L((n) => {
360
+ constructor(e, t, i, r, a = "*") {
361
+ this.plugin = e, this.iframe = t, this.window = i ?? window, this.targetOrigin = a, this.ipc = new L((n) => {
344
362
  this.iframe.contentWindow?.postMessage(n, this.targetOrigin);
345
- }, i), this.window.addEventListener("message", this.handleMessage, !1), this.registerReceivers();
363
+ }, r), this.window.addEventListener("message", this.handleMessage, !1), this.registerReceivers();
346
364
  }
347
365
  handleMessage = (e) => {
348
- const t = this.window.location.origin, r = this.targetOrigin;
349
- e.origin !== t && (r !== "*" && e.origin !== r || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
366
+ const t = this.window.location.origin, i = this.targetOrigin;
367
+ e.origin !== t && (i !== "*" && e.origin !== i || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
350
368
  };
351
369
  registerReceivers() {
352
370
  if (this.ipc.receive("getInitConfig", async () => await this.plugin.getInitConfig()), this.ipc.receive("getContent", async () => await this.plugin.getContent()), this.ipc.receive("getSelectedContent", async () => await this.plugin.getSelectedContent()), this.ipc.receive("replaceContent", async (e, t) => {
353
371
  await this.plugin.replaceContent(e, t);
354
372
  }), this.ipc.receive("selectContent", async (e) => {
355
373
  await this.plugin.selectContent(e);
356
- }), this.ipc.receive("showDialog", async (e, t, r, i) => {
357
- await this.plugin.showDialog(e, t, r, i);
374
+ }), this.ipc.receive("showDialog", async (e, t, i, r) => {
375
+ await this.plugin.showDialog(e, t, i, r);
358
376
  }), this.ipc.receive("closeDialog", async () => {
359
377
  await this.plugin.closeDialog();
360
378
  }), this.ipc.receive("replaceMultipleContents", async (e) => {
@@ -362,11 +380,18 @@ var O = () => {
362
380
  }), this.ipc.receive("onAgenticAgentResults", async (e, t) => {
363
381
  if (!Array.isArray(t))
364
382
  return;
365
- const r = this.plugin.onAgenticAgentResults;
366
- r && await r(e, t);
383
+ const i = this.plugin.onAgenticAgentResults;
384
+ i && await i(e, t);
367
385
  }), this.ipc.receive("onAgenticStreamComplete", async () => {
368
386
  const e = this.plugin.onAgenticStreamComplete;
369
387
  e && await e();
388
+ }), this.ipc.receive("onAgenticIssueStatusChanged", async (e, t, i) => {
389
+ const r = this.plugin.onAgenticIssueStatusChanged;
390
+ if (r && !(t !== "active" && t !== "resolved" && t !== "dismissed" || i !== "user" && i !== "host"))
391
+ try {
392
+ await r(e, t, i);
393
+ } catch {
394
+ }
370
395
  }), this.plugin.openAuthUrl) {
371
396
  const e = this.plugin.openAuthUrl;
372
397
  this.ipc.receive("openAuthUrl", async (t) => {
@@ -375,8 +400,8 @@ var O = () => {
375
400
  }
376
401
  if (this.plugin.onIntegrationSettingsChange) {
377
402
  const e = this.plugin.onIntegrationSettingsChange;
378
- this.ipc.receive("onIntegrationSettingsChange", async (t, r) => {
379
- await e(t, r);
403
+ this.ipc.receive("onIntegrationSettingsChange", async (t, i) => {
404
+ await e(t, i);
380
405
  });
381
406
  }
382
407
  }
@@ -386,6 +411,12 @@ var O = () => {
386
411
  async invalidateAgenticIssue(e) {
387
412
  await this.ipc.call("invalidateAgenticIssue", e);
388
413
  }
414
+ async markAgenticIssueResolved(e) {
415
+ await this.ipc.call("markAgenticIssueResolved", e);
416
+ }
417
+ async restoreAgenticIssue(e) {
418
+ await this.ipc.call("restoreAgenticIssue", e);
419
+ }
389
420
  async notifyPluginStatus(e) {
390
421
  await this.ipc.call("onPluginStatusChange", e);
391
422
  }
@@ -403,8 +434,8 @@ var O = () => {
403
434
  }
404
435
  }, W = class {
405
436
  ipcAdapter;
406
- constructor(e, t, r) {
407
- this.ipcAdapter = new $(e, t, r?.win, r?.config, r?.targetOrigin);
437
+ constructor(e, t, i) {
438
+ this.ipcAdapter = new $(e, t, i?.win, i?.config, i?.targetOrigin);
408
439
  }
409
440
  destroy() {
410
441
  this.ipcAdapter.destroy();
@@ -418,6 +449,12 @@ var O = () => {
418
449
  async invalidateAgenticIssue(e) {
419
450
  await this.ipcAdapter.invalidateAgenticIssue(e);
420
451
  }
452
+ async markAgenticIssueResolved(e) {
453
+ await this.ipcAdapter.markAgenticIssueResolved(e);
454
+ }
455
+ async restoreAgenticIssue(e) {
456
+ await this.ipcAdapter.restoreAgenticIssue(e);
457
+ }
421
458
  async applyIntegrationSettings(e) {
422
459
  await this.ipcAdapter.applyIntegrationSettings(e);
423
460
  }
@@ -457,7 +494,7 @@ var O = () => {
457
494
  overlay: e,
458
495
  button: t
459
496
  };
460
- }, T = "markupai-sidebar-load-overlay-styles", J = `
497
+ }, O = "markupai-sidebar-load-overlay-styles", J = `
461
498
  :root {
462
499
  --background: #f5f5f4;
463
500
  --foreground: #333332;
@@ -551,51 +588,51 @@ var O = () => {
551
588
  }
552
589
  `, X = (e) => {
553
590
  const t = e ?? document;
554
- if (t.getElementById(T)) return;
555
- const r = t.createElement("style");
556
- r.id = T, r.textContent = J, t.head.appendChild(r);
557
- }, Y = 8e3, V = 12e3, K = (e, t, r = {}) => {
591
+ if (t.getElementById(O)) return;
592
+ const i = t.createElement("style");
593
+ i.id = O, i.textContent = J, t.head.appendChild(i);
594
+ }, Y = 8e3, V = 12e3, K = (e, t, i = {}) => {
558
595
  X(e.ownerDocument);
559
- const { sidebarUrl: i, targetOrigin: a, timeoutMs: n = Y, retryIntervalMs: o = V, messageListenWindow: s } = r, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => i ?? t.src, k = () => {
596
+ const { sidebarUrl: r, targetOrigin: a, timeoutMs: n = Y, retryIntervalMs: o = V, messageListenWindow: s } = i, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => r ?? t.src, N = () => {
560
597
  if (a) return a;
561
598
  try {
562
599
  return new URL(p()).origin;
563
600
  } catch {
564
601
  return "*";
565
602
  }
566
- }, { overlay: v, button: I } = z();
567
- e.appendChild(v);
603
+ }, { overlay: y, button: v } = z();
604
+ e.appendChild(y);
568
605
  let u = !1, h, g;
569
606
  const d = (c) => {
570
- v.style.display = c ? "flex" : "none";
607
+ y.style.display = c ? "flex" : "none";
571
608
  };
572
609
  d(!1);
573
610
  const f = () => {
574
611
  h && (globalThis.clearTimeout(h), h = void 0);
575
- }, C = () => {
612
+ }, A = () => {
576
613
  f(), h = globalThis.setTimeout(() => {
577
614
  u || d(!0);
578
615
  }, n);
579
- }, A = (c) => {
616
+ }, C = (c) => {
580
617
  const m = c?.preserveOverlay ?? !0;
581
- u = !1, m || d(!1), t.src = p(), C();
618
+ u = !1, m || d(!1), t.src = p(), A();
582
619
  }, B = () => {
583
620
  g || o <= 0 || (g = globalThis.setInterval(() => {
584
- u || A({ preserveOverlay: !0 });
621
+ u || C({ preserveOverlay: !0 });
585
622
  }, o));
586
623
  }, b = () => {
587
624
  g && (globalThis.clearInterval(g), g = void 0);
588
- }, w = (c) => {
625
+ }, S = (c) => {
589
626
  if (!t.contentWindow || c.source !== t.contentWindow) return;
590
- const m = k();
627
+ const m = N();
591
628
  m !== "*" && c.origin !== m || (u = !0, f(), b(), d(!1));
592
- }, S = () => {
629
+ }, w = () => {
593
630
  f(), d(!0);
594
631
  }, P = () => {
595
- A();
632
+ C();
596
633
  };
597
- return I.addEventListener("click", P), t.addEventListener("error", S), l.addEventListener("message", w), C(), B(), () => {
598
- f(), b(), t.removeEventListener("error", S), l.removeEventListener("message", w), I.removeEventListener("click", P), v.remove();
634
+ return v.addEventListener("click", P), t.addEventListener("error", w), l.addEventListener("message", S), A(), B(), () => {
635
+ f(), b(), t.removeEventListener("error", w), l.removeEventListener("message", S), v.removeEventListener("click", P), y.remove();
599
636
  };
600
637
  }, q = "Markup AI Sidebar", Z = "clipboard-read; clipboard-write", de = "markupai.sidebarNextGen.overrideUrl", pe = "https://sidebar.markup.ai/";
601
638
  function ue(e) {
@@ -610,10 +647,10 @@ function he(e, t) {
610
647
  if (!t) return e;
611
648
  try {
612
649
  if (!("localStorage" in globalThis)) return e;
613
- const r = globalThis.localStorage.getItem(Q)?.trim();
614
- if (!r) return e;
615
- const i = JSON.parse(r);
616
- return i !== null && typeof i == "object" && "type" in i && (i.type === "mediation" || i.type === "popup") ? i : e;
650
+ const i = globalThis.localStorage.getItem(Q)?.trim();
651
+ if (!i) return e;
652
+ const r = JSON.parse(i);
653
+ return r !== null && typeof r == "object" && "type" in r && (r.type === "mediation" || r.type === "popup") ? r : e;
617
654
  } catch {
618
655
  return e;
619
656
  }
@@ -621,31 +658,31 @@ function he(e, t) {
621
658
  function fe(e, t) {
622
659
  try {
623
660
  return new URL(e).origin;
624
- } catch (r) {
625
- return t?.onInvalidUrl?.(e, r), "*";
661
+ } catch (i) {
662
+ return t?.onInvalidUrl?.(e, i), "*";
626
663
  }
627
664
  }
628
665
  function me(e, t = "Expected SidebarAdapter from createSidebarHost") {
629
666
  if (e.adapter === null) throw new Error(t);
630
667
  }
631
668
  function ee(e) {
632
- const { iframe: t, iframeMount: r } = e;
633
- if (t !== void 0 && r !== void 0) throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");
669
+ const { iframe: t, iframeMount: i } = e;
670
+ if (t !== void 0 && i !== void 0) throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");
634
671
  if (t !== void 0) return {
635
672
  iframe: t,
636
673
  removeMountedIframe: null
637
674
  };
638
- if (r === void 0) throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");
639
- const { container: i, src: a, allow: n = Z } = r, o = document.createElement("iframe");
640
- return o.title = q, o.src = a, n && o.setAttribute("allow", n), i.appendChild(o), {
675
+ if (i === void 0) throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");
676
+ const { container: r, src: a, allow: n = Z } = i, o = document.createElement("iframe");
677
+ return o.title = q, o.src = a, n && o.setAttribute("allow", n), r.appendChild(o), {
641
678
  iframe: o,
642
679
  removeMountedIframe: () => {
643
680
  o.remove();
644
681
  }
645
682
  };
646
683
  }
647
- function ye(e) {
648
- const { plugin: t, loadOverlayContainer: r, loadOverlayOptions: i, adapterOptions: a } = e, { iframe: n, removeMountedIframe: o } = ee(e), s = r !== void 0 ? K(r, n, i ?? {}) : null;
684
+ function Ie(e) {
685
+ const { plugin: t, loadOverlayContainer: i, loadOverlayOptions: r, adapterOptions: a } = e, { iframe: n, removeMountedIframe: o } = ee(e), s = i !== void 0 ? K(i, n, r ?? {}) : null;
649
686
  if (t !== void 0) {
650
687
  const l = new W(t, n, a);
651
688
  return {
@@ -664,13 +701,13 @@ function ye(e) {
664
701
  }
665
702
  };
666
703
  }
667
- var M = "sidebarContainer", R = "markupai-sidebar-host-shell-styles";
704
+ var M = "sidebarContainer", T = "markupai-sidebar-host-shell-styles";
668
705
  function x(e) {
669
706
  if (typeof CSS < "u" && typeof CSS.escape == "function") return CSS.escape(e);
670
707
  if (!/^[a-zA-Z_][\w-]*$/.test(e)) throw new Error(`sidebar host shell: containerId must match /^[a-zA-Z_][\\w-]*$/ when CSS.escape is unavailable (got ${JSON.stringify(e)})`);
671
708
  return e;
672
709
  }
673
- function N(e = M) {
710
+ function k(e = M) {
674
711
  const t = x(e);
675
712
  return `
676
713
  html {
@@ -696,34 +733,34 @@ body {
696
733
  }
697
734
  `.trim();
698
735
  }
699
- var ve = N();
736
+ var ye = k();
700
737
  function te(e) {
701
738
  return e instanceof Document ? e : e.ownerDocument;
702
739
  }
703
- function re(e, t, r) {
704
- if (!t || e.getElementById(R)) return;
705
- const i = e.createElement("style");
706
- i.id = R, i.textContent = N(r), e.head.appendChild(i);
740
+ function ie(e, t, i) {
741
+ if (!t || e.getElementById(T)) return;
742
+ const r = e.createElement("style");
743
+ r.id = T, r.textContent = k(i), e.head.appendChild(r);
707
744
  }
708
- function Ie(e) {
709
- const { root: t = typeof document < "u" ? document : void 0, containerId: r = M, includeDefaultStyles: i = !0 } = e ?? {};
745
+ function ve(e) {
746
+ const { root: t = typeof document < "u" ? document : void 0, containerId: i = M, includeDefaultStyles: r = !0 } = e ?? {};
710
747
  if (t === void 0) throw new Error("ensureSidebarHostShell: no document — pass `root` in non-browser environments");
711
748
  const a = te(t);
712
- re(a, i, r);
713
- const n = t instanceof Document ? a.getElementById(r) : t.querySelector(`#${x(r)}`);
749
+ ie(a, r, i);
750
+ const n = t instanceof Document ? a.getElementById(i) : t.querySelector(`#${x(i)}`);
714
751
  if (n instanceof HTMLElement && (t instanceof Document || t.contains(n))) return n;
715
752
  if (!(t instanceof Document)) {
716
753
  const s = a.createElement("div");
717
- return s.id = r, t.appendChild(s), s;
754
+ return s.id = i, t.appendChild(s), s;
718
755
  }
719
756
  const o = a.createElement("div");
720
- return o.id = r, a.body.appendChild(o), o;
757
+ return o.id = i, a.body.appendChild(o), o;
721
758
  }
722
- function ie() {
759
+ function re() {
723
760
  return ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
724
761
  }
725
- function Ce(e) {
726
- const { title: t = "Markup AI Sidebar", headInnerHtml: r = "", includePluginHostHead: i = !1, bodyScriptsHtml: a, htmlLang: n = "en", htmlAttrs: o = `lang="${n}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [i ? ie() : "", r].filter((p) => p.trim().length > 0).join(`
762
+ function Ae(e) {
763
+ const { title: t = "Markup AI Sidebar", headInnerHtml: i = "", includePluginHostHead: r = !1, bodyScriptsHtml: a, htmlLang: n = "en", htmlAttrs: o = `lang="${n}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [r ? re() : "", i].filter((p) => p.trim().length > 0).join(`
727
764
  `);
728
765
  return `<!DOCTYPE html>
729
766
  <html ${o}>
@@ -748,12 +785,12 @@ export {
748
785
  oe as DEFAULT_SIDEBAR_CONFIG,
749
786
  U as DeferredPromise,
750
787
  L as IPCCore,
751
- y as MimeType,
788
+ I as MimeType,
752
789
  ge as PluginAdapter,
753
790
  F as PluginIPCAdapter,
754
791
  pe as SIDEBAR_DEFAULT_PRODUCTION_BASE_URL,
755
792
  M as SIDEBAR_HOST_CONTAINER_ID,
756
- ve as SIDEBAR_HOST_SHELL_CSS,
793
+ ye as SIDEBAR_HOST_SHELL_CSS,
757
794
  Z as SIDEBAR_IFRAME_DEFAULT_ALLOW,
758
795
  q as SIDEBAR_IFRAME_DEFAULT_TITLE,
759
796
  de as SIDEBAR_URL_OVERRIDE_STORAGE_KEY,
@@ -762,11 +799,11 @@ export {
762
799
  ae as TEXT_MIME_TYPES,
763
800
  D as TextLookupError,
764
801
  me as assertSidebarHostAdapter,
765
- Ce as buildSidebarHostHtmlDocument,
766
- N as buildSidebarHostShellCss,
767
- ie as buildSidebarPluginHostHeadInnerHtml,
768
- ye as createSidebarHost,
769
- Ie as ensureSidebarHostShell,
802
+ Ae as buildSidebarHostHtmlDocument,
803
+ k as buildSidebarHostShellCss,
804
+ re as buildSidebarPluginHostHeadInnerHtml,
805
+ Ie as createSidebarHost,
806
+ ve as ensureSidebarHostShell,
770
807
  he as getAuthConfigWithOverride,
771
808
  ue as getSidebarBaseUrlWithOverride,
772
809
  E as ipcErrorReconstructors,
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(n,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(n=typeof globalThis<"u"?globalThis:n||self,d(n.main={}))})(this,function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});var d=(function(e){return e.TEXT_PLAIN="text/plain",e.TEXT_MARKDOWN="text/markdown",e.TEXT_HTML="text/html",e.APPLICATION_DITA_XML="application/dita+xml",e})({}),X=[d.TEXT_PLAIN,d.TEXT_MARKDOWN,d.TEXT_HTML,d.APPLICATION_DITA_XML],V={integrationName:"unknown",integrationVersion:"unknown",integrationId:"markupai-sidebar-app",hideBanner:!1,dialogClosingScript:void 0,useCheckPreviewDialog:!1,supportCheckSelection:!0},K=e=>typeof e!="object"||e===null?!1:Array.isArray(e.fields),q=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id!="string"||t.id.length===0||typeof t.label!="string"?!1:t.type==="boolean"?typeof t.default=="boolean":t.type==="enum"?typeof t.default!="string"||!Array.isArray(t.options)||t.options.length===0?!1:t.options.every(i=>{if(typeof i!="object"||i===null)return!1;const r=i;return typeof r.value=="string"&&typeof r.label=="string"}):!1},v=class J extends Error{name="TextLookupError";constructor(t){super(t),Object.setPrototypeOf(this,J.prototype)}};function Z(e){return e instanceof v}var A={TextLookupError:e=>new v(e)};function E(e){const t=e.message??"",i=e.name,r=typeof i=="string"&&i in A?A[i]:void 0;return r?r(t,e):Object.assign(new Error(t),i?{name:i}:{})}var P=()=>{},T=class{_promise;[Symbol.toStringTag]="Promise";resolve=P;reject=P;constructor(){this._promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}},O={timeout:1e4},C=class{promisesByID={};receiversByName={};currentID=0;config;postMessage;constructor(e,t){this.postMessage=e,this.config={...O,...t}}configure(e){this.config={...this.config,...e}}call(e,...t){return this.callWithOptions(e,{},...t)}callWithOptions(e,t,...i){const r=this.currentID++,o=new T,a=t.timeout??this.config.timeout,s=setTimeout(()=>{if(r in this.promisesByID){const c=new Error(`IPC call timeout: "${e}" did not respond within ${String(a)}ms`);o.reject(c),Reflect.deleteProperty(this.promisesByID,r)}},a);this.promisesByID[r]={promise:o,timeoutId:s};const l={type:"call",id:r,name:e,data:i};return this.postMessage(l),o}receive(e,t){this.receiversByName[e]=t}ignore(e){delete this.receiversByName[e]}async handleMessage(e){switch(e.type){case"call":await this.handleCall(e);break;case"response":this.handleResponse(e);break;case"error":this.handleError(e);break;default:}}async handleCall(e){const{id:t,name:i,data:r}=e;if(i in this.receiversByName){const o=this.receiversByName[i];try{if(!Array.isArray(r))throw new Error(`IPC: Expected array of arguments but got ${typeof r}`);const a=await o(...r),s={type:"response",id:t,name:i,data:a};this.postMessage(s)}catch(a){let s=JSON.stringify(a,Object.getOwnPropertyNames(a));const l=JSON.parse(s);(l.message===void 0||l.message==="")&&(s=JSON.stringify({message:a instanceof Error?a.message:String(a),name:a instanceof Error?a.name:void 0}));const c={type:"error",id:t,name:i,errorJSON:s};this.postMessage(c)}}else{const o=new Error(`No receiver registered for: ${i}`),a={type:"error",id:t,name:i,errorJSON:JSON.stringify({message:o.message,name:o.name})};this.postMessage(a)}}handleResponse(e){const{id:t}=e;if(t in this.promisesByID){const{promise:i,timeoutId:r}=this.promisesByID[t];clearTimeout(r),i.resolve(e.data),Reflect.deleteProperty(this.promisesByID,t)}}handleError(e){const{id:t,errorJSON:i}=e;if(t in this.promisesByID){const{promise:r,timeoutId:o}=this.promisesByID[t];clearTimeout(o);try{const a=E(JSON.parse(i));r.reject(a)}catch{r.reject(new Error("Failed to parse error from IPC"))}Reflect.deleteProperty(this.promisesByID,t)}}destroy(){for(const{promise:e,timeoutId:t}of Object.values(this.promisesByID))clearTimeout(t),e.reject(new Error("IPC destroyed"));this.promisesByID={},this.receiversByName={}}},R=class{ipc;sidebar;targetOrigin;constructor(e,t,i="*"){this.sidebar=e||{},this.targetOrigin=i,this.ipc=new C(r=>{window.parent.postMessage(r,this.targetOrigin)},t),window.addEventListener("message",this.handleMessage),this.registerReceivers()}handleMessage=e=>{const t=globalThis.window.location.origin,i=this.targetOrigin;e.origin!==t&&(i!=="*"&&e.origin!==i||e.data&&typeof e.data=="object"&&this.ipc.handleMessage(e.data))};registerReceivers(){if(this.sidebar.onPluginStatusChange){const e=this.sidebar.onPluginStatusChange;this.ipc.receive("onPluginStatusChange",async t=>{await e(t)})}if(this.sidebar.activateAgenticIssue){const e=this.sidebar.activateAgenticIssue;this.ipc.receive("activateAgenticIssue",async t=>{await e(t)})}if(this.sidebar.invalidateAgenticIssue){const e=this.sidebar.invalidateAgenticIssue;this.ipc.receive("invalidateAgenticIssue",async t=>{await e(t)})}if(this.sidebar.applyIntegrationSettings){const e=this.sidebar.applyIntegrationSettings;this.ipc.receive("applyIntegrationSettings",async t=>{await e(t)})}if(this.sidebar.getIntegrationSettings){const e=this.sidebar.getIntegrationSettings;this.ipc.receive("getIntegrationSettings",async()=>await e())}}async getInitConfig(){return await this.ipc.call("getInitConfig")}async getContent(e){return this.ipc.callWithOptions("getContent",e??{})}async getSelectedContent(e){return this.ipc.callWithOptions("getSelectedContent",e??{})}async replaceContent(e,t){await this.ipc.call("replaceContent",e,t)}async selectContent(e){await this.ipc.call("selectContent",e)}async showDialog(e,t,i,r){await this.ipc.call("showDialog",e,t,i,r)}async closeDialog(){await this.ipc.call("closeDialog")}async replaceMultipleContents(e){await this.ipc.call("replaceMultipleContents",e)}async onAgenticAgentResults(e,t){await this.ipc.call("onAgenticAgentResults",e,t)}async onAgenticStreamComplete(){await this.ipc.call("onAgenticStreamComplete")}async openAuthUrl(e){await this.ipc.call("openAuthUrl",e)}async onIntegrationSettingsChange(e,t){await this.ipc.call("onIntegrationSettingsChange",e,t)}configure(e){this.ipc.configure(e)}setTargetOrigin(e){if(!e||typeof e!="string")throw new Error("Invalid targetOrigin: must be a non-empty string");try{const t=new URL(e);if(!["http:","https:"].includes(t.protocol)||!t.host)throw new Error("Invalid targetOrigin: protocol must be http or https and must have a host")}catch{throw new Error("Invalid targetOrigin: must be a valid origin (e.g., https://example.com)")}this.targetOrigin=e}getTargetOrigin(){return this.targetOrigin}destroy(){window.removeEventListener("message",this.handleMessage),this.ipc.destroy()}},Q=class{ipcAdapter;constructor(e,t,i){this.ipcAdapter=new R(e,t,i)}destroy(){this.ipcAdapter.destroy()}async getInitConfig(){return await this.ipcAdapter.getInitConfig()}async getContent(e){return await this.ipcAdapter.getContent(e)}async getSelectedContent(e){return await this.ipcAdapter.getSelectedContent(e)}async replaceContent(e,t){await this.ipcAdapter.replaceContent(e,t)}async selectContent(e){await this.ipcAdapter.selectContent(e)}async showDialog(e,t,i,r){await this.ipcAdapter.showDialog(e,t,i,r)}async closeDialog(){await this.ipcAdapter.closeDialog()}async replaceMultipleContents(e){await this.ipcAdapter.replaceMultipleContents(e)}onAgenticAgentResults(e,t){return this.ipcAdapter.onAgenticAgentResults(e,t)}onAgenticStreamComplete(){return this.ipcAdapter.onAgenticStreamComplete()}openAuthUrl(e){return this.ipcAdapter.openAuthUrl(e)}onIntegrationSettingsChange(e,t){return this.ipcAdapter.onIntegrationSettingsChange(e,t)}configure(e){this.ipcAdapter.configure(e)}setTargetOrigin(e){this.ipcAdapter.setTargetOrigin(e)}getTargetOrigin(){return this.ipcAdapter.getTargetOrigin()}},_=class{ipc;plugin;iframe;window;targetOrigin;constructor(e,t,i,r,o="*"){this.plugin=e,this.iframe=t,this.window=i??window,this.targetOrigin=o,this.ipc=new C(a=>{this.iframe.contentWindow?.postMessage(a,this.targetOrigin)},r),this.window.addEventListener("message",this.handleMessage,!1),this.registerReceivers()}handleMessage=e=>{const t=this.window.location.origin,i=this.targetOrigin;e.origin!==t&&(i!=="*"&&e.origin!==i||e.data&&typeof e.data=="object"&&this.ipc.handleMessage(e.data))};registerReceivers(){if(this.ipc.receive("getInitConfig",async()=>await this.plugin.getInitConfig()),this.ipc.receive("getContent",async()=>await this.plugin.getContent()),this.ipc.receive("getSelectedContent",async()=>await this.plugin.getSelectedContent()),this.ipc.receive("replaceContent",async(e,t)=>{await this.plugin.replaceContent(e,t)}),this.ipc.receive("selectContent",async e=>{await this.plugin.selectContent(e)}),this.ipc.receive("showDialog",async(e,t,i,r)=>{await this.plugin.showDialog(e,t,i,r)}),this.ipc.receive("closeDialog",async()=>{await this.plugin.closeDialog()}),this.ipc.receive("replaceMultipleContents",async e=>{await this.plugin.replaceMultipleContents(e)}),this.ipc.receive("onAgenticAgentResults",async(e,t)=>{if(!Array.isArray(t))return;const i=this.plugin.onAgenticAgentResults;i&&await i(e,t)}),this.ipc.receive("onAgenticStreamComplete",async()=>{const e=this.plugin.onAgenticStreamComplete;e&&await e()}),this.plugin.openAuthUrl){const e=this.plugin.openAuthUrl;this.ipc.receive("openAuthUrl",async t=>{await e(t)})}if(this.plugin.onIntegrationSettingsChange){const e=this.plugin.onIntegrationSettingsChange;this.ipc.receive("onIntegrationSettingsChange",async(t,i)=>{await e(t,i)})}}async activateAgenticIssue(e){await this.ipc.call("activateAgenticIssue",e)}async invalidateAgenticIssue(e){await this.ipc.call("invalidateAgenticIssue",e)}async notifyPluginStatus(e){await this.ipc.call("onPluginStatusChange",e)}async applyIntegrationSettings(e){await this.ipc.call("applyIntegrationSettings",e)}async getIntegrationSettings(){return await this.ipc.call("getIntegrationSettings")}configure(e){this.ipc.configure(e)}destroy(){this.window.removeEventListener("message",this.handleMessage),this.ipc.destroy()}},D=class{ipcAdapter;constructor(e,t,i){this.ipcAdapter=new _(e,t,i?.win,i?.config,i?.targetOrigin)}destroy(){this.ipcAdapter.destroy()}async notifyPluginStatus(e){await this.ipcAdapter.notifyPluginStatus(e)}async activateAgenticIssue(e){await this.ipcAdapter.activateAgenticIssue(e)}async invalidateAgenticIssue(e){await this.ipcAdapter.invalidateAgenticIssue(e)}async applyIntegrationSettings(e){await this.ipcAdapter.applyIntegrationSettings(e)}async getIntegrationSettings(){return await this.ipcAdapter.getIntegrationSettings()}configure(e){this.ipcAdapter.configure(e)}},ee=`
1
+ (function(n,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(n=typeof globalThis<"u"?globalThis:n||self,d(n.main={}))})(this,function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});var d=(function(e){return e.TEXT_PLAIN="text/plain",e.TEXT_MARKDOWN="text/markdown",e.TEXT_HTML="text/html",e.APPLICATION_DITA_XML="application/dita+xml",e})({}),X=[d.TEXT_PLAIN,d.TEXT_MARKDOWN,d.TEXT_HTML,d.APPLICATION_DITA_XML],V={integrationName:"unknown",integrationVersion:"unknown",integrationId:"markupai-sidebar-app",hideBanner:!1,dialogClosingScript:void 0,useCheckPreviewDialog:!1,supportCheckSelection:!0},K=e=>typeof e!="object"||e===null?!1:Array.isArray(e.fields),q=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id!="string"||t.id.length===0||typeof t.label!="string"?!1:t.type==="boolean"?typeof t.default=="boolean":t.type==="enum"?typeof t.default!="string"||!Array.isArray(t.options)||t.options.length===0?!1:t.options.every(i=>{if(typeof i!="object"||i===null)return!1;const r=i;return typeof r.value=="string"&&typeof r.label=="string"}):!1},A=class J extends Error{name="TextLookupError";constructor(t){super(t),Object.setPrototypeOf(this,J.prototype)}};function Z(e){return e instanceof A}var v={TextLookupError:e=>new A(e)};function E(e){const t=e.message??"",i=e.name,r=typeof i=="string"&&i in v?v[i]:void 0;return r?r(t,e):Object.assign(new Error(t),i?{name:i}:{})}var P=()=>{},T=class{_promise;[Symbol.toStringTag]="Promise";resolve=P;reject=P;constructor(){this._promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}},R={timeout:1e4},C=class{promisesByID={};receiversByName={};currentID=0;config;postMessage;constructor(e,t){this.postMessage=e,this.config={...R,...t}}configure(e){this.config={...this.config,...e}}call(e,...t){return this.callWithOptions(e,{},...t)}callWithOptions(e,t,...i){const r=this.currentID++,o=new T,a=t.timeout??this.config.timeout,s=setTimeout(()=>{if(r in this.promisesByID){const c=new Error(`IPC call timeout: "${e}" did not respond within ${String(a)}ms`);o.reject(c),Reflect.deleteProperty(this.promisesByID,r)}},a);this.promisesByID[r]={promise:o,timeoutId:s};const l={type:"call",id:r,name:e,data:i};return this.postMessage(l),o}receive(e,t){this.receiversByName[e]=t}ignore(e){delete this.receiversByName[e]}async handleMessage(e){switch(e.type){case"call":await this.handleCall(e);break;case"response":this.handleResponse(e);break;case"error":this.handleError(e);break;default:}}async handleCall(e){const{id:t,name:i,data:r}=e;if(i in this.receiversByName){const o=this.receiversByName[i];try{if(!Array.isArray(r))throw new Error(`IPC: Expected array of arguments but got ${typeof r}`);const a=await o(...r),s={type:"response",id:t,name:i,data:a};this.postMessage(s)}catch(a){let s=JSON.stringify(a,Object.getOwnPropertyNames(a));const l=JSON.parse(s);(l.message===void 0||l.message==="")&&(s=JSON.stringify({message:a instanceof Error?a.message:String(a),name:a instanceof Error?a.name:void 0}));const c={type:"error",id:t,name:i,errorJSON:s};this.postMessage(c)}}else{const o=new Error(`No receiver registered for: ${i}`),a={type:"error",id:t,name:i,errorJSON:JSON.stringify({message:o.message,name:o.name})};this.postMessage(a)}}handleResponse(e){const{id:t}=e;if(t in this.promisesByID){const{promise:i,timeoutId:r}=this.promisesByID[t];clearTimeout(r),i.resolve(e.data),Reflect.deleteProperty(this.promisesByID,t)}}handleError(e){const{id:t,errorJSON:i}=e;if(t in this.promisesByID){const{promise:r,timeoutId:o}=this.promisesByID[t];clearTimeout(o);try{const a=E(JSON.parse(i));r.reject(a)}catch{r.reject(new Error("Failed to parse error from IPC"))}Reflect.deleteProperty(this.promisesByID,t)}}destroy(){for(const{promise:e,timeoutId:t}of Object.values(this.promisesByID))clearTimeout(t),e.reject(new Error("IPC destroyed"));this.promisesByID={},this.receiversByName={}}},O=class{ipc;sidebar;targetOrigin;constructor(e,t,i="*"){this.sidebar=e||{},this.targetOrigin=i,this.ipc=new C(r=>{window.parent.postMessage(r,this.targetOrigin)},t),window.addEventListener("message",this.handleMessage),this.registerReceivers()}handleMessage=e=>{const t=globalThis.window.location.origin,i=this.targetOrigin;e.origin!==t&&(i!=="*"&&e.origin!==i||e.data&&typeof e.data=="object"&&this.ipc.handleMessage(e.data))};registerReceivers(){if(this.sidebar.onPluginStatusChange){const e=this.sidebar.onPluginStatusChange;this.ipc.receive("onPluginStatusChange",async t=>{await e(t)})}if(this.sidebar.activateAgenticIssue){const e=this.sidebar.activateAgenticIssue;this.ipc.receive("activateAgenticIssue",async t=>{await e(t)})}if(this.sidebar.invalidateAgenticIssue){const e=this.sidebar.invalidateAgenticIssue;this.ipc.receive("invalidateAgenticIssue",async t=>{await e(t)})}if(this.sidebar.markAgenticIssueResolved){const e=this.sidebar.markAgenticIssueResolved;this.ipc.receive("markAgenticIssueResolved",async t=>{await e(t)})}if(this.sidebar.restoreAgenticIssue){const e=this.sidebar.restoreAgenticIssue;this.ipc.receive("restoreAgenticIssue",async t=>{await e(t)})}if(this.sidebar.applyIntegrationSettings){const e=this.sidebar.applyIntegrationSettings;this.ipc.receive("applyIntegrationSettings",async t=>{await e(t)})}if(this.sidebar.getIntegrationSettings){const e=this.sidebar.getIntegrationSettings;this.ipc.receive("getIntegrationSettings",async()=>await e())}}async getInitConfig(){return await this.ipc.call("getInitConfig")}async getContent(e){return this.ipc.callWithOptions("getContent",e??{})}async getSelectedContent(e){return this.ipc.callWithOptions("getSelectedContent",e??{})}async replaceContent(e,t){await this.ipc.call("replaceContent",e,t)}async selectContent(e){await this.ipc.call("selectContent",e)}async showDialog(e,t,i,r){await this.ipc.call("showDialog",e,t,i,r)}async closeDialog(){await this.ipc.call("closeDialog")}async replaceMultipleContents(e){await this.ipc.call("replaceMultipleContents",e)}async onAgenticAgentResults(e,t){await this.ipc.call("onAgenticAgentResults",e,t)}async onAgenticStreamComplete(){await this.ipc.call("onAgenticStreamComplete")}async onAgenticIssueStatusChanged(e,t,i){await this.ipc.call("onAgenticIssueStatusChanged",e,t,i)}async openAuthUrl(e){await this.ipc.call("openAuthUrl",e)}async onIntegrationSettingsChange(e,t){await this.ipc.call("onIntegrationSettingsChange",e,t)}configure(e){this.ipc.configure(e)}setTargetOrigin(e){if(!e||typeof e!="string")throw new Error("Invalid targetOrigin: must be a non-empty string");try{const t=new URL(e);if(!["http:","https:"].includes(t.protocol)||!t.host)throw new Error("Invalid targetOrigin: protocol must be http or https and must have a host")}catch{throw new Error("Invalid targetOrigin: must be a valid origin (e.g., https://example.com)")}this.targetOrigin=e}getTargetOrigin(){return this.targetOrigin}destroy(){window.removeEventListener("message",this.handleMessage),this.ipc.destroy()}},Q=class{ipcAdapter;constructor(e,t,i){this.ipcAdapter=new O(e,t,i)}destroy(){this.ipcAdapter.destroy()}async getInitConfig(){return await this.ipcAdapter.getInitConfig()}async getContent(e){return await this.ipcAdapter.getContent(e)}async getSelectedContent(e){return await this.ipcAdapter.getSelectedContent(e)}async replaceContent(e,t){await this.ipcAdapter.replaceContent(e,t)}async selectContent(e){await this.ipcAdapter.selectContent(e)}async showDialog(e,t,i,r){await this.ipcAdapter.showDialog(e,t,i,r)}async closeDialog(){await this.ipcAdapter.closeDialog()}async replaceMultipleContents(e){await this.ipcAdapter.replaceMultipleContents(e)}onAgenticAgentResults(e,t){return this.ipcAdapter.onAgenticAgentResults(e,t)}onAgenticStreamComplete(){return this.ipcAdapter.onAgenticStreamComplete()}onAgenticIssueStatusChanged(e,t,i){return this.ipcAdapter.onAgenticIssueStatusChanged(e,t,i)}openAuthUrl(e){return this.ipcAdapter.openAuthUrl(e)}onIntegrationSettingsChange(e,t){return this.ipcAdapter.onIntegrationSettingsChange(e,t)}configure(e){this.ipcAdapter.configure(e)}setTargetOrigin(e){this.ipcAdapter.setTargetOrigin(e)}getTargetOrigin(){return this.ipcAdapter.getTargetOrigin()}},_=class{ipc;plugin;iframe;window;targetOrigin;constructor(e,t,i,r,o="*"){this.plugin=e,this.iframe=t,this.window=i??window,this.targetOrigin=o,this.ipc=new C(a=>{this.iframe.contentWindow?.postMessage(a,this.targetOrigin)},r),this.window.addEventListener("message",this.handleMessage,!1),this.registerReceivers()}handleMessage=e=>{const t=this.window.location.origin,i=this.targetOrigin;e.origin!==t&&(i!=="*"&&e.origin!==i||e.data&&typeof e.data=="object"&&this.ipc.handleMessage(e.data))};registerReceivers(){if(this.ipc.receive("getInitConfig",async()=>await this.plugin.getInitConfig()),this.ipc.receive("getContent",async()=>await this.plugin.getContent()),this.ipc.receive("getSelectedContent",async()=>await this.plugin.getSelectedContent()),this.ipc.receive("replaceContent",async(e,t)=>{await this.plugin.replaceContent(e,t)}),this.ipc.receive("selectContent",async e=>{await this.plugin.selectContent(e)}),this.ipc.receive("showDialog",async(e,t,i,r)=>{await this.plugin.showDialog(e,t,i,r)}),this.ipc.receive("closeDialog",async()=>{await this.plugin.closeDialog()}),this.ipc.receive("replaceMultipleContents",async e=>{await this.plugin.replaceMultipleContents(e)}),this.ipc.receive("onAgenticAgentResults",async(e,t)=>{if(!Array.isArray(t))return;const i=this.plugin.onAgenticAgentResults;i&&await i(e,t)}),this.ipc.receive("onAgenticStreamComplete",async()=>{const e=this.plugin.onAgenticStreamComplete;e&&await e()}),this.ipc.receive("onAgenticIssueStatusChanged",async(e,t,i)=>{const r=this.plugin.onAgenticIssueStatusChanged;if(r&&!(t!=="active"&&t!=="resolved"&&t!=="dismissed"||i!=="user"&&i!=="host"))try{await r(e,t,i)}catch{}}),this.plugin.openAuthUrl){const e=this.plugin.openAuthUrl;this.ipc.receive("openAuthUrl",async t=>{await e(t)})}if(this.plugin.onIntegrationSettingsChange){const e=this.plugin.onIntegrationSettingsChange;this.ipc.receive("onIntegrationSettingsChange",async(t,i)=>{await e(t,i)})}}async activateAgenticIssue(e){await this.ipc.call("activateAgenticIssue",e)}async invalidateAgenticIssue(e){await this.ipc.call("invalidateAgenticIssue",e)}async markAgenticIssueResolved(e){await this.ipc.call("markAgenticIssueResolved",e)}async restoreAgenticIssue(e){await this.ipc.call("restoreAgenticIssue",e)}async notifyPluginStatus(e){await this.ipc.call("onPluginStatusChange",e)}async applyIntegrationSettings(e){await this.ipc.call("applyIntegrationSettings",e)}async getIntegrationSettings(){return await this.ipc.call("getIntegrationSettings")}configure(e){this.ipc.configure(e)}destroy(){this.window.removeEventListener("message",this.handleMessage),this.ipc.destroy()}},D=class{ipcAdapter;constructor(e,t,i){this.ipcAdapter=new _(e,t,i?.win,i?.config,i?.targetOrigin)}destroy(){this.ipcAdapter.destroy()}async notifyPluginStatus(e){await this.ipcAdapter.notifyPluginStatus(e)}async activateAgenticIssue(e){await this.ipcAdapter.activateAgenticIssue(e)}async invalidateAgenticIssue(e){await this.ipcAdapter.invalidateAgenticIssue(e)}async markAgenticIssueResolved(e){await this.ipcAdapter.markAgenticIssueResolved(e)}async restoreAgenticIssue(e){await this.ipcAdapter.restoreAgenticIssue(e)}async applyIntegrationSettings(e){await this.ipcAdapter.applyIntegrationSettings(e)}async getIntegrationSettings(){return await this.ipcAdapter.getIntegrationSettings()}configure(e){this.ipcAdapter.configure(e)}},ee=`
2
2
  <div class="sidebar-load-overlay-card">
3
3
  <div class="sidebar-load-overlay-title">Sidebar failed to load</div>
4
4
  <div class="sidebar-load-overlay-description">Check your connection or try again.</div>
@@ -111,7 +111,7 @@
111
111
  box-shadow: 0 0 0 2px
112
112
  color-mix(in srgb, var(--accent, #ef4640) 60%, transparent);
113
113
  }
114
- `,re=e=>{const t=e??document;if(t.getElementById(L))return;const i=t.createElement("style");i.id=L,i.textContent=ie,t.head.appendChild(i)},ne=8e3,ae=12e3,M=(e,t,i={})=>{re(e.ownerDocument);const{sidebarUrl:r,targetOrigin:o,timeoutMs:a=ne,retryIntervalMs:s=ae,messageListenWindow:l}=i,c=l??(typeof globalThis.window<"u"?globalThis.window:globalThis),h=()=>r??t.src,Ae=()=>{if(o)return o;try{return new URL(h()).origin}catch{return"*"}},{overlay:w,button:x}=te();e.appendChild(w);let f=!1,m,p;const u=g=>{w.style.display=g?"flex":"none"};u(!1);const y=()=>{m&&(globalThis.clearTimeout(m),m=void 0)},j=()=>{y(),m=globalThis.setTimeout(()=>{f||u(!0)},a)},$=g=>{const I=g?.preserveOverlay??!0;f=!1,I||u(!1),t.src=h(),j()},Ce=()=>{p||s<=0||(p=globalThis.setInterval(()=>{f||$({preserveOverlay:!0})},s))},W=()=>{p&&(globalThis.clearInterval(p),p=void 0)},G=g=>{if(!t.contentWindow||g.source!==t.contentWindow)return;const I=Ae();I!=="*"&&g.origin!==I||(f=!0,y(),W(),u(!1))},Y=()=>{y(),u(!0)},z=()=>{$()};return x.addEventListener("click",z),t.addEventListener("error",Y),c.addEventListener("message",G),j(),Ce(),()=>{y(),W(),t.removeEventListener("error",Y),c.removeEventListener("message",G),x.removeEventListener("click",z),w.remove()}},N="Markup AI Sidebar",H="clipboard-read; clipboard-write",oe="markupai.sidebarNextGen.overrideUrl",se="https://sidebar.markup.ai/";function le(e){try{return"localStorage"in globalThis&&globalThis.localStorage.getItem("markupai.sidebarNextGen.overrideUrl")?.trim()||e}catch{return e}}var k="markupai.sidebarNextGen.authOverride";function ce(e,t){if(!t)return e;try{if(!("localStorage"in globalThis))return e;const i=globalThis.localStorage.getItem(k)?.trim();if(!i)return e;const r=JSON.parse(i);return r!==null&&typeof r=="object"&&"type"in r&&(r.type==="mediation"||r.type==="popup")?r:e}catch{return e}}function de(e,t){try{return new URL(e).origin}catch(i){return t?.onInvalidUrl?.(e,i),"*"}}function ge(e,t="Expected SidebarAdapter from createSidebarHost"){if(e.adapter===null)throw new Error(t)}function pe(e){const{iframe:t,iframeMount:i}=e;if(t!==void 0&&i!==void 0)throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");if(t!==void 0)return{iframe:t,removeMountedIframe:null};if(i===void 0)throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");const{container:r,src:o,allow:a=H}=i,s=document.createElement("iframe");return s.title=N,s.src=o,a&&s.setAttribute("allow",a),r.appendChild(s),{iframe:s,removeMountedIframe:()=>{s.remove()}}}function ue(e){const{plugin:t,loadOverlayContainer:i,loadOverlayOptions:r,adapterOptions:o}=e,{iframe:a,removeMountedIframe:s}=pe(e),l=i!==void 0?M(i,a,r??{}):null;if(t!==void 0){const c=new D(t,a,o);return{iframe:a,adapter:c,destroy:()=>{l?.(),c.destroy(),s?.()}}}return{iframe:a,adapter:null,destroy:()=>{l?.(),s?.()}}}var S="sidebarContainer",U="markupai-sidebar-host-shell-styles";function B(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);if(!/^[a-zA-Z_][\w-]*$/.test(e))throw new Error(`sidebar host shell: containerId must match /^[a-zA-Z_][\\w-]*$/ when CSS.escape is unavailable (got ${JSON.stringify(e)})`);return e}function b(e=S){const t=B(e);return`
114
+ `,re=e=>{const t=e??document;if(t.getElementById(L))return;const i=t.createElement("style");i.id=L,i.textContent=ie,t.head.appendChild(i)},ne=8e3,ae=12e3,M=(e,t,i={})=>{re(e.ownerDocument);const{sidebarUrl:r,targetOrigin:o,timeoutMs:a=ne,retryIntervalMs:s=ae,messageListenWindow:l}=i,c=l??(typeof globalThis.window<"u"?globalThis.window:globalThis),h=()=>r??t.src,ve=()=>{if(o)return o;try{return new URL(h()).origin}catch{return"*"}},{overlay:w,button:x}=te();e.appendChild(w);let f=!1,I,p;const u=g=>{w.style.display=g?"flex":"none"};u(!1);const m=()=>{I&&(globalThis.clearTimeout(I),I=void 0)},j=()=>{m(),I=globalThis.setTimeout(()=>{f||u(!0)},a)},$=g=>{const y=g?.preserveOverlay??!0;f=!1,y||u(!1),t.src=h(),j()},Ce=()=>{p||s<=0||(p=globalThis.setInterval(()=>{f||$({preserveOverlay:!0})},s))},W=()=>{p&&(globalThis.clearInterval(p),p=void 0)},G=g=>{if(!t.contentWindow||g.source!==t.contentWindow)return;const y=ve();y!=="*"&&g.origin!==y||(f=!0,m(),W(),u(!1))},Y=()=>{m(),u(!0)},z=()=>{$()};return x.addEventListener("click",z),t.addEventListener("error",Y),c.addEventListener("message",G),j(),Ce(),()=>{m(),W(),t.removeEventListener("error",Y),c.removeEventListener("message",G),x.removeEventListener("click",z),w.remove()}},k="Markup AI Sidebar",N="clipboard-read; clipboard-write",oe="markupai.sidebarNextGen.overrideUrl",se="https://sidebar.markup.ai/";function le(e){try{return"localStorage"in globalThis&&globalThis.localStorage.getItem("markupai.sidebarNextGen.overrideUrl")?.trim()||e}catch{return e}}var H="markupai.sidebarNextGen.authOverride";function ce(e,t){if(!t)return e;try{if(!("localStorage"in globalThis))return e;const i=globalThis.localStorage.getItem(H)?.trim();if(!i)return e;const r=JSON.parse(i);return r!==null&&typeof r=="object"&&"type"in r&&(r.type==="mediation"||r.type==="popup")?r:e}catch{return e}}function de(e,t){try{return new URL(e).origin}catch(i){return t?.onInvalidUrl?.(e,i),"*"}}function ge(e,t="Expected SidebarAdapter from createSidebarHost"){if(e.adapter===null)throw new Error(t)}function pe(e){const{iframe:t,iframeMount:i}=e;if(t!==void 0&&i!==void 0)throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");if(t!==void 0)return{iframe:t,removeMountedIframe:null};if(i===void 0)throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");const{container:r,src:o,allow:a=N}=i,s=document.createElement("iframe");return s.title=k,s.src=o,a&&s.setAttribute("allow",a),r.appendChild(s),{iframe:s,removeMountedIframe:()=>{s.remove()}}}function ue(e){const{plugin:t,loadOverlayContainer:i,loadOverlayOptions:r,adapterOptions:o}=e,{iframe:a,removeMountedIframe:s}=pe(e),l=i!==void 0?M(i,a,r??{}):null;if(t!==void 0){const c=new D(t,a,o);return{iframe:a,adapter:c,destroy:()=>{l?.(),c.destroy(),s?.()}}}return{iframe:a,adapter:null,destroy:()=>{l?.(),s?.()}}}var S="sidebarContainer",U="markupai-sidebar-host-shell-styles";function B(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);if(!/^[a-zA-Z_][\w-]*$/.test(e))throw new Error(`sidebar host shell: containerId must match /^[a-zA-Z_][\\w-]*$/ when CSS.escape is unavailable (got ${JSON.stringify(e)})`);return e}function b(e=S){const t=B(e);return`
115
115
  html {
116
116
  height: 100%;
117
117
  }
@@ -133,17 +133,17 @@ body {
133
133
  margin: 0;
134
134
  display: block;
135
135
  }
136
- `.trim()}var he=b();function fe(e){return e instanceof Document?e:e.ownerDocument}function me(e,t,i){if(!t||e.getElementById(U))return;const r=e.createElement("style");r.id=U,r.textContent=b(i),e.head.appendChild(r)}function ye(e){const{root:t=typeof document<"u"?document:void 0,containerId:i=S,includeDefaultStyles:r=!0}=e??{};if(t===void 0)throw new Error("ensureSidebarHostShell: no document — pass `root` in non-browser environments");const o=fe(t);me(o,r,i);const a=t instanceof Document?o.getElementById(i):t.querySelector(`#${B(i)}`);if(a instanceof HTMLElement&&(t instanceof Document||t.contains(a)))return a;if(!(t instanceof Document)){const l=o.createElement("div");return l.id=i,t.appendChild(l),l}const s=o.createElement("div");return s.id=i,o.body.appendChild(s),s}function F(){return' <meta name="viewport" content="width=device-width, initial-scale=1.0" />'}function Ie(e){const{title:t="Markup AI Sidebar",headInnerHtml:i="",includePluginHostHead:r=!1,bodyScriptsHtml:o,htmlLang:a="en",htmlAttrs:s=`lang="${a}" style="height:100%"`,bodyAttrs:l='style="height:100%;margin:0"'}=e,c=[r?F():"",i].filter(h=>h.trim().length>0).join(`
136
+ `.trim()}var he=b();function fe(e){return e instanceof Document?e:e.ownerDocument}function Ie(e,t,i){if(!t||e.getElementById(U))return;const r=e.createElement("style");r.id=U,r.textContent=b(i),e.head.appendChild(r)}function me(e){const{root:t=typeof document<"u"?document:void 0,containerId:i=S,includeDefaultStyles:r=!0}=e??{};if(t===void 0)throw new Error("ensureSidebarHostShell: no document — pass `root` in non-browser environments");const o=fe(t);Ie(o,r,i);const a=t instanceof Document?o.getElementById(i):t.querySelector(`#${B(i)}`);if(a instanceof HTMLElement&&(t instanceof Document||t.contains(a)))return a;if(!(t instanceof Document)){const l=o.createElement("div");return l.id=i,t.appendChild(l),l}const s=o.createElement("div");return s.id=i,o.body.appendChild(s),s}function F(){return' <meta name="viewport" content="width=device-width, initial-scale=1.0" />'}function ye(e){const{title:t="Markup AI Sidebar",headInnerHtml:i="",includePluginHostHead:r=!1,bodyScriptsHtml:o,htmlLang:a="en",htmlAttrs:s=`lang="${a}" style="height:100%"`,bodyAttrs:l='style="height:100%;margin:0"'}=e,c=[r?F():"",i].filter(h=>h.trim().length>0).join(`
137
137
  `);return`<!DOCTYPE html>
138
138
  <html ${s}>
139
139
  <head>
140
140
  <base target="_top" />
141
141
  <meta charset="UTF-8" />
142
- <title>${ve(t)}</title>${c?`
142
+ <title>${Ae(t)}</title>${c?`
143
143
  ${c}`:""}
144
144
  </head>
145
145
  <body ${l}>
146
146
  ${o}
147
147
  </body>
148
148
  </html>
149
- `}function ve(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}n.AUTH_CONFIG_OVERRIDE_STORAGE_KEY=k,n.DEFAULT_IPC_CONFIG=O,n.DEFAULT_SIDEBAR_CONFIG=V,n.DeferredPromise=T,n.IPCCore=C,n.MimeType=d,n.PluginAdapter=Q,n.PluginIPCAdapter=R,n.SIDEBAR_DEFAULT_PRODUCTION_BASE_URL=se,n.SIDEBAR_HOST_CONTAINER_ID=S,n.SIDEBAR_HOST_SHELL_CSS=he,n.SIDEBAR_IFRAME_DEFAULT_ALLOW=H,n.SIDEBAR_IFRAME_DEFAULT_TITLE=N,n.SIDEBAR_URL_OVERRIDE_STORAGE_KEY=oe,n.SidebarAdapter=D,n.SidebarIPCAdapter=_,n.TEXT_MIME_TYPES=X,n.TextLookupError=v,n.assertSidebarHostAdapter=ge,n.buildSidebarHostHtmlDocument=Ie,n.buildSidebarHostShellCss=b,n.buildSidebarPluginHostHeadInnerHtml=F,n.createSidebarHost=ue,n.ensureSidebarHostShell=ye,n.getAuthConfigWithOverride=ce,n.getSidebarBaseUrlWithOverride=le,n.ipcErrorReconstructors=A,n.isIntegrationSettingField=q,n.isIntegrationSettingsSchema=K,n.isTextLookupError=Z,n.reconstructError=E,n.setupSidebarLoadOverlay=M,n.sidebarPostMessageTargetOrigin=de});
149
+ `}function Ae(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}n.AUTH_CONFIG_OVERRIDE_STORAGE_KEY=H,n.DEFAULT_IPC_CONFIG=R,n.DEFAULT_SIDEBAR_CONFIG=V,n.DeferredPromise=T,n.IPCCore=C,n.MimeType=d,n.PluginAdapter=Q,n.PluginIPCAdapter=O,n.SIDEBAR_DEFAULT_PRODUCTION_BASE_URL=se,n.SIDEBAR_HOST_CONTAINER_ID=S,n.SIDEBAR_HOST_SHELL_CSS=he,n.SIDEBAR_IFRAME_DEFAULT_ALLOW=N,n.SIDEBAR_IFRAME_DEFAULT_TITLE=k,n.SIDEBAR_URL_OVERRIDE_STORAGE_KEY=oe,n.SidebarAdapter=D,n.SidebarIPCAdapter=_,n.TEXT_MIME_TYPES=X,n.TextLookupError=A,n.assertSidebarHostAdapter=ge,n.buildSidebarHostHtmlDocument=ye,n.buildSidebarHostShellCss=b,n.buildSidebarPluginHostHeadInnerHtml=F,n.createSidebarHost=ue,n.ensureSidebarHostShell=me,n.getAuthConfigWithOverride=ce,n.getSidebarBaseUrlWithOverride=le,n.ipcErrorReconstructors=v,n.isIntegrationSettingField=q,n.isIntegrationSettingsSchema=K,n.isTextLookupError=Z,n.reconstructError=E,n.setupSidebarLoadOverlay=M,n.sidebarPostMessageTargetOrigin=de});
@@ -67,6 +67,19 @@ export interface PluginInterface {
67
67
  * Called when the agentic stream has finished (all agents done or completion/error event).
68
68
  */
69
69
  onAgenticStreamComplete?: () => Promise<void>;
70
+ /**
71
+ * Called by the sidebar after every successful status transition for an
72
+ * agentic issue. Fires for transitions driven by sidebar card affordances
73
+ * (`source: "user"`) and by host RPC calls
74
+ * ({@link SidebarInterface.invalidateAgenticIssue},
75
+ * {@link SidebarInterface.markAgenticIssueResolved},
76
+ * {@link SidebarInterface.restoreAgenticIssue}, `source: "host"`).
77
+ *
78
+ * Best-effort: the sidebar tolerates a missing or throwing implementation
79
+ * and does not roll back its own UI on failure. No-op calls (e.g. marking
80
+ * an already-resolved issue) MUST NOT emit a duplicate notification.
81
+ */
82
+ onAgenticIssueStatusChanged?: (issueId: string, status: "active" | "resolved" | "dismissed", source: "user" | "host") => Promise<void>;
70
83
  /**
71
84
  * Open an external URL during an authentication flow (typically the Auth0
72
85
  * `authorizeUrl` returned by the backend-mediated OAuth flow).
@@ -1 +1 @@
1
- {"version":3,"file":"pluginInterface.d.ts","sourceRoot":"","sources":["../../src/types/pluginInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvC;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/C;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;;;;OAKG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;;;OAOG;IACH,UAAU,EAAE,CACV,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,KACX,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB;;;OAGG;IACH,WAAW,EAAE,MAAM,OA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
38
  * Used when the plugin wants to programmatically dismiss an issue (e.g. after replacement).
39
39
  */
40
40
  invalidateAgenticIssue?: (issueId: string) => Promise<void>;
41
+ /**
42
+ * Request the sidebar to mark an open issue as resolved without applying a
43
+ * suggestion. Parallel to {@link invalidateAgenticIssue}; the resulting
44
+ * issue is restorable via {@link restoreAgenticIssue}.
45
+ *
46
+ * Silent no-op for ids that are already resolved, already dismissed, or
47
+ * unknown to the sidebar.
48
+ */
49
+ markAgenticIssueResolved?: (issueId: string) => Promise<void>;
50
+ /**
51
+ * Request the sidebar to transition an issue back to the open state. Routes
52
+ * to the unresolve path for manually-resolved issues and to the undismiss
53
+ * path for dismissed issues.
54
+ *
55
+ * Silent no-op for ids that are already open, resolved via an applied
56
+ * suggestion (which is terminal), or unknown to the sidebar.
57
+ */
58
+ restoreAgenticIssue?: (issueId: string) => Promise<void>;
41
59
  /**
42
60
  * Apply a host-driven patch to the integration-settings form values and/or
43
61
  * per-field UI state. The host calls this to push values and constraints
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarInterface.d.ts","sourceRoot":"","sources":["../../src/types/sidebarInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEnG;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;;;;;;;;;;OAcG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACrE"}
1
+ {"version":3,"file":"sidebarInterface.d.ts","sourceRoot":"","sources":["../../src/types/sidebarInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEnG;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;;;;;;;;;;;OAcG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACrE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markupai/sidebar-adapter",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Adapter package for MarkupAI Sidebar integration",
5
5
  "keywords": [
6
6
  "markupai",