dsh-vscode-mode 0.11.0 → 0.13.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.
Files changed (76) hide show
  1. package/README.md +158 -111
  2. package/assets/shell/dsh-open.cs +65 -149
  3. package/assets/shell/dsh-open.mjs +241 -0
  4. package/assets/shell/dsh-open.ps1 +28 -47
  5. package/assets/shell/dsh-open.sh +25 -66
  6. package/lib/client.js +13362 -11806
  7. package/lib/client.js.map +1 -1
  8. package/lib/index.js +4110 -2507
  9. package/lib/index.js.map +1 -1
  10. package/package.json +9 -8
  11. package/skills/dsh-vscodemode-mcp/SKILL.md +94 -132
  12. package/src/childEnv.ts +19 -0
  13. package/src/client/activePathStore.ts +28 -0
  14. package/src/client/addToConversation.ts +4 -2
  15. package/src/client/ai/inlineProvider.ts +1 -8
  16. package/src/client/commandBridge.ts +14 -42
  17. package/src/client/externalOpen.ts +40 -19
  18. package/src/client/index.ts +101 -18
  19. package/src/client/keybindings.ts +36 -73
  20. package/src/client/monaco/loader.ts +3 -1
  21. package/src/client/openFlow.ts +36 -28
  22. package/src/client/openReceipt.ts +64 -0
  23. package/src/client/panelCommands.ts +101 -0
  24. package/src/client/pdf/pdfLoader.ts +4 -2
  25. package/src/client/receiptState.ts +120 -0
  26. package/src/client/rpc.ts +30 -4
  27. package/src/client/shortcutRecorder.ts +161 -0
  28. package/src/client/shortcutsOfficial.ts +460 -0
  29. package/src/client/sidebar/panels/RulesPanel.ts +15 -11
  30. package/src/client/sidebarBridge.ts +7 -0
  31. package/src/client/ui/DiffBadge.ts +2 -1
  32. package/src/client/ui/EditorView.ts +246 -137
  33. package/src/client/ui/McpSettings.ts +10 -8
  34. package/src/client/ui/OfficialSideTab.ts +5 -2
  35. package/src/client/ui/QuickOpen.ts +16 -16
  36. package/src/client/ui/ShortcutSettings.ts +274 -0
  37. package/src/client/ui/commandCatalog.ts +39 -43
  38. package/src/client/useOpenReceipt.ts +128 -0
  39. package/src/compat.ts +5 -3
  40. package/src/dap/manager.ts +46 -13
  41. package/src/devForm.ts +252 -92
  42. package/src/externalHandoff.ts +93 -52
  43. package/src/fileOpenSettings.ts +4 -24
  44. package/src/hostImport.ts +19 -0
  45. package/src/httpGuard.ts +101 -0
  46. package/src/index.ts +106 -97
  47. package/src/integrate.ts +56 -50
  48. package/src/lsp/transport.ts +84 -127
  49. package/src/mcp.ts +58 -9
  50. package/src/mcpIsolation.ts +211 -102
  51. package/src/mcpProject.ts +220 -133
  52. package/src/mcpRuntime.ts +343 -0
  53. package/src/openBridge.ts +69 -0
  54. package/src/openInbox.ts +207 -0
  55. package/src/paths.ts +8 -5
  56. package/src/processTree.ts +63 -0
  57. package/src/reveal.ts +5 -3
  58. package/src/routes.ts +156 -154
  59. package/src/rpc.ts +14 -13
  60. package/src/rules.ts +100 -44
  61. package/src/shared/appUrl.ts +19 -0
  62. package/src/shared/externalOpen.ts +71 -0
  63. package/src/shared/integration.ts +2 -0
  64. package/src/shared/keybindings.ts +256 -0
  65. package/src/shared/mcp.ts +4 -1
  66. package/src/shared/rpc.ts +7 -4
  67. package/src/shared/rules.ts +9 -1
  68. package/src/shared/svn.ts +6 -8
  69. package/src/svnPlanTool.ts +51 -0
  70. package/src/unityBridge.ts +26 -3
  71. package/unity/com.dsh.editor/Editor/DshCodeEditor.cs +99 -203
  72. package/unity/com.dsh.editor/Editor/DshOpenWorker.cs +166 -0
  73. package/unity/com.dsh.editor/Editor/DshOpenWorker.cs.meta +2 -0
  74. package/unity/com.dsh.editor/README.md +16 -25
  75. package/unity/com.dsh.editor/package.json +2 -2
  76. package/src/client/ui/KeybindingsPanel.ts +0 -190
@@ -1,70 +1,29 @@
1
1
  #!/usr/bin/env bash
