acmer-coach 1.0.0 → 1.1.0

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.
@@ -0,0 +1,29 @@
1
+ # 发布走 npm 官方正道 Trusted Publishing(OIDC 信任发布):
2
+ # 不需要 token、不需要 2FA 码 —— GitHub Actions 用工作流身份直接换取发布权限。
3
+ #
4
+ # 前置(一次性):npm 网站 → acmer-coach 包页面 → Settings → Trusted Publisher
5
+ # 绑上这个仓库(Miantiao1231/acmer-coach)+ 本文件名(publish.yml)。
6
+ #
7
+ # 之后发布两条路:
8
+ # · 打 tag 推上来(v*)→ 自动发
9
+ # · 或 Actions 页手动触一次(首次发布用这个)
10
+ name: publish
11
+
12
+ on:
13
+ push:
14
+ tags: ['v*']
15
+ workflow_dispatch:
16
+
17
+ permissions:
18
+ contents: read
19
+ id-token: write # OIDC 必须,别删
20
+
21
+ jobs:
22
+ publish:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: actions/setup-node@v4
27
+ with:
28
+ node-version: '24'
29
+ - run: npm publish --provenance --access public
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # acmer-coach · 小鲸教练
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/acmer-coach)](https://www.npmjs.com/package/acmer-coach)
4
+ [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
5
+ [![node](https://img.shields.io/badge/node-%E2%89%A524-brightgreen)](https://nodejs.org)
6
+ [![dsh](https://img.shields.io/badge/dsh-%E2%89%A50.1.1--rc.1-blueviolet)](https://github.com/deepseek-ai/deepseek-harness)
7
+
3
8
  一个给 ACMer 用的算法训练教练插件,跑在 [dsh](https://github.com/deepseek-ai/deepseek-harness) 上。
4
9
 
5
10
  **它解决的问题**:不是「不知道学什么」——那是搜一下就有答案的。
@@ -52,12 +57,15 @@ coach_schedule → coach_plan 排课
52
57
  # 1. 装 dsh(需要 Node ≥ 24)
53
58
  npm i -g @deepseek-ai/dsh
54
59
 
55
- # 2. 装插件
56
- dsh plugin --profile web add acmer-coach
60
+ # 2. 装插件(二选一)
61
+ dsh plugin --profile web add acmer-coach # 从 npm(推荐)
62
+ dsh plugin --profile web add github:Miantiao1231/acmer-coach # 或从 GitHub
57
63
 
58
64
  # 3. 重启 dsh,然后跟小鲸说「初始化」
59
65
  ```
60
66
 
67
+ > npm 上搜 `acmer-coach`,或者直接开 <https://www.npmjs.com/package/acmer-coach>。
68
+
61
69
  **初始化流程**(说话就行,不用敲命令):
62
70
 
63
71
  1. `coach_setup { action: "status" }` —— 体检,看缺什么
@@ -119,6 +127,28 @@ dsh plugin --profile web add acmer-coach
119
127
  **用不用你自己判断。** 不想担风险的话:只关注 CF(零风险),
120
128
  或者手动记几道题。详见 `assets/extension/luogu/README.md`。
121
129
 
130
+ ## 可选扩展:接上你的 Obsidian 笔记
131
+
132
+ 如果你用 Obsidian 记竞赛笔记,`assets/extension/notes/` 是一个**可选**的 dsh 插件,
133
+ 把笔记库和教练地图接起来:给一个知识点名,一次拿到「你为它写的笔记正文 +
134
+ 图上的前置 / 后继 + 你的学习进度」。
135
+
136
+ 最直接的收益在讲知识点那一步 —— 教练讲完会附一份板子,**接上笔记后,
137
+ 这份板子能对着你自己的写法来**(宏、命名、大括号、注释密度,照你的笔记全套对齐)。
138
+
139
+ 纯附加,不装不影响任何功能。装法、配置(一个必需的环境变量:你的库路径)、
140
+ 「映射怎么建」的说明都在 [`assets/extension/notes/README.md`](assets/extension/notes/README.md)。
141
+
142
+ ## 给教练接持久记忆(可选)
143
+
144
+ dsh 的会话上下文有限 —— 新开一个会话,教练不记得上次聊到哪。想让它跨会话记住你,
145
+ 可以接一个记忆服务:[**Hindsight**](https://github.com/vectorize-io/hindsight)
146
+ 是一个开源的 agent 记忆系统(MIT 许可,有云版,也可以自己 Docker 部署),
147
+ 挂上去之后每轮自动召回相关记忆、对话结束自动归档。
148
+
149
+ **本项目不带这个插件** —— 自己装 Hindsight,再写一个 dsh 插件做桥
150
+ (进对话时 recall 注入、结束时 retain 归档)即可。
151
+
122
152
  ## 文件
123
153
 
124
154
  | 文件 | 作用 |
@@ -137,7 +167,7 @@ dsh plugin --profile web add acmer-coach
137
167
  | `assets/knowledge/` | 地图与元数据 |
138
168
  | `assets/oiwiki/` | OI Wiki 本地检索库 |
139
169
  | `assets/pool/` | 随包发的题池(41,518 道,三平台)—— 见该目录下的 LICENSE(有风险说明) |
140
- | `assets/extension/` | 可选的浏览器扩展(洛谷记录导出) |
170
+ | `assets/extension/` | **可选**扩展:洛谷记录导出(浏览器扩展)+ Obsidian 笔记桥(dsh 插件) |
141
171
  | `coach/` | 地图工具链(Python)+ 指标脚本 |
142
172
 
143
173
  ### 三层
@@ -47,7 +47,7 @@
47
47
  3. 浏览器下载一个 `luogu-<uid>-<日期>.json`
48
48
  4. 把文件交给教练,说:
49
49
 
50
- > 导入这个文件:`C:\Users\你\Downloads\luogu-1855438-2026-09-29.json`
50
+ > 导入这个文件:`%USERPROFILE%\Downloads\luogu-123456-2026-01-01.json`
51
51
 
52
52
  或者直接让教练调 `coach_import`,参数 `path` 填那个路径。
53
53
 
@@ -0,0 +1,82 @@
1
+ # whale-notes
2
+
3
+ 把你的 **Obsidian 笔记库** × **教练地图** 接起来。dsh 插件,配合 [acmer-coach](../..) 使用。
4
+
5
+ ## 它解决什么
6
+
7
+ 讲一道题要的上下文散在三个地方:
8
+
9
+ | 在哪 | 是什么 |
10
+ |---|---|
11
+ | `MAP.yaml` | 这个知识点的前置、后继(依赖图) |
12
+ | `PROGRESS.yaml` | 你学到哪了 |
13
+ | 你的笔记 `.md` | 你自己怎么写的、代码长什么样 |
14
+
15
+ 没这个插件,AI 每次要三次读取 + 一次自己的目录遍历,而且**每次拼法可能不一样**。
16
+ 装了它,一次调用全拿到。
17
+
18
+ 顺带一层:教练讲新知识点时会附一份「你的风格」的板子 —— 板子的样例来源就是这里。
19
+
20
+ ## 装
21
+
22
+ 前置:acmer-coach 已经初始化过(数据目录里有 `MAP.yaml`)。
23
+
24
+ ```bash
25
+ # 1. 拿到本仓库(已有就跳过)
26
+ git clone https://github.com/Miantiao1231/acmer-coach
27
+
28
+ # 2. 装笔记插件(spec 用 file: 协议,指向这个目录)
29
+ dsh plugin --profile web add "file:<仓库路径>/assets/extension/notes"
30
+ # Windows 示例:file:C:/Users/you/acmer-coach/assets/extension/notes
31
+
32
+ # 3. 配置你的 Obsidian 库路径(必需,见下)
33
+
34
+ # 4. 重启 dsh
35
+ ```
36
+
37
+ ## 配置
38
+
39
+ | 环境变量 | 必需? | 说明 |
40
+ |---|---|---|
41
+ | `OBSIDIAN_VAULT` | **必需** | 你的 Obsidian 库根目录。**没设时工具会明确报错,不会猜一个路径** |
42
+ | `COACH_DATA_DIR` | 可选 | 教练数据目录。默认 `~/.dsh/knowledge`,跟 acmer-coach 一致 |
43
+
44
+ 设置方式(设完要重启 dsh):
45
+
46
+ ```bash
47
+ # Windows
48
+ setx OBSIDIAN_VAULT "D:\your-vault" # 设完重开终端
49
+ # macOS / Linux(写进 ~/.zshrc 或 ~/.bashrc)
50
+ export OBSIDIAN_VAULT=~/Notes
51
+ ```
52
+
53
+ ## 三个工具
54
+
55
+ | 工具 | 干什么 |
56
+ |---|---|
57
+ | `note_context` | 给知识点名(「区间 DP」)或笔记名/路径 → **笔记正文 + 图上前置和后继 + 你的进度**,一次给全 |
58
+ | `note_map_status` | 映射登记到什么程度了:哪些笔记挂上了、哪些没挂、图上哪些节点还没有笔记 |
59
+ | `note_map_set` | 把「这篇笔记讲的是图上哪些节点」落盘。节点名逐个校验,写错会被拒并给出相近候选 |
60
+
61
+ ## 映射要建,但不用一次建完
62
+
63
+ 不登记也能用 —— 笔记名和节点名对得上时(「区间 DP」 ↔ `5.区间dp.md`),
64
+ 插件自己靠归一化兜底命中。**遇到对不上的再挂**:笔记叫 `Dijkstra 单源最短路`、
65
+ 图上只有「最短路」这种,让 AI 用 `note_map_set` 挂一次,之后一直准。
66
+
67
+ 不知道自己差哪些?`note_map_status` 会报
68
+ (「登记」和「挂上图节点」分开计数 —— 登记了但节点空着的那批也会如实点出来)。
69
+
70
+ ## 只读承诺
71
+
72
+ 这个插件**只读你的笔记,从不写**。唯一会写的文件是数据目录下的
73
+ `NOTE_MAP.yaml`(插件自己的映射账本)。你的原文一个字都不动。
74
+
75
+ ## 验收
76
+
77
+ ```bash
78
+ node verify.mjs
79
+ ```
80
+
81
+ 自造 fixture 跑全链路(不碰你的真数据);如果你配了真实环境,
82
+ 会额外做一次「真账本 + 真笔记前后指纹比对」,证明跑完什么都没动。
@@ -0,0 +1,10 @@
1
+ # whale-notes bundle patch:把笔记库 × 教练地图的桥插件插入 profile 插件清单。
2
+ #
3
+ # 必须用 file: 而非 link: —— link: 的 realpath 在 ~/.dsh/profiles/ 外,
4
+ # 解析不到 profiles/node_modules/@deepseek-ai 下的共享链接。
5
+ #
6
+ # ⚠️ id 必须和 index.js 导出的 `name` 逐字相同,name 必须和**包名**相同 ——
7
+ # 对不上不会报错,工具会**静默不注册**。
8
+ - insert:
9
+ - id: whale-notes
10
+ name: 'whale-notes'