@atlaskit/rovo-agent-analytics

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

罗沃代理分析

中文使用文档
文档目录13 节
  1. 使用量
  2. 实例
  3. 基本事件跟踪
  4. 带有自定义属性的事件跟踪
  5. 有效载荷类型
  6. 添加新动作
  7. 现有有效载荷类型
  8. 给新组合
  9. 定义自定义属性
  10. 使用底物分析属性
  11. 使用自定义属性
  12. 条目点
  13. 创建流程分析

Rovo Agent分析器

Rovo Agents 分析库,用于编译并发送已键入分析事件.

使用量

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',
  },
});

可找到详细的文件和示例使用 这里。 。 。 .

实例

基本事件跟踪

用于明确类型的活动 action, (中文(简体) ), actionSubject,以及 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: {},
});

带有自定义属性的事件跟踪

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',
});

有效载荷类型

每个组文件在 src/actions/groups/ 出口a 受歧视的联盟有效载荷类型 定义该组的所有有效事件形状.

文件有效载荷类型说明
agent-interactions.tsAgentInteractionsEventPayload用户启动的交互( 查看、 编辑、 删除、 复制、 明星、 聊天、 校验...)
triggers.tsTriggerEventPayload内置触发视图并完成前端 CRUD 操作
editing.tsEditingEventPayload代理保存/更改事件(更新)
debug.tsDebugEventPayload调试模式动作( 视图、 复制、 切换技能信息)
tools.tsToolsEventPayload工具执行动作( 确认、 流站、 查看结果、 错误)
evaluation.tsEvaluationEventPayload批量评价活动(CRUD数据集、工作周期、查看结果)
create-flow.tsCreateFlowEventPayload创建代理漏斗步骤
add-tools-prompt.tsAddToolsPromptEventPayload添加工具提示模式事件
value-calculator.tsValueCalculatorEventPayload代理透视值计算器漏斗

合计 EventPayload 类型(从 types.ts)是所有这些有效载荷类型的联盟.

添加新动作

现有有效载荷类型

  1. 打开组文件(例如. src/actions/groups/agent-interactions.ts(中文(简体) )
  2. 在有效载荷联盟类型上添加有数据-门户登记链接的新变体:
export type AgentInteractionsEventPayload =
  | {
      // https://data-portal.internal.atlassian.com/analytics/registry/XXXXX
      actionSubject: 'rovoAgent';
      action: 'myNewAction';
      attributes: BaseAgentAnalyticsAttributes & {
        myCustomField: string;
      };
    }
  | // ... existing variants

就这样——TypeScript在调用时会执行正确的形状 trackAgentEvent()。 。 。 .

给新组合

如果您的行动不符合任何已有的组,请创建一个新的组:

  1. 在 src/actions/groups/ 遵循现有模板
  2. 出口受歧视的联盟有效载荷类型(例如:. MyFeatureEventPayload(中文(简体) )
  3. 将新类型添加到 EventPayload 工会 src/common/types.ts数字 :
import type { MyFeatureEventPayload } from '../actions/groups/my-feature';

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

定义自定义属性

有效载荷类型中的每个动作变体可以有自己的具体属性:

使用底物分析属性

需要采取的行动 touchPoint 财务报告和审定财务报表 agentId数字 :

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

使用自定义属性

对于需要额外属性的行动:

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

条目点

入口说明
@atlaskit/rovo-agent-analytics/actions主要入境点——出口 useRovoAgentActionAnalytics 钩子
@atlaskit/rovo-agent-analytics/create创建代理流分析 — 导出 useRovoAgentCreateAnalytics 钩子和 AgentCreateAction 类型

创建流程分析

这个 useRovoAgentCreateAnalytics 钩子用于跟踪代理创建漏斗:

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 是什么?

罗沃代理分析

如何安装 @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 和提交记录判断。