@atlaskit/rovo-agent-selector 0.0.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +11 -0
  3. package/README.md +9 -0
  4. package/dist/cjs/index.js +13 -0
  5. package/dist/cjs/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql.js +130 -0
  6. package/dist/cjs/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery.graphql.js +146 -0
  7. package/dist/cjs/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorDisabledQuery.graphql.js +188 -0
  8. package/dist/cjs/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorFeatureGateFalseQuery.graphql.js +188 -0
  9. package/dist/cjs/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorOnChangeQuery.graphql.js +188 -0
  10. package/dist/cjs/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorQuery.graphql.js +188 -0
  11. package/dist/cjs/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorWithoutFeatureFlagQuery.graphql.js +188 -0
  12. package/dist/cjs/ui/rovo-agent-selector/index.js +181 -0
  13. package/dist/cjs/ui/rovo-agent-selector/messages.js +25 -0
  14. package/dist/cjs/ui/rovo-agent-selector/types.js +5 -0
  15. package/dist/es2019/index.js +1 -0
  16. package/dist/es2019/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql.js +123 -0
  17. package/dist/es2019/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery.graphql.js +140 -0
  18. package/dist/es2019/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorDisabledQuery.graphql.js +182 -0
  19. package/dist/es2019/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorFeatureGateFalseQuery.graphql.js +182 -0
  20. package/dist/es2019/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorOnChangeQuery.graphql.js +182 -0
  21. package/dist/es2019/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorQuery.graphql.js +182 -0
  22. package/dist/es2019/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorWithoutFeatureFlagQuery.graphql.js +182 -0
  23. package/dist/es2019/ui/rovo-agent-selector/index.js +152 -0
  24. package/dist/es2019/ui/rovo-agent-selector/messages.js +19 -0
  25. package/dist/es2019/ui/rovo-agent-selector/types.js +1 -0
  26. package/dist/esm/index.js +1 -0
  27. package/dist/esm/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql.js +123 -0
  28. package/dist/esm/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery.graphql.js +140 -0
  29. package/dist/esm/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorDisabledQuery.graphql.js +182 -0
  30. package/dist/esm/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorFeatureGateFalseQuery.graphql.js +182 -0
  31. package/dist/esm/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorOnChangeQuery.graphql.js +182 -0
  32. package/dist/esm/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorQuery.graphql.js +182 -0
  33. package/dist/esm/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorWithoutFeatureFlagQuery.graphql.js +182 -0
  34. package/dist/esm/ui/rovo-agent-selector/index.js +171 -0
  35. package/dist/esm/ui/rovo-agent-selector/messages.js +19 -0
  36. package/dist/esm/ui/rovo-agent-selector/types.js +1 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql.d.ts +32 -0
  39. package/dist/types/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery.graphql.d.ts +31 -0
  40. package/dist/types/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorDisabledQuery.graphql.d.ts +21 -0
  41. package/dist/types/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorFeatureGateFalseQuery.graphql.d.ts +21 -0
  42. package/dist/types/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorOnChangeQuery.graphql.d.ts +21 -0
  43. package/dist/types/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorQuery.graphql.d.ts +21 -0
  44. package/dist/types/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorWithoutFeatureFlagQuery.graphql.d.ts +21 -0
  45. package/dist/types/ui/rovo-agent-selector/index.d.ts +7 -0
  46. package/dist/types/ui/rovo-agent-selector/messages.d.ts +18 -0
  47. package/dist/types/ui/rovo-agent-selector/types.d.ts +41 -0
  48. package/dist/types-ts4.5/index.d.ts +1 -0
  49. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql.d.ts +32 -0
  50. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery.graphql.d.ts +31 -0
  51. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorDisabledQuery.graphql.d.ts +21 -0
  52. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorFeatureGateFalseQuery.graphql.d.ts +21 -0
  53. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorOnChangeQuery.graphql.d.ts +21 -0
  54. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorQuery.graphql.d.ts +21 -0
  55. package/dist/types-ts4.5/ui/rovo-agent-selector/__generated__/testRovoAgentSelectorWithoutFeatureFlagQuery.graphql.d.ts +21 -0
  56. package/dist/types-ts4.5/ui/rovo-agent-selector/index.d.ts +7 -0
  57. package/dist/types-ts4.5/ui/rovo-agent-selector/messages.d.ts +18 -0
  58. package/dist/types-ts4.5/ui/rovo-agent-selector/types.d.ts +41 -0
  59. package/package.json +101 -0
  60. package/stories/__generated__/storiesRovoAgentSelectorQuery.graphql.ts +172 -0
  61. package/stories/index.tsx +81 -0
