dsh-gitbash-shell 0.36.0 → 0.37.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/CHANGELOG.md +13 -0
- package/dsh.plugin.json +1 -1
- package/package.json +1 -1
- package/src/client.js +42 -42
- package/src/fastctx-bridge.js +1 -1
- package/src/index.js +10 -5
- package/src/inline-tools.js +80 -55
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
> 倒序排列,新版本条目在最上面。条目格式:`## vX.Y.Z — YYYY-MM-DD` + 类型(feat / fix / docs / chore)+ 要点 + 相关链接。
|
|
4
4
|
> 纪律见 AGENTS.md「变更记录纪律」:发版前先更新本文件并随版本提交;事故复盘、复现与真机验证记录也记在这里。
|
|
5
5
|
|
|
6
|
+
## v0.37.0 — 2026-10-13
|
|
7
|
+
|
|
8
|
+
**类型**:feat(用户拍板的命名与开关重构;真机反馈驱动)。
|
|
9
|
+
|
|
10
|
+
- **`gitbash_pwsh` 更名 `pwsh7`(破坏性:工具名变更)**:旧名读起来像「bash/pwsh 二选一的混合工具」,让人误解(用户真机反馈)。新名 `pwsh7` 语义直白(PowerShell 7),且**绝不占用宿主被污染的 `pwsh` 名**(那个名字的全局工具在本机执行 Git Bash,是假 pwsh,恒定拒绝)。真机已装旧版的会话在新版下自然看到 `pwsh7`。
|
|
11
|
+
- **`pwshTool` 开关默认翻转为 `false`(破坏性:默认值变更)**:默认**不提供**专门的 PowerShell 工具——平时全部走 bash 工具,需要 Windows 原生操作的用户在设置卡自己打开。开关只在 gitbash-shell 一侧行上(ptc 创造模式零参与,装了本插件即自动适配,2026-10-13 拍板)。
|
|
12
|
+
- **pwsh7 的提供方式改为 per-agent scope 注册**(原为全局注册):agent 独立 scope 内注册、随 agent 销毁回收;与 dsh-ops 共存时照旧让位(它的宿主 pwsh 故事优先)。
|
|
13
|
+
- **路由提示词按开关分支**:`pwsh7` 关(默认)时 bash 工具的描述**不再提及任何 PowerShell 工具**(给模型指一条到不了的路只会教它调用被拒的名字);开时才出现「pwsh7 仅用于 Windows 原生能力」的路由句。新增 `GITBASH_ROUTE_ADDENDUM_NO_PWSH` 常量,assemble 处按 `pwshTool()` 现场选择。
|
|
14
|
+
- **调用层守卫保持恒定 deny `pwsh`**:`pwsh7` 是纯加法名字,不会误杀;deny 理由句更新为指路 `pwsh7` 与设置卡开关。
|
|
15
|
+
- **词典**:pwsh.label/pwsh.hint × 21 语言重写(名字 pwsh7、默认关、**必须已安装 PowerShell 7** 的提醒与下载地址);工具 description 与错误消息同步更名。
|
|
16
|
+
- **冒烟**:117 项全绿;路由句测试加「OFF 变体不得出现 pwsh7 字样」与「 misleading 名绝迹」断言。
|
|
17
|
+
- **待真机复验**:bash 工具补位仍未在标准模式出现(v0.35.3 观察)——`activateOfficialBash` 链路失败必有日志行("not resolvable"/"import failed"/"activation failed"),等宿主日志定位;与本版无耦合。
|
|
18
|
+
|
|
6
19
|
## v0.36.0 — 2026-10-13
|
|
7
20
|
|
|
8
21
|
**类型**:feat(设置卡分组重排;用户反馈「一排按钮不知道分类」)。
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-gitbash-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "Windows 全模式 Git Bash:用 Git for Windows bash 替换 PowerShell 执行器;官方四个模式经行内工具补位直接获得 Git Bash(v0.35.0,默认),四个 *·Git Bash 变体 preset 可开关;附带 gitbash_pwsh(系统 PowerShell 7)与 gb_* FastCtx 文件工具,检测到 dsh-ops 自动让位。联动:dsh-ptc-cordis-preset(PTC 创造模式带 Git Bash 行且可去重)+ dsh-better-sidebar(终端标签自动切 Git Bash)。",
|
|
6
6
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-gitbash-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Windows 上让 agent 的每条 shell 命令改经 Git for Windows bash 执行;物化四个内置预设的 Git Bash 变体,统一 MSYS 盘根路径方言,侧栏终端接管可开关。· Run every agent shell command through Git for Windows bash on Windows; materialize Git Bash variants of the built-in presets, unify the MSYS drive-root path dialect, and adopt the sidebar terminal behind a switch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
package/src/client.js
CHANGED
|
@@ -137,8 +137,8 @@ window.__ModuleLoader__.load({
|
|
|
137
137
|
"tools.updating": "更新中…",
|
|
138
138
|
"variant.label": "四个「·Git Bash」变体模式",
|
|
139
139
|
"variant.hint": "默认关闭:官方四个模式经行内工具补位直接获得 Git Bash,模式列表保持官方原样。开启后注册四个变体(standard/minimal/ptc/cordis · Git Bash)并停用官方模式的工具补位——两者互斥。钉在变体 id 上的旧会话在关闭升级后需重新选择模式;变更对新会话生效。",
|
|
140
|
-
"pwsh.label": "PowerShell 7 工具(
|
|
141
|
-
"pwsh.hint": "
|
|
140
|
+
"pwsh.label": "PowerShell 7 工具(pwsh7)",
|
|
141
|
+
"pwsh.hint": "默认关闭:开启后本插件在会话里提供真正的 pwsh7 工具,用系统安装的 PowerShell 7 执行 Windows 原生操作(注册表/服务/WMI),仅完全权限会话可用。前提:机器上已安装 PowerShell 7(https://aka.ms/powershell),没装则工具不会出现。宿主自带的 pwsh 工具在本机实际执行 Git Bash(名字是假的),无论开关一律拒绝——命令一律走 bash 工具。",
|
|
142
142
|
"fctx.label": "FastCtx 文件工具(gb_*)",
|
|
143
143
|
"fctx.hint": "默认开启:发布 gb_inspect_local_file / gb_grep / gb_glob / gb_replace(Rust 实现:批量读取带 token 预算、编码探测)。它们是官方 read/grep/glob/edit 的补充——官方工具接文件沙箱,仍是默认推荐;检测到 dsh-ops(ops_* 工具)时本组自动让位。",
|
|
144
144
|
};
|
|
@@ -214,8 +214,8 @@ window.__ModuleLoader__.load({
|
|
|
214
214
|
"tools.updating": "Updating…",
|
|
215
215
|
"variant.label": "The four \"· Git Bash\" variant presets",
|
|
216
216
|
"variant.hint": "Off by default: the four OFFICIAL presets get Git Bash through the inline tool patch and the roster stays official. On: register the four variants (standard/minimal/ptc/cordis · Git Bash) and stop patching the official presets — the two are exclusive. A session pinned to a variant id must re-select a preset after upgrading with the switch off. Applies to new sessions.",
|
|
217
|
-
"pwsh.label": "PowerShell 7 tool (
|
|
218
|
-
"pwsh.hint": "
|
|
217
|
+
"pwsh.label": "PowerShell 7 tool (pwsh7)",
|
|
218
|
+
"pwsh.hint": "Off by default: when on, this plugin provides a REAL pwsh7 tool over the system-installed PowerShell 7 for Windows-native work (registry/services/WMI), danger-full-access sessions only. Requires PowerShell 7 installed (https://aka.ms/powershell) — without it the tool never appears. The host's own pwsh tool actually runs Git Bash on this machine (a lying name) and is denied regardless of this switch — route commands through the bash tool.",
|
|
219
219
|
"fctx.label": "FastCtx file tools (gb_*)",
|
|
220
220
|
"fctx.hint": "On by default: publishes gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: batched reads with a token budget, encoding detection). ADDITIONS to the official read/grep/glob/edit — the official tools keep the file sandbox and stay the default. Stands down automatically when dsh-ops is installed.",
|
|
221
221
|
};
|
|
@@ -301,8 +301,8 @@ window.__ModuleLoader__.load({
|
|
|
301
301
|
"tools.updating": "جارٍ الترقية…",
|
|
302
302
|
"variant.label": "الأنماط الأربعة «· Git Bash»",
|
|
303
303
|
"variant.hint": "معطَّل افتراضيًا: تحصل الأنماط الرسمية الأربعة على Git Bash عبر ترقيع الأدوات داخل العملية وتبقى القائمة رسمية. عند التفعيل تُسجَّل الأنماط الأربعة المتغيّرة وتتوقف ترقيع الأنماط الرسمية — الاثنان حصريان متباددان. الجلسة المثبَّتة على معرّف متغيّر تحتاج إعادة اختيار بعد الترقية مع بقاء المفتاح معطَّلًا.",
|
|
304
|
-
"pwsh.label": "أداة PowerShell 7 (
|
|
305
|
-
"pwsh.hint": "
|
|
304
|
+
"pwsh.label": "أداة PowerShell 7 (pwsh7)",
|
|
305
|
+
"pwsh.hint": "مُعطَّلة افتراضيًا: عند التفعيل توفر هذه الإضافة أداة pwsh7 حقيقية عبر PowerShell 7 المثبَّت على النظام لأعمال Windows الأصلية (السجل/الخدمات/WMI)، وللجلسات كاملة الصلاحيات فقط. تتطلب تثبيت PowerShell 7 (https://aka.ms/powershell) — بدونها لن تظهر الأداة. أداة pwsh الرسمية تشغّل Git Bash فعليًا على هذا الجهاز (اسم كاذب) وتُرفض بغض النظر عن هذا المفتاح — مرّر الأوامر عبر أداة bash.",
|
|
306
306
|
"fctx.label": "أدوات ملفات FastCtx (gb_*)",
|
|
307
307
|
"fctx.hint": "مُفعَّلة افتراضيًا: تنشر gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: قراءات دفعية بميزانية رموز وكشف ترميز). إضافة إلى read/grep/glob/edit الرسمية التي تحتفظ بصندوق الرمل وتبقى الافتراض؛ تتوقف تلقائيًا عند تثبيت dsh-ops.",
|
|
308
308
|
},
|
|
@@ -378,8 +378,8 @@ window.__ModuleLoader__.load({
|
|
|
378
378
|
"tools.updating": "Wird aktualisiert…",
|
|
379
379
|
"variant.label": "Die vier „· Git Bash“-Varianten",
|
|
380
380
|
"variant.hint": "Standardmäßig aus: Die vier OFFIZIELLEN Presets bekommen Git Bash durch den Inline-Tool-Patch, die Liste bleibt offiziell. Ein: Registriert die vier Varianten und stoppt das Patchen der offiziellen Presets — beides schließt sich aus. Eine am Varianten-Id festhängende Sitzung muss nach dem Upgrade neu wählen. Gilt für neue Sitzungen.",
|
|
381
|
-
"pwsh.label": "PowerShell-7-Werkzeug (
|
|
382
|
-
"pwsh.hint": "Standardmäßig
|
|
381
|
+
"pwsh.label": "PowerShell-7-Werkzeug (pwsh7)",
|
|
382
|
+
"pwsh.hint": "Standardmäßig aus: Beim Einschalten stellt dieses Plugin ein ECHTES pwsh7-Werkzeug über das installierte PowerShell 7 bereit (Windows-natives Arbeiten: Registry/Dienste/WMI), nur mit voller Berechtigung. Erfordert installiertes PowerShell 7 (https://aka.ms/powershell) — ohne es erscheint das Werkzeug nie. Das pwsh-Werkzeug des Hosts läuft hier tatsächlich als Git Bash (täuschender Name) und wird unabhängig von diesem Schalter abgelehnt — Befehle laufen über das bash-Werkzeug.",
|
|
383
383
|
"fctx.label": "FastCtx-Dateiwerkzeuge (gb_*)",
|
|
384
384
|
"fctx.hint": "Standardmäßig ein: Veröffentlicht gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: stapelweise Lesevorgänge mit Token-Budget, Kodierungserkennung). ERGÄNZUNGEN zu read/grep/glob/edit — die offiziellen Werkzeuge behalten die Datei-Sandbox und bleiben Standard. Weicht automatisch zurück, wenn dsh-ops installiert ist.",
|
|
385
385
|
},
|
|
@@ -455,8 +455,8 @@ window.__ModuleLoader__.load({
|
|
|
455
455
|
"tools.updating": "Mise à jour…",
|
|
456
456
|
"variant.label": "Les quatre variantes « · Git Bash »",
|
|
457
457
|
"variant.hint": "Désactivé par défaut : les quatre presets OFFICIELS obtiennent Git Bash via le correctif d’outils en ligne et la liste reste officielle. Activé : enregistre les quatre variantes et cesse de corriger les presets officiels — les deux s’excluent. Une session attachée à un id de variante doit être rechoisie après mise à niveau. S’applique aux nouvelles sessions.",
|
|
458
|
-
"pwsh.label": "Outil PowerShell 7 (
|
|
459
|
-
"pwsh.hint": "
|
|
458
|
+
"pwsh.label": "Outil PowerShell 7 (pwsh7)",
|
|
459
|
+
"pwsh.hint": "Désactivé par défaut : activé, ce plugin fournit un VRAI outil pwsh7 via le PowerShell 7 installé sur le système pour le travail Windows natif (registre/services/WMI), sessions en accès complet uniquement. Nécessite PowerShell 7 installé (https://aka.ms/powershell) — sans lui l'outil n'apparaît jamais. L'outil pwsh de l'hôte exécute en réalité Git Bash sur cette machine (nom trompeur) et est refusé quel que soit ce commutateur — passez par l'outil bash.",
|
|
460
460
|
"fctx.label": "Outils de fichiers FastCtx (gb_*)",
|
|
461
461
|
"fctx.hint": "Activé par défaut : publie gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust : lectures par lots avec budget de tokens, détection d’encodage). COMPLÉMENTS aux outils officiels read/grep/glob/edit — ceux-ci conservent le bac à sable fichiers et restent la valeur par défaut. Se retire automatiquement si dsh-ops est installé.",
|
|
462
462
|
},
|
|
@@ -532,8 +532,8 @@ window.__ModuleLoader__.load({
|
|
|
532
532
|
"tools.updating": "अपडेट हो रहा है…",
|
|
533
533
|
"variant.label": "चार «· Git Bash» वेरिएंट प्रीसेट",
|
|
534
534
|
"variant.hint": "डिफ़ॉल्ट रूप से बंद: चार आधिकारिक प्रीसेट को इनलाइन टूल पैच से Git Bash मिलता है और सूची आधिकारिक रहती है। चालू: चार वेरिएंट पंजीकृत होते हैं और आधिकारिक प्रीसेट पैचिंग रुक जाती है — दोनों परस्पर अनन्य हैं। वेरिएंट id पर बंधे सत्र को अपग्रेड के बाद दोबारा चुनना पड़ेगा। नए सत्रों पर लागू।",
|
|
535
|
-
"pwsh.label": "PowerShell 7
|
|
536
|
-
"pwsh.hint": "डिफ़ॉल्ट रूप से
|
|
535
|
+
"pwsh.label": "PowerShell 7 टूल (pwsh7)",
|
|
536
|
+
"pwsh.hint": "डिफ़ॉल्ट रूप से बंद: चालू करने पर यह प्लगइन सिस्टम-इंस्टॉल्ड PowerShell 7 पर एक असली pwsh7 टूल देता है (Windows-नेटिव काम: रजिस्ट्री/सेवाएँ/WMI), केवल पूर्ण-अनुमति सत्रों के लिए। PowerShell 7 इंस्टॉल होना ज़रूरी है (https://aka.ms/powershell) — बिना इसके टूल कभी नहीं दिखेगा। होस्ट का pwsh टूल इस मशीन पर असल में Git Bash चलाता है (झूठा नाम) और इस स्विच से इतर हमेशा अस्वीकृत रहता है — कमांड bash टूल से चलाएँ।",
|
|
537
537
|
"fctx.label": "FastCtx फ़ाइल उपकरण (gb_*)",
|
|
538
538
|
"fctx.hint": "डिफ़ॉल्ट रूप से चालू: gb_inspect_local_file / gb_grep / gb_glob / gb_replace प्रकाशित करता है (Rust: टोकन बजट के साथ बैच रीड, एनकोडिंग पहचान)। आधिकारिक read/grep/glob/edit के अतिरिक्त — आधिकारिक उपकरण फ़ाइल सैंडबॉक्स रखते हैं और डिफ़ॉल्ट बने रहते हैं। dsh-ops इंस्टॉल होने पर स्वतः पीछे हट जाता है।",
|
|
539
539
|
},
|
|
@@ -609,8 +609,8 @@ window.__ModuleLoader__.load({
|
|
|
609
609
|
"tools.updating": "Memperbarui…",
|
|
610
610
|
"variant.label": "Empat preset varian «· Git Bash»",
|
|
611
611
|
"variant.hint": "Nonaktif secara bawaan: empat preset RESMI mendapat Git Bash melalui patch alat inline dan daftar tetap resmi. Aktif: mendaftarkan empat varian dan berhenti mem-patch preset resmi — keduanya saling eksklusif. Sesi yang terikat pada id varian harus memilih ulang setelah peningkatan. Berlaku untuk sesi baru.",
|
|
612
|
-
"pwsh.label": "Alat PowerShell 7 (
|
|
613
|
-
"pwsh.hint": "
|
|
612
|
+
"pwsh.label": "Alat PowerShell 7 (pwsh7)",
|
|
613
|
+
"pwsh.hint": "Nonaktif secara default: saat aktif, plugin ini menyediakan alat pwsh7 ASLI melalui PowerShell 7 yang terinstal di sistem untuk kerja native Windows (registry/layanan/WMI), hanya untuk sesi akses penuh. Butuh PowerShell 7 terinstal (https://aka.ms/powershell) — tanpanya alat tak akan muncul. Alat pwsh bawaan host sebenarnya menjalankan Git Bash di mesin ini (nama palsu) dan ditolak apa pun status sakelar ini — jalankan perintah lewat alat bash.",
|
|
614
614
|
"fctx.label": "Alat berkas FastCtx (gb_*)",
|
|
615
615
|
"fctx.hint": "Aktif secara bawaan: menerbitkan gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: pembacaan batch dengan anggaran token, deteksi enkode). TAMBAHAN untuk read/grep/glob/edit resmi — alat resmi tetap memiliki sandbox berkas dan menjadi bawaan. Mundur otomatis saat dsh-ops terinstal.",
|
|
616
616
|
},
|
|
@@ -686,8 +686,8 @@ window.__ModuleLoader__.load({
|
|
|
686
686
|
"tools.updating": "Aggiornamento…",
|
|
687
687
|
"variant.label": "Le quattro varianti «· Git Bash»",
|
|
688
688
|
"variant.hint": "Disattivo per impostazione predefinita: i quattro preset UFFICIALI ottengono Git Bash tramite la patch inline degli strumenti e l’elenco resta ufficiale. Attivo: registra le quattro varianti e smette di correggere i preset ufficiali — i due si escludono. Una sessione legata a un id di variante va riscelta dopo l’aggiornamento. Vale per le nuove sessioni.",
|
|
689
|
-
"pwsh.label": "Strumento PowerShell 7 (
|
|
690
|
-
"pwsh.hint": "
|
|
689
|
+
"pwsh.label": "Strumento PowerShell 7 (pwsh7)",
|
|
690
|
+
"pwsh.hint": "Disattivo per impostazione predefinita: quando attivo, questo plugin fornisce un VERO strumento pwsh7 tramite il PowerShell 7 installato sul sistema per lavoro Windows nativo (registro/servizi/WMI), solo sessioni con accesso completo. Richiede PowerShell 7 installato (https://aka.ms/powershell) — senza di esso lo strumento non appare mai. Lo strumento pwsh dell'host esegue in realtà Git Bash su questa macchina (nome ingannevole) e viene rifiutato a prescindere da questo interruttore — instrada i comandi tramite lo strumento bash.",
|
|
691
691
|
"fctx.label": "Strumenti file FastCtx (gb_*)",
|
|
692
692
|
"fctx.hint": "Attivo per impostazione predefinita: pubblica gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: letture in batch con budget di token, rilevamento della codifica). AGGIUNTE ai read/grep/glob/edit ufficiali — quelli ufficiali mantengono la sandbox dei file e restano la scelta predefinita. Si ritira automaticamente con dsh-ops installato.",
|
|
693
693
|
},
|
|
@@ -763,8 +763,8 @@ window.__ModuleLoader__.load({
|
|
|
763
763
|
"tools.updating": "更新中…",
|
|
764
764
|
"variant.label": "4 つの「· Git Bash」バリアント",
|
|
765
765
|
"variant.hint": "既定はオフ:公式 4 プリセットはインラインツールパッチで Git Bash を得られ、一覧は公式のまま。オンにすると 4 バリアントを登録し、公式プリセットへのパッチを停止(両者は排他)。バリアント id に固定されたセッションはアップグレード後に再選択が必要。新規セッションに適用。",
|
|
766
|
-
"pwsh.label": "PowerShell 7 ツール(
|
|
767
|
-
"pwsh.hint": "
|
|
766
|
+
"pwsh.label": "PowerShell 7 ツール(pwsh7)",
|
|
767
|
+
"pwsh.hint": "既定はオフ:オンにすると、システムにインストールされた PowerShell 7 で本物の pwsh7 ツールを提供します(レジストリ/サービス/WMI など Windows ネイティブ作業用)。完全権限セッションのみ。PowerShell 7 のインストールが必要です(https://aka.ms/powershell)— 未インストールではツールは出現しません。ホスト純正の pwsh ツールはこのマシンでは実際には Git Bash を実行する(偽の名前)ため、このスイッチとは無関係に常に拒否されます — コマンドは bash ツールへ。",
|
|
768
768
|
"fctx.label": "FastCtx ファイルツール(gb_*)",
|
|
769
769
|
"fctx.hint": "既定はオン:gb_inspect_local_file / gb_grep / gb_glob / gb_replace を公開(Rust:トークン予算付き一括読み取り、エンコーディング検出)。公式 read/grep/glob/edit への追加であり、公式ツールはファイルサンドボックスを保ち既定の推奨のまま。dsh-ops が入ると自動で退きます。",
|
|
770
770
|
},
|
|
@@ -840,8 +840,8 @@ window.__ModuleLoader__.load({
|
|
|
840
840
|
"tools.updating": "업데이트 중…",
|
|
841
841
|
"variant.label": "네 개의 «· Git Bash» 변형 프리셋",
|
|
842
842
|
"variant.hint": "기본 꺼짐: 공식 4개 프리셋이 인라인 도구 패치로 Git Bash를 얻으며 목록은 공식 그대로입니다. 켜면 4개 변형을 등록하고 공식 프리셋 패칭을 중단합니다(상호 배타). 변형 id 에 고정된 세션은 업그레이드 후 다시 선택해야 합니다. 새 세션에 적용.",
|
|
843
|
-
"pwsh.label": "PowerShell 7 도구(
|
|
844
|
-
"pwsh.hint": "
|
|
843
|
+
"pwsh.label": "PowerShell 7 도구(pwsh7)",
|
|
844
|
+
"pwsh.hint": "기본적으로 꺼짐: 켜면 이 플러그인이 시스템에 설치된 PowerShell 7으로 실제 pwsh7 도구를 제공합니다(레지스트리/서비스/WMI 등 Windows 네이티브 작업), 전체 권한 세션 전용. PowerShell 7 설치가 필요합니다(https://aka.ms/powershell) — 없으면 도구가 나타나지 않습니다. 호스트의 pwsh 도구는 이 머신에서 실제로 Git Bash를 실행하는(거짓 이름) 도구로, 이 스위치와 무관하게 항상 거부됩니다 — 명령은 bash 도구로 실행하세요.",
|
|
845
845
|
"fctx.label": "FastCtx 파일 도구(gb_*)",
|
|
846
846
|
"fctx.hint": "기본 켜짐: gb_inspect_local_file / gb_grep / gb_glob / gb_replace 를 공개합니다(Rust: 토큰 예산 기반 일괄 읽기, 인코딩 감지). 공식 read/grep/glob/edit 의 추가이며 공식 도구는 파일 샌드박스를 유지하고 기본 권장입니다. dsh-ops 가 설치되면 자동으로 물러납니다.",
|
|
847
847
|
},
|
|
@@ -917,8 +917,8 @@ window.__ModuleLoader__.load({
|
|
|
917
917
|
"tools.updating": "Bijwerken…",
|
|
918
918
|
"variant.label": "De vier «· Git Bash»-varianten",
|
|
919
919
|
"variant.hint": "Standaard uit: de vier OFFICIËLE presets krijgen Git Bash via de inline-toolpatch en de lijst blijft officieel. Aan: registreert de vier varianten en stopt het patchen van de officiële presets — sluit elkaar uit. Een sessie die aan een variant-id vastzit moet na een upgrade opnieuw kiezen. Geldt voor nieuwe sessies.",
|
|
920
|
-
"pwsh.label": "PowerShell 7-hulpmiddel (
|
|
921
|
-
"pwsh.hint": "Standaard
|
|
920
|
+
"pwsh.label": "PowerShell 7-hulpmiddel (pwsh7)",
|
|
921
|
+
"pwsh.hint": "Standaard uit: ingeschakeld biedt deze plugin een ECHT pwsh7-hulpmiddel via de op het systeem geïnstalleerde PowerShell 7 voor Windows-natief werk (register/services/WMI), alleen sessies met volledige rechten. Vereist geïnstalleerde PowerShell 7 (https://aka.ms/powershell) — zonder verschijnt het hulpmiddel nooit. Het pwsh-hulpmiddel van de host draait hier feitelijk Git Bash (een misleidende naam) en wordt ongeacht deze schakelaar geweigerd — voer opdrachten uit via het bash-hulpmiddel.",
|
|
922
922
|
"fctx.label": "FastCtx-bestandshulpmiddelen (gb_*)",
|
|
923
923
|
"fctx.hint": "Standaard aan: publiceert gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: gelezen in batches met tokenbudget, coderingsdetectie). AANVULLINGEN op read/grep/glob/edit — de officiële hulpmiddelen houden de bestandssandbox en blijven de standaard. Trekt zich automatisch terug wanneer dsh-ops is geïnstalleerd.",
|
|
924
924
|
},
|
|
@@ -994,8 +994,8 @@ window.__ModuleLoader__.load({
|
|
|
994
994
|
"tools.updating": "Aktualizowanie…",
|
|
995
995
|
"variant.label": "Cztery warianty «· Git Bash»",
|
|
996
996
|
"variant.hint": "Domyślnie wyłączone: cztery OFICJALNE presety dostają Git Bash przez inline-owy patch narzędzi, a lista pozostaje oficjalna. Włączenie rejestruje cztery warianty i zatrzymuje patchowanie oficjalnych presetów — opcje wykluczają się. Sesja przypięta do id wariantu musi zostać wybrana ponownie po aktualizacji. Dotyczy nowych sesji.",
|
|
997
|
-
"pwsh.label": "Narzędzie PowerShell 7 (
|
|
998
|
-
"pwsh.hint": "Domyślnie
|
|
997
|
+
"pwsh.label": "Narzędzie PowerShell 7 (pwsh7)",
|
|
998
|
+
"pwsh.hint": "Domyślnie wyłączone: po włączeniu ta wtyczka udostępnia PRAWDZIWE narzędzie pwsh7 przez zainstalowany w systemie PowerShell 7 do natywnej pracy w Windows (rejestr/usługi/WMI), tylko sesje z pełnymi uprawnieniami. Wymaga zainstalowanego PowerShell 7 (https://aka.ms/powershell) — bez niego narzędzie nigdy się nie pojawi. Narzędzie pwsh hosta faktycznie uruchamia Git Bash na tej maszynie (myląca nazwa) i jest odrzucane niezależnie od tego przełącznika — polecenia wykonuj przez narzędzie bash.",
|
|
999
999
|
"fctx.label": "Narzędzia plików FastCtx (gb_*)",
|
|
1000
1000
|
"fctx.hint": "Domyślnie włączone: publikuje gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: odczyty wsadowe z budżetem tokenów, wykrywanie kodowania). DODATKI do oficjalnych read/grep/glob/edit — oficjalne narzędzia zachowują sandbox plików i pozostają domyślne. Wycofuje się automatycznie, gdy zainstalowano dsh-ops.",
|
|
1001
1001
|
},
|
|
@@ -1071,8 +1071,8 @@ window.__ModuleLoader__.load({
|
|
|
1071
1071
|
"tools.updating": "A atualizar…",
|
|
1072
1072
|
"variant.label": "As quatro variantes «· Git Bash»",
|
|
1073
1073
|
"variant.hint": "Desativado por padrão: os quatro presets OFICIAIS recebem Git Bash pelo patch de ferramentas em linha e a lista permanece oficial. Ativado: registra as quatro variantes e deixa de corrigir os presets oficiais — mutuamente exclusivos. Uma sessão presa a um id de variante precisa ser reescolhida após a atualização. Vale para novas sessões.",
|
|
1074
|
-
"pwsh.label": "Ferramenta PowerShell 7 (
|
|
1075
|
-
"pwsh.hint": "
|
|
1074
|
+
"pwsh.label": "Ferramenta PowerShell 7 (pwsh7)",
|
|
1075
|
+
"pwsh.hint": "Desativado por padrão: ao ativar, este plugin fornece uma ferramenta pwsh7 REAL via o PowerShell 7 instalado no sistema para trabalho nativo do Windows (registro/serviços/WMI), apenas sessões com acesso total. Requer o PowerShell 7 instalado (https://aka.ms/powershell) — sem ele a ferramenta nunca aparece. A ferramenta pwsh do host na verdade executa o Git Bash nesta máquina (nome enganoso) e é negada independentemente deste interruptor — encaminhe comandos pela ferramenta bash.",
|
|
1076
1076
|
"fctx.label": "Ferramentas de arquivos FastCtx (gb_*)",
|
|
1077
1077
|
"fctx.hint": "Ativado por padrão: publica gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: leituras em lote com orçamento de tokens, detecção de codificação). ADIÇÕES aos read/grep/glob/edit oficiais — os oficiais mantêm o sandbox de arquivos e continuam o padrão. Recua automaticamente quando o dsh-ops está instalado.",
|
|
1078
1078
|
},
|
|
@@ -1148,8 +1148,8 @@ window.__ModuleLoader__.load({
|
|
|
1148
1148
|
"tools.updating": "Обновление…",
|
|
1149
1149
|
"variant.label": "Четыре варианта «· Git Bash»",
|
|
1150
1150
|
"variant.hint": "По умолчанию выключено: четыре ОФИЦИАЛЬНЫХ пресета получают Git Bash через встроенный патч инструментов, список остаётся официальным. Включено — регистрирует четыре варианта и прекращает патчить официальные пресеты (взаимоисключающе). Сессия, привязанная к id варианта, после обновления должна выбрать пресет заново. Действует для новых сессий.",
|
|
1151
|
-
"pwsh.label": "Инструмент PowerShell 7 (
|
|
1152
|
-
"pwsh.hint": "По умолчанию
|
|
1151
|
+
"pwsh.label": "Инструмент PowerShell 7 (pwsh7)",
|
|
1152
|
+
"pwsh.hint": "По умолчанию выключено: при включении плагин предоставляет НАСТОЯЩИЙ инструмент pwsh7 через установленный в системе PowerShell 7 для нативной работы Windows (реестр/службы/WMI), только сессии с полным доступом. Требуется установленный PowerShell 7 (https://aka.ms/powershell) — без него инструмент не появится. Штатный pwsh-инструмент хоста на этой машине фактически запускает Git Bash (лживое имя) и отклоняется независимо от этого переключателя — команды выполняйте через инструмент bash.",
|
|
1153
1153
|
"fctx.label": "Файловые инструменты FastCtx (gb_*)",
|
|
1154
1154
|
"fctx.hint": "По умолчанию включено: публикует gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: пакетные чтения с бюджетом токенов, определение кодировки). ДОПОЛНЕНИЯ к официальным read/grep/glob/edit — официальные сохраняют файловую песочницу и остаются выбором по умолчанию. Автоматически отступает при установленном dsh-ops.",
|
|
1155
1155
|
},
|
|
@@ -1225,8 +1225,8 @@ window.__ModuleLoader__.load({
|
|
|
1225
1225
|
"tools.updating": "Uppdaterar…",
|
|
1226
1226
|
"variant.label": "De fyra «· Git Bash»-varianterna",
|
|
1227
1227
|
"variant.hint": "Av som standard: de fyra OFFICIELLA presetten får Git Bash via inline-verktygspatchen och listan förblir officiell. På: registrerar de fyra varianterna och slutar patcha de officiella presetten — ömsesidigt uteslutande. En session fastnåld på ett variant-id måste väljas om efter uppgradering. Gäller nya sessioner.",
|
|
1228
|
-
"pwsh.label": "PowerShell 7-verktyg (
|
|
1229
|
-
"pwsh.hint": "
|
|
1228
|
+
"pwsh.label": "PowerShell 7-verktyg (pwsh7)",
|
|
1229
|
+
"pwsh.hint": "Av som standard: när den är på tillhandahåller denna plugin ett ÄKTA pwsh7-verktyg via systemets installerade PowerShell 7 för Windows-inbyggt arbete (register/tjänster/WMI), endast sessioner med full behörighet. Kräver installerad PowerShell 7 (https://aka.ms/powershell) — utan den visas verktyget aldrig. Hostens pwsh-verktyg kör i själva verket Git Bash på denna maskin (ett vilseledande namn) och nekas oavsett denna växel — kör kommandon via bash-verktyget.",
|
|
1230
1230
|
"fctx.label": "FastCtx-filverktyg (gb_*)",
|
|
1231
1231
|
"fctx.hint": "På som standard: publicerar gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: batchläsningar med tokenbudget, kodningsdetektering). TILLÄGG till de officiella read/grep/glob/edit — de officiella behåller filsandlådan och förblir standard. Drar sig automatiskt tillbaka när dsh-ops är installerat.",
|
|
1232
1232
|
},
|
|
@@ -1302,8 +1302,8 @@ window.__ModuleLoader__.load({
|
|
|
1302
1302
|
"tools.updating": "กำลังอัปเกรด…",
|
|
1303
1303
|
"variant.label": "พรีเซ็ตย่อย «· Git Bash» ทั้งสี่",
|
|
1304
1304
|
"variant.hint": "ปิดตามค่าเริ่มต้น: พรีเซ็ตทางการทั้งสี่ได้ Git Bash ผ่านแพตช์เครื่องมือในตัว และรายการยังเป็นทางการ เปิด: ลงทะเบียนสี่ตัวย่อยและหยุดแพตช์พรีเซ็ตทางการ — ทั้งสองไม่ใช้ร่วมกันได้ เซสชันที่ตรึงกับ id ย่อยต้องเลือกใหม่หลังอัปเกรด ใช้กับเซสชันใหม่",
|
|
1305
|
-
"pwsh.label": "เครื่องมือ PowerShell 7 (
|
|
1306
|
-
"pwsh.hint": "
|
|
1305
|
+
"pwsh.label": "เครื่องมือ PowerShell 7 (pwsh7)",
|
|
1306
|
+
"pwsh.hint": "ปิดอยู่โดยค่าเริ่มต้น: เมื่อเปิด ปลั๊กอินนี้จะให้เครื่องมือ pwsh7 จริงผ่าน PowerShell 7 ที่ติดตั้งในระบบสำหรับงาน Windows แบบเนทีฟ (registry/services/WMI) เฉพาะเซสชันสิทธิ์เต็มเท่านั้น ต้องติดตั้ง PowerShell 7 (https://aka.ms/powershell) — หากไม่มี เครื่องมือจะไม่ปรากฏ เครื่องมือ pwsh ของโฮสต์ที่จริงรัน Git Bash บนเครื่องนี้ (ชื่อหลอก) และจะถูกปฏิเสธไม่ว่าสวิตช์นี้ — ส่งคำสั่งผ่านเครื่องมือ bash",
|
|
1307
1307
|
"fctx.label": "เครื่องมือไฟล์ FastCtx (gb_*)",
|
|
1308
1308
|
"fctx.hint": "เปิดตามค่าเริ่มต้น: เผยแพร่ gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: อ่านเป็นชุดพร้อมงบ token, ตรวจจับ encoding) เป็นส่วนเสริมของ read/grep/glob/edit ทางการ — เครื่องมือทางการยังมี sandbox ไฟล์และเป็นค่าเริ่มต้น ถอยอัตโนมัติเมื่อติดตั้ง dsh-ops",
|
|
1309
1309
|
},
|
|
@@ -1379,8 +1379,8 @@ window.__ModuleLoader__.load({
|
|
|
1379
1379
|
"tools.updating": "Güncelleniyor…",
|
|
1380
1380
|
"variant.label": "Dört «· Git Bash» varyantı",
|
|
1381
1381
|
"variant.hint": "Varsayılan olarak kapalı: dört RESMİ preset, satır içi araç yamasıyla Git Bash alır; liste resmi kalır. Açık: dört varyantı kaydeder ve resmi presetleri yamalamayı bırakır — ikisi birbirini dışlar. Bir varyant kimliğine bağlı oturum yükseltmeden sonra yeniden seçilmelidir. Yeni oturumlar için geçerlidir.",
|
|
1382
|
-
"pwsh.label": "PowerShell 7 aracı (
|
|
1383
|
-
"pwsh.hint": "Varsayılan
|
|
1382
|
+
"pwsh.label": "PowerShell 7 aracı (pwsh7)",
|
|
1383
|
+
"pwsh.hint": "Varsayılan olarak kapalı: açıkken bu eklenti, sistemde kurulu PowerShell 7 üzerinden GERÇEK bir pwsh7 aracı sağlar (Windows-yerel işler: kayıt defteri/hizmetler/WMI), yalnızca tam yetkili oturumlar. PowerShell 7 kurulu olmalıdır (https://aka.ms/powershell) — yoksa araç asla görünmez. Ana makinenin pwsh aracı bu makinede aslında Git Bash çalıştırır (yanıltıcı ad) ve bu anahtar ne olursa olsun reddedilir — komutları bash aracıyla çalıştırın.",
|
|
1384
1384
|
"fctx.label": "FastCtx dosya araçları (gb_*)",
|
|
1385
1385
|
"fctx.hint": "Varsayılan açık: gb_inspect_local_file / gb_grep / gb_glob / gb_replace yayımlar (Rust: token bütçeli toplu okumalar, kodlama algılama). Resmî read/grep/glob/edit’e EKLER — resmî araçlar dosya kum havuzunu korur ve varsayılan kalır. dsh-ops kurulu olduğunda otomatik olarak geri çekilir.",
|
|
1386
1386
|
},
|
|
@@ -1456,8 +1456,8 @@ window.__ModuleLoader__.load({
|
|
|
1456
1456
|
"tools.updating": "Đang nâng cấp…",
|
|
1457
1457
|
"variant.label": "Bốn biến thể «· Git Bash»",
|
|
1458
1458
|
"variant.hint": "Mặc định tắt: bốn preset CHÍNH THỨC nhận Git Bash qua bản vá công cụ nội tuyến và danh sách vẫn chính thức. Bật: đăng ký bốn biến thể và ngừng vá các preset chính thức — hai bên loại trừ nhau. Phiên đang ghim vào id biến thể cần chọn lại sau nâng cấp. Áp dụng cho phiên mới.",
|
|
1459
|
-
"pwsh.label": "Công cụ PowerShell 7 (
|
|
1460
|
-
"pwsh.hint": "Mặc định
|
|
1459
|
+
"pwsh.label": "Công cụ PowerShell 7 (pwsh7)",
|
|
1460
|
+
"pwsh.hint": "Mặc định tắt: khi bật, plugin này cung cấp công cụ pwsh7 THỰC qua PowerShell 7 đã cài trong hệ thống cho công việc Windows gốc (registry/services/WMI), chỉ dành cho phiên đầy đủ quyền. Cần PowerShell 7 đã cài (https://aka.ms/powershell) — không có thì công cụ không bao giờ xuất hiện. Công cụ pwsh của host trên máy này thực chất chạy Git Bash (tên gây hiểu lầm) và luôn bị từ chối bất kể công tắc này — chạy lệnh qua công cụ bash.",
|
|
1461
1461
|
"fctx.label": "Công cụ tệp FastCtx (gb_*)",
|
|
1462
1462
|
"fctx.hint": "Mặc định bật: phát hành gb_inspect_local_file / gb_grep / gb_glob / gb_replace (Rust: đọc theo lô có ngân sách token, phát hiện mã hóa). BỔ SUNG cho read/grep/glob/edit chính thức — công cụ chính thức giữ sandbox tệp và vẫn là mặc định. Tự rút khi dsh-ops được cài.",
|
|
1463
1463
|
},
|
|
@@ -1533,8 +1533,8 @@ window.__ModuleLoader__.load({
|
|
|
1533
1533
|
"tools.updating": "升級緊…",
|
|
1534
1534
|
"variant.label": "四個「·Git Bash」變體模式",
|
|
1535
1535
|
"variant.hint": "預設關閉:官方四個模式經行內工具補位直接獲得 Git Bash,模式列表保持官方原樣。開啟後註冊四個變體並停用官方模式的工具補位——兩者互斥。釘在變體 id 的舊會話在關閉升級後需重新選擇模式;變更對新會話生效。",
|
|
1536
|
-
"pwsh.label": "PowerShell 7 工具(
|
|
1537
|
-
"pwsh.hint": "
|
|
1536
|
+
"pwsh.label": "PowerShell 7 工具(pwsh7)",
|
|
1537
|
+
"pwsh.hint": "預設關閉:開啟後本外掛在會話裡提供真正的 pwsh7 工具,用系統安裝的 PowerShell 7 執行 Windows 原生操作(登錄檔/服務/WMI),僅完全權限會話可用。前提:機器上已安裝 PowerShell 7(https://aka.ms/powershell),沒裝則工具不會出現。宿主自帶的 pwsh 工具在本機實際執行 Git Bash(名字是假的),無論開關一律拒絕——命令一律走 bash 工具。",
|
|
1538
1538
|
"fctx.label": "FastCtx 檔案工具(gb_*)",
|
|
1539
1539
|
"fctx.hint": "預設開啟:發布 gb_inspect_local_file / gb_grep / gb_glob / gb_replace(Rust 實現:批量讀取帶 token 預算、編碼探測)。它們是官方 read/grep/glob/edit 的補充——官方工具接檔案沙箱,仍是預設推薦;偵測到 dsh-ops 時本組自動讓位。",
|
|
1540
1540
|
},
|
|
@@ -1610,8 +1610,8 @@ window.__ModuleLoader__.load({
|
|
|
1610
1610
|
"tools.updating": "升級緊…",
|
|
1611
1611
|
"variant.label": "四個「·Git Bash」變體模式",
|
|
1612
1612
|
"variant.hint": "預設關閉:官方四個模式經行內工具補位直接獲得 Git Bash,模式列表保持官方原樣。開啟後註冊四個變體並停用官方模式的工具補位——兩者互斥。釘在變體 id 的舊會話在關閉升級後需重新選擇模式;變更對新會話生效。",
|
|
1613
|
-
"pwsh.label": "PowerShell 7 工具(
|
|
1614
|
-
"pwsh.hint": "
|
|
1613
|
+
"pwsh.label": "PowerShell 7 工具(pwsh7)",
|
|
1614
|
+
"pwsh.hint": "預設關閉:開啟後本外掛在會話裡提供真正的 pwsh7 工具,用系統安裝的 PowerShell 7 執行 Windows 原生操作(登錄檔/服務/WMI),僅完全權限會話可用。前提:機器上已安裝 PowerShell 7(https://aka.ms/powershell),沒裝則工具不會出現。宿主自帶的 pwsh 工具在本機實際執行 Git Bash(名字是假的),無論開關一律拒絕——命令一律走 bash 工具。",
|
|
1615
1615
|
"fctx.label": "FastCtx 檔案工具(gb_*)",
|
|
1616
1616
|
"fctx.hint": "預設開啟:發布 gb_inspect_local_file / gb_grep / gb_glob / gb_replace(Rust 實現:批量讀取帶 token 預算、編碼探測)。它們是官方 read/grep/glob/edit 的補充——官方工具接檔案沙箱,仍是預設推薦;偵測到 dsh-ops 時本組自動讓位。",
|
|
1617
1617
|
},
|
|
@@ -1687,8 +1687,8 @@ window.__ModuleLoader__.load({
|
|
|
1687
1687
|
"tools.updating": "更新中…",
|
|
1688
1688
|
"variant.label": "四個「·Git Bash」變體模式",
|
|
1689
1689
|
"variant.hint": "預設關閉:官方四個模式經行內工具補位直接獲得 Git Bash,模式列表保持官方原樣。開啟後註冊四個變體並停用官方模式的工具補位——兩者互斥。釘在變體 id 的舊會話在關閉升級後需重新選擇模式;變更對新會話生效。",
|
|
1690
|
-
"pwsh.label": "PowerShell 7 工具(
|
|
1691
|
-
"pwsh.hint": "
|
|
1690
|
+
"pwsh.label": "PowerShell 7 工具(pwsh7)",
|
|
1691
|
+
"pwsh.hint": "預設關閉:開啟後本外掛在工作階段裡提供真正的 pwsh7 工具,用系統安裝的 PowerShell 7 執行 Windows 原生操作(登錄檔/服務/WMI),僅完全權限工作階段可用。前提:機器上已安裝 PowerShell 7(https://aka.ms/powershell),沒裝則工具不會出現。宿主自帶的 pwsh 工具在本機實際執行 Git Bash(名字是假的),無論開關一律拒絕——命令一律走 bash 工具。",
|
|
1692
1692
|
"fctx.label": "FastCtx 檔案工具(gb_*)",
|
|
1693
1693
|
"fctx.hint": "預設開啟:發布 gb_inspect_local_file / gb_grep / gb_glob / gb_replace(Rust 實現:批量讀取帶 token 預算、編碼探測)。它們是官方 read/grep/glob/edit 的補充——官方工具接檔案沙箱,仍是預設推薦;偵測到 dsh-ops 時本組自動讓位。",
|
|
1694
1694
|
},
|
package/src/fastctx-bridge.js
CHANGED
|
@@ -43,7 +43,7 @@ export const GB_PREFIX = 'gb_'
|
|
|
43
43
|
export const gbName = (raw) => GB_PREFIX + raw
|
|
44
44
|
|
|
45
45
|
// The HOST registry rejects any tool without an `output` contract (issue #18,
|
|
46
|
-
// root cause 2) — the frozen schema + text renderer the
|
|
46
|
+
// root cause 2) — the frozen schema + text renderer the pwsh7
|
|
47
47
|
// definition ships, reused so both families speak one tool-result contract.
|
|
48
48
|
import { TOOL_OUTPUT_SCHEMA, renderTextContent } from './inline-tools.js'
|
|
49
49
|
|
package/src/index.js
CHANGED
|
@@ -56,7 +56,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
56
56
|
|
|
57
57
|
import { PRESET_META, minimalPluginsFor, pluginsFor } from './compositions.js'
|
|
58
58
|
import { loadSchemastery } from './schemastery.js'
|
|
59
|
-
import { GITBASH_MSYS_ADDENDUM, GITBASH_ROUTE_ADDENDUM, mountInlineTools, resolveHostPwsh7 } from './inline-tools.js'
|
|
59
|
+
import { GITBASH_MSYS_ADDENDUM, GITBASH_ROUTE_ADDENDUM, GITBASH_ROUTE_ADDENDUM_NO_PWSH, mountInlineTools, resolveHostPwsh7 } from './inline-tools.js'
|
|
60
60
|
import { mountFastctx } from './fastctx-bridge.js'
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -503,12 +503,12 @@ export const Config = Schema === null ? undefined : Schema.object({
|
|
|
503
503
|
*/
|
|
504
504
|
variantPresets: live(Schema.boolean().default(false)),
|
|
505
505
|
/**
|
|
506
|
-
* Publish `
|
|
506
|
+
* Publish `pwsh7` — a REAL PowerShell 7 tool over ctx.subprocess —
|
|
507
507
|
* while the host `pwsh` tool is denied (its executor is Git Bash on this
|
|
508
508
|
* host). Default ON; requires pwsh 7 on the machine (never a bundled
|
|
509
509
|
* payload) and danger-full-access per session.
|
|
510
510
|
*/
|
|
511
|
-
pwshTool: live(Schema.boolean().default(
|
|
511
|
+
pwshTool: live(Schema.boolean().default(false)),
|
|
512
512
|
/**
|
|
513
513
|
* Publish the FastCtx file tools (`gb_*`) through the local MCP bridge.
|
|
514
514
|
* Default ON; Windows-only payload, stands down entirely when dsh-ops is
|
|
@@ -2091,11 +2091,16 @@ export async function apply(ctx, config = {}) {
|
|
|
2091
2091
|
// every agent (routing is dialect-independent), while the MSYS
|
|
2092
2092
|
// sentence only describes the world the dialect switch creates.
|
|
2093
2093
|
// Idempotent by marker: assemble may run more than once per agent.
|
|
2094
|
+
// The routing sentence follows the pwsh switch (v0.37.0): while the
|
|
2095
|
+
// pwsh7 tool is off (the default) the sentence must NOT name it —
|
|
2096
|
+
// a route to a tool the agent cannot see only teaches the model to
|
|
2097
|
+
// call a denied name.
|
|
2094
2098
|
if (assembly && typeof assembly === 'object' && Array.isArray(assembly.tools)) {
|
|
2099
|
+
const routeSentence = liveSettings.pwshTool() === true ? GITBASH_ROUTE_ADDENDUM : GITBASH_ROUTE_ADDENDUM_NO_PWSH
|
|
2095
2100
|
for (const tool of assembly.tools) {
|
|
2096
2101
|
if (tool && tool.name === 'bash' && typeof tool.description === 'string'
|
|
2097
2102
|
&& !tool.description.includes('Prefer this bash tool')) {
|
|
2098
|
-
tool.description += '\n' +
|
|
2103
|
+
tool.description += '\n' + routeSentence
|
|
2099
2104
|
+ (applies && dialect.posixPaths === true ? '\n' + GITBASH_MSYS_ADDENDUM : '')
|
|
2100
2105
|
}
|
|
2101
2106
|
}
|
|
@@ -2626,7 +2631,7 @@ export async function apply(ctx, config = {}) {
|
|
|
2626
2631
|
return subprocess.spawn(spec)
|
|
2627
2632
|
},
|
|
2628
2633
|
pwshPath: resolveHostPwsh7({ exists: existsSync }),
|
|
2629
|
-
pwshEnabled: () => liveSettings.pwshTool(),
|
|
2634
|
+
pwshEnabled: () => liveSettings.pwshTool() === true,
|
|
2630
2635
|
msysToWin: (p) => translateMsysPath(p, buildTranslateEnv(readConfiguredBashPath())),
|
|
2631
2636
|
echo: (text) => (liveSettings.dialect().posixPaths === true ? windowsToMsys(text) : text),
|
|
2632
2637
|
log: (m) => console.log(TAG + ' ' + m),
|
package/src/inline-tools.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* executor is ctx.shell, which on this host IS Git Bash — a pwsh tool
|
|
28
28
|
* that runs bash is a lie to the model);
|
|
29
29
|
* 2. `ops_*` tools present (dsh-ops installed) -> our FastCtx bridge and
|
|
30
|
-
*
|
|
30
|
+
* pwsh7 stands down; the official bash activation still runs, the
|
|
31
31
|
* two command surfaces are complements, not duplicates;
|
|
32
32
|
* 3. `bash` already present (variant presets on, or a future official
|
|
33
33
|
* change) -> touch nothing, so the variantPresets switch and this path
|
|
@@ -93,14 +93,24 @@ export function inlineNeeds(names) {
|
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* The routing addendum appended to the `bash` tool's description through the
|
|
96
|
-
* system-prompt assemble waterfall.
|
|
97
|
-
*
|
|
96
|
+
* system-prompt assemble waterfall. TWO variants (v0.37.0, user decision):
|
|
97
|
+
* the pwsh tool is OFF by default, and a routing sentence that names a tool
|
|
98
|
+
* the agent cannot see only teaches the model to call a denied name. The ON
|
|
99
|
+
* variant names `pwsh` (the real PowerShell 7 tool that shadows the fake
|
|
100
|
+
* global one); the OFF variant states bash-only routing. Both hold regardless
|
|
101
|
+
* of the path dialect a delegate sees.
|
|
98
102
|
*/
|
|
99
103
|
export const GITBASH_ROUTE_ADDENDUM = [
|
|
100
|
-
'Prefer this bash tool for ALL commands; use
|
|
104
|
+
'Prefer this bash tool for ALL commands; use the pwsh7 tool ONLY when a Windows-native capability (cmdlets, registry, services, WMI) is truly required.',
|
|
101
105
|
'Fix failed bash commands in bash — never switch shells mid-task, never embed `pwsh -Command` inside a bash command (variable expansion and output encoding break there).',
|
|
102
106
|
].join('\n')
|
|
103
107
|
|
|
108
|
+
/** The bash-only routing variant, used while the pwsh switch is off (the default). */
|
|
109
|
+
export const GITBASH_ROUTE_ADDENDUM_NO_PWSH = [
|
|
110
|
+
'Prefer this bash tool for ALL commands — it is this host\'s shell.',
|
|
111
|
+
'Fix failed commands in bash; there is no PowerShell tool on this host.',
|
|
112
|
+
].join('\n')
|
|
113
|
+
|
|
104
114
|
/**
|
|
105
115
|
* The dialect addendum (MSYS facts) — appended ONLY while this plugin's path
|
|
106
116
|
* dialect is on for the assembling agent, because it describes the /c/ world
|
|
@@ -158,7 +168,7 @@ export function resolveHostPwsh7({ env = process.env, exists, platform = process
|
|
|
158
168
|
return ''
|
|
159
169
|
}
|
|
160
170
|
|
|
161
|
-
/** Arguments `
|
|
171
|
+
/** Arguments `pwsh7` accepts — strict: anything else is rejected. */
|
|
162
172
|
export const PWSH_ARGUMENTS = Object.freeze(['command', 'script_path', 'workdir', 'timeoutMs'])
|
|
163
173
|
|
|
164
174
|
const PWSH_DEFAULT_TIMEOUT_MS = 120_000
|
|
@@ -185,7 +195,7 @@ export function pwshArgv(pwsh, args, { msysToWin } = {}) {
|
|
|
185
195
|
}
|
|
186
196
|
|
|
187
197
|
/**
|
|
188
|
-
* Validate one
|
|
198
|
+
* Validate one pwsh7 call's arguments. Strict like ops_bash: an
|
|
189
199
|
* undeclared key is a hard error (the host bash/pwsh tools accept
|
|
190
200
|
* `run_in_background`; this tool does not, and a silent ignore would leave a
|
|
191
201
|
* server occupying the call until timeout). Pure.
|
|
@@ -282,10 +292,8 @@ export async function activateOfficialBash(agent, toolBashHref, createScopeFn, l
|
|
|
282
292
|
*/
|
|
283
293
|
export function mountInlineTools(ctx, deps) {
|
|
284
294
|
const { tools, agents, createScope, allowed, spawn, pwshPath, echo, log } = deps
|
|
285
|
-
/** agent -> { timer, scope, denyPwsh }; named `tracked` because `agents` above is the host service */
|
|
295
|
+
/** agent -> { timer, scope, denyPwsh, pwshScope }; named `tracked` because `agents` above is the host service */
|
|
286
296
|
const tracked = new Map()
|
|
287
|
-
let pwshPublished = false
|
|
288
|
-
let pwshDisposer = undefined
|
|
289
297
|
let toolBashHrefPromise
|
|
290
298
|
|
|
291
299
|
const faceNames = (agent) => {
|
|
@@ -297,27 +305,28 @@ export function mountInlineTools(ctx, deps) {
|
|
|
297
305
|
}
|
|
298
306
|
}
|
|
299
307
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const publishPwsh = () => {
|
|
309
|
-
if (pwshPublished) return
|
|
308
|
+
/**
|
|
309
|
+
* Provide the additive `pwsh7` tool inside one agent-owned scope (v0.37.0).
|
|
310
|
+
* The name never collides with the host's fake global `pwsh`, so this is a
|
|
311
|
+
* pure ADDITION — it shadows nothing and requires no deny juggling. The
|
|
312
|
+
* scope keeps the registration revertible at agent disposal.
|
|
313
|
+
*/
|
|
314
|
+
const providePwsh = (agent, state) => {
|
|
315
|
+
if (state.pwshScope) return
|
|
310
316
|
if (typeof spawn !== 'function' || !pwshPath) return
|
|
311
|
-
if (
|
|
312
|
-
const registry = tools(ctx)
|
|
313
|
-
if (!registry || typeof registry.register !== 'function') return
|
|
317
|
+
if (!createScope) return
|
|
314
318
|
try {
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
+
const scope = createScope(agent.ctx)
|
|
320
|
+
const registry = scope.ctx?.tools
|
|
321
|
+
if (!registry || typeof registry.register !== 'function') {
|
|
322
|
+
void scope.dispose().catch(() => {})
|
|
323
|
+
return
|
|
324
|
+
}
|
|
325
|
+
registry.register(gitbashPwshDefinition({ pwsh: pwshPath, spawn, allowed, msysToWin: deps.msysToWin, echo }))
|
|
326
|
+
state.pwshScope = scope
|
|
327
|
+
log(`pwsh7 tool provided for this agent (real PowerShell 7 at ${pwshPath})`)
|
|
319
328
|
} catch (error) {
|
|
320
|
-
log(`
|
|
329
|
+
log(`pwsh7 tool registration failed for this agent: ${error?.message ?? error}`)
|
|
321
330
|
}
|
|
322
331
|
}
|
|
323
332
|
|
|
@@ -340,21 +349,37 @@ export function mountInlineTools(ctx, deps) {
|
|
|
340
349
|
let state = tracked.get(agent)
|
|
341
350
|
if (state?.timer) { clearTimeout(state.timer); state.timer = undefined }
|
|
342
351
|
if (!state) {
|
|
343
|
-
state = { timer: undefined, scope: undefined, denyPwsh: undefined }
|
|
352
|
+
state = { timer: undefined, scope: undefined, denyPwsh: undefined, pwshScope: undefined }
|
|
344
353
|
tracked.set(agent, state)
|
|
345
354
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
355
|
+
// The pwsh face has three facts (v0.37.0, user decision — the pwsh7 tool
|
|
356
|
+
// is OFF by default, and its switch lives ONLY on this plugin's row):
|
|
357
|
+
// dsh-ops present -> hands off entirely (their host-pwsh story stands;
|
|
358
|
+
// our pwsh7 and our deny would both be duplicates).
|
|
359
|
+
// the fake global `pwsh` (executor = ctx.shell = Git Bash) is DENIED
|
|
360
|
+
// per agent in EVERY case — the lying name is never
|
|
361
|
+
// callable, and `pwsh7` cannot be caught by it.
|
|
362
|
+
// switch ON -> the REAL PowerShell 7 tool is ADDED as `pwsh7` in
|
|
363
|
+
// an agent-owned scope (pure addition, no shadowing).
|
|
364
|
+
// The row switch is re-read per reconcile, so a flip lands at the next
|
|
365
|
+
// agent (or on the next event after a hot toggle).
|
|
366
|
+
if (needs.denyPwsh) {
|
|
367
|
+
if (needs.opsPresent) {
|
|
368
|
+
// hands off
|
|
369
|
+
} else {
|
|
370
|
+
if (!state.denyPwsh) {
|
|
371
|
+
// The deny MUST go through the AGENT's scoped context
|
|
372
|
+
// (`agent.ctx.tools`, the dsh-ops-proven shape): on the ROOT context
|
|
373
|
+
// the host throws "requires a scoped context" and the deny silently
|
|
374
|
+
// never exists (issue #18, root cause 3).
|
|
375
|
+
try {
|
|
376
|
+
const deny = agent.ctx?.tools?.restrict?.({ deny: ['pwsh'] })
|
|
377
|
+
if (typeof deny === 'function') state.denyPwsh = deny
|
|
378
|
+
} catch (error) {
|
|
379
|
+
log(`fake-pwsh deny failed: ${error?.message ?? error}`)
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (deps.pwshEnabled && deps.pwshEnabled() === true) providePwsh(agent, state)
|
|
358
383
|
}
|
|
359
384
|
}
|
|
360
385
|
if (needs.needsBash && !state.scope) {
|
|
@@ -371,13 +396,6 @@ export function mountInlineTools(ctx, deps) {
|
|
|
371
396
|
}
|
|
372
397
|
}).catch(() => { /* logged inside activateOfficialBash */ })
|
|
373
398
|
}
|
|
374
|
-
// The pwsh replacement follows the ops_ presence: dsh-ops already ships a
|
|
375
|
-
// PowerShell story through the HOST pwsh tool — which our own deny would
|
|
376
|
-
// otherwise silence — so ours fills that gap instead of duplicating tools.
|
|
377
|
-
// The row switch is re-read per reconcile too, so a flip lands at the
|
|
378
|
-
// next agent (or on the next event after a hot toggle).
|
|
379
|
-
if (needs.opsPresent || (deps.pwshEnabled && deps.pwshEnabled() !== true)) unpublishPwsh()
|
|
380
|
-
else publishPwsh()
|
|
381
399
|
}
|
|
382
400
|
|
|
383
401
|
const teardown = (agent) => {
|
|
@@ -386,6 +404,7 @@ export function mountInlineTools(ctx, deps) {
|
|
|
386
404
|
tracked.delete(agent)
|
|
387
405
|
if (state.timer) clearTimeout(state.timer)
|
|
388
406
|
if (state.denyPwsh) { try { state.denyPwsh() } catch { /* already lifted */ } }
|
|
407
|
+
if (state.pwshScope) { void state.pwshScope.dispose().catch(() => {}) }
|
|
389
408
|
if (state.scope) { void state.scope.dispose().catch(() => {}) }
|
|
390
409
|
}
|
|
391
410
|
|
|
@@ -400,14 +419,15 @@ export function mountInlineTools(ctx, deps) {
|
|
|
400
419
|
for (const agent of agents?.(ctx)?.list?.() ?? []) {
|
|
401
420
|
try { reconcile(agent) } catch { /* one broken agent never blocks the rest */ }
|
|
402
421
|
}
|
|
403
|
-
// CALL-LAYER GUARD (v0.35.2, second independent layer):
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
//
|
|
422
|
+
// CALL-LAYER GUARD (v0.35.2, second independent layer; v0.37.0 wording):
|
|
423
|
+
// a `pwsh` call ALWAYS reaches the fake global tool (executor = ctx.shell
|
|
424
|
+
// = Git Bash on this host) — our real tool is `pwsh7`, a different name —
|
|
425
|
+
// so the fake name is denied at dispatch unconditionally, with the
|
|
426
|
+
// replacement named.
|
|
407
427
|
ctx.on('tools/pre-execute', (exec, next) => {
|
|
408
428
|
try {
|
|
409
429
|
if (exec?.name === 'pwsh') {
|
|
410
|
-
return { kind: 'deny', reason: 'the host pwsh tool would run Git Bash on this host (its executor was replaced). Use the bash tool for commands
|
|
430
|
+
return { kind: 'deny', reason: 'the host pwsh tool would run Git Bash on this host (its executor was replaced). Use the bash tool for commands. If you need Windows-native work (registry, services, WMI), the real PowerShell 7 tool is pwsh7 — enable it on the dsh-gitbash-shell settings card if it is not present.' }
|
|
411
431
|
}
|
|
412
432
|
} catch { /* never block the waterfall */ }
|
|
413
433
|
return next()
|
|
@@ -420,7 +440,6 @@ export function mountInlineTools(ctx, deps) {
|
|
|
420
440
|
ctx.effect(() => () => {
|
|
421
441
|
for (const agent of [...tracked.keys()]) teardown(agent)
|
|
422
442
|
tracked.clear()
|
|
423
|
-
unpublishPwsh()
|
|
424
443
|
}, 'dsh-gitbash-shell: inline tool patching')
|
|
425
444
|
}
|
|
426
445
|
|
|
@@ -441,7 +460,13 @@ export function mountInlineTools(ctx, deps) {
|
|
|
441
460
|
*/
|
|
442
461
|
export function gitbashPwshDefinition({ pwsh, spawn, allowed, msysToWin, echo }) {
|
|
443
462
|
return {
|
|
444
|
-
|
|
463
|
+
// v0.37.0 (user decision): the tool is named `pwsh7` — NOT `pwsh` (that
|
|
464
|
+
// name belongs to the host's fake global tool, whose executor is
|
|
465
|
+
// ctx.shell = Git Bash on this host and stays denied) and NOT
|
|
466
|
+
// `gitbash_pwsh` (which read like a bash/pwsh hybrid). `pwsh7` is purely
|
|
467
|
+
// additive: it never shadows anything, and it exists only on hosts where
|
|
468
|
+
// a real PowerShell 7 is installed.
|
|
469
|
+
name: 'pwsh7',
|
|
445
470
|
description: gitbashPwshDescription(),
|
|
446
471
|
parameters: {
|
|
447
472
|
type: 'object',
|
|
@@ -462,7 +487,7 @@ export function gitbashPwshDefinition({ pwsh, spawn, allowed, msysToWin, echo })
|
|
|
462
487
|
const invalid = validatePwshArgs(args)
|
|
463
488
|
if (invalid) throw new Error(invalid)
|
|
464
489
|
if (!allowed(exec?.agent?.session)) {
|
|
465
|
-
throw new Error('
|
|
490
|
+
throw new Error('pwsh7 requires danger-full-access for this session; this channel has no file sandbox.')
|
|
466
491
|
}
|
|
467
492
|
const built = pwshArgv(pwsh, args, { msysToWin })
|
|
468
493
|
if (built.error) throw new Error(built.error)
|