@tapdb/tapdb-data-analysis 0.1.24 → 0.1.25

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/README.md CHANGED
@@ -78,9 +78,7 @@ AI 会自动调用 `tapdb_query.py` 脚本查询数据并生成分析报告。
78
78
  | 来源 | `source` | 新增设备/新增用户/转化率 |
79
79
  | 玩家行为 | `player_behavior` | 游戏时长/启动次数 |
80
80
  | 版本分布 | `version_distri` | 各版本活跃设备分布 |
81
- | 运营概览 | `overview` | 收入/活跃/新增汇总 |
82
81
  | 用户价值 | `user_value` | LTV (N日贡献) |
83
82
  | 鲸鱼用户 | `whale_user` | 高付费用户排行 |
84
83
  | 生命周期 | `life_cycle` | 付费转化率/金额/累计 |
85
84
  | 广告变现 | `ad_monet` | 广告收入数据 |
86
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapdb/tapdb-data-analysis",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "TapDB 游戏数据分析 AI Agent Skill - 查询和分析 TapDB 中的游戏运营数据(活跃/留存/付费/来源/LTV 等)",
5
5
  "keywords": [
6
6
  "tapdb",
@@ -6,12 +6,12 @@ description: >
6
6
  玩家行为、广告变现等指标。支持国内和海外两套数据源。
7
7
  当用户需要查询游戏数据、分析运营指标、对比项目表现、检测数据异常、生成数据报告时使用此技能。
8
8
  触发关键词:TapDB、DAU、MAU、留存、付费、收入、ARPU、LTV、活跃、新增、来源、玩家行为、
9
- 版本分布、鲸鱼用户、广告变现、运营概览、游戏数据分析。
9
+ 版本分布、鲸鱼用户、广告变现、游戏数据分析。
10
10
  ---
11
11
 
12
12
  # TapDB 数据分析
13
13
 
14
- > Skill 版本:v0.1.24
14
+ > Skill 版本:v0.1.25
15
15
 
16
16
  通过 Python 脚本调用 TapDB 运营数据查询接口,获取游戏的活跃、留存、付费、来源等指标数据并分析。
17
17
 
@@ -145,7 +145,6 @@ python3 <SKILL_DIR>/scripts/tapdb_query.py life_cycle -p 2588 -s 2026-02-01 -e 2
145
145
  python3 <SKILL_DIR>/scripts/tapdb_query.py whale_user -p 2588 -s 2026-01-01 -e 2026-02-25
146
146
  python3 <SKILL_DIR>/scripts/tapdb_query.py version_distri -p 2588 -s 2026-02-01 -e 2026-02-25
147
147
  python3 <SKILL_DIR>/scripts/tapdb_query.py player_behavior -p 2588 -s 2026-02-01 -e 2026-02-25 -g time
148
- python3 <SKILL_DIR>/scripts/tapdb_query.py overview -p 2588 --app-id abc123 -s 2026-02-01 -e 2026-02-25
149
148
  python3 <SKILL_DIR>/scripts/tapdb_query.py raw /op/active '{"project_id":2588,"start_time":"2026-02-01 00:00:00.000","end_time":"2026-02-25 23:59:59.999","subject":"device","quota":"dau","group":{"col_name":"time","col_alias":"date","is_time":true,"trunc_unit":"day"},"is_de_water":false,"filters":[]}'
150
149
  ```
151
150
 
@@ -159,7 +158,6 @@ python3 <SKILL_DIR>/scripts/tapdb_query.py raw /op/active '{"project_id":2588,"s
159
158
  | `source` | 来源/新增 | 通用参数 | `activation_time` |
160
159
  | `player_behavior` | 玩家行为 | `--quota behavior\|duration` | `time` |
161
160
  | `version_distri` | 版本分布 | 通用参数 | 按版本分组 |
162
- | `overview` | 运营概览 | `--app-id`, `--interval`, `--quota income\|active\|activation` | 独立接口 |
163
161
  | `user_value` | LTV | 通用参数 | `activation_time` |
164
162
  | `whale_user` | 鲸鱼用户 | 通用参数 | 无分组 |
165
163
  | `life_cycle` | 生命周期 | `--quota payment_amount\|payment_cvs_rate\|payment_cvs\|acc_payment` | `activation_time` |
@@ -46,6 +46,13 @@ def get_config(region):
46
46
 
47
47
  def http_request(method, url, headers, body=None):
48
48
  try:
49
+ headers = dict(headers or {})
50
+ if not any(k.lower() == "user-agent" for k in headers):
51
+ headers["User-Agent"] = (
52
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
53
+ "AppleWebKit/537.36 (KHTML, like Gecko) "
54
+ "Chrome/122.0.0.0 Safari/537.36"
55
+ )
49
56
  data = json.dumps(body).encode("utf-8") if body else None
50
57
  req = urllib.request.Request(url, data=data, headers=headers, method=method)
51
58
  if data:
@@ -433,11 +440,6 @@ ENDPOINT_CAPS = {
433
440
  "description": "版本分布: 各版本活跃/新增设备数(专用接口,忽略 group 参数,固定按版本分组)",
434
441
  "returned_metrics": ["version", "allDevices", "newDevices", "upgradeDevices", "activeDevices", "NUDevices"],
435
442
  },
436
- "overview": {
437
- "description": "运营概览: 收入/活跃/新增汇总(需 app_id,独立接口不走通用分组)",
438
- "quotas": ["income", "active", "activation"],
439
- "extra_params": ["app_id (必需)", "interval (minute|hour|day|week|month)"],
440
- },
441
443
  "user_value": {
442
444
  "description": "用户价值(LTV): N日贡献",
443
445
  "returned_metrics": ["activation", "N_LTV (1-60,90,120,150,180,210,240,270,300,330,360)"],
@@ -657,24 +659,6 @@ def cmd_player_behavior(args):
657
659
  def cmd_version_distri(args):
658
660
  do_query(args, "version_distri")
659
661
 
660
-
661
- def cmd_overview(args):
662
- key, base_url = get_config(args.region)
663
- body = {
664
- "project_id": int(args.project_id),
665
- "app_id": args.app_id,
666
- "start_date": args.start,
667
- "end_date": args.end,
668
- "interval": args.interval,
669
- "quota": args.quota,
670
- "use_cache": not getattr(args, "no_cache", False),
671
- }
672
- result = http_request("POST", f"{base_url}/mcp/op/op_overview", {"MCP-KEY": key}, body)
673
- if not getattr(args, "no_truncate", False):
674
- result = truncate_response(result, "overview")
675
- output(result)
676
-
677
-
678
662
  def cmd_user_value(args):
679
663
  do_query(args, "user_value")
680
664
 
@@ -773,18 +757,6 @@ def main():
773
757
  p = sub.add_parser("version_distri", help="版本分布: 各版本活跃设备数")
774
758
  add_common_args(p)
775
759
 
776
- # overview
777
- p = sub.add_parser("overview", help="运营概览: 收入/活跃/新增汇总")
778
- p.add_argument("-p", "--project-id", required=True, help="项目ID")
779
- p.add_argument("--app-id", required=True, help="应用ID (从 list_projects 获取)")
780
- p.add_argument("-s", "--start", required=True, help="开始日期")
781
- p.add_argument("-e", "--end", required=True, help="结束日期")
782
- p.add_argument("--interval", default="day", choices=["minute", "hour", "day", "week", "month"],
783
- help="时间粒度 (默认 day)")
784
- p.add_argument("--quota", default="income", choices=["income", "active", "activation"],
785
- help="概览类型 (默认 income)")
786
- p.add_argument("--no-cache", action="store_true")
787
-
788
760
  # user_value (LTV)
789
761
  p = sub.add_parser("user_value", help="用户价值(LTV): N日贡献")
790
762
  add_common_args(p)
@@ -824,7 +796,6 @@ def main():
824
796
  "source": cmd_source,
825
797
  "player_behavior": cmd_player_behavior,
826
798
  "version_distri": cmd_version_distri,
827
- "overview": cmd_overview,
828
799
  "user_value": cmd_user_value,
829
800
  "whale_user": cmd_whale_user,
830
801
  "life_cycle": cmd_life_cycle,