@qianhaoq/dsh-dota2ai 0.0.0-stage → 0.2.4

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.
Files changed (34) hide show
  1. package/LICENSE +85 -0
  2. package/README.md +166 -2
  3. package/cordis.patch.yml +6 -0
  4. package/data/constants/patches/7.40.json +1 -0
  5. package/data/constants/patches/7.40b.json +1 -0
  6. package/data/constants/patches/7.40c.json +1 -0
  7. package/data/constants/patches/7.41.2026-03-25T2120.json +1 -0
  8. package/data/constants/patches/7.41.2026-03-26T2340.json +1 -0
  9. package/data/constants/patches/7.41.2026-03-27T0300.json +1 -0
  10. package/data/constants/patches/7.41.json +1 -0
  11. package/data/constants/patches/7.41a.2026-03-30T2320.json +1 -0
  12. package/data/constants/patches/7.41a.2026-04-01T2220.json +1 -0
  13. package/data/constants/patches/7.41a.json +1 -0
  14. package/data/constants/patches/7.41b.2026-04-09T2200.json +1 -0
  15. package/data/constants/patches/7.41b.2026-04-17T2040.json +1 -0
  16. package/data/constants/patches/7.41b.json +1 -0
  17. package/data/constants/patches/7.41c.json +1 -0
  18. package/data/constants/patches/7.41d.json +1 -0
  19. package/data/constants/patches/7.41e.2026-07-31T1720.json +1 -0
  20. package/data/constants/patches/7.41e.2026-07-31T2020.json +1 -0
  21. package/data/constants/patches/7.41e.json +1 -0
  22. package/data/constants/patches/7.41f.2026-10-07T0040.json +1 -0
  23. package/data/constants/patches/7.41f.json +1 -0
  24. package/data/constants/patches/7.42.json +1 -0
  25. package/data/constants/patches/7.42a.2026-11-26T0220.json +1 -0
  26. package/data/constants/patches/7.42a.json +1 -0
  27. package/data/constants/patches/index.json +242 -0
  28. package/icon.svg +10 -0
  29. package/lib/client.js +31958 -0
  30. package/lib/index.js +26456 -0
  31. package/lib/typert.host.js +20029 -0
  32. package/lib/typert.remote-client.js +20029 -0
  33. package/package.json +73 -4
  34. package/skills/dota2ai/SKILL.md +107 -0
