@morlay/dsh-tool-guidance 0.0.6 → 0.0.8

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 CHANGED
@@ -1,10 +1,9 @@
1
1
  # @morlay/dsh-tool-guidance
2
2
 
3
3
  本部署的**工具说明运行时**:包根本身把工具描述换成一行中文、剥掉 schema 里的说明性字段,并把用法按组
4
- 送达——`base` 组的正文由本行挂 `agent/pre-step` 常驻注入(按**这个会话装配结果里最终可见的工具目录**过滤),
5
- 按需的 `flow` / `delegation` / `team` 三组注册进官方 `ctx.skills`(目录与按需加载由官方 `tool-skill` 那一行
6
- 提供);`rows` 出口只发布 **它那一行**(`tool-guidance`,host 平面)。取舍见
7
- [设计-工具说明与用法分组的送达](.agents/designs/20260929-工具说明与用法分组的送达.md)。
4
+ 送达——`base` 组常驻注入,`flow` / `delegation` / `team` 三组注册进官方 `ctx.skills` 按需加载(目录由官方
5
+ `tool-skill` 那一行提供);`rows` 出口只发布 **它那一行**(`tool-guidance`,host 平面)。形态、接缝与代价见
6
+ [设计 工具说明与用法分组的送达](./.agents/designs/20260929-工具说明与用法分组的送达.md)。
8
7
 
9
8
  功能行清单(工具 / 命令 / 压缩 / 计划模式 / 委派)**不归本包**:它们住在会话挂着的 agent preset 里(官方 shipped
10
9
  preset 或部署自建的那份)。取舍见
@@ -23,11 +22,7 @@ preset 或部署自建的那份)。取舍见
23
22
  装配层把 `tool-guidance` 插在 **host 平面**(`toolGuidanceRow()` 给出行 id 与模块名),装的就是本包的包根
24
23
  (`@morlay/dsh-tool-guidance`)。`rows` 出口只有数据,没有装配动作。
25
24
 
26
- 那一行只有一个开关 `config.groups`(部署级,默认开):关掉它只剩工具预处理(短描述汉化 + schema 精简),
27
- `base` 常驻注入与按需三组一起不发生——它们是一件事的两半。
28
-
29
- 模式的 `allowTools` 留空即"不设收窄,用 preset 的全部工具";要收窄就列名单(见
30
- [dsh-session-mode](../dsh-session-mode/README.md))。
25
+ 那一行只有一个开关 `config.groups`(部署级,默认开):关掉它只剩工具预处理(短描述汉化 + schema 精简)。
31
26
 
32
27
  ## 边界
33
28
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import z from "@deepseek-ai/schemastery";
2
1
  import { Context } from "@deepseek-ai/cordis";
2
+ import z from "@deepseek-ai/schemastery";
3
3
  //#region src/index.d.ts
4
4
  export declare const name = "tool-guidance";
5
5
  export declare const inject: string[];
package/dist/index.mjs CHANGED
@@ -112,6 +112,10 @@ const FS_PACK = {
112
112
  tool: "grep",
113
113
  short: "按正则搜索文件内容"
114
114
  },
