dsh-bash-terminal-ts 0.6.2 → 0.6.3

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.
@@ -44,7 +44,8 @@ var zh = {
44
44
  "shell.powershell": "PowerShell",
45
45
  "shell.gitbash": "Git Bash",
46
46
  "shell.msys2": "MSYS2",
47
- "shell.wsl": "WSL"
47
+ "shell.wsl": "WSL",
48
+ "shell.unavailable": "\u8BBE\u7F6E\u9762\u4E0D\u53EF\u7528\uFF1A\u5BBF\u4E3B\u672A\u63D0\u4F9B\u672C\u63D2\u4EF6\u7684 configForms \u6761\u76EE\uFF08\u68C0\u67E5 cordis.patch.yml \u7684 entry id\uFF09"
48
49
  };
49
50
  var en = {
50
51
  "shell.title": "Default terminal",
@@ -52,14 +53,22 @@ var en = {
52
53
  "shell.powershell": "PowerShell",
53
54
  "shell.gitbash": "Git Bash",
54
55
  "shell.msys2": "MSYS2",
55
- "shell.wsl": "WSL"
56
+ "shell.wsl": "WSL",
57
+ "shell.unavailable": "Settings unavailable: the host exposes no configForms entry for this plugin (check the cordis.patch.yml entry id)"
56
58
  };
57
59
  var inject = ["slots", "locale", "configForms"];
58
60
  function ShellPreferenceRow({ t, useStore, setShell }) {
59
61
  const shell = useStore((s) => s.shell);
60
62
  const writable = useStore((s) => s.writable);
63
+ const status = useStore((s) => s.status);
61
64
  const [open, setOpen] = (0, import_react.useState)(false);
62
65
  const items = SHELLS.map((id) => ({ id, label: t("shell." + id) }));
66
+ if (status === "unavailable") {
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btRow", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRowText", children: [
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btTitle", children: t("shell.title") }),
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btDesc", children: t("shell.unavailable") })
70
+ ] }) });
71
+ }
63
72
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRow", children: [
64
73
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRowText", children: [
65
74
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btTitle", children: t("shell.title") }),
@@ -103,19 +112,20 @@ function apply(ctx) {
103
112
  ctx.effect(() => ctx.locale.register(SETTINGS_NS, { zh, en }), "bash-terminal: settings dictionaries");
104
113
  const scope = ctx.configForms.get(ENTRY_ID);
105
114
  const store = (0, import_dsh_client_store.defineStore)({
106
- init: () => ({ shell: "powershell", revision: -1, writable: false }),
115
+ init: () => ({ shell: "powershell", revision: -1, writable: false, status: "loading" }),
107
116
  actions: {
108
- sync: (d, shell, revision, writable) => {
117
+ sync: (d, shell, revision, writable, status) => {
109
118
  if (revision !== void 0 && revision <= d.revision) return;
110
119
  if (shell !== void 0) d.shell = shell;
111
120
  if (revision !== void 0) d.revision = revision;
112
121
  if (writable !== void 0) d.writable = writable;
122
+ if (status !== void 0) d.status = status;
113
123
  }
114
124
  }
115
125
  });
116
126
  let bound;
117
127
  const push = (snap) => {
118
- bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable);
128
+ bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable, snap.status);
119
129
  };