package/LICENSE ADDED
@@ -0,0 +1,85 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
12
+
13
+ ## Distribution License
14
+
15
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
16
+
17
+ ## Notices
18
+
19
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
20
+
21
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
22
+
23
+ ## Changes and New Works License
24
+
25
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
26
+
27
+ ## Patent License
28
+
29
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
30
+
31
+ ## Noncommercial Purposes
32
+
33
+ Any noncommercial purpose is a permitted purpose.
34
+
35
+ ## Personal Uses
36
+
37
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
38
+
39
+ ## Noncommercial Organizations
40
+
41
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
42
+
43
+ ## Fair Use
44
+
45
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
46
+
47
+ ## No Other Rights
48
+
49
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
50
+
51
+ ## Patent Defense
52
+
53
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
54
+
55
+ ## Violations
56
+
57
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
58
+
59
+ ## No Liability
60
+
61
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
62
+
63
+ ## Definitions
64
+
65
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
66
+
67
+ **You** refers to the individual or entity agreeing to these terms.
68
+
69
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
70
+
71
+ **Your licenses** are all the licenses granted to you for the software under these terms.
72
+
73
+ **Use** means anything you do with the software requiring one of your licenses.
74
+
75
+ ---
76
+
77
+ Required Notice: Copyright (c) 2026 dota2.ai contributors (https://github.com/qianhaoq/dota2.ai)
78
+
79
+ Commercial use is not licensed under these terms. For a commercial license,
80
+ contact the repository owner through https://github.com/qianhaoq/dota2.ai.
81
+
82
+ Third-party trademarks: Dota, Dota 2 and Steam are trademarks of Valve
83
+ Corporation. This project is not affiliated with, endorsed or sponsored by
84
+ Valve. Match data comes from public OpenDota / STRATZ / Steam endpoints.
85
+ See CONTRIBUTING.md for the full trademark note.
package/README.md CHANGED
@@ -1,3 +1,167 @@
1
- # Temporary Holding Version
1
+ # dota2.ai for DSH
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [简体中文](#简体中文)
4
+
5
+ A native [DSH](https://www.npmjs.com/package/@deepseek-ai/dsh) (DeepSeek Harness) plugin that brings the full
6
+ [dota2.ai](https://dota2.ai) experience into DSH:
7
+
8
+ - **Standalone `dota2.ai` page in the DSH sidebar**: home, recent games, patch advisor, and the full replay review page (10-player scoreboard, clickable replay evidence cards, 10-hero minimap moment replay, coach chat rail, and next-game habit tracking).
9
+ - **Powered by your DSH host models (`ctx.llm`)**: deep replay investigations (`runDeepReview` + `verifyReview`), follow-up chat (`runChat` + `verifyText`) and the patch advisor all run locally using the models you configured in DSH — defaulting to your selected DSH model, with an in-page switcher to compare any model in your DSH profile on the same match.
10
+ - **Session tools, skill & clickable chat cards**: seven `dota2ai_*` tools and a `dota2ai` skill sharing the same local `$DSH_HOME/dota2ai` trace/review cache, with chat cards that open the match page in one click.
11
+
12
+ ## Install
13
+
14
+ ### Desktop App (Recommended — no terminal needed)
15
+
16
+ 1. Download and install the **DeepSeek Harness** desktop app (macOS / Windows) from **[https://www.deepseek.com/harness/](https://www.deepseek.com/harness/)**, open it, and enter your DeepSeek API Key.
17
+ 2. Paste this one sentence into a chat in DeepSeek Harness and press Enter:
18
+
19
+ ```text
20
+ Install the dota2.ai Dota 2 replay coach plugin @qianhaoq/dsh-dota2ai into my active desktop profile, then tell me how to open dota2.ai in the left sidebar.
21
+ ```
22
+
23
+ 3. Reload if prompted, then click **dota2.ai** in the left sidebar.
24
+
25
+ ### Update
26
+
27
+ - **Desktop App**: paste into a chat in DeepSeek Harness and press Enter:
28
+
29
+ ```text
30
+ Update my @qianhaoq/dsh-dota2ai plugin to the latest version and reload if needed.
31
+ ```
32
+
33
+ - **CLI (`dsh web`)**:
34
+
35
+ ```sh
36
+ dsh plugin --profile web update @qianhaoq/dsh-dota2ai
37
+ ```
38
+
39
+ ### CLI / Linux (`dsh web`)
40
+
41
+ Needs Node 24.9 or newer and DSH **0.2.x (≥ 0.2.1-rc.3)**: verified on 0.2.1-rc.3 and 0.2.2-rc.5, which is
42
+ npm's `latest`. DSH installs plugins with pnpm, so pnpm must be on your PATH.
43
+
44
+ ```sh
45
+ npm install -g pnpm @deepseek-ai/dsh@0.2.2-rc.5
46
+ dsh plugin --profile web add @qianhaoq/dsh-dota2ai
47
+ DEEPSEEK_API_KEY=sk-... dsh web # or start plain `dsh web` and enter the key in DSH's own API-key dialog
48
+ ```
49
+
50
+ Then open **dota2.ai** in the DSH sidebar, paste a match ID and pick your hero. The review runs on your own
51
+ DeepSeek key, so it has no queue and no daily limit. A deep review is a few hundred thousand input tokens.
52
+ To check the download, fetch `SHA256SUMS` from the same
53
+ [release](https://github.com/qianhaoq/dota2.ai/releases) and run `sha256sum -c SHA256SUMS`.
54
+
55
+ One archive serves Linux, macOS and Windows: there is no native code. Parsed replay traces (~250 KB gzipped) are fetched from `dota2.ai` (or built locally when `extractorBin` is set) and cached under `$DSH_HOME/dota2ai/traces/`. Reviews, chats and your goal stay on your machine under `$DSH_HOME/dota2ai`. The public `dota2.ai/r/<match>` page does not show them.
56
+
57
+ ### Web site, DSH or an agent?
58
+
59
+ | | dota2.ai web | DSH plugin | Agent over MCP |
60
+ |---|---|---|---|
61
+ | Model that writes the review | dota2.ai's | **yours** (any model in your DSH) | dota2.ai's (`replay_review`) |
62
+ | Limits | per caller, and a daily limit for the whole site | none of ours | same as web |
63
+ | Where the review is kept | dota2.ai | your machine | dota2.ai |
64
+
65
+ ### Troubleshooting
66
+
67
+ - **`installation rejected … incompatible with dsh`**: your DSH is outside the range above. Install a
68
+ DSH from the range (`npm install -g @deepseek-ai/dsh@0.2.2-rc.5`) or a newer plugin release.
69
+ - **`pnpm` not found / plugin command failed**: `npm install -g pnpm`, then run `dsh plugin … add` again.
70
+ - **The panel says no model / the tool answers `model_not_configured`**: DSH has no model with a key yet. Start
71
+ `dsh web` with `DEEPSEEK_API_KEY` set, or enter the key in DSH's API-key dialog, and pick a model.
72
+ - **No dota2.ai entry in the sidebar, or no tools**: the profile's `package.json` must list the package in
73
+ `dependencies` *and* in `dsh.profile.bundles`, and `dsh --profile web --dump-config` should list a `dota2ai`
74
+ entry. In GUI profiles (`dsh web` and Desktop), DSH's `typert-loader` loads `./typert` and `Dota2AiRemote`
75
+ attaches to `ctx.typert`. In headless CLI profiles without `typert`, the seven `dota2ai_*` tools and the `dota2ai`
76
+ skill still activate.
77
+
78
+ ## Tools
79
+
80
+ | Tool | What it does |
81
+ |---|---|
82
+ | `dota2ai_replay_review` | Deep replay review investigated locally by your DSH model and checked against the replay (`verifyReview`). Never blocks: `parsing` / `reviewing` mean call again after `poll_after_sec`; `pick_hero` means ask the user; `ready` has the verdict, checked findings, rules for next game, and blind spots |
83
+ | `dota2ai_recent_matches` | A player's recent public games (`account`: Steam friend code or profile link) |
84
+ | `dota2ai_coach_report` | Without `hero`: the roster. With it: `section` `summary` · `why` · `lane` · `deaths` · `items` · `fights` · `plan` · `all` |
85
+ | `dota2ai_coach_cases` | Pro games on the same problem: one that avoided it, one that repeated it |
86
+ | `dota2ai_coach_ask` | A follow-up question, answered locally by your DSH model (with replay lookup tools when a trace is cached, else from the report) |
87
+ | `dota2ai_goal_check` | Judge a later game against a finding's `goal` (or the active goal saved in `$DSH_HOME/dota2ai/profile.json`) |
88
+ | `dota2ai_hero_matchup` | Hero vs hero from pro games; `by_rank` from STRATZ (credit STRATZ when quoting it) |
89
+
90
+ ## Settings
91
+
92
+ In the profile's `cordis.patch.yml`, under the `dota2ai` entry:
93
+
94
+ | Field | Default | Meaning |
95
+ |---|---|---|
96
+ | `enabled` | `true` | Enable the UI panel and register the tools |
97
+ | `lang` | `en` | Default answer language when a tool call names none (`en` or `zh`) |
98
+ | `apiBase` | `https://dota2.ai` | dota2.ai origin for match data and parsed replay traces |
99
+ | `skillEnabled` | `true` | Register the `dota2ai` skill |
100
+ | `homeDir` | `""` | Custom local storage directory (defaults to `$DSH_HOME/dota2ai` or `~/.dsh/dota2ai`) |
101
+ | `extractorBin` | `""` | Optional local `dota-extract` binary path for offline replay parsing |
102
+
103
+ ## Develop
104
+
105
+ ```sh
106
+ npx vitest run packages/dsh # host LLM bridge, trace pipeline, local service, UI panel & bundle
107
+ node packages/dsh/scripts/pack.mjs # dist/qianhaoq-dsh-dota2ai-<version>.tgz + SHA256SUMS
108
+ node packages/dsh/scripts/installed-smoke.mjs packages/dsh/dist/*.tgz \
109
+ --dsh <dir>/node_modules/@deepseek-ai/dsh/lib/bin.js [--browser]
110
+ # a real review on a real model through a real `dsh web` (spends the key's account; see the script's header)
111
+ DEEPSEEK_API_KEY=… node packages/dsh/scripts/live-review.mjs packages/dsh/dist/*.tgz \
112
+ --dsh <dir>/node_modules/@deepseek-ai/dsh/lib/bin.js [--lang zh] [--browser <screenshot dir>]
113
+ ```
114
+
115
+ ---
116
+
117
+ ## 简体中文
118
+
119
+ 原生 [DSH](https://www.npmjs.com/package/@deepseek-ai/dsh)(DeepSeek Harness)插件,在 DSH 内完整复刻 [dota2.ai](https://dota2.ai) 页面并直接使用 DSH 宿主模型:
120
+
121
+ - **左侧栏独立 `dota2.ai` 页面**:包含首页选局、玩家近期比赛、版本顾问与完整复盘页(10 人记分板、可展开录像原始证据卡、10 英雄逐秒走位与眼位小地图回放、右侧流式追问栏、下局训练目标追踪)。
122
+ - **由你的 DSH 宿主模型驱动(`ctx.llm`)**:录像深度调查复盘(`runDeepReview` + `verifyReview` 事实核查)、录像查证追问(`runChat` + `verifyText`)与版本顾问均在本机调用你在 DSH 配置的模型——默认跟随 DSH 当前模型,同时保留页面内模型切换器,支持同一局用不同模型对比复盘。
123
+ - **会话工具与卡片联动**:7 个 `dota2ai_*` 工具与独立页面共享本地 `$DSH_HOME/dota2ai` 缓存,聊天内的工具卡片可一键跳转到对应复盘页。
124
+
125
+ **桌面客户端傻瓜式安装(推荐,免命令行)**:
126
+
127
+ 1. 前往 **[https://www.deepseek.com/harness/](https://www.deepseek.com/harness/)** 下载并安装 DeepSeek Harness 桌面客户端(macOS / Windows),打开后填入你的 DeepSeek API Key。
128
+ 2. 直接把下面这句话粘贴到桌面客户端的聊天框发送:
129
+
130
+ ```text
131
+ 帮我安装 dota2.ai 的 Dota 2 复盘插件 @qianhaoq/dsh-dota2ai 到当前桌面端 profile,装好后告诉我怎么在左侧栏打开 dota2.ai。
132
+ ```
133
+
134
+ 3. 按提示刷新或重启后,点左侧栏 **dota2.ai** 即可使用。
135
+
136
+ **更新插件**:
137
+
138
+ - **桌面客户端**:直接把下面这句话粘贴到聊天框发送:
139
+
140
+ ```text
141
+ 帮我把 @qianhaoq/dsh-dota2ai 插件更新到最新版本,如需刷新或重启请提示我。
142
+ ```
143
+
144
+ - **命令行(`dsh web`)**:
145
+
146
+ ```sh
147
+ dsh plugin --profile web update @qianhaoq/dsh-dota2ai
148
+ ```
149
+
150
+ **命令行安装(Linux / `dsh web`)**(需要 Node ≥ 24.9,DSH **0.2.x (≥ 0.2.1-rc.3)**,npm 上的 `latest` 是 0.2.2-rc.5;DSH 用 pnpm 装插件):
151
+
152
+ ```sh
153
+ npm install -g pnpm @deepseek-ai/dsh@0.2.2-rc.5
154
+ dsh plugin --profile web add @qianhaoq/dsh-dota2ai
155
+ DEEPSEEK_API_KEY=sk-... dsh web # 或者直接 dsh web,在 DSH 弹出的 API Key 窗口里填
156
+ ```
157
+
158
+ 然后在 DSH 左侧栏打开 **dota2.ai**,贴比赛 ID、选英雄即可。复盘用的是你自己的 DeepSeek Key:不排队、不限次(一次深度复盘大约几十万输入 token)。复盘、追问和训练目标都保存在你自己电脑的 `$DSH_HOME/dota2ai` 下,公开的 `dota2.ai/r/<比赛>` 页面看不到它们。
159
+
160
+ **常见问题**
161
+
162
+ - **`installation rejected … incompatible with dsh`**:你的 DSH 版本不在上面的范围内。装范围内的版本(`npm install -g @deepseek-ai/dsh@0.2.2-rc.5`),或者换更新的插件版本。
163
+ - **找不到 `pnpm` / plugin command failed**:先 `npm install -g pnpm`,再重新执行 `dsh plugin … add`。
164
+ - **页面提示没有模型 / 工具返回 `model_not_configured`**:DSH 里还没有可用的模型。启动 `dsh web` 时带上 `DEEPSEEK_API_KEY`,或者在 DSH 的 API Key 窗口里填写,然后选一个模型。
165
+ - **左侧栏没有 dota2.ai、会话里没有工具**:profile 的 `package.json` 需要同时在 `dependencies` 和 `dsh.profile.bundles` 里列出本插件,`dsh --profile web --dump-config` 里应能看到 `dota2ai`。
166
+
167
+ 同一个包适用于 Linux、macOS 和 Windows(无原生编译二进制)。配置项(`cordis.patch.yml` 下 `dota2ai`):`enabled`、`lang`、`apiBase`、`skillEnabled`、`homeDir`、`extractorBin`。
@@ -0,0 +1,6 @@
1
+ - insert:
2
+ - id: dota2ai
3
+ name: '@qianhaoq/dsh-dota2ai'
4
+ config:
5
+ enabled: true
6
+ lang: en