dsh-winrm 0.3.0 → 0.3.1
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/lib/client.js +73 -73
- package/lib/index.js +3 -3
- package/lib/types/index.d.ts +6 -5
- package/package.json +1 -1
- package/src/index.ts +6 -5
- package/src/tools.ts +2 -2
package/lib/client.js
CHANGED
|
@@ -565,93 +565,93 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
565
565
|
document.head.appendChild(tag);
|
|
566
566
|
}
|
|
567
567
|
var panel_module_css_default = {
|
|
568
|
-
"
|
|
569
|
-
"
|
|
570
|
-
"
|
|
571
|
-
"
|
|
572
|
-
"groupToggle": "hAbY3W_groupToggle",
|
|
573
|
-
"tab": "hAbY3W_tab",
|
|
574
|
-
"primaryButton": "hAbY3W_primaryButton",
|
|
575
|
-
"browsePath": "hAbY3W_browsePath",
|
|
576
|
-
"consoleInputRow": "hAbY3W_consoleInputRow",
|
|
577
|
-
"backButton": "hAbY3W_backButton",
|
|
578
|
-
"dirType": "hAbY3W_dirType",
|
|
579
|
-
"termContainer": "hAbY3W_termContainer",
|
|
580
|
-
"browseHeader": "hAbY3W_browseHeader",
|
|
581
|
-
"modalBackdrop": "hAbY3W_modalBackdrop",
|
|
582
|
-
"groupName": "hAbY3W_groupName",
|
|
583
|
-
"tableWrap": "hAbY3W_tableWrap",
|
|
584
|
-
"progressBar": "hAbY3W_progressBar",
|
|
585
|
-
"toolbarSpacer": "hAbY3W_toolbarSpacer",
|
|
568
|
+
"formRow": "hAbY3W_formRow",
|
|
569
|
+
"termPlaceholder": "hAbY3W_termPlaceholder",
|
|
570
|
+
"entryLabel": "hAbY3W_entryLabel",
|
|
571
|
+
"search": "hAbY3W_search",
|
|
586
572
|
"inlineTest": "hAbY3W_inlineTest",
|
|
587
|
-
"
|
|
588
|
-
"
|
|
589
|
-
"
|
|
573
|
+
"loading": "hAbY3W_loading",
|
|
574
|
+
"checkRow": "hAbY3W_checkRow",
|
|
575
|
+
"tabBody": "hAbY3W_tabBody",
|
|
576
|
+
"linkButton": "hAbY3W_linkButton",
|
|
577
|
+
"browseList": "hAbY3W_browseList",
|
|
590
578
|
"dirRow": "hAbY3W_dirRow",
|
|
591
|
-
"
|
|
592
|
-
"
|
|
579
|
+
"clusterFilters": "hAbY3W_clusterFilters",
|
|
580
|
+
"cellPre": "hAbY3W_cellPre",
|
|
593
581
|
"dialog": "hAbY3W_dialog",
|
|
594
|
-
"utf8Note": "hAbY3W_utf8Note",
|
|
595
|
-
"consoleHeader": "hAbY3W_consoleHeader",
|
|
596
|
-
"mono": "hAbY3W_mono",
|
|
597
|
-
"spinner": "hAbY3W_spinner",
|
|
598
|
-
"tunnelList": "hAbY3W_tunnelList",
|
|
599
|
-
"groupBySelect": "hAbY3W_groupBySelect",
|
|
600
|
-
"entryIcon": "hAbY3W_entryIcon",
|
|
601
|
-
"ghostButton": "hAbY3W_ghostButton",
|
|
602
|
-
"formCard": "hAbY3W_formCard",
|
|
603
582
|
"fieldLabel": "hAbY3W_fieldLabel",
|
|
604
|
-
"controls": "hAbY3W_controls",
|
|
605
|
-
"linkButton": "hAbY3W_linkButton",
|
|
606
|
-
"formError": "hAbY3W_formError",
|
|
607
|
-
"modalTitle": "hAbY3W_modalTitle",
|
|
608
|
-
"tunnelRow": "hAbY3W_tunnelRow",
|
|
609
|
-
"modal": "hAbY3W_modal",
|
|
610
583
|
"panelContent": "hAbY3W_panelContent",
|
|
611
|
-
"
|
|
612
|
-
"
|
|
613
|
-
"
|
|
614
|
-
"
|
|
615
|
-
"
|
|
584
|
+
"spinner": "hAbY3W_spinner",
|
|
585
|
+
"transferBlock": "hAbY3W_transferBlock",
|
|
586
|
+
"consoleOutput": "hAbY3W_consoleOutput",
|
|
587
|
+
"table": "hAbY3W_table",
|
|
588
|
+
"dialogOverlay": "hAbY3W_dialogOverlay",
|
|
589
|
+
"tunnelRow": "hAbY3W_tunnelRow",
|
|
590
|
+
"browseHeader": "hAbY3W_browseHeader",
|
|
591
|
+
"primaryButton": "hAbY3W_primaryButton",
|
|
592
|
+
"panelHeader": "hAbY3W_panelHeader",
|
|
593
|
+
"consoleInputRow": "hAbY3W_consoleInputRow",
|
|
594
|
+
"entry": "hAbY3W_entry",
|
|
616
595
|
"groupSection": "hAbY3W_groupSection",
|
|
596
|
+
"panelTitle": "hAbY3W_panelTitle",
|
|
617
597
|
"banner": "hAbY3W_banner",
|
|
618
|
-
"
|
|
619
|
-
"
|
|
620
|
-
"
|
|
621
|
-
"
|
|
622
|
-
"browsePanel": "hAbY3W_browsePanel",
|
|
623
|
-
"cellDetails": "hAbY3W_cellDetails",
|
|
624
|
-
"entry": "hAbY3W_entry",
|
|
625
|
-
"dirSize": "hAbY3W_dirSize",
|
|
598
|
+
"empty": "hAbY3W_empty",
|
|
599
|
+
"modalTitle": "hAbY3W_modalTitle",
|
|
600
|
+
"modalFooter": "hAbY3W_modalFooter",
|
|
601
|
+
"groupCount": "hAbY3W_groupCount",
|
|
626
602
|
"radioRow": "hAbY3W_radioRow",
|
|
627
|
-
"
|
|
628
|
-
"
|
|
603
|
+
"termBody": "hAbY3W_termBody",
|
|
604
|
+
"groupName": "hAbY3W_groupName",
|
|
605
|
+
"dirSize": "hAbY3W_dirSize",
|
|
606
|
+
"field": "hAbY3W_field",
|
|
607
|
+
"progressMeta": "hAbY3W_progressMeta",
|
|
629
608
|
"fieldHint": "hAbY3W_fieldHint",
|
|
630
|
-
"
|
|
631
|
-
"
|
|
632
|
-
"
|
|
633
|
-
"
|
|
634
|
-
"
|
|
635
|
-
"clusterFilters": "hAbY3W_clusterFilters",
|
|
636
|
-
"transferBlock": "hAbY3W_transferBlock",
|
|
637
|
-
"consoleWrap": "hAbY3W_consoleWrap",
|
|
638
|
-
"dshSshSpin": "hAbY3W_dshSshSpin",
|
|
639
|
-
"groupCount": "hAbY3W_groupCount",
|
|
609
|
+
"utf8Note": "hAbY3W_utf8Note",
|
|
610
|
+
"panel": "hAbY3W_panel",
|
|
611
|
+
"hiddenFile": "hAbY3W_hiddenFile",
|
|
612
|
+
"backButton": "hAbY3W_backButton",
|
|
613
|
+
"tableWrap": "hAbY3W_tableWrap",
|
|
640
614
|
"clusterForm": "hAbY3W_clusterForm",
|
|
641
|
-
"
|
|
615
|
+
"tab": "hAbY3W_tab",
|
|
616
|
+
"input": "hAbY3W_input",
|
|
617
|
+
"tunnelLabel": "hAbY3W_tunnelLabel",
|
|
618
|
+
"iconButton": "hAbY3W_iconButton",
|
|
619
|
+
"actions": "hAbY3W_actions",
|
|
642
620
|
"fillBody": "hAbY3W_fillBody",
|
|
643
|
-
"
|
|
644
|
-
"
|
|
621
|
+
"toolbarSpacer": "hAbY3W_toolbarSpacer",
|
|
622
|
+
"ghostButton": "hAbY3W_ghostButton",
|
|
623
|
+
"termWrap": "hAbY3W_termWrap",
|
|
624
|
+
"browsePanel": "hAbY3W_browsePanel",
|
|
625
|
+
"browsePath": "hAbY3W_browsePath",
|
|
626
|
+
"modal": "hAbY3W_modal",
|
|
627
|
+
"groupBySelect": "hAbY3W_groupBySelect",
|
|
645
628
|
"groupHeader": "hAbY3W_groupHeader",
|
|
646
|
-
"
|
|
629
|
+
"dshSshSpin": "hAbY3W_dshSshSpin",
|
|
630
|
+
"hint": "hAbY3W_hint",
|
|
631
|
+
"dirName": "hAbY3W_dirName",
|
|
632
|
+
"dirType": "hAbY3W_dirType",
|
|
633
|
+
"progressBar": "hAbY3W_progressBar",
|
|
634
|
+
"formCard": "hAbY3W_formCard",
|
|
635
|
+
"modalBackdrop": "hAbY3W_modalBackdrop",
|
|
647
636
|
"commandInput": "hAbY3W_commandInput",
|
|
637
|
+
"cellDetails": "hAbY3W_cellDetails",
|
|
638
|
+
"progressTrack": "hAbY3W_progressTrack",
|
|
648
639
|
"dialogTitle": "hAbY3W_dialogTitle",
|
|
649
|
-
"
|
|
650
|
-
"
|
|
651
|
-
"
|
|
652
|
-
"
|
|
653
|
-
"
|
|
654
|
-
"
|
|
640
|
+
"controls": "hAbY3W_controls",
|
|
641
|
+
"termContainer": "hAbY3W_termContainer",
|
|
642
|
+
"consoleWrap": "hAbY3W_consoleWrap",
|
|
643
|
+
"consoleHeader": "hAbY3W_consoleHeader",
|
|
644
|
+
"radioLabel": "hAbY3W_radioLabel",
|
|
645
|
+
"entryIcon": "hAbY3W_entryIcon",
|
|
646
|
+
"badge": "hAbY3W_badge",
|
|
647
|
+
"mono": "hAbY3W_mono",
|
|
648
|
+
"formError": "hAbY3W_formError",
|
|
649
|
+
"toolbar": "hAbY3W_toolbar",
|
|
650
|
+
"groupToggle": "hAbY3W_groupToggle",
|
|
651
|
+
"groupChevron": "hAbY3W_groupChevron",
|
|
652
|
+
"tabBar": "hAbY3W_tabBar",
|
|
653
|
+
"cellMuted": "hAbY3W_cellMuted",
|
|
654
|
+
"tunnelList": "hAbY3W_tunnelList"
|
|
655
655
|
};
|
|
656
656
|
//#endregion
|
|
657
657
|
//#region src/client/panel/ConsoleTab.tsx
|
package/lib/index.js
CHANGED
|
@@ -3171,7 +3171,7 @@ function winrmProcessTool(engine) {
|
|
|
3171
3171
|
function winrmUploadTool(engine) {
|
|
3172
3172
|
return defineTool({
|
|
3173
3173
|
name: "winrm_upload",
|
|
3174
|
-
description: "Upload a local file to a configured Windows host
|
|
3174
|
+
description: "Upload a local file to a configured Windows host. The bytes go over the SMB admin share when it is reachable, otherwise they are streamed over WinRM in one shell with per-chunk gzip (the 48 KiB base64 chunk path is kept only as a fallback). The local path is on THIS machine (the dsh host). Triggers: upload file to Windows server, deploy artifact, copy config to Windows server.",
|
|
3175
3175
|
parameters: {
|
|
3176
3176
|
alias: {
|
|
3177
3177
|
type: "string",
|
|
@@ -3239,7 +3239,7 @@ function winrmUploadTool(engine) {
|
|
|
3239
3239
|
function winrmDownloadTool(engine) {
|
|
3240
3240
|
return defineTool({
|
|
3241
3241
|
name: "winrm_download",
|
|
3242
|
-
description: "Download a remote FILE from a configured Windows host to a local path on this machine
|
|
3242
|
+
description: "Download a remote FILE from a configured Windows host to a local path on this machine. The bytes come over the SMB admin share when it is reachable, otherwise they are streamed over WinRM as parallel byte ranges (the 48 KiB base64 chunk path is kept only as a fallback). Directory download is not supported — download files individually. Triggers: download file from Windows server, fetch remote log/artifact.",
|
|
3243
3243
|
parameters: {
|
|
3244
3244
|
alias: {
|
|
3245
3245
|
type: "string",
|
|
@@ -3435,7 +3435,7 @@ const DEFAULT_ENABLED = true;
|
|
|
3435
3435
|
/** Order of the announcement section within the tool-guidance band. */
|
|
3436
3436
|
const SECTION_ORDER = 151;
|
|
3437
3437
|
/** Model-facing announcement: plugin presence, capabilities, and limits. */
|
|
3438
|
-
const WINRM_GUIDANCE = "本机已安装 dsh-winrm 插件(DSH 远程 Windows 运维,WinRM/PowerShell Remoting):侧边栏「Windows」入口;仿照 dsh-ssh 插件开发。能力:主机配置存 ~/.dsh/dsh-winrm.json(GUI 配置后 agent 方可使用);winrm_list 列出主机、winrm_exec 执行 PowerShell 命令(UTF-8 信封,中文不乱码)、winrm_service 服务管理(start/stop/restart/启动类型)、winrm_process 进程管理(list/kill)、winrm_upload/winrm_download 文件传输(
|
|
3438
|
+
const WINRM_GUIDANCE = "本机已安装 dsh-winrm 插件(DSH 远程 Windows 运维,WinRM/PowerShell Remoting):侧边栏「Windows」入口;仿照 dsh-ssh 插件开发。能力:主机配置存 ~/.dsh/dsh-winrm.json(GUI 配置后 agent 方可使用);winrm_list 列出主机、winrm_exec 执行 PowerShell 命令(UTF-8 信封,中文不乱码)、winrm_service 服务管理(start/stop/restart/启动类型)、winrm_process 进程管理(list/kill)、winrm_upload/winrm_download 文件传输(SMB 管理共享可达时优先,否则走 WinRM 流式传输,无 SMB 依赖,大文件经 SHA256 校验)、winrm_cluster 集群并发执行;Web 控制台走 WebSocket。认证:通过原生 Node.js WinRM 客户端(winrm-client)的 NTLM/Negotiate 与 Basic 实现,兼容本地账户与域账户;传输支持 http(5985)/https(5986)。前提:目标机需启用 WinRM(scripts/enable-winrm.ps1),本机无需 Python —— WinRM 走纯 Node 依赖。HTTP 仅建议受信内网使用;密码以明文存在用户主目录私有文件(权限 0600);命令输出可能含敏感信息;传输/执行消耗真实远程资源,先确认再操作。用户提到「Windows 服务器 / WinRM / PowerShell 远程 / 服务管理 / 进程管理」时即指本插件,请据此协作。";
|
|
3439
3439
|
/**
|
|
3440
3440
|
* Mount the WinRM engine, routes, tools, and announcement.
|
|
3441
3441
|
* @param ctx - host plugin context carrying webServer/tools/systemPrompt.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dsh-winrm — host half. Mounts the WinRM engine (per-call PowerShell
|
|
3
3
|
* execution with a UTF-8 envelope, streaming console, service/process
|
|
4
|
-
* management,
|
|
4
|
+
* management, streamed file transfer, cluster), the /api/dsh-winrm
|
|
5
5
|
* route family plus the console WebSocket upgrade, the agent tools
|
|
6
6
|
* (winrm_list, winrm_exec, winrm_service, winrm_process, winrm_upload,
|
|
7
7
|
* winrm_download, winrm_cluster), and a system-prompt announcement. The
|
|
8
8
|
* browser half (./client) renders the host manager and operations panel.
|
|
9
9
|
* Everything rides official NPM SDK packages — no dsh source changes.
|
|
10
10
|
*
|
|
11
|
-
* Config is read live through `Volatile` references (`.get()`), so
|
|
12
|
-
*
|
|
13
|
-
* `loader/volatile-update` re-runs the registration sync when
|
|
11
|
+
* Config is read live through `Volatile` references (`.get()`), so editing
|
|
12
|
+
* `enabled` / `announceToAgent` in the profile takes effect without
|
|
13
|
+
* remounting; `loader/volatile-update` re-runs the registration sync when
|
|
14
|
+
* they change.
|
|
14
15
|
*/
|
|
15
16
|
import type { Context, Volatile } from '@deepseek-ai/cordis';
|
|
16
17
|
import z from '@deepseek-ai/schemastery';
|
|
@@ -33,7 +34,7 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
33
34
|
enabled: z<boolean, boolean, "volatile-defined">;
|
|
34
35
|
}>>, "plain">;
|
|
35
36
|
/** Model-facing announcement: plugin presence, capabilities, and limits. */
|
|
36
|
-
export declare const WINRM_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-winrm \u63D2\u4EF6\uFF08DSH \u8FDC\u7A0B Windows \u8FD0\u7EF4\uFF0CWinRM/PowerShell Remoting\uFF09\uFF1A\u4FA7\u8FB9\u680F\u300CWindows\u300D\u5165\u53E3\uFF1B\u4EFF\u7167 dsh-ssh \u63D2\u4EF6\u5F00\u53D1\u3002\u80FD\u529B\uFF1A\u4E3B\u673A\u914D\u7F6E\u5B58 ~/.dsh/dsh-winrm.json\uFF08GUI \u914D\u7F6E\u540E agent \u65B9\u53EF\u4F7F\u7528\uFF09\uFF1Bwinrm_list \u5217\u51FA\u4E3B\u673A\u3001winrm_exec \u6267\u884C PowerShell \u547D\u4EE4\uFF08UTF-8 \u4FE1\u5C01\uFF0C\u4E2D\u6587\u4E0D\u4E71\u7801\uFF09\u3001winrm_service \u670D\u52A1\u7BA1\u7406\uFF08start/stop/restart/\u542F\u52A8\u7C7B\u578B\uFF09\u3001winrm_process \u8FDB\u7A0B\u7BA1\u7406\uFF08list/kill\uFF09\u3001winrm_upload/winrm_download \u6587\u4EF6\u4F20\u8F93\
|
|
37
|
+
export declare const WINRM_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-winrm \u63D2\u4EF6\uFF08DSH \u8FDC\u7A0B Windows \u8FD0\u7EF4\uFF0CWinRM/PowerShell Remoting\uFF09\uFF1A\u4FA7\u8FB9\u680F\u300CWindows\u300D\u5165\u53E3\uFF1B\u4EFF\u7167 dsh-ssh \u63D2\u4EF6\u5F00\u53D1\u3002\u80FD\u529B\uFF1A\u4E3B\u673A\u914D\u7F6E\u5B58 ~/.dsh/dsh-winrm.json\uFF08GUI \u914D\u7F6E\u540E agent \u65B9\u53EF\u4F7F\u7528\uFF09\uFF1Bwinrm_list \u5217\u51FA\u4E3B\u673A\u3001winrm_exec \u6267\u884C PowerShell \u547D\u4EE4\uFF08UTF-8 \u4FE1\u5C01\uFF0C\u4E2D\u6587\u4E0D\u4E71\u7801\uFF09\u3001winrm_service \u670D\u52A1\u7BA1\u7406\uFF08start/stop/restart/\u542F\u52A8\u7C7B\u578B\uFF09\u3001winrm_process \u8FDB\u7A0B\u7BA1\u7406\uFF08list/kill\uFF09\u3001winrm_upload/winrm_download \u6587\u4EF6\u4F20\u8F93\uFF08SMB \u7BA1\u7406\u5171\u4EAB\u53EF\u8FBE\u65F6\u4F18\u5148\uFF0C\u5426\u5219\u8D70 WinRM \u6D41\u5F0F\u4F20\u8F93\uFF0C\u65E0 SMB \u4F9D\u8D56\uFF0C\u5927\u6587\u4EF6\u7ECF SHA256 \u6821\u9A8C\uFF09\u3001winrm_cluster \u96C6\u7FA4\u5E76\u53D1\u6267\u884C\uFF1BWeb \u63A7\u5236\u53F0\u8D70 WebSocket\u3002\u8BA4\u8BC1\uFF1A\u901A\u8FC7\u539F\u751F Node.js WinRM \u5BA2\u6237\u7AEF\uFF08winrm-client\uFF09\u7684 NTLM/Negotiate \u4E0E Basic \u5B9E\u73B0\uFF0C\u517C\u5BB9\u672C\u5730\u8D26\u6237\u4E0E\u57DF\u8D26\u6237\uFF1B\u4F20\u8F93\u652F\u6301 http(5985)/https(5986)\u3002\u524D\u63D0\uFF1A\u76EE\u6807\u673A\u9700\u542F\u7528 WinRM\uFF08scripts/enable-winrm.ps1\uFF09\uFF0C\u672C\u673A\u65E0\u9700 Python \u2014\u2014 WinRM \u8D70\u7EAF Node \u4F9D\u8D56\u3002HTTP \u4EC5\u5EFA\u8BAE\u53D7\u4FE1\u5185\u7F51\u4F7F\u7528\uFF1B\u5BC6\u7801\u4EE5\u660E\u6587\u5B58\u5728\u7528\u6237\u4E3B\u76EE\u5F55\u79C1\u6709\u6587\u4EF6\uFF08\u6743\u9650 0600\uFF09\uFF1B\u547D\u4EE4\u8F93\u51FA\u53EF\u80FD\u542B\u654F\u611F\u4FE1\u606F\uFF1B\u4F20\u8F93/\u6267\u884C\u6D88\u8017\u771F\u5B9E\u8FDC\u7A0B\u8D44\u6E90\uFF0C\u5148\u786E\u8BA4\u518D\u64CD\u4F5C\u3002\u7528\u6237\u63D0\u5230\u300CWindows \u670D\u52A1\u5668 / WinRM / PowerShell \u8FDC\u7A0B / \u670D\u52A1\u7BA1\u7406 / \u8FDB\u7A0B\u7BA1\u7406\u300D\u65F6\u5373\u6307\u672C\u63D2\u4EF6\uFF0C\u8BF7\u636E\u6B64\u534F\u4F5C\u3002";
|
|
37
38
|
/**
|
|
38
39
|
* Mount the WinRM engine, routes, tools, and announcement.
|
|
39
40
|
* @param ctx - host plugin context carrying webServer/tools/systemPrompt.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-winrm",
|
|
3
3
|
"description": "Remote Windows administration for the dsh web GUI: WinRM/PowerShell Remoting host config store (~/.dsh/dsh-winrm.json), PowerShell exec / streaming console / service & process management / streamed file transfer / cluster execution, plus agent tools (winrm_list, winrm_exec, winrm_service, winrm_process, winrm_upload, winrm_download, winrm_cluster). Runs entirely on a native Node.js WinRM client (winrm-client) — no Python/pywinrm required. Standalone Cordis plugin — mounted via cordis.patch.yml + a profile node_modules link, no dsh source changes.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.7.0",
|
|
7
7
|
"engines": {
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dsh-winrm — host half. Mounts the WinRM engine (per-call PowerShell
|
|
3
3
|
* execution with a UTF-8 envelope, streaming console, service/process
|
|
4
|
-
* management,
|
|
4
|
+
* management, streamed file transfer, cluster), the /api/dsh-winrm
|
|
5
5
|
* route family plus the console WebSocket upgrade, the agent tools
|
|
6
6
|
* (winrm_list, winrm_exec, winrm_service, winrm_process, winrm_upload,
|
|
7
7
|
* winrm_download, winrm_cluster), and a system-prompt announcement. The
|
|
8
8
|
* browser half (./client) renders the host manager and operations panel.
|
|
9
9
|
* Everything rides official NPM SDK packages — no dsh source changes.
|
|
10
10
|
*
|
|
11
|
-
* Config is read live through `Volatile` references (`.get()`), so
|
|
12
|
-
*
|
|
13
|
-
* `loader/volatile-update` re-runs the registration sync when
|
|
11
|
+
* Config is read live through `Volatile` references (`.get()`), so editing
|
|
12
|
+
* `enabled` / `announceToAgent` in the profile takes effect without
|
|
13
|
+
* remounting; `loader/volatile-update` re-runs the registration sync when
|
|
14
|
+
* they change.
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
import type { Context, Volatile } from '@deepseek-ai/cordis'
|
|
@@ -63,7 +64,7 @@ const DEFAULT_ENABLED = true
|
|
|
63
64
|
const SECTION_ORDER = 151
|
|
64
65
|
|
|
65
66
|
/** Model-facing announcement: plugin presence, capabilities, and limits. */
|
|
66
|
-
export const WINRM_GUIDANCE = '本机已安装 dsh-winrm 插件(DSH 远程 Windows 运维,WinRM/PowerShell Remoting):侧边栏「Windows」入口;仿照 dsh-ssh 插件开发。能力:主机配置存 ~/.dsh/dsh-winrm.json(GUI 配置后 agent 方可使用);winrm_list 列出主机、winrm_exec 执行 PowerShell 命令(UTF-8 信封,中文不乱码)、winrm_service 服务管理(start/stop/restart/启动类型)、winrm_process 进程管理(list/kill)、winrm_upload/winrm_download 文件传输(
|
|
67
|
+
export const WINRM_GUIDANCE = '本机已安装 dsh-winrm 插件(DSH 远程 Windows 运维,WinRM/PowerShell Remoting):侧边栏「Windows」入口;仿照 dsh-ssh 插件开发。能力:主机配置存 ~/.dsh/dsh-winrm.json(GUI 配置后 agent 方可使用);winrm_list 列出主机、winrm_exec 执行 PowerShell 命令(UTF-8 信封,中文不乱码)、winrm_service 服务管理(start/stop/restart/启动类型)、winrm_process 进程管理(list/kill)、winrm_upload/winrm_download 文件传输(SMB 管理共享可达时优先,否则走 WinRM 流式传输,无 SMB 依赖,大文件经 SHA256 校验)、winrm_cluster 集群并发执行;Web 控制台走 WebSocket。认证:通过原生 Node.js WinRM 客户端(winrm-client)的 NTLM/Negotiate 与 Basic 实现,兼容本地账户与域账户;传输支持 http(5985)/https(5986)。前提:目标机需启用 WinRM(scripts/enable-winrm.ps1),本机无需 Python —— WinRM 走纯 Node 依赖。HTTP 仅建议受信内网使用;密码以明文存在用户主目录私有文件(权限 0600);命令输出可能含敏感信息;传输/执行消耗真实远程资源,先确认再操作。用户提到「Windows 服务器 / WinRM / PowerShell 远程 / 服务管理 / 进程管理」时即指本插件,请据此协作。'
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
* Mount the WinRM engine, routes, tools, and announcement.
|
package/src/tools.ts
CHANGED
|
@@ -266,7 +266,7 @@ export function winrmProcessTool(engine: WinRmEngine) {
|
|
|
266
266
|
export function winrmUploadTool(engine: WinRmEngine) {
|
|
267
267
|
return defineTool({
|
|
268
268
|
name: 'winrm_upload',
|
|
269
|
-
description: 'Upload a local file to a configured Windows host
|
|
269
|
+
description: 'Upload a local file to a configured Windows host. The bytes go over the SMB admin share when it is reachable, otherwise they are streamed over WinRM in one shell with per-chunk gzip (the 48 KiB base64 chunk path is kept only as a fallback). The local path is on THIS machine (the dsh host). ' +
|
|
270
270
|
'Triggers: upload file to Windows server, deploy artifact, copy config to Windows server.',
|
|
271
271
|
parameters: {
|
|
272
272
|
alias: { type: 'string', required: true, description: 'Host alias from winrm_list.' },
|
|
@@ -305,7 +305,7 @@ export function winrmUploadTool(engine: WinRmEngine) {
|
|
|
305
305
|
export function winrmDownloadTool(engine: WinRmEngine) {
|
|
306
306
|
return defineTool({
|
|
307
307
|
name: 'winrm_download',
|
|
308
|
-
description: 'Download a remote FILE from a configured Windows host to a local path on this machine
|
|
308
|
+
description: 'Download a remote FILE from a configured Windows host to a local path on this machine. The bytes come over the SMB admin share when it is reachable, otherwise they are streamed over WinRM as parallel byte ranges (the 48 KiB base64 chunk path is kept only as a fallback). Directory download is not supported — download files individually. ' +
|
|
309
309
|
'Triggers: download file from Windows server, fetch remote log/artifact.',
|
|
310
310
|
parameters: {
|
|
311
311
|
alias: { type: 'string', required: true, description: 'Host alias from winrm_list.' },
|