@atlaskit/rovo-agent-analytics 0.19.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 (57) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +93 -99
  3. package/actions/evaluation/package.json +17 -0
  4. package/dist/cjs/actions/groups/add-tools-prompt.js +15 -4
  5. package/dist/cjs/actions/groups/agent-interactions.js +16 -5
  6. package/dist/cjs/actions/groups/create-flow.js +15 -3
  7. package/dist/cjs/actions/groups/debug.js +16 -5
  8. package/dist/cjs/actions/groups/editing.js +11 -5
  9. package/dist/cjs/actions/groups/evaluation.js +1 -0
  10. package/dist/cjs/actions/groups/tools.js +13 -5
  11. package/dist/cjs/actions/index.js +37 -6
  12. package/dist/cjs/actions/registry.js +13 -40
  13. package/dist/cjs/common/types.js +13 -1
  14. package/dist/cjs/create/index.js +3 -5
  15. package/dist/es2019/actions/groups/add-tools-prompt.js +15 -4
  16. package/dist/es2019/actions/groups/agent-interactions.js +17 -5
  17. package/dist/es2019/actions/groups/create-flow.js +15 -3
  18. package/dist/es2019/actions/groups/debug.js +17 -5
  19. package/dist/es2019/actions/groups/editing.js +12 -5
  20. package/dist/es2019/actions/groups/evaluation.js +0 -0
  21. package/dist/es2019/actions/groups/tools.js +16 -5
  22. package/dist/es2019/actions/index.js +36 -7
  23. package/dist/es2019/actions/registry.js +11 -43
  24. package/dist/es2019/common/types.js +7 -0
  25. package/dist/es2019/create/index.js +4 -6
  26. package/dist/esm/actions/groups/add-tools-prompt.js +15 -4
  27. package/dist/esm/actions/groups/agent-interactions.js +17 -5
  28. package/dist/esm/actions/groups/create-flow.js +15 -3
  29. package/dist/esm/actions/groups/debug.js +17 -5
  30. package/dist/esm/actions/groups/editing.js +12 -5
  31. package/dist/esm/actions/groups/evaluation.js +0 -0
  32. package/dist/esm/actions/groups/tools.js +16 -5
  33. package/dist/esm/actions/index.js +38 -7
  34. package/dist/esm/actions/registry.js +11 -39
  35. package/dist/esm/common/types.js +7 -0
  36. package/dist/esm/create/index.js +4 -6
  37. package/dist/types/actions/groups/add-tools-prompt.d.ts +22 -4
  38. package/dist/types/actions/groups/agent-interactions.d.ts +46 -4
  39. package/dist/types/actions/groups/create-flow.d.ts +46 -3
  40. package/dist/types/actions/groups/debug.d.ts +29 -4
  41. package/dist/types/actions/groups/editing.d.ts +13 -4
  42. package/dist/types/actions/groups/evaluation.d.ts +56 -0
  43. package/dist/types/actions/groups/tools.d.ts +35 -4
  44. package/dist/types/actions/index.d.ts +2 -1
  45. package/dist/types/actions/registry.d.ts +16 -9
  46. package/dist/types/common/types.d.ts +14 -0
  47. package/dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts +22 -4
  48. package/dist/types-ts4.5/actions/groups/agent-interactions.d.ts +46 -4
  49. package/dist/types-ts4.5/actions/groups/create-flow.d.ts +46 -3
  50. package/dist/types-ts4.5/actions/groups/debug.d.ts +29 -4
  51. package/dist/types-ts4.5/actions/groups/editing.d.ts +13 -4
  52. package/dist/types-ts4.5/actions/groups/evaluation.d.ts +56 -0
  53. package/dist/types-ts4.5/actions/groups/tools.d.ts +35 -4
  54. package/dist/types-ts4.5/actions/index.d.ts +2 -1
  55. package/dist/types-ts4.5/actions/registry.d.ts +16 -9
  56. package/dist/types-ts4.5/common/types.d.ts +14 -0
  57. package/package.json +2 -2
