@atlaskit/rovo-agent-analytics 0.19.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +112 -103
- package/dist/cjs/actions/groups/agent-interactions.js +1 -40
- package/dist/cjs/actions/groups/debug.js +1 -31
- package/dist/cjs/actions/groups/editing.js +1 -22
- package/dist/cjs/actions/groups/evaluation.js +1 -0
- package/dist/cjs/actions/groups/tools.js +1 -28
- package/dist/cjs/actions/index.js +24 -34
- package/dist/cjs/common/types.js +18 -1
- package/dist/cjs/create/index.js +29 -15
- package/dist/es2019/actions/groups/agent-interactions.js +1 -38
- package/dist/es2019/actions/groups/debug.js +0 -25
- package/dist/es2019/actions/groups/editing.js +1 -20
- package/dist/es2019/actions/groups/evaluation.js +0 -0
- package/dist/es2019/actions/groups/tools.js +1 -26
- package/dist/es2019/actions/index.js +17 -34
- package/dist/es2019/common/types.js +12 -0
- package/dist/es2019/create/index.js +26 -16
- package/dist/esm/actions/groups/agent-interactions.js +1 -38
- package/dist/esm/actions/groups/debug.js +0 -25
- package/dist/esm/actions/groups/editing.js +1 -20
- package/dist/esm/actions/groups/evaluation.js +0 -0
- package/dist/esm/actions/groups/tools.js +1 -26
- package/dist/esm/actions/index.js +23 -34
- package/dist/esm/common/types.js +12 -0
- package/dist/esm/create/index.js +27 -14
- package/dist/types/actions/groups/agent-interactions.d.ts +42 -26
- package/dist/types/actions/groups/debug.d.ts +22 -18
- package/dist/types/actions/groups/editing.d.ts +6 -10
- package/dist/types/actions/groups/evaluation.d.ts +56 -0
- package/dist/types/actions/groups/tools.d.ts +22 -20
- package/dist/types/actions/index.d.ts +2 -20
- package/dist/types/common/types.d.ts +28 -2
- package/dist/types/create/index.d.ts +20 -17
- package/dist/types-ts4.5/actions/groups/agent-interactions.d.ts +42 -26
- package/dist/types-ts4.5/actions/groups/debug.d.ts +22 -18
- package/dist/types-ts4.5/actions/groups/editing.d.ts +6 -10
- package/dist/types-ts4.5/actions/groups/evaluation.d.ts +56 -0
- package/dist/types-ts4.5/actions/groups/tools.d.ts +22 -20
- package/dist/types-ts4.5/actions/index.d.ts +2 -20
- package/dist/types-ts4.5/common/types.d.ts +28 -2
- package/dist/types-ts4.5/create/index.d.ts +20 -17
- package/package.json +2 -2
- package/actions/add-tools-prompt/package.json +0 -17
- package/actions/agent-interactions/package.json +0 -17
- package/actions/create-flow/package.json +0 -17
- package/actions/debug/package.json +0 -17
- package/actions/editing/package.json +0 -17
- package/actions/tool-actions/package.json +0 -17
- package/dist/cjs/actions/groups/add-tools-prompt.js +0 -32
- package/dist/cjs/actions/groups/create-flow.js +0 -39
- package/dist/cjs/actions/registry.js +0 -53
- package/dist/es2019/actions/groups/add-tools-prompt.js +0 -26
- package/dist/es2019/actions/groups/create-flow.js +0 -33
- package/dist/es2019/actions/registry.js +0 -52
- package/dist/esm/actions/groups/add-tools-prompt.js +0 -26
- package/dist/esm/actions/groups/create-flow.js +0 -33
- package/dist/esm/actions/registry.js +0 -48
- package/dist/types/actions/groups/add-tools-prompt.d.ts +0 -21
- package/dist/types/actions/groups/create-flow.d.ts +0 -22
- package/dist/types/actions/registry.d.ts +0 -16
- package/dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts +0 -21
- package/dist/types-ts4.5/actions/groups/create-flow.d.ts +0 -22
- package/dist/types-ts4.5/actions/registry.d.ts +0 -16
|
@@ -7,33 +7,49 @@
|
|
|
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
|
|
11
|
-
* 2.
|
|
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
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
|
39
55
|
};
|
|
@@ -4,27 +4,31 @@
|
|
|
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
|
|
8
|
-
* 2.
|
|
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
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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: {
|
|
25
31
|
toolId: string;
|
|
26
32
|
isExpanded: boolean;
|
|
27
33
|
};
|
|
28
|
-
[AgentDebugActions.VIEW]: EmptyAttributes;
|
|
29
34
|
};
|
|
30
|
-
export {};
|
|
@@ -5,19 +5,15 @@
|
|
|
5
5
|
* Unlike agentInteractions (user clicks), these track actual data changes.
|
|
6
6
|
*
|
|
7
7
|
* ## Adding a new action
|
|
8
|
-
* 1. Add
|
|
9
|
-
* 2.
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export type EditingActionAttributes = {
|
|
20
|
-
[AgentEditingActions.UPDATED]: BaseAgentAnalyticsAttributes & {
|
|
13
|
+
export type EditingEventPayload = {
|
|
14
|
+
actionSubject: 'rovoAgent';
|
|
15
|
+
action: 'updated';
|
|
16
|
+
attributes: BaseAgentAnalyticsAttributes & {
|
|
21
17
|
agentType: string;
|
|
22
18
|
field: string;
|
|
23
19
|
};
|
|
@@ -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,21 +5,12 @@
|
|
|
5
5
|
* (confirming, streaming, viewing results, errors).
|
|
6
6
|
*
|
|
7
7
|
* ## Adding a new action
|
|
8
|
-
* 1. Add
|
|
9
|
-
* 2.
|
|
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
|
-
|
|
15
|
-
export declare const ACTION_GROUP: "tools";
|
|
16
|
-
export declare enum AgentToolActions {
|
|
17
|
-
TOOLS_EXECUTION_CONFIRMED = "toolsExecutionConfirmed",
|
|
18
|
-
TOOLS_EXECUTION_STREAM_STOPPED = "toolsExecutionStreamStopped",
|
|
19
|
-
TOOLS_EXECUTION_RESULT_VIEWED = "toolsExecutionResultViewed",
|
|
20
|
-
TOOLS_EXECUTION_RESULT_ERROR = "toolsExecutionResultError"
|
|
21
|
-
}
|
|
22
|
-
export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
13
|
+
type ToolsExecutionAttributesBase = BaseAgentAnalyticsAttributes & {
|
|
23
14
|
tools: {
|
|
24
15
|
toolId: string;
|
|
25
16
|
toolSource: string;
|
|
@@ -27,12 +18,23 @@ export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
|
27
18
|
}[];
|
|
28
19
|
singleInstrumentationId: string | undefined;
|
|
29
20
|
};
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
|
38
39
|
};
|
|
40
|
+
export {};
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { AgentInteractionActions } from './groups/agent-interactions';
|
|
3
|
-
import { AgentDebugActions as AgentDebugActionsEnum } from './groups/debug';
|
|
4
|
-
import { AgentEditingActions } from './groups/editing';
|
|
5
|
-
import type { ActionAttributes } from './registry';
|
|
6
|
-
export declare const AgentCommonActions: {
|
|
7
|
-
readonly UPDATED: AgentEditingActions.UPDATED;
|
|
8
|
-
readonly VIEW: AgentInteractionActions.VIEW;
|
|
9
|
-
readonly EDIT: AgentInteractionActions.EDIT;
|
|
10
|
-
readonly COPY_LINK: AgentInteractionActions.COPY_LINK;
|
|
11
|
-
readonly DELETE: AgentInteractionActions.DELETE;
|
|
12
|
-
readonly DUPLICATE: AgentInteractionActions.DUPLICATE;
|
|
13
|
-
readonly STAR: AgentInteractionActions.STAR;
|
|
14
|
-
readonly CHAT: AgentInteractionActions.CHAT;
|
|
15
|
-
readonly VERIFY: AgentInteractionActions.VERIFY;
|
|
16
|
-
readonly UNVERIFY: AgentInteractionActions.UNVERIFY;
|
|
17
|
-
};
|
|
18
|
-
export declare const AgentDebugActions: typeof AgentDebugActionsEnum;
|
|
1
|
+
import { type EventPayload } from '../common/types';
|
|
19
2
|
export declare const useRovoAgentActionAnalytics: <T extends {}>(commonAttributes: T) => {
|
|
20
|
-
|
|
21
|
-
trackAgentActionError: <A extends keyof ActionAttributes>(action: A, error: Error, attributes?: RemainingRequired<ActionAttributes[A], T>) => void;
|
|
3
|
+
trackAgentEvent: (payload: EventPayload) => void;
|
|
22
4
|
};
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
+
import type { AgentInteractionsEventPayload } from '../actions/groups/agent-interactions';
|
|
2
|
+
import type { DebugEventPayload } from '../actions/groups/debug';
|
|
3
|
+
import type { EditingEventPayload } from '../actions/groups/editing';
|
|
4
|
+
import type { EvaluationEventPayload } from '../actions/groups/evaluation';
|
|
5
|
+
import type { ToolsEventPayload } from '../actions/groups/tools';
|
|
1
6
|
export type RemainingRequired<T, P extends Partial<T>> = Required<Omit<T, keyof P>>;
|
|
2
7
|
export type BaseAgentAnalyticsAttributes = {
|
|
3
|
-
touchPoint
|
|
4
|
-
agentId
|
|
8
|
+
touchPoint?: string;
|
|
9
|
+
agentId?: string;
|
|
5
10
|
};
|
|
11
|
+
/** Common library attribute injected into all events */
|
|
12
|
+
export declare const LIBRARY_ATTRIBUTE: "agents-analytics";
|
|
13
|
+
/**
|
|
14
|
+
* Generic error event payload type.
|
|
15
|
+
* Use with `trackAgentEvent()` to track error events.
|
|
16
|
+
*/
|
|
17
|
+
export type ErrorEventPayload = {
|
|
18
|
+
actionSubject: 'rovoAgentError';
|
|
19
|
+
action: string;
|
|
20
|
+
attributes: {
|
|
21
|
+
error: {
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Union of all event payload types.
|
|
29
|
+
* Use with `trackAgentEvent()` for typed event tracking.
|
|
30
|
+
*/
|
|
31
|
+
export type EventPayload = EditingEventPayload | AgentInteractionsEventPayload | DebugEventPayload | ToolsEventPayload | EvaluationEventPayload | ErrorEventPayload;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Union type of all valid create agent flow actions.
|
|
3
|
+
* Includes both CreateFlow and AddToolsPrompt actions.
|
|
4
|
+
*
|
|
5
|
+
* Data portal registry links:
|
|
6
|
+
* - createFlowStart: https://data-portal.internal.atlassian.com/analytics/registry/97089
|
|
7
|
+
* - createFlowSkipNL: https://data-portal.internal.atlassian.com/analytics/registry/97127
|
|
8
|
+
* - createFlowReviewNL: https://data-portal.internal.atlassian.com/analytics/registry/97124
|
|
9
|
+
* - createFlowActivate: https://data-portal.internal.atlassian.com/analytics/registry/97123
|
|
10
|
+
* - createFlowRestart: https://data-portal.internal.atlassian.com/analytics/registry/97131
|
|
11
|
+
* - createFlowError: https://data-portal.internal.atlassian.com/analytics/registry/97132
|
|
12
|
+
* - createLandInStudio: https://data-portal.internal.atlassian.com/analytics/registry/97136
|
|
13
|
+
* - createDiscard: https://data-portal.internal.atlassian.com/analytics/registry/97137
|
|
14
|
+
* - saDraft: https://data-portal.internal.atlassian.com/analytics/registry/97924
|
|
15
|
+
* - addToolsPromptShown: https://data-portal.internal.atlassian.com/analytics/registry/98106
|
|
16
|
+
* - addToolsPromptBrowse: https://data-portal.internal.atlassian.com/analytics/registry/98107
|
|
17
|
+
* - addToolsPromptDismiss: https://data-portal.internal.atlassian.com/analytics/registry/98108
|
|
18
|
+
*/
|
|
19
|
+
type AgentCreateAction = 'createFlowStart' | 'createFlowSkipNL' | 'createFlowReviewNL' | 'createFlowActivate' | 'createFlowRestart' | 'createFlowError' | 'createLandInStudio' | 'createDiscard' | 'saDraft' | 'addToolsPromptShown' | 'addToolsPromptBrowse' | 'addToolsPromptDismiss';
|
|
17
20
|
type CommonAnalyticsAttributes = {
|
|
18
21
|
touchPoint?: string;
|
|
19
22
|
} & Record<string, any>;
|
|
20
23
|
export declare const useRovoAgentCreateAnalytics: (commonAttributes: CommonAnalyticsAttributes) => readonly [string | null, {
|
|
21
|
-
readonly trackCreateSession: (action:
|
|
24
|
+
readonly trackCreateSession: (action: AgentCreateAction, attributes?: CommonAnalyticsAttributes) => void;
|
|
22
25
|
readonly trackCreateSessionStart: (attributes?: CommonAnalyticsAttributes) => void;
|
|
23
26
|
readonly trackCreateSessionError: (error: Error, attributes?: CommonAnalyticsAttributes) => void;
|
|
24
27
|
readonly refreshCSID: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -7,33 +7,49 @@
|
|
|
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
|
|
11
|
-
* 2.
|
|
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
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
|
39
55
|
};
|
|
@@ -4,27 +4,31 @@
|
|
|
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
|
|
8
|
-
* 2.
|
|
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
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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: {
|
|
25
31
|
toolId: string;
|
|
26
32
|
isExpanded: boolean;
|
|
27
33
|
};
|
|
28
|
-
[AgentDebugActions.VIEW]: EmptyAttributes;
|
|
29
34
|
};
|
|
30
|
-
export {};
|
|
@@ -5,19 +5,15 @@
|
|
|
5
5
|
* Unlike agentInteractions (user clicks), these track actual data changes.
|
|
6
6
|
*
|
|
7
7
|
* ## Adding a new action
|
|
8
|
-
* 1. Add
|
|
9
|
-
* 2.
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export type EditingActionAttributes = {
|
|
20
|
-
[AgentEditingActions.UPDATED]: BaseAgentAnalyticsAttributes & {
|
|
13
|
+
export type EditingEventPayload = {
|
|
14
|
+
actionSubject: 'rovoAgent';
|
|
15
|
+
action: 'updated';
|
|
16
|
+
attributes: BaseAgentAnalyticsAttributes & {
|
|
21
17
|
agentType: string;
|
|
22
18
|
field: string;
|
|
23
19
|
};
|
|
@@ -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,21 +5,12 @@
|
|
|
5
5
|
* (confirming, streaming, viewing results, errors).
|
|
6
6
|
*
|
|
7
7
|
* ## Adding a new action
|
|
8
|
-
* 1. Add
|
|
9
|
-
* 2.
|
|
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
|
-
|
|
15
|
-
export declare const ACTION_GROUP: "tools";
|
|
16
|
-
export declare enum AgentToolActions {
|
|
17
|
-
TOOLS_EXECUTION_CONFIRMED = "toolsExecutionConfirmed",
|
|
18
|
-
TOOLS_EXECUTION_STREAM_STOPPED = "toolsExecutionStreamStopped",
|
|
19
|
-
TOOLS_EXECUTION_RESULT_VIEWED = "toolsExecutionResultViewed",
|
|
20
|
-
TOOLS_EXECUTION_RESULT_ERROR = "toolsExecutionResultError"
|
|
21
|
-
}
|
|
22
|
-
export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
13
|
+
type ToolsExecutionAttributesBase = BaseAgentAnalyticsAttributes & {
|
|
23
14
|
tools: {
|
|
24
15
|
toolId: string;
|
|
25
16
|
toolSource: string;
|
|
@@ -27,12 +18,23 @@ export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
|
27
18
|
}[];
|
|
28
19
|
singleInstrumentationId: string | undefined;
|
|
29
20
|
};
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
|
38
39
|
};
|
|
40
|
+
export {};
|