120
130
  ctx.slots.inject(
121
131
  "dsh-family.tab",
package/dist/client.js CHANGED
@@ -49,7 +49,8 @@ var zh = {
49
49
  "shell.powershell": "PowerShell",
50
50
  "shell.gitbash": "Git Bash",
51
51
  "shell.msys2": "MSYS2",
52
- "shell.wsl": "WSL"
52
+ "shell.wsl": "WSL",
53
+ "shell.unavailable": "\u8BBE\u7F6E\u9762\u4E0D\u53EF\u7528\uFF1A\u5BBF\u4E3B\u672A\u63D0\u4F9B\u672C\u63D2\u4EF6\u7684 configForms \u6761\u76EE\uFF08\u68C0\u67E5 cordis.patch.yml \u7684 entry id\uFF09"
53
54
  };
54
55
  var en = {
55
56
  "shell.title": "Default terminal",
@@ -57,14 +58,22 @@ var en = {
57
58
  "shell.powershell": "PowerShell",
58
59
  "shell.gitbash": "Git Bash",
59
60
  "shell.msys2": "MSYS2",
60
- "shell.wsl": "WSL"
61
+ "shell.wsl": "WSL",
62
+ "shell.unavailable": "Settings unavailable: the host exposes no configForms entry for this plugin (check the cordis.patch.yml entry id)"
61
63
  };
62
64
  var inject = ["slots", "locale", "configForms"];
63
65
  function ShellPreferenceRow({ t, useStore, setShell }) {
64
66
  const shell = useStore((s) => s.shell);
65
67
  const writable = useStore((s) => s.writable);
68
+ const status = useStore((s) => s.status);
66
69
  const [open, setOpen] = (0, import_react.useState)(false);
67
70
  const items = SHELLS.map((id) => ({ id, label: t("shell." + id) }));
71
+ if (status === "unavailable") {
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btRow", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRowText", children: [
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btTitle", children: t("shell.title") }),
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btDesc", children: t("shell.unavailable") })
75
+ ] }) });
76
+ }
68
77
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRow", children: [
69
78
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRowText", children: [
70
79
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btTitle", children: t("shell.title") }),
@@ -108,19 +117,20 @@ function apply(ctx) {
108
117
  ctx.effect(() => ctx.locale.register(SETTINGS_NS, { zh, en }), "bash-terminal: settings dictionaries");
109
118
  const scope = ctx.configForms.get(ENTRY_ID);
110
119
  const store = (0, import_dsh_client_store.defineStore)({
111
- init: () => ({ shell: "powershell", revision: -1, writable: false }),
120
+ init: () => ({ shell: "powershell", revision: -1, writable: false, status: "loading" }),
112
121
  actions: {
113
- sync: (d, shell, revision, writable) => {
122
+ sync: (d, shell, revision, writable, status) => {
114
123
  if (revision !== void 0 && revision <= d.revision) return;
115
124
  if (shell !== void 0) d.shell = shell;
116
125
  if (revision !== void 0) d.revision = revision;
117
126
  if (writable !== void 0) d.writable = writable;
127
+ if (status !== void 0) d.status = status;
118
128
  }
119
129
  }
120
130
  });
121
131
  let bound;
122
132
  const push = (snap) => {
123
- bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable);
133
+ bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable, snap.status);
124
134
  };
