@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/rovo-agent-analytics
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2ccb8729cef96`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2ccb8729cef96) -
8
+ Reorg agent action enums to different files, add the actionGroup to the analytics
9
+
3
10
  ## 0.18.0
4
11
 
5
12
  ### Minor Changes
package/README.md CHANGED
@@ -37,29 +37,81 @@ trackAgentAction(AgentDebugActions.VIEW, {});
37
37
  trackAgentAction(AgentDebugActions.COPY, {});
38
38
  ```
39
39
 
40
- ## Adding New Actions
40
+ ## Action Groups
41
41
 
42
- ### Step 1: Add the action to the appropriate enum
42
+ Actions are organized into **groups** self-contained files that define their actions, attribute
43
+ types, and a group name that gets automatically sent as `attributes.actionGroup` in every fired event.
43
44
 
44
- Add your new action to either `AgentCommonActions` or `AgentDebugActions` in
45
- `src/actions/index.tsx`:
45
+ All groups live in **one place**: `src/actions/groups/`.
46
+
47
+ | Group | File | Hook | Description |
48
+ | --- | --- | --- | --- |
49
+ | `agentInteractions` | `agent-interactions.ts` | actions | User-initiated interactions from overflow menu / profile (view, edit, delete, duplicate, star, chat, verify…) |
50
+ | `editing` | `editing.ts` | actions | Agent save/mutation events (updated) |
51
+ | `debug` | `debug.ts` | actions | Debug modal actions (view, copy, toggle skill info) |
52
+ | `tools` | `tools.ts` | actions | Tool execution actions (confirm, stream stop, result viewed, error) |
53
+ | `createFlow` | `create-flow.ts` | create | Create agent funnel steps (start, skip NL, review, activate, restart, error, land, discard) |
54
+ | `addToolsPrompt` | `add-tools-prompt.ts` | create | Add tools prompt modal shown when activating an agent with no tools (shown, browse, dismiss) |
55
+
56
+ The `actionGroup` value is visible in Databricks via `attributes.actionGroup`.
57
+
58
+ ## Adding a New Action
59
+
60
+ ### To an existing group
61
+
62
+ 1. Open the group file (e.g. `src/actions/groups/agent-interactions.ts` or `src/actions/groups/create-flow.ts`)
63
+ 2. Add the action to the enum with a data-portal registry link:
46
64
 
47
65
  ```typescript
48
- export enum AgentCommonActions {
66
+ export enum AgentInteractionActions {
49
67
  // ... existing actions
50
68
  /* My new action - https://data-portal.internal.atlassian.com/analytics/registry/XXXXX */
51
69
  MY_NEW_ACTION = 'myNewAction',
52
70
  }
53
71
  ```
54
72
 
55
- ### Step 2: Define attributes for the action
56
-
57
- Add an entry to `ActionAttributes` to specify which attributes this action requires:
73
+ 3. Add the attribute type in the same file:
58
74
 
59
75
  ```typescript
60
- type ActionAttributes = {
76
+ export type AgentInteractionAttributes = {
61
77
  // ... existing actions
62
- [AgentCommonActions.MY_NEW_ACTION]: CommonAnalyticsAttributes;
78
+ [AgentInteractionActions.MY_NEW_ACTION]: BaseAgentAnalyticsAttributes;
79
+ };
80
+ ```
81
+
82
+ That's it — the action is automatically registered and will fire with `actionGroup: 'agentInteractions'`.
83
+
84
+ ### To a new group
85
+
86
+ If your action doesn't fit any existing group, create a new one:
87
+
88
+ 1. Create a new file in `src/actions/groups/`. Use any existing group file as a template — each one
89
+ has a header comment explaining the structure.
90
+
91
+ 2. Register the group in `src/actions/registry.ts`:
92
+
93
+ ```typescript
94
+ // 1. Import the group
95
+ import {
96
+ MyFeatureActions,
97
+ type MyFeatureActionAttributes,
98
+ ACTION_GROUP as MY_FEATURE_GROUP,
99
+ } from './groups/my-feature';
100
+
101
+ // 2. Add to the combined type
102
+ export type ActionAttributes = AgentInteractionAttributes &
103
+ EditingActionAttributes &
104
+ DebugActionAttributes &
105
+ ToolsActionAttributes &
106
+ MyFeatureActionAttributes;
107
+
108
+ // 3. Add to the runtime group map
109
+ export const ACTION_TO_GROUP: Record<string, string> = {
110
+ ...mapActionsToGroup(AgentInteractionActions, AGENT_INTERACTIONS_GROUP),
111
+ ...mapActionsToGroup(AgentEditingActions, EDITING_GROUP),
112
+ ...mapActionsToGroup(AgentDebugActions, DEBUG_GROUP),
113
+ ...mapActionsToGroup(AgentToolActions, TOOLS_GROUP),
114
+ ...mapActionsToGroup(MyFeatureActions, MY_FEATURE_GROUP),
63
115
  };
64
116
  ```
