@atlaskit/rovo-agent-analytics

中文文档
6.7.2发布于 2026/11/05Apache-2.0TypeScriptESM + CJS近 30 天下载 3.4万

Rovo Agents analytics

原始使用文档
文档目录13 节
  1. Usage
  2. Examples
  3. Basic Event Tracking
  4. Event Tracking with Custom Attributes
  5. Payload Types
  6. Adding a New Action
  7. To an existing payload type
  8. To a new group
  9. Defining Custom Attributes
  10. Using BaseAgentAnalyticsAttributes
  11. Using Custom Attributes
  12. Entry Points
  13. Create Flow Analytics

RovoAgentAnalytics

Rovo Agents analytics library for composing and sending typed analytics events.

Usage

import { useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';

const { trackAgentEvent } = useRovoAgentActionAnalytics({});

// Full control over event properties — all fields are type-checked
trackAgentEvent({
  action: 'view',
  actionSubject: 'rovoAgent',
  attributes: { 
    agentId: 'agent-123',
    touchPoint: 'browse-agent-list',
  },
});

Detailed docs and example usage can be found here.

Examples

Basic Event Tracking

For fully-typed events with explicit action, actionSubject, and attributes:

import { useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';

const { trackAgentEvent } = useRovoAgentActionAnalytics({
  agentId,
  touchPoint: 'browse-agent-list',
});

// Track a user interaction
trackAgentEvent({
  action: 'duplicate',
  actionSubject: 'rovoAgent',
  attributes: {},
});

Event Tracking with Custom Attributes

import { useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';

const { trackAgentEvent } = useRovoAgentActionAnalytics({});

// Full control over event properties — all fields are type-checked
trackAgentEvent({
  action: 'created',
  actionSubject: 'batchEvaluationDataset',
  attributes: { 
    totalQuestions: 5 
  },
  objectType: 'batchEvaluationDataset',
  objectId: 'dataset-123',
});

Payload Types

Each group file in src/actions/groups/ exports a discriminated union payload type that defines all valid event shapes for that group.

FilePayload TypeDescription
agent-interactions.tsAgentInteractionsEventPayloadUser-initiated interactions (view, edit, delete, duplicate, star, chat, verify…)
triggers.tsTriggerEventPayloadInline trigger views and completed frontend CRUD operations
editing.tsEditingEventPayloadAgent save/mutation events (updated)
debug.tsDebugEventPayloadDebug modal actions (view, copy, toggle skill info)
tools.tsToolsEventPayloadTool execution actions (confirm, stream stop, result viewed, error)
evaluation.tsEvaluationEventPayloadBatch evaluation events (dataset CRUD, job lifecycle, results viewed)
create-flow.tsCreateFlowEventPayloadCreate agent funnel steps
add-tools-prompt.tsAddToolsPromptEventPayloadAdd tools prompt modal events
value-calculator.tsValueCalculatorEventPayloadAgent Insights value calculator funnel

The combined EventPayload type (exported from types.ts) is a union of all these payload types.

Adding a New Action

To an existing payload type

  1. Open the group file (e.g. src/actions/groups/agent-interactions.ts)
  2. Add a new variant to the payload union type with a data-portal registry link:
export type AgentInteractionsEventPayload =
  | {
      // https://data-portal.internal.atlassian.com/analytics/registry/XXXXX
      actionSubject: 'rovoAgent';
      action: 'myNewAction';
      attributes: BaseAgentAnalyticsAttributes & {
        myCustomField: string;
      };
    }
  | // ... existing variants

That's it — TypeScript will enforce the correct shape when calling trackAgentEvent().

To a new group

If your action doesn't fit any existing group, create a new one:

  1. Create a new file in src/actions/groups/ following the existing template
  2. Export a discriminated union payload type (e.g. MyFeatureEventPayload)
  3. Add the new type to the EventPayload union in src/common/types.ts:
import type { MyFeatureEventPayload } from '../actions/groups/my-feature';

export type EventPayload =
  | EditingEventPayload
  | AgentInteractionsEventPayload
  // ... existing types
  | MyFeatureEventPayload;

Defining Custom Attributes

Each action variant in a payload type can have its own specific attributes:

Using BaseAgentAnalyticsAttributes

For actions that need touchPoint and agentId:

{
  actionSubject: 'rovoAgent';
  action: 'view';
  attributes: BaseAgentAnalyticsAttributes;
}

Using Custom Attributes

For actions that need additional attributes:

{
  actionSubject: 'rovoAgent';
  action: 'updated';
  attributes: BaseAgentAnalyticsAttributes & { 
    agentType: string; 
    field: string; 
  };
}

Entry Points

Entry PointDescription
@atlaskit/rovo-agent-analytics/actionsMain entry point — exports useRovoAgentActionAnalytics hook
@atlaskit/rovo-agent-analytics/createCreate agent flow analytics — exports useRovoAgentCreateAnalytics hook and AgentCreateAction type

Create Flow Analytics

The useRovoAgentCreateAnalytics hook is used for tracking the agent creation funnel:

import { useRovoAgentCreateAnalytics } from '@atlaskit/rovo-agent-analytics/create';

const [csid, { trackCreateSession, trackCreateSessionStart }] = useRovoAgentCreateAnalytics({
  touchPoint: 'agent-studio',
});

// Track funnel steps using string literal actions
trackCreateSession('createFlowStart');
trackCreateSession('createFlowActivate', { agentType: 'custom' });

版本与发布记录

@atlaskit/rovo-agent-analytics 共发布 70 个版本,首次发布于 2025/11/27;过去 12 个月发布了 70 个版本。

版本发布日期距今
6.7.2latest2026/11/052 天前
6.7.12026/10/299 天前
6.7.02026/10/2711 天前
6.6.12026/10/1622 天前
6.6.02026/10/1622 天前
6.5.02026/09/251 个月前

关于 @atlaskit/rovo-agent-analytics 的常见问题

@atlaskit/rovo-agent-analytics 是什么?

Rovo Agents analytics

如何安装 @atlaskit/rovo-agent-analytics?

在项目目录运行 npm install @atlaskit/rovo-agent-analytics,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@atlaskit/rovo-agent-analytics 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@atlaskit/rovo-agent-analytics 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@atlaskit/rovo-agent-analytics 可以商用吗?

@atlaskit/rovo-agent-analytics 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@atlaskit/rovo-agent-analytics 的下载量有多少?

根据 npm 官方下载统计,@atlaskit/rovo-agent-analytics 在 2026/10/07 – 2026/11/05 这 30 天内被下载 33,569 次,日均约 1,119 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@atlaskit/rovo-agent-analytics 还在维护吗?

最新版本 6.7.2 发布于 2026/11/05(2 天前);至今共发布 70 个版本,其中过去 12 个月发布了 70 个;首次发布于 2025/11/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。