@atlaskit/rovo-agent-analytics 0.18.0 → 0.20.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 (67) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +103 -58
  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/evaluation/package.json +17 -0
  9. package/actions/tool-actions/package.json +5 -5
  10. package/dist/cjs/actions/groups/add-tools-prompt.js +43 -0
  11. package/dist/cjs/actions/groups/agent-interactions.js +55 -0
  12. package/dist/cjs/actions/groups/create-flow.js +51 -0
  13. package/dist/cjs/actions/groups/debug.js +42 -0
  14. package/dist/cjs/actions/groups/editing.js +32 -0
  15. package/dist/cjs/actions/groups/evaluation.js +1 -0
  16. package/dist/cjs/actions/{tool-actions/index.js → groups/tools.js} +25 -2
  17. package/dist/cjs/actions/index.js +46 -36
  18. package/dist/cjs/actions/registry.js +26 -0
  19. package/dist/cjs/common/types.js +13 -1
  20. package/dist/cjs/create/index.js +12 -33
  21. package/dist/es2019/actions/groups/add-tools-prompt.js +37 -0
  22. package/dist/es2019/actions/groups/agent-interactions.js +50 -0
  23. package/dist/es2019/actions/groups/create-flow.js +45 -0
  24. package/dist/es2019/actions/groups/debug.js +37 -0
  25. package/dist/es2019/actions/groups/editing.js +27 -0
  26. package/dist/es2019/actions/groups/evaluation.js +0 -0
  27. package/dist/es2019/actions/{tool-actions/index.js → groups/tools.js} +27 -1
  28. package/dist/es2019/actions/index.js +48 -35
  29. package/dist/es2019/actions/registry.js +20 -0
  30. package/dist/es2019/common/types.js +7 -0
  31. package/dist/es2019/create/index.js +15 -32
  32. package/dist/esm/actions/groups/add-tools-prompt.js +37 -0
  33. package/dist/esm/actions/groups/agent-interactions.js +50 -0
  34. package/dist/esm/actions/groups/create-flow.js +45 -0
  35. package/dist/esm/actions/groups/debug.js +37 -0
  36. package/dist/esm/actions/groups/editing.js +27 -0
  37. package/dist/esm/actions/groups/evaluation.js +0 -0
  38. package/dist/esm/actions/{tool-actions/index.js → groups/tools.js} +27 -1
  39. package/dist/esm/actions/index.js +47 -36
  40. package/dist/esm/actions/registry.js +20 -0
  41. package/dist/esm/common/types.js +7 -0
  42. package/dist/esm/create/index.js +13 -33
  43. package/dist/types/actions/groups/add-tools-prompt.d.ts +39 -0
  44. package/dist/types/actions/groups/agent-interactions.d.ts +81 -0
  45. package/dist/types/actions/groups/create-flow.d.ts +65 -0
  46. package/dist/types/actions/groups/debug.d.ts +55 -0
  47. package/dist/types/actions/groups/editing.d.ts +33 -0
  48. package/dist/types/actions/groups/evaluation.d.ts +56 -0
  49. package/dist/types/actions/groups/tools.d.ts +69 -0
  50. package/dist/types/actions/index.d.ts +18 -47
  51. package/dist/types/actions/registry.d.ts +23 -0
  52. package/dist/types/common/types.d.ts +14 -0
  53. package/dist/types/create/index.d.ts +17 -15
  54. package/dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts +39 -0
  55. package/dist/types-ts4.5/actions/groups/agent-interactions.d.ts +81 -0
  56. package/dist/types-ts4.5/actions/groups/create-flow.d.ts +65 -0
  57. package/dist/types-ts4.5/actions/groups/debug.d.ts +55 -0
  58. package/dist/types-ts4.5/actions/groups/editing.d.ts +33 -0
  59. package/dist/types-ts4.5/actions/groups/evaluation.d.ts +56 -0
  60. package/dist/types-ts4.5/actions/groups/tools.d.ts +69 -0
  61. package/dist/types-ts4.5/actions/index.d.ts +18 -47
  62. package/dist/types-ts4.5/actions/registry.d.ts +23 -0
  63. package/dist/types-ts4.5/common/types.d.ts +14 -0
  64. package/dist/types-ts4.5/create/index.d.ts +17 -15
  65. package/package.json +2 -2
  66. package/dist/types/actions/tool-actions/index.d.ts +0 -18
  67. package/dist/types-ts4.5/actions/tool-actions/index.d.ts +0 -18