65
117
 
@@ -68,31 +120,30 @@ type ActionAttributes = {
68
120
  Each action can have its own specific attributes. The `trackAgentAction` function is generic and
69
121
  will enforce the correct attributes based on the action you pass.
70
122
 
71
- ### Using CommonAnalyticsAttributes
123
+ ### Using BaseAgentAnalyticsAttributes
72
124
 
73
125
  For actions that only need `touchPoint` and `agentId`:
74
126
 
75
127
  ```typescript
76
- type ActionAttributes = {
77
- [AgentCommonActions.VIEW]: CommonAnalyticsAttributes;
128
+ export type AgentInteractionAttributes = {
129
+ [AgentInteractionActions.VIEW]: BaseAgentAnalyticsAttributes;
78
130
  };
79
131
  ```
80
132
 
81
133
  ### Using Custom Attributes
82
134
 
83
- For actions that need additional attributes beyond the common ones:
135
+ For actions that need additional attributes beyond the base ones:
84
136
 
85
137
  ```typescript
86
- type ActionAttributes = {
87
- [AgentCommonActions.STAR]: CommonAnalyticsAttributes & { isStarred: boolean };
138
+ export type EditingActionAttributes = {
139
+ [AgentEditingActions.UPDATED]: BaseAgentAnalyticsAttributes & { agentType: string; field: string };
88
140
  };
89
141
  ```
90
142
 
91
143
  When calling `trackAgentAction`, TypeScript will enforce the custom attributes:
92
144
 
93
145
  ```typescript
94
- // TypeScript will require isStarred to be provided
95
- trackAgentAction(AgentCommonActions.STAR, { isStarred: true });
146
+ trackAgentAction(AgentEditingActions.UPDATED, { agentType: 'custom', field: 'name' });
96
147
  ```
97
148
 
98
149
  ### How Type Inference Works
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/rovo-agent-analytics/actions/add-tools-prompt",
3
+ "main": "../../dist/cjs/actions/groups/add-tools-prompt.js",
4
+ "module": "../../dist/esm/actions/groups/add-tools-prompt.js",
5
+ "module:es2019": "../../dist/es2019/actions/groups/add-tools-prompt.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/actions/groups/add-tools-prompt.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/rovo-agent-analytics/actions/agent-interactions",
3
+ "main": "../../dist/cjs/actions/groups/agent-interactions.js",
4
+ "module": "../../dist/esm/actions/groups/agent-interactions.js",
5
+ "module:es2019": "../../dist/es2019/actions/groups/agent-interactions.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/actions/groups/agent-interactions.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/actions/groups/agent-interactions.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/rovo-agent-analytics/actions/create-flow",
3
+ "main": "../../dist/cjs/actions/groups/create-flow.js",
4
+ "module": "../../dist/esm/actions/groups/create-flow.js",
5
+ "module:es2019": "../../dist/es2019/actions/groups/create-flow.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/actions/groups/create-flow.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/actions/groups/create-flow.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/rovo-agent-analytics/actions/debug",
3
+ "main": "../../dist/cjs/actions/groups/debug.js",
4
+ "module": "../../dist/esm/actions/groups/debug.js",
5
+ "module:es2019": "../../dist/es2019/actions/groups/debug.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/actions/groups/debug.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/actions/groups/debug.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/rovo-agent-analytics/actions/editing",
3
+ "main": "../../dist/cjs/actions/groups/editing.js",
4
+ "module": "../../dist/esm/actions/groups/editing.js",
5
+ "module:es2019": "../../dist/es2019/actions/groups/editing.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/actions/groups/editing.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/actions/groups/editing.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-analytics/actions/tool-actions",
3
- "main": "../../dist/cjs/actions/tool-actions/index.js",
4
- "module": "../../dist/esm/actions/tool-actions/index.js",
5
- "module:es2019": "../../dist/es2019/actions/tool-actions/index.js",
3
+ "main": "../../dist/cjs/actions/groups/tools.js",
4
+ "module": "../../dist/esm/actions/groups/tools.js",
5
+ "module:es2019": "../../dist/es2019/actions/groups/tools.js",
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/actions/tool-actions/index.d.ts",
9
+ "types": "../../dist/types/actions/groups/tools.d.ts",
10
10
  "typesVersions": {
11
11
  ">=4.5 <5.9": {
12
12
  "*": [
13
- "../../dist/types-ts4.5/actions/tool-actions/index.d.ts"
13
+ "../../dist/types-ts4.5/actions/groups/tools.d.ts"
14
14
  ]
15
15
  }
16
16
  }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AddToolsPromptActions = exports.ACTION_GROUP = void 0;
7
+ /**
8
+ * Action Group: addToolsPrompt
9
+ *
10
+ * Add tools prompt modal — shown when a user tries to activate/publish an agent that has no tools.
11
+ * The user can browse tools or dismiss and proceed without them.
12
+ *
13
+ * This group is intentionally flow-agnostic so the action values stay stable
14
+ * regardless of whether the prompt fires from the create flow or a future publish flow.
15
+ *
16
+ * ## Adding a new action
17
+ * 1. Add the action to the `AddToolsPromptActions` enum below with a data-portal link
18
+ * 2. Register this group in ../registry.ts (if this is a new group file)
19
+ *
20
+ */
21
+
22
+ /** The group name sent as `attributes.actionGroup` in analytics events */
23
+ var ACTION_GROUP = exports.ACTION_GROUP = 'addToolsPrompt';
24
+ var AddToolsPromptActions = exports.AddToolsPromptActions = /*#__PURE__*/function (AddToolsPromptActions) {
25
+ /* Add tools prompt shown (agent has no tools) - https://data-portal.internal.atlassian.com/analytics/registry/98106 */
26
+ AddToolsPromptActions["SHOWN"] = "addToolsPromptShown";
27
+ /* User clicked "Browse skills" on the add tools prompt - https://data-portal.internal.atlassian.com/analytics/registry/98107 */
28
+ AddToolsPromptActions["BROWSE"] = "addToolsPromptBrowse";
29
+ /* User dismissed the add tools prompt ("No thanks") and proceeded anyway - https://data-portal.internal.atlassian.com/analytics/registry/98108 */
30
+ AddToolsPromptActions["DISMISS"] = "addToolsPromptDismiss";
31
+ return AddToolsPromptActions;
32
+ }({});
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AgentInteractionActions = exports.ACTION_GROUP = void 0;
7
+ /**
8
+ * Action Group: agentInteractions
9
+ *
10
+ * User-initiated interactions with an agent — typically from the overflow menu ("...")
11
+ * or agent profile surfaces (viewing, editing, deleting, duplicating, starring, sharing, verifying).
12
+ *
13
+ * NOTE: This is about UI interactions, not backend "actions" (which are being replaced by "tools").
14
+ *
15
+ * ## Adding a new action
16
+ * 1. Add the action to the `AgentInteractionActions` enum below with a data-portal link
17
+ * 2. Add the corresponding attribute type in `AgentInteractionAttributes`
18
+ * 3. If this action doesn't fit user interactions, create a new group file instead
19
+ * (see other files in this directory for the template)
20
+ */
21
+
22
+ /** The group name sent as `attributes.actionGroup` in analytics events */
23
+ var ACTION_GROUP = exports.ACTION_GROUP = 'agentInteractions';
24
+ var AgentInteractionActions = exports.AgentInteractionActions = /*#__PURE__*/function (AgentInteractionActions) {
25
+ /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
26
+ AgentInteractionActions["VIEW"] = "view";
27
+ /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
28
+ AgentInteractionActions["EDIT"] = "edit";
29
+ /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
30
+ AgentInteractionActions["COPY_LINK"] = "copyLink";
31
+ /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
32
+ AgentInteractionActions["DELETE"] = "delete";
33
+ /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
34
+ AgentInteractionActions["DUPLICATE"] = "duplicate";
35
+ /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
36
+ AgentInteractionActions["STAR"] = "star";
37
+ /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
38
+ AgentInteractionActions["CHAT"] = "chat";
39
+ /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
40
+ AgentInteractionActions["VERIFY"] = "verify";
41
+ /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
42
+ AgentInteractionActions["UNVERIFY"] = "unverify";
43
+ return AgentInteractionActions;
44
+ }({});
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CreateFlowActions = exports.ACTION_GROUP = void 0;
7
+ /**
8
+ * Action Group: createFlow
9
+ *
10
+ * Create agent funnel steps — from clicking "Create agent" through to activation or discard,
11
+ *
12
+ * ## Adding a new action
13
+ * 1. Add the action to the `CreateFlowActions` enum below with a data-portal link
14
+ * 2. Register this group in ../registry.ts (if this is a new group file)
15
+ */
16
+
17
+ /** The group name sent as `attributes.actionGroup` in analytics events */
18
+ var ACTION_GROUP = exports.ACTION_GROUP = 'createFlow';
19
+ var CreateFlowActions = exports.CreateFlowActions = /*#__PURE__*/function (CreateFlowActions) {
20
+ /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
21
+ CreateFlowActions["START"] = "createFlowStart";
22
+ /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
23
+ CreateFlowActions["SKIP_NL"] = "createFlowSkipNL";
24
+ /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
25
+ CreateFlowActions["REVIEW_NL"] = "createFlowReviewNL";
26
+ /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
27
+ CreateFlowActions["ACTIVATE"] = "createFlowActivate";
28
+ /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
29
+ CreateFlowActions["RESTART"] = "createFlowRestart";
30
+ /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
31
+ CreateFlowActions["ERROR"] = "createFlowError";
32
+ /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
33
+ CreateFlowActions["LAND"] = "createLandInStudio";
34
+ /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
35
+ CreateFlowActions["DISCARD"] = "createDiscard";
36
+ /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
37
+ CreateFlowActions["SA_DRAFT"] = "saDraft";
38
+ return CreateFlowActions;
39
+ }({});
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AgentDebugActions = exports.ACTION_GROUP = void 0;
7
+ /**
8
+ * Action Group: debug
9
+ *
10
+ * Actions related to the agent debug modal (viewing, copying debug data, toggling skill info).
11
+ *
12
+ * ## Adding a new action
13
+ * 1. Add the action to the `AgentDebugActions` enum below with a data-portal link
14
+ * 2. Add the corresponding attribute type in `DebugActionAttributes`
15
+ * 3. If this action doesn't fit this group, consider creating a new group file instead
16
+ * (see other files in this directory for the template)
17
+ */
18
+
19
+ /** The group name sent as `attributes.actionGroup` in analytics events */
20
+ var ACTION_GROUP = exports.ACTION_GROUP = 'debug';
21
+ var AgentDebugActions = exports.AgentDebugActions = /*#__PURE__*/function (AgentDebugActions) {
22
+ /* View debug modal - https://data-portal.internal.atlassian.com/analytics/registry/97183 */
23
+ AgentDebugActions["VIEW"] = "debugView";
24
+ /* Copy all debug data - https://data-portal.internal.atlassian.com/analytics/registry/97186 */
25
+ AgentDebugActions["COPY_ALL"] = "debugCopyAll";
26
+ /* Copy debug data - https://data-portal.internal.atlassian.com/analytics/registry/97184 */
27
+ AgentDebugActions["COPY"] = "debugCopy";
28
+ /* Toggle skill info - https://data-portal.internal.atlassian.com/analytics/registry/97185 */
29
+ AgentDebugActions["TOGGLE_SKILL_INFO"] = "debugToggleSkillInfo";
30
+ return AgentDebugActions;
31
+ }({});
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AgentEditingActions = exports.ACTION_GROUP = void 0;
7
+ /**
8
+ * Action Group: editing
9
+ *
10
+ * Agent editing/mutation events — fired when an agent's configuration is saved or modified.
11
+ * Unlike agentInteractions (user clicks), these track actual data changes.
12
+ *
13
+ * ## Adding a new action
14
+ * 1. Add the action to the `AgentEditingActions` enum below with a data-portal link
15
+ * 2. Add the corresponding attribute type in `EditingActionAttributes`
16
+ * 3. If this action doesn't fit editing/mutation events, create a new group file instead
17
+ * (see other files in this directory for the template)
18
+ */
19
+
20
+ /** The group name sent as `attributes.actionGroup` in analytics events */
21
+ var ACTION_GROUP = exports.ACTION_GROUP = 'editing';
22
+ var AgentEditingActions = exports.AgentEditingActions = /*#__PURE__*/function (AgentEditingActions) {
23
+ /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
24
+ AgentEditingActions["UPDATED"] = "updated";
25
+ return AgentEditingActions;
26
+ }({});
@@ -3,7 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.AgentToolActions = void 0;
6
+ exports.AgentToolActions = exports.ACTION_GROUP = void 0;
7
+ /**
8
+ * Action Group: tools
9
+ *
10
+ * Actions related to agent tool execution during chat
11
+ * (confirming, streaming, viewing results, errors).
12
+ *
13
+ * ## Adding a new action
14
+ * 1. Add the action to the `AgentToolActions` enum below with a data-portal link
15
+ * 2. Add the corresponding attribute type in `ToolsActionAttributes`
16
+ * 3. If this action doesn't fit this group, consider creating a new group file instead
17
+ * (see other files in this directory for the template)
18
+ */
19
+
20
+ /** The group name sent as `attributes.actionGroup` in analytics events */
21
+ var ACTION_GROUP = exports.ACTION_GROUP = 'tools';
7
22
  var AgentToolActions = exports.AgentToolActions = /*#__PURE__*/function (AgentToolActions) {
8
23
  /* 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 */
9
24
  AgentToolActions["TOOLS_EXECUTION_CONFIRMED"] = "toolsExecutionConfirmed";
@@ -10,42 +10,18 @@ var _react = require("react");
10
10
  var _analyticsNext = require("@atlaskit/analytics-next");
11
11
  var _constants = require("../common/constants");
12
12
  var _utils = require("../common/utils");
13
+ var _agentInteractions = require("./groups/agent-interactions");
14
+ var _debug = require("./groups/debug");
15
+ var _editing = require("./groups/editing");
16
+ var _registry = require("./registry");
13
17
  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; }
14
18
  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; }