2
- # dsh-open.sh — DSH 文件编辑 shell launcher(Linux/macOS 通用,bash 3.2+)。
3
- # 由 dsh-vscode-mode 设置页注册写入:Nautilus 脚本 / Dolphin 服务菜单 / macOS 快速操作引用本脚本。
4
- # 行为:读同目录 dsh-open.ini 的 base 地址 → curl 探测(可用时,1s 超时)→ 深链打开默认浏览器。
5
- # 深链契约见插件 src/shared/externalOpen.ts(edrvOpen/edrvPaths/edrvLine/edrvColumn)。
6
- # 作者 ddj 2026-09-07
7
- set -u
8
- export LC_ALL=C
9
-
2
+ # POSIX launcher; use the interpreter recorded by the selected DSH host.
3
+ # @author ddj 2026-09-28
4
+ set -eu
5
+ [ "$#" -gt 0 ] || exit 0
10
6
  case "$0" in */*) ini_dir="${0%/*}" ;; *) ini_dir="." ;; esac
11
- base="http://127.0.0.1:3080"
7
+ ini_dir=$(cd "$ini_dir" && pwd -P)
12
8
  ini="$ini_dir/dsh-open.ini"
13
- if [ -f "$ini" ]; then
14
- parsed=$(sed -n 's/^[[:space:]]*[Bb]ase[[:space:]]*=[[:space:]]*//p' "$ini" | head -n 1)
15
- [ -n "$parsed" ] && base="$parsed"
16
- fi
17
-
18
- # 逐字节 percent-encode:LC_ALL=C 下 ${s:i:1} 按字节迭代,多字节字符(中文等)安全;
19
- # unreserved 保留,其余全部 %XX(编码结果不含裸逗号/空白,逗号分隔契约安全)。
20
- urlencode() {
21
- local s="$1" out="" i c hex
22
- for ((i = 0; i < ${#s}; i++)); do
23
- c="${s:i:1}"
24
- case "$c" in
25
- [A-Za-z0-9.~_-]) out+="$c" ;;
26
- *) printf -v hex '%%%02X' "'$c" ; out+="$hex" ;;
27
- esac
28
- done
29
- printf '%s' "$out"
30
- }
31
-
32
- alert() {
33
- local msg="$1"
34
- if [ "$(uname)" = "Darwin" ]; then
35
- osascript -e "display dialog \"$msg\" with title \"DSH 文件编辑\"" >/dev/null 2>&1 || true
36
- elif command -v notify-send >/dev/null 2>&1; then
37
- notify-send "DSH 文件编辑" "$msg" || true
38
- elif command -v zenity >/dev/null 2>&1; then
39
- zenity --info --title "DSH 文件编辑" --text "$msg" >/dev/null 2>&1 || true
40
- fi
41
- }
42
-
43
- # 无参数(如 Nautilus 空选)静默退出
44
- [ $# -gt 0 ] || exit 0
45
-
46
- # DSH 未运行提示(curl 缺失时跳过探测直接打开)
47
- if command -v curl >/dev/null 2>&1; then
48
- if ! curl -s -o /dev/null --max-time 1 "$base"; then
49
- alert "DSH Web UI 未运行($base)。请先启动 DSH。"
50
- exit 1
51
- fi
52
- fi
53
-
54
- # 全部路径编码后合并为一个深链(多选一次打开)
55
- query=""
56
- for p in "$@"; do
57
- [ -n "$p" ] || continue
58
- abs=$(cd "$(dirname "$p")" 2>/dev/null && pwd)/$(basename "$p")
59
- [ -e "$abs" ] || abs="$p"
60
- seg=$(urlencode "$abs")
61
- [ -n "$seg" ] || continue
62
- if [ -z "$query" ]; then query="$seg"; else query="$query,$seg"; fi
63
- done
64
- [ -n "$query" ] || exit 0
65
-
66
- url="${base%/}/?edrvOpen=1&edrvPaths=$query"
67
- case "$(uname)" in
68
- Darwin) exec open "$url" ;;
69
- *) exec xdg-open "$url" ;;
9
+ node=""
10
+ node_mode=""
11
+ helper=""
12
+ # Read values as data; never source/eval an INI file.
13
+ while IFS='=' read -r key value || [ -n "$key" ]; do
14
+ value=${value%$'\r'}
15
+ case "$key" in
16
+ node) node="$value" ;;
17
+ nodeMode) node_mode="$value" ;;
18
+ helper) helper="$value" ;;
19
+ esac
20
+ done < "$ini"
21
+ case "$node" in /*) ;; *) printf '%s\n' 'DSH: missing absolute node executable.' >&2; exit 1 ;; esac
22
+ case "$helper" in /*) ;; *) printf '%s\n' 'DSH: missing absolute producer helper.' >&2; exit 1 ;; esac
23
+ [ -x "$node" ] && [ -f "$helper" ] || { printf '%s\n' 'DSH: configured producer is unavailable.' >&2; exit 1; }
24
+ case "$node_mode" in
25
+ electron) export ELECTRON_RUN_AS_NODE=1 ;;
26
+ node) unset ELECTRON_RUN_AS_NODE ;;
27
+ *) printf '%s\n' 'DSH: missing nodeMode.' >&2; exit 1 ;;
70
28
  esac
29
+ exec "$node" "$helper" --config "$ini" -- "$@"