@deepseek-ai/dsh-client-ui-settings-shell 0.1.7-alpha.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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +78 -0
- package/README.zh.md +78 -0
- package/lib/client.js +199 -0
- package/lib/index.js +12 -0
- package/lib/types/client/ShellCard.d.ts +12 -0
- package/lib/types/client/index.d.ts +28 -0
- package/lib/types/client/locales.d.ts +15 -0
- package/lib/types/client/shell-card-controller.d.ts +44 -0
- package/lib/types/index.d.ts +10 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/client/ui-settings-shell/README.md
|
|
5
|
+
README.md: 057cc6d268d28752ac50a2f7cc9f631211e27e6f
|
|
6
|
+
README.zh.md: 04016f9dd495c49c36d9677f379a327ee9ec70dd
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "The shell executor's settings page on the dsh web client's Plugins page: the command timeout and the per-stream output cap of the shell namespace."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-client-ui-settings-shell
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
Open **Plugins** in the sidebar and select **Shell** in the Official group to set how long one command may run and how much of each output stream stays in memory. The page stages what is typed and writes it only on save, marks the values the user overrode, and offers to reset each back to the deployment's default. The page exists while the Host serves the `shell` namespace, so a deployment without a local shell executor shows no trace of it.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
27
|
+
|
|
28
|
+
The **Shell** card in the Official group opens the page. **Command timeout (ms)** ends a command that runs longer; **Output cap per stream (bytes)** spills output beyond it to a temporary file. Both render the effective value — the user's override over the composed default — and a field the user overrode carries an **Overridden** badge with **Reset to default** beside it. Nothing is written until **Save**; leaving the page drops the drafts, an empty field saves as a reset, and text that is not a number blocks the save and says so under the field.
|
|
29
|
+
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
<a id="understand-the-implementation"></a>
|
|
33
|
+
## Understand the implementation
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary>Implementation internals — click to expand</summary>
|
|
37
|
+
|
|
38
|
+
The Host half is an empty `apply`, present only so the package holds a Loader row the client module system serves the browser half for. The browser half binds the composed shell executor entry (`bash-sandbox` off Windows, `pwsh-sandbox` on it) through `ctx.configForms.get`, keeps the staged form in `ShellCardController` over the shared `SettingsFormModel` of `ui-primitives`, and registers `ShellCard` into the Plugins page's `plugins.item` slot through `ctx.configForms.whileServed`, which registers while the Host serves either entry and withdraws when it stops. The page's copy lives in this package's `settings.shell` dictionary; the `SettingsForm` frame takes its copy as props.
|
|
39
|
+
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
-----
|
|
43
|
+
|
|
44
|
+
<a id="further-exploration"></a>
|
|
45
|
+
## Further Exploration
|
|
46
|
+
|
|
47
|
+
- [ui-plugin-manager](../ui-plugin-manager/README.md) — the Plugins page and the `plugins.item` slot the page registers into.
|
|
48
|
+
- [ui-settings](../ui-settings/README.md) — the settings scope and the served-namespace watch the page rides.
|
|
49
|
+
- [ui-primitives](../ui-primitives/README.md) — the settings form model and fields the page renders.
|
|
50
|
+
- [bash-local](../../shell/bash-local/README.md) — the executor that registers the `shell` namespace.
|
|
51
|
+
|
|
52
|
+
-----
|
|
53
|
+
|
|
54
|
+
<a id="model-experience"></a>
|
|
55
|
+
## Model Experience
|
|
56
|
+
|
|
57
|
+
None, as the package is a browser-side settings surface that registers no model surface.
|
|
58
|
+
|
|
59
|
+
#### KV Cache effect
|
|
60
|
+
|
|
61
|
+
None; this package neither assembles nor sends a provider request.
|
|
62
|
+
|
|
63
|
+
## Known Limitations and Deferred Work
|
|
64
|
+
|
|
65
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
66
|
+
|
|
67
|
+
- **The page follows the composed executor** — the POSIX and PowerShell executor families share the `shell` namespace because a host composes exactly one of them, so the served schema differs by platform (PowerShell adds `pwshPath`) while the page edits the same two fields on both.
|
|
68
|
+
- **Runtime invariant:** No companion is published. The page holds no owned relationship of its own: what it shows derives from the settings mirror, and what it writes the Host validates.
|
|
69
|
+
|
|
70
|
+
<a id="dev-note"></a>
|
|
71
|
+
### Dev Note
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
75
|
+
|
|
76
|
+
None.
|
|
77
|
+
|
|
78
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "dsh Web 客户端插件页上的终端执行器设置页:shell 命名空间的命令超时与单流输出上限。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-client-ui-settings-shell
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
在侧栏打开**插件**,在官方分组里选择**终端**,即可设置单条命令允许运行多久、每条输出流在内存里保留多少。页面暂存输入、只在保存时写入,标明用户覆盖过的值,并允许把每个值重置回部署默认值。页面只在 Host 服务 `shell` 命名空间期间存在,没有本地终端执行器的部署看不到它。
|
|
13
|
+
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [进一步探索](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与延期工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发备注](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
27
|
+
|
|
28
|
+
官方分组里的**终端**卡片打开这一页。**命令超时(毫秒)**终止运行更久的命令;**单流输出上限(字节)**把超出的输出转存到临时文件。两个字段都显示生效值,即用户覆盖值叠在组合默认值之上;用户覆盖过的字段带**已覆盖**标签,旁边是**恢复默认**。点击**保存**之前不会写入任何内容;离开页面即丢弃草稿,清空字段并保存等于重置,填了不是数字的文本则保存被阻止,并在字段下说明原因。
|
|
29
|
+
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
<a id="understand-the-implementation"></a>
|
|
33
|
+
## 理解实现
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary>实现细节——点击展开</summary>
|
|
37
|
+
|
|
38
|
+
宿主半侧是一个空的 `apply`,只为让本包占一条 Loader 行,客户端模块系统据此送出浏览器半侧。浏览器半侧通过 `ctx.configForms.get` 绑定当前平台组装的 shell 执行器条目(非 Windows 为 `bash-sandbox`,Windows 为 `pwsh-sandbox`),用 `ui-primitives` 的共享 `SettingsFormModel` 在 `ShellCardController` 里维护暂存表单,并通过 `ctx.configForms.whileServed` 把 `ShellCard` 注册进插件页的 `plugins.item` slot:Host 服务任一执行器条目时注册,停止服务时注销。页面文案在本包的 `settings.shell` 字典里;`SettingsForm` 框架的文案以 props 传入。
|
|
39
|
+
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
-----
|
|
43
|
+
|
|
44
|
+
<a id="further-exploration"></a>
|
|
45
|
+
## 进一步探索
|
|
46
|
+
|
|
47
|
+
- [ui-plugin-manager](../ui-plugin-manager/README.zh.md)——插件页以及本页注册进去的 `plugins.item` slot。
|
|
48
|
+
- [ui-settings](../ui-settings/README.zh.md)——本页依赖的设置 scope 与"命名空间被服务期间"的监视。
|
|
49
|
+
- [ui-primitives](../ui-primitives/README.zh.md)——本页渲染的设置表单模型与字段。
|
|
50
|
+
- [bash-local](../../shell/bash-local/README.zh.md)——注册 `shell` 命名空间的执行器。
|
|
51
|
+
|
|
52
|
+
-----
|
|
53
|
+
|
|
54
|
+
<a id="model-experience"></a>
|
|
55
|
+
## 模型体验
|
|
56
|
+
|
|
57
|
+
无,本包是浏览器侧的设置界面,不注册任何模型面。
|
|
58
|
+
|
|
59
|
+
#### KV 缓存影响
|
|
60
|
+
|
|
61
|
+
无;本包既不组装也不发送提供方请求。
|
|
62
|
+
|
|
63
|
+
## 已知限制与延期工作
|
|
64
|
+
|
|
65
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
66
|
+
|
|
67
|
+
- **页面跟随组合进来的执行器**——POSIX 与 PowerShell 两个执行器家族共用 `shell` 命名空间,因为一台主机只组合其中一个,所以服务出来的 schema 因平台而异(PowerShell 多一个 `pwshPath`),而页面在两个平台上编辑的都是同样两个字段。
|
|
68
|
+
- **运行时不变量:**不发布伴生。本页没有自己拥有的关系:它显示的内容派生自设置镜像,它写入的内容由 Host 校验。
|
|
69
|
+
|
|
70
|
+
<a id="dev-note"></a>
|
|
71
|
+
### 开发备注
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary>维护者工作上下文——点击展开</summary>
|
|
75
|
+
|
|
76
|
+
无。
|
|
77
|
+
|
|
78
|
+
</details>
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@deepseek-ai/dsh-client-ui-settings-shell",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
9
|
+
//#region lib/types/client/locales.js
|
|
10
|
+
/** Locale bundles for the shell executor's settings page. */
|
|
11
|
+
/** English copy. */
|
|
12
|
+
const en = {
|
|
13
|
+
title: "Shell",
|
|
14
|
+
description: "Limit how long each command may run and how much it may output.",
|
|
15
|
+
timeoutMs: "Command timeout (ms)",
|
|
16
|
+
timeoutMsHint: "How long one command may run before it is terminated.",
|
|
17
|
+
maxOutputBytes: "Output cap per stream (bytes)",
|
|
18
|
+
maxOutputBytesHint: "Output beyond this spills to a temporary file rather than being lost.",
|
|
19
|
+
overridden: "Overridden",
|
|
20
|
+
reset: "Reset to default",
|
|
21
|
+
readOnly: "This deployment stores settings read-only.",
|
|
22
|
+
unavailable: "This plugin is not loaded, so it cannot be configured right now.",
|
|
23
|
+
save: "Save",
|
|
24
|
+
saving: "Saving…",
|
|
25
|
+
saveFailed: "The deployment did not accept these values; they were left for you to correct.",
|
|
26
|
+
invalidNumber: "Enter a number, or leave blank to use the default."
|
|
27
|
+
};
|
|
28
|
+
/** Simplified Chinese copy. */
|
|
29
|
+
const zh = {
|
|
30
|
+
title: "终端",
|
|
31
|
+
description: "限制每条命令最多能跑多久、最多输出多少内容。",
|
|
32
|
+
timeoutMs: "命令超时(毫秒)",
|
|
33
|
+
timeoutMsHint: "单条命令允许运行多久,超时即终止。",
|
|
34
|
+
maxOutputBytes: "单流输出上限(字节)",
|
|
35
|
+
maxOutputBytesHint: "超出部分会转存到临时文件,而不是被丢弃。",
|
|
36
|
+
overridden: "已覆盖",
|
|
37
|
+
reset: "恢复默认",
|
|
38
|
+
readOnly: "本部署的设置为只读。",
|
|
39
|
+
unavailable: "该插件当前未加载,暂时无法配置。",
|
|
40
|
+
save: "保存",
|
|
41
|
+
saving: "保存中…",
|
|
42
|
+
saveFailed: "本部署没有接受这些值,已保留供你修改。",
|
|
43
|
+
invalidNumber: "请填数字;留空表示使用默认值。"
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The form frame's copy, read from this page's dictionary.
|
|
47
|
+
* @param t - the page's locale reader.
|
|
48
|
+
* @returns the labels the shared settings form renders.
|
|
49
|
+
*/
|
|
50
|
+
function formLabels(t) {
|
|
51
|
+
return {
|
|
52
|
+
unavailable: t("unavailable"),
|
|
53
|
+
readOnly: t("readOnly"),
|
|
54
|
+
saveFailed: t("saveFailed"),
|
|
55
|
+
save: t("save"),
|
|
56
|
+
saving: t("saving")
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region lib/types/client/ShellCard.js
|
|
61
|
+
/**
|
|
62
|
+
* Render the shell executor's one-liner or its settings form, as the Plugins page asks.
|
|
63
|
+
* @param props - the view asked for, locale copy, the form snapshot, and its actions.
|
|
64
|
+
* @returns the one-liner, or the form.
|
|
65
|
+
*/
|
|
66
|
+
function ShellCard(props) {
|
|
67
|
+
const { t } = props;
|
|
68
|
+
const state = props.useShellCard((snapshot) => snapshot);
|
|
69
|
+
if (props.view === "summary") return t("description");
|
|
70
|
+
const disabled = !state.writable;
|
|
71
|
+
return (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.SettingsForm, {
|
|
72
|
+
labels: formLabels(t),
|
|
73
|
+
state,
|
|
74
|
+
onSave: props.save,
|
|
75
|
+
onDiscard: props.discard,
|
|
76
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SettingsValueField, {
|
|
77
|
+
id: "plugin-config-shell-timeout",
|
|
78
|
+
label: t("timeoutMs"),
|
|
79
|
+
hint: t("timeoutMsHint"),
|
|
80
|
+
overriddenLabel: t("overridden"),
|
|
81
|
+
resetLabel: t("reset"),
|
|
82
|
+
invalidLabel: t("invalidNumber"),
|
|
83
|
+
numeric: true,
|
|
84
|
+
disabled,
|
|
85
|
+
...state.timeoutMs,
|
|
86
|
+
onEdit: (text) => {
|
|
87
|
+
props.edit("timeoutMs", text);
|
|
88
|
+
},
|
|
89
|
+
onReset: () => {
|
|
90
|
+
props.resetField("timeoutMs");
|
|
91
|
+
}
|
|
92
|
+
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SettingsValueField, {
|
|
93
|
+
id: "plugin-config-shell-output",
|
|
94
|
+
label: t("maxOutputBytes"),
|
|
95
|
+
hint: t("maxOutputBytesHint"),
|
|
96
|
+
overriddenLabel: t("overridden"),
|
|
97
|
+
resetLabel: t("reset"),
|
|
98
|
+
invalidLabel: t("invalidNumber"),
|
|
99
|
+
numeric: true,
|
|
100
|
+
disabled,
|
|
101
|
+
...state.maxOutputBytes,
|
|
102
|
+
onEdit: (text) => {
|
|
103
|
+
props.edit("maxOutputBytes", text);
|
|
104
|
+
},
|
|
105
|
+
onReset: () => {
|
|
106
|
+
props.resetField("maxOutputBytes");
|
|
107
|
+
}
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region lib/types/client/shell-card-controller.js
|
|
113
|
+
/** The shell page's staged form over the composed shell executor entry. */
|
|
114
|
+
/** Profile entry id of the POSIX shell executor; the base bundle composes it off Windows. */
|
|
115
|
+
const BASH_NS = "bash-sandbox";
|
|
116
|
+
/** Profile entry id of the PowerShell executor; the base bundle composes it on Windows. */
|
|
117
|
+
const PWSH_NS = "pwsh-sandbox";
|
|
118
|
+
/** Bridges one shell executor entry's form onto the page's staged form. */
|
|
119
|
+
var ShellCardController = class {
|
|
120
|
+
form;
|
|
121
|
+
store;
|
|
122
|
+
/** @param scope - the shared configuration form of the composed shell executor entry. */
|
|
123
|
+
constructor(scope) {
|
|
124
|
+
this.form = new _deepseek_ai_dsh_client_ui_primitives.SettingsFormModel(scope, [(0, _deepseek_ai_dsh_client_ui_primitives.settingsNumberField)("timeoutMs"), (0, _deepseek_ai_dsh_client_ui_primitives.settingsNumberField)("maxOutputBytes")]);
|
|
125
|
+
this.store = this.form.bind(() => this.projection());
|
|
126
|
+
}
|
|
127
|
+
projection() {
|
|
128
|
+
return {
|
|
129
|
+
...this.form.shell(),
|
|
130
|
+
timeoutMs: this.form.field("timeoutMs"),
|
|
131
|
+
maxOutputBytes: this.form.field("maxOutputBytes")
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Build the face the page's slot registration injects.
|
|
136
|
+
* @returns the page's snapshot and its form actions.
|
|
137
|
+
*/
|
|
138
|
+
inject() {
|
|
139
|
+
return {
|
|
140
|
+
hooks: { shellCard: this.store },
|
|
141
|
+
...this.form.actions()
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/** Release the form subscription. */
|
|
145
|
+
dispose() {
|
|
146
|
+
this.form.dispose();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region lib/types/client/index.js
|
|
151
|
+
/**
|
|
152
|
+
* The shell executor's settings page, browser half: the command timeout and
|
|
153
|
+
* the per-stream output cap over the `shell` namespace the executor
|
|
154
|
+
* registers. The page registers into the Plugins page's `plugins.item` slot
|
|
155
|
+
* while the Host serves that namespace, so a deployment without a local shell
|
|
156
|
+
* executor shows no trace of it.
|
|
157
|
+
*/
|
|
158
|
+
/** Dictionary namespace owned by this plugin. */
|
|
159
|
+
const NS = "settings.shell";
|
|
160
|
+
/** Required services (cordis fiber inject). */
|
|
161
|
+
const inject = [
|
|
162
|
+
"slots",
|
|
163
|
+
"locale",
|
|
164
|
+
"configForms"
|
|
165
|
+
];
|
|
166
|
+
/**
|
|
167
|
+
* Mount the shell settings page while the Host serves its namespace.
|
|
168
|
+
* @param ctx - the browser plugin context.
|
|
169
|
+
*/
|
|
170
|
+
function apply(ctx) {
|
|
171
|
+
const t = ctx.locale.bind(NS);
|
|
172
|
+
ctx.effect(() => ctx.locale.register(NS, {
|
|
173
|
+
zh,
|
|
174
|
+
en
|
|
175
|
+
}), "ui-settings-shell: dictionaries");
|
|
176
|
+
const bash = new ShellCardController(ctx.configForms.get(BASH_NS));
|
|
177
|
+
const pwsh = new ShellCardController(ctx.configForms.get(PWSH_NS));
|
|
178
|
+
ctx.effect(() => () => {
|
|
179
|
+
bash.dispose();
|
|
180
|
+
pwsh.dispose();
|
|
181
|
+
}, "ui-settings-shell: form subscriptions");
|
|
182
|
+
ctx.effect(() => ctx.configForms.whileServed([BASH_NS, PWSH_NS], (served) => ctx.slots.inject("plugins.item", () => ctx.slots.register({
|
|
183
|
+
name: "plugins.item",
|
|
184
|
+
id: "shell",
|
|
185
|
+
order: 10,
|
|
186
|
+
label: () => t("title"),
|
|
187
|
+
locale: NS,
|
|
188
|
+
inject: () => (served.has("pwsh-sandbox") ? pwsh : bash).inject()
|
|
189
|
+
}, ShellCard))), "ui-settings-shell: page");
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
exports.NS = NS;
|
|
193
|
+
exports.apply = apply;
|
|
194
|
+
exports.inject = inject;
|
|
195
|
+
return module.exports;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=client.js.map
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region lib/types/index.js
|
|
2
|
+
/**
|
|
3
|
+
* Shell settings page, node half. The empty apply exists so the plugin appears
|
|
4
|
+
* in the host cordis.yml / Loader; the browser half owns the page through
|
|
5
|
+
* exports["./client"], discovered from the package.json dsh.client
|
|
6
|
+
* declaration. The `shell` namespace the page edits is registered by the
|
|
7
|
+
* shell executor, so this package registers no namespace of its own.
|
|
8
|
+
*/
|
|
9
|
+
/** Host plugin body — no host-side behavior for this surface plugin. */
|
|
10
|
+
function apply() {}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { apply };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The shell executor's settings page: the limits every command the agent runs is bound by. */
|
|
2
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { ShellCardFace } from './shell-card-controller.ts';
|
|
4
|
+
/** Props the renderer binds for the shell page. */
|
|
5
|
+
export type ShellCardProps = PropsRuntime<'plugins.item'> & PropsLocale<'settings.shell'> & InjectFace<ShellCardFace>;
|
|
6
|
+
/**
|
|
7
|
+
* Render the shell executor's one-liner or its settings form, as the Plugins page asks.
|
|
8
|
+
* @param props - the view asked for, locale copy, the form snapshot, and its actions.
|
|
9
|
+
* @returns the one-liner, or the form.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ShellCard(props: ShellCardProps): string | import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ShellCard.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell executor's settings page, browser half: the command timeout and
|
|
3
|
+
* the per-stream output cap over the `shell` namespace the executor
|
|
4
|
+
* registers. The page registers into the Plugins page's `plugins.item` slot
|
|
5
|
+
* while the Host serves that namespace, so a deployment without a local shell
|
|
6
|
+
* executor shows no trace of it.
|
|
7
|
+
*/
|
|
8
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
9
|
+
import { type ShellSettingsLocaleKey } from './locales.ts';
|
|
10
|
+
export type { ShellCardProps } from './ShellCard.tsx';
|
|
11
|
+
export type { ShellCardFace, ShellCardState, ShellSettings } from './shell-card-controller.ts';
|
|
12
|
+
export type { ShellSettingsLocaleKey } from './locales.ts';
|
|
13
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
14
|
+
interface LocaleNamespaceMap {
|
|
15
|
+
/** Shell settings page copy. */
|
|
16
|
+
'settings.shell': ShellSettingsLocaleKey;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Dictionary namespace owned by this plugin. */
|
|
20
|
+
export declare const NS = "settings.shell";
|
|
21
|
+
/** Required services (cordis fiber inject). */
|
|
22
|
+
export declare const inject: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Mount the shell settings page while the Host serves its namespace.
|
|
25
|
+
* @param ctx - the browser plugin context.
|
|
26
|
+
*/
|
|
27
|
+
export declare function apply(ctx: ClientContext): void;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Locale bundles for the shell executor's settings page. */
|
|
2
|
+
import type { SettingsFormLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
/** Locale keys the page renders. */
|
|
4
|
+
export type ShellSettingsLocaleKey = 'title' | 'description' | 'timeoutMs' | 'timeoutMsHint' | 'maxOutputBytes' | 'maxOutputBytesHint' | 'overridden' | 'reset' | 'readOnly' | 'unavailable' | 'save' | 'saving' | 'saveFailed' | 'invalidNumber';
|
|
5
|
+
/** English copy. */
|
|
6
|
+
export declare const en: Record<ShellSettingsLocaleKey, string>;
|
|
7
|
+
/** Simplified Chinese copy. */
|
|
8
|
+
export declare const zh: Record<ShellSettingsLocaleKey, string>;
|
|
9
|
+
/**
|
|
10
|
+
* The form frame's copy, read from this page's dictionary.
|
|
11
|
+
* @param t - the page's locale reader.
|
|
12
|
+
* @returns the labels the shared settings form renders.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formLabels(t: (key: ShellSettingsLocaleKey) => string): SettingsFormLabels;
|
|
15
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** The shell page's staged form over the composed shell executor entry. */
|
|
2
|
+
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
3
|
+
import { type SettingsFieldState, type SettingsFormActions, type SettingsFormScope, type SettingsFormShell } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
|
+
/** Profile entry id of the POSIX shell executor; the base bundle composes it off Windows. */
|
|
5
|
+
export declare const BASH_NS = "bash-sandbox";
|
|
6
|
+
/** Profile entry id of the PowerShell executor; the base bundle composes it on Windows. */
|
|
7
|
+
export declare const PWSH_NS = "pwsh-sandbox";
|
|
8
|
+
/** The shell fields this page edits — a subset of the served schema by design. */
|
|
9
|
+
export interface ShellSettings {
|
|
10
|
+
/** Foreground command timeout in milliseconds. */
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
/** Per-stream in-memory output cap in bytes. */
|
|
13
|
+
maxOutputBytes?: number;
|
|
14
|
+
}
|
|
15
|
+
/** What the shell page renders. */
|
|
16
|
+
export interface ShellCardState extends SettingsFormShell {
|
|
17
|
+
/** Command timeout in milliseconds. */
|
|
18
|
+
timeoutMs: SettingsFieldState;
|
|
19
|
+
/** Per-stream output cap in bytes. */
|
|
20
|
+
maxOutputBytes: SettingsFieldState;
|
|
21
|
+
}
|
|
22
|
+
/** The registration-side face the shell page's slot entry injects. */
|
|
23
|
+
export interface ShellCardFace extends SettingsFormActions {
|
|
24
|
+
hooks: {
|
|
25
|
+
/** Page snapshot bound by the renderer as useShellCard. */
|
|
26
|
+
shellCard: SnapshotStore<ShellCardState>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Bridges one shell executor entry's form onto the page's staged form. */
|
|
30
|
+
export declare class ShellCardController {
|
|
31
|
+
private readonly form;
|
|
32
|
+
private readonly store;
|
|
33
|
+
/** @param scope - the shared configuration form of the composed shell executor entry. */
|
|
34
|
+
constructor(scope: SettingsFormScope<ShellSettings>);
|
|
35
|
+
private projection;
|
|
36
|
+
/**
|
|
37
|
+
* Build the face the page's slot registration injects.
|
|
38
|
+
* @returns the page's snapshot and its form actions.
|
|
39
|
+
*/
|
|
40
|
+
inject(): ShellCardFace;
|
|
41
|
+
/** Release the form subscription. */
|
|
42
|
+
dispose(): void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=shell-card-controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell settings page, node half. The empty apply exists so the plugin appears
|
|
3
|
+
* in the host cordis.yml / Loader; the browser half owns the page through
|
|
4
|
+
* exports["./client"], discovered from the package.json dsh.client
|
|
5
|
+
* declaration. The `shell` namespace the page edits is registered by the
|
|
6
|
+
* shell executor, so this package registers no namespace of its own.
|
|
7
|
+
*/
|
|
8
|
+
/** Host plugin body — no host-side behavior for this surface plugin. */
|
|
9
|
+
export declare function apply(): void;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-client-ui-settings-shell",
|
|
3
|
+
"description": "Settings page of the shell executor on the dsh web client's Plugins page: the command timeout and the per-stream output cap of the shell namespace",
|
|
4
|
+
"version": "0.1.7-alpha.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/client/ui-settings-shell"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./client": {
|
|
22
|
+
"types": "./lib/types/client/index.d.ts",
|
|
23
|
+
"default": "./lib/client.js"
|
|
24
|
+
},
|
|
25
|
+
"./src/*": "./src/*",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"dsh": {
|
|
29
|
+
"client": {
|
|
30
|
+
"inject": [
|
|
31
|
+
"@deepseek-ai/dsh-client-locale",
|
|
32
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager"
|
|
34
|
+
],
|
|
35
|
+
"platform": "web"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@deepseek-ai/cordis": "^4.0.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/react": "~18.3.1",
|
|
44
|
+
"react": "^18.2.0",
|
|
45
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
46
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.7-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.7-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.7-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.7-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-alpha.1"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"lib/index.js",
|
|
58
|
+
"lib/client.js",
|
|
59
|
+
"lib/types/**/*.d.ts"
|
|
60
|
+
],
|
|
61
|
+
"scripts": {
|
|
62
|
+
"bundle": "tsdown",
|
|
63
|
+
"watch": "tsdown --watch"
|
|
64
|
+
}
|
|
65
|
+
}
|