@@ -1,5 +1,19 @@
1
+ import type { AddToolsPromptEventPayload } from '../actions/groups/add-tools-prompt';
2
+ import type { AgentInteractionsEventPayload } from '../actions/groups/agent-interactions';
3
+ import type { CreateFlowEventPayload } from '../actions/groups/create-flow';
4
+ import type { DebugEventPayload } from '../actions/groups/debug';
5
+ import type { EditingEventPayload } from '../actions/groups/editing';
6
+ import type { EvaluationEventPayload } from '../actions/groups/evaluation';
7
+ import type { ToolsEventPayload } from '../actions/groups/tools';
1
8
  export type RemainingRequired<T, P extends Partial<T>> = Required<Omit<T, keyof P>>;
2
9
  export type BaseAgentAnalyticsAttributes = {
3
10
  touchPoint: string;
4
11
  agentId: string;
5
12
  };
13
+ /** Common library attribute injected into all events */
14
+ export declare const LIBRARY_ATTRIBUTE: "agents-analytics";
15
+ /**
16
+ * Union of all event payload types.
17
+ * Use with `trackAgentEvent()` for typed event tracking.
18
+ */
19
+ export type EventPayload = EditingEventPayload | AgentInteractionsEventPayload | DebugEventPayload | ToolsEventPayload | EvaluationEventPayload | CreateFlowEventPayload | AddToolsPromptEventPayload;
@@ -8,12 +8,30 @@
8
8
  * regardless of whether the prompt fires from the create flow or a future publish flow.
9
9
  *
