@xiaoso/dsh-tool-plus 0.1.7-beta.0 → 0.1.7

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.
Files changed (243) hide show
  1. package/lib/index.mjs +11 -9
  2. package/lib/{scrapers-D8oWspgW.mjs → scrapers-CtQrQ5kG.mjs} +1 -1
  3. package/lib/types/client/BashPlusCard.d.ts +53 -0
  4. package/lib/types/client/ToolPlusSection.d.ts +36 -0
  5. package/lib/types/client/forms.d.ts +42 -0
  6. package/lib/types/client/index.d.ts +29 -0
  7. package/lib/types/client/locales.d.ts +19 -0
  8. package/lib/types/client/rm-safe-status-text.d.ts +15 -0
  9. package/lib/types/client/rows.d.ts +107 -0
  10. package/lib/types/client/web-connection-rpc.d.ts +22 -0
  11. package/lib/types/config/fields.d.ts +85 -0
  12. package/lib/types/config/omp-settings.d.ts +21 -0
  13. package/lib/types/config/settings.d.ts +212 -0
  14. package/lib/types/config/truncate.d.ts +27 -0
  15. package/lib/types/host/browser-probe-rpc.d.ts +29 -0
  16. package/lib/types/index.d.ts +6 -0
  17. package/lib/types/tools/ast-edit/adapter/index.d.ts +26 -0
  18. package/lib/types/tools/ast-edit/adapter/sdk.d.ts +49 -0
  19. package/lib/types/tools/ast-grep/adapter/index.d.ts +31 -0
  20. package/lib/types/tools/ast-grep/adapter/sdk.d.ts +44 -0
  21. package/lib/types/tools/bash/adapter/spill.d.ts +34 -0
  22. package/lib/types/tools/bash/background.d.ts +40 -0
  23. package/lib/types/tools/bash/bash-executor.d.ts +102 -0
  24. package/lib/types/tools/bash/bash-interceptor.d.ts +33 -0
  25. package/lib/types/tools/bash/cd-workdir.d.ts +35 -0
  26. package/lib/types/tools/bash/logger.d.ts +18 -0
  27. package/lib/types/tools/bash/non-interactive-env.d.ts +5 -0
  28. package/lib/types/tools/bash/render.d.ts +46 -0
  29. package/lib/types/tools/bash/rm-safe-status.d.ts +62 -0
  30. package/lib/types/tools/bash/rm-safe.d.ts +18 -0
  31. package/lib/types/tools/bash/sanitize-text.d.ts +34 -0
  32. package/lib/types/tools/bash/shell-snapshot.d.ts +31 -0
  33. package/lib/types/tools/bash/shell-tokenize.d.ts +60 -0
  34. package/lib/types/tools/bash/streaming-output.d.ts +32 -0
  35. package/lib/types/tools/bash/trash-cli-main.d.ts +1 -0
  36. package/lib/types/tools/bash/trash-cli.d.ts +77 -0
  37. package/lib/types/tools/bash/types.d.ts +107 -0
  38. package/lib/types/tools/bash/which.d.ts +20 -0
  39. package/lib/types/tools/bash/windows-shell.d.ts +31 -0
  40. package/lib/types/tools/bash/yield.d.ts +71 -0
  41. package/lib/types/tools/edit/adapter/index.d.ts +57 -0
  42. package/lib/types/tools/edit/adapter/tools/auto-generated-guard.d.ts +10 -0
  43. package/lib/types/tools/edit/adapter/tools/output-meta.d.ts +34 -0
  44. package/lib/types/tools/edit/adapter/tools/plan-mode-guard.d.ts +21 -0
  45. package/lib/types/tools/glob/adapter/index.d.ts +52 -0
  46. package/lib/types/tools/grep/adapter/index.d.ts +53 -0
  47. package/lib/types/tools/grep/adapter/match-path.d.ts +1 -0
  48. package/lib/types/tools/hashline/native/diff-preview.d.ts +37 -0
  49. package/lib/types/tools/hashline/native/index.d.ts +109 -0
  50. package/lib/types/tools/hashline/native/normalize.d.ts +29 -0
  51. package/lib/types/tools/hashline/native/policy.d.ts +98 -0
  52. package/lib/types/tools/hashline/native/writer.d.ts +42 -0
  53. package/lib/types/tools/omp/browser/launch.d.ts +28 -0
  54. package/lib/types/tools/omp/browser/readable.d.ts +17 -0
  55. package/lib/types/tools/omp/config/settings-schema.d.ts +12 -0
  56. package/lib/types/tools/omp/config/settings.d.ts +59 -0
  57. package/lib/types/tools/omp/edit/apply-patch/parser.d.ts +34 -0
  58. package/lib/types/tools/omp/edit/details.d.ts +54 -0
  59. package/lib/types/tools/omp/edit/diff.d.ts +60 -0
  60. package/lib/types/tools/omp/edit/dispatch.d.ts +43 -0
  61. package/lib/types/tools/omp/edit/file-snapshot-store.d.ts +81 -0
  62. package/lib/types/tools/omp/edit/hashline/execute.d.ts +40 -0
  63. package/lib/types/tools/omp/edit/hashline/params.d.ts +6 -0
  64. package/lib/types/tools/omp/edit/modes/apply-patch.d.ts +25 -0
  65. package/lib/types/tools/omp/edit/modes/patch.d.ts +109 -0
  66. package/lib/types/tools/omp/edit/modes/replace.d.ts +151 -0
  67. package/lib/types/tools/omp/edit/normalize.d.ts +31 -0
  68. package/lib/types/tools/omp/edit/notebook.d.ts +50 -0
  69. package/lib/types/tools/omp/edit/read-file.d.ts +2 -0
  70. package/lib/types/tools/omp/edit/snapshot-details.d.ts +33 -0
  71. package/lib/types/tools/omp/extensibility/skills.d.ts +22 -0
  72. package/lib/types/tools/omp/internal-urls/index.d.ts +100 -0
  73. package/lib/types/tools/omp/internal-urls/local-protocol.d.ts +12 -0
  74. package/lib/types/tools/omp/internal-urls/parse.d.ts +31 -0
  75. package/lib/types/tools/omp/internal-urls/types.d.ts +189 -0
  76. package/lib/types/tools/omp/internal-urls/xd-protocol.d.ts +19 -0
  77. package/lib/types/tools/omp/markit/converters/docx.d.ts +6 -0
  78. package/lib/types/tools/omp/markit/converters/epub.d.ts +15 -0
  79. package/lib/types/tools/omp/markit/converters/pdf/index.d.ts +7 -0
  80. package/lib/types/tools/omp/markit/converters/pptx.d.ts +57 -0
  81. package/lib/types/tools/omp/markit/converters/xlsx.d.ts +25 -0
  82. package/lib/types/tools/omp/markit/index.d.ts +2 -0
  83. package/lib/types/tools/omp/markit/registry.d.ts +16 -0
  84. package/lib/types/tools/omp/markit/types.d.ts +30 -0
  85. package/lib/types/tools/omp/sdk.d.ts +103 -0
  86. package/lib/types/tools/omp/session/agent-storage.d.ts +154 -0
  87. package/lib/types/tools/omp/session/streaming-output.d.ts +244 -0
  88. package/lib/types/tools/omp/task/spawn-policy.d.ts +22 -0
  89. package/lib/types/tools/omp/tools/approval.d.ts +62 -0
  90. package/lib/types/tools/omp/tools/ast-edit.d.ts +73 -0
  91. package/lib/types/tools/omp/tools/ast-grep.d.ts +61 -0
  92. package/lib/types/tools/omp/tools/auto-generated-guard.d.ts +20 -0
  93. package/lib/types/tools/omp/tools/conflict-detect.d.ts +237 -0
  94. package/lib/types/tools/omp/tools/fetch.d.ts +103 -0
  95. package/lib/types/tools/omp/tools/file-recorder.d.ts +13 -0
  96. package/lib/types/tools/omp/tools/fs-cache-invalidation.d.ts +15 -0
  97. package/lib/types/tools/omp/tools/glob.d.ts +86 -0
  98. package/lib/types/tools/omp/tools/grep.d.ts +102 -0
  99. package/lib/types/tools/omp/tools/grouped-file-output.d.ts +70 -0
  100. package/lib/types/tools/omp/tools/index.d.ts +23 -0
  101. package/lib/types/tools/omp/tools/list-limit.d.ts +12 -0
  102. package/lib/types/tools/omp/tools/match-line-format.d.ts +11 -0
  103. package/lib/types/tools/omp/tools/output-meta.d.ts +160 -0
  104. package/lib/types/tools/omp/tools/path-utils.d.ts +326 -0
  105. package/lib/types/tools/omp/tools/plan-mode-guard.d.ts +33 -0
  106. package/lib/types/tools/omp/tools/read-archive.d.ts +16 -0
  107. package/lib/types/tools/omp/tools/read-format.d.ts +104 -0
  108. package/lib/types/tools/omp/tools/read-path-resolution.d.ts +19 -0
  109. package/lib/types/tools/omp/tools/read-selector.d.ts +27 -0
  110. package/lib/types/tools/omp/tools/read-sqlite.d.ts +16 -0
  111. package/lib/types/tools/omp/tools/read-summary.d.ts +15 -0
  112. package/lib/types/tools/omp/tools/read.d.ts +70 -0
  113. package/lib/types/tools/omp/tools/render-utils.d.ts +28 -0
  114. package/lib/types/tools/omp/tools/report-tool-issue.d.ts +149 -0
  115. package/lib/types/tools/omp/tools/resolve.d.ts +127 -0
  116. package/lib/types/tools/omp/tools/sqlite-reader.d.ts +114 -0
  117. package/lib/types/tools/omp/tools/tool-errors.d.ts +33 -0
  118. package/lib/types/tools/omp/tools/tool-result.d.ts +33 -0
  119. package/lib/types/tools/omp/tools/tool-timeouts.d.ts +57 -0
  120. package/lib/types/tools/omp/tools/write.d.ts +53 -0
  121. package/lib/types/tools/omp/tools/writethrough.d.ts +24 -0
  122. package/lib/types/tools/omp/utils/block-context.d.ts +35 -0
  123. package/lib/types/tools/omp/utils/cpuprofile.d.ts +51 -0
  124. package/lib/types/tools/omp/utils/edit-mode.d.ts +13 -0
  125. package/lib/types/tools/omp/utils/file-display-mode.d.ts +27 -0
  126. package/lib/types/tools/omp/utils/image-loading.d.ts +51 -0
  127. package/lib/types/tools/omp/utils/image-resize.d.ts +42 -0
  128. package/lib/types/tools/omp/utils/lang-from-path.d.ts +9 -0
  129. package/lib/types/tools/omp/utils/markit-cache.d.ts +23 -0
  130. package/lib/types/tools/omp/utils/markit.d.ts +30 -0
  131. package/lib/types/tools/omp/utils/profile-tree.d.ts +47 -0
  132. package/lib/types/tools/omp/utils/sample-profile.d.ts +67 -0
  133. package/lib/types/tools/omp/utils/sixel.d.ts +21 -0
  134. package/lib/types/tools/omp/utils/tools-manager.d.ts +11 -0
  135. package/lib/types/tools/omp/utils/turndown.d.ts +15 -0
  136. package/lib/types/tools/omp/utils/zip.d.ts +129 -0
  137. package/lib/types/tools/omp/web/browser-render.d.ts +50 -0
  138. package/lib/types/tools/omp/web/parallel.d.ts +68 -0
  139. package/lib/types/tools/omp/web/scrapers/artifacthub.d.ts +6 -0
  140. package/lib/types/tools/omp/web/scrapers/arxiv.d.ts +5 -0
  141. package/lib/types/tools/omp/web/scrapers/aur.d.ts +5 -0
  142. package/lib/types/tools/omp/web/scrapers/biorxiv.d.ts +5 -0
  143. package/lib/types/tools/omp/web/scrapers/bluesky.d.ts +5 -0
  144. package/lib/types/tools/omp/web/scrapers/brew.d.ts +5 -0
  145. package/lib/types/tools/omp/web/scrapers/cheatsh.d.ts +8 -0
  146. package/lib/types/tools/omp/web/scrapers/chocolatey.d.ts +5 -0
  147. package/lib/types/tools/omp/web/scrapers/choosealicense.d.ts +2 -0
  148. package/lib/types/tools/omp/web/scrapers/cisa-kev.d.ts +5 -0
  149. package/lib/types/tools/omp/web/scrapers/clojars.d.ts +5 -0
  150. package/lib/types/tools/omp/web/scrapers/coingecko.d.ts +5 -0
  151. package/lib/types/tools/omp/web/scrapers/crates-io.d.ts +5 -0
  152. package/lib/types/tools/omp/web/scrapers/crossref.d.ts +2 -0
  153. package/lib/types/tools/omp/web/scrapers/devto.d.ts +5 -0
  154. package/lib/types/tools/omp/web/scrapers/discogs.d.ts +8 -0
  155. package/lib/types/tools/omp/web/scrapers/discourse.d.ts +5 -0
  156. package/lib/types/tools/omp/web/scrapers/dockerhub.d.ts +5 -0
  157. package/lib/types/tools/omp/web/scrapers/docs-rs.d.ts +9 -0
  158. package/lib/types/tools/omp/web/scrapers/fdroid.d.ts +5 -0
  159. package/lib/types/tools/omp/web/scrapers/firefox-addons.d.ts +2 -0
  160. package/lib/types/tools/omp/web/scrapers/flathub.d.ts +2 -0
  161. package/lib/types/tools/omp/web/scrapers/github-gist.d.ts +5 -0
  162. package/lib/types/tools/omp/web/scrapers/github.d.ts +34 -0
  163. package/lib/types/tools/omp/web/scrapers/gitlab.d.ts +5 -0
  164. package/lib/types/tools/omp/web/scrapers/go-pkg.d.ts +5 -0
  165. package/lib/types/tools/omp/web/scrapers/hackage.d.ts +5 -0
  166. package/lib/types/tools/omp/web/scrapers/hackernews.d.ts +2 -0
  167. package/lib/types/tools/omp/web/scrapers/hex.d.ts +5 -0
  168. package/lib/types/tools/omp/web/scrapers/huggingface.d.ts +2 -0
  169. package/lib/types/tools/omp/web/scrapers/iacr.d.ts +5 -0
  170. package/lib/types/tools/omp/web/scrapers/index.d.ts +84 -0
  171. package/lib/types/tools/omp/web/scrapers/jetbrains-marketplace.d.ts +2 -0
  172. package/lib/types/tools/omp/web/scrapers/lemmy.d.ts +2 -0
  173. package/lib/types/tools/omp/web/scrapers/lobsters.d.ts +5 -0
  174. package/lib/types/tools/omp/web/scrapers/mastodon.d.ts +5 -0
  175. package/lib/types/tools/omp/web/scrapers/maven.d.ts +6 -0
  176. package/lib/types/tools/omp/web/scrapers/mdn.d.ts +2 -0
  177. package/lib/types/tools/omp/web/scrapers/metacpan.d.ts +5 -0
  178. package/lib/types/tools/omp/web/scrapers/musicbrainz.d.ts +5 -0
  179. package/lib/types/tools/omp/web/scrapers/npm.d.ts +5 -0
  180. package/lib/types/tools/omp/web/scrapers/nuget.d.ts +5 -0
  181. package/lib/types/tools/omp/web/scrapers/nvd.d.ts +5 -0
  182. package/lib/types/tools/omp/web/scrapers/ollama.d.ts +2 -0
  183. package/lib/types/tools/omp/web/scrapers/open-vsx.d.ts +5 -0
  184. package/lib/types/tools/omp/web/scrapers/opencorporates.d.ts +5 -0
  185. package/lib/types/tools/omp/web/scrapers/openlibrary.d.ts +5 -0
  186. package/lib/types/tools/omp/web/scrapers/orcid.d.ts +5 -0
  187. package/lib/types/tools/omp/web/scrapers/osv.d.ts +5 -0
  188. package/lib/types/tools/omp/web/scrapers/packagist.d.ts +5 -0
  189. package/lib/types/tools/omp/web/scrapers/pub-dev.d.ts +5 -0
  190. package/lib/types/tools/omp/web/scrapers/pubmed.d.ts +5 -0
  191. package/lib/types/tools/omp/web/scrapers/pypi.d.ts +5 -0
  192. package/lib/types/tools/omp/web/scrapers/rawg.d.ts +2 -0
  193. package/lib/types/tools/omp/web/scrapers/readthedocs.d.ts +2 -0
  194. package/lib/types/tools/omp/web/scrapers/reddit.d.ts +5 -0
  195. package/lib/types/tools/omp/web/scrapers/repology.d.ts +5 -0
  196. package/lib/types/tools/omp/web/scrapers/rfc.d.ts +5 -0
  197. package/lib/types/tools/omp/web/scrapers/rubygems.d.ts +5 -0
  198. package/lib/types/tools/omp/web/scrapers/searchcode.d.ts +2 -0
  199. package/lib/types/tools/omp/web/scrapers/sec-edgar.d.ts +5 -0
  200. package/lib/types/tools/omp/web/scrapers/semantic-scholar.d.ts +2 -0
  201. package/lib/types/tools/omp/web/scrapers/snapcraft.d.ts +2 -0
  202. package/lib/types/tools/omp/web/scrapers/sourcegraph.d.ts +2 -0
  203. package/lib/types/tools/omp/web/scrapers/spdx.d.ts +5 -0
  204. package/lib/types/tools/omp/web/scrapers/spotify.d.ts +8 -0
  205. package/lib/types/tools/omp/web/scrapers/stackoverflow.d.ts +6 -0
  206. package/lib/types/tools/omp/web/scrapers/terraform.d.ts +5 -0
  207. package/lib/types/tools/omp/web/scrapers/tldr.d.ts +7 -0
  208. package/lib/types/tools/omp/web/scrapers/twitter.d.ts +5 -0
  209. package/lib/types/tools/omp/web/scrapers/types.d.ts +90 -0
  210. package/lib/types/tools/omp/web/scrapers/utils.d.ts +26 -0
  211. package/lib/types/tools/omp/web/scrapers/vimeo.d.ts +5 -0
  212. package/lib/types/tools/omp/web/scrapers/vscode-marketplace.d.ts +5 -0
  213. package/lib/types/tools/omp/web/scrapers/w3c.d.ts +2 -0
  214. package/lib/types/tools/omp/web/scrapers/wikidata.d.ts +5 -0
  215. package/lib/types/tools/omp/web/scrapers/wikipedia.d.ts +5 -0
  216. package/lib/types/tools/omp/web/scrapers/youtube.d.ts +5 -0
  217. package/lib/types/tools/omp/web/search/providers/utils.d.ts +49 -0
  218. package/lib/types/tools/omp/web/search/types.d.ts +501 -0
  219. package/lib/types/tools/omp/web/search/utils.d.ts +4 -0
  220. package/lib/types/tools/omp/workspace-tree.d.ts +42 -0
  221. package/lib/types/tools/read/adapter/index.d.ts +49 -0
  222. package/lib/types/tools/read/adapter/internal-urls/artifact-protocol.d.ts +15 -0
  223. package/lib/types/tools/read/adapter/internal-urls/registry-helpers.d.ts +44 -0
  224. package/lib/types/tools/read/adapter/registry/agent-registry.d.ts +29 -0
  225. package/lib/types/tools/shared/auto-generated-guard.dsh.d.ts +16 -0
  226. package/lib/types/tools/shared/browser-detect.d.ts +54 -0
  227. package/lib/types/tools/shared/browser-rpc-channel.d.ts +40 -0
  228. package/lib/types/tools/shared/bun-ffi-shim.d.ts +13 -0
  229. package/lib/types/tools/shared/bun-named-shim.d.ts +42 -0
  230. package/lib/types/tools/shared/bun-shim.d.ts +138 -0
  231. package/lib/types/tools/shared/bun-sqlite-shim.d.ts +49 -0
  232. package/lib/types/tools/shared/fs-promises-shim.d.ts +15 -0
  233. package/lib/types/tools/shared/image-bridge.d.ts +98 -0
  234. package/lib/types/tools/shared/omp-prompt.d.ts +47 -0
  235. package/lib/types/tools/shared/sandbox-policy.d.ts +38 -0
  236. package/lib/types/tools/shared/session-state.d.ts +51 -0
  237. package/lib/types/tools/shared/tool-errors.d.ts +33 -0
  238. package/lib/types/tools/shared/win-path-fixes.d.ts +16 -0
  239. package/lib/types/tools/write/adapter/index.d.ts +31 -0
  240. package/lib/{utils-CCfhUQen.mjs → utils-ECAwvaPQ.mjs} +1 -1
  241. package/package.json +2 -2
  242. package/presets/package.json +1 -1
  243. package/scripts/patch-pi-natives.mjs +108 -108
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-DKDH71En.mjs";
5
5
  import { $ as isEnoent, A as formatCount, C as warn, D as installBunShim, F as $flag, N as $env, O as formatAge, P as $envpos, Q as hasFsCode, U as getAutoQaDbPath, V as VERSION, X as getRemoteDir, Y as getPuppeteerDir, at as findOnPath, b as debug, c as combineSignals, d as $which, et as isEnotdir, it as untilAborted, k as formatBytes$1, l as exec, m as readImageMetadata, nt as peekFile, q as getInstallId, tt as isProbablyBinary, u as render, x as error } from "./src-BwW51vA5.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-CCfhUQen.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-ECAwvaPQ.mjs";
