dsh-plugin-admin 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cordis.patch.yml +7 -7
- package/lib/bring-explorer.ps1 +38 -12
- package/lib/client.js +2339 -2299
- package/lib/index.js +2157 -2157
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ node scripts/host-check.mjs
|
|
|
83
83
|
2. 单个“管理中心” `settings.section` 声明与注册,以及插件管理 / 会话管理 / MCP 配置 Tab 的按需切换;
|
|
84
84
|
3. 现代化统一样式注入(`<style>` 挂载与动画定义);
|
|
85
85
|
4. React 组件真实挂载(JSDOM + React 18);
|
|
86
|
-
5.
|
|
86
|
+
5. 插件管理面板渲染、过滤统计与卸载二次确认交互;**失败反馈可见性**:安装 / 更新 / 卸载的 RPC 返回 `{ok:false}` 时,错误文案渲染后**不被同批次触发的静默列表刷新清除**(旧实现在同一微任务里先写 error 再 reload,React 18 批处理把错误吞掉,失败表现为「点击没反应」),并同步弹出顶部浮动错误 toast(双通道:面板红条持久显示细节 + toast 醒目提示;toast 为**单例**——新提示原位替换旧提示并重启倒计时,同屏至多一条,快速连续失败不会重叠遮挡);
|
|
87
87
|
6. 会话管理面板渲染(独立组件,无 Tab)、列表与状态渲染;
|
|
88
88
|
7. 会话删除二次确认交互;
|
|
89
89
|
8. **侧边栏菜单注入**:验证会话菜单追加「复制会话 ID / 删除会话」,删除项为**两次点击确认**(首击改写标签、二击才触发 RPC)且对**同名会话拒绝删除**;工作区菜单追加「在资源管理器打开」;
|
package/cordis.patch.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# dsh-plugin-admin bundle patch: inserts the unified admin plugin row. The host
|
|
2
|
-
# half provides both `pluginAdmin` and `sessionAdmin` remotes through the typert
|
|
3
|
-
# registry; the browser half renders the modern tabbed management panel
|
|
4
|
-
# (Plugins & Sessions) and calls the remotes over the /api RPC gateway.
|
|
5
|
-
- insert:
|
|
6
|
-
- id: plugin-admin
|
|
7
|
-
name: dsh-plugin-admin
|
|
1
|
+
# dsh-plugin-admin bundle patch: inserts the unified admin plugin row. The host
|
|
2
|
+
# half provides both `pluginAdmin` and `sessionAdmin` remotes through the typert
|
|
3
|
+
# registry; the browser half renders the modern tabbed management panel
|
|
4
|
+
# (Plugins & Sessions) and calls the remotes over the /api RPC gateway.
|
|
5
|
+
- insert:
|
|
6
|
+
- id: plugin-admin
|
|
7
|
+
name: dsh-plugin-admin
|
package/lib/bring-explorer.ps1
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# dsh-plugin-admin: bring Explorer window to foreground
|
|
2
2
|
# Usage: powershell -File bring-explorer.ps1 -Path <absolute path>
|
|
3
|
-
|
|
3
|
+
# Fail-soft contract: never waits on user input -- an empty/missing -Path
|
|
4
|
+
# must NOT hit a Mandatory prompt (this console is HIDDEN; the process
|
|
5
|
+
# would linger forever), so the parameter is optional and guarded below.
|
|
6
|
+
param([string]$Path = '')
|
|
7
|
+
|
|
8
|
+
$ErrorActionPreference = 'SilentlyContinue'
|
|
9
|
+
if ([string]::IsNullOrWhiteSpace($Path)) { exit 0 }
|
|
4
10
|
|
|
5
11
|
Add-Type @"
|
|
6
12
|
using System;
|
|
@@ -18,8 +24,24 @@ public class Fr {
|
|
|
18
24
|
}
|
|
19
25
|
"@
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
# The title Explorer displays is the DISPLAY NAME of the revealed FOLDER:
|
|
28
|
+
# the folder itself -- or its PARENT when reveal ran `/select,<file>` on a
|
|
29
|
+
# file. Fall back to the last path segment when the item is gone/unreadable.
|
|
30
|
+
$base = $null
|
|
31
|
+
$item = Get-Item -LiteralPath $Path
|
|
32
|
+
if ($null -ne $item) {
|
|
33
|
+
if ($item.PSIsContainer) { $base = $item.Name }
|
|
34
|
+
else { $base = Split-Path -Leaf $item.DirectoryName }
|
|
35
|
+
} else {
|
|
36
|
+
$segments = ($Path -replace '\\', '/').Split('/') | Where-Object { $_ }
|
|
37
|
+
if ($segments.Count -gt 0) { $base = $segments[-1] }
|
|
38
|
+
}
|
|
39
|
+
if ([string]::IsNullOrWhiteSpace($base)) { exit 0 }
|
|
40
|
+
|
|
41
|
+
# Stock Windows 10/11 titles are the bare folder name; some shell addons
|
|
42
|
+
# append " - <suffix>". Anchor at start, make the dash clause optional so
|
|
43
|
+
# both shapes match, and prefix collisions ("Test" vs "Test 2") stay safe.
|
|
44
|
+
$script:pattern = '^' + [regex]::Escape($base) + '(?:\s*-|$)'
|
|
23
45
|
$script:found = [IntPtr]::Zero
|
|
24
46
|
|
|
25
47
|
function Find-Target {
|
|
@@ -45,12 +67,16 @@ for ($i = 0; $i -lt 30; $i++) {
|
|
|
45
67
|
Start-Sleep -Milliseconds 200
|
|
46
68
|
}
|
|
47
69
|
|
|
48
|
-
if ($target -
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
70
|
+
if ($target -eq [IntPtr]::Zero) { exit 1 }
|
|
71
|
+
|
|
72
|
+
# Simulated ALT keypress grants foreground permission
|
|
73
|
+
[Fr]::keybd_event(0x12, 0, 0, [UIntPtr]::Zero)
|
|
74
|
+
[Fr]::keybd_event(0x12, 0, 2, [UIntPtr]::Zero)
|
|
75
|
+
Start-Sleep -Milliseconds 80
|
|
76
|
+
[Fr]::ShowWindow($target, 9) | Out-Null
|
|
77
|
+
[Fr]::SetForegroundWindow($target) | Out-Null
|
|
78
|
+
[Fr]::BringWindowToTop($target) | Out-Null
|
|
79
|
+
|
|
80
|
+
# One debuggable line on stdout; the host pipe just drains it.
|
|
81
|
+
Write-Output ("raised:{0}" -f $target)
|
|
82
|
+
exit 0
|