hearthstone-cli 0.2.0__tar.gz → 0.2.1__tar.gz
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.
- {hearthstone_cli-0.2.0/src/hearthstone_cli.egg-info → hearthstone_cli-0.2.1}/PKG-INFO +4 -1
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/README.md +3 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/pyproject.toml +1 -1
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli/board.py +23 -12
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli/deck.py +5 -4
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli/watch_worker.py +2 -1
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1/src/hearthstone_cli.egg-info}/PKG-INFO +4 -1
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/LICENSE +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/setup.cfg +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli/__init__.py +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli/collection.py +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli/config.py +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli.egg-info/SOURCES.txt +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli.egg-info/dependency_links.txt +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli.egg-info/entry_points.txt +0 -0
- {hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hearthstone-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Hearthstone toolbox for AI agents — deck building (validate, encode, filter, deck images, collection sync from game memory) and match analysis (board parsing from game logs, action replay, AI advisor watcher)
|
|
5
5
|
Author: OstrichHermit
|
|
6
6
|
License-Expression: MIT
|
|
@@ -117,6 +117,9 @@ hs board
|
|
|
117
117
|
hs board --log=D:\games\Hearthstone\Logs\Power.log # 指定日志路径(也可指向日志目录自动发现)
|
|
118
118
|
hs board --player=鸵鸟居士 # 自动判定我方不准时手动指定
|
|
119
119
|
|
|
120
|
+
# 日志不在标准位置时(如安装在其他盘),设环境变量后 hs board / hs watch 均自动发现:
|
|
121
|
+
# setx HS_LOG_DIR "I:\暴雪\Hearthstone\Logs" # 指向 Logs 目录即可,自动进入 Hearthstone_* 子目录取最新
|
|
122
|
+
|
|
120
123
|
# 军师监听:换牌阶段/轮到我方回合时,向 IM 桥接器 POST 提示词触发 AI 分析
|
|
121
124
|
# 先编辑 ~/.hearthstone-cli/config.json 配好 watch 节(channel_id/url/token 等),再启动
|
|
122
125
|
hs watch start # 配置好 config.json 的 watch 节后启动
|
|
@@ -92,6 +92,9 @@ hs board
|
|
|
92
92
|
hs board --log=D:\games\Hearthstone\Logs\Power.log # 指定日志路径(也可指向日志目录自动发现)
|
|
93
93
|
hs board --player=鸵鸟居士 # 自动判定我方不准时手动指定
|
|
94
94
|
|
|
95
|
+
# 日志不在标准位置时(如安装在其他盘),设环境变量后 hs board / hs watch 均自动发现:
|
|
96
|
+
# setx HS_LOG_DIR "I:\暴雪\Hearthstone\Logs" # 指向 Logs 目录即可,自动进入 Hearthstone_* 子目录取最新
|
|
97
|
+
|
|
95
98
|
# 军师监听:换牌阶段/轮到我方回合时,向 IM 桥接器 POST 提示词触发 AI 分析
|
|
96
99
|
# 先编辑 ~/.hearthstone-cli/config.json 配好 watch 节(channel_id/url/token 等),再启动
|
|
97
100
|
hs watch start # 配置好 config.json 的 watch 节后启动
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hearthstone-cli"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "Hearthstone toolbox for AI agents — deck building (validate, encode, filter, deck images, collection sync from game memory) and match analysis (board parsing from game logs, action replay, AI advisor watcher)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""hs board — 解析炉石客户端日志 Power.log, 输出当前对局面板 (供 AI 军师读取)
|
|
2
2
|
|
|
3
3
|
用法:
|
|
4
|
-
hs board
|
|
5
|
-
hs board --log=D:\\path\\Power.log
|
|
4
|
+
hs board 自动发现最新日志 (Logs 下直接存在或 Hearthstone_<时间戳> 子目录, 取最新)
|
|
5
|
+
hs board --log=D:\\path\\Power.log 指定日志文件
|
|
6
|
+
hs board --log=D:\\path\\Logs 指定日志目录 (自动发现其中最新)
|
|
6
7
|
hs board --stdin 从 stdin 读日志 (方便测试)
|
|
7
8
|
hs board --player=鸵鸟居士 手动指定我方玩家名 (默认自动判定)
|
|
8
9
|
hs board --turns=N 行动回顾带最近 N 个回合 (默认 3, N=0 完全不输出)
|
|
@@ -18,15 +19,20 @@ import re
|
|
|
18
19
|
import sys
|
|
19
20
|
from pathlib import Path
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
def _localappdata():
|
|
23
|
+
return Path(os.environ.get("LOCALAPPDATA") or Path.home() / "AppData" / "Local")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
DEFAULT_LOG = _localappdata() / "Blizzard" / "Hearthstone" / "Logs" / "Power.log"
|
|
27
|
+
# 日志根目录候选 (按序扫描, 取最新): HS_LOG_DIR 环境变量 (日志不在标准位置时配置,
|
|
28
|
+
# 如 I:\暴雪\Hearthstone\Logs), E:\Hearthstone\Logs, 标准位置 %LOCALAPPDATA%\Blizzard\Hearthstone\Logs。
|
|
29
|
+
# 炉石每次启动会在 Logs 下生成 Hearthstone_<时间戳> 子目录, find_latest_power 会自动进入子目录找 Power.log
|
|
30
|
+
_HS_LOG_DIR = os.environ.get("HS_LOG_DIR", "").strip()
|
|
31
|
+
DEFAULT_LOG_DIRS = [d for d in [
|
|
32
|
+
Path(_HS_LOG_DIR).expanduser() if _HS_LOG_DIR else None,
|
|
26
33
|
Path(r"E:\Hearthstone\Logs"),
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
]
|
|
34
|
+
_localappdata() / "Blizzard" / "Hearthstone" / "Logs",
|
|
35
|
+
] if d is not None]
|
|
30
36
|
|
|
31
37
|
|
|
32
38
|
def find_latest_power(base_dir=None):
|
|
@@ -2306,10 +2312,15 @@ def cmd_board(args):
|
|
|
2306
2312
|
if use_stdin:
|
|
2307
2313
|
lines = sys.stdin.buffer.read().decode("utf-8", "replace").splitlines()
|
|
2308
2314
|
else:
|
|
2309
|
-
p = Path(log_path) if log_path else
|
|
2315
|
+
p = Path(log_path).expanduser() if log_path else None
|
|
2316
|
+
if p is not None and p.is_dir(): # --log 指向日志目录: 在其中自动发现最新 Power.log
|
|
2317
|
+
p = find_latest_power(p)
|
|
2318
|
+
elif p is None:
|
|
2319
|
+
p = find_latest_power()
|
|
2310
2320
|
if not p or not p.is_file():
|
|
2311
2321
|
sys.exit(f"未找到 Power.log (已扫描候选目录: {'; '.join(str(d) for d in DEFAULT_LOG_DIRS)})"
|
|
2312
|
-
f"\n
|
|
2322
|
+
f"\n日志不在标准位置时可设环境变量 HS_LOG_DIR 指向日志目录 (如 I:\\暴雪\\Hearthstone\\Logs),"
|
|
2323
|
+
f" 或 --log=路径/目录 指定, 或 --stdin 从管道读入")
|
|
2313
2324
|
lines = p.read_text(encoding="utf-8", errors="replace").splitlines()
|
|
2314
2325
|
|
|
2315
2326
|
game, start_line, total = parse_power_log(lines)
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
生成卡组长图 PNG (本地 Chrome/Edge 无头渲染)
|
|
15
15
|
标准卡组含非标准池卡时拦截不出图 (--force 强制渲染)
|
|
16
16
|
默认同名卡不合并逐张列出, --merge 则合并同名卡
|
|
17
|
-
board [--log=Power.log
|
|
17
|
+
board [--log=Power.log路径或日志目录] [--stdin] [--player=玩家名]
|
|
18
18
|
解析炉石客户端日志 Power.log, 输出当前对局面板 (供 AI 军师分析)
|
|
19
|
-
|
|
19
|
+
默认自动发现最新日志 (候选目录见 --log 缺省报错提示, 支持
|
|
20
|
+
Hearthstone_<时间戳> 子目录; 日志不在标准位置可设环境变量 HS_LOG_DIR),
|
|
21
|
+
--log 可指定文件或目录, --stdin 从管道读
|
|
20
22
|
watch start [--config=路径] [--force]
|
|
21
23
|
启动军师监听守护进程 (tail Power.log, 换牌/我方回合时 POST 提示词到 IM 桥接器;
|
|
22
24
|
配置在 ~/.hearthstone-cli/config.json 的 watch 节, 编辑文件后 start 生效)
|
|
@@ -71,7 +73,6 @@ IMAGES_DIR = BASE / "image"
|
|
|
71
73
|
CARD_TYPES = {"MINION", "SPELL", "WEAPON", "LOCATION", "HERO"}
|
|
72
74
|
|
|
73
75
|
# 标准池白名单 (迅猛龙年2025.4起): 2027年春退环境
|
|
74
|
-
# 10.21 上线"黑暗帝国"后需新增对应 set 代码
|
|
75
76
|
STANDARD_SETS = {
|
|
76
77
|
"CORE", # 核心系列 (轮换子集)
|
|
77
78
|
"EMERALD_DREAM", # 翡翠梦境 2025
|
|
@@ -79,7 +80,7 @@ STANDARD_SETS = {
|
|
|
79
80
|
"TIME_TRAVEL", # 穿越时间流 2026上半年
|
|
80
81
|
"CATACLYSM", # 大地的裂变 2026上半年
|
|
81
82
|
"ESCAPEFROM_VIOLET_HOLD", # 逃离紫罗兰监狱 2026下半年
|
|
82
|
-
"BE", #
|
|
83
|
+
"BE", # 黑暗帝国的统治 2026.10.21 (预发布4传说+正片135张)
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
# 特殊构筑规则卡 dbfId
|
|
@@ -40,7 +40,8 @@ USAGE = """用法: hs watch start [--config=路径] [--force]
|
|
|
40
40
|
|
|
41
41
|
配置: 编辑 ~/.hearthstone-cli/config.json 的 watch 节
|
|
42
42
|
(channel_id/url/token/log/mulligan_prompt/turn_prompt), 编辑后 start 生效。
|
|
43
|
-
--log 支持三种: "auto"(默认, 自动发现最新 Hearthstone_*/Power.log)、日志目录、具体 Power.log
|
|
43
|
+
--log 支持三种: "auto"(默认, 自动发现最新 Hearthstone_*/Power.log)、日志目录、具体 Power.log 文件路径;
|
|
44
|
+
auto 模式扫描候选目录 (HS_LOG_DIR 环境变量优先, 其余见 board 报错提示), 日志不在标准位置时设 HS_LOG_DIR 即可。
|
|
44
45
|
监听炉石 Power.log, 检测到换牌阶段/轮到我方回合时向 IM 桥接器 POST 提示词触发军师分析。
|
|
45
46
|
token 也可用环境变量 HS_WATCH_TOKEN; 同目录生成 watch.log(运行日志) 与 watch.pid。"""
|
|
46
47
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hearthstone-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Hearthstone toolbox for AI agents — deck building (validate, encode, filter, deck images, collection sync from game memory) and match analysis (board parsing from game logs, action replay, AI advisor watcher)
|
|
5
5
|
Author: OstrichHermit
|
|
6
6
|
License-Expression: MIT
|
|
@@ -117,6 +117,9 @@ hs board
|
|
|
117
117
|
hs board --log=D:\games\Hearthstone\Logs\Power.log # 指定日志路径(也可指向日志目录自动发现)
|
|
118
118
|
hs board --player=鸵鸟居士 # 自动判定我方不准时手动指定
|
|
119
119
|
|
|
120
|
+
# 日志不在标准位置时(如安装在其他盘),设环境变量后 hs board / hs watch 均自动发现:
|
|
121
|
+
# setx HS_LOG_DIR "I:\暴雪\Hearthstone\Logs" # 指向 Logs 目录即可,自动进入 Hearthstone_* 子目录取最新
|
|
122
|
+
|
|
120
123
|
# 军师监听:换牌阶段/轮到我方回合时,向 IM 桥接器 POST 提示词触发 AI 分析
|
|
121
124
|
# 先编辑 ~/.hearthstone-cli/config.json 配好 watch 节(channel_id/url/token 等),再启动
|
|
122
125
|
hs watch start # 配置好 config.json 的 watch 节后启动
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{hearthstone_cli-0.2.0 → hearthstone_cli-0.2.1}/src/hearthstone_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|