@markupai/sidebar-adapter 1.4.0 → 1.5.1

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.
@@ -174,6 +174,36 @@ export interface SidebarConfig {
174
174
  * entitled agent is never offered while this is `false`.
175
175
  */
176
176
  multiAgent?: boolean;
177
+ /**
178
+ * Whether the sidebar retains check results and issue decisions separately
179
+ * per document, for hosts that let a user switch between several open
180
+ * documents (e.g. a tabbed editor).
181
+ *
182
+ * When `false` or omitted (the default), the sidebar holds a single shared
183
+ * check state regardless of any `onActiveDocumentChanged` calls the host
184
+ * makes. When `true`, switching the active document preserves the
185
+ * outgoing document's results and restores the incoming document's
186
+ * previously retained results, if any.
187
+ */
188
+ multiDocument?: boolean;
189
+ /**
190
+ * The document the host considers active at the moment it responds to
191
+ * `getInitConfig()` — `null` if none is checkable right now, or omitted if
192
+ * the host doesn't know or doesn't support reporting it yet.
193
+ *
194
+ * This is a **one-time snapshot resolved at init**, not a live-updating
195
+ * field — `SidebarConfig` is fetched once per session, so later changes to
196
+ * the active document must still go through `notifyActiveDocumentChanged`.
197
+ * Only meaningful when `multiDocument` is `true`; ignored otherwise.
198
+ *
199
+ * Supplying this lets the sidebar show its "nothing to check" state
200
+ * immediately on load instead of only after a subsequent
201
+ * `notifyActiveDocumentChanged` call. Omit it if the host cannot answer
202
+ * the question at init time — the sidebar falls back to waiting for that
203
+ * later call (or its own passive detection from the first `getContent()`
204
+ * response) exactly as it does today.
205
+ */
206
+ initialActiveDocumentReference?: string | null;
177
207
  /**
178
208
  * How the sidebar should run the Auth0 login flow. When omitted, the sidebar
179
209
  * falls back to heuristic strategy selection (iframe context, secure origin,
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;;GAIG;AACH,oBAAY,QAAQ;IAClB,UAA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C;CACrB"}
@@ -7,13 +7,16 @@ import type { IntegrationSettingsValues, IntegrationSettingsChangeMeta } from ".
7
7
  export interface PluginInterface {
8
8
  /**
9
9
  * Get content from the editor in whatever format the integration supports
10
- * The integration must provide content and documentReference; documentName and mimeType are optional
10
+ * The integration must provide content and documentReference; documentName and mimeType are optional.
11
+ * Compose `documentReference` with the exported `buildDocumentReference(prefix, id)` helper —
12
+ * see {@link ContentInfo.documentReference} for why.
11
13
  * @returns Promise that resolves with content info including documentReference and optional documentName/mimeType
12
14
  */
13
15
  getContent: () => Promise<ContentInfo>;
14
16
  /**
15
17
  * Get selected content from the editor in whatever format the integration supports
16
- * The integration must provide content and documentReference; documentName and mimeType are optional
18
+ * The integration must provide content and documentReference; documentName and mimeType are optional.
19
+ * Same `documentReference` as the whole document — see {@link ContentInfo.documentReference}.
17
20
  * @returns Promise that resolves with content info including documentReference and optional documentName/mimeType
18
21
  */
19
22
  getSelectedContent: () => Promise<ContentInfo>;
@@ -21,17 +24,21 @@ export interface PluginInterface {
21
24
  * Replace content in the editor using document offsets only.
22
25
  * @param suggestion - Replacement text for the span `[range.start, range.end)`
23
26
  * @param range - Half-open document span to replace
27
+ * @param documentReference - The document to apply the edit to. Omitted or
28
+ * `null` means the integration's currently active document.
24
29
  * @returns Promise that resolves when replacement is complete
25
30
  * @throws {TextLookupError} When the requested text cannot be found or located (see ReplaceContentError)
26
31
  */
27
- replaceContent: (suggestion: string, range: ContentRange) => Promise<void>;
32
+ replaceContent: (suggestion: string, range: ContentRange, documentReference?: string | null) => Promise<void>;
28
33
  /**
29
34
  * Select or highlight content in the editor using document character offsets only.
30
35
  * @param range - Half-open document span `[range.start, range.end)` to select (same semantics as `replaceContent`'s `range`)
36
+ * @param documentReference - The document to select within. Omitted or
37
+ * `null` means the integration's currently active document.
31
38
  * @returns Promise that resolves when selection is complete
32
39
  * @throws {TextLookupError} When the requested text cannot be found or located (see SelectContentError)
33
40
  */
34
- selectContent: (range: ContentRange) => Promise<void>;
41
+ selectContent: (range: ContentRange, documentReference?: string | null) => Promise<void>;
35
42
  /**
36
43
  * Show a dialog in the editor.
37
44
  *
@@ -70,12 +77,20 @@ export interface PluginInterface {
70
77
  /**
71
78
  * Called when one agent's results are available during agentic streaming.
72
79
  * Enables the plugin to render underlines or update UI per agent as results arrive.
80
+ *
81
+ * @param documentReference - The document the check was run against (the
82
+ * run's originating document, not necessarily the host's currently active
83
+ * one — a check keeps streaming results after the active document
84
+ * changes). `null` when `multiDocument` is not enabled.
73
85
  */
74
- onAgenticAgentResults?: (agentName: string, issues: AgenticIssuePayload[]) => Promise<void>;
86
+ onAgenticAgentResults?: (agentName: string, issues: AgenticIssuePayload[], documentReference: string | null) => Promise<void>;
75
87
  /**
76
88
  * Called when the agentic stream has finished (all agents done or completion/error event).
89
+ *
90
+ * @param documentReference - The document the check was run against. `null`
91
+ * when `multiDocument` is not enabled. See {@link PluginInterface.onAgenticAgentResults}.
77
92
  */
78
- onAgenticStreamComplete?: () => Promise<void>;
93
+ onAgenticStreamComplete?: (documentReference: string | null) => Promise<void>;
79
94
  /**
80
95
  * Called by the sidebar after every successful status transition for an
81
96
  * agentic issue. Fires for transitions driven by sidebar card affordances
@@ -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,UA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,CAAC,YAAY,EAAE,kBAAkB,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/E;;;;OAIG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAE5C;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,CACtB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAAE,EAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,KAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;;;;;;;;;OAWG;IACH,2BAA2B,CAAC,EAAE,CAC5B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,EAC3C,MAAM,EAAE,MAAM,GAAG,MAAM,KACpB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;;;;;;;;;;OAWG;IACH,2BAA2B,CAAC,EAAE,CAC5B,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE,6BAA6B,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
@@ -35,8 +35,13 @@ export interface SidebarInterface {
35
35
  /**
36
36
  * Request the sidebar to activate (expand and scroll to) the card for the given issue.
37
37
  * Used when the user clicks an underline in the document so the sidebar focuses that issue.
38
+ *
39
+ * @param documentReference - The document the issue belongs to. When it
40
+ * differs from the sidebar's currently displayed document, the sidebar
41
+ * switches to it before activating. Omitted or `null` means the
42
+ * sidebar's currently displayed document (prior behavior).
38
43
  */
39
- activateAgenticIssue?: (issueId: string) => Promise<void>;
44
+ activateAgenticIssue?: (issueId: string, documentReference?: string | null) => Promise<void>;
40
45
  /**
41
46
  * Request the sidebar to invalidate (dismiss) the card for the given issue.
42
47
  * Used when the plugin wants to programmatically dismiss an issue (e.g. after replacement).
@@ -91,5 +96,21 @@ export interface SidebarInterface {
91
96
  * implementation always provides it.
92
97
  */
93
98
  getIntegrationSettings?: () => Promise<IntegrationSettingsSnapshot>;
99
+ /**
100
+ * Notify the sidebar that the user switched which document is active in a
101
+ * multi-document host (e.g. a tabbed editor). Only meaningful when the
102
+ * host's init config sets `multiDocument: true`; the sidebar SHALL ignore
103
+ * this call otherwise.
104
+ *
105
+ * `documentReference` must match the `documentReference` returned in that
106
+ * document's `ContentInfo` — the same value built with
107
+ * `buildDocumentReference(prefix, id)`, not a re-derivation. Pass `null` when there is no checkable
108
+ * document currently active — every tab closed, or the active tab is
109
+ * content the host does not consider checkable — which the sidebar treats
110
+ * as a deliberate signal, not a malformed value. An empty string, by
111
+ * contrast, is ignored as malformed; the sidebar's active document stays
112
+ * whatever it was.
113
+ */
114
+ onActiveDocumentChanged?: (documentReference: string | null) => Promise<void>;
94
115
  }
95
116
  //# sourceMappingURL=sidebarInterface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarInterface.d.ts","sourceRoot":"","sources":["../../src/types/sidebarInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEnG;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,I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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;IAEpE;;;;;;;;;;;;;;OAcG;IACH,uBAAuB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markupai/sidebar-adapter",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "Adapter package for MarkupAI Sidebar integration",
5
5
  "keywords": [
6
6
  "markupai",