@atlaskit/rovo-agent-analytics 0.18.0 → 0.19.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 (56) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +69 -18
  3. package/actions/add-tools-prompt/package.json +17 -0
  4. package/actions/agent-interactions/package.json +17 -0
  5. package/actions/create-flow/package.json +17 -0
  6. package/actions/debug/package.json +17 -0
  7. package/actions/editing/package.json +17 -0
  8. package/actions/tool-actions/package.json +5 -5
  9. package/dist/cjs/actions/groups/add-tools-prompt.js +32 -0
  10. package/dist/cjs/actions/groups/agent-interactions.js +44 -0
  11. package/dist/cjs/actions/groups/create-flow.js +39 -0
  12. package/dist/cjs/actions/groups/debug.js +31 -0
  13. package/dist/cjs/actions/groups/editing.js +26 -0
  14. package/dist/cjs/actions/{tool-actions/index.js → groups/tools.js} +16 -1
  15. package/dist/cjs/actions/index.js +14 -35
  16. package/dist/cjs/actions/registry.js +53 -0
  17. package/dist/cjs/create/index.js +11 -30
  18. package/dist/es2019/actions/groups/add-tools-prompt.js +26 -0
  19. package/dist/es2019/actions/groups/agent-interactions.js +38 -0
  20. package/dist/es2019/actions/groups/create-flow.js +33 -0
  21. package/dist/es2019/actions/groups/debug.js +25 -0
  22. package/dist/es2019/actions/groups/editing.js +20 -0
  23. package/dist/es2019/actions/{tool-actions/index.js → groups/tools.js} +15 -0
  24. package/dist/es2019/actions/index.js +19 -35
  25. package/dist/es2019/actions/registry.js +52 -0
  26. package/dist/es2019/create/index.js +14 -29
  27. package/dist/esm/actions/groups/add-tools-prompt.js +26 -0
  28. package/dist/esm/actions/groups/agent-interactions.js +38 -0
  29. package/dist/esm/actions/groups/create-flow.js +33 -0
  30. package/dist/esm/actions/groups/debug.js +25 -0
  31. package/dist/esm/actions/groups/editing.js +20 -0
  32. package/dist/esm/actions/{tool-actions/index.js → groups/tools.js} +15 -0
  33. package/dist/esm/actions/index.js +15 -35
  34. package/dist/esm/actions/registry.js +48 -0
  35. package/dist/esm/create/index.js +12 -30
  36. package/dist/types/actions/groups/add-tools-prompt.d.ts +21 -0
  37. package/dist/types/actions/groups/agent-interactions.d.ts +39 -0
  38. package/dist/types/actions/groups/create-flow.d.ts +22 -0
  39. package/dist/types/actions/groups/debug.d.ts +30 -0
  40. package/dist/types/actions/groups/editing.d.ts +24 -0
  41. package/dist/types/actions/groups/tools.d.ts +38 -0
  42. package/dist/types/actions/index.d.ts +17 -47
  43. package/dist/types/actions/registry.d.ts +16 -0
  44. package/dist/types/create/index.d.ts +17 -15
  45. package/dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts +21 -0
  46. package/dist/types-ts4.5/actions/groups/agent-interactions.d.ts +39 -0
  47. package/dist/types-ts4.5/actions/groups/create-flow.d.ts +22 -0
  48. package/dist/types-ts4.5/actions/groups/debug.d.ts +30 -0
  49. package/dist/types-ts4.5/actions/groups/editing.d.ts +24 -0
  50. package/dist/types-ts4.5/actions/groups/tools.d.ts +38 -0
  51. package/dist/types-ts4.5/actions/index.d.ts +17 -47
  52. package/dist/types-ts4.5/actions/registry.d.ts +16 -0
  53. package/dist/types-ts4.5/create/index.d.ts +17 -15
  54. package/package.json +1 -1
  55. package/dist/types/actions/tool-actions/index.d.ts +0 -18
  56. package/dist/types-ts4.5/actions/tool-actions/index.d.ts +0 -18
@@ -5,42 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.useRovoAgentCreateAnalytics = exports.AgentCreateActions = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = require("react");
11
11
  var _analyticsNext = require("@atlaskit/analytics-next");
12
+ var _addToolsPrompt = require("../actions/groups/add-tools-prompt");
13
+ var _createFlow = require("../actions/groups/create-flow");
14
+ var _registry = require("../actions/registry");
12
15
  var _constants = require("../common/constants");
13
16
  var _csid = require("../common/csid");
14
17
  var _utils = require("../common/utils");
