@xiaoso/dsh-tool-plus 0.1.1 → 0.1.2-beta.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.en.md CHANGED
@@ -20,6 +20,10 @@ Essential tools enhancement for DeepSeek Harness: persistent bash, structured re
20
20
  - **ast_grep / ast_edit** (optional): syntax-tree based structural code search and rewrite, enabled in settings
21
21
  - **agent presets**: two companion templates — Standard enhanced and PTC (Code Mode) — installable in one command (see Installation)
22
22
 
23
+ Settings panel (Bash tab):
24
+
25
+ ![Tool Plus settings panel (Bash)](docs/screenshots/settings-bash-en.png)
26
+
23
27
  ## Recommended Environment & Configuration
24
28
 
25
29
  - **Full-access mode**: the plugin is best used under `danger-full-access`, which avoids file writes being blocked by mistake in sandboxed modes.
package/README.md CHANGED
@@ -20,6 +20,10 @@ DeepSeek Harness 基础工具增强:持久 bash、结构化 read、多模式 e
20
20
  - **ast_grep / ast_edit**(可选):基于语法树的结构化代码搜索与重写,可在设置中开启
21
21
  - **agent 预设**:标准增强版 / PTC(Code Mode)两套配套模板,一条命令安装(见安装章节)
22
22
 
23
+ 设置面板(Bash 工具页):
24
+
25
+ ![Tool Plus 设置面板(Bash)](docs/screenshots/settings-bash-zh.png)
26
+
23
27
  ## 推荐环境与配置
24
28
 
25
29
  - **完全权限模式**:建议在 `danger-full-access` 下使用本插件,可避免沙箱模式下文件写入被误拦。
