dsh-cwtools 0.0.0-stage → 0.2.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-cwtools contributors
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,105 @@
1
- # Temporary Holding Version
1
+ # dsh-cwtools
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [English](#english) | [中文](#中文)
4
+
5
+ <a id="english"></a>
6
+ ## English
7
+
8
+ `dsh-cwtools` is a standalone DeepSeek Harness bundle that exposes CWTools as native DSH tools and adds a CWTools section to DSH Settings. It does not use MCP or require an MCP transport. A running VS Code extension is optional: a healthy active host is reused by default, otherwise a standalone backend is started.
9
+
10
+ ### Features
11
+
12
+ - Up to 37 read-only tools for project knowledge, rules and scopes, navigation, diagnostics, localisation, semantic analysis, and Shader queries.
13
+ - `query_targeting_weight` for Stellaris combat targeting calculations.
14
+ - Diagnostics honour the filter list configured for the workspace (`.vscode/settings.json`), and suppressed items stay counted.
15
+ - Vanilla-game errors are off by default; the settings page also forwards ignored error codes, ignored file names, and the localisation diagnostic filter to the backend.
16
+ - Optional `write_localisation`, disabled by default, with workspace path checks and UTF-8 BOM handling.
17
+ - Active-first backend reuse over a dedicated `/cwtools/*` HTTP API, with no second process when a healthy matching host exists.
18
+ - A bounded runtime per mod workspace with single-flight startup, LRU/idle disposal, cooperative cancellation, and backend protocol/capability checks.
19
+ - A bilingual CWTools settings section split into Project, Backend, Read tools, and Write and output tabs, covering backend paths, runtime bounds, read groups, individual read tools, the write allowlist, and output limits.
20
+
21
+ CWT-only workspaces expose only their supported document/navigation/diagnostic subset. Targeting weights require a Stellaris full-mod workspace. The five VS Code-dependent domain writes, IDE tools, and visual editors are outside this release.
22
+
23
+ ### Requirements
24
+
25
+ - DSH `>=0.2.2-rc.1 <0.3.0`.
26
+ - A matching external CWTools server built with capability protocol 1. Older servers are rejected with `backend_incompatible` instead of silently producing partial results.
27
+ - `cwtools-shared` 0.3.0 and `cwtools-node` 0.2.0. Development installations can link those checkouts; published installations should install them before this bundle.
28
+
29
+ The bundle does not ship a backend. Empty `backend.serverPath` auto-discovers a standalone CWTools installation or development build. Empty `backend.activeManifestPath` auto-discovers the active-host manifest. An empty `backend.gamePath` is discovered from the local Steam libraries; empty rules and cache paths try the installed extension first, then the workspace's rule checkout, then the server default.
30
+
31
+ ### Install
32
+
33
+ Build the upstream packages and this package, then install through DSH:
34
+
35
+ ```sh
36
+ dsh plugin --profile <profile> add /path/to/cwtools-shared /path/to/cwtools-node /path/to/dsh-cwtool
37
+ dsh --profile <profile> --dump-config
38
+ ```
39
+
40
+ The dump must contain `# == dsh-cwtools` and `id: cwtools`. Installation and activation are separate checks; do not infer a running backend from a dependency row alone.
41
+
42
+ ### Configure and use
43
+
44
+ Open **Settings → CWTools**:
45
+
46
+ 1. Keep **Prefer active backend** enabled to reuse a healthy host for the exact workspace. Set **Active manifest path** only when automatic discovery is not suitable; disable the preference to force a standalone process.
47
+ 2. Set the external backend, game, rules, and cache paths, or leave them empty for auto-discovery.
48
+ 3. Enable the read groups and individual tools you need. A group switch preserves the individual choices while that group is disabled.
49
+ 4. Enable `write_localisation` only when you intend to allow localisation writes. DSH tool policy still applies to every call.
50
+ 5. Save once. The form writes all changes atomically through `configForms`; revision conflicts keep the draft, and reset removes user overrides.
51
+
52
+ Tools resolve the calling Agent Session's current working directory. Missing/malformed manifests, stale processes, workspace mismatches, inactive hosts, and connection failures or timeouts fall back to a standalone backend. An incompatible active protocol or capability handshake returns `backend_incompatible` and never starts a competing process. Existing runtime entries are not migrated between backends. Unsupported or ambiguous projects do not start a language server. Loading and mod-only results carry readiness/cache provenance and must not be treated as complete vanilla answers.
53
+
54
+ See `ARCHITECTURE.md` for data flow and `CONTRIBUTING.md` for verification.
55
+
56
+ <a id="中文"></a>
57
+ ## 中文
58
+
59
+ `dsh-cwtools` 是独立的 DeepSeek Harness 组合包,把 CWTools 作为 DSH 原生工具接入,并在 DSH 设置中增加 CWTools 分区。它不使用 MCP,也不要求 MCP transport。正在运行的 VS Code 扩展只是可选优化:默认复用健康的活跃宿主,否则启动独立后端。
60
+
61
+ ### 功能
62
+
63
+ - 最多 37 个只读工具,覆盖项目知识、规则与作用域、导航、诊断、本地化、语义分析和 Shader 查询。
64
+ - 使用 `query_targeting_weight` 计算 Stellaris 战斗索敌权重。
65
+ - 诊断会按工作区配置的过滤列表(`.vscode/settings.json`)过滤,被过滤掉的条目仍计入统计。
66
+ - 原版游戏错误默认关闭;设置页还会把忽略的错误码、忽略的文件名和本地化诊断过滤模式透传给后端。
67
+ - 可选 `write_localisation`,默认关闭,带工作区路径约束和 UTF-8 BOM 处理。
68
+ - 通过独立 `/cwtools/*` HTTP API 优先复用活跃后端,工作区匹配且健康时不创建第二个进程。
69
+ - 每个 Mod 工作区使用有界运行时,支持 single-flight 启动、LRU/idle 释放、协作取消和后端协议/能力握手。
70
+ - 中英双语 CWTools 设置分区,分为项目 / 后端 / 只读工具 / 写入与输出四个页签,覆盖后端路径、运行时上限、只读组、单个只读工具、写入白名单和结果上限。
71
+
72
+ CWT-only 工作区只提供支持的文档、导航和诊断子集。索敌权重只用于 Stellaris full-mod 工作区。另外五个依赖 VS Code 的领域写入、IDE 工具和可视化编辑器不在首版范围内。
73
+
74
+ ### 环境要求
75
+
76
+ - DSH `>=0.2.2-rc.1 <0.3.0`。
77
+ - 带能力协议 1 的匹配外置 CWTools 服务端。旧服务端会返回 `backend_incompatible`,不会静默产生不完整的语义结果。
78
+ - `cwtools-shared` 0.3.0 与 `cwtools-node` 0.2.0。开发安装可链接这些 checkout;发布安装应先安装这两个包。
79
+
80
+ 组合包不自带后端。`backend.serverPath` 留空时自动发现独立 CWTools 安装或开发构建;`backend.activeManifestPath` 留空时自动发现活跃宿主清单。`backend.gamePath` 留空时从本机 Steam 库自动发现安装目录;规则与缓存路径留空时先尝试已安装扩展,再尝试工作区的规则检出,最后用服务器默认值。
81
+
82
+ ### 安装
83
+
84
+ 先构建上游包与本包,再通过 DSH 安装:
85
+
86
+ ```sh
87
+ dsh plugin --profile <profile> add /path/to/cwtools-shared /path/to/cwtools-node /path/to/dsh-cwtool
88
+ dsh --profile <profile> --dump-config
89
+ ```
90
+
91
+ 输出必须包含 `# == dsh-cwtools` 和 `id: cwtools`。安装与激活是两项不同检查,不能仅凭依赖行就认定后端已经运行。
92
+
93
+ ### 配置与使用
94
+
95
+ 打开 **设置 → CWTools**:
96
+
97
+ 1. 保持“优先复用活跃后端”开启,可复用同一工作区的健康宿主;仅在自动发现不合适时填写“活跃宿主清单路径”。关闭该偏好可强制使用独立进程。
98
+ 2. 设置外置后端、游戏、规则和缓存路径,或留空自动发现。
99
+ 3. 启用需要的只读组和单个工具。组关闭会保留组内单工具选择,重新开启后恢复。
100
+ 4. 只在确实需要本地化写入时开启 `write_localisation`,每次调用仍经过 DSH 工具策略。
101
+ 5. 一次保存全部修改。`configForms` 原子写回;revision 冲突保留草稿,恢复默认只移除用户覆盖。
102
+
103
+ 工具使用调用 Agent Session 的当前工作目录。清单缺失或畸形、进程失效、工作区不匹配、宿主尚未活跃、连接失败或超时才回退到独立后端。活跃宿主协议或能力握手不兼容时返回 `backend_incompatible`,绝不启动竞争实例。已创建的运行时不会在两种后端间热迁移。不支持或歧义项目不会启动语言服务。加载中和仅有 mod 数据的结果带 readiness/cache provenance,不能当作完整 vanilla 结论。
104
+
105
+ 数据流见 `ARCHITECTURE.md`,验证方式见 `CONTRIBUTING.md`。
@@ -0,0 +1,4 @@
1
+ - insert:
2
+ - id: cwtools
3
+ name: dsh-cwtools
4
+ config: {}
package/icon.svg ADDED
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="CWTools">
2
+ <rect width="64" height="64" rx="14" fill="#12161d"/>
3
+ <path d="M43 20a17 17 0 1 0 0 24" fill="none" stroke="#5ec8f2" stroke-width="6" stroke-linecap="round"/>
4
+ <path d="M25 27l-5 5 5 5M39 27l5 5-5 5" fill="none" stroke="#8fbf5a" stroke-width="4"
5
+ stroke-linecap="round" stroke-linejoin="round"/>
6
+ <circle cx="32" cy="32" r="3.5" fill="#f2f5f8"/>
7
+ </svg>