125
135
  ctx.slots.inject(
126
136
  "dsh-family.tab",
package/dsh.plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "dsh-bash-terminal",
3
3
  "name": "dsh-bash-terminal",
4
- "version": "0.6.1",
4
+ "version": "0.6.3",
5
5
  "description": {
6
6
  "en": "One shell tool that runs commands through PowerShell, Git Bash, MSYS2 or WSL on Windows, with a user-chosen default terminal in the Web UI settings.",
7
7
  "zh": "一个 shell 工具,可在 Windows 上通过 PowerShell / Git Bash / MSYS2 / WSL 执行命令,默认终端在 Web UI 设置中选择。"
package/lib/client.js CHANGED
@@ -49,7 +49,8 @@ var zh = {
49
49
  "shell.powershell": "PowerShell",
50
50
  "shell.gitbash": "Git Bash",
51
51
  "shell.msys2": "MSYS2",
52
- "shell.wsl": "WSL"
52
+ "shell.wsl": "WSL",
53
+ "shell.unavailable": "\u8BBE\u7F6E\u9762\u4E0D\u53EF\u7528\uFF1A\u5BBF\u4E3B\u672A\u63D0\u4F9B\u672C\u63D2\u4EF6\u7684 configForms \u6761\u76EE\uFF08\u68C0\u67E5 cordis.patch.yml \u7684 entry id\uFF09"
53
54
  };
54
55
  var en = {
55
56
  "shell.title": "Default terminal",
@@ -57,14 +58,22 @@ var en = {
57
58
  "shell.powershell": "PowerShell",
58
59
  "shell.gitbash": "Git Bash",
59
60
  "shell.msys2": "MSYS2",
60
- "shell.wsl": "WSL"
61
+ "shell.wsl": "WSL",
62
+ "shell.unavailable": "Settings unavailable: the host exposes no configForms entry for this plugin (check the cordis.patch.yml entry id)"
61
63
  };
62
64
  var inject = ["slots", "locale", "configForms"];
63
65
  function ShellPreferenceRow({ t, useStore, setShell }) {
64
66
  const shell = useStore((s) => s.shell);
65
67
  const writable = useStore((s) => s.writable);
68
+ const status = useStore((s) => s.status);
66
69
  const [open, setOpen] = (0, import_react.useState)(false);
67
70
  const items = SHELLS.map((id) => ({ id, label: t("shell." + id) }));
71
+ if (status === "unavailable") {
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btRow", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRowText", children: [
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btTitle", children: t("shell.title") }),
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btDesc", children: t("shell.unavailable") })
75
+ ] }) });
76
+ }
68
77
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRow", children: [
69
78
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "btRowText", children: [
70
79
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btTitle", children: t("shell.title") }),
@@ -108,19 +117,20 @@ function apply(ctx) {
108
117
  ctx.effect(() => ctx.locale.register(SETTINGS_NS, { zh, en }), "bash-terminal: settings dictionaries");
109
118
  const scope = ctx.configForms.get(ENTRY_ID);
110
119
  const store = (0, import_dsh_client_store.defineStore)({
111
- init: () => ({ shell: "powershell", revision: -1, writable: false }),
120
+ init: () => ({ shell: "powershell", revision: -1, writable: false, status: "loading" }),
112
121
  actions: {
113
- sync: (d, shell, revision, writable) => {
122
+ sync: (d, shell, revision, writable, status) => {
114
123
  if (revision !== void 0 && revision <= d.revision) return;
115
124
  if (shell !== void 0) d.shell = shell;
116
125
  if (revision !== void 0) d.revision = revision;
117
126
  if (writable !== void 0) d.writable = writable;
127
+ if (status !== void 0) d.status = status;
118
128
  }
119
129
  }
120
130
  });
121
131
  let bound;
122
132
  const push = (snap) => {
123
- bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable);
133
+ bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable, snap.status);
124
134
  };
125
135
  ctx.slots.inject(
126
136
  "dsh-family.tab",
package/package.json CHANGED
@@ -1,119 +1,119 @@
1
- {
2
- "name": "dsh-bash-terminal-ts",
3
- "version": "0.6.2",
4
- "publishConfig": {
5
- "tag": "dsh-0.1.7"
6
- },
7
- "description": "DSH plugin: one shell tool that runs commands through PowerShell, Git Bash, MSYS2, or WSL on Windows, with a user-chosen default terminal in the Web UI settings. TypeScript rewrite of MAXeaglet/dsh-bash-terminal with working MSYS2/MINGW64 support.",
8
- "author": "drscrewdriver",
9
- "license": "MIT",
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/drscrewdriver/dsh-bash-terminal-ts.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/drscrewdriver/dsh-bash-terminal-ts/issues"
16
- },
17
- "homepage": "https://github.com/drscrewdriver/dsh-bash-terminal-ts#readme",
18
- "keywords": [
19
- "deepseek-harness",
20
- "dsh",
21
- "plugin",
22
- "terminal",
23
- "shell",
24
- "powershell",
25
- "git-bash",
26
- "wsl",
27
- "windows",
28
- "typescript"
29
- ],
30
- "engines": {
31
- "node": ">=22",
32
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
33
- },
34
- "type": "module",
35
- "main": "lib/index.js",
36
- "exports": {
37
- ".": "./lib/index.js",
38
- "./client": "./lib/client.js",
39
- "./package.json": "./package.json"
40
- },
41
- "files": [
42
- "lib",
43
- "dist",
44
- "src",
45
- "scripts",
46
- "template",
47
- "tsconfig.json",
48
- "tsconfig.client.json",
49
- "tsconfig.test.json",
50
- "README.md",
51
- "LICENSE",
52
- "cordis.patch.yml",
53
- "dsh.plugin.json",
54
- "screenshots.json"
55
- ],
56
- "scripts": {
57
- "build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && node scripts/build-client.mjs && tsc -p tsconfig.test.json",
58
- "build:client": "node scripts/build-client.mjs",
59
- "test": "node test-dist/unit.js && node test-dist/apply.js && node test-dist/client.js && node test-dist/terminal.js"
60
- },
61
- "dsh": {
62
- "bundle": {
63
- "patch": "./cordis.patch.yml"
64
- },
65
- "client": {
66
- "platform": "web",
67
- "immediately": true,
68
- "inject": [
69
- "@deepseek-ai/dsh-client-locale",
70
- "@deepseek-ai/dsh-client-ui-settings",
71
- "@deepseek-ai/dsh-api-remotes"
72
- ]
73
- }
74
- },
75
- "peerDependencies": {
76
- "@deepseek-ai/cordis": "^4.0.2",
77
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
78
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.1.8-0",
79
- "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1 <0.1.8-0",
80
- "@deepseek-ai/dsh-shell": ">=0.1.7-rc.1 <0.1.8-0",
81
- "@deepseek-ai/dsh-sandbox": ">=0.1.7-rc.1 <0.1.8-0",
82
- "@deepseek-ai/dsh-timeout": ">=0.1.7-rc.1 <0.1.8-0",
83
- "@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.1.8-0",
84
- "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0",
85
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.1 <0.1.8-0",
86
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.1.8-0",
87
- "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.7-rc.1 <0.1.8-0",
88
- "react": "^18.2.0"
89
- },
90
- "dependencies": {
91
- "@deepseek-ai/schemastery": "^3.18.4",
92
- "node-pty": "^1.1.0"
93
- },
94
- "devDependencies": {
95
- "@deepseek-ai/cordis": "^4.0.2",
96
- "@deepseek-ai/dsh-client-locale": "0.1.7-rc.2",
97
- "@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
98
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
99
- "@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.2",
100
- "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
101
- "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
102
- "@deepseek-ai/dsh-sandbox": "0.1.7-rc.2",
103
- "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
104
- "@deepseek-ai/dsh-shell": "0.1.7-rc.2",
105
- "@deepseek-ai/dsh-timeout": "0.1.7-rc.2",
106
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
107
- "@types/node": "^22.10.0",
108
- "@types/react": "^18.2.0",
109
- "@types/react-dom": "^18.2.0",
110
- "esbuild": "^0.28.2",
111
- "react": "^18.2.0",
112
- "react-dom": "^18.2.0",
113
- "typescript": "^5.9.0",
114
- "@deepseek-ai/dsh-scope": "0.1.7-rc.2",
115
- "@deepseek-ai/dsh-subprocess": "0.1.7-rc.2",
116
- "@deepseek-ai/dsh-sandbox-policy": "0.1.7-rc.2",
117
- "@deepseek-ai/dsh-http-proxy": "0.1.7-rc.2"
118
- }
119
- }
1
+ {
2
+ "name": "dsh-bash-terminal-ts",
3
+ "version": "0.6.3",
4
+ "publishConfig": {
5
+ "tag": "dsh-0.1.7"
6
+ },
7
+ "description": "DSH plugin: one shell tool that runs commands through PowerShell, Git Bash, MSYS2, or WSL on Windows, with a user-chosen default terminal in the Web UI settings. TypeScript rewrite of MAXeaglet/dsh-bash-terminal with working MSYS2/MINGW64 support.",
8
+ "author": "drscrewdriver",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/drscrewdriver/dsh-bash-terminal-ts.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/drscrewdriver/dsh-bash-terminal-ts/issues"
16
+ },
17
+ "homepage": "https://github.com/drscrewdriver/dsh-bash-terminal-ts#readme",
18
+ "keywords": [
19
+ "deepseek-harness",
20
+ "dsh",
21
+ "plugin",
22
+ "terminal",
23
+ "shell",
24
+ "powershell",
25
+ "git-bash",
26
+ "wsl",
27
+ "windows",
28
+ "typescript"
29
+ ],
30
+ "engines": {
31
+ "node": ">=22",
32
+ "dsh": ">=0.1.7-rc.1 <0.1.8-0"
33
+ },
34
+ "type": "module",
35
+ "main": "lib/index.js",
36
+ "exports": {
37
+ ".": "./lib/index.js",
38
+ "./client": "./lib/client.js",
39
+ "./package.json": "./package.json"
40
+ },
41
+ "files": [
42
+ "lib",
43
+ "dist",
44
+ "src",
45
+ "scripts",
46
+ "template",
47
+ "tsconfig.json",
48
+ "tsconfig.client.json",
49
+ "tsconfig.test.json",
50
+ "README.md",
51
+ "LICENSE",
52
+ "cordis.patch.yml",
53
+ "dsh.plugin.json",
54
+ "screenshots.json"
55
+ ],
56
+ "scripts": {
57
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && node scripts/build-client.mjs && tsc -p tsconfig.test.json",
58
+ "build:client": "node scripts/build-client.mjs",
59
+ "test": "node test-dist/unit.js && node test-dist/apply.js && node test-dist/client.js && node test-dist/terminal.js"
60
+ },
61
+ "dsh": {
62
+ "bundle": {
63
+ "patch": "./cordis.patch.yml"
64
+ },
65
+ "client": {
66
+ "platform": "web",
67
+ "immediately": true,
68
+ "inject": [
69
+ "@deepseek-ai/dsh-client-locale",
70
+ "@deepseek-ai/dsh-client-ui-settings",
71
+ "@deepseek-ai/dsh-api-remotes"
72
+ ]
73
+ }
74
+ },
75
+ "peerDependencies": {
76
+ "@deepseek-ai/cordis": "^4.0.2",
77
+ "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
78
+ "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.1.8-0",
79
+ "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1 <0.1.8-0",
80
+ "@deepseek-ai/dsh-shell": ">=0.1.7-rc.1 <0.1.8-0",
81
+ "@deepseek-ai/dsh-sandbox": ">=0.1.7-rc.1 <0.1.8-0",
82
+ "@deepseek-ai/dsh-timeout": ">=0.1.7-rc.1 <0.1.8-0",
83
+ "@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.1.8-0",
84
+ "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0",
85
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.1 <0.1.8-0",
86
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.1.8-0",
87
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.7-rc.1 <0.1.8-0",
88
+ "react": "^18.2.0"
89
+ },
90
+ "dependencies": {
91
+ "@deepseek-ai/schemastery": "^3.18.4",
92
+ "node-pty": "^1.1.0"
93
+ },
94
+ "devDependencies": {
95
+ "@deepseek-ai/cordis": "^4.0.2",
96
+ "@deepseek-ai/dsh-client-locale": "0.1.7-rc.2",
97
+ "@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
98
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
99
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.2",
100
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
101
+ "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
102
+ "@deepseek-ai/dsh-sandbox": "0.1.7-rc.2",
103
+ "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
104
+ "@deepseek-ai/dsh-shell": "0.1.7-rc.2",
105
+ "@deepseek-ai/dsh-timeout": "0.1.7-rc.2",
106
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
107
+ "@types/node": "^22.10.0",
108
+ "@types/react": "^18.2.0",
109
+ "@types/react-dom": "^18.2.0",
110
+ "esbuild": "^0.28.2",
111
+ "react": "^18.2.0",
112
+ "react-dom": "^18.2.0",
113
+ "typescript": "^5.9.0",
114
+ "@deepseek-ai/dsh-scope": "0.1.7-rc.2",
115
+ "@deepseek-ai/dsh-subprocess": "0.1.7-rc.2",
116
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.7-rc.2",
117
+ "@deepseek-ai/dsh-http-proxy": "0.1.7-rc.2"
118
+ }
119
+ }
package/src/client.tsx CHANGED
@@ -45,7 +45,8 @@ const zh: Record<string, string> = {
45
45
  "shell.powershell": "PowerShell",
46
46
  "shell.gitbash": "Git Bash",
47
47
  "shell.msys2": "MSYS2",
48
- "shell.wsl": "WSL"
48
+ "shell.wsl": "WSL",
49
+ "shell.unavailable": "设置面不可用:宿主未提供本插件的 configForms 条目(检查 cordis.patch.yml 的 entry id)"
49
50
  };
