dsh-ai-collab 0.4.3 → 0.5.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.template.md +10 -0
- package/CHANGELOG.md +47 -0
- package/README.md +101 -12
- package/docs/DETAIL.md +36 -7
- package/docs/DISCLAIMER.md +54 -0
- package/docs/MARKET.md +1 -1
- package/docs/NONCOMMERCIAL-NOTICE.md +34 -0
- package/docs/index.html +1257 -0
- package/index.js +202 -17
- package/install.ps1 +106 -5
- package/lib/atomic.js +83 -0
- package/lib/disciplines.js +300 -0
- package/lib/handoff.js +174 -0
- package/lib/lock.js +70 -0
- package/lib/tasks.js +3 -2
- package/package.json +4 -4
- package/template/.ai/llm.ps1 +62 -12
package/AGENTS.template.md
CHANGED
|
@@ -91,6 +91,16 @@
|
|
|
91
91
|
1. **用户级一次性转发**(推荐,项目内零冗余):`~\.claude\CLAUDE.md` 写"若存在 ./AGENTS.md 则遵循";Gemini 在 `~\.gemini\settings.json` 设 `"contextFileName": "AGENTS.md"`。
|
|
92
92
|
2. **临时落地**:`& .ai\llm.cmd entries -Publish` 生成 4 个转发文件,用完 `& .ai\llm.cmd entries -Remove` 收回。
|
|
93
93
|
- 转发母版常驻 `.ai\entries\`;改规则只改本文件,`entries -Publish -Force` 会同步。
|
|
94
|
+
## 8. 纪律清单(自动生成,勿手改)
|
|
95
|
+
|
|
96
|
+
> 全局纪律由 `$DSH_HOME\AGENTS.md` 注入(对所有会话生效);项目纪律的“启用”表示正文已内联在本节,
|
|
97
|
+
> 真正进入当前项目的提示词;“停用”只保留清单行,不生效。
|
|
98
|
+
> 管理入口:DSH 工具 `ai_discipline`(list / add / enable / disable / remove / global-*);
|
|
99
|
+
> 改动后由 `ai-ensure` 重渲染本节。
|
|
100
|
+
|
|
101
|
+
{{DISCIPLINE_TABLE}}
|
|
102
|
+
|
|
103
|
+
{{DISCIPLINE_RULES}}
|
|
94
104
|
<!-- dsh-ai-collab:generated:end -->
|
|
95
105
|
|
|
96
106
|
<!-- dsh-ai-collab:user:start -->
|
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
- Disciplines: global modules + project rules.
|
|
6
|
+
- New `ai_discipline` tool: `list/add/enable/disable/remove` for
|
|
7
|
+
`.ai/disciplines/disciplines.json` + `.ai/disciplines/rules/<id>.md`;
|
|
8
|
+
`global-list/global-migrate/global-add/global-enable/global-disable/global-remove`
|
|
9
|
+
for `$DSH_HOME/disciplines/`.
|
|
10
|
+
- `global-migrate` splits an existing `$DSH_HOME/AGENTS.md` into `g0.md … gN.md` + a registry,
|
|
11
|
+
then rewrites `AGENTS.md` as a marker line plus the original text (byte-for-byte, backup
|
|
12
|
+
first). Toggling a module re-renders the injected file, so a disabled section really stops
|
|
13
|
+
being injected.
|
|
14
|
+
- Project rules render into a new **§8** of `AGENTS.md`: a table of global `G*` and project
|
|
15
|
+
`P-*` rows, plus the inline body of every enabled rule. `ai_check` reports drift
|
|
16
|
+
(`on-rule` / `off-rule` / registry unreadable).
|
|
17
|
+
- Cross-session handoff: new `ai_handoff` tool (`read` / `write` / `inherit`) and
|
|
18
|
+
`.ai/SESSION_BOOT.md`, regenerated by `ai_log`, `ai_init` and `autoInit`. It carries the status
|
|
19
|
+
snapshot, the most recent records, the discipline list, and an inheritance prompt for a new
|
|
20
|
+
session. `read` returns the file text itself (generating the file first if it is missing).
|
|
21
|
+
- Concurrency and file protection: `lib/atomic.js` (temp file + `fsync` + rename, retry on
|
|
22
|
+
`EPERM`/`EBUSY`/`EACCES`) and `lib/lock.js` (cross-process lock with stale detection).
|
|
23
|
+
`ai_log` holds `.ai/.log.lock` across the append and status update; `status.json` gains a
|
|
24
|
+
`rev`; `TASKS.md` and `SESSION_BOOT.md` are written atomically. `template/.ai/llm.ps1` gets
|
|
25
|
+
`Write-TextAtomic` + `Enter-ProjectLock`/`Exit-ProjectLock` for `add`, `tasks`, `board` and
|
|
26
|
+
`archive` (archive aborts if the log grew during the copy). `install.ps1` writes `AGENTS.md`
|
|
27
|
+
atomically and backs it up to `.ai/backups/` (last 10) before any change.
|
|
28
|
+
- Tests: 25 (tool contract, config, task rendering, AGENTS.md preservation, atomic/lock,
|
|
29
|
+
discipline registry and §8 drift, handoff).
|
|
30
|
+
- Verified on a real workspace: project rule add/disable/enable/remove, global module
|
|
31
|
+
disable/enable (bytes 5900 → 5671 → 5900), 12 concurrent writers → 12 records with `rev=12`,
|
|
32
|
+
6 concurrent `llm.ps1 add` calls without loss.
|
|
33
|
+
- Docs: README gains a "What's new in 0.5.0" summary and the discipline/concurrency sections;
|
|
34
|
+
`docs/DETAIL.md` and the visual introduction page are refreshed for 0.5.0.
|
|
35
|
+
|
|
36
|
+
## 0.4.4
|
|
37
|
+
|
|
38
|
+
- Docs/legal: add `docs/DISCLAIMER.md` (AS IS, limitation of liability, backup guidance)
|
|
39
|
+
and `docs/NONCOMMERCIAL-NOTICE.md` (advisory non-commercial request). `LICENSE` stays MIT;
|
|
40
|
+
both notices state that MIT permits commercial use and the request is not a license condition.
|
|
41
|
+
- README: License section links both documents; status line now notes the bundle is listed in
|
|
42
|
+
the community plugin market (it was already listed; the text was stale).
|
|
43
|
+
- Republish so the npm README shows the **Visual introduction** link
|
|
44
|
+
(<https://zhuyw3927.github.io/dsh-ai-collab/>), which was added after 0.4.3.
|
|
45
|
+
- `docs/index.html` refreshed to 0.4.4 and links the disclaimer / non-commercial notice.
|
|
46
|
+
- No runtime behaviour changes.
|
|
47
|
+
|
|
3
48
|
## 0.4.3
|
|
4
49
|
|
|
50
|
+
- Published to npm as `dsh-ai-collab@0.4.3` (2026-11-17).
|
|
51
|
+
|
|
5
52
|
- Repository metadata: `repository`, `homepage`, `bugs` point at the public GitHub repository;
|
|
6
53
|
`README` carries the CI badge; `.gitignore` added for release artifacts.
|
|
7
54
|
- Market checklist updated now that the repository exists.
|
package/README.md
CHANGED
|
@@ -9,7 +9,30 @@ A [DeepSeek Harness](https://github.com/deepseek-ai) bundle that adds a **projec
|
|
|
9
9
|
|
|
10
10
|
The point: any AI tool working in the repo (DSH, Claude Code, Cursor, Copilot, Codex) reads and writes the same progress, instead of rediscovering the project every session.
|
|
11
11
|
|
|
12
|
-
>
|
|
12
|
+
> **Visual introduction (中文):** <https://ZhuYw3927.github.io/dsh-ai-collab/>
|
|
13
|
+
|
|
14
|
+
> Status: **0.5.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.5.0
|
|
17
|
+
|
|
18
|
+
- **Disciplines are now first-class.** `AGENTS.md` gains a generated **§8 discipline list**: global
|
|
19
|
+
modules (`G0…`) plus project rules (`P-*`), each marked enabled/disabled with its source file.
|
|
20
|
+
Enabled project rules are inlined, so they actually constrain the session; disabled ones stay as
|
|
21
|
+
a visible row only.
|
|
22
|
+
- **`ai_discipline`** manages both levels from a DSH tool: `list/add/enable/disable/remove` for the
|
|
23
|
+
project (`.ai/disciplines/`), `global-list/global-migrate/global-add/global-enable/global-disable/global-remove`
|
|
24
|
+
for `$DSH_HOME/disciplines/`. Toggling a global module re-renders `$DSH_HOME/AGENTS.md` from the
|
|
25
|
+
enabled modules only — a disabled section really disappears from the prompt.
|
|
26
|
+
- **`ai_handoff` + `.ai/SESSION_BOOT.md`**: a new session reads one file to load the status
|
|
27
|
+
snapshot, the recent records, the discipline list and an inheritance prompt, instead of guessing
|
|
28
|
+
from a long log. Regenerated by `ai_log`, `ai_init` and `autoInit`; `read` returns the file text.
|
|
29
|
+
- **Concurrency and file protection**: cross-process locks (`lib/lock.js`) plus atomic writes
|
|
30
|
+
(`lib/atomic.js` — temp file, `fsync`, rename, retry on `EPERM`/`EBUSY`/`EACCES`).
|
|
31
|
+
`status.json` carries an incrementing `rev`; `TASKS.md` and `SESSION_BOOT.md` are written
|
|
32
|
+
atomically; `llm.ps1` mirrors both mechanisms; `AGENTS.md` rewrites are backed up to
|
|
33
|
+
`.ai/backups/` (last 10). `ai_check` also fails on §8 drift.
|
|
34
|
+
- Verified by 25 tests (atomic/lock, discipline registry, §8 drift, handoff) and by a real burst:
|
|
35
|
+
12 concurrent writers → 12 records, one unique id each, `rev=12`.
|
|
13
36
|
|
|
14
37
|
## Requirements
|
|
15
38
|
|
|
@@ -78,10 +101,12 @@ index generated by `scripts/make-market-index.mjs`.
|
|
|
78
101
|
| Tool | Does |
|
|
79
102
|
|---|---|
|
|
80
103
|
| `ai_status` | Reads `.ai/status.json` + the last N log records (start a session here) |
|
|
81
|
-
| `ai_log` | Appends one record to `.ai/log.jsonl`; rejects invalid enums, requires `issue` for `blocked`/`failed`; refreshes `status.json
|
|
82
|
-
| `ai_check` | Validates every record: required fields, enums, timezone, monotonic `ts`, unique `id
|
|
104
|
+
| `ai_log` | Appends one record to `.ai/log.jsonl`; rejects invalid enums, requires `issue` for `blocked`/`failed`; refreshes `status.json`, the sibling board, `TASKS.md` and `.ai/SESSION_BOOT.md` |
|
|
105
|
+
| `ai_check` | Validates every record: required fields, enums, timezone, monotonic `ts`, unique `id`; audits the §8 discipline list for drift |
|
|
83
106
|
| `ai_board` | Read-only roll-up of sibling projects' `.ai/status.json` |
|
|
84
107
|
| `ai_init` | Ensures the workspace: scaffold if missing, refresh stale `.ai/`/`AGENTS.md`, refresh stale board (idempotent) |
|
|
108
|
+
| `ai_discipline` | Lists, adds, enables, disables and removes project disciplines; migrates/toggles the global discipline modules in `$DSH_HOME` |
|
|
109
|
+
| `ai_handoff` | Reads or rewrites the cross-session handoff packet (`.ai/SESSION_BOOT.md`) and returns an inheritance prompt |
|
|
85
110
|
|
|
86
111
|
## What `ai_init` creates
|
|
87
112
|
|
|
@@ -91,7 +116,9 @@ index generated by `scripts/make-market-index.mjs`.
|
|
|
91
116
|
└─ .ai\
|
|
92
117
|
├─ llm.ps1, llm.cmd ← CLI: status / tail / add / check / entries / archive / board / doctor
|
|
93
118
|
├─ log.jsonl ← append-only, UTF-8 no BOM, LF
|
|
94
|
-
├─ status.json ← current state (overwritten)
|
|
119
|
+
├─ status.json ← current state (overwritten, `rev` increments)
|
|
120
|
+
├─ SESSION_BOOT.md ← cross-session handoff packet (regenerated on demand)
|
|
121
|
+
├─ disciplines\ ← project discipline registry + rules\*.md
|
|
95
122
|
├─ LOG_FORMAT.md, SECURITY.md, schema\log.schema.json
|
|
96
123
|
├─ changelog\ ← version-level docs + patch engine
|
|
97
124
|
├─ entries\ ← forwarding-file masters (publish on demand)
|
|
@@ -128,7 +155,7 @@ Get-Content "$DSH_HOME\logs\ai-collab-tools.log" -Tail 3 # tools=ai_status,…
|
|
|
128
155
|
```
|
|
129
156
|
|
|
130
157
|
- A fresh boot line means `apply()` ran in this process.
|
|
131
|
-
- A `tools=` line means all
|
|
158
|
+
- A `tools=` line means all seven tools registered; `spec` shows where `@deepseek-ai/dsh-tools` was loaded from.
|
|
132
159
|
- `load-failed` / `register-failed` lines carry the exact resolution errors.
|
|
133
160
|
|
|
134
161
|
The plugin is mounted from outside `app.asar` (a `link:`/absolute path), so the bare `@deepseek-ai/dsh-tools` specifier is not resolvable; it is loaded from the host's real `app.asar` path instead (see `asarRoots()` in `index.js`). `DSH_HOME` is read from the host environment and may be absent when the app is launched from Explorer — the plugin then falls back to `~/.dsh` (`home=homedir`).
|
|
@@ -150,7 +177,33 @@ The plugin is mounted from outside `app.asar` (a `link:`/absolute path), so the
|
|
|
150
177
|
- 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.
|
|
151
178
|
- Explicit migration only:
|
|
152
179
|
- `-ForceAgents` — rebuild the generated zone and move the whole old file into the user zone (nothing deleted);
|
|
153
|
-
- `-ResetAgents` — discard old content and write the template (destructive, explicit).
|
|
180
|
+
- `-ResetAgents` — discard old content and write the template (destructive, explicit; the old file is backed up to `.ai/backups/` first).
|
|
181
|
+
|
|
182
|
+
## Disciplines: global modules and project rules
|
|
183
|
+
|
|
184
|
+
### Global (`$DSH_HOME`)
|
|
185
|
+
|
|
186
|
+
- `$DSH_HOME/AGENTS.md` stays the file DSH injects into every session. `ai_discipline` with
|
|
187
|
+
`action:"global-migrate"` splits it into `$DSH_HOME/disciplines/g0.md … gN.md` plus
|
|
188
|
+
`$DSH_HOME/disciplines/disciplines.json`, then rewrites `AGENTS.md` as **one marker line + the
|
|
189
|
+
original text, byte-for-byte**. Nothing is deleted; a timestamped copy is written first.
|
|
190
|
+
- `global-list` / `global-enable` / `global-disable` / `global-add` / `global-remove` manage the
|
|
191
|
+
modules. Every change re-renders `AGENTS.md` from the enabled modules only.
|
|
192
|
+
- Disabling a global module is real: the text disappears from the injected file. It cannot be
|
|
193
|
+
overridden per project, because DSH injects the global file unconditionally.
|
|
194
|
+
|
|
195
|
+
### Project (`.ai/disciplines/`)
|
|
196
|
+
|
|
197
|
+
- Registry: `.ai/disciplines/disciplines.json`; rule bodies: `.ai/disciplines/rules/<id>.md`.
|
|
198
|
+
- `ai_discipline action:"add" | "enable" | "disable" | "remove"` edits the registry and re-renders
|
|
199
|
+
the workspace. Section **§8** of `AGENTS.md` (generated zone) lists every global module (G0…,
|
|
200
|
+
read-only) and every project rule (P-…). The body of each **enabled** project rule is inlined
|
|
201
|
+
into §8, so it is part of the prompt of the project; a disabled rule keeps only its table row.
|
|
202
|
+
- `ai_check` audits §8 against the registry and reports drift: an enabled rule whose body is
|
|
203
|
+
missing, a disabled rule still inlined, or a registry that cannot be read.
|
|
204
|
+
- Raw format is intentionally plain: any human can edit the registry or the rule files; the next
|
|
205
|
+
`ai-ensure` / `install.ps1` render will pick them up.
|
|
206
|
+
|
|
154
207
|
## Safety
|
|
155
208
|
|
|
156
209
|
- The log is **append-only**; corrections are new records (`action:"correction"`), never edits.
|
|
@@ -160,6 +213,24 @@ The plugin is mounted from outside `app.asar` (a `link:`/absolute path), so the
|
|
|
160
213
|
- **Task lists are rendered inside the plugin** (`lib/tasks.js`); the plugin never executes a
|
|
161
214
|
workspace-provided `.ai/llm.ps1`, so cloning a hostile repository and logging cannot run its code.
|
|
162
215
|
|
|
216
|
+
## Concurrency and file protection
|
|
217
|
+
|
|
218
|
+
- `lib/atomic.js` writes to a same-directory temp file, `fsync`s and renames (retries on
|
|
219
|
+
`EPERM`/`EBUSY`/`EACCES`), so a reader never sees a half-written `status.json`, `TASKS.md` or
|
|
220
|
+
`SESSION_BOOT.md`.
|
|
221
|
+
- `lib/lock.js` is a cross-process lock (`openSync(path, 'wx')`), stale after 30 s, 15 s timeout.
|
|
222
|
+
`ai_log` holds `.ai/.log.lock` across the append **and** the status update; `status.json`
|
|
223
|
+
carries a `rev` that increments on each write.
|
|
224
|
+
- `TASKS.md` refresh holds `.ai/.tasks.lock`; `SESSION_BOOT.md` is written atomically.
|
|
225
|
+
- `template/.ai/llm.ps1` mirrors this in PowerShell: `Write-TextAtomic` (temp + `File.Replace`),
|
|
226
|
+
`Enter-ProjectLock` / `Exit-ProjectLock` around `add`, `tasks`, `board` and `archive`; `archive`
|
|
227
|
+
aborts if the log grew while it was copying.
|
|
228
|
+
- `install.ps1` writes `AGENTS.md` atomically and backs it up to
|
|
229
|
+
`.ai/backups/AGENTS.<stamp>.md` (last 10) before any change.
|
|
230
|
+
- Boundaries: this is **cooperative** locking between this plugin and `.ai/llm.cmd`, not an
|
|
231
|
+
OS-level guarantee. Editors that ignore the lock can still race. `initScript` is trusted
|
|
232
|
+
configuration — never point it at untrusted code.
|
|
233
|
+
|
|
163
234
|
## Uninstall
|
|
164
235
|
|
|
165
236
|
1. Remove `dsh-ai-collab` from `dsh.profile.bundles` (or set `enabled: false` on its row) and restart.
|
|
@@ -168,16 +239,21 @@ The plugin is mounted from outside `app.asar` (a `link:`/absolute path), so the
|
|
|
168
239
|
|
|
169
240
|
## Global discipline (user level)
|
|
170
241
|
|
|
171
|
-
The bundle ships tools and workspace scaffolding, not a user-level instruction file.
|
|
172
|
-
the mandatory "step 0" behaviour in every session
|
|
173
|
-
|
|
174
|
-
|
|
242
|
+
The bundle ships tools and workspace scaffolding, not a user-level instruction file. Two ways to
|
|
243
|
+
get the mandatory "step 0" behaviour in every session:
|
|
244
|
+
|
|
245
|
+
- **Fresh machine**: copy [`AGENTS.global.template.md`](AGENTS.global.template.md) to
|
|
246
|
+
`$DSH_HOME/AGENTS.md`.
|
|
247
|
+
- **Existing `AGENTS.md`**: call `ai_discipline` with `action:"global-migrate"`. It backs up the
|
|
248
|
+
file, splits it into `$DSH_HOME/disciplines/gN.md` + `disciplines.json`, and rewrites
|
|
249
|
+
`AGENTS.md` as a single marker plus the original text (byte-for-byte). Then use
|
|
250
|
+
`global-disable` / `global-enable` to switch individual sections off or on.
|
|
175
251
|
|
|
176
252
|
## Development
|
|
177
253
|
|
|
178
254
|
```powershell
|
|
179
255
|
npm run check # node --check index.js + lib/*.js
|
|
180
|
-
npm test #
|
|
256
|
+
npm test # 25 tests: tool contract, config, task rendering, AGENTS.md preservation, atomic/lock/discipline/handoff
|
|
181
257
|
npm pack --dry-run
|
|
182
258
|
```
|
|
183
259
|
|
|
@@ -189,9 +265,22 @@ npm pack --dry-run
|
|
|
189
265
|
return `unsupported-platform` instead of failing silently.
|
|
190
266
|
- Config values are normalised in-process (no schemastery `Config` yet); invalid values produce warnings in `$DSH_HOME/logs/ai-collab-config.log`.
|
|
191
267
|
- A legacy `AGENTS.md` without zone markers is frozen by design; migrate explicitly with `-ForceAgents` or `-ResetAgents`.
|
|
268
|
+
- Global discipline toggles rewrite `$DSH_HOME/AGENTS.md`. They only work after `global-migrate`
|
|
269
|
+
has produced the marker + `disciplines/` directory; `global-enable` of a missing module is
|
|
270
|
+
rejected. A global module cannot be disabled for one project only — DSH injects the file
|
|
271
|
+
unconditionally.
|
|
272
|
+
- Section §8 of a project `AGENTS.md` is refreshed by `ai-ensure` / `install.ps1`; a rule added
|
|
273
|
+
while no render runs appears after the next `ai_init`, `ai_discipline` change, or session start.
|
|
274
|
+
- The locking is cooperative (plugin + `.ai/llm.cmd`); external editors are not blocked.
|
|
192
275
|
- The forwarding files for Claude Code / Gemini CLI are only masters under `.ai/entries/`; publish them with `.ai\llm.cmd entries -Publish` when a tool needs auto-discovery.
|
|
193
276
|
- Publishing is not automated yet — see `PUBLISH.md`.
|
|
194
277
|
|
|
195
278
|
## License
|
|
196
279
|
|
|
197
|
-
MIT — see [LICENSE](LICENSE).
|
|
280
|
+
MIT — see [LICENSE](LICENSE). MIT permits commercial use.
|
|
281
|
+
|
|
282
|
+
- [Disclaimer](docs/DISCLAIMER.md) — the software is provided "AS IS", without warranty;
|
|
283
|
+
back up your workspace before use and review generated changes.
|
|
284
|
+
- [Non-commercial request](docs/NONCOMMERCIAL-NOTICE.md) — the author asks you to prefer
|
|
285
|
+
non-commercial use. This is a request, **not** a license condition: MIT still grants
|
|
286
|
+
commercial rights, and the notice adds no restriction.
|
package/docs/DETAIL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-ai-collab
|
|
2
2
|
|
|
3
|
-
A DeepSeek Harness bundle that gives every AI tool in a repository the same project memory:
|
|
3
|
+
A DeepSeek Harness bundle that gives every AI tool in a repository the same project memory (visual introduction: <https://ZhuYw3927.github.io/dsh-ai-collab/>):
|
|
4
4
|
one `AGENTS.md` entry file and one hidden `.ai/` folder holding an append-only work log,
|
|
5
5
|
a current-state snapshot, and version-level change notes.
|
|
6
6
|
|
|
@@ -14,18 +14,31 @@ files that any tool can read: `AGENTS.md` for facts, `.ai/log.jsonl` for history
|
|
|
14
14
|
|
|
15
15
|
| Capability | Detail |
|
|
16
16
|
|---|---|
|
|
17
|
-
|
|
|
17
|
+
| Seven tools | `ai_status`, `ai_log`, `ai_check`, `ai_board`, `ai_init`, `ai_discipline`, `ai_handoff` |
|
|
18
18
|
| Auto-adoption | On `session/created` (`autoInit: true`) run `ai-ensure` in non-temp directories: scaffold when missing, upgrade when the template changed, refresh the board when stale |
|
|
19
|
-
| Zoned `AGENTS.md` | A `generated` zone (routing, permissions, commands) replaced on upgrade, and a `user` zone (project facts, sampling data, analysis methods, decisions) preserved byte-for-byte |
|
|
20
|
-
|
|
|
19
|
+
| Zoned `AGENTS.md` | A `generated` zone (routing, permissions, commands, §8 discipline list) replaced on upgrade, and a `user` zone (project facts, sampling data, analysis methods, decisions) preserved byte-for-byte |
|
|
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
|
+
| Handoff | `.ai/SESSION_BOOT.md` carries status, recent records, disciplines and an inheritance prompt; regenerated by `ai_log` / `ai_init` / `autoInit` |
|
|
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 |
|
|
21
23
|
| Task list | When `.ai/tasks-enabled` exists, `ai_log` and `ai-ensure` refresh `TASKS.md` at the workspace root |
|
|
22
24
|
| Cross-project board | When a sibling `.ai/board.md` exists, the board is refreshed after a record is written |
|
|
25
|
+
| Concurrency | `lib/lock.js` cross-process lock + `lib/atomic.js` temp/fsync/rename; `status.json` has a `rev`; PowerShell `llm.ps1` mirrors both |
|
|
26
|
+
|
|
27
|
+
## What's new in 0.5.0
|
|
28
|
+
|
|
29
|
+
| Change | Effect |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Discipline list | `AGENTS.md` §8 lists global modules (`G*`) and project rules (`P-*`); enabled project rules are inlined, disabled ones only listed |
|
|
32
|
+
| `ai_discipline` | Manages project rules (`.ai/disciplines/`) and global modules (`$DSH_HOME/disciplines/`), including `global-migrate` and per-module toggles that really re-render the injected file |
|
|
33
|
+
| `ai_handoff` | `.ai/SESSION_BOOT.md` carries status, recent records, disciplines and an inheritance prompt; `read` returns the text |
|
|
34
|
+
| Concurrency | Cross-process lock + atomic writes for log, status (`rev`), `TASKS.md`, `SESSION_BOOT.md` and `AGENTS.md` (with backups); `llm.ps1` mirrors the protocol |
|
|
35
|
+
| Drift audit | `ai_check` reports §8 drift (enabled rule not inlined, disabled rule still inlined, registry unreadable) |
|
|
23
36
|
|
|
24
37
|
## Install
|
|
25
38
|
|
|
26
39
|
- **Plugin Manager (recommended):** Plugins → Add plugin → select this package directory.
|
|
27
40
|
- **CLI:** `dsh plugin --profile <profile> add <package path or npm name>`
|
|
28
|
-
- Restart DSH once; every session in the profile then exposes the
|
|
41
|
+
- Restart DSH once; every session in the profile then exposes the seven tools.
|
|
29
42
|
|
|
30
43
|
## Configuration
|
|
31
44
|
|
|
@@ -47,7 +60,9 @@ Values are normalised and invalid values are reported as warnings in
|
|
|
47
60
|
└─ .ai/
|
|
48
61
|
├─ llm.ps1 / llm.cmd status / tail / add / check / board / doctor / tasks
|
|
49
62
|
├─ log.jsonl append-only, UTF-8 without BOM, LF
|
|
50
|
-
├─ status.json current-state snapshot (overwritten)
|
|
63
|
+
├─ status.json current-state snapshot (overwritten, `rev` increments)
|
|
64
|
+
├─ SESSION_BOOT.md cross-session handoff packet
|
|
65
|
+
├─ disciplines/ project discipline registry + rules/
|
|
51
66
|
├─ LOG_FORMAT.md / SECURITY.md / schema/log.schema.json
|
|
52
67
|
├─ changelog/ version-level notes and patches
|
|
53
68
|
├─ entries/ forwarding masters for Claude Code / Gemini CLI
|
|
@@ -68,6 +83,9 @@ A record is one JSON object per line:
|
|
|
68
83
|
- Adoption writes only into the workspace, never into system or temp directories.
|
|
69
84
|
- The plugin performs no network requests and stores no credentials.
|
|
70
85
|
- Task rendering runs inside the plugin; it never executes a workspace-provided script.
|
|
86
|
+
- Writes are atomic (temp + `fsync` + rename) and record/status updates take `.ai/.log.lock`;
|
|
87
|
+
PowerShell `llm.ps1` uses the same lock protocol. This is cooperative, not an OS guarantee.
|
|
88
|
+
- `install.ps1` backs up `AGENTS.md` to `.ai/backups/` (last 10) before changing it.
|
|
71
89
|
|
|
72
90
|
## Compatibility
|
|
73
91
|
|
|
@@ -83,7 +101,18 @@ A record is one JSON object per line:
|
|
|
83
101
|
- The bundle declares no display icon fallback for hosts older than the locale/meta support.
|
|
84
102
|
- A legacy `AGENTS.md` without zone markers is frozen by design; migrate explicitly with
|
|
85
103
|
`install.ps1 -ForceAgents` (moves old content into the user zone) or `-ResetAgents`.
|
|
104
|
+
- Global discipline toggles require a prior `ai_discipline global-migrate`; they rewrite
|
|
105
|
+
`$DSH_HOME/AGENTS.md`, and a global module cannot be disabled for a single project.
|
|
106
|
+
- §8 of a project `AGENTS.md` refreshes on the next `ai-ensure` / `install.ps1` render.
|
|
86
107
|
|
|
87
108
|
## License
|
|
88
109
|
|
|
89
|
-
MIT.
|
|
110
|
+
MIT. MIT permits commercial use.
|
|
111
|
+
|
|
112
|
+
- [Disclaimer](DISCLAIMER.md) — the software is provided "AS IS", without warranty; back up
|
|
113
|
+
your workspace and review generated changes before committing.
|
|
114
|
+
- [Non-commercial request](NONCOMMERCIAL-NOTICE.md) — the author asks you to prefer
|
|
115
|
+
non-commercial use. This is a request, not a license condition; MIT still grants
|
|
116
|
+
commercial rights and the notice adds no restriction.
|
|
117
|
+
|
|
118
|
+
Using the bundle means you have read and accepted the disclaimer.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Disclaimer
|
|
2
|
+
|
|
3
|
+
`dsh-ai-collab` is provided **"AS IS"**, without warranty of any kind, express or implied,
|
|
4
|
+
including but not limited to merchantability, fitness for a particular purpose,
|
|
5
|
+
non-infringement, uninterrupted operation, freedom from errors, or accuracy of data.
|
|
6
|
+
|
|
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
|
|
9
|
+
repository:
|
|
10
|
+
|
|
11
|
+
- make a full backup, including the version-control state and uncommitted changes;
|
|
12
|
+
- try it on a test branch or a copy first;
|
|
13
|
+
- review the generated changes before committing them.
|
|
14
|
+
|
|
15
|
+
To the maximum extent permitted by applicable law, the authors are not liable for any
|
|
16
|
+
direct, indirect, incidental, special, punitive or consequential damages arising from
|
|
17
|
+
the use of, or inability to use, this software — including but not limited to loss or
|
|
18
|
+
corruption of data, accidental deletion or overwriting of files, business interruption,
|
|
19
|
+
loss of profits or loss of goodwill — even if the authors have been advised of the
|
|
20
|
+
possibility of such damages.
|
|
21
|
+
|
|
22
|
+
This software and its output do not constitute legal, financial, medical or other
|
|
23
|
+
professional advice. Third-party tools, model services and plugin marketplaces accessed
|
|
24
|
+
through it are governed by their own providers; the authors accept no joint liability
|
|
25
|
+
for them.
|
|
26
|
+
|
|
27
|
+
If any part of this disclaimer is held invalid, the authors' aggregate liability shall
|
|
28
|
+
not exceed the amount you actually paid for this software (it is free, i.e. zero).
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# 免责声明
|
|
33
|
+
|
|
34
|
+
本软件按“现状(AS IS)”提供,不附带任何明示或默示的担保,包括但不限于:
|
|
35
|
+
适销性、特定用途适用性、不侵权、无中断、无错误、数据准确性。
|
|
36
|
+
|
|
37
|
+
本插件会在工作区内写入或修改文件(如 `AGENTS.md`、`.ai/`、`TASKS.md`),并可能调用
|
|
38
|
+
本地 PowerShell 脚本。请在重要仓库中:
|
|
39
|
+
|
|
40
|
+
- 使用前做好完整备份(含版本库与未提交改动);
|
|
41
|
+
- 先在测试分支或副本中验证;
|
|
42
|
+
- 自行审查插件生成的改动后再提交。
|
|
43
|
+
|
|
44
|
+
在适用法律允许的最大范围内,作者不对因使用或无法使用本软件而产生的任何直接、
|
|
45
|
+
间接、偶然、特殊、惩罚性或后果性损失承担责任,包括但不限于:数据丢失或损坏、
|
|
46
|
+
文件误删/误覆盖、业务中断、利润损失、商誉损失。即使作者已被告知上述损失的可能性,
|
|
47
|
+
本条仍然适用。
|
|
48
|
+
|
|
49
|
+
本软件及其输出不构成法律、财务、医疗或其他专业建议;使用者应自行判断并承担决策后果。
|
|
50
|
+
通过本软件访问的第三方工具、模型服务与插件市场,其可用性、计费与数据处理由相应提供方
|
|
51
|
+
负责,作者不承担连带责任。
|
|
52
|
+
|
|
53
|
+
若本条被认定为部分无效,作者的累计责任不超过你为本软件实际支付的费用
|
|
54
|
+
(本软件免费,即 0 元)。
|
package/docs/MARKET.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Market release checklist
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Published as `dsh-ai-collab@0.4.4`. 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
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Non-commercial request
|
|
2
|
+
|
|
3
|
+
`dsh-ai-collab` is open source under the **MIT** license. MIT permits commercial use,
|
|
4
|
+
so everything below is a **request from the author**, not a license condition, and it
|
|
5
|
+
does not change any right MIT grants you.
|
|
6
|
+
|
|
7
|
+
The author asks individuals and companies to prefer non-commercial use of this bundle
|
|
8
|
+
(personal learning, research, teaching, charity, non-commercial internal evaluation).
|
|
9
|
+
If you plan to use it in a commercial product, a paid service, or a client delivery,
|
|
10
|
+
please:
|
|
11
|
+
|
|
12
|
+
- assess data-security and compliance risks yourself, and keep backups and isolation
|
|
13
|
+
in place;
|
|
14
|
+
- consider opening an issue to describe your scenario, so the author can give
|
|
15
|
+
targeted advice and support.
|
|
16
|
+
|
|
17
|
+
To be explicit: MIT remains in force even if you choose commercial use. This notice
|
|
18
|
+
adds no restriction and creates no warranty or liability commitment.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# 建议性非商业使用声明
|
|
23
|
+
|
|
24
|
+
本项目以 **MIT** 许可开源。MIT 允许商业使用,因此以下内容是**作者的建议与请求**,
|
|
25
|
+
不是许可条件,也不改变 MIT 授予你的任何权利。
|
|
26
|
+
|
|
27
|
+
作者恳请个人与企业优先将本插件用于非商业场景(个人学习、研究、教学、慈善、
|
|
28
|
+
非商业性内部评估)。如你计划将其用于商业产品、付费服务或客户交付,请先:
|
|
29
|
+
|
|
30
|
+
- 自行评估数据安全与合规风险,并做好备份与隔离;
|
|
31
|
+
- 考虑通过仓库 Issue 告知作者使用场景,以便获得针对性的建议与支持。
|
|
32
|
+
|
|
33
|
+
再次说明:即使你选择商业使用,MIT 仍然有效;本声明不构成额外限制,
|
|
34
|
+
也不产生任何担保或责任承诺。
|