@@ -0,0 +1,182 @@
1
+ /**
2
+ * @generated SignedSource<<bb6a4009749a1e66dc659d703f002b11>>
3
+ * @relayHash 4c899bd93f28362592f84caca67e0430
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ * @codegen-command: yarn relay
7
+ */
8
+
9
+ /* tslint:disable */
10
+ /* eslint-disable */
11
+ // @ts-nocheck
12
+
13
+ // @relayRequestID 76593c8c595064568c6b14b9d08a00e762c8436420a9cdd674814465906b7721
14
+
15
+ var node = function () {
16
+ var v0 = [{
17
+ "defaultValue": null,
18
+ "kind": "LocalArgument",
19
+ "name": "cloudId"
20
+ }],
21
+ v1 = {
22
+ "kind": "Variable",
23
+ "name": "cloudId",
24
+ "variableName": "cloudId"
25
+ },
26
+ v2 = [v1 /*: any*/, {
27
+ "kind": "Literal",
28
+ "name": "first",
29
+ "value": 30
30
+ }, {
31
+ "kind": "Literal",
32
+ "name": "input",
33
+ "value": {
34
+ "onlyEditableAgents": true
35
+ }
36
+ }],
37
+ v3 = {
38
+ "enumValues": null,
39
+ "nullable": true,
40
+ "plural": false,
41
+ "type": "String"
42
+ };
43
+ return {
44
+ "fragment": {
45
+ "argumentDefinitions": v0 /*: any*/,
46
+ "kind": "Fragment",
47
+ "name": "testRovoAgentSelectorQuery",
48
+ "selections": [{
49
+ "args": [v1 /*: any*/],
50
+ "kind": "FragmentSpread",
51
+ "name": "rovoAgentSelector_AtlaskitRovoAgentSelector"
52
+ }],
53
+ "type": "Query"
54
+ },
55
+ "kind": "Request",
56
+ "operation": {
57
+ "argumentDefinitions": v0 /*: any*/,
58
+ "kind": "Operation",
59
+ "name": "testRovoAgentSelectorQuery",
60
+ "selections": [{
61
+ "args": v2 /*: any*/,
62
+ "concreteType": "AgentStudioAgentsConnection",
63
+ "kind": "LinkedField",
64
+ "name": "agentStudio_getAgents",
65
+ "plural": false,
66
+ "selections": [{
67
+ "concreteType": "PageInfo",
68
+ "kind": "LinkedField",
69
+ "name": "pageInfo",
70
+ "plural": false,
71
+ "selections": [{
72
+ "kind": "ScalarField",
73
+ "name": "hasNextPage"
74
+ }, {
75
+ "kind": "ScalarField",
76
+ "name": "endCursor"
77
+ }]
78
+ }, {
79
+ "concreteType": "AgentStudioAgentEdge",
80
+ "kind": "LinkedField",
81
+ "name": "edges",
82
+ "plural": true,
83
+ "selections": [{
84
+ "concreteType": "AgentStudioAssistant",
85
+ "kind": "LinkedField",
86
+ "name": "node",
87
+ "plural": false,
88
+ "selections": [{
89
+ "kind": "ScalarField",
90
+ "name": "id"
91
+ }, {
92
+ "kind": "ScalarField",
93
+ "name": "name"
94
+ }, {
95
+ "kind": "ScalarField",
96
+ "name": "externalConfigReference"
97
+ }, {
98
+ "kind": "ScalarField",
99
+ "name": "identityAccountId"
100
+ }, {
101
+ "kind": "ScalarField",
102
+ "name": "creatorType"
103
+ }, {
104
+ "kind": "ScalarField",
105
+ "name": "__typename"
106
+ }]
107
+ }, {
108
+ "kind": "ScalarField",
109
+ "name": "cursor"
110
+ }]
111
+ }]
112
+ }, {
113
+ "args": v2 /*: any*/,
114
+ "filters": ["cloudId", "input"],
115
+ "handle": "connection",
116
+ "key": "RovoAgent_agentStudio_getAgents",
117
+ "kind": "LinkedHandle",
118
+ "name": "agentStudio_getAgents"
119
+ }]
120
+ },
121
+ "params": {
122
+ "id": "76593c8c595064568c6b14b9d08a00e762c8436420a9cdd674814465906b7721",
123
+ "metadata": {
124
+ "relayTestingSelectionTypeInfo": {
125
+ "agentStudio_getAgents": {
126
+ "enumValues": null,
127
+ "nullable": true,
128
+ "plural": false,
129
+ "type": "AgentStudioAgentsConnection"
130
+ },
131
+ "agentStudio_getAgents.edges": {
132
+ "enumValues": null,
133
+ "nullable": false,
134
+ "plural": true,
135
+ "type": "AgentStudioAgentEdge"
136
+ },
137
+ "agentStudio_getAgents.edges.cursor": v3 /*: any*/,
138
+ "agentStudio_getAgents.edges.node": {
139
+ "enumValues": null,
140
+ "nullable": true,
141
+ "plural": false,
142
+ "type": "AgentStudioAssistant"
143
+ },
144
+ "agentStudio_getAgents.edges.node.__typename": {
145
+ "enumValues": null,
146
+ "nullable": false,
147
+ "plural": false,
148
+ "type": "String"
149
+ },
150
+ "agentStudio_getAgents.edges.node.creatorType": v3 /*: any*/,
151
+ "agentStudio_getAgents.edges.node.externalConfigReference": v3 /*: any*/,
152
+ "agentStudio_getAgents.edges.node.id": {
153
+ "enumValues": null,
154
+ "nullable": false,
155
+ "plural": false,
156
+ "type": "ID"
157
+ },
158
+ "agentStudio_getAgents.edges.node.identityAccountId": v3 /*: any*/,
159
+ "agentStudio_getAgents.edges.node.name": v3 /*: any*/,
160
+ "agentStudio_getAgents.pageInfo": {
161
+ "enumValues": null,
162
+ "nullable": false,
163
+ "plural": false,
164
+ "type": "PageInfo"
165
+ },
166
+ "agentStudio_getAgents.pageInfo.endCursor": v3 /*: any*/,
167
+ "agentStudio_getAgents.pageInfo.hasNextPage": {
168
+ "enumValues": null,
169
+ "nullable": false,
170
+ "plural": false,
171
+ "type": "Boolean"
172
+ }
173
+ }
174
+ },
175
+ "name": "testRovoAgentSelectorQuery",
176
+ "operationKind": "query",
177
+ "text": null
178
+ }
179
+ };
180
+ }();
181
+ node.hash = "b6b34bf9b0c27f8042e08b3e7de8cf06";
182
+ export default node;
@@ -0,0 +1,182 @@
1
+ /**
2
+ * @generated SignedSource<<0c7de09d2854262c64a44ef92c9f0807>>
3
+ * @relayHash 38db3c47c923c8c9440e6aa32ae99c35
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ * @codegen-command: yarn relay
7
+ */
8
+
9
+ /* tslint:disable */
10
+ /* eslint-disable */
11
+ // @ts-nocheck
12
+
13
+ // @relayRequestID 6fa0dcb130ee0ade530bef810f71d7fe1d99115927d45d457ed5a5a27da9e6b9
14
+
15
+ var node = function () {
16
+ var v0 = [{
17
+ "defaultValue": null,
18
+ "kind": "LocalArgument",
19
+ "name": "cloudId"
20
+ }],
21
+ v1 = {
22
+ "kind": "Variable",
23
+ "name": "cloudId",
24
+ "variableName": "cloudId"
25
+ },
26
+ v2 = [v1 /*: any*/, {
27
+ "kind": "Literal",
28
+ "name": "first",
29
+ "value": 30
30
+ }, {
31
+ "kind": "Literal",
32
+ "name": "input",
33
+ "value": {
34
+ "onlyEditableAgents": true
35
+ }
36
+ }],
37
+ v3 = {
38
+ "enumValues": null,
39
+ "nullable": true,
40
+ "plural": false,
41
+ "type": "String"
42
+ };
43
+ return {
44
+ "fragment": {
45
+ "argumentDefinitions": v0 /*: any*/,
46
+ "kind": "Fragment",
47
+ "name": "testRovoAgentSelectorWithoutFeatureFlagQuery",
48
+ "selections": [{
49
+ "args": [v1 /*: any*/],
50
+ "kind": "FragmentSpread",
51
+ "name": "rovoAgentSelector_AtlaskitRovoAgentSelector"
52
+ }],
53
+ "type": "Query"
54
+ },
55
+ "kind": "Request",
56
+ "operation": {
57
+ "argumentDefinitions": v0 /*: any*/,
58
+ "kind": "Operation",
59
+ "name": "testRovoAgentSelectorWithoutFeatureFlagQuery",
60
+ "selections": [{
61
+ "args": v2 /*: any*/,
62
+ "concreteType": "AgentStudioAgentsConnection",
63
+ "kind": "LinkedField",
64
+ "name": "agentStudio_getAgents",
65
+ "plural": false,
66
+ "selections": [{
67
+ "concreteType": "PageInfo",
68
+ "kind": "LinkedField",
69
+ "name": "pageInfo",
70
+ "plural": false,
71
+ "selections": [{
72
+ "kind": "ScalarField",
73
+ "name": "hasNextPage"
74
+ }, {
75
+ "kind": "ScalarField",
76
+ "name": "endCursor"
77
+ }]
78
+ }, {
79
+ "concreteType": "AgentStudioAgentEdge",
80
+ "kind": "LinkedField",
81
+ "name": "edges",
82
+ "plural": true,
83
+ "selections": [{
84
+ "concreteType": "AgentStudioAssistant",
85
+ "kind": "LinkedField",
86
+ "name": "node",
87
+ "plural": false,
88
+ "selections": [{
89
+ "kind": "ScalarField",
90
+ "name": "id"
91
+ }, {
92
+ "kind": "ScalarField",
93
+ "name": "name"
94
+ }, {
95
+ "kind": "ScalarField",
96
+ "name": "externalConfigReference"
97
+ }, {
98
+ "kind": "ScalarField",
99
+ "name": "identityAccountId"
100
+ }, {
101
+ "kind": "ScalarField",
102
+ "name": "creatorType"
103
+ }, {
104
+ "kind": "ScalarField",
105
+ "name": "__typename"
106
+ }]
107
+ }, {
108
+ "kind": "ScalarField",
109
+ "name": "cursor"
110
+ }]
111
+ }]
112
+ }, {
113
+ "args": v2 /*: any*/,
114
+ "filters": ["cloudId", "input"],
115
+ "handle": "connection",
116
+ "key": "RovoAgent_agentStudio_getAgents",
117
+ "kind": "LinkedHandle",
118
+ "name": "agentStudio_getAgents"
119
+ }]
120
+ },
121
+ "params": {
122
+ "id": "6fa0dcb130ee0ade530bef810f71d7fe1d99115927d45d457ed5a5a27da9e6b9",
123
+ "metadata": {
124
+ "relayTestingSelectionTypeInfo": {
125
+ "agentStudio_getAgents": {
126
+ "enumValues": null,
127
+ "nullable": true,
128
+ "plural": false,
129
+ "type": "AgentStudioAgentsConnection"
130
+ },
131
+ "agentStudio_getAgents.edges": {
132
+ "enumValues": null,
133
+ "nullable": false,
134
+ "plural": true,
135
+ "type": "AgentStudioAgentEdge"
136
+ },
137
+ "agentStudio_getAgents.edges.cursor": v3 /*: any*/,
138
+ "agentStudio_getAgents.edges.node": {
139
+ "enumValues": null,
140
+ "nullable": true,
141
+ "plural": false,
142
+ "type": "AgentStudioAssistant"
143
+ },
144
+ "agentStudio_getAgents.edges.node.__typename": {
145
+ "enumValues": null,
146
+ "nullable": false,
147
+ "plural": false,
148
+ "type": "String"
149
+ },
150
+ "agentStudio_getAgents.edges.node.creatorType": v3 /*: any*/,
151
+ "agentStudio_getAgents.edges.node.externalConfigReference": v3 /*: any*/,
152
+ "agentStudio_getAgents.edges.node.id": {
153
+ "enumValues": null,
154
+ "nullable": false,
155
+ "plural": false,
156
+ "type": "ID"
157
+ },
158
+ "agentStudio_getAgents.edges.node.identityAccountId": v3 /*: any*/,
159
+ "agentStudio_getAgents.edges.node.name": v3 /*: any*/,
160
+ "agentStudio_getAgents.pageInfo": {
161
+ "enumValues": null,
162
+ "nullable": false,
163
+ "plural": false,
164
+ "type": "PageInfo"
165
+ },
166
+ "agentStudio_getAgents.pageInfo.endCursor": v3 /*: any*/,
167
+ "agentStudio_getAgents.pageInfo.hasNextPage": {
168
+ "enumValues": null,
169
+ "nullable": false,
170
+ "plural": false,
171
+ "type": "Boolean"
172
+ }
173
+ }
174
+ },
175
+ "name": "testRovoAgentSelectorWithoutFeatureFlagQuery",
176
+ "operationKind": "query",
177
+ "text": null
178
+ }
179
+ };
180
+ }();
181
+ node.hash = "cfab1e98961b1a1411d8b090b5d826ac";
182
+ export default node;
@@ -0,0 +1,171 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ 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; }
7
+ 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; }
8
+ import _rovoAgentSelector_AtlaskitRovoAgentSelector from "./__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql";
9
+ import { useCallback, useMemo, useRef, useState } from 'react';
10
+ import { useIntl } from 'react-intl-next';
11
+ import { graphql, usePaginationFragment } from 'react-relay';
12
+ import { Label } from '@atlaskit/form';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { Box, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
15
+ import { AgentAvatar } from '@atlaskit/rovo-agent-components';
16
+ import Select from '@atlaskit/select';
17
+ import messages from './messages';
18
+ export var AGENT_SELECT_ID = 'rovo-agent-select';
19
+ var DEBOUNCE_DELAY = 500;
20
+ var PAGE_SIZE = 30;
21
+
22
+ // Simple debounce hook
23
+ function useDebouncedCallback(callback, delay) {
24
+ var timeoutRef = useRef(null);
25
+
26
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27
+ return useCallback(function () {
28
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
+ args[_key] = arguments[_key];
30
+ }
31
+ if (timeoutRef.current) {
32
+ clearTimeout(timeoutRef.current);
33
+ }
34
+ timeoutRef.current = setTimeout(function () {
35
+ callback.apply(void 0, args);
36
+ }, delay);
37
+ }, [callback, delay]);
38
+ }
39
+ export default function RovoAgentSelector(_ref) {
40
+ var _data$agentStudio_get3;
41
+ var testId = _ref.testId,
42
+ isFeatureEnabledOverride = _ref.isFeatureEnabled,
43
+ fragmentReference = _ref.fragmentReference,
44
+ cloudId = _ref.cloudId,
45
+ selectedAgent = _ref.selectedAgent,
46
+ onChange = _ref.onChange,
47
+ isLoadingOverride = _ref.isLoading;
48
+ var _useIntl = useIntl(),
49
+ formatMessage = _useIntl.formatMessage;
50
+ var isFeatureEnabled = isFeatureEnabledOverride !== null && isFeatureEnabledOverride !== void 0 ? isFeatureEnabledOverride : fg('jsm_help_center_one-click_rovo_agent');
51
+ var _useState = useState(null),
52
+ _useState2 = _slicedToArray(_useState, 2),
53
+ setSearchInput = _useState2[1];
54
+ var _useState3 = useState(false),
55
+ _useState4 = _slicedToArray(_useState3, 2),
56
+ isRefetching = _useState4[0],
57
+ setIsRefetching = _useState4[1];
58
+ var _usePaginationFragmen = usePaginationFragment(_rovoAgentSelector_AtlaskitRovoAgentSelector, fragmentReference),
59
+ data = _usePaginationFragmen.data,
60
+ loadNext = _usePaginationFragmen.loadNext,
61
+ hasNext = _usePaginationFragmen.hasNext,
62
+ isLoadingNext = _usePaginationFragmen.isLoadingNext,
63
+ refetch = _usePaginationFragmen.refetch;
64
+ var agentOptions = useMemo(function () {
65
+ var _data$agentStudio_get, _data$agentStudio_get2;
66
+ return (_data$agentStudio_get = data === null || data === void 0 || (_data$agentStudio_get2 = data.agentStudio_getAgents) === null || _data$agentStudio_get2 === void 0 || (_data$agentStudio_get2 = _data$agentStudio_get2.edges) === null || _data$agentStudio_get2 === void 0 ? void 0 : _data$agentStudio_get2.map(function (edge) {
67
+ return edge === null || edge === void 0 ? void 0 : edge.node;
68
+ }).filter(function (node) {
69
+ return node != null;
70
+ }).map(function (agent) {
71
+ var _agent$name, _agent$id, _agent$externalConfig, _agent$identityAccoun;
72
+ return {
73
+ label: (_agent$name = agent === null || agent === void 0 ? void 0 : agent.name) !== null && _agent$name !== void 0 ? _agent$name : '',
74
+ value: (_agent$id = agent === null || agent === void 0 ? void 0 : agent.id) !== null && _agent$id !== void 0 ? _agent$id : '',
75
+ externalConfigReference: (_agent$externalConfig = agent === null || agent === void 0 ? void 0 : agent.externalConfigReference) !== null && _agent$externalConfig !== void 0 ? _agent$externalConfig : undefined,
76
+ identityAccountId: (_agent$identityAccoun = agent === null || agent === void 0 ? void 0 : agent.identityAccountId) !== null && _agent$identityAccoun !== void 0 ? _agent$identityAccoun : undefined,
77
+ isForgeAgent: (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'FORGE'
78
+ };
79
+ }).filter(function (option) {
80
+ return option.label;
81
+ })) !== null && _data$agentStudio_get !== void 0 ? _data$agentStudio_get : [];
82
+ }, [data === null || data === void 0 || (_data$agentStudio_get3 = data.agentStudio_getAgents) === null || _data$agentStudio_get3 === void 0 ? void 0 : _data$agentStudio_get3.edges]);
83
+
84
+ // Non-suspending refetch to prevent select input suspending during search
85
+ // Since useSuspenselessRefetch is Jira-specific, we use refetch with fetchPolicy to avoid suspending
86
+ var suspenselessRefetch = useCallback(function (variables) {
87
+ setIsRefetching(true);
88
+ refetch(variables, {
89
+ fetchPolicy: 'store-or-network'
90
+ });
91
+ // Reset loading state after a delay to handle async nature
92
+ // Note: In a real implementation with useSuspenselessRefetch, this would be handled automatically
93
+ setTimeout(function () {
94
+ setIsRefetching(false);
95
+ }, 100);
96
+ }, [refetch]);
97
+ var debouncedRefetch = useDebouncedCallback(useCallback(function (searchTerm) {
98
+ var input = _objectSpread({
99
+ onlyEditableAgents: true
100
+ }, searchTerm.trim() ? {
101
+ name: searchTerm.trim()
102
+ } : {});
103
+ suspenselessRefetch({
104
+ cloudId: cloudId,
105
+ input: input
106
+ });
107
+ }, [cloudId, suspenselessRefetch]), DEBOUNCE_DELAY);
108
+ var handleInputChange = useCallback(function (inputValue) {
109
+ setSearchInput(inputValue);
110
+ debouncedRefetch(inputValue);
111
+ }, [setSearchInput, debouncedRefetch]);
112
+ var handleMenuScrollToBottom = useCallback(function () {
113
+ if (hasNext && !isLoadingNext && !isRefetching) {
114
+ loadNext(PAGE_SIZE);
115
+ }
116
+ }, [hasNext, isLoadingNext, isRefetching, loadNext]);
117
+ var handleUpdateAgent = useCallback(function (option) {
118
+ onChange === null || onChange === void 0 || onChange(option);
119
+ }, [onChange]);
120
+ var isLoading = isLoadingOverride !== null && isLoadingOverride !== void 0 ? isLoadingOverride : isRefetching || isLoadingNext;
121
+ if (!isFeatureEnabled) {
122
+ return null;
123
+ }
124
+ return /*#__PURE__*/React.createElement(Box, {
125
+ testId: testId
126
+ }, /*#__PURE__*/React.createElement(Stack, {
127
+ space: "space.050"
128
+ }, /*#__PURE__*/React.createElement(Label, {
129
+ htmlFor: AGENT_SELECT_ID
130
+ }, /*#__PURE__*/React.createElement(Text, {
131
+ weight: "semibold"
132
+ }, formatMessage(messages.selectorLabel))), /*#__PURE__*/React.createElement(Select, {
133
+ inputId: AGENT_SELECT_ID,
134
+ placeholder: formatMessage(messages.rovoAgentPlaceholder),
135
+ options: agentOptions,
136
+ value: selectedAgent,
137
+ noOptionsMessage: function noOptionsMessage() {
138
+ return formatMessage(messages.noOptionsMessage);
139
+ },
140
+ onChange: handleUpdateAgent,
141
+ onInputChange: handleInputChange,
142
+ isSearchable: true,
143
+ filterOption: function filterOption() {
144
+ return true;
145
+ } // Disabled filtering in component since options are cached and filtered in relay store
146
+ ,
147
+ isLoading: isLoading,
148
+ onMenuScrollToBottom: handleMenuScrollToBottom,
149
+ formatOptionLabel: function formatOptionLabel(_ref2) {
150
+ var label = _ref2.label,
151
+ value = _ref2.value,
152
+ externalConfigReference = _ref2.externalConfigReference,
153
+ identityAccountId = _ref2.identityAccountId,
154
+ isForgeAgent = _ref2.isForgeAgent;
155
+ return /*#__PURE__*/React.createElement(Inline, {
156
+ alignBlock: "center",
157
+ space: "space.075"
158
+ }, /*#__PURE__*/React.createElement(AgentAvatar, {
159
+ agentId: value,
160
+ agentNamedId: externalConfigReference,
161
+ agentIdentityAccountId: identityAccountId,
162
+ size: "small",
163
+ showBorder: false,
164
+ isForgeAgent: isForgeAgent
165
+ }), /*#__PURE__*/React.createElement(Text, {
166
+ size: "small",
167
+ color: "color.text.subtle"
168
+ }, label));
169
+ }
170
+ })));
171
+ }
@@ -0,0 +1,19 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ var messages = defineMessages({
3
+ selectorLabel: {
4
+ id: 'rovo-agent-selector.label',
5
+ defaultMessage: 'Select agent',
6
+ description: 'Label for the agent selector dropdown'
7
+ },
8
+ rovoAgentPlaceholder: {
9
+ id: 'rovo-agent-selector.lplaceholder',
10
+ defaultMessage: 'Select a Rovo agent',
11
+ description: 'Placeholder for the Rovo Agent select on the customer portal settings page'
12
+ },
13
+ noOptionsMessage: {
14
+ id: 'rovo-agent-selector.lno-options-message',
15
+ defaultMessage: 'No agents found',
16
+ description: 'Message displayed when no options are available'
17
+ }
18
+ });
19
+ export default messages;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './ui/rovo-agent-selector';
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @generated SignedSource<<d5c96fb06da7a96bc5df3f9ac4925786>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ * @codegen-command: yarn relay
6
+ */
7
+ import type { ReaderFragment } from 'relay-runtime';
8
+ import type { FragmentRefs } from "relay-runtime";
9
+ export type rovoAgentSelector_AtlaskitRovoAgentSelector$data = {
10
+ readonly agentStudio_getAgents: {
11
+ readonly edges: ReadonlyArray<{
12
+ readonly node: {
13
+ readonly creatorType: string | null | undefined;
14
+ readonly externalConfigReference: string | null | undefined;
15
+ readonly id: string;
16
+ readonly identityAccountId: string | null | undefined;
17
+ readonly name: string | null | undefined;
18
+ } | null | undefined;
19
+ }>;
20
+ readonly pageInfo: {
21
+ readonly endCursor: string | null | undefined;
22
+ readonly hasNextPage: boolean;
23
+ };
24
+ } | null | undefined;
25
+ readonly " $fragmentType": "rovoAgentSelector_AtlaskitRovoAgentSelector";
26
+ };
27
+ export type rovoAgentSelector_AtlaskitRovoAgentSelector$key = {
28
+ readonly " $data"?: rovoAgentSelector_AtlaskitRovoAgentSelector$data;
29
+ readonly " $fragmentSpreads": FragmentRefs<"rovoAgentSelector_AtlaskitRovoAgentSelector">;
30
+ };
31
+ declare const node: ReaderFragment;
32
+ export default node;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @generated SignedSource<<a5435352f3d8a8d5c79e9c07b1c4fe33>>
3
+ * @relayHash 3b0f1687d8cc89a312aa0e46a133624b
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ * @codegen-command: yarn relay
7
+ */
8
+ import type { ConcreteRequest } from 'relay-runtime';
9
+ import type { FragmentRefs } from "relay-runtime";
10
+ export type AgentStudioAgentQueryInput = {
11
+ name?: string | null | undefined;
12
+ onlyEditableAgents?: boolean | null | undefined;
13
+ onlyFavouriteAgents?: boolean | null | undefined;
14
+ onlyMyAgents?: boolean | null | undefined;
15
+ onlyTemplateAgents?: boolean | null | undefined;
16
+ };
17
+ export type rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery$variables = {
18
+ after?: string | null | undefined;
19
+ cloudId: string;
20
+ first?: number | null | undefined;
21
+ input?: AgentStudioAgentQueryInput | null | undefined;
22
+ };
23
+ export type rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery$data = {
24
+ readonly " $fragmentSpreads": FragmentRefs<"rovoAgentSelector_AtlaskitRovoAgentSelector">;
25
+ };
26
+ export type rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery = {
27
+ response: rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery$data;
28
+ variables: rovoAgentSelector_AtlaskitRovoAgentSelectorPaginationQuery$variables;
29
+ };
30
+ declare const node: ConcreteRequest;
31
+ export default node;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @generated SignedSource<<116afbd0b2f0bd35c47d903fbab98347>>
3
+ * @relayHash 61a7512ae1b46179a546873063cb6d59
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ * @codegen-command: yarn relay
7
+ */
8
+ import type { ConcreteRequest } from 'relay-runtime';
9
+ import type { FragmentRefs } from "relay-runtime";
10
+ export type testRovoAgentSelectorDisabledQuery$variables = {
11
+ cloudId: string;
12
+ };
13
+ export type testRovoAgentSelectorDisabledQuery$data = {
14
+ readonly " $fragmentSpreads": FragmentRefs<"rovoAgentSelector_AtlaskitRovoAgentSelector">;
15
+ };
16
+ export type testRovoAgentSelectorDisabledQuery = {
17
+ response: testRovoAgentSelectorDisabledQuery$data;
18
+ variables: testRovoAgentSelectorDisabledQuery$variables;
19
+ };
20
+ declare const node: ConcreteRequest;
21
+ export default node;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @generated SignedSource<<1aa6c479359e297b1bd7e245e0149961>>
3
+ * @relayHash fcee212dc75f6bc47c2cb7e88815a5eb
4
+ * @lightSyntaxTransform
5
+ * @nogrep
6
+ * @codegen-command: yarn relay
7
+ */
8
+ import type { ConcreteRequest } from 'relay-runtime';
9
+ import type { FragmentRefs } from "relay-runtime";
10
+ export type testRovoAgentSelectorFeatureGateFalseQuery$variables = {
11
+ cloudId: string;
12
+ };
13
+ export type testRovoAgentSelectorFeatureGateFalseQuery$data = {
14
+ readonly " $fragmentSpreads": FragmentRefs<"rovoAgentSelector_AtlaskitRovoAgentSelector">;
15
+ };
16
+ export type testRovoAgentSelectorFeatureGateFalseQuery = {
17
+ response: testRovoAgentSelectorFeatureGateFalseQuery$data;
18
+ variables: testRovoAgentSelectorFeatureGateFalseQuery$variables;
19
+ };
20
+ declare const node: ConcreteRequest;
21
+ export default node;