@cjhyy/code-shell-capability-coding 0.9.31 → 0.9.32
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/dist/index.capability.js +71 -0
- package/package.json +2 -2
package/dist/index.capability.js
CHANGED
|
@@ -131,9 +131,79 @@ const generalBase = BUILTIN_AGENT_PRESETS.general;
|
|
|
131
131
|
const generalCodingExposure = derivePresetExposure("general", CODING_TOOLS);
|
|
132
132
|
const terminalCodingExposure = derivePresetExposure("terminal-coding", CODING_TOOLS);
|
|
133
133
|
const productFullExposure = derivePresetExposure("product-full", BUILTIN_TOOLS);
|
|
134
|
+
function codingInitialToolRouting(terminal) {
|
|
135
|
+
const base = generalBase.initialToolRouting;
|
|
136
|
+
const rules = [
|
|
137
|
+
{
|
|
138
|
+
id: "coding",
|
|
139
|
+
terms: [
|
|
140
|
+
"code",
|
|
141
|
+
"coding",
|
|
142
|
+
"implement",
|
|
143
|
+
"debug",
|
|
144
|
+
"bug",
|
|
145
|
+
"fix",
|
|
146
|
+
"test",
|
|
147
|
+
"tests",
|
|
148
|
+
"refactor",
|
|
149
|
+
"repository",
|
|
150
|
+
"repo",
|
|
151
|
+
"git",
|
|
152
|
+
"commit",
|
|
153
|
+
"patch",
|
|
154
|
+
"lsp",
|
|
155
|
+
"terminal",
|
|
156
|
+
"shell",
|
|
157
|
+
"python",
|
|
158
|
+
"edit file",
|
|
159
|
+
"modify file",
|
|
160
|
+
"编程",
|
|
161
|
+
"代码",
|
|
162
|
+
"实现",
|
|
163
|
+
"修复",
|
|
164
|
+
"测试",
|
|
165
|
+
"重构",
|
|
166
|
+
"仓库",
|
|
167
|
+
"补丁",
|
|
168
|
+
"修改文件",
|
|
169
|
+
"编辑文件",
|
|
170
|
+
"改配置",
|
|
171
|
+
"报错",
|
|
172
|
+
],
|
|
173
|
+
toolNames: terminal
|
|
174
|
+
? ["ApplyPatch", "Bash", "Read", "Grep", "LSP", "Glob", "Edit", "NotebookEdit"]
|
|
175
|
+
: ["Bash", "Read", "Grep", "Glob", "Edit", "DriveAgent", "DriveAgentJobs"],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "worktree",
|
|
179
|
+
terms: ["worktree", "branch", "工作树", "分支"],
|
|
180
|
+
toolNames: ["Bash", "EnterWorktree", "ExitWorktree", "SwitchSessionWorkspace"],
|
|
181
|
+
},
|
|
182
|
+
...base.rules.map((rule) => terminal && rule.id === "files"
|
|
183
|
+
? { ...rule, toolNames: ["Read", "Glob", "Grep", "view_image"] }
|
|
184
|
+
: rule),
|
|
185
|
+
];
|
|
186
|
+
return {
|
|
187
|
+
...base,
|
|
188
|
+
// Terminal-coding keeps its ApplyPatch policy. Generic file intent must not
|
|
189
|
+
// bring Write back, including when it is matched alongside another route.
|
|
190
|
+
managedToolNames: [
|
|
191
|
+
...new Set([
|
|
192
|
+
...base.managedToolNames.filter((name) => !terminal || name !== "Write"),
|
|
193
|
+
"ApplyPatch",
|
|
194
|
+
...rules.flatMap((rule) => rule.toolNames),
|
|
195
|
+
]),
|
|
196
|
+
].filter((name) => !terminal || name !== "Write"),
|
|
197
|
+
rules: rules.map((rule) => ({
|
|
198
|
+
...rule,
|
|
199
|
+
toolNames: terminal ? rule.toolNames.filter((name) => name !== "Write") : rule.toolNames,
|
|
200
|
+
})),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
134
203
|
/** Preserve the general host profile while adding coding-package tools tagged for it. */
|
|
135
204
|
export const CODING_GENERAL_PRESET = {
|
|
136
205
|
...generalBase,
|
|
206
|
+
initialToolRouting: codingInitialToolRouting(false),
|
|
137
207
|
builtinTools: [...generalBase.builtinTools, ...generalCodingExposure.builtinTools],
|
|
138
208
|
defaultPermissionRules: [
|
|
139
209
|
...generalBase.defaultPermissionRules,
|
|
@@ -150,6 +220,7 @@ export const TERMINAL_CODING_PRESET = {
|
|
|
150
220
|
...(generalBase.initialToolNames ?? []).filter((name) => name !== "Write"),
|
|
151
221
|
"ApplyPatch",
|
|
152
222
|
],
|
|
223
|
+
initialToolRouting: codingInitialToolRouting(true),
|
|
153
224
|
builtinTools: [
|
|
154
225
|
...generalBase.builtinTools,
|
|
155
226
|
...productFullExposure.builtinTools,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cjhyy/code-shell-capability-coding",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.32",
|
|
4
4
|
"description": "Coding capability pack for the generic code-shell agent core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@cjhyy/code-shell-core": "0.9.
|
|
42
|
+
"@cjhyy/code-shell-core": "0.9.32"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=20.10"
|