@dsh-cc/command-compact 0.6.1 → 0.6.3-rc.2

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,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm check:readme --write
5
+ README.md: 3484facd51a0f18c9b4ee20b558dfca246f3d93d
6
+ README.zh.md: 2be6541bec5b20a029adcfb0b24575dee401cc7f
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # @dsh-cc/command-compact
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ The human-facing `/compact` slash command with optional preservation instructions: `/compact` runs the same idle-session manual compaction as upstream, and `/compact <instructions>` additionally parks the free-text hint on the invoking agent so the CC compaction engine's summarizer preserves what the user asked for.
6
+
7
+ ## Usage
8
+
9
+ The package is a cordis plugin; registering it mounts the command for every composed human-command adapter:
10
+
11
+ ```ts
12
+ import commandCompact from '@dsh-cc/command-compact'
13
+
14
+ ctx.plugin(commandCompact) // injects `commands` and `compaction`
15
+ ```
16
+
17
+ ## What it provides
18
+
19
+ - `/compact` — compact older conversation history and report the shadowed item count and approximate token count; `No compactable history yet.` when nothing is compactable.
20
+ - `/compact [instructions]` — free-text preservation instructions, handed to `@dsh-cc/compaction-basic`'s hint seam before compaction runs.
21
+ - Trailing `help` / `-h` / `--help` is answered by `@dsh-cc/command-usage` with plain-text help, no model turn.
22
+ - Expected capability failures (`busy`, `cancelled`, `changed`, `summary`, `commit`, `persistence`) from `ManualCompactionError` are converted into concise human-only error outcomes instead of raw errors.
23
+
24
+ ## Notes
25
+
26
+ - The hint is cleared in a `finally` block, so a failed or no-op compaction never leaves a stale hint parked for a later turn.
27
+ - Already-started handler promises quiesce on teardown (yielded drain before unregister), so no invocation is left in flight during composite teardown.
28
+ - Subcommand `@dsh-cc/command-compact/invariant` registers the package's invariant companion; it installs no runtime invariant because the command is a thin adapter over the upstream-verified compaction seam.
package/README.zh.md ADDED
@@ -0,0 +1,28 @@
1
+ # @dsh-cc/command-compact
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 面向用户的 `/compact` 斜杠命令,支持可选的保留指示:`/compact` 运行与上游一致的空闲会话手动压缩;`/compact <instructions>` 还会把自由文本提示停放在发起调用的 agent 上,让 CC 压缩引擎的摘要器保留用户要求的内容。
6
+
7
+ ## 用法
8
+
9
+ 本包是一个 cordis 插件;注册后会为每个已组合的人工命令适配器挂载该命令:
10
+
11
+ ```ts
12
+ import commandCompact from '@dsh-cc/command-compact'
13
+
14
+ ctx.plugin(commandCompact) // 注入 `commands` 与 `compaction`
15
+ ```
16
+
17
+ ## 提供内容
18
+
19
+ - `/compact` — 压缩较旧的会话历史,并报告被遮蔽的条目数与近似 token 数;无可压缩内容时返回 `No compactable history yet.`。
20
+ - `/compact [instructions]` — 自由文本保留指示,在压缩执行前交给 `@dsh-cc/compaction-basic` 的提示接缝。
21
+ - 尾部 `help` / `-h` / `--help` 由 `@dsh-cc/command-usage` 以纯文本帮助作答,不消耗模型轮次。
22
+ - `ManualCompactionError` 中可预期的能力失败(`busy`、`cancelled`、`changed`、`summary`、`commit`、`persistence`)会被转换为简洁的、仅面向人的错误结果,而不是原始错误。
23
+
24
+ ## 备注
25
+
26
+ - 提示在 `finally` 块中清除,因此失败或空操作的压缩绝不会留下陈旧提示影响后续轮次。
27
+ - 已启动的 handler promise 在拆卸时静默收敛(注销前先等待排空),组合式拆卸期间不会有调用仍在飞行。
28
+ - 子命令 `@dsh-cc/command-compact/invariant` 注册本包的 invariant 伴随插件;它不安装任何运行时 invariant,因为该命令只是上游已验证的压缩接缝之上的薄适配器。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dsh-cc/command-compact",
3
3
  "description": "Human-facing /compact command with optional preservation instructions",
4
- "version": "0.6.1",
4
+ "version": "0.6.3-rc.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/dsh-cc/dsh-cc.git",
@@ -25,15 +25,15 @@
25
25
  ],
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@dsh-cc/command-usage": "^0.6.1",
29
- "@dsh-cc/compaction-basic": "^0.6.1"
28
+ "@dsh-cc/command-usage": "^0.6.3-rc.2",
29
+ "@dsh-cc/compaction-basic": "^0.6.3-rc.2"
30
30
  },
31
31
  "peerDependencies": {
32
- "@deepseek-ai/dsh-commands": ">=0.1.2-rc.1",
33
- "@deepseek-ai/dsh-compaction": ">=0.1.2-rc.1",
34
- "@deepseek-ai/dsh-invariants": ">=0.1.2-rc.1",
35
- "@deepseek-ai/dsh-session": ">=0.1.2-rc.1",
36
- "@deepseek-ai/cordis": ">=0.1.2-rc.1"
32
+ "@deepseek-ai/dsh-commands": ">=0.1.5-rc.1",
33
+ "@deepseek-ai/dsh-compaction": ">=0.1.5-rc.1",
34
+ "@deepseek-ai/dsh-invariants": ">=0.1.5-rc.1",
35
+ "@deepseek-ai/dsh-session": ">=0.1.5-rc.1",
36
+ "@deepseek-ai/cordis": ">=0.1.5-rc.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@deepseek-ai/cordis-plugin-loader": "link:../../../../deepseek-harness/vendor/loader",