50
51
  const en: Record<string, string> = {
51
52
  "shell.title": "Default terminal",
@@ -53,7 +54,8 @@ const en: Record<string, string> = {
53
54
  "shell.powershell": "PowerShell",
54
55
  "shell.gitbash": "Git Bash",
55
56
  "shell.msys2": "MSYS2",
56
- "shell.wsl": "WSL"
57
+ "shell.wsl": "WSL",
58
+ "shell.unavailable": "Settings unavailable: the host exposes no configForms entry for this plugin (check the cordis.patch.yml entry id)"
57
59
  };
58
60
 
59
61
  export const inject = ["slots", "locale", "configForms"];
@@ -63,6 +65,7 @@ interface RowState {
63
65
  shell: string;
64
66
  revision: number;
65
67
  writable: boolean;
68
+ status: "loading" | "ready" | "unavailable";
66
69
  }
67
70
 
68
71
  interface ShellPreferenceRowProps {
@@ -74,8 +77,19 @@ interface ShellPreferenceRowProps {
74
77
  function ShellPreferenceRow({ t, useStore, setShell }: ShellPreferenceRowProps) {
75
78
  const shell = useStore((s) => s.shell);
76
79
  const writable = useStore((s) => s.writable);
80
+ const status = useStore((s) => s.status);
77
81
  const [open, setOpen] = useState(false);
78
82
  const items = SHELLS.map((id) => ({ id, label: t("shell." + id) }));
83
+ if (status === "unavailable") {
84
+ return (
85
+ <div className="btRow">
86
+ <div className="btRowText">
87
+ <div className="btTitle">{t("shell.title")}</div>
88
+ <div className="btDesc">{t("shell.unavailable")}</div>
89
+ </div>
90
+ </div>
91
+ );
92
+ }
79
93
  return (
80
94
  <div className="btRow">
81
95
  <div className="btRowText">
@@ -137,7 +151,7 @@ interface ClientContext {
137
151
  }
138
152
 
139
153
  interface RowStoreActions {
140
- sync(shell?: string, revision?: number, writable?: boolean): void;
154
+ sync(shell?: string, revision?: number, writable?: boolean, status?: RowState["status"]): void;
141
155
  }
142
156
 
143
157
  interface RowStore {
@@ -150,20 +164,21 @@ const zhDictTitle = (): string => (zh as Record<string, string>)["shell.title"]
150
164
  export function apply(ctx: ClientContext): void {
151
165
  ctx.effect(() => ctx.locale.register(SETTINGS_NS, { zh, en }), "bash-terminal: settings dictionaries");
152
166
  const scope = ctx.configForms.get(ENTRY_ID);
153
- const store = defineStore<RowState, { sync: (draft: RowState, shell?: string, revision?: number, writable?: boolean) => void }>({
154
- init: (): RowState => ({ shell: "powershell", revision: -1, writable: false }),
167
+ const store = defineStore<RowState, { sync: (draft: RowState, shell?: string, revision?: number, writable?: boolean, status?: RowState["status"]) => void }>({
168
+ init: (): RowState => ({ shell: "powershell", revision: -1, writable: false, status: "loading" }),
155
169
  actions: {
156
- sync: (d, shell, revision, writable) => {
170
+ sync: (d, shell, revision, writable, status) => {
157
171
  if (revision !== undefined && revision <= d.revision) return;
158
172
  if (shell !== undefined) d.shell = shell;
159
173
  if (revision !== undefined) d.revision = revision;
160
174
  if (writable !== undefined) d.writable = writable;
175
+ if (status !== undefined) d.status = status;
161
176
  }
162
177
  }
163
178
  });
164
179
  let bound: RowStoreActions | undefined;
165
180
  const push = (snap: SettingsSnapshot): void => {
166
- bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable);
181
+ bound?.sync(snap.value?.defaultShell, snap.revision, snap.writable, snap.status);
167
182
  };
168
183
  // 插件族共用设置 tab(dsh-thinking-levels 顶级「起子插件设置」节声明该子席位)。
169
184
  // thinking-levels 缺席时本 inject 静默等待,不阻塞客户端半。