aram-mayhem-dsh 0.4.1 → 0.4.3
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/INSTALL.zh-CN.txt +1 -1
- package/README.md +2 -2
- package/client.js +6 -2
- package/index.js +10 -0
- package/package.json +1 -1
- package/scripts/desktop_overlay.py +18 -5
- package/scripts/dsh_service.py +1 -1
package/INSTALL.zh-CN.txt
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
--------
|
|
33
33
|
- 服务不会自动启动。打开「海斗助手」页面,先点右上角 **「服务 开」**;
|
|
34
34
|
不用时点 **「服务 关」**,Python 进程会立即停止。
|
|
35
|
-
-
|
|
35
|
+
- 启动服务后会自动显示桌面图标;不需要时点「桌面图标 关」;服务关闭时图标会一并停止。
|
|
36
36
|
- 点击图标展开:英雄 / 推荐海克斯 / 出装;点「收起」、按 Esc 或点击游戏
|
|
37
37
|
会自动缩回右侧小图标。
|
|
38
38
|
- 游戏内必须使用「无边框」或「窗口化」。独占全屏会遮挡图标和 OCR。
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
把《英雄联盟》**海克斯大乱斗**(ARAM: Mayhem)的选人、推荐海克斯和出装数据搬进 DeepSeek Harness。
|
|
9
9
|
|
|
10
|
-
-
|
|
10
|
+
- **屏幕置顶小图标**:点击页面 **「服务 开」** 启动服务时会一并显示;也可用 **「桌面图标 开/关」** 单独关闭/重开。点击图标展开英雄、推荐海克斯和出装。窗口置顶、可拖动、记住位置。
|
|
11
11
|
- **DSH 侧边栏页面**:完整的「海斗助手」页面(选人 / 推荐海克斯 / 出装),右上角有 **「服务 开/关」** 和 **「桌面图标 开/关」** 两个独立开关。
|
|
12
12
|
- **九个 `aram_*` 工具**:让模型查询英雄胜率、海克斯推荐分、出装、当前 LCU 状态,并启动/停止服务、打开/关闭桌面图标。
|
|
13
13
|
- **本地 Python 服务**:复用统计、LCU、OCR 模块,不依赖 Qt 的页面通过 DSH Host 的 `/aram-api` 同源代理访问;桌面图标直接访问本地服务。**服务不会自动启动**,关闭后释放 Python 进程。
|
|
@@ -37,7 +37,7 @@ python -m pip install -r requirements-dsh.txt
|
|
|
37
37
|
也可以直接运行 `.\install.ps1`(完整依赖),或 `.\install.ps1 -Minimal`(只装图标/页面/LCU,不装 OCR);不熟悉 PowerShell 的话双击 `install.bat` 即可。桌面图标需要 **PySide6**(已包含在依赖中)。然后在 DSH 的 **Plugins** 里用 **Add plugin** 安装本目录(或由 Agent 用 `plugin_manager install_bundle` 安装)。安装后:
|
|
38
38
|
|
|
39
39
|
1. 打开侧边栏「海斗助手」页面,点击右上角 **「服务 开」**;服务不会随插件自动启动;
|
|
40
|
-
2.
|
|
40
|
+
2. 启动服务后会自动显示桌面图标;不需要时点 **「桌面图标 关」**,点图标展开,点「收起」或按 `Esc` 缩回;
|
|
41
41
|
3. 不用时点 **「服务 关」**,Python 服务会立即停止;桌面图标也会一并关闭;
|
|
42
42
|
4. 新开会话后,模型即可使用 `aram_*` 工具;工具需要服务处于开启状态,也可以让 Agent 调用 `aram_service start`。
|
|
43
43
|
|
package/client.js
CHANGED
|
@@ -627,6 +627,10 @@ window.__ModuleLoader__.load({
|
|
|
627
627
|
if (data.running) throw new Error(data.error || '服务关闭失败')
|
|
628
628
|
} else if (data.running || data.starting) {
|
|
629
629
|
setServiceOn(true)
|
|
630
|
+
try {
|
|
631
|
+
const overlay = await get('/overlay/status', 4000)
|
|
632
|
+
setOverlayOn(!!overlay.running)
|
|
633
|
+
} catch { /* status poll will catch up */ }
|
|
630
634
|
} else {
|
|
631
635
|
throw new Error(data.error || '服务启动失败')
|
|
632
636
|
}
|
|
@@ -727,8 +731,8 @@ window.__ModuleLoader__.load({
|
|
|
727
731
|
onClick: toggleService,
|
|
728
732
|
}, serviceBusy ? '启动中…' : '启动服务')),
|
|
729
733
|
serviceError ? h('div', { style: { ...S.error, marginTop: 10 } }, serviceError) : null,
|
|
730
|
-
h('div', { style: { ...S.muted,
|
|
731
|
-
'
|
|
734
|
+
h('div', { style: { ...S.muted }, 'data-testid': 'service-note' },
|
|
735
|
+
'启动服务时会一并显示桌面图标;图标可在右上角单独关闭,服务关闭时会一并停止。')),
|
|
732
736
|
h('div', { style: S.muted },
|
|
733
737
|
'数据依赖本地 Python 服务(127.0.0.1:8123)。'))
|
|
734
738
|
}
|
package/index.js
CHANGED
|
@@ -152,6 +152,16 @@ export function apply(ctx, config = {}) {
|
|
|
152
152
|
} finally {
|
|
153
153
|
starting = null
|
|
154
154
|
}
|
|
155
|
+
// A fresh service start is an explicit user action; show the icon as well.
|
|
156
|
+
// The icon remains independently switchable, and stopService closes it.
|
|
157
|
+
try {
|
|
158
|
+
await fetch(`${base}/overlay/start`, {
|
|
159
|
+
method: 'POST',
|
|
160
|
+
headers: { 'content-type': 'application/json' },
|
|
161
|
+
body: JSON.stringify({ persist: true }),
|
|
162
|
+
signal: AbortSignal.timeout(12_000),
|
|
163
|
+
})
|
|
164
|
+
} catch { /* service is still usable without PySide6/icon */ }
|
|
155
165
|
return serviceInfo()
|
|
156
166
|
}
|
|
157
167
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aram-mayhem-dsh",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ARAM: Mayhem companion for DSH: an on-demand local service, screen-top desktop icon, sidebar page with LCU state, champion/augment statistics, builds and screen OCR, with nine agent tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -636,7 +636,7 @@ class FloatingOverlay(QWidget):
|
|
|
636
636
|
self._hide_timer.stop()
|
|
637
637
|
self._peeked = True
|
|
638
638
|
self._snap_icon(peek=True, animate=False)
|
|
639
|
-
self.setWindowOpacity(0.
|
|
639
|
+
self.setWindowOpacity(0.62)
|
|
640
640
|
self._raise_topmost()
|
|
641
641
|
|
|
642
642
|
def _edge_x(self, peek: bool) -> int:
|
|
@@ -645,8 +645,8 @@ class FloatingOverlay(QWidget):
|
|
|
645
645
|
return self.x()
|
|
646
646
|
area = screen.availableGeometry()
|
|
647
647
|
if peek:
|
|
648
|
-
ratio = 0.
|
|
649
|
-
visible = max(
|
|
648
|
+
ratio = 0.30
|
|
649
|
+
visible = max(24, round(self.width() * (1.0 - ratio)))
|
|
650
650
|
return area.right() - visible
|
|
651
651
|
return area.right() - self.width() + 1
|
|
652
652
|
|
|
@@ -667,7 +667,7 @@ class FloatingOverlay(QWidget):
|
|
|
667
667
|
self._peeked = peek
|
|
668
668
|
if not animate or not self.isVisible():
|
|
669
669
|
self.move(target)
|
|
670
|
-
self.setWindowOpacity(0.
|
|
670
|
+
self.setWindowOpacity(0.62 if peek else 1.0)
|
|
671
671
|
return
|
|
672
672
|
if self._icon_animation is not None:
|
|
673
673
|
self._icon_animation.stop()
|
|
@@ -680,7 +680,7 @@ class FloatingOverlay(QWidget):
|
|
|
680
680
|
fade = QPropertyAnimation(self, b"windowOpacity", group)
|
|
681
681
|
fade.setDuration(180)
|
|
682
682
|
fade.setStartValue(float(self.windowOpacity()))
|
|
683
|
-
fade.setEndValue(0.
|
|
683
|
+
fade.setEndValue(0.62 if peek else 1.0)
|
|
684
684
|
fade.setEasingCurve(QEasingCurve.Type.OutCubic)
|
|
685
685
|
group.addAnimation(move)
|
|
686
686
|
group.addAnimation(fade)
|
|
@@ -699,6 +699,17 @@ class FloatingOverlay(QWidget):
|
|
|
699
699
|
return
|
|
700
700
|
self._snap_icon(peek=True, animate=True)
|
|
701
701
|
|
|
702
|
+
def _startup_peek(self) -> None:
|
|
703
|
+
"""Show the icon fully for a moment when it first launches."""
|
|
704
|
+
if self.expanded:
|
|
705
|
+
return
|
|
706
|
+
self._snap_icon(peek=False, animate=True)
|
|
707
|
+
QTimer.singleShot(1800, self._startup_settle)
|
|
708
|
+
|
|
709
|
+
def _startup_settle(self) -> None:
|
|
710
|
+
if not self.expanded and not self.underMouse():
|
|
711
|
+
self._snap_icon(peek=True, animate=True)
|
|
712
|
+
|
|
702
713
|
def enterEvent(self, event):
|
|
703
714
|
self._hide_timer.stop()
|
|
704
715
|
if not self.expanded:
|
|
@@ -1393,6 +1404,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
1393
1404
|
persist_pref=bool(args.pid_file),
|
|
1394
1405
|
)
|
|
1395
1406
|
overlay.show()
|
|
1407
|
+
if not args.expanded:
|
|
1408
|
+
QTimer.singleShot(300, overlay._startup_peek)
|
|
1396
1409
|
if args.tab != "champ":
|
|
1397
1410
|
QTimer.singleShot(300, lambda: overlay._select_tab(args.tab))
|
|
1398
1411
|
if args.screenshot:
|
package/scripts/dsh_service.py
CHANGED
|
@@ -65,7 +65,7 @@ from src.lcu.listener import parse_champ_select, parse_queue_info
|
|
|
65
65
|
log = logging.getLogger("aram-dsh-service")
|
|
66
66
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
67
67
|
|
|
68
|
-
VERSION = "0.4.
|
|
68
|
+
VERSION = "0.4.3"
|
|
69
69
|
IN_GAME_PHASES = {"InProgress", "Reconnect"}
|
|
70
70
|
|
|
71
71
|
|