@klarkxy/dsh-self-improvement 0.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.
package/LICENSE ADDED
@@ -0,0 +1,41 @@
1
+ The Star And Thank Author License (SATA)
2
+ Version 2.1, September 2026
3
+
4
+ Copyright © 2026 Klarkxy(278370456@qq.com)
5
+
6
+ Project Url: https://github.com/klarkxy/dsh-editor
7
+ https://github.com/klarkxy/sata-license
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ And wait, one more thing — an invitation, not a condition: it would be best if
20
+ you star/+1/like the project(s) in the project url section above, and thank the
21
+ author(s) in the Copyright section. You may, and arguably you should — but the
22
+ permissions above hold either way, star or no star.
23
+
24
+ Here are some suggested ways:
25
+
26
+ - Email the authors a thank-you letter, and make friends with him/her/them.
27
+ - Report bugs or issues.
28
+ - Tell friends what a wonderful project this is.
29
+ - And, sure, you can just express thanks in your mind without telling the world.
30
+
31
+ Contributors of this project by forking have the option to add his/her name and
32
+ forked project url at copyright and project url sections, but shall not delete
33
+ or modify anything else in these two sections.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @klarkxy/dsh-self-improvement
2
+
3
+ Default-enabled self-improvement: extracted lessons take effect automatically in shared Memory, with an audit view and optional Markdown skill export.
4
+
5
+ [简体中文](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-self-improvement/docs/README.zh-CN.md)
6
+
7
+ ## Install
8
+
9
+ Requires Node.js ≥22 and DSH `0.1.7-alpha.1`. The bundle entry starts enabled and remains independently switchable. It does **not** load Memory or turn on Dream; standalone hosts must install and load `@klarkxy/dsh-memory` separately.
10
+
11
+ ```sh
12
+ dsh plugin --profile web add @klarkxy/dsh-ai-services
13
+ dsh plugin --profile web add @klarkxy/dsh-memory
14
+ dsh plugin --profile web add @klarkxy/dsh-self-improvement
15
+ ```
16
+
17
+ Open **Settings → 自我改进** to audit lessons and skill drafts. The plugin does not render status, empty states, or management controls in chat.
18
+
19
+ ## Behaviour
20
+
21
+ Candidates come only from explicit human corrections or a tool failure that is later verified by a successful result for the same tool. Silence and model self-report are not treated as success. Extracted lessons are stored as Memory `kind: lesson` with `source: self-improvement` and take effect immediately — they join prompts as soon as they are relevant, and can be revoked any time from the audit view. Host pre-step injection uses `createUserMessage`, keeps decision flags such as `startsRequestSeries`, and only inserts active unexpired lessons relevant to the current user request (at most 5, ~800 tokens including the wrapper). Disabling this plugin or Memory mid-await stops lesson injection even if Memory stays on.
22
+
23
+ Accepted lessons can preview a skill Markdown draft with `name`/`description` frontmatter. Export is a browser download of that proposal; it does not install a skill or write `AGENTS.md`, scripts, or other plugins. The in-app export record is written only after the download is invoked. Revoking an export updates the in-app record only — downloaded files are not recalled.
24
+
25
+ From the repository root:
26
+
27
+ ```sh
28
+ pnpm --filter @klarkxy/dsh-self-improvement typecheck
29
+ pnpm exec vitest run packages/dsh-self-improvement/src
30
+ pnpm --filter @klarkxy/dsh-self-improvement build
31
+ ```
32
+
33
+ [Publishing](https://github.com/klarkxy/dsh-editor/blob/main/packages/PUBLISHING.md) · [License](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-self-improvement/LICENSE)
34
+
35
+ The Editor preinstalls this feature enabled. In the Editor, use Settings → Plugins to switch it without restarting. Standalone DSH must load `@klarkxy/dsh-ai-services` before this package; installation or removal may require a restart when the host asks for one. It also requires Memory to be installed and enabled.
@@ -0,0 +1,5 @@
1
+ # Enabled when installed. This plugin still does not enable Memory or Dream.
2
+ - insert:
3
+ - id: self-improvement
4
+ name: '@klarkxy/dsh-self-improvement'
5
+ disabled: false
@@ -0,0 +1,23 @@
1
+ # @klarkxy/dsh-self-improvement
2
+
3
+ 默认启用的自我改进:教训自动摘录进共享记忆并即时生效,可审计、可撤回,支持导出 Markdown 技能草稿。
4
+
5
+ [English](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-self-improvement/README.md)
6
+
7
+ ## 安装
8
+
9
+ 需要 Node.js ≥22、DSH `0.1.7-alpha.1`。捆绑入口安装后默认启用,也可在插件设置中关闭。本插件**不会**替宿主加载记忆或开启 Dream;独立部署仍需安装并加载 `@klarkxy/dsh-memory`。
10
+
11
+ ```sh
12
+ dsh plugin --profile web add @klarkxy/dsh-self-improvement
13
+ ```
14
+
15
+ 教训与技能草稿统一在 **设置 → 自我改进** 审计;聊天区不显示插件状态、空状态或管理控件。
16
+
17
+ ## 行为
18
+
19
+ 只从明确的人工纠正,或「同名工具先失败、后核实成功」摘录。沉默和模型自称成功不视为成功。教训以 Memory `kind: lesson`、`source: self-improvement` 保存,摘录成功即自动生效,可随时撤回。注入使用 `createUserMessage`,只放入与当前用户请求相关、未过期的已生效教训(最多 5 条,含包装约 800 tokens)。关闭本插件或等待期间关闭记忆都不会注入旧教训。
20
+
21
+ 已生效的教训可预览带 `name`/`description` 的技能 Markdown。导出是浏览器下载,不会安装技能,也不会改写 `AGENTS.md`、脚本或其他插件。应用内导出记录只在实际开始下载后写入。撤回导出只更新应用内记录,不会收回已下载的文件。
22
+
23
+ [发布维护](https://github.com/klarkxy/dsh-editor/blob/main/packages/PUBLISHING.md) · [许可证](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-self-improvement/LICENSE)