@atlaskit/rovo-agent-analytics 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +69 -18
- 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/tool-actions/package.json +5 -5
- package/dist/cjs/actions/groups/add-tools-prompt.js +32 -0
- package/dist/cjs/actions/groups/agent-interactions.js +44 -0
- package/dist/cjs/actions/groups/create-flow.js +39 -0
- package/dist/cjs/actions/groups/debug.js +31 -0
- package/dist/cjs/actions/groups/editing.js +26 -0
- package/dist/cjs/actions/{tool-actions/index.js → groups/tools.js} +16 -1
- package/dist/cjs/actions/index.js +14 -35
- package/dist/cjs/actions/registry.js +53 -0
- package/dist/cjs/create/index.js +11 -30
- package/dist/es2019/actions/groups/add-tools-prompt.js +26 -0
- package/dist/es2019/actions/groups/agent-interactions.js +38 -0
- package/dist/es2019/actions/groups/create-flow.js +33 -0
- package/dist/es2019/actions/groups/debug.js +25 -0
- package/dist/es2019/actions/groups/editing.js +20 -0
- package/dist/es2019/actions/{tool-actions/index.js → groups/tools.js} +15 -0
- package/dist/es2019/actions/index.js +19 -35
- package/dist/es2019/actions/registry.js +52 -0
- package/dist/es2019/create/index.js +14 -29
- package/dist/esm/actions/groups/add-tools-prompt.js +26 -0
- package/dist/esm/actions/groups/agent-interactions.js +38 -0
- package/dist/esm/actions/groups/create-flow.js +33 -0
- package/dist/esm/actions/groups/debug.js +25 -0
- package/dist/esm/actions/groups/editing.js +20 -0
- package/dist/esm/actions/{tool-actions/index.js → groups/tools.js} +15 -0
- package/dist/esm/actions/index.js +15 -35
- package/dist/esm/actions/registry.js +48 -0
- package/dist/esm/create/index.js +12 -30
- package/dist/types/actions/groups/add-tools-prompt.d.ts +21 -0
- package/dist/types/actions/groups/agent-interactions.d.ts +39 -0
- package/dist/types/actions/groups/create-flow.d.ts +22 -0
- package/dist/types/actions/groups/debug.d.ts +30 -0
- package/dist/types/actions/groups/editing.d.ts +24 -0
- package/dist/types/actions/groups/tools.d.ts +38 -0
- package/dist/types/actions/index.d.ts +17 -47
- package/dist/types/actions/registry.d.ts +16 -0
- package/dist/types/create/index.d.ts +17 -15
- package/dist/types-ts4.5/actions/groups/add-tools-prompt.d.ts +21 -0
- package/dist/types-ts4.5/actions/groups/agent-interactions.d.ts +39 -0
- package/dist/types-ts4.5/actions/groups/create-flow.d.ts +22 -0
- package/dist/types-ts4.5/actions/groups/debug.d.ts +30 -0
- package/dist/types-ts4.5/actions/groups/editing.d.ts +24 -0
- package/dist/types-ts4.5/actions/groups/tools.d.ts +38 -0
- package/dist/types-ts4.5/actions/index.d.ts +17 -47
- package/dist/types-ts4.5/actions/registry.d.ts +16 -0
- package/dist/types-ts4.5/create/index.d.ts +17 -15
- package/package.json +1 -1
- package/dist/types/actions/tool-actions/index.d.ts +0 -14
- package/dist/types-ts4.5/actions/tool-actions/index.d.ts +0 -14
|
@@ -0,0 +1,24 @@
|
|
|
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 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
|
|
11
|
+
* (see other files in this directory for the template)
|
|
12
|
+
*/
|
|
13
|
+
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
14
|
+
/** The group name sent as `attributes.actionGroup` in analytics events */
|
|
15
|
+
export declare const ACTION_GROUP: "editing";
|
|
16
|
+
export declare enum AgentEditingActions {
|
|
17
|
+
UPDATED = "updated"
|
|
18
|
+
}
|
|
19
|
+
export type EditingActionAttributes = {
|
|
20
|
+
[AgentEditingActions.UPDATED]: BaseAgentAnalyticsAttributes & {
|
|
21
|
+
agentType: string;
|
|
22
|
+
field: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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 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
|
|
11
|
+
* (see other files in this directory for the template)
|
|
12
|
+
*/
|
|
13
|
+
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
14
|
+
/** The group name sent as `attributes.actionGroup` in analytics events */
|
|
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 & {
|
|
23
|
+
tools: {
|
|
24
|
+
toolId: string;
|
|
25
|
+
toolSource: string;
|
|
26
|
+
resolutionType: string;
|
|
27
|
+
}[];
|
|
28
|
+
singleInstrumentationId: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
export type ToolsExecutionResultAttributes = ToolsExecutionAttributes & {
|
|
31
|
+
scenarioId: string | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
export type ToolsActionAttributes = {
|
|
34
|
+
[AgentToolActions.TOOLS_EXECUTION_CONFIRMED]: ToolsExecutionAttributes;
|
|
35
|
+
[AgentToolActions.TOOLS_EXECUTION_STREAM_STOPPED]: ToolsExecutionAttributes;
|
|
36
|
+
[AgentToolActions.TOOLS_EXECUTION_RESULT_VIEWED]: ToolsExecutionResultAttributes;
|
|
37
|
+
[AgentToolActions.TOOLS_EXECUTION_RESULT_ERROR]: ToolsExecutionAttributes;
|
|
38
|
+
};
|
|
@@ -1,52 +1,22 @@
|
|
|
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]: ToolsExecutionAttributes;
|
|
46
|
-
[AgentToolActions.TOOLS_EXECUTION_RESULT_ERROR]: ToolsExecutionAttributes;
|
|
1
|
+
import 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;
|
|
50
21
|
trackAgentActionError: <A extends keyof ActionAttributes>(action: A, error: Error, attributes?: RemainingRequired<ActionAttributes[A], T>) => void;
|
|
51
22
|
};
|
|
52
|
-
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AgentInteractionAttributes } from './groups/agent-interactions';
|
|
2
|
+
import { type DebugActionAttributes } from './groups/debug';
|
|
3
|
+
import { type EditingActionAttributes } from './groups/editing';
|
|
4
|
+
import { type ToolsActionAttributes } from './groups/tools';
|
|
5
|
+
/**
|
|
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`.
|
|
13
|
+
*
|
|
14
|
+
* When you add a new group, add it here too.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ACTION_TO_GROUP: Record<string, string>;
|
|
@@ -1,24 +1,26 @@
|
|
|
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 [
|
|
19
21
|
string | null,
|
|
20
22
|
{
|
|
21
|
-
readonly trackCreateSession: (action:
|
|
23
|
+
readonly trackCreateSession: (action: (typeof AgentCreateActions)[keyof typeof AgentCreateActions], attributes?: CommonAnalyticsAttributes) => void;
|
|
22
24
|
readonly trackCreateSessionStart: (attributes?: CommonAnalyticsAttributes) => void;
|
|
23
25
|
readonly trackCreateSessionError: (error: Error, attributes?: CommonAnalyticsAttributes) => void;
|
|
24
26
|
readonly refreshCSID: () => `${string}-${string}-${string}-${string}-${string}`;
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
2
|
-
export declare enum AgentToolActions {
|
|
3
|
-
TOOLS_EXECUTION_CONFIRMED = "toolsExecutionConfirmed",
|
|
4
|
-
TOOLS_EXECUTION_STREAM_STOPPED = "toolsExecutionStreamStopped",
|
|
5
|
-
TOOLS_EXECUTION_RESULT_VIEWED = "toolsExecutionResultViewed",
|
|
6
|
-
TOOLS_EXECUTION_RESULT_ERROR = "toolsExecutionResultError"
|
|
7
|
-
}
|
|
8
|
-
export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
9
|
-
tools: {
|
|
10
|
-
toolId: string;
|
|
11
|
-
toolSource: string;
|
|
12
|
-
resolutionType: string;
|
|
13
|
-
}[];
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BaseAgentAnalyticsAttributes } from '../../common/types';
|
|
2
|
-
export declare enum AgentToolActions {
|
|
3
|
-
TOOLS_EXECUTION_CONFIRMED = "toolsExecutionConfirmed",
|
|
4
|
-
TOOLS_EXECUTION_STREAM_STOPPED = "toolsExecutionStreamStopped",
|
|
5
|
-
TOOLS_EXECUTION_RESULT_VIEWED = "toolsExecutionResultViewed",
|
|
6
|
-
TOOLS_EXECUTION_RESULT_ERROR = "toolsExecutionResultError"
|
|
7
|
-
}
|
|
8
|
-
export type ToolsExecutionAttributes = BaseAgentAnalyticsAttributes & {
|
|
9
|
-
tools: {
|
|
10
|
-
toolId: string;
|
|
11
|
-
toolSource: string;
|
|
12
|
-
resolutionType: string;
|
|
13
|
-
}[];
|
|
14
|
-
};
|