@atlaskit/rovo-agent-components 8.10.6 → 8.12.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 +28 -0
- package/agent-conversation-starters/package.json +10 -0
- package/conversation-starters/package.json +10 -0
- package/dist/cjs/common/ui/agent-chat-icon/index.js +1 -1
- package/dist/cjs/common/ui/chat-pill/index.js +1 -1
- package/dist/cjs/common/ui/link-icon-button/index.js +1 -1
- package/dist/cjs/common/ui/star-icon-button/index.js +1 -1
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/ui/agent-avatar/agent-avatar-skeleton/index.js +1 -1
- package/dist/cjs/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +73 -0
- package/dist/cjs/ui/agent-avatar/generated-avatars/index.js +16 -1
- package/dist/cjs/ui/agent-avatar/index.js +1 -1
- package/dist/cjs/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js +88 -0
- package/dist/cjs/ui/agent-avatar/resolved-agent-avatar/__generated__/ResolvedAgentAvatarQuery.graphql.js +83 -0
- package/dist/cjs/ui/agent-conversation-starters/AgentConversationStarters.js +44 -0
- package/dist/cjs/ui/agent-conversation-starters/ConversationStarters.js +78 -0
- package/dist/cjs/ui/agent-conversation-starters/getConversationStarters.js +49 -0
- package/dist/cjs/ui/agent-conversation-starters/index.js +21 -149
- package/dist/cjs/ui/agent-dropdown-menu/AgentDropdownMenu.js +223 -0
- package/dist/cjs/ui/agent-dropdown-menu/ChatToAgentButton.js +46 -0
- package/dist/cjs/ui/agent-dropdown-menu/index.js +14 -249
- package/dist/cjs/ui/agent-menu-item-skeleton/index.js +1 -1
- package/dist/cjs/ui/agent-name-side-nav/index.js +1 -1
- package/dist/cjs/ui/agent-profile-info/agent-star-count/index.js +1 -1
- package/dist/cjs/ui/agent-profile-info/index.js +1 -1
- package/dist/cjs/ui/agent-verified/agent-verified-icon.js +40 -0
- package/dist/cjs/ui/agent-verified/agent-verified.js +22 -0
- package/dist/cjs/ui/agent-verified/agent-verified.stories.js +6 -6
- package/dist/cjs/ui/agent-verified/index.js +13 -47
- package/dist/es2019/common/ui/agent-chat-icon/index.js +1 -1
- package/dist/es2019/common/ui/chat-pill/index.js +1 -1
- package/dist/es2019/common/ui/link-icon-button/index.js +1 -1
- package/dist/es2019/common/ui/star-icon-button/index.js +1 -1
- package/dist/es2019/index.js +4 -2
- package/dist/es2019/ui/agent-avatar/agent-avatar-skeleton/index.js +1 -1
- package/dist/es2019/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +65 -0
- package/dist/es2019/ui/agent-avatar/generated-avatars/index.js +10 -1
- package/dist/es2019/ui/agent-avatar/index.js +1 -1
- package/dist/es2019/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js +78 -0
- package/dist/es2019/ui/agent-avatar/resolved-agent-avatar/__generated__/ResolvedAgentAvatarQuery.graphql.js +77 -0
- package/dist/es2019/ui/agent-conversation-starters/AgentConversationStarters.js +30 -0
- package/dist/es2019/ui/agent-conversation-starters/ConversationStarters.js +67 -0
- package/dist/es2019/ui/agent-conversation-starters/getConversationStarters.js +42 -0
- package/dist/es2019/ui/agent-conversation-starters/index.js +20 -136
- package/dist/es2019/ui/agent-dropdown-menu/AgentDropdownMenu.js +160 -0
- package/dist/es2019/ui/agent-dropdown-menu/ChatToAgentButton.js +39 -0
- package/dist/es2019/ui/agent-dropdown-menu/index.js +14 -192
- package/dist/es2019/ui/agent-menu-item-skeleton/index.js +1 -1
- package/dist/es2019/ui/agent-name-side-nav/index.js +1 -1
- package/dist/es2019/ui/agent-profile-info/agent-star-count/index.js +1 -1
- package/dist/es2019/ui/agent-profile-info/index.js +1 -1
- package/dist/es2019/ui/agent-verified/agent-verified-icon.js +34 -0
- package/dist/es2019/ui/agent-verified/agent-verified.js +16 -0
- package/dist/es2019/ui/agent-verified/agent-verified.stories.js +2 -2
- package/dist/es2019/ui/agent-verified/index.js +11 -48
- package/dist/esm/common/ui/agent-chat-icon/index.js +1 -1
- package/dist/esm/common/ui/chat-pill/index.js +1 -1
- package/dist/esm/common/ui/link-icon-button/index.js +1 -1
- package/dist/esm/common/ui/star-icon-button/index.js +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/ui/agent-avatar/agent-avatar-skeleton/index.js +1 -1
- package/dist/esm/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +66 -0
- package/dist/esm/ui/agent-avatar/generated-avatars/index.js +14 -1
- package/dist/esm/ui/agent-avatar/index.js +1 -1
- package/dist/esm/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js +78 -0
- package/dist/esm/ui/agent-avatar/resolved-agent-avatar/__generated__/ResolvedAgentAvatarQuery.graphql.js +77 -0
- package/dist/esm/ui/agent-conversation-starters/AgentConversationStarters.js +35 -0
- package/dist/esm/ui/agent-conversation-starters/ConversationStarters.js +71 -0
- package/dist/esm/ui/agent-conversation-starters/getConversationStarters.js +42 -0
- package/dist/esm/ui/agent-conversation-starters/index.js +20 -145
- package/dist/esm/ui/agent-dropdown-menu/AgentDropdownMenu.js +214 -0
- package/dist/esm/ui/agent-dropdown-menu/ChatToAgentButton.js +37 -0
- package/dist/esm/ui/agent-dropdown-menu/index.js +14 -244
- package/dist/esm/ui/agent-menu-item-skeleton/index.js +1 -1
- package/dist/esm/ui/agent-name-side-nav/index.js +1 -1
- package/dist/esm/ui/agent-profile-info/agent-star-count/index.js +1 -1
- package/dist/esm/ui/agent-profile-info/index.js +1 -1
- package/dist/esm/ui/agent-verified/agent-verified-icon.js +33 -0
- package/dist/esm/ui/agent-verified/agent-verified.js +15 -0
- package/dist/esm/ui/agent-verified/agent-verified.stories.js +2 -2
- package/dist/esm/ui/agent-verified/index.js +11 -46
- package/dist/types/index.d.ts +7 -2
- package/dist/types/ui/agent-avatar/generated-avatars/assets/content-reviewer.d.ts +8 -0
- package/dist/types/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.d.ts +18 -0
- package/dist/types/ui/agent-avatar/resolved-agent-avatar/__generated__/ResolvedAgentAvatarQuery.graphql.d.ts +23 -0
- package/dist/types/ui/agent-conversation-starters/AgentConversationStarters.d.ts +8 -0
- package/dist/types/ui/agent-conversation-starters/ConversationStarters.d.ts +11 -0
- package/dist/types/ui/agent-conversation-starters/getConversationStarters.d.ts +14 -0
- package/dist/types/ui/agent-conversation-starters/index.d.ts +14 -27
- package/dist/types/ui/agent-dropdown-menu/AgentDropdownMenu.d.ts +57 -0
- package/dist/types/ui/agent-dropdown-menu/ChatToAgentButton.d.ts +10 -0
- package/dist/types/ui/agent-dropdown-menu/index.d.ts +8 -58
- package/dist/types/ui/agent-verified/agent-verified-icon.d.ts +3 -0
- package/dist/types/ui/agent-verified/agent-verified.d.ts +13 -0
- package/dist/types/ui/agent-verified/index.d.ts +10 -14
- package/get-conversation-starters/package.json +10 -0
- package/package.json +3 -2
- package/ui/agent-avatar/ResolvedAgentAvatar/package.json +10 -0
- package/ui/agent-dropdown-menu/agent-dropdown-menu/package.json +10 -0
- package/ui/agent-dropdown-menu/chat-to-agent-button/package.json +10 -0
- package/ui/agent-verified/agent-verified/package.json +10 -0
- package/ui/agent-verified/agent-verified-icon/package.json +10 -0
- /package/dist/cjs/ui/agent-conversation-starters/{index.compiled.css → ConversationStarters.compiled.css} +0 -0
- /package/dist/cjs/ui/agent-dropdown-menu/{index.compiled.css → ChatToAgentButton.compiled.css} +0 -0
- /package/dist/cjs/ui/agent-verified/{index.compiled.css → agent-verified-icon.compiled.css} +0 -0
- /package/dist/es2019/ui/agent-conversation-starters/{index.compiled.css → ConversationStarters.compiled.css} +0 -0
- /package/dist/es2019/ui/agent-dropdown-menu/{index.compiled.css → ChatToAgentButton.compiled.css} +0 -0
- /package/dist/es2019/ui/agent-verified/{index.compiled.css → agent-verified-icon.compiled.css} +0 -0
- /package/dist/esm/ui/agent-conversation-starters/{index.compiled.css → ConversationStarters.compiled.css} +0 -0
- /package/dist/esm/ui/agent-dropdown-menu/{index.compiled.css → ChatToAgentButton.compiled.css} +0 -0
- /package/dist/esm/ui/agent-verified/{index.compiled.css → agent-verified-icon.compiled.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { lazy, Suspense, useEffect } from 'react';
|
|
@@ -64,6 +64,7 @@ const ReplitAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "
|
|
|
64
64
|
const RovoAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-RovoAgentAvatar"*/'./assets/rovo-agent'));
|
|
65
65
|
const JiraWorkAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-JiraWorkAgentAvatar"*/'./assets/jira-work-agent'));
|
|
66
66
|
const JiraTaskPlannerAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-JiraTaskPlannerAgentAvatar"*/'./assets/jira-task-planner-agent'));
|
|
67
|
+
const ContentReviewerAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-ContentReviewerAvatar"*/'./assets/content-reviewer'));
|
|
67
68
|
const JiraCodingAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-JiraCodingAgentAvatar"*/'./assets/jira-coding-agent'));
|
|
68
69
|
const JiraIntelligentTriageAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-JiraIntelligentTriageAgentAvatar"*/'./assets/jira-intelligent-triage-agent'));
|
|
69
70
|
const JsmServiceTriageAgentAvatar = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-rovo-avatar-JsmServiceTriageAgentAvatar"*/'./assets/jsm-service-triage-agent'));
|
|
@@ -195,6 +196,14 @@ const outOfTheBoxAgentAvatar = {
|
|
|
195
196
|
}),
|
|
196
197
|
color: blueColor
|
|
197
198
|
},
|
|
199
|
+
content_reviewer_agent: {
|
|
200
|
+
getRender: size => /*#__PURE__*/React.createElement(ContentReviewerAvatar, {
|
|
201
|
+
size: AVATAR_SIZES[size],
|
|
202
|
+
primaryColor: "",
|
|
203
|
+
secondaryColor: ""
|
|
204
|
+
}),
|
|
205
|
+
color: blueColor
|
|
206
|
+
},
|
|
198
207
|
user_manual_writer_agent: {
|
|
199
208
|
getRender: size => /*#__PURE__*/React.createElement(MyUserManualAvatar, {
|
|
200
209
|
size: AVATAR_SIZES[size],
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _ResolvedAgentAvatarQuery from "./__generated__/ResolvedAgentAvatarQuery.graphql";
|
|
2
|
+
import React, { Suspense } from 'react';
|
|
3
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
|
+
import { graphql, useLazyLoadQuery } from 'react-relay';
|
|
5
|
+
import AvatarSkeleton from '@atlaskit/avatar/Skeleton';
|
|
6
|
+
// A relative import, not the package's own public subpath: a package can't resolve its own
|
|
7
|
+
// name from within itself when building its published type declarations in isolation.
|
|
8
|
+
import { AgentAvatar } from '../index';
|
|
9
|
+
// The fixed partition/resource-owner/resource-type segments of an identity user ARI — only the
|
|
10
|
+
// account id itself varies. Matched by prefix rather than via `@atlassian/ari` (an internal
|
|
11
|
+
// package this public package can't depend on).
|
|
12
|
+
const IDENTITY_USER_ARI_PREFIX = 'ari:cloud:identity::user/';
|
|
13
|
+
|
|
14
|
+
/** Parses the account id needed for the picture fetch from the identity ARI a caller carries. */
|
|
15
|
+
const parseIdentityAccountId = value => {
|
|
16
|
+
const trimmed = value === null || value === void 0 ? void 0 : value.trim();
|
|
17
|
+
return trimmed !== null && trimmed !== void 0 && trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : undefined;
|
|
18
|
+
};
|
|
19
|
+
const FetchedAgentAvatar = ({
|
|
20
|
+
accountId,
|
|
21
|
+
agentName,
|
|
22
|
+
fallback,
|
|
23
|
+
showBorder,
|
|
24
|
+
size
|
|
25
|
+
}) => {
|
|
26
|
+
var _data$user, _data$user$picture, _data$user2, _data$user2$name;
|
|
27
|
+
const data = useLazyLoadQuery(_ResolvedAgentAvatarQuery, {
|
|
28
|
+
accountId
|
|
29
|
+
}, {
|
|
30
|
+
fetchPolicy: 'store-or-network'
|
|
31
|
+
});
|
|
32
|
+
const picture = (_data$user = data.user) === null || _data$user === void 0 ? void 0 : (_data$user$picture = _data$user.picture) === null || _data$user$picture === void 0 ? void 0 : _data$user$picture.trim();
|
|
33
|
+
if (!picture) {
|
|
34
|
+
return fallback;
|
|
35
|
+
}
|
|
36
|
+
const name = ((_data$user2 = data.user) === null || _data$user2 === void 0 ? void 0 : (_data$user2$name = _data$user2.name) === null || _data$user2$name === void 0 ? void 0 : _data$user2$name.trim()) || agentName;
|
|
37
|
+
return /*#__PURE__*/React.createElement(AgentAvatar, {
|
|
38
|
+
imageUrl: picture,
|
|
39
|
+
name: name,
|
|
40
|
+
label: name,
|
|
41
|
+
showBorder: showBorder,
|
|
42
|
+
size: size
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The best avatar available for an agent identity: the real account picture when one can be
|
|
48
|
+
* fetched, otherwise the caller-supplied `fallback`. Works for any identity with an
|
|
49
|
+
* `agentIdentityAccountId` — including the default Rovo agent, now that Rovo is provisioned its
|
|
50
|
+
* own identity account. A `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a
|
|
51
|
+
* failed or unavailable fetch from ever breaking the caller — it just renders `fallback`.
|
|
52
|
+
*/
|
|
53
|
+
export const ResolvedAgentAvatar = ({
|
|
54
|
+
agentIdentityAccountId,
|
|
55
|
+
agentName,
|
|
56
|
+
fallback,
|
|
57
|
+
showBorder = false,
|
|
58
|
+
size = 'medium'
|
|
59
|
+
}) => {
|
|
60
|
+
const accountId = parseIdentityAccountId(agentIdentityAccountId);
|
|
61
|
+
if (!accountId) {
|
|
62
|
+
return fallback;
|
|
63
|
+
}
|
|
64
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
65
|
+
fallback: fallback
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
67
|
+
fallback: /*#__PURE__*/React.createElement(AvatarSkeleton, {
|
|
68
|
+
appearance: "hexagon",
|
|
69
|
+
size: size
|
|
70
|
+
})
|
|
71
|
+
}, /*#__PURE__*/React.createElement(FetchedAgentAvatar, {
|
|
72
|
+
accountId: accountId,
|
|
73
|
+
agentName: agentName,
|
|
74
|
+
fallback: fallback,
|
|
75
|
+
showBorder: showBorder,
|
|
76
|
+
size: size
|
|
77
|
+
})));
|
|
78
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<765322731b31afdb0584c134ed53e12a>>
|
|
3
|
+
* @relayHash 07c2f9612a7a8401a21c6ad1a0936b2d
|
|
4
|
+
* @lightSyntaxTransform
|
|
5
|
+
* @nogrep
|
|
6
|
+
* @codegen-command: yarn relay
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* tslint:disable */
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
// @ts-nocheck
|
|
12
|
+
|
|
13
|
+
// @relayRequestID aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5
|
|
14
|
+
|
|
15
|
+
const node = function () {
|
|
16
|
+
var v0 = [{
|
|
17
|
+
"defaultValue": null,
|
|
18
|
+
"kind": "LocalArgument",
|
|
19
|
+
"name": "accountId"
|
|
20
|
+
}],
|
|
21
|
+
v1 = [{
|
|
22
|
+
"kind": "Variable",
|
|
23
|
+
"name": "accountId",
|
|
24
|
+
"variableName": "accountId"
|
|
25
|
+
}],
|
|
26
|
+
v2 = {
|
|
27
|
+
"kind": "ScalarField",
|
|
28
|
+
"name": "name"
|
|
29
|
+
},
|
|
30
|
+
v3 = {
|
|
31
|
+
"kind": "ScalarField",
|
|
32
|
+
"name": "picture"
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
"fragment": {
|
|
36
|
+
"argumentDefinitions": v0 /*: any*/,
|
|
37
|
+
"kind": "Fragment",
|
|
38
|
+
"name": "ResolvedAgentAvatarQuery",
|
|
39
|
+
"selections": [{
|
|
40
|
+
"args": v1 /*: any*/,
|
|
41
|
+
"kind": "LinkedField",
|
|
42
|
+
"name": "user",
|
|
43
|
+
"plural": false,
|
|
44
|
+
"selections": [v2 /*: any*/, v3 /*: any*/]
|
|
45
|
+
}],
|
|
46
|
+
"type": "Query"
|
|
47
|
+
},
|
|
48
|
+
"kind": "Request",
|
|
49
|
+
"operation": {
|
|
50
|
+
"argumentDefinitions": v0 /*: any*/,
|
|
51
|
+
"kind": "Operation",
|
|
52
|
+
"name": "ResolvedAgentAvatarQuery",
|
|
53
|
+
"selections": [{
|
|
54
|
+
"args": v1 /*: any*/,
|
|
55
|
+
"kind": "LinkedField",
|
|
56
|
+
"name": "user",
|
|
57
|
+
"plural": false,
|
|
58
|
+
"selections": [{
|
|
59
|
+
"kind": "ScalarField",
|
|
60
|
+
"name": "__typename"
|
|
61
|
+
}, v2 /*: any*/, v3 /*: any*/, {
|
|
62
|
+
"kind": "ScalarField",
|
|
63
|
+
"name": "id"
|
|
64
|
+
}]
|
|
65
|
+
}]
|
|
66
|
+
},
|
|
67
|
+
"params": {
|
|
68
|
+
"id": "aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5",
|
|
69
|
+
"metadata": {},
|
|
70
|
+
"name": "ResolvedAgentAvatarQuery",
|
|
71
|
+
"operationKind": "query",
|
|
72
|
+
"text": null
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}();
|
|
76
|
+
node.hash = "a2c97e7ac7feca789629a3b50c6150aa";
|
|
77
|
+
export default node;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { ConversationStarters } from './ConversationStarters';
|
|
5
|
+
import { getConversationStarters } from './getConversationStarters';
|
|
6
|
+
export const AgentConversationStarters = ({
|
|
7
|
+
userDefinedConversationStarters,
|
|
8
|
+
isAgentDefault,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage
|
|
13
|
+
} = useIntl();
|
|
14
|
+
const {
|
|
15
|
+
combinedConversationStarters
|
|
16
|
+
} = useMemo(() => getConversationStarters({
|
|
17
|
+
userDefinedConversationStarters,
|
|
18
|
+
isAgentDefault
|
|
19
|
+
}), [userDefinedConversationStarters, isAgentDefault]);
|
|
20
|
+
const starters = useMemo(() => combinedConversationStarters.map(starter => typeof starter.message === 'string' ? {
|
|
21
|
+
message: starter.message,
|
|
22
|
+
type: starter.type
|
|
23
|
+
} : {
|
|
24
|
+
message: formatMessage(starter.message),
|
|
25
|
+
type: starter.type
|
|
26
|
+
}), [combinedConversationStarters, formatMessage]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(ConversationStarters, _extends({
|
|
28
|
+
starters: starters
|
|
29
|
+
}, props));
|
|
30
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* ConversationStarters.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import "./ConversationStarters.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
6
|
+
import { cx } from '@atlaskit/css';
|
|
7
|
+
import RetryIcon from '@atlaskit/icon/core/retry';
|
|
8
|
+
import { Box, Inline, Pressable, Stack } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
|
+
import { AgentChatIcon } from '../../common/ui/agent-chat-icon';
|
|
11
|
+
import { BrowseAgentsPill } from '../../common/ui/chat-pill';
|
|
12
|
+
const styles = {
|
|
13
|
+
conversationStartersList: "_qtt8glyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bsb1osq",
|
|
14
|
+
conversationStartersListWithRefreshDesign: "_19pkze3t",
|
|
15
|
+
conversationStaterItem: "_ca0qze3t",
|
|
16
|
+
conversationStarterIcon: "_1o9zidpf",
|
|
17
|
+
conversationStarterText: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c _1o9zkb7n _1ul9idpf",
|
|
18
|
+
button: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek",
|
|
19
|
+
button_motion: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek"
|
|
20
|
+
};
|
|
21
|
+
export const ConversationStarters = ({
|
|
22
|
+
starters,
|
|
23
|
+
onConversationStarterClick,
|
|
24
|
+
showReloadButton = false,
|
|
25
|
+
onReloadButtonClick = () => {},
|
|
26
|
+
onBrowseAgentsClick,
|
|
27
|
+
refreshDesignEnabled = false
|
|
28
|
+
}) => {
|
|
29
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
30
|
+
as: "ul",
|
|
31
|
+
space: "space.050",
|
|
32
|
+
xcss: cx(styles.conversationStartersList, refreshDesignEnabled && styles.conversationStartersListWithRefreshDesign)
|
|
33
|
+
}, starters.map((starter, index) => {
|
|
34
|
+
const isLastStarter = index === starters.length - 1;
|
|
35
|
+
const chatPill = /*#__PURE__*/React.createElement(Box, {
|
|
36
|
+
as: "li",
|
|
37
|
+
key: starter.message,
|
|
38
|
+
xcss: refreshDesignEnabled && styles.conversationStaterItem
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
40
|
+
xcss: fg('platform-dst-motion-uplift-custom-button') ? styles.button_motion : styles.button,
|
|
41
|
+
onClick: () => onConversationStarterClick(starter),
|
|
42
|
+
testId: "conversation-starter"
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
44
|
+
space: "space.150",
|
|
45
|
+
alignBlock: "center"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
47
|
+
xcss: styles.conversationStarterIcon
|
|
48
|
+
}, /*#__PURE__*/React.createElement(AgentChatIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
49
|
+
xcss: styles.conversationStarterText
|
|
50
|
+
}, starter.message))));
|
|
51
|
+
return isLastStarter && showReloadButton ? /*#__PURE__*/React.createElement(Inline, {
|
|
52
|
+
space: "space.050",
|
|
53
|
+
grow: "fill",
|
|
54
|
+
alignInline: "end",
|
|
55
|
+
key: starter.message
|
|
56
|
+
}, chatPill, /*#__PURE__*/React.createElement(IconButton, {
|
|
57
|
+
icon: RetryIcon,
|
|
58
|
+
onClick: onReloadButtonClick,
|
|
59
|
+
appearance: "subtle",
|
|
60
|
+
label: ""
|
|
61
|
+
})) : chatPill;
|
|
62
|
+
}), !!onBrowseAgentsClick && /*#__PURE__*/React.createElement(Box, {
|
|
63
|
+
as: "li"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(BrowseAgentsPill, {
|
|
65
|
+
onClick: onBrowseAgentsClick
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { messages } from './messages';
|
|
2
|
+
export const getConversationStarters = ({
|
|
3
|
+
userDefinedConversationStarters: userDefinedConversationStartersParam,
|
|
4
|
+
isAgentDefault
|
|
5
|
+
}) => {
|
|
6
|
+
const type = 'static';
|
|
7
|
+
const customAgentConversationStarters = [{
|
|
8
|
+
message: messages.agentEmptyStateSuggestion1,
|
|
9
|
+
type
|
|
10
|
+
}, {
|
|
11
|
+
message: messages.agentEmptyStateSuggestion2,
|
|
12
|
+
type
|
|
13
|
+
}, {
|
|
14
|
+
message: messages.agentEmptyStateSuggestion3,
|
|
15
|
+
type
|
|
16
|
+
}];
|
|
17
|
+
const userDefinedConversationStarters = userDefinedConversationStartersParam !== null && userDefinedConversationStartersParam !== void 0 ? userDefinedConversationStartersParam : [];
|
|
18
|
+
const defaultAgentConversationStarters = [{
|
|
19
|
+
message: messages.emptyStateSuggestion1,
|
|
20
|
+
type
|
|
21
|
+
}, {
|
|
22
|
+
message: messages.emptyStateSuggestion2,
|
|
23
|
+
type
|
|
24
|
+
}, {
|
|
25
|
+
message: messages.emptyStateSuggestion3,
|
|
26
|
+
type
|
|
27
|
+
}];
|
|
28
|
+
const getCombinedConversationStarters = () => {
|
|
29
|
+
const shouldCombine = !isAgentDefault;
|
|
30
|
+
if (shouldCombine) {
|
|
31
|
+
// Return user defined suggestions + static fallback suggestions with a max of 3 suggestions (user defined taking precendence over fallback)
|
|
32
|
+
return [...userDefinedConversationStarters, ...customAgentConversationStarters].slice(0, 3);
|
|
33
|
+
}
|
|
34
|
+
return defaultAgentConversationStarters;
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
userDefinedConversationStarters,
|
|
38
|
+
customAgentConversationStarters,
|
|
39
|
+
defaultAgentConversationStarters,
|
|
40
|
+
combinedConversationStarters: getCombinedConversationStarters()
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,136 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
button: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek",
|
|
22
|
-
button_motion: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek"
|
|
23
|
-
};
|
|
24
|
-
export const getConversationStarters = ({
|
|
25
|
-
userDefinedConversationStarters: userDefinedConversationStartersParam,
|
|
26
|
-
isAgentDefault
|
|
27
|
-
}) => {
|
|
28
|
-
const type = 'static';
|
|
29
|
-
const customAgentConversationStarters = [{
|
|
30
|
-
message: messages.agentEmptyStateSuggestion1,
|
|
31
|
-
type
|
|
32
|
-
}, {
|
|
33
|
-
message: messages.agentEmptyStateSuggestion2,
|
|
34
|
-
type
|
|
35
|
-
}, {
|
|
36
|
-
message: messages.agentEmptyStateSuggestion3,
|
|
37
|
-
type
|
|
38
|
-
}];
|
|
39
|
-
const userDefinedConversationStarters = userDefinedConversationStartersParam !== null && userDefinedConversationStartersParam !== void 0 ? userDefinedConversationStartersParam : [];
|
|
40
|
-
const defaultAgentConversationStarters = [{
|
|
41
|
-
message: messages.emptyStateSuggestion1,
|
|
42
|
-
type
|
|
43
|
-
}, {
|
|
44
|
-
message: messages.emptyStateSuggestion2,
|
|
45
|
-
type
|
|
46
|
-
}, {
|
|
47
|
-
message: messages.emptyStateSuggestion3,
|
|
48
|
-
type
|
|
49
|
-
}];
|
|
50
|
-
const getCombinedConversationStarters = () => {
|
|
51
|
-
const shouldCombine = !isAgentDefault;
|
|
52
|
-
if (shouldCombine) {
|
|
53
|
-
// Return user defined suggestions + static fallback suggestions with a max of 3 suggestions (user defined taking precendence over fallback)
|
|
54
|
-
return [...userDefinedConversationStarters, ...customAgentConversationStarters].slice(0, 3);
|
|
55
|
-
}
|
|
56
|
-
return defaultAgentConversationStarters;
|
|
57
|
-
};
|
|
58
|
-
return {
|
|
59
|
-
userDefinedConversationStarters,
|
|
60
|
-
customAgentConversationStarters,
|
|
61
|
-
defaultAgentConversationStarters,
|
|
62
|
-
combinedConversationStarters: getCombinedConversationStarters()
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export const AgentConversationStarters = ({
|
|
66
|
-
userDefinedConversationStarters,
|
|
67
|
-
isAgentDefault,
|
|
68
|
-
...props
|
|
69
|
-
}) => {
|
|
70
|
-
const {
|
|
71
|
-
formatMessage
|
|
72
|
-
} = useIntl();
|
|
73
|
-
const {
|
|
74
|
-
combinedConversationStarters
|
|
75
|
-
} = useMemo(() => getConversationStarters({
|
|
76
|
-
userDefinedConversationStarters,
|
|
77
|
-
isAgentDefault
|
|
78
|
-
}), [userDefinedConversationStarters, isAgentDefault]);
|
|
79
|
-
const starters = useMemo(() => combinedConversationStarters.map(starter => typeof starter.message === 'string' ? {
|
|
80
|
-
message: starter.message,
|
|
81
|
-
type: starter.type
|
|
82
|
-
} : {
|
|
83
|
-
message: formatMessage(starter.message),
|
|
84
|
-
type: starter.type
|
|
85
|
-
}), [combinedConversationStarters, formatMessage]);
|
|
86
|
-
return /*#__PURE__*/React.createElement(ConversationStarters, _extends({
|
|
87
|
-
starters: starters
|
|
88
|
-
}, props));
|
|
89
|
-
};
|
|
90
|
-
export const ConversationStarters = ({
|
|
91
|
-
starters,
|
|
92
|
-
onConversationStarterClick,
|
|
93
|
-
showReloadButton = false,
|
|
94
|
-
onReloadButtonClick = () => {},
|
|
95
|
-
onBrowseAgentsClick,
|
|
96
|
-
refreshDesignEnabled = false
|
|
97
|
-
}) => {
|
|
98
|
-
return /*#__PURE__*/React.createElement(Stack, {
|
|
99
|
-
as: "ul",
|
|
100
|
-
space: "space.050",
|
|
101
|
-
xcss: cx(styles.conversationStartersList, refreshDesignEnabled && styles.conversationStartersListWithRefreshDesign)
|
|
102
|
-
}, starters.map((starter, index) => {
|
|
103
|
-
const isLastStarter = index === starters.length - 1;
|
|
104
|
-
const chatPill = /*#__PURE__*/React.createElement(Box, {
|
|
105
|
-
as: "li",
|
|
106
|
-
key: starter.message,
|
|
107
|
-
xcss: refreshDesignEnabled && styles.conversationStaterItem
|
|
108
|
-
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
109
|
-
xcss: fg('platform-dst-motion-uplift-custom-button') ? styles.button_motion : styles.button,
|
|
110
|
-
onClick: () => onConversationStarterClick(starter),
|
|
111
|
-
testId: "conversation-starter"
|
|
112
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
113
|
-
space: "space.150",
|
|
114
|
-
alignBlock: "center"
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
116
|
-
xcss: styles.conversationStarterIcon
|
|
117
|
-
}, /*#__PURE__*/React.createElement(AgentChatIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
118
|
-
xcss: styles.conversationStarterText
|
|
119
|
-
}, starter.message))));
|
|
120
|
-
return isLastStarter && showReloadButton ? /*#__PURE__*/React.createElement(Inline, {
|
|
121
|
-
space: "space.050",
|
|
122
|
-
grow: "fill",
|
|
123
|
-
alignInline: "end",
|
|
124
|
-
key: starter.message
|
|
125
|
-
}, chatPill, /*#__PURE__*/React.createElement(IconButton, {
|
|
126
|
-
icon: RetryIcon,
|
|
127
|
-
onClick: onReloadButtonClick,
|
|
128
|
-
appearance: "subtle",
|
|
129
|
-
label: ""
|
|
130
|
-
})) : chatPill;
|
|
131
|
-
}), !!onBrowseAgentsClick && /*#__PURE__*/React.createElement(Box, {
|
|
132
|
-
as: "li"
|
|
133
|
-
}, /*#__PURE__*/React.createElement(BrowseAgentsPill, {
|
|
134
|
-
onClick: onBrowseAgentsClick
|
|
135
|
-
})));
|
|
136
|
-
};
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `import { getConversationStarters } from '@atlaskit/rovo-agent-components/get-conversation-starters'` instead.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
7
|
+
export { getConversationStarters } from './getConversationStarters';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import { AgentConversationStarters } from '@atlaskit/rovo-agent-components/agent-conversation-starters'` instead.
|
|
10
|
+
*/
|
|
11
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
12
|
+
export { AgentConversationStarters } from './AgentConversationStarters';
|
|
13
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `import { ConversationStarters } from '@atlaskit/rovo-agent-components/conversation-starters'` instead.
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
19
|
+
export { ConversationStarters } from './ConversationStarters';
|
|
20
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* AgentDropdownMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
7
|
+
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
|
|
8
|
+
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
|
|
9
|
+
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
|
|
10
|
+
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
|
+
import { Inline } from '@atlaskit/primitives/compiled';
|
|
13
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
14
|
+
import { AgentVerificationDropdownItem } from '../agent-verification-dropdown-item';
|
|
15
|
+
import messages from './messages';
|
|
16
|
+
export const AgentDropdownMenu = ({
|
|
17
|
+
isAutodevTemplateAgent,
|
|
18
|
+
onEditAgent,
|
|
19
|
+
onCopyAgent,
|
|
20
|
+
onDuplicateAgent,
|
|
21
|
+
onDeleteAgent,
|
|
22
|
+
onViewAgentFullProfileClick,
|
|
23
|
+
onOpenChange,
|
|
24
|
+
isForgeAgent,
|
|
25
|
+
showDeleteOption = true,
|
|
26
|
+
showViewAgentOption = false,
|
|
27
|
+
onViewAgentClick,
|
|
28
|
+
onDropdownTriggerClick,
|
|
29
|
+
spacing,
|
|
30
|
+
appearance,
|
|
31
|
+
dropdownMenuTestId,
|
|
32
|
+
doesAgentHaveIdentityAccountId,
|
|
33
|
+
loadAgentPermissions,
|
|
34
|
+
loadPermissionsOnMount,
|
|
35
|
+
shouldTriggerStopPropagation,
|
|
36
|
+
shouldRenderToParent,
|
|
37
|
+
agentName,
|
|
38
|
+
agentRef,
|
|
39
|
+
userPermissionsRef,
|
|
40
|
+
onVerificationSuccess,
|
|
41
|
+
customDropdownOptions
|
|
42
|
+
}) => {
|
|
43
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
44
|
+
const [isDuplicating, setIsDuplicating] = useState(false);
|
|
45
|
+
const {
|
|
46
|
+
formatMessage
|
|
47
|
+
} = useIntl();
|
|
48
|
+
const [hasBeenCopied, setHasBeenCopied] = useState(false);
|
|
49
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
50
|
+
const [permissions, setPermissions] = useState();
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const fetchData = async () => {
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
const {
|
|
55
|
+
isCreateEnabled,
|
|
56
|
+
isEditEnabled,
|
|
57
|
+
isDeleteEnabled
|
|
58
|
+
} = await loadAgentPermissions();
|
|
59
|
+
setIsLoading(false);
|
|
60
|
+
setPermissions({
|
|
61
|
+
isCreateEnabled,
|
|
62
|
+
isEditEnabled,
|
|
63
|
+
isDeleteEnabled
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Only load once
|
|
68
|
+
if (!permissions && (isOpen || loadPermissionsOnMount)) {
|
|
69
|
+
fetchData();
|
|
70
|
+
}
|
|
71
|
+
}, [isOpen, loadAgentPermissions, loadPermissionsOnMount, permissions]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (!isOpen) {
|
|
74
|
+
setHasBeenCopied(false);
|
|
75
|
+
}
|
|
76
|
+
}, [isOpen]);
|
|
77
|
+
const renderEditDelete = () => {
|
|
78
|
+
if (!(permissions !== null && permissions !== void 0 && permissions.isEditEnabled) && !(permissions !== null && permissions !== void 0 && permissions.isDeleteEnabled)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/React.createElement(DropdownItemGroup, {
|
|
82
|
+
hasSeparator: true
|
|
83
|
+
}, permissions.isEditEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
84
|
+
onClick: onEditAgent
|
|
85
|
+
}, formatMessage(messages.editAgent)), permissions.isDeleteEnabled && showDeleteOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
86
|
+
onClick: onDeleteAgent
|
|
87
|
+
}, formatMessage(messages.deleteAgent)));
|
|
88
|
+
};
|
|
89
|
+
const isCreateAgentsEnabled = permissions === null || permissions === void 0 ? void 0 : permissions.isCreateEnabled;
|
|
90
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
91
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
92
|
+
isLoading: isLoading,
|
|
93
|
+
isOpen: isOpen,
|
|
94
|
+
testId: dropdownMenuTestId,
|
|
95
|
+
trigger: ({
|
|
96
|
+
triggerRef,
|
|
97
|
+
...props
|
|
98
|
+
}) => /*#__PURE__*/React.createElement(IconButton, _extends({}, props, {
|
|
99
|
+
icon: MoreIcon,
|
|
100
|
+
label: agentName ? formatMessage(messages.moreActionsForLabel, {
|
|
101
|
+
agentName: agentName
|
|
102
|
+
}) : formatMessage(messages.moreActionsLabel),
|
|
103
|
+
ref: triggerRef,
|
|
104
|
+
spacing: spacing,
|
|
105
|
+
appearance: appearance,
|
|
106
|
+
onClick: (e, analyticsEvent) => {
|
|
107
|
+
var _props$onClick;
|
|
108
|
+
if (onDropdownTriggerClick) {
|
|
109
|
+
onDropdownTriggerClick(e, analyticsEvent);
|
|
110
|
+
}
|
|
111
|
+
if (shouldTriggerStopPropagation) {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
}
|
|
114
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e);
|
|
115
|
+
}
|
|
116
|
+
})),
|
|
117
|
+
onOpenChange: args => {
|
|
118
|
+
setIsOpen(args.isOpen);
|
|
119
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(args);
|
|
120
|
+
if (!args.isOpen) {
|
|
121
|
+
setHasBeenCopied(false);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, customDropdownOptions === null || customDropdownOptions === void 0 ? void 0 : customDropdownOptions.map(option => /*#__PURE__*/React.createElement(DropdownItem, {
|
|
125
|
+
key: option.id,
|
|
126
|
+
onClick: option.onClick
|
|
127
|
+
}, option.label)), showViewAgentOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
128
|
+
onClick: onViewAgentClick
|
|
129
|
+
}, formatMessage(messages.viewAgent)), doesAgentHaveIdentityAccountId && onViewAgentFullProfileClick && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
130
|
+
onClick: onViewAgentFullProfileClick
|
|
131
|
+
}, formatMessage(messages.viewAgentFullProfile)), !isForgeAgent && isCreateAgentsEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
132
|
+
onClick: async e => {
|
|
133
|
+
if (fg('rovo_agent_versioning_enabled')) {
|
|
134
|
+
e.stopPropagation();
|
|
135
|
+
}
|
|
136
|
+
setIsDuplicating(true);
|
|
137
|
+
try {
|
|
138
|
+
await (onDuplicateAgent === null || onDuplicateAgent === void 0 ? void 0 : onDuplicateAgent(e));
|
|
139
|
+
} finally {
|
|
140
|
+
setIsDuplicating(false);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
isDisabled: isDuplicating
|
|
144
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
145
|
+
space: "space.050"
|
|
146
|
+
}, isDuplicating && /*#__PURE__*/React.createElement(Spinner, {
|
|
147
|
+
size: "small"
|
|
148
|
+
}), isAutodevTemplateAgent ? formatMessage(messages.useTemplateButton) : formatMessage(messages.duplicateAgent))), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
149
|
+
onClick: e => {
|
|
150
|
+
e.stopPropagation();
|
|
151
|
+
setHasBeenCopied(true);
|
|
152
|
+
onCopyAgent === null || onCopyAgent === void 0 ? void 0 : onCopyAgent(e);
|
|
153
|
+
}
|
|
154
|
+
}, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
|
|
155
|
+
agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
|
|
156
|
+
userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
|
|
157
|
+
onVerificationSuccess: onVerificationSuccess,
|
|
158
|
+
testId: "agent-actions-menu-verification"
|
|
159
|
+
})), renderEditDelete());
|
|
160
|
+
};
|