15
18
  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; }
16
19
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
- var AgentCreateActions = exports.AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
18
- /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
19
- AgentCreateActions["START"] = "createFlowStart";
20
- /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
21
- AgentCreateActions["SKIP_NL"] = "createFlowSkipNL";
22
- /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
23
- AgentCreateActions["REVIEW_NL"] = "createFlowReviewNL";
24
- /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
25
- AgentCreateActions["ACTIVATE"] = "createFlowActivate";
26
- /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
27
- AgentCreateActions["RESTART"] = "createFlowRestart";
28
- /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
29
- AgentCreateActions["ERROR"] = "createFlowError";
30
- /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
31
- AgentCreateActions["LAND"] = "createLandInStudio";
32
- /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
33
- AgentCreateActions["DISCARD"] = "createDiscard";
34
- /* Show no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97435 */
35
- AgentCreateActions["SHOW_NO_SKILLS_MODAL"] = "showNoSkillsModal";
36
- /* Browse click no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97436 */
37
- AgentCreateActions["BROWSE_CLICK_NO_SKILLS_MODAL"] = "browseClickNoSkillsModal";
38
- /* Discard no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97437 */
39
- AgentCreateActions["DISCARD_NO_SKILLS_MODAL"] = "discardNoSkillsModal";
40
- /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
41
- AgentCreateActions["SA_DRAFT"] = "saDraft";
42
- return AgentCreateActions;
43
- }({});
20
+ // Backward-compatible alias
21
+ // TODO: migrate consumers to use CreateFlowActions / AddToolsPromptActions directly, then remove
22
+ var AgentCreateActions = exports.AgentCreateActions = _objectSpread(_objectSpread({}, _createFlow.CreateFlowActions), _addToolsPrompt.AddToolsPromptActions);
44
23
  var globalEventConfig = (0, _utils.getDefaultTrackEventConfig)();
