@atlaskit/rovo-triggers 10.14.0 → 10.16.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 +21 -0
- package/dist/cjs/common/utils/extension-context-bridge/ExtensionContextBridgeClient.js +130 -0
- package/dist/cjs/common/utils/extension-context-bridge/ExtensionContextBridgeHost.js +85 -0
- package/dist/cjs/common/utils/extension-context-bridge/constants.js +22 -0
- package/dist/cjs/common/utils/extension-context-bridge/policy.js +40 -0
- package/dist/cjs/common/utils/extension-context-bridge/registry.js +134 -0
- package/dist/cjs/common/utils/extension-context-bridge/transport.js +49 -0
- package/dist/cjs/main.js +6 -3
- package/dist/cjs/types.js +1 -0
- package/dist/es2019/common/utils/extension-context-bridge/ExtensionContextBridgeClient.js +128 -0
- package/dist/es2019/common/utils/extension-context-bridge/ExtensionContextBridgeHost.js +82 -0
- package/dist/es2019/common/utils/extension-context-bridge/constants.js +16 -0
- package/dist/es2019/common/utils/extension-context-bridge/policy.js +32 -0
- package/dist/es2019/common/utils/extension-context-bridge/registry.js +120 -0
- package/dist/es2019/common/utils/extension-context-bridge/transport.js +35 -0
- package/dist/es2019/main.js +5 -1
- package/dist/es2019/types.js +1 -0
- package/dist/esm/common/utils/extension-context-bridge/ExtensionContextBridgeClient.js +124 -0
- package/dist/esm/common/utils/extension-context-bridge/ExtensionContextBridgeHost.js +78 -0
- package/dist/esm/common/utils/extension-context-bridge/constants.js +16 -0
- package/dist/esm/common/utils/extension-context-bridge/policy.js +34 -0
- package/dist/esm/common/utils/extension-context-bridge/registry.js +127 -0
- package/dist/esm/common/utils/extension-context-bridge/transport.js +43 -0
- package/dist/esm/main.js +5 -1
- package/dist/esm/types.js +1 -0
- package/dist/types/common/utils/extension-context-bridge/ExtensionContextBridgeClient.d.ts +19 -0
- package/dist/types/common/utils/extension-context-bridge/ExtensionContextBridgeHost.d.ts +16 -0
- package/dist/types/common/utils/extension-context-bridge/constants.d.ts +13 -0
- package/dist/types/common/utils/extension-context-bridge/policy.d.ts +8 -0
- package/dist/types/common/utils/extension-context-bridge/registry.d.ts +6 -0
- package/dist/types/common/utils/extension-context-bridge/transport.d.ts +38 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/types.d.ts +23 -1
- package/extension-context-bridge/client/package.json +10 -0
- package/extension-context-bridge/constants/package.json +10 -0
- package/extension-context-bridge/host/package.json +10 -0
- package/extension-context-bridge/transport/package.json +10 -0
- package/package.json +9 -3
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
+
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
|
+
import { BRIDGE_SOURCE } from './constants';
|
|
6
|
+
var base = function base(payload) {
|
|
7
|
+
return {
|
|
8
|
+
type: payload.type,
|
|
9
|
+
source: payload.source,
|
|
10
|
+
product: payload.product,
|
|
11
|
+
openChat: payload.openChat
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Boundary cast: the `Payload` union cannot be expressed structurally at this seam.
|
|
17
|
+
* Always stamps the loop-guard sentinel so the mirroring side skips it.
|
|
18
|
+
*/
|
|
19
|
+
var toPayload = function toPayload(value) {
|
|
20
|
+
return (// eslint-disable-next-line @atlaskit/platform/no-double-type-assertions -- serialization boundary reconstruction
|
|
21
|
+
_objectSpread(_objectSpread({}, value), {}, {
|
|
22
|
+
interactionSource: BRIDGE_SOURCE
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Per-type overrides for payloads carrying non-cloneable data (functions). Anything not listed
|
|
29
|
+
* uses the generic JSON (de)serializer.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/** Sentinel used to detect merge-style `setContext` implementations. */
|
|
33
|
+
var MERGE_PROBE_KEY = '__rovoExtBridgeMergeProbe__';
|
|
34
|
+
var SHIMS = {
|
|
35
|
+
/**
|
|
36
|
+
* `set-message-context` carries a `setContext` function, which cannot be structured-cloned.
|
|
37
|
+
* Resolves REPLACE-style publishers (return a fixed value) to their value and rebuilds a
|
|
38
|
+
* trivial `setContext` on the far side; merge-style publishers are dropped (detected via a
|
|
39
|
+
* probe object, since a throw-based check would silently ship a truncated context).
|
|
40
|
+
*/
|
|
41
|
+
'set-message-context': {
|
|
42
|
+
serialize: function serialize(payload) {
|
|
43
|
+
var data = payload.data;
|
|
44
|
+
if (!data || typeof data.setContext !== 'function') {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
var value;
|
|
48
|
+
try {
|
|
49
|
+
value = data.setContext(_defineProperty({}, MERGE_PROBE_KEY, true));
|
|
50
|
+
} catch (_unused) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
// Sentinel survived: merge-style, cannot be resolved to a standalone value.
|
|
54
|
+
if (_typeof(value) === 'object' && value !== null && MERGE_PROBE_KEY in value) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
JSON.stringify(value);
|
|
59
|
+
} catch (_unused2) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return _objectSpread(_objectSpread({}, base(payload)), {}, {
|
|
63
|
+
data: {
|
|
64
|
+
contextKey: data.contextKey,
|
|
65
|
+
value: value
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
deserialize: function deserialize(serialized) {
|
|
70
|
+
var _serialized$source;
|
|
71
|
+
var data = serialized.data;
|
|
72
|
+
if (!data) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
var rebuilt = {
|
|
76
|
+
contextKey: data.contextKey,
|
|
77
|
+
setContext: function setContext() {
|
|
78
|
+
return data.value;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return toPayload({
|
|
82
|
+
type: 'set-message-context',
|
|
83
|
+
source: (_serialized$source = serialized.source) !== null && _serialized$source !== void 0 ? _serialized$source : BRIDGE_SOURCE,
|
|
84
|
+
product: serialized.product,
|
|
85
|
+
openChat: serialized.openChat,
|
|
86
|
+
data: rebuilt
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var getShim = function getShim(type) {
|
|
92
|
+
return SHIMS[type];
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** Serialise a payload for the wire, using a shim if one exists, else a generic JSON round-trip. */
|
|
96
|
+
export var serializePayload = function serializePayload(payload) {
|
|
97
|
+
var shim = getShim(payload.type);
|
|
98
|
+
if (shim) {
|
|
99
|
+
return shim.serialize(payload);
|
|
100
|
+
}
|
|
101
|
+
var rawData = payload.data;
|
|
102
|
+
var data;
|
|
103
|
+
try {
|
|
104
|
+
data = rawData === undefined ? undefined : JSON.parse(JSON.stringify(rawData));
|
|
105
|
+
} catch (_unused3) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return _objectSpread(_objectSpread({}, base(payload)), {}, {
|
|
109
|
+
data: data
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** Reconstruct a payload from the wire, stamping the loop-guard sentinel. */
|
|
114
|
+
export var deserializePayload = function deserializePayload(serialized) {
|
|
115
|
+
var _serialized$source2;
|
|
116
|
+
var shim = getShim(serialized.type);
|
|
117
|
+
if (shim) {
|
|
118
|
+
return shim.deserialize(serialized);
|
|
119
|
+
}
|
|
120
|
+
return toPayload({
|
|
121
|
+
type: serialized.type,
|
|
122
|
+
source: (_serialized$source2 = serialized.source) !== null && _serialized$source2 !== void 0 ? _serialized$source2 : BRIDGE_SOURCE,
|
|
123
|
+
product: serialized.product,
|
|
124
|
+
openChat: serialized.openChat,
|
|
125
|
+
data: serialized.data
|
|
126
|
+
});
|
|
127
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import { bind } from 'bind-event-listener';
|
|
3
|
+
import { BRIDGE_MESSAGE_MARKER } from './constants';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A `rovo-triggers` payload reduced to a structured-clone-safe shape. Functions (e.g.
|
|
7
|
+
* `set-message-context`'s `setContext`) are resolved to values by `./registry` first.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Transport abstraction so Host/Client work over any carrier: same-window `postMessage` on the
|
|
12
|
+
* product side, iframe/side-panel `postMessage` in the chat iframe. Carries `BridgeMessage` only;
|
|
13
|
+
* `rovo-content-bridge-api` commands travel separately, relayed verbatim by the extension.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export var isBridgeMessage = function isBridgeMessage(value) {
|
|
17
|
+
return _typeof(value) === 'object' && value !== null && value[BRIDGE_MESSAGE_MARKER] === true && typeof value.direction === 'string' && _typeof(value.payload) === 'object' && value.payload !== null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** `postMessage`-based transport. Callers override `targetWindow`/`self` for the iframe side. */
|
|
21
|
+
export var createWindowTransport = function createWindowTransport(_ref) {
|
|
22
|
+
var targetWindow = _ref.targetWindow,
|
|
23
|
+
_ref$self = _ref.self,
|
|
24
|
+
selfWindow = _ref$self === void 0 ? window : _ref$self,
|
|
25
|
+
_ref$targetOrigin = _ref.targetOrigin,
|
|
26
|
+
targetOrigin = _ref$targetOrigin === void 0 ? selfWindow.location.origin : _ref$targetOrigin;
|
|
27
|
+
return {
|
|
28
|
+
send: function send(message) {
|
|
29
|
+
targetWindow.postMessage(message, targetOrigin);
|
|
30
|
+
},
|
|
31
|
+
// `bind` returns its own unbind function, which is exactly the `subscribe` contract.
|
|
32
|
+
subscribe: function subscribe(handler) {
|
|
33
|
+
return bind(selfWindow, {
|
|
34
|
+
type: 'message',
|
|
35
|
+
listener: function listener(event) {
|
|
36
|
+
if (isBridgeMessage(event.data)) {
|
|
37
|
+
handler(event.data);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
package/dist/esm/main.js
CHANGED
|
@@ -4,6 +4,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
|
+
/* eslint-disable @atlaskit/platform/one-value-export-per-file -- command callers cannot use hooks */
|
|
7
8
|
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
|
|
8
9
|
var MAX_CONSUMED_EVENT_KEYS = 5000;
|
|
9
10
|
var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
|
|
@@ -11,7 +12,7 @@ var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-chang
|
|
|
11
12
|
// cause `triggerLatest` subscribers (e.g. PubSubListener) to replay them
|
|
12
13
|
// instead of the real action event (e.g. open-browse-agent-modal) that
|
|
13
14
|
// originally opened the chat.
|
|
14
|
-
'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload']);
|
|
15
|
+
'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload', 'submit-rovo-remix']);
|
|
15
16
|
var isIgnoredForTriggerLatest = function isIgnoredForTriggerLatest(type) {
|
|
16
17
|
return ignoredTriggerLatestEvents.has(type);
|
|
17
18
|
};
|
|
@@ -157,6 +158,9 @@ var createPubSub = function createPubSub() {
|
|
|
157
158
|
};
|
|
158
159
|
};
|
|
159
160
|
var pubSub = createPubSub();
|
|
161
|
+
export var publish = function publish(topic, payload) {
|
|
162
|
+
pubSub.publish(topic, payload);
|
|
163
|
+
};
|
|
160
164
|
var usePubSub = function usePubSub() {
|
|
161
165
|
return pubSub;
|
|
162
166
|
};
|
package/dist/esm/types.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Transport } from './transport';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Override the transport (tests). Defaults to iframe<->parent `postMessage`. */
|
|
4
|
+
transport?: Transport;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Chat-iframe half of the bridge.
|
|
8
|
+
* - Inbound: deserializes context from the extension transport and re-publishes it onto the
|
|
9
|
+
* iframe's own `ai-mate` bus for the existing `ChatContextSubscriber` to consume unchanged.
|
|
10
|
+
* - Outbound: forwards allowlisted action payloads (e.g. `editor-suggestion`) back to the product,
|
|
11
|
+
* via the extension's content script.
|
|
12
|
+
*
|
|
13
|
+
* Content writes (`rovo-content-bridge-api` commands) are not handled here — that API already
|
|
14
|
+
* crosses this boundary on its own, so the extension only relays envelopes for it.
|
|
15
|
+
*
|
|
16
|
+
* Headless.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ExtensionContextBridgeClient: ({ transport }: Props) => null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Transport } from './transport';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Override the transport (tests). Defaults to same-window `postMessage`. */
|
|
4
|
+
transport?: Transport;
|
|
5
|
+
/** Resolves the current content id at relay time (a getter, so the Host reads it lazily). */
|
|
6
|
+
getContentId?: () => string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Product-window half of the bridge. Observes the `ai-mate` bus and mirrors allowlisted context out
|
|
10
|
+
* to the extension via same-window `postMessage` (see `./policy` for the allow/deny rules).
|
|
11
|
+
*
|
|
12
|
+
* The reverse direction is handled by the sibling `RovoPostMessagePubsubListener` in
|
|
13
|
+
* `ChatOpenerSubscriber`, not here. Headless; mounts at product root via `ChatOpenerSubscriber`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ExtensionContextBridgeHost: ({ transport, getContentId }: Props) => null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature gate for the extension context bridge; both Host and Client self-gate on it.
|
|
3
|
+
* `fg()` requires a static literal, so call sites inline this value rather than importing it;
|
|
4
|
+
* tests resolve the gate through this constant so the two cannot drift apart.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BRIDGE_FEATURE_GATE = "rovo-ext_context_bridge";
|
|
7
|
+
/** Marker on every bridge `postMessage`, so listeners can ignore unrelated messages. */
|
|
8
|
+
export declare const BRIDGE_MESSAGE_MARKER: '__rovoExtContextBridge';
|
|
9
|
+
/** Read context flows product -> extension; actions flow extension -> product. */
|
|
10
|
+
export declare const BRIDGE_TO_EXTENSION: 'to-extension';
|
|
11
|
+
export declare const BRIDGE_TO_PRODUCT: 'to-product';
|
|
12
|
+
/** Loop-guard sentinel stamped on re-published payloads so they never ping-pong. */
|
|
13
|
+
export declare const BRIDGE_SOURCE: 'rovo-extension-bridge';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Payload } from '../../../types';
|
|
2
|
+
/** Why a product-bus payload was or was not relayed. */
|
|
3
|
+
type InboundDecision = 'allow' | 'not-allowlisted' | 'denylisted';
|
|
4
|
+
/** Classify a product-bus payload. Relay iff `allow`. */
|
|
5
|
+
export declare const getInboundDecision: (type: Payload['type']) => InboundDecision;
|
|
6
|
+
/** True if a chat-bus payload of this type may be relayed back to the product. */
|
|
7
|
+
export declare const shouldRelayToProduct: (type: Payload['type']) => boolean;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Payload } from '../../../types';
|
|
2
|
+
import { type SerializedPayload } from './transport';
|
|
3
|
+
/** Serialise a payload for the wire, using a shim if one exists, else a generic JSON round-trip. */
|
|
4
|
+
export declare const serializePayload: (payload: Payload) => SerializedPayload | null;
|
|
5
|
+
/** Reconstruct a payload from the wire, stamping the loop-guard sentinel. */
|
|
6
|
+
export declare const deserializePayload: (serialized: SerializedPayload) => Payload | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Payload } from '../../../types';
|
|
2
|
+
import { BRIDGE_MESSAGE_MARKER } from './constants';
|
|
3
|
+
import type { BRIDGE_TO_EXTENSION, BRIDGE_TO_PRODUCT } from './constants';
|
|
4
|
+
type BridgeDirection = typeof BRIDGE_TO_EXTENSION | typeof BRIDGE_TO_PRODUCT;
|
|
5
|
+
/**
|
|
6
|
+
* A `rovo-triggers` payload reduced to a structured-clone-safe shape. Functions (e.g.
|
|
7
|
+
* `set-message-context`'s `setContext`) are resolved to values by `./registry` first.
|
|
8
|
+
*/
|
|
9
|
+
export type SerializedPayload = {
|
|
10
|
+
type: Payload['type'];
|
|
11
|
+
source?: string;
|
|
12
|
+
product?: Payload['product'];
|
|
13
|
+
openChat?: boolean;
|
|
14
|
+
data: unknown;
|
|
15
|
+
};
|
|
16
|
+
export type BridgeMessage = {
|
|
17
|
+
[BRIDGE_MESSAGE_MARKER]: true;
|
|
18
|
+
direction: BridgeDirection;
|
|
19
|
+
payload: SerializedPayload;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Transport abstraction so Host/Client work over any carrier: same-window `postMessage` on the
|
|
23
|
+
* product side, iframe/side-panel `postMessage` in the chat iframe. Carries `BridgeMessage` only;
|
|
24
|
+
* `rovo-content-bridge-api` commands travel separately, relayed verbatim by the extension.
|
|
25
|
+
*/
|
|
26
|
+
export type Transport = {
|
|
27
|
+
send: (message: BridgeMessage) => void;
|
|
28
|
+
/** Returns an unsubscribe function. */
|
|
29
|
+
subscribe: (handler: (message: BridgeMessage) => void) => () => void;
|
|
30
|
+
};
|
|
31
|
+
export declare const isBridgeMessage: (value: unknown) => value is BridgeMessage;
|
|
32
|
+
/** `postMessage`-based transport. Callers override `targetWindow`/`self` for the iframe side. */
|
|
33
|
+
export declare const createWindowTransport: ({ targetWindow, self: selfWindow, targetOrigin, }: {
|
|
34
|
+
targetWindow: Window;
|
|
35
|
+
self?: Window;
|
|
36
|
+
targetOrigin?: string;
|
|
37
|
+
}) => Transport;
|
|
38
|
+
export {};
|
package/dist/types/main.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface SubscribeOptions {
|
|
|
4
4
|
triggerLatest?: boolean;
|
|
5
5
|
consumeOnceKey?: string;
|
|
6
6
|
}
|
|
7
|
+
export declare const publish: (topic: Topic, payload: Payload) => void;
|
|
7
8
|
export declare const useSubscribe: ({ topic, triggerLatest, consumeOnceKey }: SubscribeOptions, callback: Callback) => void;
|
|
8
9
|
export declare const useSubscribeAll: (callback: Callback) => void;
|
|
9
10
|
export declare const usePublish: (topic: Topic) => ((payload: Payload) => void);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const Topics: {
|
|
|
11
11
|
readonly AI_MATE_INSERT_URLS: 'ai-mate-chat-inserts';
|
|
12
12
|
readonly AI_MATE_CHAT_INPUT_OVERLAY: 'ai-mate-chat-input-overlay';
|
|
13
13
|
readonly AI_MATE_AIFC: 'ai-mate-aifc';
|
|
14
|
+
readonly ROVO_REMIX: 'rovo-remix';
|
|
14
15
|
readonly AVP: 'avp';
|
|
15
16
|
};
|
|
16
17
|
export type Topic = (typeof Topics)[keyof typeof Topics];
|
|
@@ -293,6 +294,27 @@ export type ChatSmartLink3PPostAuthLaunchPayload = PayloadCore<'chat-smartlink-3
|
|
|
293
294
|
}>;
|
|
294
295
|
export type OpenBrowseAgentPayload = PayloadCore<'open-browse-agent-modal'>;
|
|
295
296
|
export type OpenBrowseAgentSidebarPayload = PayloadCore<'open-browse-agent-sidebar'>;
|
|
297
|
+
export type RovoRemixConsumer = 'editor' | 'renderer';
|
|
298
|
+
export type RovoRemixPreset = 'selection' | 'page';
|
|
299
|
+
export type RovoRemixOption = 'chart' | 'diagram' | 'infographic' | 'visual-aid' | 'slides' | 'whiteboard' | 'database' | 'custom' | 'image';
|
|
300
|
+
export type OpenRovoRemixSidebarPayload = PayloadCore<'open-rovo-remix-sidebar', {
|
|
301
|
+
remixConsumer: RovoRemixConsumer;
|
|
302
|
+
remixPreset: RovoRemixPreset;
|
|
303
|
+
}>;
|
|
304
|
+
export type UpdateRovoRemixPresetPayload = PayloadCore<'update-rovo-remix-preset', {
|
|
305
|
+
remixConsumer: RovoRemixConsumer;
|
|
306
|
+
remixPreset: RovoRemixPreset;
|
|
307
|
+
}>;
|
|
308
|
+
export type SubmitRovoRemixPayload = PayloadCore<'submit-rovo-remix', {
|
|
309
|
+
remixConsumer: RovoRemixConsumer;
|
|
310
|
+
remixPreset: RovoRemixPreset;
|
|
311
|
+
remixOption: RovoRemixOption;
|
|
312
|
+
remixSubType?: string;
|
|
313
|
+
userPrompt: string;
|
|
314
|
+
conversationId?: string;
|
|
315
|
+
}> & {
|
|
316
|
+
consumeOnce: true;
|
|
317
|
+
};
|
|
296
318
|
export type EditorSuggestionRichContent = {
|
|
297
319
|
type: 'text/adf';
|
|
298
320
|
version: 1;
|
|
@@ -617,7 +639,7 @@ export type SmartlinksSubscriptionChangedPayload = PayloadCore<'smartlinks-subsc
|
|
|
617
639
|
* is expected to be open at a time.
|
|
618
640
|
*/
|
|
619
641
|
export type CloseInContextAifcModalPayload = PayloadCore<'close-in-context-aifc-modal'>;
|
|
620
|
-
export type Payload = MessageSendPayload | ChatClosePayload | CloseInContextAifcModalPayload | SmartCreationModalOpenPayload | ChatNewPayload | InsightsOpenInChatPayload | InsightsChatExitedPayload | ChatDraftPayload | ChatSmartLink3PPostAuthLaunchPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | SmartlinksSubscriptionChangedPayload | OpenBrowseAgentSidebarPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | JiraCreateContextPayload | JiraInlineAgentCreationAgentAssignedPayload | JiraWorkItemsCreatingPayload | JiraWorkItemsCreatedPayload | JiraWorkItemsCreateFailedPayload | DatabaseContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | InsertSkillPayload | SelectActionPayload | AddChartToDashboardPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | StudioAutomationBuildUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload | SolutionArchitectAgentActivationFlowStartedPayload | SolutionArchitectAgentActivationFlowStoppedPayload | UpdateAgentConfigurationPayload | StudioLandingPageRedirectPayload | UploadAndInsertMediaPayload | SmartLinksContextPayload | SpaceSelectedPayload | SpaceDeselectedPayload | RecommendedSpacesSelectedPayload | CustomSkillUpdatePayload | TaskPlanConfirmedPayload | TaskAskQuestionRenderedPayload | TaskPlanRenderedPayload | TaskSkipAllQuestionsPayload | TaskCancelPlanPayload | TaskAskQuestionConfirmedPayload | TaskModifyPlanRequestedPayload | TaskModifyPlanSubmittedPayload | ConfluenceContentFinalizedPayload;
|
|
642
|
+
export type Payload = MessageSendPayload | ChatClosePayload | CloseInContextAifcModalPayload | SmartCreationModalOpenPayload | ChatNewPayload | InsightsOpenInChatPayload | InsightsChatExitedPayload | ChatDraftPayload | ChatSmartLink3PPostAuthLaunchPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | SmartlinksSubscriptionChangedPayload | OpenBrowseAgentSidebarPayload | OpenRovoRemixSidebarPayload | UpdateRovoRemixPresetPayload | SubmitRovoRemixPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | JiraCreateContextPayload | JiraInlineAgentCreationAgentAssignedPayload | JiraWorkItemsCreatingPayload | JiraWorkItemsCreatedPayload | JiraWorkItemsCreateFailedPayload | DatabaseContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | InsertSkillPayload | SelectActionPayload | AddChartToDashboardPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | StudioAutomationBuildUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload | SolutionArchitectAgentActivationFlowStartedPayload | SolutionArchitectAgentActivationFlowStoppedPayload | UpdateAgentConfigurationPayload | StudioLandingPageRedirectPayload | UploadAndInsertMediaPayload | SmartLinksContextPayload | SpaceSelectedPayload | SpaceDeselectedPayload | RecommendedSpacesSelectedPayload | CustomSkillUpdatePayload | TaskPlanConfirmedPayload | TaskAskQuestionRenderedPayload | TaskPlanRenderedPayload | TaskSkipAllQuestionsPayload | TaskCancelPlanPayload | TaskAskQuestionConfirmedPayload | TaskModifyPlanRequestedPayload | TaskModifyPlanSubmittedPayload | ConfluenceContentFinalizedPayload;
|
|
621
643
|
export type TaskPlanConfirmedPayload = PayloadCore<'task-plan-confirmed', {
|
|
622
644
|
conversationId: string;
|
|
623
645
|
planTitle: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/rovo-triggers/extension-context-bridge/client",
|
|
3
|
+
"main": "../../dist/cjs/common/utils/extension-context-bridge/ExtensionContextBridgeClient.js",
|
|
4
|
+
"module": "../../dist/esm/common/utils/extension-context-bridge/ExtensionContextBridgeClient.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/common/utils/extension-context-bridge/ExtensionContextBridgeClient.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/common/utils/extension-context-bridge/ExtensionContextBridgeClient.d.ts"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/rovo-triggers/extension-context-bridge/constants",
|
|
3
|
+
"main": "../../dist/cjs/common/utils/extension-context-bridge/constants.js",
|
|
4
|
+
"module": "../../dist/esm/common/utils/extension-context-bridge/constants.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/common/utils/extension-context-bridge/constants.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/common/utils/extension-context-bridge/constants.d.ts"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/rovo-triggers/extension-context-bridge/host",
|
|
3
|
+
"main": "../../dist/cjs/common/utils/extension-context-bridge/ExtensionContextBridgeHost.js",
|
|
4
|
+
"module": "../../dist/esm/common/utils/extension-context-bridge/ExtensionContextBridgeHost.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/common/utils/extension-context-bridge/ExtensionContextBridgeHost.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/common/utils/extension-context-bridge/ExtensionContextBridgeHost.d.ts"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/rovo-triggers/extension-context-bridge/transport",
|
|
3
|
+
"main": "../../dist/cjs/common/utils/extension-context-bridge/transport.js",
|
|
4
|
+
"module": "../../dist/esm/common/utils/extension-context-bridge/transport.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/common/utils/extension-context-bridge/transport.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/common/utils/extension-context-bridge/transport.d.ts"
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rovo-triggers",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.16.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": {
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
"@atlaskit/css": "^1.0.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.2.0",
|
|
45
45
|
"@atlaskit/ssr": "workspace:^",
|
|
46
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
47
|
-
"@atlassian/conversation-assistant-service-api": "^16.
|
|
46
|
+
"@atlassian/a11y-jest-testing": "^0.16.0",
|
|
47
|
+
"@atlassian/conversation-assistant-service-api": "^16.5.0",
|
|
48
48
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
49
|
+
"@atlassian/testing-library": "^0.11.0",
|
|
49
50
|
"@testing-library/react": "^16.3.0",
|
|
50
51
|
"react": "^18.2.0",
|
|
51
52
|
"react-dom": "^18.2.0",
|
|
@@ -85,5 +86,10 @@
|
|
|
85
86
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
86
87
|
]
|
|
87
88
|
}
|
|
89
|
+
},
|
|
90
|
+
"platform-feature-flags": {
|
|
91
|
+
"rovo-ext_context_bridge": {
|
|
92
|
+
"type": "boolean"
|
|
93
|
+
}
|
|
88
94
|
}
|
|
89
95
|
}
|