@gooddata/sdk-pluggable-application-model 11.42.0-alpha.3 → 11.42.0-alpha.5
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/esm/__version.js +1 -1
- package/esm/hostUi.d.ts +66 -2
- package/esm/hostUi.d.ts.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/mount.d.ts +130 -0
- package/esm/mount.d.ts.map +1 -1
- package/esm/mount.js +83 -0
- package/esm/sdk-pluggable-application-model.d.ts +207 -1
- package/package.json +4 -4
package/esm/__version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
3
|
/** @alpha */
|
|
4
|
-
export const LIB_VERSION = "11.42.0-alpha.
|
|
4
|
+
export const LIB_VERSION = "11.42.0-alpha.5";
|
|
5
5
|
/** @alpha */
|
|
6
6
|
export const LIB_DESCRIPTION = "GoodData SDK model contracts for pluggable applications";
|
|
7
7
|
/** @alpha */
|
package/esm/hostUi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PluggableApplicationRegistryItem } from "@gooddata/sdk-model";
|
|
1
|
+
import { type IGenAIUserContext, type PluggableApplicationRegistryItem } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IAppHeaderOptions } from "./mount.js";
|
|
3
3
|
import { type IPlatformContext } from "./platformContext.js";
|
|
4
4
|
/**
|
|
@@ -44,6 +44,15 @@ export interface IHostUiMountOptions {
|
|
|
44
44
|
* entry instead of pushing a new one.
|
|
45
45
|
*/
|
|
46
46
|
replace: (url: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Reports the host-owned AI assistant chat open-state whenever it changes.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* The host UI owns the single chat instance on hosted routes; the host runtime forwards this
|
|
52
|
+
* open-state to the active pluggable application (via its mount handle) so app-side assistant
|
|
53
|
+
* controls stay aligned with what the user sees.
|
|
54
|
+
*/
|
|
55
|
+
onAiAssistantOpenChange?: (open: boolean) => void;
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
58
|
* Notification dispatched when the host runtime detects that a newer build of the host
|
|
@@ -68,6 +77,61 @@ export interface INewDeploymentAvailableHostUiNotification {
|
|
|
68
77
|
*/
|
|
69
78
|
commitHash: string;
|
|
70
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Notification requesting the host UI to open its AI assistant chat.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* Emitted when the active pluggable application requests the assistant (see
|
|
85
|
+
* `IOpenAiAssistantRequestedEvent`). The host UI owns the single chat instance on
|
|
86
|
+
* hosted-application routes and opens it, optionally seeded with a question and user context.
|
|
87
|
+
*
|
|
88
|
+
* @alpha
|
|
89
|
+
*/
|
|
90
|
+
export interface IOpenAiAssistantHostUiNotification {
|
|
91
|
+
type: "openAiAssistant";
|
|
92
|
+
/**
|
|
93
|
+
* Question to seed the chat with. When omitted, the chat just opens.
|
|
94
|
+
*/
|
|
95
|
+
question?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Context of the user's current location (e.g. the active dashboard), passed to the
|
|
98
|
+
* assistant alongside the seeded question.
|
|
99
|
+
*/
|
|
100
|
+
userContext?: IGenAIUserContext;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Notification requesting the host UI to close its AI assistant chat.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Emitted when the active pluggable application closes the assistant from one of its own controls
|
|
107
|
+
* (see `ICloseAiAssistantRequestedEvent`). The host UI closes its single chat instance.
|
|
108
|
+
*
|
|
109
|
+
* @alpha
|
|
110
|
+
*/
|
|
111
|
+
export interface ICloseAiAssistantHostUiNotification {
|
|
112
|
+
type: "closeAiAssistant";
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Notification informing the host UI of the active application's current AI-assistant tag scope.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* Emitted when the active pluggable application's tag scope changes (see
|
|
119
|
+
* `IAiAssistantContextChangedEvent`). The host UI keeps the latest scope and applies it to its
|
|
120
|
+
* chat so the assistant's object search stays within the same scope the application enforces.
|
|
121
|
+
*
|
|
122
|
+
* @alpha
|
|
123
|
+
*/
|
|
124
|
+
export interface IAiAssistantContextHostUiNotification {
|
|
125
|
+
type: "aiAssistantContext";
|
|
126
|
+
/**
|
|
127
|
+
* Tag identifiers the assistant's object search should be restricted to.
|
|
128
|
+
*/
|
|
129
|
+
includeTags?: string[];
|
|
130
|
+
/**
|
|
131
|
+
* Tag identifiers the assistant's object search should exclude.
|
|
132
|
+
*/
|
|
133
|
+
excludeTags?: string[];
|
|
134
|
+
}
|
|
71
135
|
/**
|
|
72
136
|
* Discriminated union of out-of-band notifications the host runtime can push into the
|
|
73
137
|
* host UI module after mount. Lets the runtime signal events that should affect the UI
|
|
@@ -80,7 +144,7 @@ export interface INewDeploymentAvailableHostUiNotification {
|
|
|
80
144
|
*
|
|
81
145
|
* @alpha
|
|
82
146
|
*/
|
|
83
|
-
export type IHostUiNotification = INewDeploymentAvailableHostUiNotification;
|
|
147
|
+
export type IHostUiNotification = INewDeploymentAvailableHostUiNotification | IOpenAiAssistantHostUiNotification | ICloseAiAssistantHostUiNotification | IAiAssistantContextHostUiNotification;
|
|
84
148
|
/**
|
|
85
149
|
* Handle returned from a host UI mount for lifecycle management.
|
|
86
150
|
*
|
package/esm/hostUi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostUi.d.ts","sourceRoot":"","sources":["../src/hostUi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"hostUi.d.ts","sourceRoot":"","sources":["../src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E,MAAM,EAAE,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GACzB,yCAAyC,GACzC,kCAAkC,GAClC,mCAAmC,GACnC,qCAAqC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,aAAa,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE5C;;;;;OAKG;IACH,kBAAkB,CAAC,CAAC,IAAI,EAAE,gCAAgC,EAAE,GAAG,IAAI,CAAC;IAEpE;;;;;;OAMG;IACH,cAAc,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;;;;;;;OAQG;IACH,YAAY,CAAC,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAAC;IAE3D;;;;;;;;OAQG;IACH,mBAAmB,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAE1D;;;;;;;OAOG;IACH,eAAe,IAAI,WAAW,CAAC;IAE/B;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACpD;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,mBAAmB,KAAK,kBAAkB,CAAC;AAE/E;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,WAAW,CAAC;CACtB"}
|
package/esm/index.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export { DefaultApplicationId } from "./defaultPlatformApplications.js";
|
|
|
7
7
|
export { LIB_VERSION, LIB_DESCRIPTION, LIB_NAME } from "./__version.js";
|
|
8
8
|
export { type EmbeddingMode, type IApiTokenAuthCredentials, type IAuthCredentials, type IContextDeferredAuthCredentials, type IEffectiveSettings, type IJwtAuthCredentials, type IOrganization, type IOrganizationPermissions, type IPlatformContext, type IPlatformContextV1, type IPluggableApplicationNavigation, PantherTier, isPlatformContextV1, isWorkspaceScopedSettings, } from "./platformContext.js";
|
|
9
9
|
export { type ILocale } from "@gooddata/sdk-model";
|
|
10
|
-
export { type IAppHeaderOptions, type IAppInstance, type KnownPluggableAppEventTypeName, type IDocumentTitleChangedEvent, type IPluggableApp, type IPluggableApplicationMountHandle, type IPluggableApplicationMountOptions, type IPluggableAppEvent, type IPluggableAppTelemetryCallbacks, type IReloadPlatformContextRequestedEvent, type ITelemetryEventOptions, documentTitleChanged, isDocumentTitleChangedEvent, isReloadPlatformContextRequestedEvent, type PluggableApplicationMount, PluggableAppEventType, type PluggableAppEventTypeName, reloadPlatformContextRequested, type TelemetryChannel, } from "./mount.js";
|
|
11
|
-
export { type IHostUiModule, type IHostUiMountHandle, type IHostUiMountOptions, type IHostUiNotification, type INewDeploymentAvailableHostUiNotification, type HostUiMount, } from "./hostUi.js";
|
|
10
|
+
export { type IAppHeaderOptions, type IAppInstance, type KnownPluggableAppEventTypeName, type IDocumentTitleChangedEvent, type IOpenAiAssistantRequestedEvent, type ICloseAiAssistantRequestedEvent, type IAiAssistantContextChangedEvent, type IPluggableApp, type IPluggableApplicationMountHandle, type IPluggableApplicationMountOptions, type IPluggableAppEvent, type IPluggableAppTelemetryCallbacks, type IReloadPlatformContextRequestedEvent, type ITelemetryEventOptions, documentTitleChanged, isDocumentTitleChangedEvent, isOpenAiAssistantRequestedEvent, isCloseAiAssistantRequestedEvent, isAiAssistantContextChangedEvent, isReloadPlatformContextRequestedEvent, openAiAssistantRequested, closeAiAssistantRequested, aiAssistantContextChanged, type PluggableApplicationMount, PluggableAppEventType, type PluggableAppEventTypeName, reloadPlatformContextRequested, type TelemetryChannel, } from "./mount.js";
|
|
11
|
+
export { type IHostUiModule, type IHostUiMountHandle, type IHostUiMountOptions, type IHostUiNotification, type INewDeploymentAvailableHostUiNotification, type IOpenAiAssistantHostUiNotification, type ICloseAiAssistantHostUiNotification, type IAiAssistantContextHostUiNotification, type HostUiMount, } from "./hostUi.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,WAAW,EACX,mBAAmB,EACnB,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,qCAAqC,EACrC,KAAK,yBAAyB,EAC9B,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,8BAA8B,EAC9B,KAAK,gBAAgB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,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H,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,yCAAyC,EAC9C,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,KAAK,qCAAqC,EAC1C,KAAK,WAAW,GACnB,MAAM,aAAa,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
export { DefaultApplicationId } from "./defaultPlatformApplications.js";
|
|
9
9
|
export { LIB_VERSION, LIB_DESCRIPTION, LIB_NAME } from "./__version.js";
|
|
10
10
|
export { PantherTier, isPlatformContextV1, isWorkspaceScopedSettings, } from "./platformContext.js";
|
|
11
|
-
export { documentTitleChanged, isDocumentTitleChangedEvent, isReloadPlatformContextRequestedEvent, PluggableAppEventType, reloadPlatformContextRequested, } from "./mount.js";
|
|
11
|
+
export { documentTitleChanged, isDocumentTitleChangedEvent, isOpenAiAssistantRequestedEvent, isCloseAiAssistantRequestedEvent, isAiAssistantContextChangedEvent, isReloadPlatformContextRequestedEvent, openAiAssistantRequested, closeAiAssistantRequested, aiAssistantContextChanged, PluggableAppEventType, reloadPlatformContextRequested, } from "./mount.js";
|
package/esm/mount.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type IGenAIUserContext } from "@gooddata/sdk-model";
|
|
1
2
|
import { type IPlatformContext } from "./platformContext.js";
|
|
2
3
|
/**
|
|
3
4
|
* Known generic pluggable application event types.
|
|
@@ -7,6 +8,9 @@ import { type IPlatformContext } from "./platformContext.js";
|
|
|
7
8
|
export declare const PluggableAppEventType: {
|
|
8
9
|
readonly RELOAD_PLATFORM_CONTEXT_REQUESTED: "GDC.PLUGGABLE_APP/EVT.RELOAD_PLATFORM_CONTEXT.REQUESTED";
|
|
9
10
|
readonly DOCUMENT_TITLE_CHANGED: "GDC.PLUGGABLE_APP/EVT.DOCUMENT_TITLE.CHANGED";
|
|
11
|
+
readonly AI_ASSISTANT_OPEN_REQUESTED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED";
|
|
12
|
+
readonly AI_ASSISTANT_CLOSE_REQUESTED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED";
|
|
13
|
+
readonly AI_ASSISTANT_CONTEXT_CHANGED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED";
|
|
10
14
|
};
|
|
11
15
|
/**
|
|
12
16
|
* Union of known pluggable application event type names.
|
|
@@ -91,6 +95,121 @@ export declare function documentTitleChanged(pageTitle: string | undefined): IDo
|
|
|
91
95
|
* @alpha
|
|
92
96
|
*/
|
|
93
97
|
export declare function isDocumentTitleChangedEvent(obj: unknown): obj is IDocumentTitleChangedEvent;
|
|
98
|
+
/**
|
|
99
|
+
* Event requesting the host to open its AI assistant chat.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* The host shell owns the AI assistant on hosted-application routes — a pluggable application must
|
|
103
|
+
* not render its own chat dialog there (two assistants would overlay each other and a duplicate
|
|
104
|
+
* could auto-open from the shared open-state, see LX-2544). Instead, its in-content entry points
|
|
105
|
+
* (e.g. a "Summarize" action) emit this event and the host opens its chat, optionally seeded with a
|
|
106
|
+
* question and the user's location context. Tag scoping for the assistant's object search is carried
|
|
107
|
+
* separately via {@link IAiAssistantContextChangedEvent}, which reflects the app's current view.
|
|
108
|
+
*
|
|
109
|
+
* @alpha
|
|
110
|
+
*/
|
|
111
|
+
export interface IOpenAiAssistantRequestedEvent extends IPluggableAppEvent {
|
|
112
|
+
readonly type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED";
|
|
113
|
+
readonly payload: {
|
|
114
|
+
/**
|
|
115
|
+
* Question to seed the chat with. When omitted, the chat just opens.
|
|
116
|
+
*/
|
|
117
|
+
readonly question?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Context of the user's current location (e.g. the active dashboard and its widgets),
|
|
120
|
+
* passed to the assistant alongside the seeded question.
|
|
121
|
+
*/
|
|
122
|
+
readonly userContext?: IGenAIUserContext;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Creates an {@link IOpenAiAssistantRequestedEvent}.
|
|
127
|
+
*
|
|
128
|
+
* @alpha
|
|
129
|
+
*/
|
|
130
|
+
export declare function openAiAssistantRequested(payload?: {
|
|
131
|
+
question?: string;
|
|
132
|
+
userContext?: IGenAIUserContext;
|
|
133
|
+
}): IOpenAiAssistantRequestedEvent;
|
|
134
|
+
/**
|
|
135
|
+
* Type guard for {@link IOpenAiAssistantRequestedEvent}.
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* Validates the payload shape too (not just the type), so a malformed event — e.g. one emitted
|
|
139
|
+
* from JS or a mismatched remote module — is rejected rather than narrowed to a type whose later
|
|
140
|
+
* `payload.question` access would throw.
|
|
141
|
+
*
|
|
142
|
+
* @alpha
|
|
143
|
+
*/
|
|
144
|
+
export declare function isOpenAiAssistantRequestedEvent(obj: unknown): obj is IOpenAiAssistantRequestedEvent;
|
|
145
|
+
/**
|
|
146
|
+
* Event requesting the host to close its AI assistant chat.
|
|
147
|
+
*
|
|
148
|
+
* @remarks
|
|
149
|
+
* Counterpart to {@link IOpenAiAssistantRequestedEvent}. A pluggable application emits this when one
|
|
150
|
+
* of its in-content controls toggles the assistant closed (e.g. an embedded AI button), so the
|
|
151
|
+
* host-owned chat closes in step with the application.
|
|
152
|
+
*
|
|
153
|
+
* @alpha
|
|
154
|
+
*/
|
|
155
|
+
export interface ICloseAiAssistantRequestedEvent extends IPluggableAppEvent {
|
|
156
|
+
readonly type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED";
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Creates an {@link ICloseAiAssistantRequestedEvent}.
|
|
160
|
+
*
|
|
161
|
+
* @alpha
|
|
162
|
+
*/
|
|
163
|
+
export declare function closeAiAssistantRequested(): ICloseAiAssistantRequestedEvent;
|
|
164
|
+
/**
|
|
165
|
+
* Type guard for {@link ICloseAiAssistantRequestedEvent}.
|
|
166
|
+
*
|
|
167
|
+
* @alpha
|
|
168
|
+
*/
|
|
169
|
+
export declare function isCloseAiAssistantRequestedEvent(obj: unknown): obj is ICloseAiAssistantRequestedEvent;
|
|
170
|
+
/**
|
|
171
|
+
* Event informing the host of the active application's current AI-assistant tag scope.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* A hosted application can constrain its catalog to objects tagged in a certain way (e.g. AD's
|
|
175
|
+
* `includeObjectsWithTags` route filter). Because the host owns the single chat instance on hosted
|
|
176
|
+
* routes, the application forwards its current tag scope through this event so the host assistant's
|
|
177
|
+
* object search/autocomplete stays within the same scope the rest of the application enforces.
|
|
178
|
+
* The host keeps the latest reported scope and clears it (empty arrays / omitted) when the
|
|
179
|
+
* application no longer constrains its catalog.
|
|
180
|
+
*
|
|
181
|
+
* @alpha
|
|
182
|
+
*/
|
|
183
|
+
export interface IAiAssistantContextChangedEvent extends IPluggableAppEvent {
|
|
184
|
+
readonly type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED";
|
|
185
|
+
readonly payload: {
|
|
186
|
+
/**
|
|
187
|
+
* Tag identifiers the assistant's object search should be restricted to. Empty/omitted
|
|
188
|
+
* means no include filter.
|
|
189
|
+
*/
|
|
190
|
+
readonly includeTags?: string[];
|
|
191
|
+
/**
|
|
192
|
+
* Tag identifiers the assistant's object search should exclude. Empty/omitted means no
|
|
193
|
+
* exclude filter.
|
|
194
|
+
*/
|
|
195
|
+
readonly excludeTags?: string[];
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Creates an {@link IAiAssistantContextChangedEvent}.
|
|
200
|
+
*
|
|
201
|
+
* @alpha
|
|
202
|
+
*/
|
|
203
|
+
export declare function aiAssistantContextChanged(payload?: {
|
|
204
|
+
includeTags?: string[];
|
|
205
|
+
excludeTags?: string[];
|
|
206
|
+
}): IAiAssistantContextChangedEvent;
|
|
207
|
+
/**
|
|
208
|
+
* Type guard for {@link IAiAssistantContextChangedEvent}.
|
|
209
|
+
*
|
|
210
|
+
* @alpha
|
|
211
|
+
*/
|
|
212
|
+
export declare function isAiAssistantContextChangedEvent(obj: unknown): obj is IAiAssistantContextChangedEvent;
|
|
94
213
|
/**
|
|
95
214
|
* Telemetry channel determines which analytics pipeline receives the event.
|
|
96
215
|
*
|
|
@@ -244,6 +363,17 @@ export interface IPluggableApplicationMountHandle {
|
|
|
244
363
|
* Host uses this to push down context changes after initial mount.
|
|
245
364
|
*/
|
|
246
365
|
updateContext?: (ctx: IPlatformContext) => void;
|
|
366
|
+
/**
|
|
367
|
+
* Pushes the host-owned AI assistant chat open-state into the pluggable application.
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* On hosted routes the host owns the single chat instance; an application that exposes its own
|
|
371
|
+
* assistant controls (e.g. an embedded AI button, or the `toggleAIAssistant` postMessage command
|
|
372
|
+
* whose result is echoed to an embedding client) needs to know the real open-state to keep those
|
|
373
|
+
* controls and their reported results aligned with what the user sees. The host calls this
|
|
374
|
+
* whenever its chat opens or closes. Applications without such controls may omit it.
|
|
375
|
+
*/
|
|
376
|
+
setAiAssistantOpen?: (open: boolean) => void;
|
|
247
377
|
}
|
|
248
378
|
/**
|
|
249
379
|
* Pluggable application mount function signature.
|
package/esm/mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,E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_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED",
|
|
11
|
+
AI_ASSISTANT_CLOSE_REQUESTED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED",
|
|
12
|
+
AI_ASSISTANT_CONTEXT_CHANGED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED",
|
|
10
13
|
};
|
|
11
14
|
/**
|
|
12
15
|
* Creates an {@link IReloadPlatformContextRequestedEvent}.
|
|
@@ -58,3 +61,83 @@ export function isDocumentTitleChangedEvent(obj) {
|
|
|
58
61
|
const pageTitle = payload.pageTitle;
|
|
59
62
|
return typeof pageTitle === "string" || pageTitle === undefined;
|
|
60
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates an {@link IOpenAiAssistantRequestedEvent}.
|
|
66
|
+
*
|
|
67
|
+
* @alpha
|
|
68
|
+
*/
|
|
69
|
+
export function openAiAssistantRequested(payload) {
|
|
70
|
+
return { type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED", payload: payload ?? {} };
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Type guard for {@link IOpenAiAssistantRequestedEvent}.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* Validates the payload shape too (not just the type), so a malformed event — e.g. one emitted
|
|
77
|
+
* from JS or a mismatched remote module — is rejected rather than narrowed to a type whose later
|
|
78
|
+
* `payload.question` access would throw.
|
|
79
|
+
*
|
|
80
|
+
* @alpha
|
|
81
|
+
*/
|
|
82
|
+
export function isOpenAiAssistantRequestedEvent(obj) {
|
|
83
|
+
if (typeof obj !== "object" ||
|
|
84
|
+
obj === null ||
|
|
85
|
+
obj.type !== "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED") {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
const payload = obj.payload;
|
|
89
|
+
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const { question, userContext } = payload;
|
|
93
|
+
const questionOk = typeof question === "string" || question === undefined;
|
|
94
|
+
// userContext is an opaque structured object; validate only that it is an object when present
|
|
95
|
+
// so a later property read on the host side cannot throw.
|
|
96
|
+
const userContextOk = userContext === undefined || (typeof userContext === "object" && userContext !== null);
|
|
97
|
+
return questionOk && userContextOk;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Creates an {@link ICloseAiAssistantRequestedEvent}.
|
|
101
|
+
*
|
|
102
|
+
* @alpha
|
|
103
|
+
*/
|
|
104
|
+
export function closeAiAssistantRequested() {
|
|
105
|
+
return { type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED" };
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Type guard for {@link ICloseAiAssistantRequestedEvent}.
|
|
109
|
+
*
|
|
110
|
+
* @alpha
|
|
111
|
+
*/
|
|
112
|
+
export function isCloseAiAssistantRequestedEvent(obj) {
|
|
113
|
+
return (typeof obj === "object" &&
|
|
114
|
+
obj !== null &&
|
|
115
|
+
obj.type === "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED");
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Creates an {@link IAiAssistantContextChangedEvent}.
|
|
119
|
+
*
|
|
120
|
+
* @alpha
|
|
121
|
+
*/
|
|
122
|
+
export function aiAssistantContextChanged(payload) {
|
|
123
|
+
return { type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED", payload: payload ?? {} };
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Type guard for {@link IAiAssistantContextChangedEvent}.
|
|
127
|
+
*
|
|
128
|
+
* @alpha
|
|
129
|
+
*/
|
|
130
|
+
export function isAiAssistantContextChangedEvent(obj) {
|
|
131
|
+
if (typeof obj !== "object" ||
|
|
132
|
+
obj === null ||
|
|
133
|
+
obj.type !== "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED") {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
const payload = obj.payload;
|
|
137
|
+
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
const { includeTags, excludeTags } = payload;
|
|
141
|
+
const isStringArrayOrUndefined = (value) => value === undefined || (Array.isArray(value) && value.every((item) => typeof item === "string"));
|
|
142
|
+
return isStringArrayOrUndefined(includeTags) && isStringArrayOrUndefined(excludeTags);
|
|
143
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { ApplicationScope } from '@gooddata/sdk-model';
|
|
8
8
|
import { IColorPalette } from '@gooddata/sdk-model';
|
|
9
9
|
import { IEntitlementDescriptor } from '@gooddata/sdk-model';
|
|
10
|
+
import { IGenAIUserContext } from '@gooddata/sdk-model';
|
|
10
11
|
import { ILocale } from '@gooddata/sdk-model';
|
|
11
12
|
import { ITheme } from '@gooddata/sdk-model';
|
|
12
13
|
import { IUser } from '@gooddata/sdk-model';
|
|
@@ -17,6 +18,23 @@ import { IWorkspacePermissions } from '@gooddata/sdk-model';
|
|
|
17
18
|
import { ObjRef } from '@gooddata/sdk-model';
|
|
18
19
|
import { PluggableApplicationRegistryItem } from '@gooddata/sdk-model';
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Creates an {@link IAiAssistantContextChangedEvent}.
|
|
23
|
+
*
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
export declare function aiAssistantContextChanged(payload?: {
|
|
27
|
+
includeTags?: string[];
|
|
28
|
+
excludeTags?: string[];
|
|
29
|
+
}): IAiAssistantContextChangedEvent;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates an {@link ICloseAiAssistantRequestedEvent}.
|
|
33
|
+
*
|
|
34
|
+
* @alpha
|
|
35
|
+
*/
|
|
36
|
+
export declare function closeAiAssistantRequested(): ICloseAiAssistantRequestedEvent;
|
|
37
|
+
|
|
20
38
|
/**
|
|
21
39
|
* The object contains constants with IDs of default platform applications.
|
|
22
40
|
* These IDs are used to identify application in the platform registry.
|
|
@@ -64,6 +82,57 @@ export declare type EmbeddingMode = "none" | "iframe" | "export";
|
|
|
64
82
|
*/
|
|
65
83
|
export declare type HostUiMount = (options: IHostUiMountOptions) => IHostUiMountHandle;
|
|
66
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Event informing the host of the active application's current AI-assistant tag scope.
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* A hosted application can constrain its catalog to objects tagged in a certain way (e.g. AD's
|
|
90
|
+
* `includeObjectsWithTags` route filter). Because the host owns the single chat instance on hosted
|
|
91
|
+
* routes, the application forwards its current tag scope through this event so the host assistant's
|
|
92
|
+
* object search/autocomplete stays within the same scope the rest of the application enforces.
|
|
93
|
+
* The host keeps the latest reported scope and clears it (empty arrays / omitted) when the
|
|
94
|
+
* application no longer constrains its catalog.
|
|
95
|
+
*
|
|
96
|
+
* @alpha
|
|
97
|
+
*/
|
|
98
|
+
export declare interface IAiAssistantContextChangedEvent extends IPluggableAppEvent {
|
|
99
|
+
readonly type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED";
|
|
100
|
+
readonly payload: {
|
|
101
|
+
/**
|
|
102
|
+
* Tag identifiers the assistant's object search should be restricted to. Empty/omitted
|
|
103
|
+
* means no include filter.
|
|
104
|
+
*/
|
|
105
|
+
readonly includeTags?: string[];
|
|
106
|
+
/**
|
|
107
|
+
* Tag identifiers the assistant's object search should exclude. Empty/omitted means no
|
|
108
|
+
* exclude filter.
|
|
109
|
+
*/
|
|
110
|
+
readonly excludeTags?: string[];
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Notification informing the host UI of the active application's current AI-assistant tag scope.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* Emitted when the active pluggable application's tag scope changes (see
|
|
119
|
+
* `IAiAssistantContextChangedEvent`). The host UI keeps the latest scope and applies it to its
|
|
120
|
+
* chat so the assistant's object search stays within the same scope the application enforces.
|
|
121
|
+
*
|
|
122
|
+
* @alpha
|
|
123
|
+
*/
|
|
124
|
+
export declare interface IAiAssistantContextHostUiNotification {
|
|
125
|
+
type: "aiAssistantContext";
|
|
126
|
+
/**
|
|
127
|
+
* Tag identifiers the assistant's object search should be restricted to.
|
|
128
|
+
*/
|
|
129
|
+
includeTags?: string[];
|
|
130
|
+
/**
|
|
131
|
+
* Tag identifiers the assistant's object search should exclude.
|
|
132
|
+
*/
|
|
133
|
+
excludeTags?: string[];
|
|
134
|
+
}
|
|
135
|
+
|
|
67
136
|
/**
|
|
68
137
|
* GoodData API-token authentication.
|
|
69
138
|
*
|
|
@@ -128,6 +197,33 @@ export declare interface IAppInstance extends IPluggableApplicationMountHandle {
|
|
|
128
197
|
*/
|
|
129
198
|
export declare type IAuthCredentials = IContextDeferredAuthCredentials | IApiTokenAuthCredentials | IJwtAuthCredentials;
|
|
130
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Notification requesting the host UI to close its AI assistant chat.
|
|
202
|
+
*
|
|
203
|
+
* @remarks
|
|
204
|
+
* Emitted when the active pluggable application closes the assistant from one of its own controls
|
|
205
|
+
* (see `ICloseAiAssistantRequestedEvent`). The host UI closes its single chat instance.
|
|
206
|
+
*
|
|
207
|
+
* @alpha
|
|
208
|
+
*/
|
|
209
|
+
export declare interface ICloseAiAssistantHostUiNotification {
|
|
210
|
+
type: "closeAiAssistant";
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Event requesting the host to close its AI assistant chat.
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* Counterpart to {@link IOpenAiAssistantRequestedEvent}. A pluggable application emits this when one
|
|
218
|
+
* of its in-content controls toggles the assistant closed (e.g. an embedded AI button), so the
|
|
219
|
+
* host-owned chat closes in step with the application.
|
|
220
|
+
*
|
|
221
|
+
* @alpha
|
|
222
|
+
*/
|
|
223
|
+
export declare interface ICloseAiAssistantRequestedEvent extends IPluggableAppEvent {
|
|
224
|
+
readonly type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED";
|
|
225
|
+
}
|
|
226
|
+
|
|
131
227
|
/**
|
|
132
228
|
* Cookie / session-based authentication — no explicit credentials required.
|
|
133
229
|
*
|
|
@@ -307,6 +403,15 @@ export declare interface IHostUiMountOptions {
|
|
|
307
403
|
* entry instead of pushing a new one.
|
|
308
404
|
*/
|
|
309
405
|
replace: (url: string) => void;
|
|
406
|
+
/**
|
|
407
|
+
* Reports the host-owned AI assistant chat open-state whenever it changes.
|
|
408
|
+
*
|
|
409
|
+
* @remarks
|
|
410
|
+
* The host UI owns the single chat instance on hosted routes; the host runtime forwards this
|
|
411
|
+
* open-state to the active pluggable application (via its mount handle) so app-side assistant
|
|
412
|
+
* controls stay aligned with what the user sees.
|
|
413
|
+
*/
|
|
414
|
+
onAiAssistantOpenChange?: (open: boolean) => void;
|
|
310
415
|
}
|
|
311
416
|
|
|
312
417
|
/**
|
|
@@ -321,7 +426,7 @@ export declare interface IHostUiMountOptions {
|
|
|
321
426
|
*
|
|
322
427
|
* @alpha
|
|
323
428
|
*/
|
|
324
|
-
export declare type IHostUiNotification = INewDeploymentAvailableHostUiNotification;
|
|
429
|
+
export declare type IHostUiNotification = INewDeploymentAvailableHostUiNotification | IOpenAiAssistantHostUiNotification | ICloseAiAssistantHostUiNotification | IAiAssistantContextHostUiNotification;
|
|
325
430
|
|
|
326
431
|
/**
|
|
327
432
|
* JWT-based authentication.
|
|
@@ -360,6 +465,57 @@ export declare interface INewDeploymentAvailableHostUiNotification {
|
|
|
360
465
|
commitHash: string;
|
|
361
466
|
}
|
|
362
467
|
|
|
468
|
+
/**
|
|
469
|
+
* Notification requesting the host UI to open its AI assistant chat.
|
|
470
|
+
*
|
|
471
|
+
* @remarks
|
|
472
|
+
* Emitted when the active pluggable application requests the assistant (see
|
|
473
|
+
* `IOpenAiAssistantRequestedEvent`). The host UI owns the single chat instance on
|
|
474
|
+
* hosted-application routes and opens it, optionally seeded with a question and user context.
|
|
475
|
+
*
|
|
476
|
+
* @alpha
|
|
477
|
+
*/
|
|
478
|
+
export declare interface IOpenAiAssistantHostUiNotification {
|
|
479
|
+
type: "openAiAssistant";
|
|
480
|
+
/**
|
|
481
|
+
* Question to seed the chat with. When omitted, the chat just opens.
|
|
482
|
+
*/
|
|
483
|
+
question?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Context of the user's current location (e.g. the active dashboard), passed to the
|
|
486
|
+
* assistant alongside the seeded question.
|
|
487
|
+
*/
|
|
488
|
+
userContext?: IGenAIUserContext;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Event requesting the host to open its AI assistant chat.
|
|
493
|
+
*
|
|
494
|
+
* @remarks
|
|
495
|
+
* The host shell owns the AI assistant on hosted-application routes — a pluggable application must
|
|
496
|
+
* not render its own chat dialog there (two assistants would overlay each other and a duplicate
|
|
497
|
+
* could auto-open from the shared open-state, see LX-2544). Instead, its in-content entry points
|
|
498
|
+
* (e.g. a "Summarize" action) emit this event and the host opens its chat, optionally seeded with a
|
|
499
|
+
* question and the user's location context. Tag scoping for the assistant's object search is carried
|
|
500
|
+
* separately via {@link IAiAssistantContextChangedEvent}, which reflects the app's current view.
|
|
501
|
+
*
|
|
502
|
+
* @alpha
|
|
503
|
+
*/
|
|
504
|
+
export declare interface IOpenAiAssistantRequestedEvent extends IPluggableAppEvent {
|
|
505
|
+
readonly type: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED";
|
|
506
|
+
readonly payload: {
|
|
507
|
+
/**
|
|
508
|
+
* Question to seed the chat with. When omitted, the chat just opens.
|
|
509
|
+
*/
|
|
510
|
+
readonly question?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Context of the user's current location (e.g. the active dashboard and its widgets),
|
|
513
|
+
* passed to the assistant alongside the seeded question.
|
|
514
|
+
*/
|
|
515
|
+
readonly userContext?: IGenAIUserContext;
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
|
|
363
519
|
/**
|
|
364
520
|
* Organization information available in the platform context.
|
|
365
521
|
*
|
|
@@ -525,6 +681,17 @@ export declare interface IPluggableApplicationMountHandle {
|
|
|
525
681
|
* Host uses this to push down context changes after initial mount.
|
|
526
682
|
*/
|
|
527
683
|
updateContext?: (ctx: IPlatformContext) => void;
|
|
684
|
+
/**
|
|
685
|
+
* Pushes the host-owned AI assistant chat open-state into the pluggable application.
|
|
686
|
+
*
|
|
687
|
+
* @remarks
|
|
688
|
+
* On hosted routes the host owns the single chat instance; an application that exposes its own
|
|
689
|
+
* assistant controls (e.g. an embedded AI button, or the `toggleAIAssistant` postMessage command
|
|
690
|
+
* whose result is echoed to an embedding client) needs to know the real open-state to keep those
|
|
691
|
+
* controls and their reported results aligned with what the user sees. The host calls this
|
|
692
|
+
* whenever its chat opens or closes. Applications without such controls may omit it.
|
|
693
|
+
*/
|
|
694
|
+
setAiAssistantOpen?: (open: boolean) => void;
|
|
528
695
|
}
|
|
529
696
|
|
|
530
697
|
/**
|
|
@@ -629,6 +796,20 @@ export declare interface IReloadPlatformContextRequestedEvent extends IPluggable
|
|
|
629
796
|
readonly type: "GDC.PLUGGABLE_APP/EVT.RELOAD_PLATFORM_CONTEXT.REQUESTED";
|
|
630
797
|
}
|
|
631
798
|
|
|
799
|
+
/**
|
|
800
|
+
* Type guard for {@link IAiAssistantContextChangedEvent}.
|
|
801
|
+
*
|
|
802
|
+
* @alpha
|
|
803
|
+
*/
|
|
804
|
+
export declare function isAiAssistantContextChangedEvent(obj: unknown): obj is IAiAssistantContextChangedEvent;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Type guard for {@link ICloseAiAssistantRequestedEvent}.
|
|
808
|
+
*
|
|
809
|
+
* @alpha
|
|
810
|
+
*/
|
|
811
|
+
export declare function isCloseAiAssistantRequestedEvent(obj: unknown): obj is ICloseAiAssistantRequestedEvent;
|
|
812
|
+
|
|
632
813
|
/**
|
|
633
814
|
* Type guard for {@link IDocumentTitleChangedEvent}.
|
|
634
815
|
*
|
|
@@ -641,6 +822,18 @@ export declare interface IReloadPlatformContextRequestedEvent extends IPluggable
|
|
|
641
822
|
*/
|
|
642
823
|
export declare function isDocumentTitleChangedEvent(obj: unknown): obj is IDocumentTitleChangedEvent;
|
|
643
824
|
|
|
825
|
+
/**
|
|
826
|
+
* Type guard for {@link IOpenAiAssistantRequestedEvent}.
|
|
827
|
+
*
|
|
828
|
+
* @remarks
|
|
829
|
+
* Validates the payload shape too (not just the type), so a malformed event — e.g. one emitted
|
|
830
|
+
* from JS or a mismatched remote module — is rejected rather than narrowed to a type whose later
|
|
831
|
+
* `payload.question` access would throw.
|
|
832
|
+
*
|
|
833
|
+
* @alpha
|
|
834
|
+
*/
|
|
835
|
+
export declare function isOpenAiAssistantRequestedEvent(obj: unknown): obj is IOpenAiAssistantRequestedEvent;
|
|
836
|
+
|
|
644
837
|
/**
|
|
645
838
|
* Type guard for {@link IPlatformContextV1}.
|
|
646
839
|
*
|
|
@@ -692,6 +885,16 @@ export declare const LIB_NAME: string;
|
|
|
692
885
|
/** @alpha */
|
|
693
886
|
export declare const LIB_VERSION: string;
|
|
694
887
|
|
|
888
|
+
/**
|
|
889
|
+
* Creates an {@link IOpenAiAssistantRequestedEvent}.
|
|
890
|
+
*
|
|
891
|
+
* @alpha
|
|
892
|
+
*/
|
|
893
|
+
export declare function openAiAssistantRequested(payload?: {
|
|
894
|
+
question?: string;
|
|
895
|
+
userContext?: IGenAIUserContext;
|
|
896
|
+
}): IOpenAiAssistantRequestedEvent;
|
|
897
|
+
|
|
695
898
|
/**
|
|
696
899
|
* Panther tier.
|
|
697
900
|
*
|
|
@@ -713,6 +916,9 @@ export declare enum PantherTier {
|
|
|
713
916
|
export declare const PluggableAppEventType: {
|
|
714
917
|
readonly RELOAD_PLATFORM_CONTEXT_REQUESTED: "GDC.PLUGGABLE_APP/EVT.RELOAD_PLATFORM_CONTEXT.REQUESTED";
|
|
715
918
|
readonly DOCUMENT_TITLE_CHANGED: "GDC.PLUGGABLE_APP/EVT.DOCUMENT_TITLE.CHANGED";
|
|
919
|
+
readonly AI_ASSISTANT_OPEN_REQUESTED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.OPEN_REQUESTED";
|
|
920
|
+
readonly AI_ASSISTANT_CLOSE_REQUESTED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CLOSE_REQUESTED";
|
|
921
|
+
readonly AI_ASSISTANT_CONTEXT_CHANGED: "GDC.PLUGGABLE_APP/EVT.AI_ASSISTANT.CONTEXT_CHANGED";
|
|
716
922
|
};
|
|
717
923
|
|
|
718
924
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-pluggable-application-model",
|
|
3
|
-
"version": "11.42.0-alpha.
|
|
3
|
+
"version": "11.42.0-alpha.5",
|
|
4
4
|
"description": "GoodData SDK model contracts for pluggable applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"ts-invariant": "0.10.3",
|
|
25
25
|
"tslib": "2.8.1",
|
|
26
|
-
"@gooddata/sdk-model": "11.42.0-alpha.
|
|
26
|
+
"@gooddata/sdk-model": "11.42.0-alpha.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"oxlint-tsgolint": "0.15.0",
|
|
48
48
|
"typescript": "5.9.3",
|
|
49
49
|
"vitest": "4.1.8",
|
|
50
|
-
"@gooddata/
|
|
51
|
-
"@gooddata/
|
|
50
|
+
"@gooddata/eslint-config": "11.42.0-alpha.5",
|
|
51
|
+
"@gooddata/oxlint-config": "11.42.0-alpha.5"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"_phase:build": "npm run build",
|