45
24
  var useRovoAgentCreateAnalytics = exports.useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(commonAttributes) {
46
25
  var _useRovoAgentCSID = (0, _csid.useRovoAgentCSID)(),
@@ -53,7 +32,9 @@ var useRovoAgentCreateAnalytics = exports.useRovoAgentCreateAnalytics = function
53
32
  var commonAttributesRef = (0, _react.useRef)(commonAttributes);
54
33
  var fireAnalyticsEvent = (0, _react.useCallback)(function (event) {
55
34
  var referrer = typeof window !== 'undefined' ? window.document.referrer : 'unknown';
35
+ var action = event.action;
56
36
  var attributes = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (0, _utils.getAttributesFromContexts)(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), event.attributes), {}, {
37
+ actionGroup: _registry.ACTION_TO_GROUP[action],
57
38
  csid: csid,
58
39
  referrer: referrer
59
40
  });
@@ -81,7 +62,7 @@ var useRovoAgentCreateAnalytics = exports.useRovoAgentCreateAnalytics = function
81
62
  var trackCreateSessionStart = (0, _react.useCallback)(function (attributes) {
82
63
  fireAnalyticsEvent({
83
64
  actionSubject: 'rovoAgent',
84
- action: AgentCreateActions.START,
65
+ action: _createFlow.CreateFlowActions.START,
85
66
  attributes: attributes
86
67
  });
87
68
  refreshCSID();
@@ -89,7 +70,7 @@ var useRovoAgentCreateAnalytics = exports.useRovoAgentCreateAnalytics = function
89
70
  var trackCreateSessionError = (0, _react.useCallback)(function (error, attributes) {
90
71
  fireAnalyticsEvent({
91
72
  actionSubject: 'rovoAgent',
92
- action: AgentCreateActions.ERROR,
73
+ action: _createFlow.CreateFlowActions.ERROR,
93
74
  attributes: _objectSpread({
94
75
  error: {
95
76
  message: error.message
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Action Group: addToolsPrompt
3
+ *
4
+ * Add tools prompt modal — shown when a user tries to activate/publish an agent that has no tools.
5
+ * The user can browse tools or dismiss and proceed without them.
6
+ *
7
+ * This group is intentionally flow-agnostic so the action values stay stable
8
+ * regardless of whether the prompt fires from the create flow or a future publish flow.
9
+ *
10
+ * ## Adding a new action
11
+ * 1. Add the action to the `AddToolsPromptActions` enum below with a data-portal link
12
+ * 2. Register this group in ../registry.ts (if this is a new group file)
13
+ *
14
+ */
15
+
16
+ /** The group name sent as `attributes.actionGroup` in analytics events */
17
+ export const ACTION_GROUP = 'addToolsPrompt';
18
+ export let AddToolsPromptActions = /*#__PURE__*/function (AddToolsPromptActions) {
19
+ /* Add tools prompt shown (agent has no tools) - https://data-portal.internal.atlassian.com/analytics/registry/98106 */
20
+ AddToolsPromptActions["SHOWN"] = "addToolsPromptShown";
21
+ /* User clicked "Browse skills" on the add tools prompt - https://data-portal.internal.atlassian.com/analytics/registry/98107 */
22
+ AddToolsPromptActions["BROWSE"] = "addToolsPromptBrowse";
23
+ /* User dismissed the add tools prompt ("No thanks") and proceeded anyway - https://data-portal.internal.atlassian.com/analytics/registry/98108 */
24
+ AddToolsPromptActions["DISMISS"] = "addToolsPromptDismiss";
25
+ return AddToolsPromptActions;
26
+ }({});
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Action Group: agentInteractions
3
+ *
4
+ * User-initiated interactions with an agent — typically from the overflow menu ("...")
5
+ * or agent profile surfaces (viewing, editing, deleting, duplicating, starring, sharing, verifying).
6
+ *
7
+ * NOTE: This is about UI interactions, not backend "actions" (which are being replaced by "tools").
8
+ *
9
+ * ## Adding a new action
10
+ * 1. Add the action to the `AgentInteractionActions` enum below with a data-portal link
11
+ * 2. Add the corresponding attribute type in `AgentInteractionAttributes`
12
+ * 3. If this action doesn't fit user interactions, create a new group file instead
13
+ * (see other files in this directory for the template)
14
+ */
15
+
16
+ /** The group name sent as `attributes.actionGroup` in analytics events */
17
+ export const ACTION_GROUP = 'agentInteractions';
18
+ export let AgentInteractionActions = /*#__PURE__*/function (AgentInteractionActions) {
19
+ /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
20
+ AgentInteractionActions["VIEW"] = "view";
21
+ /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
22
+ AgentInteractionActions["EDIT"] = "edit";
23
+ /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
24
+ AgentInteractionActions["COPY_LINK"] = "copyLink";
25
+ /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
26
+ AgentInteractionActions["DELETE"] = "delete";
27
+ /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
28
+ AgentInteractionActions["DUPLICATE"] = "duplicate";
29
+ /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
30
+ AgentInteractionActions["STAR"] = "star";
31
+ /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
32
+ AgentInteractionActions["CHAT"] = "chat";
33
+ /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
34
+ AgentInteractionActions["VERIFY"] = "verify";
35
+ /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
36
+ AgentInteractionActions["UNVERIFY"] = "unverify";
37
+ return AgentInteractionActions;
38
+ }({});
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Action Group: createFlow
3
+ *
4
+ * Create agent funnel steps — from clicking "Create agent" through to activation or discard,
5
+ *
6
+ * ## Adding a new action
7
+ * 1. Add the action to the `CreateFlowActions` enum below with a data-portal link
8
+ * 2. Register this group in ../registry.ts (if this is a new group file)
9
+ */
10
+
11
+ /** The group name sent as `attributes.actionGroup` in analytics events */
12
+ export const ACTION_GROUP = 'createFlow';
13
+ export let CreateFlowActions = /*#__PURE__*/function (CreateFlowActions) {
14
+ /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
15
+ CreateFlowActions["START"] = "createFlowStart";
16
+ /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
17
+ CreateFlowActions["SKIP_NL"] = "createFlowSkipNL";
18
+ /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
19
+ CreateFlowActions["REVIEW_NL"] = "createFlowReviewNL";
20
+ /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
21
+ CreateFlowActions["ACTIVATE"] = "createFlowActivate";
22
+ /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
23
+ CreateFlowActions["RESTART"] = "createFlowRestart";
24
+ /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
25
+ CreateFlowActions["ERROR"] = "createFlowError";
26
+ /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
27
+ CreateFlowActions["LAND"] = "createLandInStudio";
28
+ /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
29
+ CreateFlowActions["DISCARD"] = "createDiscard";
30
+ /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
31
+ CreateFlowActions["SA_DRAFT"] = "saDraft";
32
+ return CreateFlowActions;
33
+ }({});
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Action Group: debug
3
+ *
4
+ * Actions related to the agent debug modal (viewing, copying debug data, toggling skill info).
5
+ *
6
+ * ## Adding a new action
7
+ * 1. Add the action to the `AgentDebugActions` enum below with a data-portal link
8
+ * 2. Add the corresponding attribute type in `DebugActionAttributes`
9
+ * 3. If this action doesn't fit this group, consider creating a new group file instead
10
+ * (see other files in this directory for the template)
11
+ */
12
+
13
+ /** The group name sent as `attributes.actionGroup` in analytics events */
14
+ export const ACTION_GROUP = 'debug';
15
+ export let AgentDebugActions = /*#__PURE__*/function (AgentDebugActions) {
16
+ /* View debug modal - https://data-portal.internal.atlassian.com/analytics/registry/97183 */
17
+ AgentDebugActions["VIEW"] = "debugView";
18
+ /* Copy all debug data - https://data-portal.internal.atlassian.com/analytics/registry/97186 */
19
+ AgentDebugActions["COPY_ALL"] = "debugCopyAll";
20
+ /* Copy debug data - https://data-portal.internal.atlassian.com/analytics/registry/97184 */
21
+ AgentDebugActions["COPY"] = "debugCopy";
22
+ /* Toggle skill info - https://data-portal.internal.atlassian.com/analytics/registry/97185 */
23
+ AgentDebugActions["TOGGLE_SKILL_INFO"] = "debugToggleSkillInfo";
24
+ return AgentDebugActions;
25
+ }({});
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Action Group: editing
3
+ *
4
+ * Agent editing/mutation events — fired when an agent's configuration is saved or modified.
5
+ * Unlike agentInteractions (user clicks), these track actual data changes.
6
+ *
7
+ * ## Adding a new action
8
+ * 1. Add the action to the `AgentEditingActions` enum below with a data-portal link
9
+ * 2. Add the corresponding attribute type in `EditingActionAttributes`
10
+ * 3. If this action doesn't fit editing/mutation events, create a new group file instead
11
+ * (see other files in this directory for the template)
12
+ */
13
+
14
+ /** The group name sent as `attributes.actionGroup` in analytics events */
15
+ export const ACTION_GROUP = 'editing';
16
+ export let AgentEditingActions = /*#__PURE__*/function (AgentEditingActions) {
17
+ /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
18
+ AgentEditingActions["UPDATED"] = "updated";
19
+ return AgentEditingActions;
20
+ }({});
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Action Group: tools
3
+ *
4
+ * Actions related to agent tool execution during chat
5
+ * (confirming, streaming, viewing results, errors).
6
+ *
7
+ * ## Adding a new action
8
+ * 1. Add the action to the `AgentToolActions` enum below with a data-portal link
9
+ * 2. Add the corresponding attribute type in `ToolsActionAttributes`
10
+ * 3. If this action doesn't fit this group, consider creating a new group file instead
11
+ * (see other files in this directory for the template)
12
+ */
13
+
14
+ /** The group name sent as `attributes.actionGroup` in analytics events */
15
+ export const ACTION_GROUP = 'tools';
1
16
  export let AgentToolActions = /*#__PURE__*/function (AgentToolActions) {
2
17
  /* When chatting with an agent, and tools confirmation being shown, then user click proceed with the possible actions (e.g. confirm, dismiss etc) https://data-portal.internal.atlassian.com/analytics/registry/97675 */
3
18
  AgentToolActions["TOOLS_EXECUTION_CONFIRMED"] = "toolsExecutionConfirmed";
@@ -2,40 +2,20 @@ import { useCallback, useContext, useRef } from 'react';
2
2
  import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
3
3
  import { ANALYTICS_CHANNEL } from '../common/constants';
4
4
  import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
5
- export let AgentDebugActions = /*#__PURE__*/function (AgentDebugActions) {
6
- /* View debug modal - https://data-portal.internal.atlassian.com/analytics/registry/97183 */
7
- AgentDebugActions["VIEW"] = "debugView";
8
- /* Copy all debug data - https://data-portal.internal.atlassian.com/analytics/registry/97186 */
9
- AgentDebugActions["COPY_ALL"] = "debugCopyAll";
10
- /* Copy debug data - https://data-portal.internal.atlassian.com/analytics/registry/97184 */
11
- AgentDebugActions["COPY"] = "debugCopy";
12
- /* Toggle skill info - https://data-portal.internal.atlassian.com/analytics/registry/97185 */
13
- AgentDebugActions["TOGGLE_SKILL_INFO"] = "debugToggleSkillInfo";
14
- return AgentDebugActions;
15
- }({});
16
- export let AgentCommonActions = /*#__PURE__*/function (AgentCommonActions) {
17
- /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
18
- AgentCommonActions["VIEW"] = "view";
19
- /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
20
- AgentCommonActions["EDIT"] = "edit";
21
- /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
22
- AgentCommonActions["UPDATED"] = "updated";
23
- /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
24
- AgentCommonActions["COPY_LINK"] = "copyLink";
25
- /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
26
- AgentCommonActions["DELETE"] = "delete";
27
- /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
28
- AgentCommonActions["DUPLICATE"] = "duplicate";
29
- /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
30
- AgentCommonActions["STAR"] = "star";
31
- /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
32
- AgentCommonActions["CHAT"] = "chat";
33
- /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
34
- AgentCommonActions["VERIFY"] = "verify";
35
- /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
36
- AgentCommonActions["UNVERIFY"] = "unverify";
37
- return AgentCommonActions;
38
- }({});
5
+ import { AgentInteractionActions } from './groups/agent-interactions';
6
+ import { AgentDebugActions as AgentDebugActionsEnum } from './groups/debug';
7
+ import { AgentEditingActions } from './groups/editing';
8
+ import { ACTION_TO_GROUP } from './registry';
9
+
10
+ // Backward-compatible aliases
11
+ // TODO: migrate consumers to use group-specific imports, then remove
12
+ export const AgentCommonActions = {
13
+ ...AgentInteractionActions,
14
+ ...AgentEditingActions
15
+ };
16
+
17
+ // TODO: Remove the alias, will be breaking change, this is just for backward compatibility
18
+ export const AgentDebugActions = AgentDebugActionsEnum;
39
19
  const globalEventConfig = getDefaultTrackEventConfig();
40
20
  export const useRovoAgentActionAnalytics = commonAttributes => {
41
21
  const analyticsContext = useContext(AnalyticsReactContext);
@@ -60,7 +40,10 @@ export const useRovoAgentActionAnalytics = commonAttributes => {
60
40
  fireAnalyticsEvent({
61
41
  actionSubject: 'rovoAgent',
62
42
  action,
63
- attributes
43
+ attributes: {
44
+ ...attributes,
45
+ actionGroup: ACTION_TO_GROUP[action]
46
+ }
64
47
  });
65
48
  }, [fireAnalyticsEvent]);
66
49
  const trackAgentActionError = useCallback((action, error, attributes) => {
@@ -69,6 +52,7 @@ export const useRovoAgentActionAnalytics = commonAttributes => {
69
52
  action,
70
53
  attributes: {
71
54
  ...attributes,
55
+ actionGroup: ACTION_TO_GROUP[action],
72
56
  error: {
73
57
  message: error.message
74
58
  }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Action Registry
3
+ *
4
+ * Single source of truth for ALL action groups across the library.
5
+ * This file composes all groups into a type-safe registry and builds the
6
+ * runtime mapping from action values to their group names, which gets
7
+ * automatically attached as `attributes.actionGroup` in every fired event.
8
+ *
9
+ * Both `useRovoAgentActionAnalytics` and `useRovoAgentCreateAnalytics` hooks
10
+ * use `ACTION_TO_GROUP` from this registry.
11
+ *
12
+ * ## Adding a new action group
13
+ * 1. Create a new file in ./groups/ following the template of existing group files
14
+ * 2. Import the group's ACTION_GROUP, action enum, and attribute type below
15
+ * 3. If the group is used by the actions hook, add the attribute type to `ActionAttributes`
16
+ * 4. Add the enum + group to `ACTION_TO_GROUP` using `mapActionsToGroup`
17
+ */
18
+ import { AddToolsPromptActions, ACTION_GROUP as ADD_TOOLS_PROMPT_GROUP } from './groups/add-tools-prompt';
19
+ import { AgentInteractionActions, ACTION_GROUP as AGENT_INTERACTIONS_GROUP } from './groups/agent-interactions';
20
+ import { CreateFlowActions, ACTION_GROUP as CREATE_FLOW_GROUP } from './groups/create-flow';
21
+ import { AgentDebugActions, ACTION_GROUP as DEBUG_GROUP } from './groups/debug';
22
+ import { AgentEditingActions, ACTION_GROUP as EDITING_GROUP } from './groups/editing';
23
+ import { AgentToolActions, ACTION_GROUP as TOOLS_GROUP } from './groups/tools';
24
+
25
+ /**
26
+ * Combined attribute map for action-hook groups (type-safe attributes).
27
+ * Create-flow groups are excluded — they use a looser attribute type via the create hook.
28
+ */
29
+
30
+ /**
31
+ * Helper to build a Record mapping each enum value to its group name.
32
+ */
33
+ const mapActionsToGroup = (actionEnum, group) => {
34
+ return Object.fromEntries(Object.values(actionEnum).map(action => [action, group]));
35
+ };
36
+
37
+ /**
38
+ * Runtime lookup: action value → group name.
39
+ * Used by ALL analytics hooks to auto-inject `attributes.actionGroup`.
40
+ *
41
+ * When you add a new group, add it here too.
42
+ */
43
+ export const ACTION_TO_GROUP = {
44
+ // Action hook groups
45
+ ...mapActionsToGroup(AgentInteractionActions, AGENT_INTERACTIONS_GROUP),
46
+ ...mapActionsToGroup(AgentEditingActions, EDITING_GROUP),
47
+ ...mapActionsToGroup(AgentDebugActions, DEBUG_GROUP),
48
+ ...mapActionsToGroup(AgentToolActions, TOOLS_GROUP),
49
+ // Create hook groups
50
+ ...mapActionsToGroup(CreateFlowActions, CREATE_FLOW_GROUP),
51
+ ...mapActionsToGroup(AddToolsPromptActions, ADD_TOOLS_PROMPT_GROUP)
52
+ };
@@ -1,35 +1,18 @@
1
1
  import { useCallback, useContext, useRef } from 'react';
2
2
  import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
3
+ import { AddToolsPromptActions } from '../actions/groups/add-tools-prompt';
4
+ import { CreateFlowActions } from '../actions/groups/create-flow';
5
+ import { ACTION_TO_GROUP } from '../actions/registry';
3
6
  import { ANALYTICS_CHANNEL } from '../common/constants';
4
7
  import { useRovoAgentCSID } from '../common/csid';
5
8
  import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
6
- export let AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
7
- /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
8
- AgentCreateActions["START"] = "createFlowStart";
9
- /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
10
- AgentCreateActions["SKIP_NL"] = "createFlowSkipNL";
11
- /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
12
- AgentCreateActions["REVIEW_NL"] = "createFlowReviewNL";
13
- /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
14
- AgentCreateActions["ACTIVATE"] = "createFlowActivate";
15
- /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
16
- AgentCreateActions["RESTART"] = "createFlowRestart";
17
- /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
18
- AgentCreateActions["ERROR"] = "createFlowError";
19
- /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
20
- AgentCreateActions["LAND"] = "createLandInStudio";
21
- /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
22
- AgentCreateActions["DISCARD"] = "createDiscard";
23
- /* Show no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97435 */
24
- AgentCreateActions["SHOW_NO_SKILLS_MODAL"] = "showNoSkillsModal";
25
- /* Browse click no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97436 */
26
- AgentCreateActions["BROWSE_CLICK_NO_SKILLS_MODAL"] = "browseClickNoSkillsModal";
27
- /* Discard no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97437 */
28
- AgentCreateActions["DISCARD_NO_SKILLS_MODAL"] = "discardNoSkillsModal";
29
- /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
30
- AgentCreateActions["SA_DRAFT"] = "saDraft";
31
- return AgentCreateActions;
32
- }({});
9
+
10
+ // Backward-compatible alias
11
+ // TODO: migrate consumers to use CreateFlowActions / AddToolsPromptActions directly, then remove
12
+ export const AgentCreateActions = {
13
+ ...CreateFlowActions,
14
+ ...AddToolsPromptActions
15
+ };
33
16
  const globalEventConfig = getDefaultTrackEventConfig();
34
17
  export const useRovoAgentCreateAnalytics = commonAttributes => {
35
18
  const [csid, {
@@ -42,10 +25,12 @@ export const useRovoAgentCreateAnalytics = commonAttributes => {
42
25
  const commonAttributesRef = useRef(commonAttributes);
43
26
  const fireAnalyticsEvent = useCallback(event => {
44
27
  const referrer = typeof window !== 'undefined' ? window.document.referrer : 'unknown';
28
+ const action = event.action;
45
29
  const attributes = {
46
30
  ...getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext()),
47
31
  ...commonAttributesRef.current,
48
32
  ...event.attributes,
33
+ actionGroup: ACTION_TO_GROUP[action],
49
34
  csid,
50
35
  referrer
51
36
  };
@@ -75,7 +60,7 @@ export const useRovoAgentCreateAnalytics = commonAttributes => {
75
60
  const trackCreateSessionStart = useCallback(attributes => {
76
61
  fireAnalyticsEvent({
77
62
  actionSubject: 'rovoAgent',
78
- action: AgentCreateActions.START,
63
+ action: CreateFlowActions.START,
79
64
  attributes
80
65
  });
81
66
  refreshCSID();
@@ -83,7 +68,7 @@ export const useRovoAgentCreateAnalytics = commonAttributes => {
83
68
  const trackCreateSessionError = useCallback((error, attributes) => {
84
69
  fireAnalyticsEvent({
85
70
  actionSubject: 'rovoAgent',
86
- action: AgentCreateActions.ERROR,
71
+ action: CreateFlowActions.ERROR,
87
72
  attributes: {
88
73
  error: {
89
74
  message: error.message
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Action Group: addToolsPrompt
3
+ *
4
+ * Add tools prompt modal — shown when a user tries to activate/publish an agent that has no tools.
5
+ * The user can browse tools or dismiss and proceed without them.
6
+ *
7
+ * This group is intentionally flow-agnostic so the action values stay stable
8
+ * regardless of whether the prompt fires from the create flow or a future publish flow.
9
+ *
10
+ * ## Adding a new action
11
+ * 1. Add the action to the `AddToolsPromptActions` enum below with a data-portal link
12
+ * 2. Register this group in ../registry.ts (if this is a new group file)
13
+ *
14
+ */
15
+
16
+ /** The group name sent as `attributes.actionGroup` in analytics events */
17
+ export var ACTION_GROUP = 'addToolsPrompt';
18
+ export var AddToolsPromptActions = /*#__PURE__*/function (AddToolsPromptActions) {
19
+ /* Add tools prompt shown (agent has no tools) - https://data-portal.internal.atlassian.com/analytics/registry/98106 */
20
+ AddToolsPromptActions["SHOWN"] = "addToolsPromptShown";
21
+ /* User clicked "Browse skills" on the add tools prompt - https://data-portal.internal.atlassian.com/analytics/registry/98107 */
22
+ AddToolsPromptActions["BROWSE"] = "addToolsPromptBrowse";
23
+ /* User dismissed the add tools prompt ("No thanks") and proceeded anyway - https://data-portal.internal.atlassian.com/analytics/registry/98108 */
24
+ AddToolsPromptActions["DISMISS"] = "addToolsPromptDismiss";
25
+ return AddToolsPromptActions;
26
+ }({});
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Action Group: agentInteractions
3
+ *
4
+ * User-initiated interactions with an agent — typically from the overflow menu ("...")
5
+ * or agent profile surfaces (viewing, editing, deleting, duplicating, starring, sharing, verifying).
6
+ *
7
+ * NOTE: This is about UI interactions, not backend "actions" (which are being replaced by "tools").
8
+ *
9
+ * ## Adding a new action
10
+ * 1. Add the action to the `AgentInteractionActions` enum below with a data-portal link
11
+ * 2. Add the corresponding attribute type in `AgentInteractionAttributes`
12
+ * 3. If this action doesn't fit user interactions, create a new group file instead
13
+ * (see other files in this directory for the template)
14
+ */
15
+
16
+ /** The group name sent as `attributes.actionGroup` in analytics events */
17
+ export var ACTION_GROUP = 'agentInteractions';
18
+ export var AgentInteractionActions = /*#__PURE__*/function (AgentInteractionActions) {
19
+ /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
20
+ AgentInteractionActions["VIEW"] = "view";
21
+ /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
22
+ AgentInteractionActions["EDIT"] = "edit";
23
+ /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
24
+ AgentInteractionActions["COPY_LINK"] = "copyLink";
25
+ /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
26
+ AgentInteractionActions["DELETE"] = "delete";
27
+ /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
28
+ AgentInteractionActions["DUPLICATE"] = "duplicate";
29
+ /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
30
+ AgentInteractionActions["STAR"] = "star";
31
+ /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
32
+ AgentInteractionActions["CHAT"] = "chat";
33
+ /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
34
+ AgentInteractionActions["VERIFY"] = "verify";
35
+ /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
36
+ AgentInteractionActions["UNVERIFY"] = "unverify";
37
+ return AgentInteractionActions;
38
+ }({});
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Action Group: createFlow
3
+ *
4
+ * Create agent funnel steps — from clicking "Create agent" through to activation or discard,
5
+ *
6
+ * ## Adding a new action
7
+ * 1. Add the action to the `CreateFlowActions` enum below with a data-portal link
8
+ * 2. Register this group in ../registry.ts (if this is a new group file)
9
+ */
10
+
11
+ /** The group name sent as `attributes.actionGroup` in analytics events */
12
+ export var ACTION_GROUP = 'createFlow';
13
+ export var CreateFlowActions = /*#__PURE__*/function (CreateFlowActions) {
14
+ /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
15
+ CreateFlowActions["START"] = "createFlowStart";
16
+ /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
17
+ CreateFlowActions["SKIP_NL"] = "createFlowSkipNL";
18
+ /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
19
+ CreateFlowActions["REVIEW_NL"] = "createFlowReviewNL";
20
+ /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
21
+ CreateFlowActions["ACTIVATE"] = "createFlowActivate";
22
+ /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
23
+ CreateFlowActions["RESTART"] = "createFlowRestart";
24
+ /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
25
+ CreateFlowActions["ERROR"] = "createFlowError";
26
+ /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
27
+ CreateFlowActions["LAND"] = "createLandInStudio";
28
+ /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
29
+ CreateFlowActions["DISCARD"] = "createDiscard";
30
+ /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
31
+ CreateFlowActions["SA_DRAFT"] = "saDraft";
32
+ return CreateFlowActions;
33
+ }({});
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Action Group: debug
3
+ *
4
+ * Actions related to the agent debug modal (viewing, copying debug data, toggling skill info).
5
+ *
6
+ * ## Adding a new action
7
+ * 1. Add the action to the `AgentDebugActions` enum below with a data-portal link
8
+ * 2. Add the corresponding attribute type in `DebugActionAttributes`
9
+ * 3. If this action doesn't fit this group, consider creating a new group file instead
10
+ * (see other files in this directory for the template)
11
+ */
12
+
13
+ /** The group name sent as `attributes.actionGroup` in analytics events */
14
+ export var ACTION_GROUP = 'debug';
15
+ export var AgentDebugActions = /*#__PURE__*/function (AgentDebugActions) {
16
+ /* View debug modal - https://data-portal.internal.atlassian.com/analytics/registry/97183 */
17
+ AgentDebugActions["VIEW"] = "debugView";
18
+ /* Copy all debug data - https://data-portal.internal.atlassian.com/analytics/registry/97186 */
19
+ AgentDebugActions["COPY_ALL"] = "debugCopyAll";
20
+ /* Copy debug data - https://data-portal.internal.atlassian.com/analytics/registry/97184 */
21
+ AgentDebugActions["COPY"] = "debugCopy";
22
+ /* Toggle skill info - https://data-portal.internal.atlassian.com/analytics/registry/97185 */
23
+ AgentDebugActions["TOGGLE_SKILL_INFO"] = "debugToggleSkillInfo";
24
+ return AgentDebugActions;
25
+ }({});
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Action Group: editing
3
+ *
4
+ * Agent editing/mutation events — fired when an agent's configuration is saved or modified.
5
+ * Unlike agentInteractions (user clicks), these track actual data changes.
6
+ *
7
+ * ## Adding a new action
8
+ * 1. Add the action to the `AgentEditingActions` enum below with a data-portal link
9
+ * 2. Add the corresponding attribute type in `EditingActionAttributes`
10
+ * 3. If this action doesn't fit editing/mutation events, create a new group file instead
11
+ * (see other files in this directory for the template)
12
+ */
13
+
14
+ /** The group name sent as `attributes.actionGroup` in analytics events */
15
+ export var ACTION_GROUP = 'editing';
16
+ export var AgentEditingActions = /*#__PURE__*/function (AgentEditingActions) {
17
+ /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
18
+ AgentEditingActions["UPDATED"] = "updated";
19
+ return AgentEditingActions;
20
+ }({});
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Action Group: tools
3
+ *
4
+ * Actions related to agent tool execution during chat
5
+ * (confirming, streaming, viewing results, errors).
6
+ *
7
+ * ## Adding a new action
8
+ * 1. Add the action to the `AgentToolActions` enum below with a data-portal link
9
+ * 2. Add the corresponding attribute type in `ToolsActionAttributes`
10
+ * 3. If this action doesn't fit this group, consider creating a new group file instead
11
+ * (see other files in this directory for the template)
12
+ */
13
+
14
+ /** The group name sent as `attributes.actionGroup` in analytics events */
15
+ export var ACTION_GROUP = 'tools';
1
16
  export var AgentToolActions = /*#__PURE__*/function (AgentToolActions) {
2
17
  /* When chatting with an agent, and tools confirmation being shown, then user click proceed with the possible actions (e.g. confirm, dismiss etc) https://data-portal.internal.atlassian.com/analytics/registry/97675 */
3
18
  AgentToolActions["TOOLS_EXECUTION_CONFIRMED"] = "toolsExecutionConfirmed";