15
- var AgentDebugActions = exports.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
- }({});
26
- var AgentCommonActions = exports.AgentCommonActions = /*#__PURE__*/function (AgentCommonActions) {
27
- /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
28
- AgentCommonActions["VIEW"] = "view";
29
- /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
30
- AgentCommonActions["EDIT"] = "edit";
31
- /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
32
- AgentCommonActions["UPDATED"] = "updated";
33
- /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
34
- AgentCommonActions["COPY_LINK"] = "copyLink";
35
- /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
36
- AgentCommonActions["DELETE"] = "delete";
37
- /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
38
- AgentCommonActions["DUPLICATE"] = "duplicate";
39
- /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
40
- AgentCommonActions["STAR"] = "star";
41
- /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
42
- AgentCommonActions["CHAT"] = "chat";
43
- /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
44
- AgentCommonActions["VERIFY"] = "verify";
45
- /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
46
- AgentCommonActions["UNVERIFY"] = "unverify";
47
- return AgentCommonActions;
48
- }({});
19
+ // Backward-compatible aliases
20
+ // TODO: migrate consumers to use group-specific imports, then remove
21
+ var AgentCommonActions = exports.AgentCommonActions = _objectSpread(_objectSpread({}, _agentInteractions.AgentInteractionActions), _editing.AgentEditingActions);
22
+
23
+ // TODO: Remove the alias, will be breaking change, this is just for backward compatibility
24
+ var AgentDebugActions = exports.AgentDebugActions = _debug.AgentDebugActions;
49
25
  var globalEventConfig = (0, _utils.getDefaultTrackEventConfig)();