10
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
- *
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()`.
14
18
  */
15
- /** The group name sent as `attributes.actionGroup` in analytics events */
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 */
16
33
  export declare const ACTION_GROUP: "addToolsPrompt";
34
+ /** @deprecated Use AddToolsPromptEventPayload with trackAgentEvent() instead */
17
35
  export declare enum AddToolsPromptActions {
18
36
  SHOWN = "addToolsPromptShown",
19
37
  BROWSE = "addToolsPromptBrowse",
@@ -7,14 +7,55 @@
7
7
  * NOTE: This is about UI interactions, not backend "actions" (which are being replaced by "tools").
8
8
  *
9
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
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
13
12
  * (see other files in this directory for the template)
14
13
  */
15
14
  import type { BaseAgentAnalyticsAttributes } from '../../common/types';
16
- /** The group name sent as `attributes.actionGroup` in analytics events */
15
+ /**
16
+ * Discriminated union payload type for agent interaction events.
17
+ * Use with `trackAgentEvent()`.
18
+ */
19
+ export type AgentInteractionsEventPayload = {
20
+ actionSubject: 'rovoAgent';
21
+ action: 'view';
22
+ attributes: BaseAgentAnalyticsAttributes;
23
+ } | {
24
+ actionSubject: 'rovoAgent';
25
+ action: 'edit';
26
+ attributes: BaseAgentAnalyticsAttributes;
27
+ } | {
28
+ actionSubject: 'rovoAgent';
29
+ action: 'copyLink';
30
+ attributes: BaseAgentAnalyticsAttributes;
31
+ } | {
32
+ actionSubject: 'rovoAgent';
33
+ action: 'delete';
34
+ attributes: BaseAgentAnalyticsAttributes;
35
+ } | {
36
+ actionSubject: 'rovoAgent';
37
+ action: 'duplicate';
38
+ attributes: BaseAgentAnalyticsAttributes;
39
+ } | {
40
+ actionSubject: 'rovoAgent';
41
+ action: 'star';
42
+ attributes: BaseAgentAnalyticsAttributes;
43
+ } | {
44
+ actionSubject: 'rovoAgent';
45
+ action: 'chat';
46
+ attributes: BaseAgentAnalyticsAttributes;
47
+ } | {
48
+ actionSubject: 'rovoAgent';
49
+ action: 'verify';
50
+ attributes: BaseAgentAnalyticsAttributes;
51
+ } | {
52
+ actionSubject: 'rovoAgent';
53
+ action: 'unverify';
54
+ attributes: BaseAgentAnalyticsAttributes;
55
+ };
56
+ /** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
17
57
  export declare const ACTION_GROUP: "agentInteractions";
58
+ /** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
18
59
  export declare enum AgentInteractionActions {
19
60
  VIEW = "view",
20
61
  EDIT = "edit",
@@ -26,6 +67,7 @@ export declare enum AgentInteractionActions {
26
67
  VERIFY = "verify",
27
68
  UNVERIFY = "unverify"
28
69
  }
70
+ /** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
29
71
  export type AgentInteractionAttributes = {
30
72
  [AgentInteractionActions.VIEW]: BaseAgentAnalyticsAttributes;
31
73
  [AgentInteractionActions.EDIT]: BaseAgentAnalyticsAttributes;
@@ -4,11 +4,54 @@
4
4
  * Create agent funnel steps — from clicking "Create agent" through to activation or discard,
5
5
  *
6
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)
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)
9
10
  */
10
- /** The group name sent as `attributes.actionGroup` in analytics events */
11
+ /**
12
+ * Discriminated union payload type for create flow events.
13
+ * Use with `trackAgentEvent()`.
14
+ */
15
+ export type CreateFlowEventPayload = {
16
+ actionSubject: 'rovoAgent';
17
+ action: 'createFlowStart';
18
+ attributes: {};
19
+ } | {
20
+ actionSubject: 'rovoAgent';
21
+ action: 'createFlowSkipNL';
22
+ attributes: {};
23
+ } | {
24
+ actionSubject: 'rovoAgent';
25
+ action: 'createFlowReviewNL';
26
+ attributes: {};
27
+ } | {
28
+ actionSubject: 'rovoAgent';
29
+ action: 'createFlowActivate';
30
+ attributes: {};
31
+ } | {
32
+ actionSubject: 'rovoAgent';
33
+ action: 'createFlowRestart';
34
+ attributes: {};
35
+ } | {
36
+ actionSubject: 'rovoAgent';
37
+ action: 'createFlowError';
38
+ attributes: {};
39
+ } | {
40
+ actionSubject: 'rovoAgent';
41
+ action: 'createLandInStudio';
42
+ attributes: {};
43
+ } | {
44
+ actionSubject: 'rovoAgent';
45
+ action: 'createDiscard';
46
+ attributes: {};
47
+ } | {
48
+ actionSubject: 'rovoAgent';
49
+ action: 'saDraft';
50
+ attributes: {};
51
+ };
52
+ /** @deprecated Use CreateFlowEventPayload with trackAgentEvent() instead */
11
53
  export declare const ACTION_GROUP: "createFlow";
54
+ /** @deprecated Use CreateFlowEventPayload with trackAgentEvent() instead */
12
55
  export declare enum CreateFlowActions {
13
56
  START = "createFlowStart",
14
57
  SKIP_NL = "createFlowSkipNL",
@@ -4,13 +4,37 @@
4
4
  * Actions related to the agent debug modal (viewing, copying debug data, toggling skill info).
5
5
  *
6
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
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
10
9
  * (see other files in this directory for the template)
11
10
  */
12
- /** The group name sent as `attributes.actionGroup` in analytics events */
11
+ /**
12
+ * Discriminated union payload type for debug events.
13
+ * Use with `trackAgentEvent()`.
14
+ */
15
+ export type DebugEventPayload = {
16
+ actionSubject: 'rovoAgent';
17
+ action: 'debugView';
18
+ attributes: {};
19
+ } | {
20
+ actionSubject: 'rovoAgent';
21
+ action: 'debugCopyAll';
22
+ attributes: {};
23
+ } | {
24
+ actionSubject: 'rovoAgent';
25
+ action: 'debugCopy';
26
+ attributes: {};
27
+ } | {
28
+ actionSubject: 'rovoAgent';
29
+ action: 'debugToggleSkillInfo';
30
+ attributes: {
31
+ toolId: string;
32
+ isExpanded: boolean;
33
+ };
34
+ };
35
+ /** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
13
36
  export declare const ACTION_GROUP: "debug";
37
+ /** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
14
38
  export declare enum AgentDebugActions {
15
39
  VIEW = "debugView",
16
40
  COPY_ALL = "debugCopyAll",
@@ -18,6 +42,7 @@ export declare enum AgentDebugActions {
18
42
  TOGGLE_SKILL_INFO = "debugToggleSkillInfo"
19
43
  }
20
44
  type EmptyAttributes = {};
45
+ /** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
21
46
  export type DebugActionAttributes = {
22
47
  [AgentDebugActions.COPY_ALL]: EmptyAttributes;
23
48
  [AgentDebugActions.COPY]: EmptyAttributes;
@@ -5,17 +5,26 @@
5
5
  * Unlike agentInteractions (user clicks), these track actual data changes.
6
6
  *
7
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
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
11
10
  * (see other files in this directory for the template)
12
11
  */
13
12
  import type { BaseAgentAnalyticsAttributes } from '../../common/types';
14
- /** The group name sent as `attributes.actionGroup` in analytics events */
13
+ export type EditingEventPayload = {
14
+ actionSubject: 'rovoAgent';
15
+ action: 'updated';
16
+ attributes: BaseAgentAnalyticsAttributes & {
17
+ agentType: string;
18
+ field: string;
19
+ };
20
+ };
21
+ /** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
15
22
  export declare const ACTION_GROUP: "editing";
23
+ /** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
16
24
  export declare enum AgentEditingActions {
17
25
  UPDATED = "updated"
18
26
  }
27
+ /** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
19
28
  export type EditingActionAttributes = {
20
29
  [AgentEditingActions.UPDATED]: BaseAgentAnalyticsAttributes & {
21
30
  agentType: string;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Action Group: evaluation
3
+ *
4
+ * Batch evaluation events — dataset CRUD, job lifecycle, and validation UI events
5
+ * fired from the shared `agent-evaluation` package.
6
+ *
7
+ * ## Adding a new action
8
+ * 1. Add a new variant to the `EvaluationEventPayload` 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
+ type EvalAttributesBase = {
13
+ objectType?: string;
14
+ objectId?: string;
15
+ containerType?: string;
16
+ containerId?: string;
17
+ actionSubjectId?: string;
18
+ };
19
+ export type EvaluationEventPayload = ({
20
+ actionSubject: 'batchEvaluationDataset';
21
+ action: 'created';
22
+ attributes: {
23
+ totalQuestions: number;
24
+ };
25
+ } & EvalAttributesBase) | ({
26
+ actionSubject: 'batchEvaluationJob';
27
+ action: 'created';
28
+ attributes: {
29
+ datasetSize: number;
30
+ isDraftAgent: boolean;
31
+ judgeMode: string | undefined;
32
+ };
33
+ } & EvalAttributesBase) | ({
34
+ actionSubject: 'batchEvaluationDataset';
35
+ action: 'deleted';
36
+ attributes: {};
37
+ } & EvalAttributesBase) | ({
38
+ actionSubject: 'batchEvaluationDatasetQuestion';
39
+ action: 'deleted';
40
+ attributes: {};
41
+ } & EvalAttributesBase) | ({
42
+ actionSubject: 'evalResultsModal';
43
+ action: 'viewed';
44
+ attributes: {
45
+ trigger: 'row_action' | 'flag_action';
46
+ };
47
+ } & EvalAttributesBase) | ({
48
+ actionSubject: 'batchEvaluationJob';
49
+ action: 'completed';
50
+ attributes: {
51
+ status: string | null;
52
+ durationMs: number | null;
53
+ datasetSize: number | null | undefined;
54
+ };
55
+ } & EvalAttributesBase);
56
+ export {};
@@ -5,20 +5,48 @@
5
5
  * (confirming, streaming, viewing results, errors).
6
6
  *
7
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
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
11
10
  * (see other files in this directory for the template)
12
11
  */
13
12
  import type { BaseAgentAnalyticsAttributes } from '../../common/types';
14
- /** The group name sent as `attributes.actionGroup` in analytics events */
13
+ type ToolsExecutionAttributesBase = BaseAgentAnalyticsAttributes & {
14
+ tools: {
15
+ toolId: string;
16
+ toolSource: string;
17
+ resolutionType: string;
18
+ }[];
19
+ singleInstrumentationId: string | undefined;
20
+ };
21
+ export type ToolsEventPayload = {
22
+ actionSubject: 'rovoAgent';
23
+ action: 'toolsExecutionConfirmed';
24
+ attributes: ToolsExecutionAttributesBase;
25
+ } | {
26
+ actionSubject: 'rovoAgent';
27
+ action: 'toolsExecutionStreamStopped';
28
+ attributes: ToolsExecutionAttributesBase;
29
+ } | {
30
+ actionSubject: 'rovoAgent';
31
+ action: 'toolsExecutionResultViewed';
32
+ attributes: ToolsExecutionAttributesBase & {
33
+ scenarioId: string | null | undefined;
34
+ };
35
+ } | {
36
+ actionSubject: 'rovoAgent';
37
+ action: 'toolsExecutionResultError';
38
+ attributes: ToolsExecutionAttributesBase;
39
+ };
40
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
15
41
  export declare const ACTION_GROUP: "tools";
42
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
16
43
  export declare enum AgentToolActions {
17
44
  TOOLS_EXECUTION_CONFIRMED = "toolsExecutionConfirmed",
18
45
  TOOLS_EXECUTION_STREAM_STOPPED = "toolsExecutionStreamStopped",
19
46
  TOOLS_EXECUTION_RESULT_VIEWED = "toolsExecutionResultViewed",
20
47
  TOOLS_EXECUTION_RESULT_ERROR = "toolsExecutionResultError"
21
48
  }
49
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
22
50
  export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
23
51
  tools: {
24
52
  toolId: string;
@@ -27,12 +55,15 @@ export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
27
55
  }[];
28
56
  singleInstrumentationId: string | undefined;
29
57
  };
58
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
30
59
  export type ToolsExecutionResultAttributes = ToolsExecutionAttributes & {
31
60
  scenarioId: string | null | undefined;
32
61
  };
62
+ /** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
33
63
  export type ToolsActionAttributes = {
34
64
  [AgentToolActions.TOOLS_EXECUTION_CONFIRMED]: ToolsExecutionAttributes;
35
65
  [AgentToolActions.TOOLS_EXECUTION_STREAM_STOPPED]: ToolsExecutionAttributes;
36
66
  [AgentToolActions.TOOLS_EXECUTION_RESULT_VIEWED]: ToolsExecutionResultAttributes;
37
67
  [AgentToolActions.TOOLS_EXECUTION_RESULT_ERROR]: ToolsExecutionAttributes;
38
68
  };
69
+ export {};
@@ -1,4 +1,4 @@
1
- import type { RemainingRequired } from '../common/types';
1
+ import { type EventPayload, type RemainingRequired } from '../common/types';
2
2
  import { AgentInteractionActions } from './groups/agent-interactions';
3
3
  import { AgentDebugActions as AgentDebugActionsEnum } from './groups/debug';
4
4
  import { AgentEditingActions } from './groups/editing';
@@ -18,5 +18,6 @@ export declare const AgentCommonActions: {
18
18
  export declare const AgentDebugActions: typeof AgentDebugActionsEnum;
19
19
  export declare const useRovoAgentActionAnalytics: <T extends {}>(commonAttributes: T) => {
20
20
  trackAgentAction: <A extends keyof ActionAttributes>(action: A, attributes: RemainingRequired<ActionAttributes[A], T>) => void;
21
+ trackAgentEvent: (payload: EventPayload) => void;
21
22
  trackAgentActionError: <A extends keyof ActionAttributes>(action: A, error: Error, attributes?: RemainingRequired<ActionAttributes[A], T>) => void;
22
23
  };
@@ -1,16 +1,23 @@
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
+ */
1
12
  import { type AgentInteractionAttributes } from './groups/agent-interactions';
2
13
  import { type DebugActionAttributes } from './groups/debug';
3
14
  import { type EditingActionAttributes } from './groups/editing';
4
15
  import { type ToolsActionAttributes } from './groups/tools';
16
+ export declare const DefaultActionSubject = "rovoAgent";
5
17
  /**
6
- * Combined attribute map for action-hook groups (type-safe attributes).
7
- * Create-flow groups are excluded they use a looser attribute type via the create hook.
8
- */
9
- export type ActionAttributes = AgentInteractionAttributes & EditingActionAttributes & DebugActionAttributes & ToolsActionAttributes;
10
- /**
11
- * Runtime lookup: action value → group name.
12
- * Used by ALL analytics hooks to auto-inject `attributes.actionGroup`.
18
+ * Combined attribute map (union of all groups).
19
+ * Used by the backward-compatible `trackAgentAction` helper.
13
20
  *
14
- * When you add a new group, add it here too.
21
+ * @deprecated Use EventPayload with trackAgentEvent() instead
15
22
  */
16
- export declare const ACTION_TO_GROUP: Record<string, string>;
23
+ export type ActionAttributes = AgentInteractionAttributes & EditingActionAttributes & DebugActionAttributes & ToolsActionAttributes;
@@ -1,5 +1,19 @@
1
+ import type { AddToolsPromptEventPayload } from '../actions/groups/add-tools-prompt';
2
+ import type { AgentInteractionsEventPayload } from '../actions/groups/agent-interactions';
3
+ import type { CreateFlowEventPayload } from '../actions/groups/create-flow';
4
+ import type { DebugEventPayload } from '../actions/groups/debug';
5
+ import type { EditingEventPayload } from '../actions/groups/editing';
6
+ import type { EvaluationEventPayload } from '../actions/groups/evaluation';
7
+ import type { ToolsEventPayload } from '../actions/groups/tools';
1
8
  export type RemainingRequired<T, P extends Partial<T>> = Required<Omit<T, keyof P>>;
2
9
  export type BaseAgentAnalyticsAttributes = {
3
10
  touchPoint: string;
4
11
  agentId: string;
5
12
  };
13
+ /** Common library attribute injected into all events */
14
+ export declare const LIBRARY_ATTRIBUTE: "agents-analytics";
15
+ /**
16
+ * Union of all event payload types.
17
+ * Use with `trackAgentEvent()` for typed event tracking.
18
+ */
19
+ export type EventPayload = EditingEventPayload | AgentInteractionsEventPayload | DebugEventPayload | ToolsEventPayload | EvaluationEventPayload | CreateFlowEventPayload | AddToolsPromptEventPayload;
package/package.json CHANGED
@@ -27,7 +27,7 @@
27
27
  "@atlaskit/analytics-listeners": "^10.0.0",
28
28
  "@atlaskit/analytics-next": "^11.1.0",
29
29
  "@babel/runtime": "^7.0.0",
30
- "@compiled/react": "^0.18.6"
30
+ "@compiled/react": "^0.20.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": "^18.2.0"
@@ -75,7 +75,7 @@
75
75
  }
76
76
  },
77
77
  "name": "@atlaskit/rovo-agent-analytics",
78
- "version": "0.19.0",
78
+ "version": "0.20.0",
79
79
  "description": "Rovo Agents analytics",
80
80
  "author": "Atlassian Pty Ltd",
81
81
  "license": "Apache-2.0",