@atlaskit/rovo-triggers 6.5.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/cjs/common/utils/params/index.js +0 -1
- package/dist/cjs/main.js +8 -1
- package/dist/es2019/common/utils/params/index.js +0 -1
- package/dist/es2019/main.js +8 -1
- package/dist/esm/common/utils/params/index.js +0 -1
- package/dist/esm/main.js +8 -1
- package/dist/types/types.d.ts +7 -1
- package/dist/types-ts4.5/types.d.ts +7 -1
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @atlaskit/rovo-triggers
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3813de687aea3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3813de687aea3) -
|
|
8
|
+
Fix Rovo nudge prompt not being inserted into chat on the first cold-start open of the chat.
|
|
9
|
+
Guarded by `rovo_chat_fix_cold_start_prompt_insertion`.
|
|
10
|
+
|
|
11
|
+
Stop `set-message-context` from overwriting the single-slot `triggerLatest` replay queue, which
|
|
12
|
+
could displace a queued action event (e.g. a nudge's `insert-prompt`) before a late subscriber
|
|
13
|
+
(PubSubListener) mounts on cold start.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 7.0.0
|
|
20
|
+
|
|
21
|
+
### Major Changes
|
|
22
|
+
|
|
23
|
+
- [`b0222d13caefe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b0222d13caefe) -
|
|
24
|
+
Replace `@typescript-eslint/no-explicit-any` suppressions with real types across
|
|
25
|
+
rovo-content-bridge and rovo-platform packages (TREX-1392).
|
|
26
|
+
|
|
27
|
+
Key changes:
|
|
28
|
+
- `rovo-content-bridge-api`: Replace `any` in `CommandConstructor`, type guards, handlers,
|
|
29
|
+
debugger, and desktop transport with `unknown`, typed event interfaces, and a new `WebContents`
|
|
30
|
+
interface.
|
|
31
|
+
- `rovo-content-bridge-api-commands`: Replace `any` fields with `SerializableValue` in chart,
|
|
32
|
+
Jira, and content commands.
|
|
33
|
+
- `rovo-playground`: Replace `any` in plugin config, settings store, and ADF utilities with
|
|
34
|
+
`unknown` and recursive typed nodes.
|
|
35
|
+
- `rovo-platform-ui-components`, `rovo-navigation`, `rovo-spaces`, `rovo-triggers`,
|
|
36
|
+
`rovo-agent-analytics`, `rovo-agent-components`, `rovo-chat-side-by-side-evaluation`,
|
|
37
|
+
`rovo-agent-debug-modal`: Replace remaining `any` occurrences with `unknown`, typed interfaces,
|
|
38
|
+
or properly inferred types.
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- [`18aff6350fd6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/18aff6350fd6a) -
|
|
43
|
+
Add optional `tags` field to `ChatNewPayload` and forward conversation-channel tags through the
|
|
44
|
+
`chat-new` bridge to `createSeededConversation`. Used by the Confluence @ Mention Agents feature
|
|
45
|
+
to pass `mention-in-comment`, `page:<pageId>`, and `comment:<commentId>` tags so the backend can
|
|
46
|
+
create a `SessionAssociationPublic` record and initialize conversation state.
|
|
47
|
+
|
|
3
48
|
## 6.5.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
|
@@ -39,7 +39,6 @@ var processParams = function processParams(input) {
|
|
|
39
39
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
40
40
|
filter: []
|
|
41
41
|
};
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
42
|
var output = {};
|
|
44
43
|
var safeSearchParamsInput = typeof input === 'string' ? isValidURL(input) ? new URLSearchParams(new URL(input).search) : new URLSearchParams(input) : input;
|
|
45
44
|
var processedInput = new URLSearchParams(safeSearchParamsInput);
|
package/dist/cjs/main.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.useSubscribeAll = exports.useSubscribe = exports.usePublish = exports.Su
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
14
|
var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
|
|
@@ -16,6 +17,12 @@ var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-chang
|
|
|
16
17
|
// instead of the real action event (e.g. open-browse-agent-modal) that
|
|
17
18
|
// originally opened the chat.
|
|
18
19
|
'smartlinks-subscription-changed', 'smartlinks-context-payload']);
|
|
20
|
+
var isIgnoredForTriggerLatest = function isIgnoredForTriggerLatest(type) {
|
|
21
|
+
if (ignoredTriggerLatestEvents.has(type)) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return type === 'set-message-context' && (0, _platformFeatureFlags.fg)('rovo_chat_fix_cold_start_prompt_insertion');
|
|
25
|
+
};
|
|
19
26
|
var createPubSub = function createPubSub() {
|
|
20
27
|
var subscribedEvents = {};
|
|
21
28
|
var publishQueue = {};
|
|
@@ -76,7 +83,7 @@ var createPubSub = function createPubSub() {
|
|
|
76
83
|
* This ensures new subscribers can trigger their callback if `triggerLatest` is true, and the event hasn't already been triggered.
|
|
77
84
|
*/
|
|
78
85
|
// This `ignoredTriggerLatestEvents` is a quick fix to prevent triggering the latest event for certain events
|
|
79
|
-
if (!
|
|
86
|
+
if (!isIgnoredForTriggerLatest(payload.type)) {
|
|
80
87
|
publishQueue[topic] = payload;
|
|
81
88
|
}
|
|
82
89
|
|
|
@@ -21,7 +21,6 @@ export const removePrefix = param => {
|
|
|
21
21
|
const processParams = (input, options = {
|
|
22
22
|
filter: []
|
|
23
23
|
}) => {
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
24
|
const output = {};
|
|
26
25
|
const safeSearchParamsInput = typeof input === 'string' ? isValidURL(input) ? new URLSearchParams(new URL(input).search) : new URLSearchParams(input) : input;
|
|
27
26
|
const processedInput = new URLSearchParams(safeSearchParamsInput);
|
package/dist/es2019/main.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
const ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
|
|
3
4
|
// Internal signals that must never overwrite the publish queue — they would
|
|
4
5
|
// cause `triggerLatest` subscribers (e.g. PubSubListener) to replay them
|
|
5
6
|
// instead of the real action event (e.g. open-browse-agent-modal) that
|
|
6
7
|
// originally opened the chat.
|
|
7
8
|
'smartlinks-subscription-changed', 'smartlinks-context-payload']);
|
|
9
|
+
const isIgnoredForTriggerLatest = type => {
|
|
10
|
+
if (ignoredTriggerLatestEvents.has(type)) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return type === 'set-message-context' && fg('rovo_chat_fix_cold_start_prompt_insertion');
|
|
14
|
+
};
|
|
8
15
|
const createPubSub = () => {
|
|
9
16
|
let subscribedEvents = {};
|
|
10
17
|
let publishQueue = {};
|
|
@@ -69,7 +76,7 @@ const createPubSub = () => {
|
|
|
69
76
|
* This ensures new subscribers can trigger their callback if `triggerLatest` is true, and the event hasn't already been triggered.
|
|
70
77
|
*/
|
|
71
78
|
// This `ignoredTriggerLatestEvents` is a quick fix to prevent triggering the latest event for certain events
|
|
72
|
-
if (!
|
|
79
|
+
if (!isIgnoredForTriggerLatest(payload.type)) {
|
|
73
80
|
publishQueue[topic] = payload;
|
|
74
81
|
}
|
|
75
82
|
|
|
@@ -32,7 +32,6 @@ var processParams = function processParams(input) {
|
|
|
32
32
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
33
33
|
filter: []
|
|
34
34
|
};
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
35
|
var output = {};
|
|
37
36
|
var safeSearchParamsInput = typeof input === 'string' ? isValidURL(input) ? new URLSearchParams(new URL(input).search) : new URLSearchParams(input) : input;
|
|
38
37
|
var processedInput = new URLSearchParams(safeSearchParamsInput);
|
package/dist/esm/main.js
CHANGED
|
@@ -3,12 +3,19 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
|
|
7
8
|
// Internal signals that must never overwrite the publish queue — they would
|
|
8
9
|
// cause `triggerLatest` subscribers (e.g. PubSubListener) to replay them
|
|
9
10
|
// instead of the real action event (e.g. open-browse-agent-modal) that
|
|
10
11
|
// originally opened the chat.
|
|
11
12
|
'smartlinks-subscription-changed', 'smartlinks-context-payload']);
|
|
13
|
+
var isIgnoredForTriggerLatest = function isIgnoredForTriggerLatest(type) {
|
|
14
|
+
if (ignoredTriggerLatestEvents.has(type)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return type === 'set-message-context' && fg('rovo_chat_fix_cold_start_prompt_insertion');
|
|
18
|
+
};
|
|
12
19
|
var createPubSub = function createPubSub() {
|
|
13
20
|
var subscribedEvents = {};
|
|
14
21
|
var publishQueue = {};
|
|
@@ -69,7 +76,7 @@ var createPubSub = function createPubSub() {
|
|
|
69
76
|
* This ensures new subscribers can trigger their callback if `triggerLatest` is true, and the event hasn't already been triggered.
|
|
70
77
|
*/
|
|
71
78
|
// This `ignoredTriggerLatestEvents` is a quick fix to prevent triggering the latest event for certain events
|
|
72
|
-
if (!
|
|
79
|
+
if (!isIgnoredForTriggerLatest(payload.type)) {
|
|
73
80
|
publishQueue[topic] = payload;
|
|
74
81
|
}
|
|
75
82
|
|
package/dist/types/types.d.ts
CHANGED
|
@@ -92,6 +92,12 @@ export type ChatNewPayload = PayloadCore<'chat-new', {
|
|
|
92
92
|
* Sent as `search_artifact` in `body.context`.
|
|
93
93
|
*/
|
|
94
94
|
searchArtifact?: SendMessageSearchArtifact;
|
|
95
|
+
/**
|
|
96
|
+
* Optional conversation-channel tags forwarded to the backend on conversation creation.
|
|
97
|
+
* Used by the agent-mention-in-comment feature to pass mention-in-comment, page:<pageId>,
|
|
98
|
+
* and comment:<commentId> so the backend can create a SessionAssociationPublic record.
|
|
99
|
+
*/
|
|
100
|
+
tags?: string[];
|
|
95
101
|
} & Partial<TargetAgentParam> & PlaceholderParam>;
|
|
96
102
|
export type EditorContextPayloadData = {
|
|
97
103
|
document: {
|
|
@@ -161,7 +167,7 @@ export type JiraCreateContextPayloadData = {
|
|
|
161
167
|
projectIdOrKey: string;
|
|
162
168
|
issueTypeId: string;
|
|
163
169
|
summary: string;
|
|
164
|
-
fields: Record<string,
|
|
170
|
+
fields: Record<string, unknown>;
|
|
165
171
|
}[] | null;
|
|
166
172
|
};
|
|
167
173
|
export type EditorContextPayload = PayloadCore<'editor-context-payload'> & {
|
|
@@ -92,6 +92,12 @@ export type ChatNewPayload = PayloadCore<'chat-new', {
|
|
|
92
92
|
* Sent as `search_artifact` in `body.context`.
|
|
93
93
|
*/
|
|
94
94
|
searchArtifact?: SendMessageSearchArtifact;
|
|
95
|
+
/**
|
|
96
|
+
* Optional conversation-channel tags forwarded to the backend on conversation creation.
|
|
97
|
+
* Used by the agent-mention-in-comment feature to pass mention-in-comment, page:<pageId>,
|
|
98
|
+
* and comment:<commentId> so the backend can create a SessionAssociationPublic record.
|
|
99
|
+
*/
|
|
100
|
+
tags?: string[];
|
|
95
101
|
} & Partial<TargetAgentParam> & PlaceholderParam>;
|
|
96
102
|
export type EditorContextPayloadData = {
|
|
97
103
|
document: {
|
|
@@ -161,7 +167,7 @@ export type JiraCreateContextPayloadData = {
|
|
|
161
167
|
projectIdOrKey: string;
|
|
162
168
|
issueTypeId: string;
|
|
163
169
|
summary: string;
|
|
164
|
-
fields: Record<string,
|
|
170
|
+
fields: Record<string, unknown>;
|
|
165
171
|
}[] | null;
|
|
166
172
|
};
|
|
167
173
|
export type EditorContextPayload = PayloadCore<'editor-context-payload'> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rovo-triggers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Provides various trigger events to drive Rovo Chat functionality, such as a publish-subscribe and URL parameter hooks",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -92,5 +92,10 @@
|
|
|
92
92
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
|
+
},
|
|
96
|
+
"platform-feature-flags": {
|
|
97
|
+
"rovo_chat_fix_cold_start_prompt_insertion": {
|
|
98
|
+
"type": "boolean"
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
}
|