package/lib/client.js CHANGED
@@ -22,6 +22,7 @@ window.__ModuleLoader__.load({
22
22
  editMode: "groupEditMode",
23
23
  guard: "groupGuard",
24
24
  grep: "groupGrep",
25
+ searchDefaults: "groupSearchDefaults",
25
26
  ast: "groupAst"
26
27
  };
27
28
  /**
@@ -672,6 +673,42 @@ window.__ModuleLoader__.load({
672
673
  group: "grep",
673
674
  tool: "grep"
674
675
  },
676
+ {
677
+ name: "grepCaseDefault",
678
+ kind: "boolean",
679
+ default: true,
680
+ labelKey: "grepCaseDefault",
681
+ hintKey: "grepCaseDefaultHint",
682
+ group: "searchDefaults",
683
+ tool: "grep"
684
+ },
685
+ {
686
+ name: "grepGitignoreDefault",
687
+ kind: "boolean",
688
+ default: true,
689
+ labelKey: "grepGitignoreDefault",
690
+ hintKey: "grepGitignoreDefaultHint",
691
+ group: "searchDefaults",
692
+ tool: "grep"
693
+ },
694
+ {
695
+ name: "globGitignoreDefault",
696
+ kind: "boolean",
697
+ default: true,
698
+ labelKey: "globGitignoreDefault",
699
+ hintKey: "globGitignoreDefaultHint",
700
+ group: "searchDefaults",
701
+ tool: "glob"
702
+ },
703
+ {
704
+ name: "globHiddenDefault",
705
+ kind: "boolean",
706
+ default: true,
707
+ labelKey: "globHiddenDefault",
708
+ hintKey: "globHiddenDefaultHint",
709
+ group: "searchDefaults",
710
+ tool: "glob"
711
+ },
675
712
  {
676
713
  name: "astGrepEnabled",
677
714
  kind: "boolean",
@@ -713,6 +750,11 @@ window.__ModuleLoader__.load({
713
750
  labelKey: "tabGrep",
714
751
  fields: TOOL_PLUS_FIELDS.filter((f) => f.tool === "grep").map((f) => f.name)
715
752
  },
753
+ {
754
+ id: "glob",
755
+ labelKey: "tabGlob",
756
+ fields: TOOL_PLUS_FIELDS.filter((f) => f.tool === "glob").map((f) => f.name)
757
+ },
716
758
  {
717
759
  id: "astGrep",
718
760
  labelKey: "tabAstGrep",
@@ -2590,6 +2632,7 @@ window.__ModuleLoader__.load({
2590
2632
  tabRead: "Read",
2591
2633
  tabWriteEdit: "Write & Edit",
2592
2634
  tabGrep: "Grep",
2635
+ tabGlob: "Glob",
2593
2636
  tabAstGrep: "Ast Grep",
2594
2637
  tabAstEdit: "Ast Edit",
2595
2638
  tabReadImage: "Read Image",
@@ -2676,11 +2719,20 @@ window.__ModuleLoader__.load({
2676
2719
  grepContextBeforeHint: "每个匹配前展示的上下文行数。",
2677
2720
  grepContextAfter: "匹配后上下文行数",
2678
2721
  grepContextAfterHint: "每个匹配后展示的上下文行数。",
2722
+ grepCaseDefault: "大小写敏感(默认)",
2723
+ grepCaseDefaultHint: "开启(默认)时按大小写严格匹配;关闭后忽略大小写。调用时显式传 case 参数会覆盖此默认。",
2724
+ grepGitignoreDefault: "跳过被忽略的文件(默认)",
2725
+ grepGitignoreDefaultHint: "开启(默认)时,.gitignore 里列出的文件/目录会自动跳过,不出现在搜索结果里;关闭后它们也会被搜到。调用时显式传 gitignore 参数会覆盖此默认。",
2726
+ globGitignoreDefault: "跳过被忽略的文件(默认)",
2727
+ globGitignoreDefaultHint: "开启(默认)时,.gitignore 里列出的文件/目录会自动跳过,不会出现在结果里;关闭后它们也会被列出。调用时显式传 gitignore 参数会覆盖此默认。",
2728
+ globHiddenDefault: "包含隐藏文件(默认)",
2729
+ globHiddenDefaultHint: "开启(默认)时以 . 开头的文件/目录(如 .env、.git)也会出现在结果里;关闭后自动跳过。调用时显式传 hidden 参数会覆盖此默认。",
2679
2730
  astGrepEnabled: "启用 ast_grep",
2680
2731
  astGrepEnabledHint: "启用 ast_grep 工具做结构化 AST 搜索(默认关闭)。",
2681
2732
  astEditEnabled: "启用 ast_edit",
2682
2733
  astEditEnabledHint: "启用 ast_edit 工具做结构化 AST 重写(默认开启)。",
2683
2734
  groupGrep: "匹配上下文",
2735
+ groupSearchDefaults: "搜索默认值",
2684
2736
  groupAst: "AST 工具",
2685
2737
  optReplace: "replace(字面量替换)",
2686
2738
  optPatch: "patch(unified diff)",
@@ -2766,11 +2818,12 @@ window.__ModuleLoader__.load({
2766
2818
  description: "Persistent shell tool: timeouts, backgrounding, interception, and environment.",
2767
2819
  nav: "Tool Plus",
2768
2820
  pageTitle: "Tool Plus tool configuration",
2769
- pageDescription: "Switch by tool to adjust its global settings; values apply to new calls.",
2821
+ pageDescription: "Switch by tool to adjust its global settings; values apply …",
2770
2822
  tabBash: "Bash",
2771
2823
  tabRead: "Read",
2772
2824
  tabWriteEdit: "Write & Edit",
2773
2825
  tabGrep: "Grep",
2826
+ tabGlob: "Glob",
2774
2827
  tabAstGrep: "Ast Grep",
2775
2828
  tabAstEdit: "Ast Edit",
2776
2829
  tabReadImage: "Read Image",
@@ -2857,11 +2910,20 @@ window.__ModuleLoader__.load({
2857
2910
  grepContextBeforeHint: "Context lines shown before each match.",
2858
2911
  grepContextAfter: "Context lines after match",
2859
2912
  grepContextAfterHint: "Context lines shown after each match.",
2913
+ grepCaseDefault: "Case-sensitive (default)",
2914
+ grepCaseDefaultHint: "When on (default), matches strictly by case; when off, case is ignored. An explicit case argument on the call overrides this default.",
2915
+ grepGitignoreDefault: "Skip ignored files (default)",
2916
+ grepGitignoreDefaultHint: "When on (default), files and directories listed in .gitignore are skipped and never appear in results; when off, they are searched too. An explicit gitignore argument on the call overrides this default.",
2917
+ globGitignoreDefault: "Skip ignored files (default)",
2918
+ globGitignoreDefaultHint: "When on (default), files and directories listed in .gitignore are skipped and never appear in results; when off, they are listed too. An explicit gitignore argument on the call overrides this default.",
2919
+ globHiddenDefault: "Include hidden files (default)",
2920
+ globHiddenDefaultHint: "When on (default), dot-files and dot-directories (e.g. .env, .git) appear in results; when off, they are skipped. An explicit hidden argument on the call overrides this default.",
2860
2921
  astGrepEnabled: "Enable ast_grep",
2861
2922
  astGrepEnabledHint: "Enable the ast_grep tool for structural AST search (off by default).",
2862
2923
  astEditEnabled: "Enable ast_edit",
2863
2924
  astEditEnabledHint: "Enable the ast_edit tool for structural AST rewrites (on by default).",
2864
2925
  groupGrep: "Match context",
2926
+ groupSearchDefaults: "Search defaults",
2865
2927
  groupAst: "AST tools",
2866
2928
  optReplace: "replace (literal)",
2867
2929
  optPatch: "patch (unified diff)",
package/lib/index.mjs CHANGED
@@ -3,7 +3,7 @@ __installBunShim();
3
3
  import { n as fs_promises_shim_exports, t as exists } from "./fs-promises-shim-Bx0fpxuk.mjs";
4
4
  import { i as setRuntimeLogger, n as systemChromiumCandidatesForTest, r as runtimeLogger } from "./launch-DwpE70Pv.mjs";
5
5
  import { $ as peekFile, A as formatAge, C as error, F as $envpos, I as $flag, M as formatCount, P as $env, Q as isProbablyBinary, S as debug, T as warn, U as getAutoQaDbPath, V as VERSION, X as getRemoteDir, Y as getPuppeteerDir, b as isEnotdir, c as combineSignals, d as $which, j as formatBytes$1, k as installBunShim, l as exec, p as readImageMetadata, q as getInstallId, tt as untilAborted, u as render, v as hasFsCode, y as isEnoent } from "./src-D_e1qMwi.mjs";
6
- import { C as truncateToWidth$1, S as replaceTabs, _ as formatCodeFrameLine, a as fetchBinary, b as LRUCache, c as getParallelExtractContent, d as convertFileWithMarkit, f as Settings, g as capParseErrors, h as OMP_DEFAULTS, i as convertWithMarkit, l as ensureTool, m as settings, o as extractWithParallel, p as isSettingsInitialized, s as findParallelApiKey, u as CONVERTIBLE_EXTENSIONS, v as formatParseErrors, x as padding, y as shortenPath } from "./utils-D1p8-H8L.mjs";
6
+ import { C as truncateToWidth$1, S as replaceTabs, _ as formatCodeFrameLine, a as fetchBinary, b as LRUCache, c as getParallelExtractContent, d as convertFileWithMarkit, f as Settings, g as capParseErrors, h as OMP_DEFAULTS, i as convertWithMarkit, l as ensureTool, m as settings, o as extractWithParallel, p as isSettingsInitialized, s as findParallelApiKey, u as CONVERTIBLE_EXTENSIONS, v as formatParseErrors, x as padding, y as shortenPath } from "./utils-DvRrWOyM.mjs";
7
7
  import { t as sanitizeText } from "./sanitize-text-CfcXzw5X.mjs";
8
8
  import { n as isRecord$2 } from "./type-guards-B9VVjRDK.mjs";
9
9
  import { n as ToolError, r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
@@ -2758,6 +2758,7 @@ function startBashJob(options) {
2758
2758
  headBytes: config.outputSinkHeadBytes,
2759
2759
  useShellCommandWrapper: config.useShellCommandWrapper,
2760
2760
  snapshotEnabled: config.snapshotEnabled,
2761
+ rmSafe: config.rmSafe,
2761
2762
  nonInteractiveEnv: config.nonInteractiveEnv,
2762
2763
  artifactPath: spillPath,
2763
2764
  onMinimizedSave: (originalText) => saveOriginalText(originalText),
@@ -3942,6 +3943,42 @@ const TOOL_PLUS_FIELDS = [
3942
3943
  group: "grep",
3943
3944
  tool: "grep"
3944
3945
  },
3946
+ {
3947
+ name: "grepCaseDefault",
3948
+ kind: "boolean",
3949
+ default: true,
3950
+ labelKey: "grepCaseDefault",
3951
+ hintKey: "grepCaseDefaultHint",
3952
+ group: "searchDefaults",
3953
+ tool: "grep"
3954
+ },
3955
+ {
3956
+ name: "grepGitignoreDefault",
3957
+ kind: "boolean",
3958
+ default: true,
3959
+ labelKey: "grepGitignoreDefault",
3960
+ hintKey: "grepGitignoreDefaultHint",
3961
+ group: "searchDefaults",
3962
+ tool: "grep"
3963
+ },
3964
+ {
3965
+ name: "globGitignoreDefault",
3966
+ kind: "boolean",
3967
+ default: true,
3968
+ labelKey: "globGitignoreDefault",
3969
+ hintKey: "globGitignoreDefaultHint",
3970
+ group: "searchDefaults",
3971
+ tool: "glob"
3972
+ },
3973
+ {
3974
+ name: "globHiddenDefault",
3975
+ kind: "boolean",
3976
+ default: true,
3977
+ labelKey: "globHiddenDefault",
3978
+ hintKey: "globHiddenDefaultHint",
3979
+ group: "searchDefaults",
3980
+ tool: "glob"
3981
+ },
3945
3982
  {
3946
3983
  name: "astGrepEnabled",
3947
3984
  kind: "boolean",
@@ -3961,7 +3998,7 @@ const TOOL_PLUS_FIELDS = [
3961
3998
  tool: "astEdit"
3962
3999
  }
3963
4000
  ];
3964
- TOOL_PLUS_FIELDS.filter((f) => f.tool === "bash").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "read").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "writeEdit").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "grep").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "astGrep").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "astEdit").map((f) => f.name);
4001
+ TOOL_PLUS_FIELDS.filter((f) => f.tool === "bash").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "read").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "writeEdit").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "grep").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "glob").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "astGrep").map((f) => f.name), TOOL_PLUS_FIELDS.filter((f) => f.tool === "astEdit").map((f) => f.name);
3965
4002
  /** Look up one field definition by its schema key. */
3966
4003
  function toolPlusField(name) {
3967
4004
  return TOOL_PLUS_FIELDS.find((field) => field.name === name);
@@ -4063,6 +4100,10 @@ const Config = z.object({
4063
4100
  readConcurrentSafe: z.boolean().default(fieldDefault("readConcurrentSafe", true)),
4064
4101
  grepContextBefore: z.number().default(fieldDefault("grepContextBefore", 1)),
4065
4102
  grepContextAfter: z.number().default(fieldDefault("grepContextAfter", 3)),
4103
+ grepCaseDefault: z.boolean().default(fieldDefault("grepCaseDefault", true)),
4104
+ grepGitignoreDefault: z.boolean().default(fieldDefault("grepGitignoreDefault", true)),
4105
+ globGitignoreDefault: z.boolean().default(fieldDefault("globGitignoreDefault", true)),
4106
+ globHiddenDefault: z.boolean().default(fieldDefault("globHiddenDefault", true)),
4066
4107
  astGrepEnabled: z.boolean().default(fieldDefault("astGrepEnabled", false)),
4067
4108
  astEditEnabled: z.boolean().default(fieldDefault("astEditEnabled", true)),
4068
4109
  fetchEnabled: z.boolean().default(fieldDefault("fetchEnabled", true)),
@@ -4149,6 +4190,10 @@ function resolveConfig(config) {
4149
4190
  readConcurrentSafe: config.readConcurrentSafe ?? fieldDefault("readConcurrentSafe", true),
4150
4191
  grepContextBefore: config.grepContextBefore ?? fieldDefault("grepContextBefore", 1),
4151
4192
  grepContextAfter: config.grepContextAfter ?? fieldDefault("grepContextAfter", 3),
4193
+ grepCaseDefault: config.grepCaseDefault ?? fieldDefault("grepCaseDefault", true),
4194
+ grepGitignoreDefault: config.grepGitignoreDefault ?? fieldDefault("grepGitignoreDefault", true),
4195
+ globGitignoreDefault: config.globGitignoreDefault ?? fieldDefault("globGitignoreDefault", true),
4196
+ globHiddenDefault: config.globHiddenDefault ?? fieldDefault("globHiddenDefault", true),
4152
4197
  astGrepEnabled: config.astGrepEnabled ?? fieldDefault("astGrepEnabled", false),
4153
4198
  astEditEnabled: config.astEditEnabled ?? fieldDefault("astEditEnabled", true),
4154
4199
  fetchEnabled: config.fetchEnabled ?? fieldDefault("fetchEnabled", true),
@@ -14836,7 +14881,7 @@ let specialHandlersPromise;
14836
14881
  * requires a special handler, so we keep them out of the cold-startup graph.
14837
14882
  */
14838
14883
  function loadSpecialHandlers() {
14839
- specialHandlersPromise ??= import("./scrapers-DI8yWlu_.mjs").then((m) => m.specialHandlers);
14884
+ specialHandlersPromise ??= import("./scrapers-B3AO6nqq.mjs").then((m) => m.specialHandlers);
14840
14885
  return specialHandlersPromise;
14841
14886
  }
14842
14887
  /**
@@ -24590,7 +24635,9 @@ async function executeGrepTool(exec, cfg, args, ctx) {
24590
24635
  const params = { pattern: String(args.pattern ?? "") };
24591
24636
  if (args.path !== void 0 && args.path !== null && args.path !== "") params.path = String(args.path);
24592
24637
  if (typeof args.case === "boolean") params.case = args.case;
24638
+ else params.case = cfg.grepCaseDefault;
24593
24639
  if (typeof args.gitignore === "boolean") params.gitignore = args.gitignore;
24640
+ else params.gitignore = cfg.grepGitignoreDefault;
24594
24641
  if (typeof args.skip === "number") params.skip = args.skip;
24595
24642
  return toGrepToolResult(await tool.execute("grep", params, exec.signal));
24596
24643
  }
@@ -25007,8 +25054,8 @@ function toGlobToolResult(result, args) {
25007
25054
  async function executeGlobTool(exec, cfg, args, ctx) {
25008
25055
  return toGlobToolResult(await new GlobTool(createToolSession$2(exec, cfg)).execute("glob", {
25009
25056
  path: args.path !== void 0 ? String(args.path) : void 0,
25010
- hidden: args.hidden,
25011
- gitignore: args.gitignore,
25057
+ hidden: typeof args.hidden === "boolean" ? args.hidden : cfg.globHiddenDefault,
25058
+ gitignore: typeof args.gitignore === "boolean" ? args.gitignore : cfg.globGitignoreDefault,
25012
25059
  limit: args.limit
25013
25060
  }, exec.signal), args);
25014
25061
  }
@@ -3,7 +3,7 @@ __installBunShim();
3
3
  import { n as fs_promises_shim_exports } from "./fs-promises-shim-Bx0fpxuk.mjs";
4
4
  import { B as USER_AGENT, G as getDocsRsCacheDir, N as formatNumber, P as $env, T as warn, c as combineSignals, j as formatBytes, l as exec, s as Snowflake, x as parseFrontmatter, y as isEnoent } from "./src-D_e1qMwi.mjs";
5
5
  import { V as tryParseJson } from "./utils-fnV2zzp3.mjs";
6
- import { a as fetchBinary, c as getParallelExtractContent, i as convertWithMarkit, l as ensureTool, m as settings, n as asRecord, o as extractWithParallel, r as asString, s as findParallelApiKey, t as asNumber } from "./utils-D1p8-H8L.mjs";
6
+ import { a as fetchBinary, c as getParallelExtractContent, i as convertWithMarkit, l as ensureTool, m as settings, n as asRecord, o as extractWithParallel, r as asString, s as findParallelApiKey, t as asNumber } from "./utils-DvRrWOyM.mjs";
7
7
  import { n as isRecord } from "./type-guards-B9VVjRDK.mjs";
8
8
  import { r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
9
9
  import { c as getLocalizedText, d as looksLikeHtml, i as decodeHtmlEntities, l as htmlToBasicMarkdown, o as formatIsoDate, r as buildResult, s as formatMediaDuration, u as loadPage } from "./types-BUO0JXO-.mjs";
@@ -7202,7 +7202,7 @@ const settings = {
7202
7202
  };
7203
7203
  //#endregion
7204
7204
  //#region package.json
7205
- var version = "0.1.1";
7205
+ var version = "0.1.2-beta.0";
7206
7206
  /** `.tmp` files older than this are treated as orphaned writes and swept. */
7207
7207
  const TMP_ORPHAN_MAX_AGE_MS = 3e5;
7208
7208
  function markitConversionCacheKey(bytes, extension) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xiaoso/dsh-tool-plus",
3
3
  "description": "Oh My Pi bash runtime ported as a deepseek-harness tool plugin: persistent shell session, output minimizer, managed background jobs, command interception",
4
- "version": "0.1.1",
4
+ "version": "0.1.2-beta.0",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "deepseek-harness",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaoso/dsh-tool-plus-presets",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-beta.0",
4
4
  "description": "Agent-preset installer for dsh-tool-plus: installs the standard / PTC enhanced preset templates into a DeepSeek Harness home.",
5
5
  "license": "MIT",
6
6
  "keywords": [