@@ -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 { DefaultActionSubject } 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, {
@@ -63,7 +46,7 @@ export const useRovoAgentCreateAnalytics = commonAttributes => {
63
46
  */
64
47
  const trackCreateSession = useCallback((action, attributes) => {
65
48
  fireAnalyticsEvent({
66
- actionSubject: 'rovoAgent',
49
+ actionSubject: DefaultActionSubject,
67
50
  action,
68
51
  attributes
69
52
  });
@@ -74,16 +57,16 @@ export const useRovoAgentCreateAnalytics = commonAttributes => {
74
57
  */
75
58
  const trackCreateSessionStart = useCallback(attributes => {
76
59
  fireAnalyticsEvent({
77
- actionSubject: 'rovoAgent',
78
- action: AgentCreateActions.START,
60
+ actionSubject: DefaultActionSubject,
61
+ action: CreateFlowActions.START,
79
62
  attributes
80
63
  });
81
64
  refreshCSID();
82
65
  }, [fireAnalyticsEvent, refreshCSID]);
83
66
  const trackCreateSessionError = useCallback((error, attributes) => {
84
67
  fireAnalyticsEvent({
85
- actionSubject: 'rovoAgent',
86
- action: AgentCreateActions.ERROR,
68
+ actionSubject: DefaultActionSubject,
69
+ action: CreateFlowActions.ERROR,
87
70
  attributes: {
88
71
  error: {
89
72
  message: error.message
@@ -0,0 +1,37 @@
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 a new variant to the `AddToolsPromptEventPayload` union type below with a data-portal link
12
+ * 2. If this action doesn't fit this group, consider creating a new group file instead
13
+ * (see other files in this directory for the template)
14
+ */
15
+
16
+ /**
17
+ * Discriminated union payload type for add tools prompt events.
18
+ * Use with `trackAgentEvent()`.
19
+ */
20
+
21
+ // ============================================================================
22
+ // BACKWARDS COMPAT (deprecated): Keep enum and attributes for trackAgentAction() consumers
23
+ // ============================================================================
24
+
25
+ /** @deprecated Use AddToolsPromptEventPayload with trackAgentEvent() instead */
26
+ export var ACTION_GROUP = 'addToolsPrompt';
27
+
28
+ /** @deprecated Use AddToolsPromptEventPayload with trackAgentEvent() instead */
29
+ export var AddToolsPromptActions = /*#__PURE__*/function (AddToolsPromptActions) {
30
+ /* Add tools prompt shown (agent has no tools) - https://data-portal.internal.atlassian.com/analytics/registry/98106 */
31
+ AddToolsPromptActions["SHOWN"] = "addToolsPromptShown";
32
+ /* User clicked "Browse skills" on the add tools prompt - https://data-portal.internal.atlassian.com/analytics/registry/98107 */
33
+ AddToolsPromptActions["BROWSE"] = "addToolsPromptBrowse";
34
+ /* User dismissed the add tools prompt ("No thanks") and proceeded anyway - https://data-portal.internal.atlassian.com/analytics/registry/98108 */
35
+ AddToolsPromptActions["DISMISS"] = "addToolsPromptDismiss";
36
+ return AddToolsPromptActions;
37
+ }({});
@@ -0,0 +1,50 @@
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 a new variant to the `AgentInteractionsEventPayload` union type below with a data-portal link
11
+ * 2. If this action doesn't fit user interactions, create a new group file instead
12
+ * (see other files in this directory for the template)
13
+ */
14
+
15
+ /**
16
+ * Discriminated union payload type for agent interaction events.
17
+ * Use with `trackAgentEvent()`.
18
+ */
19
+
20
+ // ============================================================================
21
+ // BACKWARDS COMPAT (deprecated): Keep enum and attributes for trackAgentAction() consumers
22
+ // ============================================================================
23
+
24
+ /** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
25
+ export var ACTION_GROUP = 'agentInteractions';
26
+
27
+ /** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
28
+ export var AgentInteractionActions = /*#__PURE__*/function (AgentInteractionActions) {
29
+ /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
30
+ AgentInteractionActions["VIEW"] = "view";
31
+ /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
32
+ AgentInteractionActions["EDIT"] = "edit";
33
+ /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
34
+ AgentInteractionActions["COPY_LINK"] = "copyLink";
35
+ /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
36
+ AgentInteractionActions["DELETE"] = "delete";
37
+ /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
38
+ AgentInteractionActions["DUPLICATE"] = "duplicate";
39
+ /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
40
+ AgentInteractionActions["STAR"] = "star";
41
+ /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
42
+ AgentInteractionActions["CHAT"] = "chat";
43
+ /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
44
+ AgentInteractionActions["VERIFY"] = "verify";
45
+ /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
46
+ AgentInteractionActions["UNVERIFY"] = "unverify";
47
+ return AgentInteractionActions;
48
+ }({});
49
+
50
+ /** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
@@ -0,0 +1,45 @@
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 a new variant to the `CreateFlowEventPayload` union type below with a data-portal link
8
+ * 2. If this action doesn't fit this group, consider creating a new group file instead
9
+ * (see other files in this directory for the template)
10
+ */
11
+
12
+ /**
13
+ * Discriminated union payload type for create flow events.
14
+ * Use with `trackAgentEvent()`.
15
+ */
16
+
17
+ // ============================================================================
18
+ // BACKWARDS COMPAT (deprecated): Keep enum and attributes for trackAgentAction() consumers
19
+ // ============================================================================
20
+
21
+ /** @deprecated Use CreateFlowEventPayload with trackAgentEvent() instead */
22
+ export var ACTION_GROUP = 'createFlow';
23
+
24
+ /** @deprecated Use CreateFlowEventPayload with trackAgentEvent() instead */
25
+ export var CreateFlowActions = /*#__PURE__*/function (CreateFlowActions) {
26
+ /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
27
+ CreateFlowActions["START"] = "createFlowStart";
28
+ /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
29
+ CreateFlowActions["SKIP_NL"] = "createFlowSkipNL";
30
+ /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
31
+ CreateFlowActions["REVIEW_NL"] = "createFlowReviewNL";
32
+ /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
33
+ CreateFlowActions["ACTIVATE"] = "createFlowActivate";
34
+ /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
35
+ CreateFlowActions["RESTART"] = "createFlowRestart";
36
+ /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
37
+ CreateFlowActions["ERROR"] = "createFlowError";
38
+ /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
39
+ CreateFlowActions["LAND"] = "createLandInStudio";
40
+ /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
41
+ CreateFlowActions["DISCARD"] = "createDiscard";
42
+ /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
43
+ CreateFlowActions["SA_DRAFT"] = "saDraft";
44
+ return CreateFlowActions;
45
+ }({});
@@ -0,0 +1,37 @@
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 a new variant to the `DebugEventPayload` union type below with a data-portal link
8
+ * 2. If this action doesn't fit this group, consider creating a new group file instead
9
+ * (see other files in this directory for the template)
10
+ */
11
+
12
+ /**
13
+ * Discriminated union payload type for debug events.
14
+ * Use with `trackAgentEvent()`.
15
+ */
16
+
17
+ // ============================================================================
18
+ // BACKWARDS COMPAT (deprecated): Keep enum and attributes for trackAgentAction() consumers
19
+ // ============================================================================
20
+
21
+ /** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
22
+ export var ACTION_GROUP = 'debug';
23
+
24
+ /** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
25
+ export var AgentDebugActions = /*#__PURE__*/function (AgentDebugActions) {
26
+ /* View debug modal - https://data-portal.internal.atlassian.com/analytics/registry/97183 */
27
+ AgentDebugActions["VIEW"] = "debugView";
28
+ /* Copy all debug data - https://data-portal.internal.atlassian.com/analytics/registry/97186 */
29
+ AgentDebugActions["COPY_ALL"] = "debugCopyAll";
30
+ /* Copy debug data - https://data-portal.internal.atlassian.com/analytics/registry/97184 */
31
+ AgentDebugActions["COPY"] = "debugCopy";
32
+ /* Toggle skill info - https://data-portal.internal.atlassian.com/analytics/registry/97185 */
33
+ AgentDebugActions["TOGGLE_SKILL_INFO"] = "debugToggleSkillInfo";
34
+ return AgentDebugActions;
35
+ }({});
36
+
37
+ /** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
@@ -0,0 +1,27 @@
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 a new variant to the `EditingEventPayload` union type below with a data-portal link
9
+ * 2. If this action doesn't fit editing/mutation events, create a new group file instead
10
+ * (see other files in this directory for the template)
11
+ */
12
+
13
+ // ============================================================================
14
+ // BACKWARDS COMPAT (deprecated): Keep enum and attributes for trackAgentAction() consumers
15
+ // ============================================================================
16
+
17
+ /** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
18
+ export var ACTION_GROUP = 'editing';
19
+
20
+ /** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
21
+ export var AgentEditingActions = /*#__PURE__*/function (AgentEditingActions) {
22
+ /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
23
+ AgentEditingActions["UPDATED"] = "updated";
24
+ return AgentEditingActions;
25
+ }({});
26
+
27
+ /** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
File without changes
@@ -1,3 +1,23 @@
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 a new variant to the `ToolsEventPayload` union type below with a data-portal link
9
+ * 2. 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
+ // ============================================================================
14
+ // BACKWARDS COMPAT (deprecated): Keep enum and attributes for trackAgentAction() consumers
15
+ // ============================================================================
16
+
17
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
18
+ export var ACTION_GROUP = 'tools';
19
+
20
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
1
21
  export var AgentToolActions = /*#__PURE__*/function (AgentToolActions) {
2
22
  /* 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
23
  AgentToolActions["TOOLS_EXECUTION_CONFIRMED"] = "toolsExecutionConfirmed";
@@ -8,4 +28,10 @@ export var AgentToolActions = /*#__PURE__*/function (AgentToolActions) {
8
28
  /* When tools execution result streaming fails https://data-portal.internal.atlassian.com/analytics/registry/97752 */
9
29
  AgentToolActions["TOOLS_EXECUTION_RESULT_ERROR"] = "toolsExecutionResultError";
10
30
  return AgentToolActions;
11
- }({});
31
+ }({});
32
+
33
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
34
+
35
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
36
+
37
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
@@ -1,44 +1,24 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ var _excluded = ["action", "actionSubject", "attributes"];
2
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
6
  import { useCallback, useContext, useRef } from 'react';
5
7
  import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
6
8
  import { ANALYTICS_CHANNEL } from '../common/constants';
9
+ import { LIBRARY_ATTRIBUTE } from '../common/types';
7
10
  import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
8
- export var AgentDebugActions = /*#__PURE__*/function (AgentDebugActions) {
9
- /* View debug modal - https://data-portal.internal.atlassian.com/analytics/registry/97183 */
10
- AgentDebugActions["VIEW"] = "debugView";
11
- /* Copy all debug data - https://data-portal.internal.atlassian.com/analytics/registry/97186 */
12
- AgentDebugActions["COPY_ALL"] = "debugCopyAll";
13
- /* Copy debug data - https://data-portal.internal.atlassian.com/analytics/registry/97184 */
14
- AgentDebugActions["COPY"] = "debugCopy";
15
- /* Toggle skill info - https://data-portal.internal.atlassian.com/analytics/registry/97185 */
16
- AgentDebugActions["TOGGLE_SKILL_INFO"] = "debugToggleSkillInfo";
17
- return AgentDebugActions;
18
- }({});
19
- export var AgentCommonActions = /*#__PURE__*/function (AgentCommonActions) {
20
- /* View agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97125 */
21
- AgentCommonActions["VIEW"] = "view";
22
- /* Edit agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97126 */
23
- AgentCommonActions["EDIT"] = "edit";
24
- /* Agent updated - https://data-portal.internal.atlassian.com/analytics/registry/97122 */
25
- AgentCommonActions["UPDATED"] = "updated";
26
- /* Copy link clicked - https://data-portal.internal.atlassian.com/analytics/registry/97128 */
27
- AgentCommonActions["COPY_LINK"] = "copyLink";
28
- /* Delete agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97129 */
29
- AgentCommonActions["DELETE"] = "delete";
30
- /* Duplicate agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97130 */
31
- AgentCommonActions["DUPLICATE"] = "duplicate";
32
- /* Star agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97133 */
33
- AgentCommonActions["STAR"] = "star";
34
- /* Chat with agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97095 */
35
- AgentCommonActions["CHAT"] = "chat";
36
- /* Verify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97134 */
37
- AgentCommonActions["VERIFY"] = "verify";
38
- /* Unverify agent clicked - https://data-portal.internal.atlassian.com/analytics/registry/97135 */
39
- AgentCommonActions["UNVERIFY"] = "unverify";
40
- return AgentCommonActions;
41
- }({});
11
+ import { AgentInteractionActions } from './groups/agent-interactions';
12
+ import { AgentDebugActions as AgentDebugActionsEnum } from './groups/debug';
13
+ import { AgentEditingActions } from './groups/editing';
14
+ import { DefaultActionSubject } from './registry';
15
+
16
+ // Backward-compatible aliases
17
+ // TODO: migrate consumers to use group-specific imports, then remove
18
+ export var AgentCommonActions = _objectSpread(_objectSpread({}, AgentInteractionActions), AgentEditingActions);
19
+
20
+ // TODO: Remove the alias, will be breaking change, this is just for backward compatibility
21
+ export var AgentDebugActions = AgentDebugActionsEnum;
42
22
  var globalEventConfig = getDefaultTrackEventConfig();
43
23
  export var useRovoAgentActionAnalytics = function useRovoAgentActionAnalytics(commonAttributes) {
44
24
  var analyticsContext = useContext(AnalyticsReactContext);
@@ -46,19 +26,49 @@ export var useRovoAgentActionAnalytics = function useRovoAgentActionAnalytics(co
46
26
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
47
27
  var commonAttributesRef = useRef(commonAttributes);
48
28
  var fireAnalyticsEvent = useCallback(function (event) {
49
- var attributes = _objectSpread(_objectSpread(_objectSpread({}, getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), event.attributes);
29
+ var attributes = _objectSpread(_objectSpread(_objectSpread({}, getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), {}, {
30
+ library: LIBRARY_ATTRIBUTE
31
+ }, event.attributes);
50
32
  createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({}, globalEventConfig), event), {}, {
51
33
  attributes: attributes
52
34
  })).fire(ANALYTICS_CHANNEL);
53
35
  }, [createAnalyticsEvent, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
54
36
  );
37
+
38
+ /**
39
+ * Simple tracking of just action + attributes only.
40
+ * Uses default actionSubject ('rovoAgent').
41
+ *
42
+ * @deprecated Use trackAgentEvent() with typed payloads instead
43
+ */
55
44
  var trackAgentAction = useCallback(function (action, attributes) {
56
45
  fireAnalyticsEvent({
57
- actionSubject: 'rovoAgent',
46
+ actionSubject: DefaultActionSubject,
58
47
  action: action,
59
48
  attributes: attributes
60
49
  });
61
50
  }, [fireAnalyticsEvent]);
51
+
52
+ /**
53
+ * Fully-typed event tracking using discriminated union payload types.
54
+ * The payload type enforces correct action, actionSubject, and attributes.
55
+ */
56
+ var trackAgentEvent = useCallback(function (payload) {
57
+ var action = payload.action,
58
+ actionSubject = payload.actionSubject,
59
+ attributes = payload.attributes,
60
+ eventProps = _objectWithoutProperties(payload, _excluded);
61
+ fireAnalyticsEvent(_objectSpread(_objectSpread({
62
+ actionSubject: actionSubject,
63
+ action: action
64
+ }, eventProps), {}, {
65
+ attributes: attributes
66
+ }));
67
+ }, [fireAnalyticsEvent]);
68
+
69
+ /**
70
+ * @deprecated Use trackAgentEvent() with typed payloads instead
71
+ */
62
72
  var trackAgentActionError = useCallback(function (action, error, attributes) {
63
73
  fireAnalyticsEvent({
64
74
  actionSubject: 'rovoAgentError',
@@ -72,6 +82,7 @@ export var useRovoAgentActionAnalytics = function useRovoAgentActionAnalytics(co
72
82
  }, [fireAnalyticsEvent]);
73
83
  return {
74
84
  trackAgentAction: trackAgentAction,
85
+ trackAgentEvent: trackAgentEvent,
75
86
  trackAgentActionError: trackAgentActionError
76
87
  };
77
88
  };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Action Registry (Backwards Compatibility)
3
+ *
4
+ * This file contains deprecated exports for backwards compatibility
5
+ * with consumers using `trackAgentAction()`.
6
+ *
7
+ * For new code, use the payload types from each group file directly
8
+ * with `trackAgentEvent()`.
9
+ *
10
+ * @deprecated The registry pattern is deprecated. Use EventPayload from types.ts instead.
11
+ */
12
+
13
+ export var DefaultActionSubject = 'rovoAgent';
14
+
15
+ /**
16
+ * Combined attribute map (union of all groups).
17
+ * Used by the backward-compatible `trackAgentAction` helper.
18
+ *
19
+ * @deprecated Use EventPayload with trackAgentEvent() instead
20
+ */
@@ -0,0 +1,7 @@
1
+ /** Common library attribute injected into all events */
2
+ export var LIBRARY_ATTRIBUTE = 'agents-analytics';
3
+
4
+ /**
5
+ * Union of all event payload types.
6
+ * Use with `trackAgentEvent()` for typed event tracking.
7
+ */
@@ -1,39 +1,19 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  import { useCallback, useContext, useRef } from 'react';
6
6
  import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
7
+ import { AddToolsPromptActions } from '../actions/groups/add-tools-prompt';
8
+ import { CreateFlowActions } from '../actions/groups/create-flow';
9
+ import { DefaultActionSubject } from '../actions/registry';
7
10
  import { ANALYTICS_CHANNEL } from '../common/constants';
8
11
  import { useRovoAgentCSID } from '../common/csid';
9
12
  import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
10
- export var AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
11
- /* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
12
- AgentCreateActions["START"] = "createFlowStart";
13
- /* Skip natural language - https://data-portal.internal.atlassian.com/analytics/registry/97127 */
14
- AgentCreateActions["SKIP_NL"] = "createFlowSkipNL";
15
- /* Review natural language - https://data-portal.internal.atlassian.com/analytics/registry/97124 */
16
- AgentCreateActions["REVIEW_NL"] = "createFlowReviewNL";
17
- /* Activate agent - https://data-portal.internal.atlassian.com/analytics/registry/97123 */
18
- AgentCreateActions["ACTIVATE"] = "createFlowActivate";
19
- /* Restart create flow - https://data-portal.internal.atlassian.com/analytics/registry/97131 */
20
- AgentCreateActions["RESTART"] = "createFlowRestart";
21
- /* Error occurred - https://data-portal.internal.atlassian.com/analytics/registry/97132 */
22
- AgentCreateActions["ERROR"] = "createFlowError";
23
- /* Land in studio - https://data-portal.internal.atlassian.com/analytics/registry/97136 */
24
- AgentCreateActions["LAND"] = "createLandInStudio";
25
- /* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
26
- AgentCreateActions["DISCARD"] = "createDiscard";
27
- /* Show no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97435 */
28
- AgentCreateActions["SHOW_NO_SKILLS_MODAL"] = "showNoSkillsModal";
29
- /* Browse click no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97436 */
30
- AgentCreateActions["BROWSE_CLICK_NO_SKILLS_MODAL"] = "browseClickNoSkillsModal";
31
- /* Discard no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97437 */
32
- AgentCreateActions["DISCARD_NO_SKILLS_MODAL"] = "discardNoSkillsModal";
33
- /* Draft created from solution architect plan card - https://data-portal.internal.atlassian.com/analytics/registry/97924 */
34
- AgentCreateActions["SA_DRAFT"] = "saDraft";
35
- return AgentCreateActions;
36
- }({});
13
+
14
+ // Backward-compatible alias
15
+ // TODO: migrate consumers to use CreateFlowActions / AddToolsPromptActions directly, then remove
16
+ export var AgentCreateActions = _objectSpread(_objectSpread({}, CreateFlowActions), AddToolsPromptActions);
37
17
  var globalEventConfig = getDefaultTrackEventConfig();
38
18
  export var useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(commonAttributes) {
39
19
  var _useRovoAgentCSID = useRovoAgentCSID(),
@@ -62,7 +42,7 @@ export var useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(co
62
42
  */
63
43
  var trackCreateSession = useCallback(function (action, attributes) {
64
44
  fireAnalyticsEvent({
65
- actionSubject: 'rovoAgent',
45
+ actionSubject: DefaultActionSubject,
66
46
  action: action,
67
47
  attributes: attributes
68
48
  });
@@ -73,16 +53,16 @@ export var useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(co
73
53
  */
74
54
  var trackCreateSessionStart = useCallback(function (attributes) {
75
55
  fireAnalyticsEvent({
76
- actionSubject: 'rovoAgent',
77
- action: AgentCreateActions.START,
56
+ actionSubject: DefaultActionSubject,
57
+ action: CreateFlowActions.START,
78
58
  attributes: attributes
79
59
  });
80
60
  refreshCSID();
81
61
  }, [fireAnalyticsEvent, refreshCSID]);
82
62
  var trackCreateSessionError = useCallback(function (error, attributes) {
83
63
  fireAnalyticsEvent({
84
- actionSubject: 'rovoAgent',
85
- action: AgentCreateActions.ERROR,
64
+ actionSubject: DefaultActionSubject,
65
+ action: CreateFlowActions.ERROR,
86
66
  attributes: _objectSpread({
87
67
  error: {
88
68
  message: error.message
@@ -0,0 +1,39 @@
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 a new variant to the `AddToolsPromptEventPayload` union type below with a data-portal link
12
+ * 2. If this action doesn't fit this group, consider creating a new group file instead
13
+ * (see other files in this directory for the template)
14
+ */
15
+ /**
16
+ * Discriminated union payload type for add tools prompt events.
17
+ * Use with `trackAgentEvent()`.
18
+ */
19
+ export type AddToolsPromptEventPayload = {
20
+ actionSubject: 'rovoAgent';
21
+ action: 'addToolsPromptShown';
22
+ attributes: {};
23
+ } | {
24
+ actionSubject: 'rovoAgent';
25
+ action: 'addToolsPromptBrowse';
26
+ attributes: {};
27
+ } | {
28
+ actionSubject: 'rovoAgent';
29
+ action: 'addToolsPromptDismiss';
30
+ attributes: {};
31
+ };
32
+ /** @deprecated Use AddToolsPromptEventPayload with trackAgentEvent() instead */
33
+ export declare const ACTION_GROUP: "addToolsPrompt";
34
+ /** @deprecated Use AddToolsPromptEventPayload with trackAgentEvent() instead */
35
+ export declare enum AddToolsPromptActions {
36
+ SHOWN = "addToolsPromptShown",
37
+ BROWSE = "addToolsPromptBrowse",
38
+ DISMISS = "addToolsPromptDismiss"
39
+ }