50
26
  var useRovoAgentActionAnalytics = exports.useRovoAgentActionAnalytics = function useRovoAgentActionAnalytics(commonAttributes) {
51
27
  var analyticsContext = (0, _react.useContext)(_analyticsNext.AnalyticsReactContext);
@@ -63,7 +39,9 @@ var useRovoAgentActionAnalytics = exports.useRovoAgentActionAnalytics = function
63
39
  fireAnalyticsEvent({
64
40
  actionSubject: 'rovoAgent',
65
41
  action: action,
66
- attributes: attributes
42
+ attributes: _objectSpread(_objectSpread({}, attributes), {}, {
43
+ actionGroup: _registry.ACTION_TO_GROUP[action]
44
+ })
67
45
  });
68
46
  }, [fireAnalyticsEvent]);
69
47
  var trackAgentActionError = (0, _react.useCallback)(function (action, error, attributes) {
@@ -71,6 +49,7 @@ var useRovoAgentActionAnalytics = exports.useRovoAgentActionAnalytics = function
71
49
  actionSubject: 'rovoAgentError',
72
50
  action: action,
73
51
  attributes: _objectSpread(_objectSpread({}, attributes), {}, {
52
+ actionGroup: _registry.ACTION_TO_GROUP[action],
74
53
  error: {
75
54
  message: error.message
76
55
  }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ACTION_TO_GROUP = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _addToolsPrompt = require("./groups/add-tools-prompt");
10
+ var _agentInteractions = require("./groups/agent-interactions");
11
+ var _createFlow = require("./groups/create-flow");
12
+ var _debug = require("./groups/debug");
13
+ var _editing = require("./groups/editing");
14
+ var _tools = require("./groups/tools");
15
+ 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
+ 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
+ * Action Registry
18
+ *
19
+ * Single source of truth for ALL action groups across the library.
20
+ * This file composes all groups into a type-safe registry and builds the
21
+ * runtime mapping from action values to their group names, which gets
22
+ * automatically attached as `attributes.actionGroup` in every fired event.
23
+ *
24
+ * Both `useRovoAgentActionAnalytics` and `useRovoAgentCreateAnalytics` hooks
25
+ * use `ACTION_TO_GROUP` from this registry.
26
+ *
27
+ * ## Adding a new action group
28
+ * 1. Create a new file in ./groups/ following the template of existing group files
29
+ * 2. Import the group's ACTION_GROUP, action enum, and attribute type below
30
+ * 3. If the group is used by the actions hook, add the attribute type to `ActionAttributes`
31
+ * 4. Add the enum + group to `ACTION_TO_GROUP` using `mapActionsToGroup`
32
+ */
33
+ /**
34
+ * Combined attribute map for action-hook groups (type-safe attributes).
35
+ * Create-flow groups are excluded — they use a looser attribute type via the create hook.
36
+ */
37
+
38
+ /**
39
+ * Helper to build a Record mapping each enum value to its group name.
40
+ */
41
+ var mapActionsToGroup = function mapActionsToGroup(actionEnum, group) {
42
+ return Object.fromEntries(Object.values(actionEnum).map(function (action) {
43
+ return [action, group];
44
+ }));
45
+ };
46
+
47
+ /**
48
+ * Runtime lookup: action value → group name.
49
+ * Used by ALL analytics hooks to auto-inject `attributes.actionGroup`.
50
+ *
51
+ * When you add a new group, add it here too.
52
+ */
53
+ var ACTION_TO_GROUP = exports.ACTION_TO_GROUP = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, mapActionsToGroup(_agentInteractions.AgentInteractionActions, _agentInteractions.ACTION_GROUP)), mapActionsToGroup(_editing.AgentEditingActions, _editing.ACTION_GROUP)), mapActionsToGroup(_debug.AgentDebugActions, _debug.ACTION_GROUP)), mapActionsToGroup(_tools.AgentToolActions, _tools.ACTION_GROUP)), mapActionsToGroup(_createFlow.CreateFlowActions, _createFlow.ACTION_GROUP)), mapActionsToGroup(_addToolsPrompt.AddToolsPromptActions, _addToolsPrompt.ACTION_GROUP));