7
7
  import { t as sanitizeText } from "./sanitize-text-BCf5KmCf.mjs";
8
8
  import { n as isRecord$2 } from "./type-guards-CttAANEx.mjs";
9
9
  import { n as ToolError, r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
@@ -10264,7 +10264,7 @@ let specialHandlersPromise;
10264
10264
  * requires a special handler, so we keep them out of the cold-startup graph.
10265
10265
  */
10266
10266
  function loadSpecialHandlers() {
10267
- specialHandlersPromise ??= import("./scrapers-D8oWspgW.mjs").then((m) => m.specialHandlers);
10267
+ specialHandlersPromise ??= import("./scrapers-CtQrQ5kG.mjs").then((m) => m.specialHandlers);
10268
10268
  return specialHandlersPromise;
10269
10269
  }
10270
10270
  /**
@@ -14483,9 +14483,10 @@ const writeSchema = type({
14483
14483
  * line-number prefixes (for example legacy or malformed hashline echoes).
14484
14484
  */
14485
14485
  function stripWriteContentWithPotentialLooseHeader(lines) {
14486
- const cleaned = stripHashlinePrefixes(lines);
14487
- if (cleaned !== lines) return {
14488
- text: cleaned.join("\n"),
14486
+ const originalText = lines.join("\n");
14487
+ const cleanedText = stripHashlinePrefixes(lines).join("\n");
14488
+ if (cleanedText !== originalText) return {
14489
+ text: cleanedText,
14489
14490
  stripped: true
14490
14491
  };
14491
14492
  const headerIndex = lines.findIndex((line) => line.trim().length > 0);
@@ -14494,13 +14495,14 @@ function stripWriteContentWithPotentialLooseHeader(lines) {
14494
14495
  stripped: false
14495
14496
  };
14496
14497
  const linesWithoutHeader = lines.slice(0, headerIndex).concat(lines.slice(headerIndex + 1));
14497
- const cleanedWithoutHeader = stripHashlinePrefixes(linesWithoutHeader);
14498
- if (cleanedWithoutHeader === linesWithoutHeader) return {
14499
- text: lines.join("\n"),
14498
+ const textWithoutHeader = linesWithoutHeader.join("\n");
14499
+ const cleanedWithoutHeader = stripHashlinePrefixes(linesWithoutHeader).join("\n");
14500
+ if (cleanedWithoutHeader === textWithoutHeader) return {
14501
+ text: originalText,
14500
14502
  stripped: false
14501
14503
  };
14502
14504
  return {
14503
- text: cleanedWithoutHeader.join("\n"),
14505
+ text: cleanedWithoutHeader,
14504
14506
  stripped: true
14505
14507
  };
14506
14508
  }
@@ -3,7 +3,7 @@ __installBunShim();
3
3
  import { n as fs_promises_shim_exports } from "./fs-promises-shim-Bx0fpxuk.mjs";
4
4
  import { $ as isEnoent, B as USER_AGENT, C as warn, G as getDocsRsCacheDir, N as $env, c as combineSignals, j as formatNumber, k as formatBytes, l as exec, s as Snowflake, y as parseFrontmatter } from "./src-BwW51vA5.mjs";
5
5
  import { W as tryParseJson } from "./utils-CUPhpw9A.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-CCfhUQen.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-ECAwvaPQ.mjs";
7
7
  import { n as isRecord } from "./type-guards-CttAANEx.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-PVueGi9S.mjs";
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The tool-plus settings card — a collapsible disclosure card in the Plugins
3
+ * settings tab styled against the app's `--dsw-alias-*` design tokens and the
4
+ * official card interaction (header button with unsaved badge + rotating
5
+ * chevron, smooth expand/collapse respecting reduced-motion, staged edits that
6
+ * survive collapsing, one Save write, nothing rendered while the namespace is
7
+ * unavailable). Copy is fully localized through the slot-injected `t` seat
8
+ * (`locale: 'tool-plus'`), which re-renders on a locale switch.
9
+ *
10
+ * The card edits the FLAT settings surface (OMP `bash*`-style scalar keys) —
11
+ * the client scope only writes scalar fields — grouped as timeouts,
12
+ * backgrounding, output, completion truncation (subdivided into byte and line
13
+ * settings), and behavior. Field definitions, defaults, and copy keys come
14
+ * from the single-source field table (`src/config/fields.ts`), shared with
15
+ * the Tool Plus settings section.
16
+ * @module @xiaoso/dsh-tool-plus/client
17
+ */
18
+ import { type ReactNode } from 'react';
19
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
20
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
21
+ import type { OutputRetentionMode, OutputTruncateStrategy } from '../config/settings.ts';
22
+ /** The flat, scalar-editable fields this card edits (mirrors the settings schema). */
23
+ export interface BashPlusSettings {
24
+ enableRunInBackground?: boolean;
25
+ autoBackgroundMs?: number;
26
+ defaultTimeoutMs?: number;
27
+ maxTimeoutMs?: number;
28
+ outputMaxBytes?: number;
29
+ outputSinkTailBytes?: number;
30
+ outputSinkHeadBytes?: number;
31
+ minimizerEnabled?: boolean;
32
+ interceptorEnabled?: boolean;
33
+ nonInteractiveEnv?: boolean;
34
+ snapshotEnabled?: boolean;
35
+ useShellCommandWrapper?: boolean;
36
+ maxBackgroundJobs?: number;
37
+ outputTruncateStrategy?: OutputTruncateStrategy;
38
+ outputTruncateTriggerBytes?: number;
39
+ outputTruncateTriggerLines?: number;
40
+ outputTruncateByteMode?: OutputRetentionMode;
41
+ outputTruncateByteHeadBytes?: number;
42
+ outputTruncateByteTailBytes?: number;
43
+ outputTruncateLineMode?: OutputRetentionMode;
44
+ outputTruncateLineHeadLines?: number;
45
+ outputTruncateLineTailLines?: number;
46
+ }
47
+ /** Business face the slot registration injects: the bound scope. */
48
+ export interface BashPlusCardFace {
49
+ scope: SettingsScope<BashPlusSettings>;
50
+ }
51
+ /** Props the renderer binds: runtime seat, the `t` locale seat, and the scope face. */
52
+ export type BashPlusCardProps = PropsRuntime<'settings.plugin.item'> & PropsLocale<'tool-plus'> & BashPlusCardFace;
53
+ export declare function BashPlusCard(props: BashPlusCardProps): ReactNode;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Tool Plus settings section — the plugin's own page in the Settings panel,
3
+ * registered into the `settings.section` slot (nav id `tool-plus`). The page
4
+ * renders one tab per tool (Bash / Read / Write & Edit / Grep /
5
+ * Ast Edit / Read Image); switching a tab shows that tool's configurable
6
+ * fields, while tools without global settings show a placeholder. Only the
7
+ * active tool's panel is rendered; the shared staged form over the
8
+ * `tool-plus` namespace lives at the page level, so drafts survive switching
9
+ * without keeping hidden panels mounted — the same flat schema the Bash card
10
+ * edits, from the same single-source field table.
11
+ *
12
+ * `action`-kind fields (e.g. 探测浏览器) are not part of the staged form:
13
+ * they run a host RPC endpoint over the official Connection channel
14
+ * (`/tool-plus`), with per-field running/result state kept at the page level.
15
+ *
16
+ * Tab chrome mirrors the official Plugins settings section
17
+ * (ui-settings-plugins): `role="tablist"` + tab/panel roles, aria wiring,
18
+ * and arrow/Home/End keyboard roaming.
19
+ *
20
+ * The page is pinned to the host settings pane: the heading, intro and tablist
21
+ * stay put, the save bar sits at the bottom, and the tab panel is the only
22
+ * scroller — so the scrollbar spans just the band between them.
23
+ * @module @xiaoso/dsh-tool-plus/client
24
+ */
25
+ import { type ReactNode } from 'react';
26
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
27
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
28
+ import { type ToolSettingsValue } from './forms.ts';
29
+ /** Registration-side face: the bound settings scope. */
30
+ export interface ToolPlusSectionInjected {
31
+ scope: SettingsScope<ToolSettingsValue>;
32
+ }
33
+ /** Props the renderer binds for the section (owner + locale + injected face). */
34
+ export type ToolPlusSectionProps = PropsRuntime<'settings.section'> & PropsLocale<'tool-plus'> & InjectFace<ToolPlusSectionInjected>;
35
+ /** Render the Tool Plus settings section. */
36
+ export declare function ToolPlusSection(props: ToolPlusSectionProps): ReactNode;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Generic staged-form model over the plugin's flat settings namespace,
3
+ * shared by the Bash card and the Tool Plus settings section. A form stages
4
+ * what the user types and writes it only on save; field definitions come from
5
+ * the single-source table (`src/config/fields.ts`), so every surface renders
6
+ * the same fields with the same defaults.
7
+ * @module @xiaoso/dsh-tool-plus/client
8
+ */
9
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
10
+ import type { CardShell } from '@deepseek-ai/dsh-client-ui-settings-plugins/client';
11
+ import type { ToolPlusField } from '../config/fields.ts';
12
+ import { type NumberControl, type SelectControl, type ToggleControl } from './rows.tsx';
13
+ /** The flat settings document shape this form edits. */
14
+ export type ToolSettingsValue = Record<string, number | boolean | string | undefined>;
15
+ /** One group of controls (a Bash subgroup or a whole tool's section). */
16
+ export interface ToolFormGroup {
17
+ group: string;
18
+ numbers: NumberControl[];
19
+ selects: SelectControl[];
20
+ toggles: ToggleControl[];
21
+ }
22
+ /** The form state a settings surface renders. */
23
+ export interface ToolForm {
24
+ shell: CardShell;
25
+ /** Controls grouped by `ToolPlusField.group`, in first-appearance order. */
26
+ groups: ToolFormGroup[];
27
+ actions: {
28
+ edit: (field: string, text: string) => void;
29
+ resetField: (field: string) => void;
30
+ save: () => Promise<void>;
31
+ discard: () => void;
32
+ };
33
+ editSelect: (field: string, value: string) => void;
34
+ onToggle: (field: string, checked: boolean) => void;
35
+ }
36
+ /**
37
+ * Stage edits over the bound scope; only a Save writes the document.
38
+ * @param scope - bound settings scope for the `tool-plus` namespace.
39
+ * @param fields - the fields this surface edits (single-source table slice).
40
+ * @returns the form state and its write actions.
41
+ */
42
+ export declare function useToolForm(scope: SettingsScope<ToolSettingsValue>, fields: readonly ToolPlusField[]): ToolForm;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Tool-plus settings card, browser half. Registers the plugin's card into the
3
+ * Plugins settings surface's `settings.plugin.item` slot — keyed by the
4
+ * `tool-plus` namespace, so the configurable tab pairs it with the Host-side
5
+ * namespace of the same name — binds that namespace's settings scope for
6
+ * reads and writes, and registers the card's locale dictionaries.
7
+ *
8
+ * Only officially exported APIs are used (`dsh-client-ui-slots` slot
9
+ * registry, `dsh-client-locale` dictionary registration, `dsh-client-ui-settings`
10
+ * scope contract and binder, and the published
11
+ * `dsh-client-ui-settings-plugins` slot-type declaration); the card itself is
12
+ * this package's own, not a copy of any non-exported card internals.
13
+ *
14
+ * @module @xiaoso/dsh-tool-plus/client
15
+ */
16
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
17
+ /**
18
+ * Settings namespace of this plugin, spelled here because a client package
19
+ * must not depend on a Host package — official convention: the browser half
20
+ * spells the same value the Host plugin registers (src/config/settings.ts).
21
+ */
22
+ export declare const BASH_PLUS_CLIENT_NS = "tool-plus";
23
+ /** Required services (cordis fiber inject): slots + locale + the settings scope binder. */
24
+ export declare const inject: string[];
25
+ /**
26
+ * Mount the tool-plus settings card.
27
+ * @param ctx - the browser plugin context.
28
+ */
29
+ export declare function apply(ctx: ClientContext): void;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Locale bundles for the bash-plus settings card. zh is the source of truth
3
+ * for the key set; en is checked complete against it — both dictionaries are
4
+ * `Record<BashPlusLocaleKey, string>`, so a missing or extra key in either is
5
+ * a compile error (the official registration enforces bilingual balance).
6
+ * @module @xiaoso/dsh-tool-plus/client
7
+ */
8
+ export type BashPlusLocaleKey = 'title' | 'description' | 'nav' | 'pageTitle' | 'pageDescription' | 'tabBash' | 'tabRead' | 'tabWriteEdit' | 'tabGrep' | 'tabGlob' | 'tabAstGrep' | 'tabAstEdit' | 'tabReadImage' | 'groupTiming' | 'groupOutput' | 'groupTruncation' | 'groupBehavior' | 'groupReading' | 'groupSummary' | 'groupImages' | 'groupEditMode' | 'groupGuard' | 'groupGrep' | 'groupSearchDefaults' | 'groupFetch' | 'groupAst' | 'noConfigTitle' | 'noConfigHint' | 'readSummarizeEnabled' | 'readSummarizeEnabledHint' | 'readSummarizeProse' | 'readSummarizeProseHint' | 'readSummarizeMinBodyLines' | 'readSummarizeMinBodyLinesHint' | 'readSummarizeMinCommentLines' | 'readSummarizeMinCommentLinesHint' | 'readSummarizeMinTotalLines' | 'readSummarizeMinTotalLinesHint' | 'readSummarizeUnfoldUntil' | 'readSummarizeUnfoldUntilHint' | 'readSummarizeUnfoldLimit' | 'readSummarizeUnfoldLimitHint' | 'editBlockAutoGenerated' | 'editBlockAutoGeneratedHint' | 'readDefaultLimit' | 'readDefaultLimitHint' | 'readLineNumbers' | 'readLineNumbersHint' | 'readRenderMarkdown' | 'readRenderMarkdownHint' | 'readConcurrentSafe' | 'readConcurrentSafeHint' | 'editMode' | 'editModeHint' | 'editFuzzyMatch' | 'editFuzzyMatchHint' | 'editFuzzyThreshold' | 'editFuzzyThresholdHint' | 'editEnforceSeenLines' | 'editEnforceSeenLinesHint' | 'grepContextBefore' | 'grepContextBeforeHint' | 'grepContextAfter' | 'grepContextAfterHint' | 'grepCaseDefault' | 'grepCaseDefaultHint' | 'grepGitignoreDefault' | 'grepGitignoreDefaultHint' | 'globGitignoreDefault' | 'globGitignoreDefaultHint' | 'globHiddenDefault' | 'globHiddenDefaultHint' | 'astGrepEnabled' | 'astGrepEnabledHint' | 'astEditEnabled' | 'astEditEnabledHint' | 'optReplace' | 'optPatch' | 'optHashline' | 'optApplyPatch' | 'fetchEnabled' | 'fetchEnabledHint' | 'fetchMaxTimeoutSeconds' | 'fetchMaxTimeoutSecondsHint' | 'fetchReader' | 'fetchReaderHint' | 'browserReaderEnabled' | 'browserReaderEnabledHint' | 'browserProbe' | 'browserProbeHint' | 'browserProbeRunning' | 'browserProbeNone' | 'browserProbeFailed' | 'browserProbeUnavailable' | 'optReaderAuto' | 'optReaderNative' | 'optReaderTrafilatura' | 'optReaderLynx' | 'optReaderParallel' | 'optReaderJina' | 'optReaderBrowser' | 'imagesAutoResize' | 'imagesAutoResizeHint' | 'imagesBlockImages' | 'imagesBlockImagesHint' | 'imagesExcludeWebp' | 'imagesExcludeWebpHint' | 'imagesInputMaxBytes' | 'imagesInputMaxBytesHint' | 'imagesResizeMaxSide' | 'imagesResizeMaxSideHint' | 'imagesResizeMaxBytes' | 'imagesResizeMaxBytesHint' | 'imagesResizeMinSide' | 'imagesResizeMinSideHint' | 'imagesResizeJpegQuality' | 'imagesResizeJpegQualityHint' | 'autoBackgroundMs' | 'autoBackgroundMsHint' | 'defaultTimeoutMs' | 'defaultTimeoutMsHint' | 'maxTimeoutMs' | 'maxTimeoutMsHint' | 'maxBackgroundJobs' | 'maxBackgroundJobsHint' | 'outputMaxBytes' | 'outputMaxBytesHint' | 'outputSinkTailBytes' | 'outputSinkTailBytesHint' | 'outputSinkHeadBytes' | 'outputSinkHeadBytesHint' | 'minimizerEnabled' | 'minimizerEnabledHint' | 'enableRunInBackground' | 'enableRunInBackgroundHint' | 'interceptorEnabled' | 'interceptorEnabledHint' | 'nonInteractiveEnv' | 'nonInteractiveEnvHint' | 'snapshotEnabled' | 'snapshotEnabledHint' | 'rmSafe' | 'rmSafeHint' | 'rmSafeStatusInjected' | 'rmSafeStatusInjectedUnverified' | 'rmSafeStatusFailed' | 'rmSafeReasonSnapshotUnavailable' | 'rmSafeReasonCliMissing' | 'rmSafeReasonSnapshotWriteFailed' | 'rmSafeReasonRuntimeNotEffective' | 'useShellCommandWrapper' | 'useShellCommandWrapperHint' | 'outputTruncateStrategy' | 'outputTruncateStrategyHint' | 'outputTruncateTriggerBytes' | 'outputTruncateTriggerBytesHint' | 'outputTruncateTriggerLines' | 'outputTruncateTriggerLinesHint' | 'outputTruncateByteMode' | 'outputTruncateByteModeHint' | 'outputTruncateByteHeadBytes' | 'outputTruncateByteHeadBytesHint' | 'outputTruncateByteTailBytes' | 'outputTruncateByteTailBytesHint' | 'outputTruncateLineMode' | 'outputTruncateLineModeHint' | 'outputTruncateLineHeadLines' | 'outputTruncateLineHeadLinesHint' | 'outputTruncateLineTailLines' | 'outputTruncateLineTailLinesHint' | 'optBytes' | 'optLines' | 'optHead' | 'optTail' | 'optMiddle' | 'overridden' | 'reset' | 'readOnly' | 'expand' | 'collapse' | 'save' | 'saving' | 'discard' | 'unsaved' | 'saveFailed' | 'invalidNumber' | 'appliesTo';
9
+ /** Simplified Chinese copy. */
10
+ export declare const zh: Record<BashPlusLocaleKey, string>;
11
+ /** English copy. */
12
+ export declare const en: Record<BashPlusLocaleKey, string>;
13
+ /** Merge this plugin's namespace into the slot locale table (official pattern). */
14
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
15
+ interface LocaleNamespaceMap {
16
+ /** This plugin's own settings-card copy. */
17
+ 'tool-plus': BashPlusLocaleKey;
18
+ }
19
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * rmSafe/status 结果 → 本地化文案的纯映射(无 React/DOM 依赖,可单测)。
3
+ * @module @xiaoso/dsh-tool-plus/client/rm-safe-status-text
4
+ */
5
+ import type { RmSafeStatusValue } from '../tools/shared/browser-rpc-channel.ts';
6
+ import type { BashPlusLocaleKey } from './locales.ts';
7
+ /** Locale key of one rmSafe failure reason. */
8
+ export declare function rmSafeReasonKey(reason: Extract<RmSafeStatusValue, {
9
+ status: 'failed';
10
+ }>['reason']): BashPlusLocaleKey;
11
+ /**
12
+ * Localized text of one rmSafe/status result. `disabled` maps to the empty
13
+ * string — the caller decides not to surface it.
14
+ */
15
+ export declare function rmSafeStatusText(t: (key: BashPlusLocaleKey) => string, value: RmSafeStatusValue): string;
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Shared settings-row controls for the tool-plus settings surfaces: number
3
+ * input, select pill, and toggle switch rows, styled against the app's
4
+ * `--dsw-alias-*` design tokens. Extracted from the Bash card so the Plugins
5
+ * card and the Tool Plus settings section render identical controls.
6
+ * @module @xiaoso/dsh-tool-plus/client
7
+ */
8
+ import { type ReactNode } from 'react';
9
+ import type { BashPlusLocaleKey } from './locales.ts';
10
+ /** One rendered number control. */
11
+ export interface NumberControl {
12
+ field: string;
13
+ labelKey: BashPlusLocaleKey;
14
+ hintKey: BashPlusLocaleKey;
15
+ text: string;
16
+ overridden: boolean;
17
+ invalid: boolean;
18
+ }
19
+ /** One rendered select control. */
20
+ export interface SelectControl {
21
+ field: string;
22
+ labelKey: BashPlusLocaleKey;
23
+ hintKey: BashPlusLocaleKey;
24
+ options: readonly {
25
+ value: string;
26
+ labelKey: BashPlusLocaleKey;
27
+ }[];
28
+ value: string;
29
+ overridden: boolean;
30
+ }
31
+ /** One rendered toggle control. */
32
+ export interface ToggleControl {
33
+ field: string;
34
+ labelKey: BashPlusLocaleKey;
35
+ hintKey: BashPlusLocaleKey;
36
+ checked: boolean;
37
+ overridden: boolean;
38
+ }
39
+ /** One rendered action control (button that calls a host RPC endpoint). */
40
+ export interface ActionControl {
41
+ field: string;
42
+ labelKey: BashPlusLocaleKey;
43
+ hintKey: BashPlusLocaleKey;
44
+ actionKey: string;
45
+ }
46
+ /**
47
+ * Shared row control CSS, keyed by `data-plugin-css` and injected once.
48
+ *
49
+ * Motion discipline: every moving control animates transform/opacity only
50
+ * (GPU-composited); color transitions fire on hover/focus state changes
51
+ * only. Everything is disabled under prefers-reduced-motion. All colors are
52
+ * `--dsw-alias-*` host tokens (or color-mix of them), so light/dark themes
53
+ * adapt automatically.
54
+ */
55
+ export declare const SETTINGS_ROWS_CSS = "\n.tp-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--dsw-alias-border-l1);transition:background .16s ease}\n.tp-row:last-child{border-bottom:none}\n.tp-rowText{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding-right:24px}\n.tp-rowTitle{font-size:14px;font-weight:400;line-height:22px;color:var(--dsw-alias-label-primary)}\n.tp-rowDesc{font-size:12px;font-weight:400;line-height:18px;color:var(--dsw-alias-label-tertiary)}\n.tp-badges{display:inline-flex;align-items:center;gap:8px}\n.tp-badge{display:inline-flex;align-items:center;gap:6px;padding:1px 0;font-size:11px;line-height:17px;white-space:nowrap;font-weight:500;color:var(--dsw-alias-label-tertiary)}\n.tp-badge::before{content:'';flex:none;width:5px;height:5px;border-radius:999px;background:var(--dsw-alias-state-business-primary)}\n.tp-reset{position:relative;border:none;background:none;padding:2px 0;font:inherit;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color .16s ease}\n.tp-reset::after{content:'';position:absolute;left:0;right:0;bottom:0;height:1px;border-radius:1px;background:currentColor;opacity:0;transform:scaleX(.6);transform-origin:left center;transition:opacity .16s ease,transform .2s cubic-bezier(.22,1,.36,1)}\n.tp-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}\n.tp-reset:hover:not(:disabled)::after{opacity:.6;transform:scaleX(1)}\n.tp-reset:disabled{cursor:default}\n.tp-reset:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px;border-radius:2px}\n.tp-input{flex:none;width:128px;height:34px;padding:0 11px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);font:inherit;font-size:13px;line-height:1.5;color:var(--dsw-alias-label-primary);box-sizing:border-box;transition:border-color .16s ease}\n.tp-input:hover:not(:disabled):not(:focus-visible){border-color:var(--dsw-alias-border-l3)}\n.tp-input:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px;border-color:var(--dsw-alias-border-l3)}\n.tp-input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}\n.tp-input.tp-invalid{border-color:var(--dsw-alias-label-error)}\n.tp-input.tp-invalid:focus-visible{outline-color:var(--dsw-alias-state-error-primary)}\n.tp-invalidText{color:var(--dsw-alias-label-error);animation:tp-soft-in .18s ease both}\n.tp-selectAnchor{display:inline-flex;flex-shrink:0}\n.tp-selectTrigger{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-module-platform);font:inherit;font-size:13px;line-height:20px;color:var(--dsw-alias-label-primary);cursor:pointer;flex-shrink:0;transition:background .16s ease,border-color .16s ease,transform .1s ease}\n.tp-selectTrigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3)}\n.tp-selectTrigger:active:not(:disabled){transform:scale(.97)}\n.tp-selectTrigger:disabled{opacity:.55;cursor:default}\n.tp-selectTrigger:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}\n.tp-selectChevron{flex:none;color:var(--dsw-alias-label-tertiary);display:inline-flex;transition:transform .2s cubic-bezier(.22,1,.36,1)}\n.tp-selectTrigger[aria-expanded=\"true\"] .tp-selectChevron{transform:rotate(180deg)}\n.tp-switch{position:relative;width:40px;height:24px;flex:none}\n.tp-switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1}\n.tp-switchTrack{position:absolute;inset:0;border-radius:999px;background:var(--dsw-alias-border-l2);transition:background .18s ease;pointer-events:none}\n.tp-row:hover .tp-switchTrack{background:var(--dsw-alias-border-l3)}\n.tp-switch input:checked+.tp-switchTrack{background:var(--dsw-alias-brand-primary)}\n.tp-row:hover .tp-switch input:checked+.tp-switchTrack{background:var(--dsw-alias-brand-primary)}\n.tp-switch input:focus-visible+.tp-switchTrack{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.tp-thumb{position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:999px;background:var(--dsw-alias-bg-layer-3);box-shadow:0 1px 3px rgba(0,0,0,.14),0 1px 1px rgba(0,0,0,.08);transition:transform .2s cubic-bezier(.34,1.3,.5,1);transform-origin:left center;pointer-events:none}\n.tp-switch input:checked~.tp-thumb{transform:translateX(16px);transform-origin:right center}\n.tp-switch input:active:not(:disabled)~.tp-thumb{transform:scaleX(1.2)}\n.tp-switch input:checked:active:not(:disabled)~.tp-thumb{transform:translateX(16px) scaleX(1.2)}\n.tp-switch input:disabled{cursor:default}\n.tp-switch input:disabled~.tp-switchTrack,.tp-switch input:disabled~.tp-thumb{opacity:.45}\n.tp-actionField{display:flex;flex-direction:column;gap:8px;padding:12px 0;border-bottom:1px solid var(--dsw-alias-border-l1)}\n.tp-actionField:last-child{border-bottom:none}\n.tp-actionHead{display:flex;align-items:center;gap:12px}\n.tp-actionInfo{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}\n.tp-actionTitle{font-size:14px;font-weight:400;line-height:22px;color:var(--dsw-alias-label-primary)}\n.tp-actionDesc{font-size:12px;font-weight:400;line-height:18px;color:var(--dsw-alias-label-tertiary)}\n.tp-actionButton{appearance:none;flex:none;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:5px 14px;font:inherit;font-size:13px;line-height:1.5;color:var(--dsw-alias-label-primary);cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .1s ease}\n.tp-actionButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3)}\n.tp-actionButton:active:not(:disabled){transform:scale(.97)}\n.tp-actionButton:disabled{opacity:.55;cursor:default}\n.tp-actionButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}\n.tp-actionResult{margin:0;font-size:12px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;animation:tp-soft-in .22s cubic-bezier(.22,1,.36,1) both}\n.tp-actionResult[data-state=\"ok\"]{color:var(--dsw-alias-label-secondary)}\n.tp-actionResult[data-state=\"error\"]{color:var(--dsw-alias-label-error)}\n@keyframes tp-soft-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion: reduce){\n .tp-row,.tp-reset,.tp-reset::after,.tp-input,.tp-selectTrigger,.tp-selectChevron,.tp-switchTrack,.tp-thumb,.tp-actionButton{transition:none}\n .tp-invalidText,.tp-actionResult{animation:none}\n}\n";
56
+ export declare function injectSettingsRowsCss(): void;
57
+ declare function hasOwn(obj: unknown, key: string): boolean;
58
+ /**
59
+ * Number row: same left-text / right-control anatomy as toggle and select
60
+ * rows, with the input right-aligned at a fixed width. The title is wired to
61
+ * the input (htmlFor), so clicking the title focuses the input; the
62
+ * description and the rest of the row are inert — each side manages its own
63
+ * interaction.
64
+ */
65
+ export declare function NumberRow(props: {
66
+ t: (key: BashPlusLocaleKey) => string;
67
+ control: NumberControl;
68
+ disabled: boolean;
69
+ onEdit: (field: string, text: string) => void;
70
+ onReset: (field: string) => void;
71
+ }): ReactNode;
72
+ /** Select row: Title + desc stacked on left, selector pill on right. */
73
+ export declare function SelectRow(props: {
74
+ t: (key: BashPlusLocaleKey) => string;
75
+ control: SelectControl;
76
+ disabled: boolean;
77
+ open: boolean;
78
+ onOpenChange: (field: string | null) => void;
79
+ onEdit: (field: string, value: string) => void;
80
+ onReset: (field: string) => void;
81
+ }): ReactNode;
82
+ /** Toggle row: Title + desc stacked on left, switch on right. */
83
+ export declare function ToggleRow(props: {
84
+ t: (key: BashPlusLocaleKey) => string;
85
+ control: ToggleControl;
86
+ disabled: boolean;
87
+ onToggle: (field: string, checked: boolean) => void;
88
+ onReset: (field: string) => void;
89
+ }): ReactNode;
90
+ /**
91
+ * Action row: Title + desc stacked on left, a button on the right that calls
92
+ * the host RPC endpoint named by `control.actionKey` (via the Connection
93
+ * channel; the caller owns the RPC). The result line renders below, colored
94
+ * by outcome (`ok` / `error`).
95
+ */
96
+ export declare function ActionRow(props: {
97
+ t: (key: BashPlusLocaleKey) => string;
98
+ control: ActionControl;
99
+ disabled: boolean;
100
+ running: boolean;
101
+ result: {
102
+ ok: boolean;
103
+ text: string;
104
+ } | null;
105
+ onRun: (actionKey: string) => void;
106
+ }): ReactNode;
107
+ export { hasOwn };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Browser caller for the plugin's Connection RPC channel.
3
+ *
4
+ * The official `@deepseek-ai/dsh-client-connection/client` package ships the
5
+ * protocol primitives as types (`RpcFetch`, `ClientConnectionRpc`, `RpcResult`)
6
+ * and the `RpcId` brand, but its published `createWebConnectionRpc` factory is
7
+ * internal to the bundle — not re-exported. This module re-implements that
8
+ * factory against the same public wire contract (docs/api-gateway.md, the
9
+ * client `rpc.ts` source): a `POST {origin}/{channel}/{endpoint}` with a
10
+ * `client-request` JSON envelope, answered by a `server-response` envelope
11
+ * echoing the rpcId. Host-side registration uses the official
12
+ * `ctx.connection.rpc.handle` — this file only mirrors the caller half.
13
+ * @module @xiaoso/dsh-tool-plus/client/web-connection-rpc
14
+ */
15
+ import type { ClientConnectionRpc, RpcFetch } from '@deepseek-ai/dsh-client-connection/client';
16
+ /**
17
+ * Create the browser-backed generic RPC caller for the plugin's channel
18
+ * (the `/tool-plus` host registration). Wire-compatible with the official
19
+ * ClientConnectionRpc contract; only the transport override differs.
20
+ * @param doFetch - transport override; defaults to the page's global fetch.
21
+ */
22
+ export declare function createWebConnectionRpc(doFetch?: RpcFetch): ClientConnectionRpc;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Tool-plus configuration single source of truth: every settable field across
3
+ * all ported tools (bash + read + write/edit guard), its kind, default value,
4
+ * UI copy keys, and its group/tool membership — plus the tool-tab map the
5
+ * settings page renders.
6
+ *
7
+ * This module is intentionally dependency-free (no host services): both the
8
+ * Host schema (`src/config/settings.ts`) and the browser settings UI
9
+ * (`src/client/*`) read from it, so a default or a field can never drift
10
+ * between the two planes. The only import is the locale key type, which is
11
+ * type-only and erased at build time.
12
+ * @module @xiaoso/dsh-tool-plus/config
13
+ */
14
+ import type { BashPlusLocaleKey } from '../client/locales.ts';
15
+ /** A scalar value a settings field can hold (mirrors the schema types). */
16
+ export type ToolPlusFieldValue = number | boolean | string;
17
+ /** Field control kinds the settings UI renders. */
18
+ export type ToolPlusFieldKind = 'number' | 'boolean' | 'select' | 'action';
19
+ /** One selectable option of a `select` field. */
20
+ export interface ToolPlusSelectOption {
21
+ value: string;
22
+ labelKey: BashPlusLocaleKey;
23
+ }
24
+ /** Conditional visibility: show this field only while a condition field matches. */
25
+ export interface ToolPlusFieldVisibility {
26
+ /** Show only while this boolean field is true (a master switch). */
27
+ requiresEnabled?: string;
28
+ /** Show only while this select field equals the value. */
29
+ requiresSelect?: {
30
+ field: string;
31
+ value: string;
32
+ };
33
+ /** Hide while this select field equals the value (e.g. hide head bytes in tail mode). */
34
+ hideWhenSelect?: {
35
+ field: string;
36
+ value: string;
37
+ };
38
+ }
39
+ /** One configurable field of the plugin's tools. */
40
+ export interface ToolPlusField {
41
+ /** Settings namespace key (flat schema key). */
42
+ name: string;
43
+ /** Control kind the UI renders. */
44
+ kind: ToolPlusFieldKind;
45
+ /** Schema default; a cleared user field reverts to this value. */
46
+ default: ToolPlusFieldValue;
47
+ /** Locale keys for the control label and hint. */
48
+ labelKey: BashPlusLocaleKey;
49
+ hintKey: BashPlusLocaleKey;
50
+ /** Group id (a Bash subgroup or the whole-tool group); order = render order. */
51
+ group: string;
52
+ /** Owning tool tab. */
53
+ tool: ToolPlusToolId;
54
+ /** Options for `select` fields. */
55
+ options?: readonly ToolPlusSelectOption[];
56
+ /** Conditional visibility (master switches, strategy-dependent fields). */
57
+ visibility?: ToolPlusFieldVisibility;
58
+ /** Host RPC endpoint for `action` fields (channel-relative, e.g. `browser/detect`). */
59
+ actionKey?: string;
60
+ }
61
+ /** Tool tabs of the settings page; `fields: []` = no global settings. */
62
+ export interface ToolPlusTab {
63
+ id: ToolPlusToolId;
64
+ labelKey: BashPlusLocaleKey;
65
+ /** Field names owned by this tool, in render order. */
66
+ fields: readonly string[];
67
+ }
68
+ /** Identifiers of every tool tab. */
69
+ export type ToolPlusToolId = 'bash' | 'read' | 'writeEdit' | 'grep' | 'glob' | 'astGrep' | 'astEdit';
70
+ /** Field group ids -> locale key of the group heading. */
71
+ export declare const TOOL_PLUS_GROUP_LABELS: Record<string, BashPlusLocaleKey>;
72
+ /**
73
+ * Every field of the plugin, in schema order. Defaults mirror
74
+ * `src/config/settings.ts` schema + `resolveConfig` — this table is the
75
+ * single source; settings.ts reads from here.
76
+ */
77
+ export declare const TOOL_PLUS_FIELDS: readonly ToolPlusField[];
78
+ /** Tool tabs in nav order; empty `fields` = no configurable settings. */
79
+ export declare const TOOL_PLUS_TABS: readonly ToolPlusTab[];
80
+ /** Look up one field definition by its schema key. */
81
+ export declare function toolPlusField(name: string): ToolPlusField | undefined;
82
+ /** Fields of one tool tab, in table order. */
83
+ export declare function toolPlusFieldsOf(tool: ToolPlusToolId): readonly ToolPlusField[];
84
+ /** Every schema key, for settings-schema parity tests. */
85
+ export declare const TOOL_PLUS_FIELD_NAMES: readonly string[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * tool-plus 统一 OMP 配置注册表(单一事实源)。
3
+ *
4
+ * 所有移植工具(read/write/edit/grep/glob/ast_edit/ast_grep)的 OMP settings
5
+ * 键集中定义在这里:
6
+ * - `OMP_DEFAULTS`:每个键的默认值,verbatim 取自 OMP `config/settings-schema.ts`
7
+ * (refs/oh-my-pi/packages/coding-agent/src/config/settings-schema.ts,5880 行注册表),
8
+ * 引擎行为与上游一致。
9
+ * - `OMP_KEY_TO_FIELD`:OMP dotted key → DSH tool-plus 扁平配置字段(fields.ts)
10
+ * 的映射;未映射的键走默认值(如 LSP/web-search/autoqa 等 DSH 不暴露的
11
+ * 能力,默认值兜底即可,不会降级)。
12
+ *
13
+ * 各工具 adapter 的 `config/settings.ts` / `config/settings-schema.ts` 引用
14
+ * 本模块,消除多份重复定义。新增配置键只改这里 + fields.ts。
15
+ */
16
+ /** OMP dotted key -> flat tool-plus config field (when present). */
17
+ export declare const OMP_KEY_TO_FIELD: Record<string, string | undefined>;
18
+ /**
19
+ * OMP schema 默认值(verbatim,来源见上)。键 = OMP settings-schema.ts 的注册键。
20
+ */
21
+ export declare const OMP_DEFAULTS: Record<string, unknown>;