dsh-context-toolkit 0.1.0 → 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/README.md +6 -0
- package/README.zh.md +6 -0
- package/index.js +15 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/README.zh.md
CHANGED
package/index.js
CHANGED
|
@@ -262,9 +262,22 @@ export function apply(ctx, rawConfig) {
|
|
|
262
262
|
/** Names whose whole purpose is to pour raw bytes into the conversation. */
|
|
263
263
|
const FLOOD_TOOLS = new Set(['curl', 'wget', 'httpie', 'http', 'aria2c'])
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Every tool name that runs a shell command, so the gate can read its `command`.
|
|
267
|
+
*
|
|
268
|
+
* This list is the gate's blind spot if it drifts: a host name that is absent here
|
|
269
|
+
* is simply not inspected, and the flood tools run unchecked through it. `ops_bash`
|
|
270
|
+
* is the live example - dsh-ops publishes it (and does not publish `bash` at all),
|
|
271
|
+
* so before this list existed `curl` through `ops_bash` slipped past a gate that
|
|
272
|
+
* was refusing the identical command through `pwsh`.
|
|
273
|
+
*
|
|
274
|
+
* Add a name here when a shell tool appears; the other branches key off this set.
|
|
275
|
+
*/
|
|
276
|
+
const SHELL_TOOL_NAMES = new Set(['bash', 'pwsh', 'shell', 'ops_bash', 'bash_persistent', 'pwsh_persistent'])
|
|
277
|
+
|
|
265
278
|
function floodReason(toolName, args) {
|
|
266
279
|
const command = typeof args.command === 'string' ? args.command : ''
|
|
267
|
-
if (toolName
|
|
280
|
+
if (!SHELL_TOOL_NAMES.has(toolName)) return undefined
|
|
268
281
|
for (const word of FLOOD_TOOLS) {
|
|
269
282
|
if (new RegExp('(^|[ \\t;&|(])' + word + '([ \\t;&|)]|$)', 'i').test(command)) {
|
|
270
283
|
return 'dsh-context-toolkit: "' + word + '" pours whole responses into the transcript. '
|
|
@@ -312,7 +325,7 @@ function registerRoutingGate(ctx, config, stats) {
|
|
|
312
325
|
}
|
|
313
326
|
}
|
|
314
327
|
|
|
315
|
-
if ((toolName
|
|
328
|
+
if (SHELL_TOOL_NAMES.has(toolName) && config.bashNudgeMinCommandBytes > 0) {
|
|
316
329
|
const command = typeof args.command === 'string' ? args.command : ''
|
|
317
330
|
if (command.length > config.bashNudgeMinCommandBytes) {
|
|
318
331
|
const reason = 'dsh-context-toolkit: this command is about ' + command.length
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "DeepSeek Harness bundle: native ctk_* sandbox tools, a routing gate that keeps bulk output out of the transcript, and a local full-text knowledge base. No third-party runtime dependencies.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|