dsh-ai-collab 0.6.0 → 0.7.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.
- package/AGENTS.global.template.md +1 -1
- package/AGENTS.template.md +1 -1
- package/CHANGELOG.md +21 -0
- package/README.md +18 -5
- package/docs/DETAIL.md +14 -5
- package/docs/DISCLAIMER.md +2 -2
- package/docs/MARKET.md +5 -4
- package/docs/index.html +20 -19
- package/index.js +62 -8
- package/lib/dashboard.js +1 -1
- package/lib/handoff.js +2 -2
- package/lib/plan.js +6 -4
- package/lib/tasks.js +6 -4
- package/package.json +2 -2
- package/template/.ai/llm.ps1 +4 -3
package/AGENTS.template.md
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
| 发布产物 | `.ai\dist\` |
|
|
85
85
|
| 跨项目看板 / 仪表盘 | `..\.ai\board.md`、`..\.ai\dashboard.html` |
|
|
86
86
|
| 工程内修改历史(对外) | 各工程 `readme.txt` |
|
|
87
|
-
| 任务记录清单(所有项目) | `TASKS.
|
|
87
|
+
| 任务记录清单(所有项目) | 根 `TASKS.html`(可视化,自动生成)、`.ai\TASKS.md`(markdown 归档,自动生成) |
|
|
88
88
|
|
|
89
89
|
## 7. 多工具入口(严格单文件)
|
|
90
90
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0 (2026-11-27)
|
|
4
|
+
|
|
5
|
+
- Feature: **clean project root**. `TASKS.md` moved to `.ai/TASKS.md`; the root keeps only
|
|
6
|
+
`AGENTS.md` and the rendered HTML pages. Workspace docs/scripts/artifacts are sorted into
|
|
7
|
+
`.ai/docs`, `.ai/scripts`, `.ai/dist` and `.ai/market`.
|
|
8
|
+
- Feature: **automatic HTML regeneration**. New `syncArtifacts(root)` in `index.js` re-renders
|
|
9
|
+
`.ai/TASKS.md` + root `TASKS.html` + `.ai/PLAN.md` + `..\.ai\dashboard.html`; it is called from
|
|
10
|
+
`ai_status`, `ai_log`, `ai_board`, `ai_plan` (`set`/`done`), `ai_init` and `session/created`
|
|
11
|
+
autoInit, and from a global `session/event` hook (8 s throttle) that covers resumed sessions.
|
|
12
|
+
- Fix: visualization files were never produced unless an `ai_log`/`ai_plan` call happened after
|
|
13
|
+
the upgrade.
|
|
14
|
+
- `session/created` autoInit now renders the artifacts right after the workspace is synced.
|
|
15
|
+
- `ai_board` now refreshes `dashboard.html` on every call (it still never writes `board.md`).
|
|
16
|
+
- `ai_init` returns the artifacts flag and renders the same files.
|
|
17
|
+
- Fix: `dashboard.html` per-project links were resolved against `.ai\` instead of the parent
|
|
18
|
+
directory (`../<project>/TASKS.html`) and were not URL-encoded (spaces broke the link).
|
|
19
|
+
- Docs: intro page (`docs/index.html`) refreshed for 0.7.0 (root layout policy, auto-sync,
|
|
20
|
+
eight tools).
|
|
21
|
+
- Migration: `ai-ensure` / `ai_init` moves an existing root `TASKS.md` into `.ai/TASKS.md` and
|
|
22
|
+
re-renders; verified on 10 workspaces (32/6/38/12/49/2/49/36/18/24 records).
|
|
23
|
+
- Tests: **41** (2 new artifact-sync tests in `test/smoke.test.mjs`; `npm run check` clean).
|
|
3
24
|
## 0.6.0
|
|
4
25
|
|
|
5
26
|
- Plan & task management: new `ai_plan` tool (show / set / done).
|
package/README.md
CHANGED
|
@@ -11,7 +11,20 @@ The point: any AI tool working in the repo (DSH, Claude Code, Cursor, Copilot, C
|
|
|
11
11
|
|
|
12
12
|
> **Visual introduction (中文):** <https://ZhuYw3927.github.io/dsh-ai-collab/>
|
|
13
13
|
|
|
14
|
-
> Status: **0.
|
|
14
|
+
> Status: **0.7.0, experimental**. Published on npm as [`dsh-ai-collab`](https://www.npmjs.com/package/dsh-ai-collab) and listed in the community plugin market — see [Known limitations](#known-limitations).
|
|
15
|
+
|
|
16
|
+
## What's new in 0.7.0
|
|
17
|
+
|
|
18
|
+
- **Clean project root.** The root now only holds what a human reads: `AGENTS.md` plus the rendered
|
|
19
|
+
HTML pages (`TASKS.html`). The markdown task list moved to `.ai/TASKS.md`; docs, scripts, release
|
|
20
|
+
artifacts and market clones live under `.ai/docs`, `.ai/scripts`, `.ai/dist` and `.ai/market`.
|
|
21
|
+
- **HTML views regenerate themselves.** `ai_status`, `ai_log`, `ai_board`, `ai_plan` and `ai_init`
|
|
22
|
+
refresh `TASKS.html`, `.ai/PLAN.md` and `..\.ai\dashboard.html`; a global `session/event` hook
|
|
23
|
+
(8 s throttle per project) also covers **resumed** sessions, so a restart or a fresh plugin
|
|
24
|
+
install no longer needs a manual `ai_log` before the pages appear.
|
|
25
|
+
- **Existing workspaces migrate on the next `ai-ensure` / `ai_init`**: a root `TASKS.md` is moved
|
|
26
|
+
into `.ai/` and re-rendered, so nothing is lost and the root stays clean.
|
|
27
|
+
- Tests: **41** (2 new for artifact sync; all 39 existing tests pass).
|
|
15
28
|
|
|
16
29
|
## What's new in 0.6.0
|
|
17
30
|
|
|
@@ -98,7 +111,7 @@ index generated by `scripts/make-market-index.mjs`.
|
|
|
98
111
|
| Tool | Does |
|
|
99
112
|
|---|---|
|
|
100
113
|
| `ai_status` | Reads `.ai/status.json` + the last N log records (start a session here) |
|
|
101
|
-
| `ai_log` | Appends one record to `.ai/log.jsonl`; rejects invalid enums, requires `issue` for `blocked`/`failed`; refreshes `status.json`, the sibling board, `TASKS.
|
|
114
|
+
| `ai_log` | Appends one record to `.ai/log.jsonl`; rejects invalid enums, requires `issue` for `blocked`/`failed`; refreshes `status.json`, the sibling board, `TASKS.html` and `.ai/SESSION_BOOT.md` |
|
|
102
115
|
| `ai_check` | Validates every record: required fields, enums, timezone, monotonic `ts`, unique `id`; audits the §8 discipline list for drift |
|
|
103
116
|
| `ai_board` | Read-only roll-up of sibling projects' `.ai/status.json` |
|
|
104
117
|
| `ai_init` | Ensures the workspace: scaffold if missing, refresh stale `.ai/`/`AGENTS.md`, refresh stale board (idempotent) |
|
|
@@ -169,7 +182,7 @@ The plugin is mounted from outside `app.asar` (a `link:`/absolute path), so the
|
|
|
169
182
|
<!-- dsh-ai-collab:user:end -->
|
|
170
183
|
```
|
|
171
184
|
|
|
172
|
-
- `ai_log` (and `ai_init`/`ai-ensure`) refresh the task list (`TASKS.md`) whenever the workspace has `.ai/tasks-enabled`.
|
|
185
|
+
- `ai_log` (and `ai_init`/`ai-ensure`) refresh the task list (root `TASKS.html`, markdown archive `.ai/TASKS.md`) whenever the workspace has `.ai/tasks-enabled`.
|
|
173
186
|
- Re-render replaces **only** the generated zone. The user zone (and anything outside both zones) is preserved **byte-for-byte**; `placeholders.json`, `log.jsonl` and `status.json` are never touched.
|
|
174
187
|
- A file **without** the zone markers is treated as project-owned and is never rewritten; the rendered reference goes to `.ai/AGENTS.generated.md`. This includes legacy single-line-marker files, which are frozen.
|
|
175
188
|
- Explicit migration only:
|
|
@@ -213,12 +226,12 @@ The plugin is mounted from outside `app.asar` (a `link:`/absolute path), so the
|
|
|
213
226
|
## Concurrency and file protection
|
|
214
227
|
|
|
215
228
|
- `lib/atomic.js` writes to a same-directory temp file, `fsync`s and renames (retries on
|
|
216
|
-
`EPERM`/`EBUSY`/`EACCES`), so a reader never sees a half-written `status.json`, `TASKS.
|
|
229
|
+
`EPERM`/`EBUSY`/`EACCES`), so a reader never sees a half-written `status.json`, `TASKS.html` or
|
|
217
230
|
`SESSION_BOOT.md`.
|
|
218
231
|
- `lib/lock.js` is a cross-process lock (`openSync(path, 'wx')`), stale after 30 s, 15 s timeout.
|
|
219
232
|
`ai_log` holds `.ai/.log.lock` across the append **and** the status update; `status.json`
|
|
220
233
|
carries a `rev` that increments on each write.
|
|
221
|
-
- `TASKS.md` refresh holds `.ai/.tasks.lock`; `SESSION_BOOT.md` is written atomically.
|
|
234
|
+
- `TASKS.html` / `.ai/TASKS.md` refresh holds `.ai/.tasks.lock`; `SESSION_BOOT.md` is written atomically.
|
|
222
235
|
- `template/.ai/llm.ps1` mirrors this in PowerShell: `Write-TextAtomic` (temp + `File.Replace`),
|
|
223
236
|
`Enter-ProjectLock` / `Exit-ProjectLock` around `add`, `tasks`, `board` and `archive`; `archive`
|
|
224
237
|
aborts if the log grew while it was copying.
|
package/docs/DETAIL.md
CHANGED
|
@@ -20,17 +20,26 @@ files that any tool can read: `AGENTS.md` for facts, `.ai/log.jsonl` for history
|
|
|
20
20
|
| Disciplines | Global modules in `$DSH_HOME/disciplines/` (migrate/toggle via `ai_discipline`) and project rules in `.ai/disciplines/`; enabled project rules are inlined into §8, disabled ones only listed |
|
|
21
21
|
| Handoff | `.ai/SESSION_BOOT.md` carries status, recent records, disciplines and an inheritance prompt; regenerated by `ai_log` / `ai_init` / `autoInit` |
|
|
22
22
|
| Protected files | An `AGENTS.md` without zone markers is treated as project-owned and never rewritten; the rendered reference goes to `.ai/AGENTS.generated.md`; rewrites are atomic and backed up |
|
|
23
|
-
| Task list | `.ai/log.jsonl` drives a three-section
|
|
23
|
+
| Task list | `.ai/log.jsonl` drives a three-section `.ai/TASKS.md` (plan → checklist → risks → log) and a self-contained root `TASKS.html` dashboard; `refreshTasks` auto-creates `.ai/tasks-enabled` on first write |
|
|
24
24
|
| Cross-project board | When a sibling `.ai/board.md` exists, the board is refreshed after a record is written; `dashboard.html` scans all projects with red-highlighted blocker rows |
|
|
25
25
|
| Plan & risk tracking | `.ai/plan.json` stores goals, checklists and risks; active risks merge into `status.json` → `blockers` on every `ai_log`; managed via `ai_plan` (show / set / done) |
|
|
26
26
|
| Concurrency | `lib/lock.js` cross-process lock + `lib/atomic.js` temp/fsync/rename; `status.json` has a `rev`; PowerShell `llm.ps1` mirrors both |
|
|
27
27
|
|
|
28
|
+
## What's new in 0.7.0
|
|
29
|
+
|
|
30
|
+
| Change | Effect |
|
|
31
|
+
|---|---|
|
|
32
|
+
| Root layout policy | Root keeps only `AGENTS.md` + rendered HTML (`TASKS.html`); `.ai/TASKS.md` is the markdown archive, everything else lives under `.ai/docs` / `.ai/scripts` / `.ai/dist` / `.ai/market` |
|
|
33
|
+
| Auto artifact sync | `ai_status`, `ai_log`, `ai_board`, `ai_plan`, `ai_init` and a global `session/event` hook (8 s throttle) regenerate `TASKS.html` / `.ai/PLAN.md` / `..\.ai\dashboard.html` |
|
|
34
|
+
| Resumed sessions covered | `session/created` only fires for new sessions; `session/event` closes the gap so a restart or plugin upgrade repaints the pages |
|
|
35
|
+
| Root `TASKS.md` migration | The next `ai-ensure` / `ai_init` moves an existing root `TASKS.md` into `.ai/` and re-renders |
|
|
36
|
+
|
|
28
37
|
## What's new in 0.6.0
|
|
29
38
|
|
|
30
39
|
| Change | Effect |
|
|
31
40
|
|---|---|
|
|
32
41
|
| `ai_plan` tool | Stores structured plans in `.ai/plan.json`: goals, checklists (with done/undone toggles), risks (severity-badged, each with mitigation and active/resolved). `show` / `set` (upsert any block) / `done` (toggle checklist items) |
|
|
33
|
-
|
|
|
42
|
+
| `.ai/TASKS.md` → three-section + root `TASKS.html` | Plan, checklist and risk blocks precede the reverse-chronological log; a parallel `TASKS.html` renders the same data as a self-contained dashboard page with status badges |
|
|
34
43
|
| Cross-project `dashboard.html` | Scans sibling projects, highlights rows with active blockers in red, adds a sparkline bar from the last 7 record counts |
|
|
35
44
|
| Risk → blocker auto-merge | Every `ai_log` merges active plan risks into `status.json` → `blockers`, so they surface in `ai_status` |
|
|
36
45
|
| `.tasks-enabled` auto-created | `refreshTasks` creates the marker on first write; no manual step needed |
|
|
@@ -59,14 +68,14 @@ Values are normalised and invalid values are reported as warnings in
|
|
|
59
68
|
```
|
|
60
69
|
<project root>
|
|
61
70
|
├─ AGENTS.md generated zone + user zone
|
|
62
|
-
├─ TASKS.
|
|
63
|
-
├─
|
|
71
|
+
├─ TASKS.html self-contained dashboard-style task view (auto-regenerated)
|
|
72
|
+
├─ (root policy: only AGENTS.md + HTML pages live at the top level)
|
|
64
73
|
└─ .ai/
|
|
65
74
|
├─ llm.ps1 / llm.cmd status / tail / add / check / board / doctor / tasks
|
|
66
75
|
├─ log.jsonl append-only, UTF-8 without BOM, LF
|
|
67
76
|
├─ status.json current-state snapshot (overwritten, `rev` increments)
|
|
68
77
|
├─ plan.json structured plan: goals, checklists, risks
|
|
69
|
-
├─ PLAN.md rendered plan
|
|
78
|
+
├─ PLAN.md rendered plan`n ├─ TASKS.md three-section markdown archive (plan → checklist → risks → log)
|
|
70
79
|
├─ SESSION_BOOT.md cross-session handoff packet
|
|
71
80
|
├─ disciplines/ project discipline registry + rules/
|
|
72
81
|
├─ LOG_FORMAT.md / SECURITY.md / schema/log.schema.json
|
package/docs/DISCLAIMER.md
CHANGED
|
@@ -5,7 +5,7 @@ including but not limited to merchantability, fitness for a particular purpose,
|
|
|
5
5
|
non-infringement, uninterrupted operation, freedom from errors, or accuracy of data.
|
|
6
6
|
|
|
7
7
|
The bundle writes files inside your workspace (for example `AGENTS.md`, `.ai/` and
|
|
8
|
-
`TASKS.md`) and may run local PowerShell scripts. Before using it on an important
|
|
8
|
+
`TASKS.html`, `.ai/TASKS.md`) and may run local PowerShell scripts. Before using it on an important
|
|
9
9
|
repository:
|
|
10
10
|
|
|
11
11
|
- make a full backup, including the version-control state and uncommitted changes;
|
|
@@ -34,7 +34,7 @@ not exceed the amount you actually paid for this software (it is free, i.e. zero
|
|
|
34
34
|
本软件按“现状(AS IS)”提供,不附带任何明示或默示的担保,包括但不限于:
|
|
35
35
|
适销性、特定用途适用性、不侵权、无中断、无错误、数据准确性。
|
|
36
36
|
|
|
37
|
-
本插件会在工作区内写入或修改文件(如 `AGENTS.md`、`.ai/`、`TASKS.
|
|
37
|
+
本插件会在工作区内写入或修改文件(如 `AGENTS.md`、`.ai/`、`TASKS.html`),并可能调用
|
|
38
38
|
本地 PowerShell 脚本。请在重要仓库中:
|
|
39
39
|
|
|
40
40
|
- 使用前做好完整备份(含版本库与未提交改动);
|
package/docs/MARKET.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# Market release checklist
|
|
2
2
|
|
|
3
|
-
Published as `dsh-ai-collab@0.
|
|
3
|
+
Published as `dsh-ai-collab@0.7.0`. The remaining steps take it to the
|
|
4
4
|
community plugin market (`dshmarket` / awesome-dsh-plugin) and, optionally, a self-hosted
|
|
5
5
|
format-1 index.
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ format-1 index.
|
|
|
8
8
|
|
|
9
9
|
| Version | npm | Git tag | Market entry PR |
|
|
10
10
|
|---|---|---|---|
|
|
11
|
+
| `0.7.0` (2026-11-27) | published | `v0.7.0` | docs/desc-070 — description refresh for clean root layout / auto-rendered HTML views / resumed-session sync (pending) |
|
|
11
12
|
| `0.5.0` (2026-11-23) | published | `v0.5.0` | #18120 — description refresh for disciplines / handoff / safe writes (open) |
|
|
12
13
|
| `0.4.4` (2026-11-20) | published | `v0.4.4` | #17234 — intro-page link in description (merged) |
|
|
13
14
|
| `0.4.3` (2026-11-17) | published | `v0.4.3` | #16419 — first listing (merged) |
|
|
@@ -20,7 +21,7 @@ format-1 index.
|
|
|
20
21
|
| No build scripts, no native modules | yes (nothing to compile on install) |
|
|
21
22
|
| Package manifest complete | `engines.dsh`, `os`, `exports` (locale/icon), `files` whitelist |
|
|
22
23
|
| Display metadata | `locale/en.json`, `locale/zh.json`, `icon.svg`, `docs/DETAIL.md` |
|
|
23
|
-
| Tests | `npm test` (
|
|
24
|
+
| Tests | `npm test` (41 cases) |
|
|
24
25
|
| npm name `dsh-ai-collab` | taken by this package |
|
|
25
26
|
| Local-only data | none: paths, hostnames and project names in examples are placeholders |
|
|
26
27
|
|
|
@@ -36,7 +37,7 @@ Still missing (needs the maintainer's accounts):
|
|
|
36
37
|
cd <package-dir>
|
|
37
38
|
npm run check
|
|
38
39
|
npm test
|
|
39
|
-
npm pack --dry-run # inspect the file list (
|
|
40
|
+
npm pack --dry-run # inspect the file list (39 files)
|
|
40
41
|
npm publish --access public --registry https://registry.npmjs.org
|
|
41
42
|
npm view dsh-ai-collab version
|
|
42
43
|
```
|
package/docs/index.html
CHANGED
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
<svg class="logo" viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="8" fill="#0d6b5b"/><path d="M9 11h14M9 16h9M9 21h11" stroke="#8fe7d1" stroke-width="2.6" stroke-linecap="round"/></svg>
|
|
485
485
|
<span>dsh-ai-collab</span>
|
|
486
486
|
</a>
|
|
487
|
-
<span class="ver">v0.
|
|
487
|
+
<span class="ver">v0.7.0</span>
|
|
488
488
|
<nav class="top-nav" aria-label="页面导航">
|
|
489
489
|
<a href="#problem">问题</a>
|
|
490
490
|
<a href="#model">机制</a>
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
|
|
544
544
|
<div class="stats-band">
|
|
545
545
|
<div class="stats" role="list">
|
|
546
|
-
<div role="listitem"><div class="stat-value">
|
|
546
|
+
<div role="listitem"><div class="stat-value">8<small>个</small></div><div class="stat-label">原生工具</div></div>
|
|
547
547
|
<div role="listitem"><div class="stat-value">3<small>条</small></div><div class="stat-label">命令开始交接</div></div>
|
|
548
548
|
<div role="listitem"><div class="stat-value">0<small>次</small></div><div class="stat-label">网络请求</div></div>
|
|
549
549
|
<div role="listitem"><div class="stat-value">100<small>%</small></div><div class="stat-label">数据本地留存</div></div>
|
|
@@ -568,7 +568,7 @@
|
|
|
568
568
|
</ol>
|
|
569
569
|
</nav>
|
|
570
570
|
<div class="side-card">
|
|
571
|
-
<div class="sc-row"><span class="pulse" aria-hidden="true"></span>已发布 · 0.
|
|
571
|
+
<div class="sc-row"><span class="pulse" aria-hidden="true"></span>已发布 · 0.7.0</div>
|
|
572
572
|
<p>npm 已上架,社区市场已收录;脚手架当前支持 Windows。</p>
|
|
573
573
|
<button class="print-btn" type="button" id="printBtn" onclick="window.print()">打印 / 保存为 PDF</button>
|
|
574
574
|
</div>
|
|
@@ -646,7 +646,7 @@
|
|
|
646
646
|
<p class="pillar-role">协作层</p>
|
|
647
647
|
</div>
|
|
648
648
|
</div>
|
|
649
|
-
<p>追加式日志、当前状态快照、版本级变更、schema 与归档。所有写入经由 <code>.ai\llm.cmd</code> 或
|
|
649
|
+
<p>追加式日志、当前状态快照、版本级变更、schema 与归档。所有写入经由 <code>.ai\llm.cmd</code> 或 8 个原生工具,编码与格式由脚本保证。</p>
|
|
650
650
|
<ul class="ticks">
|
|
651
651
|
<li>log.jsonl 只追加,不改写</li>
|
|
652
652
|
<li>status.json 覆盖式,10 秒接手</li>
|
|
@@ -677,7 +677,7 @@
|
|
|
677
677
|
<tr><th>工具</th><th>接入方式</th><th>参与方式</th></tr>
|
|
678
678
|
</thead>
|
|
679
679
|
<tbody>
|
|
680
|
-
<tr><td>DSH</td><td>Bundle 安装,
|
|
680
|
+
<tr><td>DSH</td><td>Bundle 安装,8 个原生工具</td><td><code>ai_status</code> / <code>ai_log</code> / <code>ai_check</code> 直接读写</td></tr>
|
|
681
681
|
<tr><td>Claude Code</td><td>用户级 <code>CLAUDE.md</code> 转发,或 <code>entries -Publish</code></td><td>读 <code>AGENTS.md</code>,用 <code>llm.cmd</code> 记录</td></tr>
|
|
682
682
|
<tr><td>Cursor / Copilot</td><td>原生读取 <code>AGENTS.md</code></td><td>继承项目事实与纪律</td></tr>
|
|
683
683
|
<tr><td>Codex / 其他 CLI</td><td>任意 shell 调用 <code>.ai\llm.cmd</code></td><td><code>status</code> / <code>tail</code> / <code>add</code> / <code>check</code></td></tr>
|
|
@@ -695,7 +695,7 @@
|
|
|
695
695
|
<article class="step">
|
|
696
696
|
<div class="step-n"><span>02 收工</span><span>1 条记录</span></div>
|
|
697
697
|
<h3>追加流水</h3>
|
|
698
|
-
<p><code>add</code> 自动生成 id 与时间戳,刷新 <code>status.json</code
|
|
698
|
+
<p><code>add</code> 自动生成 id 与时间戳,刷新 <code>status.json</code>,并在需要时刷新看板、<code>TASKS.html</code> 与 <code>.ai/TASKS.md</code>。</p>
|
|
699
699
|
</article>
|
|
700
700
|
<article class="step">
|
|
701
701
|
<div class="step-n"><span>03 提交前</span><span>强制</span></div>
|
|
@@ -957,7 +957,7 @@ ai_handoff action:inherit
|
|
|
957
957
|
<tbody>
|
|
958
958
|
<tr><td>两个会话同时写日志</td><td><code>.ai/.log.lock</code> 跨进程锁,append 与状态更新在同一临界区</td><td>12 个进程并发写入 → 12 条记录、id 全唯一、<code>rev=12</code></td></tr>
|
|
959
959
|
<tr><td>写到一半被读到</td><td>临时文件 + <code>fsync</code> + rename 原子替换(对占用/权限错误退避重试)</td><td>读者只会看到旧版或新版,没有半截文件</td></tr>
|
|
960
|
-
<tr><td><code>TASKS.md</code> 被并行覆盖</td><td><code>.ai/.tasks.lock</code> 内整份重渲染</td><td>清单始终与日志一致</td></tr>
|
|
960
|
+
<tr><td><code>TASKS.html</code> / <code>.ai/TASKS.md</code> 被并行覆盖</td><td><code>.ai/.tasks.lock</code> 内整份重渲染</td><td>清单始终与日志一致</td></tr>
|
|
961
961
|
<tr><td><code>AGENTS.md</code> 改坏</td><td>原子写 + 写前备份到 <code>.ai/backups/</code>(保留最近 10 份)</td><td>可回滚;<code>-ResetAgents</code> 也有备份</td></tr>
|
|
962
962
|
<tr><td>状态快照丢更新</td><td><code>status.json</code> 增加自增 <code>rev</code>,写入在锁内完成</td><td><code>rev</code> 可作为「有没有丢写」的快速判断</td></tr>
|
|
963
963
|
<tr><td>纪律与实际渲染不一致</td><td><code>ai_check</code> 审计 §8 漂移</td><td>启用未内联 / 停用仍内联 / 注册表损坏都会报错</td></tr>
|
|
@@ -1002,7 +1002,7 @@ dsh plugin --profile <profile> add "<包绝对路径>"</code></pre>
|
|
|
1002
1002
|
autoInit: true</code></pre>
|
|
1003
1003
|
</div>
|
|
1004
1004
|
</div>
|
|
1005
|
-
<p class="note">安装后重启 DSH;profile 内所有会话都会出现
|
|
1005
|
+
<p class="note">安装后重启 DSH;profile 内所有会话都会出现 8 个工具。首次进入某个项目时,先调用 <code>ai_init</code>(或把 <code>autoInit</code> 设为 <code>true</code>)生成 <code>.ai/</code> 与 <code>AGENTS.md</code>,之后按下面的动作循环。若包只进了依赖、未进 <code>dsh.profile.bundles</code>,需要手动补一行。</p>
|
|
1006
1006
|
|
|
1007
1007
|
<div class="code-wrap">
|
|
1008
1008
|
<pre class="code powershell"><code><span class="c"># 开工:同步并读状态(约 10 秒)</span>
|
|
@@ -1016,7 +1016,7 @@ dsh plugin --profile <profile> add "<包绝对路径>"</code></pre>
|
|
|
1016
1016
|
& .ai\llm.cmd check</code></pre>
|
|
1017
1017
|
</div>
|
|
1018
1018
|
|
|
1019
|
-
<div class="tools-chips" aria-label="
|
|
1019
|
+
<div class="tools-chips" aria-label="八个原生工具">
|
|
1020
1020
|
<div class="toolchip"><b>ai_status</b><span>读状态与最近记录</span></div>
|
|
1021
1021
|
<div class="toolchip"><b>ai_log</b><span>追加一条记录</span></div>
|
|
1022
1022
|
<div class="toolchip"><b>ai_check</b><span>校验日志与状态</span></div>
|
|
@@ -1024,6 +1024,7 @@ dsh plugin --profile <profile> add "<包绝对路径>"</code></pre>
|
|
|
1024
1024
|
<div class="toolchip"><b>ai_init</b><span>幂等接入工作区</span></div>
|
|
1025
1025
|
<div class="toolchip"><b>ai_discipline</b><span>纪律清单与开关</span></div>
|
|
1026
1026
|
<div class="toolchip"><b>ai_handoff</b><span>跨会话交接摘要</span></div>
|
|
1027
|
+
<div class="toolchip"><b>ai_plan</b><span>执行计划 / 清单 / 风险</span></div>
|
|
1027
1028
|
</div>
|
|
1028
1029
|
|
|
1029
1030
|
<h3 class="subhead">常用命令</h3>
|
|
@@ -1060,12 +1061,12 @@ dsh plugin --profile <profile> add "<包绝对路径>"</code></pre>
|
|
|
1060
1061
|
<section class="sec" id="status">
|
|
1061
1062
|
<p class="kicker"><span class="bar" aria-hidden="true"></span>09 · 边界与状态</p>
|
|
1062
1063
|
<h2>已发布,边界清晰</h2>
|
|
1063
|
-
<p class="lead">0.
|
|
1064
|
+
<p class="lead">0.7.0 已上 npm 并被社区插件市场收录;项目根只保留 <code>AGENTS.md</code> 与可视化 HTML,任务清单与跨项目仪表盘会自动重新生成(含重启后的恢复会话);脚手架目前仅支持 Windows,只读工具与任务渲染本身与平台无关。</p>
|
|
1064
1065
|
|
|
1065
1066
|
<div class="release">
|
|
1066
1067
|
<div class="rel">
|
|
1067
1068
|
<div class="rel-top"><span>npm</span><span class="badge-ok">已发布</span></div>
|
|
1068
|
-
<b>dsh-ai-collab@0.
|
|
1069
|
+
<b>dsh-ai-collab@0.7.0</b>
|
|
1069
1070
|
<span>2026-11-27 上架,可直接安装</span>
|
|
1070
1071
|
</div>
|
|
1071
1072
|
<div class="rel">
|
|
@@ -1085,27 +1086,27 @@ dsh plugin --profile <profile> add "<包绝对路径>"</code></pre>
|
|
|
1085
1086
|
</div>
|
|
1086
1087
|
</div>
|
|
1087
1088
|
|
|
1088
|
-
<h3 class="subhead">0.
|
|
1089
|
+
<h3 class="subhead">0.7.0 更新摘要</h3>
|
|
1089
1090
|
<div class="rules">
|
|
1090
1091
|
<div class="rule">
|
|
1091
1092
|
<span class="rule-n">新</span>
|
|
1092
|
-
<div><h3
|
|
1093
|
+
<div><h3>项目根更干净</h3><p>根目录只留 <code>AGENTS.md</code> 和可视化 HTML(<code>TASKS.html</code>);markdown 任务清单迁到 <code>.ai/TASKS.md</code>,文档 / 脚本 / 发布产物 / 市场克隆分别收进 <code>.ai/docs</code> <code>.ai/scripts</code> <code>.ai/dist</code> <code>.ai/market</code>。</p></div>
|
|
1093
1094
|
</div>
|
|
1094
1095
|
<div class="rule">
|
|
1095
1096
|
<span class="rule-n">新</span>
|
|
1096
|
-
<div><h3>
|
|
1097
|
+
<div><h3>HTML 自动重新生成</h3><p>新增 <code>syncArtifacts()</code>:<code>ai_status</code> / <code>ai_log</code> / <code>ai_board</code> / <code>ai_plan</code> / <code>ai_init</code> 都会刷新 <code>TASKS.html</code>、<code>.ai/PLAN.md</code> 与 <code>..\.ai\dashboard.html</code>;全局 <code>session/event</code> 钩子(每项目 8 秒节流)覆盖 <b>恢复的会话</b>,重启或刚升级插件后不必先写日志再看页面。</p></div>
|
|
1097
1098
|
</div>
|
|
1098
1099
|
<div class="rule">
|
|
1099
|
-
<span class="rule-n"
|
|
1100
|
-
<div><h3
|
|
1100
|
+
<span class="rule-n">改</span>
|
|
1101
|
+
<div><h3>仪表盘链接修正</h3><p><code>dashboard.html</code> 的项目链接改为相对父目录的真实路径(<code>../<project>/TASKS.html</code>)并做 URL 编码,含空格的目录名不再断链。</p></div>
|
|
1101
1102
|
</div>
|
|
1102
1103
|
<div class="rule">
|
|
1103
1104
|
<span class="rule-n">改</span>
|
|
1104
|
-
<div><h3
|
|
1105
|
+
<div><h3>存量工作区自动迁移</h3><p>下次 <code>ai-ensure</code> / <code>ai_init</code> 会把根目录旧的 <code>TASKS.md</code> 搬进 <code>.ai/</code> 并重渲染;已在 10 个工作区验证,记录数 32/6/38/12/49/2/49/36/18/24,无丢失。</p></div>
|
|
1105
1106
|
</div>
|
|
1106
1107
|
<div class="rule">
|
|
1107
1108
|
<span class="rule-n">测</span>
|
|
1108
|
-
<div><h3>验证</h3><p>
|
|
1109
|
+
<div><h3>验证</h3><p>41 个测试全通过(新增 2 个覆盖自动产物同步与未接入目录短路);<code>npm run check</code> 覆盖 9 个 JS 文件。</p></div>
|
|
1109
1110
|
</div>
|
|
1110
1111
|
</div>
|
|
1111
1112
|
|
|
@@ -1153,7 +1154,7 @@ dsh plugin --profile <profile> add "<包绝对路径>"</code></pre>
|
|
|
1153
1154
|
|
|
1154
1155
|
<footer class="site-footer">
|
|
1155
1156
|
<div class="foot-inner">
|
|
1156
|
-
<div>本文基于项目 <code>AGENTS.md</code>、<code>dsh-ai-collab.md</code>、插件 README 与发布记录整理 · 2026-11-27 · 对应版本 0.
|
|
1157
|
+
<div>本文基于项目 <code>AGENTS.md</code>、<code>dsh-ai-collab.md</code>、插件 README 与发布记录整理 · 2026-11-27 · 对应版本 0.7.0</div>
|
|
1157
1158
|
<div class="foot-links">
|
|
1158
1159
|
<a href="https://www.npmjs.com/package/dsh-ai-collab" target="_blank" rel="noopener">npm</a>
|
|
1159
1160
|
<a href="https://github.com/ZhuYw3927/dsh-ai-collab" target="_blank" rel="noopener">GitHub</a>
|
package/index.js
CHANGED
|
@@ -290,7 +290,7 @@ function maybeRefreshBoard(root) {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
*
|
|
293
|
+
* 写日志后刷新任务清单(.ai/TASKS.md + 根 TASKS.html + .ai/PLAN.md)。
|
|
294
294
|
* 首次触发时自动创建 .ai\tasks-enabled(不再需要手动开)。
|
|
295
295
|
* 进程内渲染:不执行工作区自带的 .ai/llm.ps1,避免仓库脚本被插件执行。
|
|
296
296
|
*/
|
|
@@ -308,6 +308,28 @@ function refreshTasks(root) {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
/**
|
|
312
|
+
* 重新生成所有可视化产物(`.ai/TASKS.md` + 根 `TASKS.html` + `.ai/PLAN.md`
|
|
313
|
+
* + 父目录 `.ai/dashboard.html`)。工具调用与会话活动都会走这里,
|
|
314
|
+
* 保证「插件刚装好/刚重启」时文件也能自动出现,不需要用户手动 log 一次。
|
|
315
|
+
*
|
|
316
|
+
* 8s 内同一项目只渲染一次(会话事件很密,避免重复写盘);`force` 跳过节流。
|
|
317
|
+
*/
|
|
318
|
+
function syncArtifacts(root, { force = false } = {}) {
|
|
319
|
+
try {
|
|
320
|
+
if (!root || !existsSync(join(root, '.ai'))) return false
|
|
321
|
+
if (!force && recentlyRefreshed(root, 'artifacts', 8000)) return false
|
|
322
|
+
refreshTasks(root)
|
|
323
|
+
try { writeDashboard(root) } catch (error) {
|
|
324
|
+
appendLog('ai-collab-dashboard.log', `sync root=${root} throw ${error?.message || error}`)
|
|
325
|
+
}
|
|
326
|
+
return true
|
|
327
|
+
} catch (error) {
|
|
328
|
+
appendLog('ai-collab-artifacts.log', `sync root=${root} throw ${error?.message || error}`)
|
|
329
|
+
return false
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
311
333
|
/**
|
|
312
334
|
* Rebuild `.ai\SESSION_BOOT.md` after every record. It is derived data
|
|
313
335
|
* (status + last N records), so a stale boot file is worse than a small write.
|
|
@@ -360,6 +382,8 @@ export function apply(ctx, config = {}) {
|
|
|
360
382
|
try { writeSessionBoot(root, { maxTail: opts.maxTail }) } catch (error) {
|
|
361
383
|
appendLog('ai-collab-handoff.log', `autoInit root=${root} throw ${error?.message || error}`)
|
|
362
384
|
}
|
|
385
|
+
// 会话一建立就补齐可视化产物(TASKS.html / dashboard.html),避免重启后文件不存在
|
|
386
|
+
syncArtifacts(root, { force: true })
|
|
363
387
|
}
|
|
364
388
|
ctx.logger?.info?.('ai-collab autoInit', { root, ok: finished.ok, parsed: parseEnsureOutput(finished.out) })
|
|
365
389
|
}
|
|
@@ -380,6 +404,28 @@ export function apply(ctx, config = {}) {
|
|
|
380
404
|
}
|
|
381
405
|
})
|
|
382
406
|
|
|
407
|
+
// 1b) 会话活动兜底:`session/created` 只覆盖新建会话,重启后恢复的旧会话不会触发;
|
|
408
|
+
// 而 `session/event` 在每个 turn/step 都会发一次,用它把「恢复会话」也纳入自动渲染。
|
|
409
|
+
// 走 syncArtifacts 的 8s 节流,密集事件不会重复写盘。
|
|
410
|
+
ctx.effect(() => {
|
|
411
|
+
const handler = (session) => {
|
|
412
|
+
try {
|
|
413
|
+
const root = session?.cwd || session?.workspace
|
|
414
|
+
if (!root) return
|
|
415
|
+
syncArtifacts(root)
|
|
416
|
+
} catch (error) {
|
|
417
|
+
appendLog('ai-collab-artifacts.log', `session-event throw ${error?.message || error}`)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
try {
|
|
421
|
+
const off = ctx.on('session/event', handler, { global: true })
|
|
422
|
+
return typeof off === 'function' ? off : () => {}
|
|
423
|
+
} catch (error) {
|
|
424
|
+
ctx.logger?.warn?.('ai-collab: session/event hook unavailable', error)
|
|
425
|
+
return () => {}
|
|
426
|
+
}
|
|
427
|
+
})
|
|
428
|
+
|
|
383
429
|
// 2) 工具:加载 dsh-tools 后注册;失败要落盘,不能只留一条 warn
|
|
384
430
|
ctx.effect(() => {
|
|
385
431
|
let disposed = false
|
|
@@ -458,6 +504,8 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
458
504
|
output,
|
|
459
505
|
async execute(args, exec) {
|
|
460
506
|
const r = await rootOf(exec)
|
|
507
|
+
// 开工第一步就把可视化产物补齐(重启/新装/恢复会话后第一次 ai_status 即可见)
|
|
508
|
+
syncArtifacts(r)
|
|
461
509
|
const st = readJson(statusPath(r))
|
|
462
510
|
const lines = readLines(logPath(r))
|
|
463
511
|
return {
|
|
@@ -488,7 +536,7 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
488
536
|
async execute(args, exec) {
|
|
489
537
|
const r = await rootOf(exec)
|
|
490
538
|
const rec = appendRecord(r, args)
|
|
491
|
-
|
|
539
|
+
syncArtifacts(r)
|
|
492
540
|
refreshSessionBoot(r)
|
|
493
541
|
maybeRefreshBoard(r)
|
|
494
542
|
return rec
|
|
@@ -535,7 +583,8 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
535
583
|
parameters: {},
|
|
536
584
|
output,
|
|
537
585
|
async execute(args, exec) {
|
|
538
|
-
const
|
|
586
|
+
const root = await rootOf(exec)
|
|
587
|
+
const parent = dirname(root)
|
|
539
588
|
const rows = []
|
|
540
589
|
for (const entry of readdirSafe(parent)) {
|
|
541
590
|
if (entry.startsWith('.') || entry.startsWith('_')) continue
|
|
@@ -551,7 +600,10 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
551
600
|
updated_at: st.updated_at || ''
|
|
552
601
|
})
|
|
553
602
|
}
|
|
554
|
-
|
|
603
|
+
const projects = rows.sort((a, b) => String(b.updated_at).localeCompare(String(a.updated_at)))
|
|
604
|
+
// 仪表盘与本工具同频刷新(board.md 由 ai-ensure 维护,这里只写 dashboard.html + TASKS.html)
|
|
605
|
+
syncArtifacts(root, { force: true })
|
|
606
|
+
return { scanned: parent, projects }
|
|
555
607
|
}
|
|
556
608
|
}))
|
|
557
609
|
|
|
@@ -585,6 +637,8 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
585
637
|
try { payload.boot = writeSessionBoot(target, { maxTail: opts.maxTail }) } catch (error) {
|
|
586
638
|
payload.boot = { ok: false, error: String(error?.message || error) }
|
|
587
639
|
}
|
|
640
|
+
// 接入/同步完成后补齐可视化产物(TASKS.html / dashboard.html)
|
|
641
|
+
payload.artifacts = syncArtifacts(target, { force: true })
|
|
588
642
|
}
|
|
589
643
|
return payload
|
|
590
644
|
}
|
|
@@ -722,7 +776,7 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
722
776
|
registered.push('ai_plan')
|
|
723
777
|
ctx.tools.register(defineTool({
|
|
724
778
|
name: 'ai_plan',
|
|
725
|
-
description: '管理执行计划、检查清单与风险应对:数据存 .ai\\plan.json,渲染产物 .ai\\PLAN.md + TASKS.md + TASKS.html。show / set <plan|checklist|risks> / done <checklist-id>。',
|
|
779
|
+
description: '管理执行计划、检查清单与风险应对:数据存 .ai\\plan.json,渲染产物 .ai\\PLAN.md + .ai\\TASKS.md + 根 TASKS.html。show / set <plan|checklist|risks> / done <checklist-id>。',
|
|
726
780
|
parameters: {
|
|
727
781
|
action: { type: 'string', required: true, enum: ['show', 'set', 'done'], description: 'show 返回当前计划;set 覆盖 plan/checklist/risks 其中一块(传 key+items);done 勾选一条清单项' },
|
|
728
782
|
key: { type: 'string', description: 'set 时必填:plan / checklist / risks' },
|
|
@@ -745,7 +799,7 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
745
799
|
const key = String(args?.key || '')
|
|
746
800
|
const items = Array.isArray(args?.items) ? args.items : []
|
|
747
801
|
const result = setBlock(r, key, items, now)
|
|
748
|
-
|
|
802
|
+
syncArtifacts(r, { force: true })
|
|
749
803
|
maybeRefreshBoard(r)
|
|
750
804
|
return { root: r, ok: true, key, count: (result[key] || []).length, updated_at: result.updated_at }
|
|
751
805
|
}
|
|
@@ -758,7 +812,7 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
758
812
|
summary: `清单项完成: ${item.item}`,
|
|
759
813
|
tags: ['plan', 'checklist'],
|
|
760
814
|
})
|
|
761
|
-
|
|
815
|
+
syncArtifacts(r, { force: true })
|
|
762
816
|
refreshSessionBoot(r)
|
|
763
817
|
maybeRefreshBoard(r)
|
|
764
818
|
return { root: r, ok: true, id, item, record: rec.id, plan: { ...plan, plan: undefined, checklist: undefined, risks: undefined } }
|
|
@@ -772,4 +826,4 @@ function registerTools(ctx, opts, defineTool, spec) {
|
|
|
772
826
|
}
|
|
773
827
|
|
|
774
828
|
// 仅供测试与调试:不要在插件内部依赖这些内部函数。
|
|
775
|
-
export const __internals = { recordErrors, appendRecord, readLines, nowIso, newId, refreshTasks, SCAFFOLD_SUPPORTED }
|
|
829
|
+
export const __internals = { recordErrors, appendRecord, readLines, nowIso, newId, refreshTasks, syncArtifacts, SCAFFOLD_SUPPORTED }
|
package/lib/dashboard.js
CHANGED
|
@@ -76,7 +76,7 @@ export function renderDashboard(rows, parent, now) {
|
|
|
76
76
|
<td>${phaseLabel(r.phase)}</td>
|
|
77
77
|
<td>${htmlEsc(r.focus)}</td>
|
|
78
78
|
<td>${blockText}</td>
|
|
79
|
-
<td><a href="
|
|
79
|
+
<td><a href="../${encodeURIComponent(r.dir)}/TASKS.html" title="任务清单">${r.logCount} 条</a></td>
|
|
80
80
|
<td class="muted">${htmlEsc(r.updated_at)}</td>
|
|
81
81
|
</tr>`
|
|
82
82
|
}
|
package/lib/handoff.js
CHANGED
|
@@ -79,7 +79,7 @@ export function buildHandoff(root, { maxTail = 10 } = {}) {
|
|
|
79
79
|
agents: join(root, 'AGENTS.md'),
|
|
80
80
|
status: join(root, '.ai', 'status.json'),
|
|
81
81
|
log: join(root, '.ai', 'log.jsonl'),
|
|
82
|
-
tasks: join(root, 'TASKS.md'),
|
|
82
|
+
tasks: join(root, '.ai', 'TASKS.md'),
|
|
83
83
|
boot: join(root, '.ai', 'SESSION_BOOT.md'),
|
|
84
84
|
disciplines: join(root, '.ai', 'disciplines', 'disciplines.json'),
|
|
85
85
|
},
|
|
@@ -102,7 +102,7 @@ export function renderSessionBoot(packet) {
|
|
|
102
102
|
'2. `AGENTS.md`:§1 项目事实、§3 权限表、§8 纪律清单;',
|
|
103
103
|
'3. `.ai/status.json`:当前状态快照;',
|
|
104
104
|
`4. \`.ai/log.jsonl\` 最近 ${packet.recent.length} 条(§3 已摘录,需要细节再回读);`,
|
|
105
|
-
'5. `TASKS.
|
|
105
|
+
'5. `.ai/TASKS.md`(存在时):任务记录清单;根目录 `TASKS.html` 是它的可视化版;',
|
|
106
106
|
'6. `.ai/disciplines/disciplines.json` 与启用规则(存在时)。',
|
|
107
107
|
'',
|
|
108
108
|
'## 2. 当前状态',
|
package/lib/plan.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `ai_plan` data layer: `.ai/plan.json` (structured plan/checklist/risks)
|
|
3
|
-
* and its rendered outputs `.ai/PLAN.md` and
|
|
3
|
+
* and its rendered outputs `.ai/PLAN.md` and `.ai/TASKS.md` (three-section,
|
|
4
|
+
* markdown archive) + `TASKS.html` (project-root visual page).
|
|
4
5
|
*
|
|
5
6
|
* plan.json 写入走原子写 + 项目级锁(与 appendRecord 同级保护)。
|
|
6
|
-
* TASKS.md /
|
|
7
|
+
* 渲染产物(.ai/TASKS.md / .ai/PLAN.md / TASKS.html)不手改:根目录只留
|
|
8
|
+
* 用户要读的 AGENTS.md 与 HTML 页面,markdown 清单归 `.ai/`。
|
|
7
9
|
*/
|
|
8
10
|
import { existsSync, mkdirSync } from 'node:fs'
|
|
9
11
|
import { join } from 'node:path'
|
|
@@ -34,7 +36,7 @@ export function emptyPlan() {
|
|
|
34
36
|
|
|
35
37
|
function planPath(root) { return join(root, '.ai', 'plan.json') }
|
|
36
38
|
function planMdPath(root) { return join(root, '.ai', 'PLAN.md') }
|
|
37
|
-
function tasksMdPath(root) { return join(root, 'TASKS.md') }
|
|
39
|
+
function tasksMdPath(root) { return join(root, '.ai', 'TASKS.md') }
|
|
38
40
|
|
|
39
41
|
/** 需要锁保护的动作统一走这里。 */
|
|
40
42
|
function planLockPath(root) { return join(root, '.ai', '.plan.lock') }
|
|
@@ -321,7 +323,7 @@ ${records.length === 0 && !hasPlan ? '<div class="placeholder">暂无记录与
|
|
|
321
323
|
|
|
322
324
|
// ---------------------------------------------------------------- write all renders
|
|
323
325
|
|
|
324
|
-
/** 一次写 TASKS.md + TASKS.html + PLAN.md(在锁内)。 */
|
|
326
|
+
/** 一次写 .ai/TASKS.md + TASKS.html + .ai/PLAN.md(在锁内)。 */
|
|
325
327
|
export function writeAllRenders(root, records, now, projectName) {
|
|
326
328
|
mkdirSync(join(root, '.ai'), { recursive: true })
|
|
327
329
|
const plan = readPlan(root)
|
package/lib/tasks.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Task-list renderer: reads `.ai/log.jsonl`, writes three-section
|
|
3
|
-
* + `TASKS.html` (dashboard-style) +
|
|
2
|
+
* Task-list renderer: reads `.ai/log.jsonl`, writes three-section `.ai/TASKS.md`
|
|
3
|
+
* (markdown archive) + root `TASKS.html` (dashboard-style visual page) +
|
|
4
|
+
* `.ai/PLAN.md` (from .ai/plan.json).
|
|
4
5
|
*
|
|
6
|
+
* 根目录只留用户要读的文件:AGENTS.md 与 HTML 页面;markdown 清单归档在 `.ai/`。
|
|
5
7
|
* Plan-aware rendering is delegated to `lib/plan.js`; this module keeps the
|
|
6
8
|
* record parsing and provides `writeTasks` for index.js.
|
|
7
9
|
*/
|
|
@@ -25,7 +27,7 @@ export function parseRecords(text) {
|
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
|
-
* Write
|
|
30
|
+
* Write `.ai/TASKS.md` + `<root>/TASKS.html` + `.ai/PLAN.md`.
|
|
29
31
|
*
|
|
30
32
|
* When `.ai/plan.json` exists the TASKS files include plan/checklist/risks
|
|
31
33
|
* sections before the log table; otherwise they fall back to a log-only view.
|
|
@@ -35,7 +37,7 @@ export function parseRecords(text) {
|
|
|
35
37
|
*/
|
|
36
38
|
export function writeTasks(root, now, projectName) {
|
|
37
39
|
const logFile = join(root, '.ai', 'log.jsonl')
|
|
38
|
-
const outFile = join(root, 'TASKS.md')
|
|
40
|
+
const outFile = join(root, '.ai', 'TASKS.md')
|
|
39
41
|
if (!existsSync(logFile)) return { written: false, count: 0, path: outFile }
|
|
40
42
|
const records = parseRecords(readFileSync(logFile, 'utf8'))
|
|
41
43
|
mkdirSync(join(root, '.ai'), { recursive: true })
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ai-collab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"os": [
|
|
5
5
|
"win32"
|
|
6
6
|
],
|
|
7
|
-
"description": "DeepSeek Harness bundle: AI collaboration layer (status/log/check/plan tools, disciplines, handoff, workspace scaffold) built around AGENTS.md and .ai/",
|
|
7
|
+
"description": "DeepSeek Harness bundle: AI collaboration layer (status/log/check/plan tools, disciplines, handoff, workspace scaffold, auto-rendered HTML views) built around AGENTS.md and .ai/",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./index.js",
|
|
10
10
|
"exports": {
|
package/template/.ai/llm.ps1
CHANGED
|
@@ -734,7 +734,8 @@ Record work through `.ai\llm.cmd` (status / tail / add / check). Never rewrite t
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
function Invoke-Tasks([string]$ProjectRoot) {
|
|
737
|
-
#
|
|
737
|
+
# 生成人读的任务记录清单:<项目根>\.ai\TASKS.md(来源 log.jsonl,追加语义不变)
|
|
738
|
+
# 根目录只留 AGENTS.md 与可视化 HTML(TASKS.html 由插件渲染),markdown 归 .ai\
|
|
738
739
|
$rows = @()
|
|
739
740
|
foreach ($line in (Get-LogLines $ProjectRoot)) {
|
|
740
741
|
$rec = $null
|
|
@@ -763,7 +764,7 @@ function Invoke-Tasks([string]$ProjectRoot) {
|
|
|
763
764
|
}
|
|
764
765
|
if ($rows.Count -eq 0) { [void]$sb.AppendLine('| (暂无记录) | | | | |') }
|
|
765
766
|
|
|
766
|
-
$out = Join-Path $ProjectRoot 'TASKS.md'
|
|
767
|
+
$out = Join-Path $ProjectRoot '.ai\TASKS.md'
|
|
767
768
|
$lock = Join-Path $ProjectRoot '.ai\.tasks.lock'
|
|
768
769
|
[void](Enter-ProjectLock $lock)
|
|
769
770
|
try { Write-TextAtomic $out ($sb.ToString().Replace("`r`n", "`n")) }
|
|
@@ -987,7 +988,7 @@ AI 协作层 v2 — .ai\llm.ps1
|
|
|
987
988
|
.ai\llm.ps1 archive [-Before yyyy-MM-dd] [-MaxMB 2] [-Force]
|
|
988
989
|
.ai\llm.ps1 board [-Root <project-root>] [-Out <path>]
|
|
989
990
|
.ai\llm.ps1 doctor
|
|
990
|
-
.ai\llm.ps1 tasks # 生成
|
|
991
|
+
.ai\llm.ps1 tasks # 生成 .ai\TASKS.md(任务记录清单;根目录 TASKS.html 由插件渲染)
|
|
991
992
|
|
|
992
993
|
示例:
|
|
993
994
|
& .ai\llm.ps1 add -Tool deepseek-harness -Action fix -Status ok `
|