@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.
- package/CHANGELOG.md +14 -0
- package/README.md +103 -58
- package/actions/add-tools-prompt/package.json +17 -0
- package/actions/agent-interactions/package.json +17 -0
- package/actions/create-flow/package.json +17 -0
- package/actions/debug/package.json +17 -0
- package/actions/editing/package.json +17 -0
- package/actions/evaluation/package.json +17 -0
- package/actions/tool-actions/package.json +5 -5
- package/dist/cjs/actions/groups/add-tools-prompt.js +43 -0
- package/dist/cjs/actions/groups/agent-interactions.js +55 -0
- package/dist/cjs/actions/groups/create-flow.js +51 -0
- package/dist/cjs/actions/groups/debug.js +42 -0
- package/dist/cjs/actions/groups/editing.js +32 -0
- package/dist/cjs/actions/groups/evaluation.js +1 -0
- package/dist/cjs/actions/{tool-actions/index.js → groups/tools.js} +25 -2
- package/dist/cjs/actions/index.js +46 -36
- package/dist/cjs/actions/registry.js +26 -0
- package/dist/cjs/common/types.js +13 -1
- package/dist/cjs/create/index.js +12 -33
- package/dist/es2019/actions/groups/add-tools-prompt.js +37 -0
- package/dist/es2019/actions/groups/agent-interactions.js +50 -0
- package/dist/es2019/actions/groups/create-flow.js +45 -0
- package/dist/es2019/actions/groups/debug.js +37 -0
- package/dist/es2019/actions/groups/editing.js +27 -0
- package/dist/es2019/actions/groups/evaluation.js +0 -0
- package/dist/es2019/actions/{tool-actions/index.js → groups/tools.js} +27 -1
- package/dist/es2019/actions/index.js +48 -35
- package/dist/es2019/actions/registry.js +20 -0
- package/dist/es2019/common/types.js +7 -0
- package/dist/es2019/create/index.js +15 -32
- package/dist/esm/actions/groups/add-tools-prompt.js +37 -0
- package/dist/esm/actions/groups/agent-interactions.js +50 -0
- package/dist/esm/actions/groups/create-flow.js +45 -0
- package/dist/esm/actions/groups/debug.js +37 -0
- package/dist/esm/actions/groups/editing.js +27 -0
- package/dist/esm/actions/groups/evaluation.js +0 -0
- package/dist/esm/actions/{tool-actions/index.js → groups/tools.js} +27 -1
- package/dist/esm/actions/index.js +47 -36
- package/dist/esm/actions/registry.js +20 -0
- package/dist/esm/common/types.js +7 -0
- package/dist/esm/create/index.js +13 -33
- package/dist/types/actions/groups/add-tools-prompt.d.ts +39 -0
- package/dist/types/actions/groups/agent-interactions.d.ts +81 -0
- package/dist/types/actions/groups/create-flow.d.ts +65 -0
- package/dist/types/actions/groups/debug.d.ts +55 -0
- package/dist/types/actions/groups/editing.d.ts +33 -0
- package/dist/types/actions/groups/evaluation.d.ts +56 -0
- package/dist/types/actions/groups/tools.d.ts +69 -0
- package/dist/types/actions/index.d.ts +18 -47
- package/dist/types/actions/registry.d.ts +23 -0
- package/dist/types/common/types.d.ts +14 -0
- package/dist/types/create/index.d.ts +17 -15
- package/dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts +39 -0
- package/dist/types-ts4.5/actions/groups/agent-interactions.d.ts +81 -0
- package/dist/types-ts4.5/actions/groups/create-flow.d.ts +65 -0
- package/dist/types-ts4.5/actions/groups/debug.d.ts +55 -0
- package/dist/types-ts4.5/actions/groups/editing.d.ts +33 -0
- package/dist/types-ts4.5/actions/groups/evaluation.d.ts +56 -0
- package/dist/types-ts4.5/actions/groups/tools.d.ts +69 -0
- package/dist/types-ts4.5/actions/index.d.ts +18 -47
- package/dist/types-ts4.5/actions/registry.d.ts +23 -0
- package/dist/types-ts4.5/common/types.d.ts +14 -0
- package/dist/types-ts4.5/create/index.d.ts +17 -15
- package/package.json +2 -2
- package/dist/types/actions/tool-actions/index.d.ts +0 -18
- package/dist/types-ts4.5/actions/tool-actions/index.d.ts +0 -18
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
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 */
|
|
57
|
+
export declare const ACTION_GROUP: "agentInteractions";
|
|
58
|
+
/** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
|
|
59
|
+
export declare enum AgentInteractionActions {
|
|
60
|
+
VIEW = "view",
|
|
61
|
+
EDIT = "edit",
|
|
62
|
+
COPY_LINK = "copyLink",
|
|
63
|
+
DELETE = "delete",
|
|
64
|
+
DUPLICATE = "duplicate",
|
|
65
|
+
STAR = "star",
|
|
66
|
+
CHAT = "chat",
|
|
67
|
+
VERIFY = "verify",
|
|
68
|
+
UNVERIFY = "unverify"
|
|
69
|
+
}
|
|
70
|
+
/** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
|
|
71
|
+
export type AgentInteractionAttributes = {
|
|
72
|
+
[AgentInteractionActions.VIEW]: BaseAgentAnalyticsAttributes;
|
|
73
|
+
[AgentInteractionActions.EDIT]: BaseAgentAnalyticsAttributes;
|
|
74
|
+
[AgentInteractionActions.COPY_LINK]: BaseAgentAnalyticsAttributes;
|
|
75
|
+
[AgentInteractionActions.DELETE]: BaseAgentAnalyticsAttributes;
|
|
76
|
+
[AgentInteractionActions.DUPLICATE]: BaseAgentAnalyticsAttributes;
|
|
77
|
+
[AgentInteractionActions.STAR]: BaseAgentAnalyticsAttributes;
|
|
78
|
+
[AgentInteractionActions.CHAT]: BaseAgentAnalyticsAttributes;
|
|
79
|
+
[AgentInteractionActions.VERIFY]: BaseAgentAnalyticsAttributes;
|
|
80
|
+
[AgentInteractionActions.UNVERIFY]: BaseAgentAnalyticsAttributes;
|
|
81
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* 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 */
|
|
53
|
+
export declare const ACTION_GROUP: "createFlow";
|
|
54
|
+
/** @deprecated Use CreateFlowEventPayload with trackAgentEvent() instead */
|
|
55
|
+
export declare enum CreateFlowActions {
|
|
56
|
+
START = "createFlowStart",
|
|
57
|
+
SKIP_NL = "createFlowSkipNL",
|
|
58
|
+
REVIEW_NL = "createFlowReviewNL",
|
|
59
|
+
ACTIVATE = "createFlowActivate",
|
|
60
|
+
RESTART = "createFlowRestart",
|
|
61
|
+
ERROR = "createFlowError",
|
|
62
|
+
LAND = "createLandInStudio",
|
|
63
|
+
DISCARD = "createDiscard",
|
|
64
|
+
SA_DRAFT = "saDraft"
|
|
65
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
* 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 */
|
|
36
|
+
export declare const ACTION_GROUP: "debug";
|
|
37
|
+
/** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
|
|
38
|
+
export declare enum AgentDebugActions {
|
|
39
|
+
VIEW = "debugView",
|
|
40
|
+
COPY_ALL = "debugCopyAll",
|
|
41
|
+
COPY = "debugCopy",
|
|
42
|
+
TOGGLE_SKILL_INFO = "debugToggleSkillInfo"
|
|
43
|
+
}
|
|
44
|
+
type EmptyAttributes = {};
|
|
45
|
+
/** @deprecated Use DebugEventPayload with trackAgentEvent() instead */
|
|
46
|
+
export type DebugActionAttributes = {
|
|
47
|
+
[AgentDebugActions.COPY_ALL]: EmptyAttributes;
|
|
48
|
+
[AgentDebugActions.COPY]: EmptyAttributes;
|
|
49
|
+
[AgentDebugActions.TOGGLE_SKILL_INFO]: {
|
|
50
|
+
toolId: string;
|
|
51
|
+
isExpanded: boolean;
|
|
52
|
+
};
|
|
53
|
+
[AgentDebugActions.VIEW]: EmptyAttributes;
|
|
54
|
+
};
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
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 */
|
|
22
|
+
export declare const ACTION_GROUP: "editing";
|
|
23
|
+
/** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
|
|
24
|
+
export declare enum AgentEditingActions {
|
|
25
|
+
UPDATED = "updated"
|
|
26
|
+
}
|
|
27
|
+
/** @deprecated Use EditingEventPayload with trackAgentEvent() instead */
|
|
28
|
+
export type EditingActionAttributes = {
|
|
29
|
+
[AgentEditingActions.UPDATED]: BaseAgentAnalyticsAttributes & {
|
|
30
|
+
agentType: string;
|
|
31
|
+
field: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -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 {};
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
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 */
|
|
41
|
+
export declare const ACTION_GROUP: "tools";
|
|
42
|
+
/** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
|
|
43
|
+
export declare enum AgentToolActions {
|
|
44
|
+
TOOLS_EXECUTION_CONFIRMED = "toolsExecutionConfirmed",
|
|
45
|
+
TOOLS_EXECUTION_STREAM_STOPPED = "toolsExecutionStreamStopped",
|
|
46
|
+
TOOLS_EXECUTION_RESULT_VIEWED = "toolsExecutionResultViewed",
|
|
47
|
+
TOOLS_EXECUTION_RESULT_ERROR = "toolsExecutionResultError"
|
|
48
|
+
}
|
|
49
|
+
/** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
|
|
50
|
+
export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
51
|
+
tools: {
|
|
52
|
+
toolId: string;
|
|
53
|
+
toolSource: string;
|
|
54
|
+
resolutionType: string;
|
|
55
|
+
}[];
|
|
56
|
+
singleInstrumentationId: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
|
|
59
|
+
export type ToolsExecutionResultAttributes = ToolsExecutionAttributes & {
|
|
60
|
+
scenarioId: string | null | undefined;
|
|
61
|
+
};
|
|
62
|
+
/** @deprecated Use ToolsEventPayload with trackAgentEvent() instead */
|
|
63
|
+
export type ToolsActionAttributes = {
|
|
64
|
+
[AgentToolActions.TOOLS_EXECUTION_CONFIRMED]: ToolsExecutionAttributes;
|
|
65
|
+
[AgentToolActions.TOOLS_EXECUTION_STREAM_STOPPED]: ToolsExecutionAttributes;
|
|
66
|
+
[AgentToolActions.TOOLS_EXECUTION_RESULT_VIEWED]: ToolsExecutionResultAttributes;
|
|
67
|
+
[AgentToolActions.TOOLS_EXECUTION_RESULT_ERROR]: ToolsExecutionAttributes;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -1,52 +1,23 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
CHAT = "chat",
|
|
18
|
-
VERIFY = "verify",
|
|
19
|
-
UNVERIFY = "unverify"
|
|
20
|
-
}
|
|
21
|
-
type EmptyAttributes = {};
|
|
22
|
-
type ActionAttributes = {
|
|
23
|
-
[AgentCommonActions.VIEW]: BaseAgentAnalyticsAttributes;
|
|
24
|
-
[AgentCommonActions.EDIT]: BaseAgentAnalyticsAttributes;
|
|
25
|
-
[AgentCommonActions.UPDATED]: BaseAgentAnalyticsAttributes & {
|
|
26
|
-
agentType: string;
|
|
27
|
-
field: string;
|
|
28
|
-
};
|
|
29
|
-
[AgentCommonActions.COPY_LINK]: BaseAgentAnalyticsAttributes;
|
|
30
|
-
[AgentCommonActions.DELETE]: BaseAgentAnalyticsAttributes;
|
|
31
|
-
[AgentCommonActions.DUPLICATE]: BaseAgentAnalyticsAttributes;
|
|
32
|
-
[AgentCommonActions.STAR]: BaseAgentAnalyticsAttributes;
|
|
33
|
-
[AgentCommonActions.CHAT]: BaseAgentAnalyticsAttributes;
|
|
34
|
-
[AgentCommonActions.VERIFY]: BaseAgentAnalyticsAttributes;
|
|
35
|
-
[AgentCommonActions.UNVERIFY]: BaseAgentAnalyticsAttributes;
|
|
36
|
-
[AgentDebugActions.COPY_ALL]: EmptyAttributes;
|
|
37
|
-
[AgentDebugActions.COPY]: EmptyAttributes;
|
|
38
|
-
[AgentDebugActions.TOGGLE_SKILL_INFO]: {
|
|
39
|
-
toolId: string;
|
|
40
|
-
isExpanded: boolean;
|
|
41
|
-
};
|
|
42
|
-
[AgentDebugActions.VIEW]: EmptyAttributes;
|
|
43
|
-
[AgentToolActions.TOOLS_EXECUTION_CONFIRMED]: ToolsExecutionAttributes;
|
|
44
|
-
[AgentToolActions.TOOLS_EXECUTION_STREAM_STOPPED]: ToolsExecutionAttributes;
|
|
45
|
-
[AgentToolActions.TOOLS_EXECUTION_RESULT_VIEWED]: ToolsExecutionResultAttributes;
|
|
46
|
-
[AgentToolActions.TOOLS_EXECUTION_RESULT_ERROR]: ToolsExecutionAttributes;
|
|
1
|
+
import { type EventPayload, type RemainingRequired } from '../common/types';
|
|
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;
|
|
47
17
|
};
|
|
18
|
+
export declare const AgentDebugActions: typeof AgentDebugActionsEnum;
|
|
48
19
|
export declare const useRovoAgentActionAnalytics: <T extends {}>(commonAttributes: T) => {
|
|
49
20
|
trackAgentAction: <A extends keyof ActionAttributes>(action: A, attributes: RemainingRequired<ActionAttributes[A], T>) => void;
|
|
21
|
+
trackAgentEvent: (payload: EventPayload) => void;
|
|
50
22
|
trackAgentActionError: <A extends keyof ActionAttributes>(action: A, error: Error, attributes?: RemainingRequired<ActionAttributes[A], T>) => void;
|
|
51
23
|
};
|
|
52
|
-
export {};
|
|
@@ -0,0 +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
|
+
*/
|
|
12
|
+
import { type AgentInteractionAttributes } from './groups/agent-interactions';
|
|
13
|
+
import { type DebugActionAttributes } from './groups/debug';
|
|
14
|
+
import { type EditingActionAttributes } from './groups/editing';
|
|
15
|
+
import { type ToolsActionAttributes } from './groups/tools';
|
|
16
|
+
export declare const DefaultActionSubject = "rovoAgent";
|
|
17
|
+
/**
|
|
18
|
+
* Combined attribute map (union of all groups).
|
|
19
|
+
* Used by the backward-compatible `trackAgentAction` helper.
|
|
20
|
+
*
|
|
21
|
+
* @deprecated Use EventPayload with trackAgentEvent() instead
|
|
22
|
+
*/
|
|
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;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import { AddToolsPromptActions } from '../actions/groups/add-tools-prompt';
|
|
2
|
+
import { CreateFlowActions } from '../actions/groups/create-flow';
|
|
3
|
+
export declare const AgentCreateActions: {
|
|
4
|
+
readonly SHOWN: AddToolsPromptActions.SHOWN;
|
|
5
|
+
readonly BROWSE: AddToolsPromptActions.BROWSE;
|
|
6
|
+
readonly DISMISS: AddToolsPromptActions.DISMISS;
|
|
7
|
+
readonly START: CreateFlowActions.START;
|
|
8
|
+
readonly SKIP_NL: CreateFlowActions.SKIP_NL;
|
|
9
|
+
readonly REVIEW_NL: CreateFlowActions.REVIEW_NL;
|
|
10
|
+
readonly ACTIVATE: CreateFlowActions.ACTIVATE;
|
|
11
|
+
readonly RESTART: CreateFlowActions.RESTART;
|
|
12
|
+
readonly ERROR: CreateFlowActions.ERROR;
|
|
13
|
+
readonly LAND: CreateFlowActions.LAND;
|
|
14
|
+
readonly DISCARD: CreateFlowActions.DISCARD;
|
|
15
|
+
readonly SA_DRAFT: CreateFlowActions.SA_DRAFT;
|
|
16
|
+
};
|
|
1
17
|
type CommonAnalyticsAttributes = {
|
|
2
18
|
touchPoint?: string;
|
|
3
19
|
} & Record<string, any>;
|
|
4
|
-
export declare enum AgentCreateActions {
|
|
5
|
-
START = "createFlowStart",
|
|
6
|
-
SKIP_NL = "createFlowSkipNL",
|
|
7
|
-
REVIEW_NL = "createFlowReviewNL",
|
|
8
|
-
ACTIVATE = "createFlowActivate",
|
|
9
|
-
RESTART = "createFlowRestart",
|
|
10
|
-
ERROR = "createFlowError",
|
|
11
|
-
LAND = "createLandInStudio",
|
|
12
|
-
DISCARD = "createDiscard",
|
|
13
|
-
SHOW_NO_SKILLS_MODAL = "showNoSkillsModal",
|
|
14
|
-
BROWSE_CLICK_NO_SKILLS_MODAL = "browseClickNoSkillsModal",
|
|
15
|
-
DISCARD_NO_SKILLS_MODAL = "discardNoSkillsModal",
|
|
16
|
-
SA_DRAFT = "saDraft"
|
|
17
|
-
}
|
|
18
20
|
export declare const useRovoAgentCreateAnalytics: (commonAttributes: CommonAnalyticsAttributes) => readonly [string | null, {
|
|
19
|
-
readonly trackCreateSession: (action:
|
|
21
|
+
readonly trackCreateSession: (action: (typeof AgentCreateActions)[keyof typeof AgentCreateActions], attributes?: CommonAnalyticsAttributes) => void;
|
|
20
22
|
readonly trackCreateSessionStart: (attributes?: CommonAnalyticsAttributes) => void;
|
|
21
23
|
readonly trackCreateSessionError: (error: Error, attributes?: CommonAnalyticsAttributes) => void;
|
|
22
24
|
readonly refreshCSID: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
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 */
|
|
57
|
+
export declare const ACTION_GROUP: "agentInteractions";
|
|
58
|
+
/** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
|
|
59
|
+
export declare enum AgentInteractionActions {
|
|
60
|
+
VIEW = "view",
|
|
61
|
+
EDIT = "edit",
|
|
62
|
+
COPY_LINK = "copyLink",
|
|
63
|
+
DELETE = "delete",
|
|
64
|
+
DUPLICATE = "duplicate",
|
|
65
|
+
STAR = "star",
|
|
66
|
+
CHAT = "chat",
|
|
67
|
+
VERIFY = "verify",
|
|
68
|
+
UNVERIFY = "unverify"
|
|
69
|
+
}
|
|
70
|
+
/** @deprecated Use AgentInteractionsEventPayload with trackAgentEvent() instead */
|
|
71
|
+
export type AgentInteractionAttributes = {
|
|
72
|
+
[AgentInteractionActions.VIEW]: BaseAgentAnalyticsAttributes;
|
|
73
|
+
[AgentInteractionActions.EDIT]: BaseAgentAnalyticsAttributes;
|
|
74
|
+
[AgentInteractionActions.COPY_LINK]: BaseAgentAnalyticsAttributes;
|
|
75
|
+
[AgentInteractionActions.DELETE]: BaseAgentAnalyticsAttributes;
|
|
76
|
+
[AgentInteractionActions.DUPLICATE]: BaseAgentAnalyticsAttributes;
|
|
77
|
+
[AgentInteractionActions.STAR]: BaseAgentAnalyticsAttributes;
|
|
78
|
+
[AgentInteractionActions.CHAT]: BaseAgentAnalyticsAttributes;
|
|
79
|
+
[AgentInteractionActions.VERIFY]: BaseAgentAnalyticsAttributes;
|
|
80
|
+
[AgentInteractionActions.UNVERIFY]: BaseAgentAnalyticsAttributes;
|
|
81
|
+
};
|