115
+ {
116
+ tool: "working_directory",
117
+ short: "查看当前工作目录,或用 cd 切换"
118
+ },
115
119
  {
116
120
  tool: "read_image",
117
121
  short: "读取图片内容"
@@ -270,6 +274,10 @@ const BASE_GROUP = {
270
274
  when: "grep",
271
275
  text: "grep:按内容搜索(不要用 shell grep / rg);需要上下文再 read 命中的文件。"
272
276
  },
277
+ {
278
+ when: "working_directory",
279
+ text: "working_directory:查会话当前工作目录,或传 cd 切到某个已存在的目录——切完相对路径都按它解析;已开的 shell 与在跑进程留在自己的目录里,不受这次切换影响。"
280
+ },
273
281
  {
274
282
  when: "bash",
275
283
  text: "bash:执行命令。使用参数 workdir,默认是你的工作目录,严禁使用 `cd`;非零退出会标 [exit code: N],先查清失败原因再继续。"
@@ -344,6 +352,7 @@ const BASE_GROUP = {
344
352
  "str_replace_editor",
345
353
  "glob",
346
354
  "grep",
355
+ "working_directory",
347
356
  "bash",
348
357
  "pwsh",
349
358
  "ask_user_question",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morlay/dsh-tool-guidance",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Tool guidance for dsh: localized short tool descriptions, trimmed schema and usage groups as one host-plane row. The agent row list lives in the agent presets themselves (shipped or deployment-owned).",
5
5
  "keywords": [
6
6
  "dsh",
@@ -22,32 +22,41 @@
22
22
  ],
23
23
  "type": "module",
24
24
  "exports": {
25
- ".": "./dist/index.mjs",
26
- "./rows": "./dist/rows.mjs",
25
+ ".": {
26
+ "types": "./dist/index.d.mts",
27
+ "default": "./dist/index.mjs"
28
+ },
29
+ "./rows": {
30
+ "types": "./dist/rows.d.mts",
31
+ "default": "./dist/rows.mjs"
32
+ },
27
33
  "./package.json": "./package.json",
28
34
  "./locale/*.json": "./locale/*.json"
29
35
  },
30
36
  "devDependencies": {
31
- "@deepseek-ai/cordis-plugin-include": "1.0.9",
32
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
33
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.0-rc.2",
34
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
35
- "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
36
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
37
- "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
38
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
39
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
40
- "@deepseek-ai/schemastery": "3.18.4",
41
- "@morlay/dsh-context-assembler": "0.0.6",
42
- "@morlay/dsh-session-mode": "0.0.8",
37
+ "@deepseek-ai/cordis-plugin-include": "^1.0.10",
38
+ "@deepseek-ai/dsh-agent-loop-testkit": "^0.2.1-rc.1",
39
+ "@deepseek-ai/dsh-llm": "^0.2.1-rc.1",
40
+ "@deepseek-ai/dsh-scope": "^0.2.1-rc.1",
41
+ "@deepseek-ai/dsh-session": "^0.2.1-rc.1",
42
+ "@deepseek-ai/dsh-system-prompt": "^0.2.1-rc.1",
43
+ "@deepseek-ai/schemastery": "^3.18.5",
44
+ "@morlay/dsh-context-assembler": "0.0.8",
45
+ "@morlay/dsh-session-mode": "0.0.11",
43
46
  "@types/js-yaml": "^4.0.9",
44
47
  "js-yaml": "^4.1.0"
45
48
  },
46
49
  "peerDependencies": {
47
- "@deepseek-ai/cordis": "^4.0.4",
48
- "@deepseek-ai/dsh-llm": "^0.2.0-rc.2",
49
- "@deepseek-ai/schemastery": "^3.18.4",
50
- "@morlay/dsh-context-assembler": "0.0.6"
50
+ "@deepseek-ai/cordis": "^4.0.5",
51
+ "@deepseek-ai/dsh-agent": "^0.2.1-rc.1",
52
+ "@deepseek-ai/dsh-llm": "^0.2.1-rc.1",
53
+ "@deepseek-ai/dsh-skill": "^0.2.1-rc.1",
54
+ "@deepseek-ai/dsh-tools": "^0.2.1-rc.1",
55
+ "@deepseek-ai/schemastery": "^3.18.5",
56
+ "@morlay/dsh-context-assembler": "0.0.8"
57
+ },
58
+ "engines": {
59
+ "dsh": ">= 0.2.1-rc.1 < 0.2.2"
51
60
  },
52
61
  "scripts": {
53
62
  "build": "pnpm exec tsdown"
@@ -1,4 +1,4 @@
1
- // 文件与图片:读写搜。
1
+ // 文件与目录:读写搜 + 工作目录。
2
2
  import type { ToolPack } from "../types.ts";
3
3
 
4
4
  export const FS_PACK: ToolPack = {
@@ -9,6 +9,7 @@ export const FS_PACK: ToolPack = {
9
9
  { tool: "edit", short: "按精确匹配替换文件片段" },
10
10
  { tool: "glob", short: "按模式查找文件路径" },
11
11
  { tool: "grep", short: "按正则搜索文件内容" },
12
+ { tool: "working_directory", short: "查看当前工作目录,或用 cd 切换" },
12
13
  { tool: "read_image", short: "读取图片内容" },
13
14
  { tool: "str_replace_editor", short: "查看 / 创建 / 精确替换文件" },
14
15
  ],
@@ -33,6 +33,10 @@ export const BASE_GROUP: GroupPack = {
33
33
  when: "grep",
34
34
  text: "grep:按内容搜索(不要用 shell grep / rg);需要上下文再 read 命中的文件。",
35
35
  },
36
+ {
37
+ when: "working_directory",
38
+ text: "working_directory:查会话当前工作目录,或传 cd 切到某个已存在的目录——切完相对路径都按它解析;已开的 shell 与在跑进程留在自己的目录里,不受这次切换影响。",
39
+ },
36
40
  {
37
41
  when: "bash",
38
42
  text: "bash:执行命令。使用参数 workdir,默认是你的工作目录,严禁使用 `cd`;非零退出会标 [exit code: N],先查清失败原因再继续。",
@@ -92,6 +96,7 @@ export const BASE_GROUP: GroupPack = {
92
96
  "str_replace_editor",
93
97
  "glob",
94
98
  "grep",
99
+ "working_directory",
95
100
  "bash",
96
101
  "pwsh",
97
102
  "ask_user_question",