dsh-meeting-notes-check 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +68 -2
- package/bin/cli.js +26 -0
- package/cordis.patch.yml +4 -0
- package/package.json +45 -4
- package/src/index.js +124 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zjukop3
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-meeting-notes-check
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Meeting-note hygiene from markdown. A note is decidable: it must say **when** the meeting happened, **who** was in the room, **what was decided**, and every action item must carry **an owner and a deadline**. This verifies exactly those and names the line that is missing whom.
|
|
4
|
+
|
|
5
|
+
<!-- example:start -->
|
|
6
|
+
## 真实输入输出
|
|
7
|
+
|
|
8
|
+
输入:
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
# 项目周会
|
|
12
|
+
|
|
13
|
+
- 日期:2026-11-15
|
|
14
|
+
- 与会人:张三、李四、王五
|
|
15
|
+
|
|
16
|
+
## 议程
|
|
17
|
+
|
|
18
|
+
1. 讨论登录页改版
|
|
19
|
+
2. 评审导出性能
|
|
20
|
+
|
|
21
|
+
## 行动项
|
|
22
|
+
|
|
23
|
+
- [ ] 登录页模板替换
|
|
24
|
+
- [ ] 导出性能基线测试 负责人:李四
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
真实运行(逐字输出,由测试与工具保持同步):
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
$ meeting-notes-check meeting-sample.md
|
|
31
|
+
error action-no-owner 第13行 第 13 行行动项没有负责人(认得:负责人:…、@名字、X 负责):「- [ ] 登录页模板替换…」
|
|
32
|
+
error action-no-deadline 第13行 第 13 行行动项没有截止时间(认得:11月20日前、2026-11-20、下周三)
|
|
33
|
+
error action-no-deadline 第14行 第 14 行行动项没有截止时间(认得:11月20日前、2026-11-20、下周三)
|
|
34
|
+
warn decisions-missing 第0行 没有记录任何决定/决议/结论——如果这次会议真的没有决定,忽略这条
|
|
35
|
+
fail: 2 action items, 3 errors, 1 warnings
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
出口码:1。
|
|
39
|
+
<!-- example:start -->
|
|
40
|
+
|
|
41
|
+
Listed in [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin).
|
|
42
|
+
|
|
43
|
+
## What it decides
|
|
44
|
+
|
|
45
|
+
| rule | level | meaning |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `date-missing` | error | no recognizable date anywhere (2026-11-16, 11月16日, 11/16, 下周三) |
|
|
48
|
+
| `attendees-missing` | error | no 与会人/参会人/出席/Attendees line or heading |
|
|
49
|
+
| `action-no-owner` | error | a checkbox or 待办-numbered item without 负责人:… / @名字 / X 负责 |
|
|
50
|
+
| `action-no-deadline` | error | an action item without a date or a 周X deadline |
|
|
51
|
+
| `agenda-missing` | warn | no 议程/议题 heading or numbered discussion points |
|
|
52
|
+
| `decisions-missing` | warn | no 决定/决议/结论 — the message says to ignore it if the meeting truly made none |
|
|
53
|
+
| `no-action-items` | warn | no tasks at all — again with an escape hatch in the message |
|
|
54
|
+
|
|
55
|
+
Numbered lines are how a whole note is structured, so plain numbered discussion points are **not** action items; only checkboxes, and numbered lines under a 行动/待办/Action heading, count.
|
|
56
|
+
|
|
57
|
+
## Use
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx dsh-meeting-notes-check notes.md # findings + summary, exit 1 on errors
|
|
61
|
+
npx dsh-meeting-notes-check notes.md --json # machine output
|
|
62
|
+
npx dsh-meeting-notes-check notes.md --no-require-agenda
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Same function over HTTP: `POST /meeting-notes-check/api` with `{"text": "…"}` or `{"path": "…"}`, optional `{"rules": {"requireAgenda": false}}` — the CLI and the host route share one implementation, so they cannot disagree.
|
|
66
|
+
|
|
67
|
+
## Honest scope
|
|
68
|
+
|
|
69
|
+
This checks the note's **bookkeeping**, not the meeting's quality. It cannot tell whether 张三 really accepted the task or whether 下周三 was realistic — it verifies the note says who carries what by when. A meeting with genuinely no decisions passes with a warning, not a fake failure.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Exit codes: 0 clean, 1 findings, 2 usage or read error.
|
|
3
|
+
import { readFile } from 'node:fs/promises'
|
|
4
|
+
import { lintMeetingNotes } from '../src/index.js'
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2)
|
|
7
|
+
const target = args.find(argument => !argument.startsWith('--'))
|
|
8
|
+
if (!target) {
|
|
9
|
+
process.stderr.write('usage: meeting-notes-check <notes.md> [--json] [--no-require-agenda] [--warnings-fail]\n')
|
|
10
|
+
process.exit(2)
|
|
11
|
+
}
|
|
12
|
+
const rules = {}
|
|
13
|
+
if (args.includes('--no-require-agenda')) rules.requireAgenda = false
|
|
14
|
+
try {
|
|
15
|
+
const result = await lintMeetingNotes(await readFile(target, 'utf8'), rules)
|
|
16
|
+
if (args.includes('--json')) {
|
|
17
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`)
|
|
18
|
+
} else {
|
|
19
|
+
for (const finding of result.findings) process.stdout.write(`${finding.level} ${finding.rule} 第${finding.line}行 ${finding.message}\n`)
|
|
20
|
+
process.stdout.write(`${result.ok ? 'ok' : 'fail'}: ${result.checked.actions} action items, ${result.errors} errors, ${result.warnings} warnings\n`)
|
|
21
|
+
}
|
|
22
|
+
process.exit(result.ok ? 0 : 1)
|
|
23
|
+
} catch (error) {
|
|
24
|
+
process.stderr.write(`${error.message}\n`)
|
|
25
|
+
process.exit(2)
|
|
26
|
+
}
|
package/cordis.patch.yml
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-meeting-notes-check",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Meeting-note hygiene from markdown: a date, the people in the room, recorded decisions, and every action item carrying an owner and a deadline.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./src/index.js",
|
|
9
|
+
"./package.json": "./package.json"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"meeting-notes-check": "./bin/cli.js"
|
|
13
|
+
},
|
|
14
|
+
"dsh": {
|
|
15
|
+
"bundle": {
|
|
16
|
+
"patch": "./cordis.patch.yml"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22.19.0",
|
|
21
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0-0"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"src",
|
|
25
|
+
"bin",
|
|
26
|
+
"cordis.patch.yml",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"dsh",
|
|
32
|
+
"dsh-plugin",
|
|
33
|
+
"deepseek-harness",
|
|
34
|
+
"meeting",
|
|
35
|
+
"minutes",
|
|
36
|
+
"action-items",
|
|
37
|
+
"会议纪要",
|
|
38
|
+
"行动项"
|
|
39
|
+
],
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"author": "zjukop3",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/zjukop3/dsh-vertical-kit.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/zjukop3/dsh-vertical-kit/tree/main/packages/dsh-meeting-notes-check"
|
|
47
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// A meeting note is decidable from the markdown: a date, the people in the
|
|
2
|
+
// room, what was decided, and who carries each action item by when. This
|
|
3
|
+
// verifies exactly those, and says which line is missing whom.
|
|
4
|
+
|
|
5
|
+
export const name = 'meeting-notes-check'
|
|
6
|
+
export const inject = ['webServer']
|
|
7
|
+
|
|
8
|
+
const DATE_PATTERNS = [
|
|
9
|
+
/\d{4}[-/.年]\s*\d{1,2}[-/.月]\s*\d{1,2}/,
|
|
10
|
+
/\b\d{1,2}\/\d{1,2}\b/,
|
|
11
|
+
/\b\d{1,2}-\d{1,2}\b/,
|
|
12
|
+
/[下本]?周[一二三四五六日天末]/,
|
|
13
|
+
/\d{1,2}\s*[月号日]/,
|
|
14
|
+
]
|
|
15
|
+
const OWNER_PATTERNS = [/(?:负责人|owner|assigned)\s*[::]/i, /@[\w\u4e00-\u9fff.-]+/, /[\w\u4e00-\u9fff]{1,6}\s*(?:负责|跟进|牵头)/]
|
|
16
|
+
const ACTION_HEADINGS = /(?:^|\n)#{1,6}[^\n]*(?:行动|待办|任务|action|todo|follow)/i
|
|
17
|
+
const ACTION_LIST_KEYWORDS = /(?:^|\n)[^\n]*(?:行动项|待办|任务分派|action items?|todos?)/i
|
|
18
|
+
const DECISION_HEADINGS = /(?:^|\n)#{1,6}[^\n]*(?:决定|决议|结论|decisions?|outcomes?)/i
|
|
19
|
+
const DECISION_LINE = /^[^\n]*(?:决定[::,\s]|决议[::,\s]|结论[::,\s]|拍板|定了[::])/i
|
|
20
|
+
const ATTENDEES_LINE = /(?:与会|参会|出席|列席|参加者|attendees?|participants?|in attendance)[人员者名单]{0,3}\s*[::]/i
|
|
21
|
+
const ATTENDEES_HEADINGS = /(?:^|\n)#{1,6}[^\n]*(?:与会|参会|出席|attendees?|participants?)/i
|
|
22
|
+
const AGENDA_HEADINGS = /(?:^|\n)#{1,6}[^\n]*(?:议程|议题|agenda|topics?)/i
|
|
23
|
+
const AGENDA_LINE = /^[^\n]*(?:议程[::,\s]|议题[::,\s]|\d+\s*[.、]\s*(?:讨论|评审|同步|对齐))/
|
|
24
|
+
|
|
25
|
+
function hasDate(line) {
|
|
26
|
+
return DATE_PATTERNS.some(pattern => pattern.test(line))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function hasOwner(line) {
|
|
30
|
+
return OWNER_PATTERNS.some(pattern => pattern.test(line))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// A checkbox item or a 待办-labelled numbered line is an action item. Plain
|
|
34
|
+
// numbered discussion points are not — numbering alone is how the whole note
|
|
35
|
+
// is structured, and treating every numbered line as a task would flag half
|
|
36
|
+
// the note.
|
|
37
|
+
export function actionItems(text) {
|
|
38
|
+
const lines = text.split('\n')
|
|
39
|
+
const out = []
|
|
40
|
+
const seen = new Set()
|
|
41
|
+
const push = (number, line) => {
|
|
42
|
+
if (!seen.has(number)) {
|
|
43
|
+
seen.add(number)
|
|
44
|
+
out.push({ line, number })
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Checkbox items are action items wherever they sit.
|
|
48
|
+
lines.forEach((line, index) => {
|
|
49
|
+
if (/^\s*[-*+]\s*\[[ xX]\]/.test(line)) push(index + 1, line)
|
|
50
|
+
})
|
|
51
|
+
// A 待办/行动/Action heading also makes numbered lines under it tasks —
|
|
52
|
+
// numbering alone elsewhere is how the whole note is structured, and
|
|
53
|
+
// treating every numbered line as a task would flag half the note.
|
|
54
|
+
let inActions = false
|
|
55
|
+
lines.forEach((line, index) => {
|
|
56
|
+
if (/^#{1,6}\s/.test(line)) {
|
|
57
|
+
inActions = ACTION_HEADINGS.test(`\n${line}`) || ACTION_LIST_KEYWORDS.test(`\n${line}`)
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
if (inActions && /^\s*\d+\s*[.、))]\s*\S/.test(line)) push(index + 1, line)
|
|
61
|
+
})
|
|
62
|
+
return out.sort((a, b) => a.number - b.number)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function lintMeetingNotes(text, rules = {}) {
|
|
66
|
+
const requireAgenda = rules.requireAgenda ?? true
|
|
67
|
+
const findings = []
|
|
68
|
+
const add = (level, rule, line, message) => findings.push({ level, rule, line, message })
|
|
69
|
+
const lines = text.split('\n')
|
|
70
|
+
|
|
71
|
+
// Date: the note must say when the meeting happened, anywhere.
|
|
72
|
+
if (!lines.some(hasDate)) add('error', 'date-missing', 0, '整份纪要没有任何日期(认得:2026-11-16、11月16日、11/16、下周三)')
|
|
73
|
+
|
|
74
|
+
// Attendees: a line or a heading saying who was in the room.
|
|
75
|
+
const hasAttendees = lines.some(line => ATTENDEES_LINE.test(line)) || lines.some(line => ATTENDEES_HEADINGS.test(`\n${line}`))
|
|
76
|
+
if (!hasAttendees) add('error', 'attendees-missing', 0, '没有与会人(认得:与会人:…、参会人:…、出席:…、Attendees:…)')
|
|
77
|
+
|
|
78
|
+
// Agenda: a heading or numbered discussion points.
|
|
79
|
+
if (requireAgenda) {
|
|
80
|
+
const hasAgenda = lines.some(line => AGENDA_HEADINGS.test(`\n${line}`)) || lines.some(line => AGENDA_LINE.test(line))
|
|
81
|
+
if (!hasAgenda) add('warn', 'agenda-missing', 0, '没有议程或编号议题(认得:## 议程、议题:、1. 讨论…)')
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Decisions: a heading or any line that marks a decision. A meeting with
|
|
85
|
+
// genuinely no decisions does happen — hence warn, not error.
|
|
86
|
+
const hasDecisions = lines.some(line => DECISION_HEADINGS.test(`\n${line}`)) || lines.some(line => DECISION_LINE.test(line))
|
|
87
|
+
if (!hasDecisions) add('warn', 'decisions-missing', 0, '没有记录任何决定/决议/结论——如果这次会议真的没有决定,忽略这条')
|
|
88
|
+
|
|
89
|
+
// Action items: every one needs an owner and a deadline.
|
|
90
|
+
const actions = actionItems(text)
|
|
91
|
+
for (const { line, number } of actions) {
|
|
92
|
+
if (!hasOwner(line)) add('error', 'action-no-owner', number, `第 ${number} 行行动项没有负责人(认得:负责人:…、@名字、X 负责):「${line.trim().slice(0, 30)}…」`)
|
|
93
|
+
if (!hasDate(line)) add('error', 'action-no-deadline', number, `第 ${number} 行行动项没有截止时间(认得:11月20日前、2026-11-20、下周三)`)
|
|
94
|
+
}
|
|
95
|
+
if (actions.length === 0) add('warn', 'no-action-items', 0, '没有勾选框或待办编号的行动项——如果这次会议不产生任务,忽略这条')
|
|
96
|
+
|
|
97
|
+
const order = { error: 0, warn: 1 }
|
|
98
|
+
findings.sort((a, b) => order[a.level] - order[b.level] || a.line - b.line)
|
|
99
|
+
const errors = findings.filter(finding => finding.level === 'error').length
|
|
100
|
+
return { ok: errors === 0, checked: { actions: actions.length, lines: lines.length }, errors, warnings: findings.length - errors, findings }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function apply(ctx, config = {}) {
|
|
104
|
+
const prefix = config.path || '/meeting-notes-check/api'
|
|
105
|
+
const handler = async (req, res) => {
|
|
106
|
+
const send = (status, body) => {
|
|
107
|
+
res.statusCode = status
|
|
108
|
+
res.setHeader('content-type', 'application/json; charset=utf-8')
|
|
109
|
+
res.end(JSON.stringify(body))
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
if (req.method !== 'POST') return send(405, { error: 'POST only' })
|
|
113
|
+
const chunks = []
|
|
114
|
+
for await (const chunk of req) chunks.push(chunk)
|
|
115
|
+
const body = JSON.parse(Buffer.concat(chunks).toString('utf8') || '{}')
|
|
116
|
+
const text = typeof body.text === 'string' && body.text ? body.text : body.path ? (await import('node:fs/promises')).readFile(body.path, 'utf8') : ''
|
|
117
|
+
if (!text) return send(400, { error: 'text or path is required' })
|
|
118
|
+
return send(200, lintMeetingNotes(text, body.rules))
|
|
119
|
+
} catch (error) {
|
|
120
|
+
return send(400, { error: error.message || 'request failed' })
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
ctx.effect(() => ctx.webServer.register({ kind: 'prefix', path: prefix, handler }))
|
|
124
|
+
}
|