@dsh-workbench/shared 0.1.1 → 0.1.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.
- package/dist/api/workbench-contract.d.ts +1 -1
- package/dist/components/ApprovalDetail.css +4 -0
- package/dist/components/ApprovalDetail.d.ts +1 -0
- package/dist/components/ApprovalDetail.js +5 -1
- package/dist/components/CardHead.css +92 -0
- package/dist/components/CardHead.d.ts +1 -0
- package/dist/components/CardHead.js +9 -7
- package/dist/components/ChoiceGroup.css +75 -0
- package/dist/components/ChoiceGroup.d.ts +1 -0
- package/dist/components/ChoiceGroup.js +1 -0
- package/dist/components/LongTaskRow.css +53 -0
- package/dist/components/LongTaskRow.d.ts +3 -0
- package/dist/components/LongTaskRow.js +11 -11
- package/dist/components/MockStrip.css +39 -0
- package/dist/components/MockStrip.d.ts +1 -0
- package/dist/components/MockStrip.js +1 -0
- package/dist/components/ResourceStates.css +111 -0
- package/dist/components/ResourceStates.d.ts +2 -1
- package/dist/components/ResourceStates.js +1 -0
- package/dist/components/SaveBar.css +7 -0
- package/dist/components/SaveBar.d.ts +1 -0
- package/dist/components/SaveBar.js +4 -2
- package/dist/components/TextField.css +22 -0
- package/dist/components/TextField.d.ts +6 -0
- package/dist/components/TextField.js +5 -0
- package/dist/components/icons.d.ts +0 -12
- package/dist/components/icons.js +0 -61
- package/dist/host/http.js +5 -29
- package/dist/host/provision.d.ts +18 -1
- package/dist/host/provision.js +73 -0
- package/dist/host.d.ts +6 -0
- package/dist/host.js +6 -0
- package/dist/i18n/en.js +126 -1
- package/dist/i18n/index.d.ts +129 -4
- package/dist/i18n/zh.d.ts +128 -3
- package/dist/i18n/zh.js +128 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -3
- package/src/api/workbench-contract.ts +5 -1
- package/src/components/ApprovalDetail.css +4 -0
- package/src/components/ApprovalDetail.tsx +11 -1
- package/src/components/CardHead.css +92 -0
- package/src/components/CardHead.tsx +43 -31
- package/src/components/ChoiceGroup.css +75 -0
- package/src/components/ChoiceGroup.tsx +1 -0
- package/src/components/LongTaskRow.css +53 -0
- package/src/components/LongTaskRow.tsx +52 -13
- package/src/components/MockStrip.css +39 -0
- package/src/components/MockStrip.tsx +1 -0
- package/src/components/ResourceStates.css +111 -0
- package/src/components/ResourceStates.tsx +2 -1
- package/src/components/SaveBar.css +7 -0
- package/src/components/SaveBar.tsx +8 -5
- package/src/components/TextField.css +22 -0
- package/src/components/TextField.tsx +17 -0
- package/src/components/icons.tsx +0 -164
- package/src/host/__tests__/provision.test.ts +90 -0
- package/src/host/http.ts +5 -33
- package/src/host/provision.ts +87 -0
- package/src/host.ts +6 -0
- package/src/i18n/en.ts +127 -1
- package/src/i18n/zh.ts +128 -4
- package/src/index.ts +1 -1
- package/dist/components/StateDot.d.ts +0 -5
- package/dist/components/StateDot.js +0 -10
- package/dist/host/__tests__/fakes.d.ts +0 -41
- package/dist/host/__tests__/fakes.js +0 -76
- package/dist/host/__tests__/preflight-fixtures.d.ts +0 -19
- package/dist/host/__tests__/preflight-fixtures.js +0 -47
- package/dist/host/context-inject.d.ts +0 -24
- package/dist/host/context-inject.js +0 -74
- package/dist/host/events.d.ts +0 -9
- package/dist/host/events.js +0 -70
- package/dist/host/mount-units.d.ts +0 -52
- package/dist/host/mount-units.js +0 -186
- package/dist/host/preflight.d.ts +0 -58
- package/dist/host/preflight.js +0 -233
- package/dist/host/probe-cache.d.ts +0 -6
- package/dist/host/probe-cache.js +0 -19
- package/dist/host/probe-libs.d.ts +0 -45
- package/dist/host/probe-libs.js +0 -61
- package/dist/host/probe-units.d.ts +0 -17
- package/dist/host/probe-units.js +0 -102
- package/dist/host/probe-verdict.d.ts +0 -7
- package/dist/host/probe-verdict.js +0 -143
- package/dist/host/tool-scope.d.ts +0 -32
- package/dist/host/tool-scope.js +0 -84
- package/dist/host/unit-readiness.d.ts +0 -7
- package/dist/host/unit-readiness.js +0 -5
- package/dist/host/unit-registry.d.ts +0 -9
- package/dist/host/unit-registry.js +0 -33
- package/dist/host/version-range.d.ts +0 -2
- package/dist/host/version-range.js +0 -73
- package/src/components/StateDot.tsx +0 -31
package/dist/i18n/zh.d.ts
CHANGED
|
@@ -63,18 +63,23 @@ export declare const zh: {
|
|
|
63
63
|
readonly 'panels.market.install': "安装";
|
|
64
64
|
readonly 'panels.market.update': "更新";
|
|
65
65
|
readonly 'panels.market.uninstall': "卸载";
|
|
66
|
+
readonly 'panels.market.uninstallLabel': "卸载 {name}";
|
|
66
67
|
readonly 'panels.market.installing': "正在安装…";
|
|
67
68
|
readonly 'panels.market.updating': "正在更新…";
|
|
68
69
|
readonly 'panels.market.uninstalling': "正在卸载…";
|
|
69
|
-
readonly 'panels.market.
|
|
70
|
-
readonly 'panels.market.confirmUninstallDetail': "
|
|
71
|
-
readonly 'panels.market.
|
|
70
|
+
readonly 'panels.market.confirmUninstallTitle': "卸载「{name}」?";
|
|
71
|
+
readonly 'panels.market.confirmUninstallDetail': "卸载后它提供的功能会消失。";
|
|
72
|
+
readonly 'panels.market.confirmUninstallAck': "我明白:卸载后想再用,得重新装一遍。";
|
|
73
|
+
readonly 'panels.market.confirmYes': "卸载";
|
|
72
74
|
readonly 'panels.market.confirmNo': "取消";
|
|
73
75
|
readonly 'panels.market.failed': "没成功:{reason}";
|
|
74
76
|
readonly 'panels.market.needEnv': "先在启动工作台的终端里设 {env}";
|
|
75
77
|
readonly 'panels.market.noSource': "这个模块没声明怎么装,只能自己动手";
|
|
76
78
|
readonly 'panels.market.badSource': "安装方式没写全,只能自己动手";
|
|
77
79
|
readonly 'panels.market.empty': "暂无可用模块";
|
|
80
|
+
readonly 'panels.market.installedSection': "已装";
|
|
81
|
+
readonly 'panels.market.moduleUpdate': "有新版 {version}:安装完成后可能需要重启才生效。";
|
|
82
|
+
readonly 'panels.market.restartNeeded': "新版装好了,重启一次才生效。";
|
|
78
83
|
readonly 'panels.market.foot': "装好后到那个项目的面板页勾选它,模块才会出现。";
|
|
79
84
|
readonly 'panels.market.recheck': "重新检查更新";
|
|
80
85
|
readonly 'panels.market.checkUpdates': "检查更新";
|
|
@@ -82,6 +87,126 @@ export declare const zh: {
|
|
|
82
87
|
readonly 'panels.market.justNow': "刚刚";
|
|
83
88
|
readonly 'panels.market.minutesAgo': "{n} 分钟前";
|
|
84
89
|
readonly 'panels.market.hoursAgo': "{n} 小时前";
|
|
90
|
+
readonly 'panels.market.add.description': "输入模块的包名、Git 仓库地址或本地目录路径。";
|
|
91
|
+
readonly 'panels.market.add.specPlaceholder': "例如 @dsh-workbench/module-hello";
|
|
92
|
+
readonly 'panels.market.add.guideToggle': "模块安装引导和示例";
|
|
93
|
+
readonly 'panels.market.add.guideHide': "收起引导";
|
|
94
|
+
readonly 'panels.market.add.guideIdTitle': "包名";
|
|
95
|
+
readonly 'panels.market.add.guideIdExample': "@dsh-workbench/module-hello";
|
|
96
|
+
readonly 'panels.market.add.guideIdHint': "模块包名即 npm 包名(如 dsh-workbench-module-xxx 或 @作者/模块名),社区模块的 README 安装命令中 dsh plugin add 或 pnpm add 之后的部分。";
|
|
97
|
+
readonly 'panels.market.add.guideGitTitle': "Git 仓库地址";
|
|
98
|
+
readonly 'panels.market.add.guideGitExample': "https://github.com/author/dsh-workbench-module-x";
|
|
99
|
+
readonly 'panels.market.add.guideGitHint': "模块在 GitHub 上的开源仓库地址,也支持其他 Git 仓库。";
|
|
100
|
+
readonly 'panels.market.add.guidePathTitle': "本地模块目录";
|
|
101
|
+
readonly 'panels.market.add.guidePathExample': "/Users/name/my-workbench-module";
|
|
102
|
+
readonly 'panels.market.add.guidePathHint': "本机上模块目录的绝对路径,适用于自行开发或已下载的模块。";
|
|
103
|
+
readonly 'panels.market.add.guideExampleLabel': "示例:";
|
|
104
|
+
readonly 'panels.market.add.guideFill': "填入示例";
|
|
105
|
+
readonly 'panels.market.add.guideSafety': "请确认模块来源可信。模块在本机以你的权限运行,来源不明的模块可能损坏工作台,或读取和泄露你的数据。";
|
|
106
|
+
readonly 'panels.market.add.registryLegend': "从哪个 npm 源下载模块";
|
|
107
|
+
readonly 'panels.market.add.registryOfficial': "npm 官方源";
|
|
108
|
+
readonly 'panels.market.add.registryMirror': "中国大陆镜像源";
|
|
109
|
+
readonly 'panels.market.add.registryWithHost': "{name}({host})";
|
|
110
|
+
readonly 'panels.market.add.registryToggle': "安装源";
|
|
111
|
+
readonly 'panels.market.add.installVersion': "版本 {version}";
|
|
112
|
+
readonly 'panels.market.add.registryDefault': "默认安装源";
|
|
113
|
+
readonly 'panels.market.add.registryCustom': "自定义地址";
|
|
114
|
+
readonly 'panels.market.add.registryCustomPlaceholder': "https://npm.example.com/";
|
|
115
|
+
readonly 'panels.market.add.registryCustomHint': "公司内网或私有 npm 源;需要登录的源,把凭据放在本机的 ~/.npmrc 里";
|
|
116
|
+
readonly 'panels.market.add.registryCustomInvalid': "请输入以 http:// 或 https:// 开头的地址";
|
|
117
|
+
readonly 'panels.market.add.run': "安装";
|
|
118
|
+
readonly 'panels.market.add.edit': "编辑";
|
|
119
|
+
readonly 'panels.market.add.changeRegistry': "更换安装源";
|
|
120
|
+
readonly 'panels.market.add.installingTitle': "模块安装中…";
|
|
121
|
+
readonly 'panels.market.add.installedTitle': "已安装";
|
|
122
|
+
readonly 'panels.market.add.failedTitle': "模块安装失败";
|
|
123
|
+
readonly 'panels.market.add.cancelledTitle': "已取消";
|
|
124
|
+
readonly 'panels.market.add.failureNetworkHost': "无法连接 {host}。Git 地址和 .tgz 直链不经过安装源,需要本机能直接访问它或配置代理;如果这个模块也发布到了 npm,请改填包名。";
|
|
125
|
+
readonly 'panels.market.add.problemInvalid': "无法识别这个包名或地址:{reason}";
|
|
126
|
+
readonly 'panels.market.add.problemInstalled': "该模块已安装";
|
|
127
|
+
readonly 'panels.market.add.problemNotFound': "未找到相关模块";
|
|
128
|
+
readonly 'panels.market.add.problemNotPackage': "该路径不存在或不是有效的模块包";
|
|
129
|
+
readonly 'panels.market.add.problemNotBundle': "这个包没有声明组合包,无法作为模块安装:{reason}";
|
|
130
|
+
readonly 'panels.market.add.problemNetwork': "无法连接模块源,请检查网络后重试";
|
|
131
|
+
readonly 'panels.market.add.problemUnknown': "无法获取模块信息:{reason}";
|
|
132
|
+
readonly 'panels.market.add.failureNetwork': "网络连接失败";
|
|
133
|
+
readonly 'panels.market.add.failureNotFound': "未找到相关模块";
|
|
134
|
+
readonly 'panels.market.add.failureNoMatchingVersion': "没有匹配的版本";
|
|
135
|
+
readonly 'panels.market.add.failureDiskFull': "磁盘空间不足,安装已停止";
|
|
136
|
+
readonly 'panels.market.add.failurePermission': "没有写入权限,无法安装";
|
|
137
|
+
readonly 'panels.market.add.failureBuildBlocked': "有依赖的安装脚本需要你允许后才能继续";
|
|
138
|
+
readonly 'panels.market.add.failureIntegrity': "下载的安装包校验失败";
|
|
139
|
+
readonly 'panels.market.add.failureTimeout': "安装超时";
|
|
140
|
+
readonly 'panels.market.add.failurePnpmMissing': "没有找到 pnpm,无法安装";
|
|
141
|
+
readonly 'panels.market.add.failureGeneric': "安装过程中出错,原因见安装详情";
|
|
142
|
+
readonly 'panels.market.add.approveTitle': "需要你允许安装脚本";
|
|
143
|
+
readonly 'panels.market.add.approveCaution': "只允许你信得过的包:安装脚本会以你的权限在这台机器上运行。";
|
|
144
|
+
readonly 'panels.market.add.approveRun': "允许并继续安装";
|
|
145
|
+
readonly 'panels.market.add.restart': "装好了,重启一次才生效。";
|
|
146
|
+
readonly 'panels.market.add.tookEffect': "已生效。";
|
|
147
|
+
readonly 'panels.market.add.details': "安装详情";
|
|
148
|
+
readonly 'panels.market.add.open': "添加模块";
|
|
149
|
+
readonly 'panels.market.add.title': "添加模块";
|
|
150
|
+
readonly 'panels.market.add.intro': "按包名装工作台模块。装在这台机器上,所有项目共用。";
|
|
151
|
+
readonly 'panels.market.add.specLabel': "包名";
|
|
152
|
+
readonly 'panels.market.add.specHint': "就是命令里 `dsh plugin add` 后面那一段:包名(可带 @版本)、git 地址、压缩包或本地绝对路径。";
|
|
153
|
+
readonly 'panels.market.add.exampleTitle': "示例";
|
|
154
|
+
readonly 'panels.market.add.exampleFill': "填入示例";
|
|
155
|
+
readonly 'panels.market.add.registryLabel': "安装源";
|
|
156
|
+
readonly 'panels.market.add.registryProfile': "这个 profile 配的源";
|
|
157
|
+
readonly 'panels.market.add.registryPnpm': "pnpm 自己配的源";
|
|
158
|
+
readonly 'panels.market.add.check': "预检";
|
|
159
|
+
readonly 'panels.market.add.checking': "正在预检…";
|
|
160
|
+
readonly 'panels.market.add.change': "改一下";
|
|
161
|
+
readonly 'panels.market.add.previewTitle': "将要安装";
|
|
162
|
+
readonly 'panels.market.add.fieldName': "包名";
|
|
163
|
+
readonly 'panels.market.add.fieldVersion': "版本";
|
|
164
|
+
readonly 'panels.market.add.fieldDescription': "简介";
|
|
165
|
+
readonly 'panels.market.add.fieldSource': "来源";
|
|
166
|
+
readonly 'panels.market.add.install': "安装";
|
|
167
|
+
readonly 'panels.market.add.installing': "正在安装…";
|
|
168
|
+
readonly 'panels.market.add.cancel': "取消安装";
|
|
169
|
+
readonly 'panels.market.add.close': "关闭";
|
|
170
|
+
readonly 'panels.market.add.retry': "重试";
|
|
171
|
+
readonly 'panels.market.add.changeSource': "换源";
|
|
172
|
+
readonly 'panels.market.add.approveBuilds': "允许这些脚本并重试";
|
|
173
|
+
readonly 'panels.market.add.approveHint': "这几个包要跑安装脚本:{packages}";
|
|
174
|
+
readonly 'panels.market.add.doneApplied': "装好了,已经生效。";
|
|
175
|
+
readonly 'panels.market.add.doneRestart': "装好了,重启一次才生效。";
|
|
176
|
+
readonly 'panels.market.add.cancelled': "已取消。";
|
|
177
|
+
readonly 'panels.market.add.failed': "没成功:{reason}";
|
|
178
|
+
readonly 'panels.market.add.supplyInstalled': "它要的插件也装上了。";
|
|
179
|
+
readonly 'panels.market.add.supplyPending': "它要的插件重启后再装。";
|
|
180
|
+
readonly 'panels.market.add.supplyFailed': "它要的插件没装上:{reason}";
|
|
181
|
+
readonly 'panels.market.add.notModule': "这不是工作台模块(没有 dsh.workbench 声明),不会出现在面板上。";
|
|
182
|
+
readonly 'panels.market.add.removed': "已经移除了。";
|
|
183
|
+
readonly 'panels.market.add.removedRestart': "卸掉了,重启一次才彻底生效。";
|
|
184
|
+
readonly 'panels.market.add.remove': "移除它";
|
|
185
|
+
readonly 'panels.market.add.problem.invalidSpec': "这个写法不认:不能是空的,也不能以横杠开头。";
|
|
186
|
+
readonly 'panels.market.add.problem.alreadyInstalled': "这个包已经在 profile 里了(要换版本请带上 @版本)。";
|
|
187
|
+
readonly 'panels.market.add.problem.notFound': "源上没有这个包。";
|
|
188
|
+
readonly 'panels.market.add.problem.notAPackage': "这个位置没有包。";
|
|
189
|
+
readonly 'panels.market.add.problem.notABundle': "它是一个 npm 包,但不是 dsh 插件包(没有 bundle patch)。";
|
|
190
|
+
readonly 'panels.market.add.problem.network': "源连不上。";
|
|
191
|
+
readonly 'panels.market.add.problem.unknown': "预检没通过(原因未知)。";
|
|
192
|
+
readonly 'panels.market.add.reason.invalidSpec': "写法不认";
|
|
193
|
+
readonly 'panels.market.add.reason.incompatible': "它要的 dsh 版本和这台机器上的不一致";
|
|
194
|
+
readonly 'panels.market.add.reason.notBundle': "它不是一个 dsh 插件包";
|
|
195
|
+
readonly 'panels.market.add.reason.notRemovable': "它是安装自带的组合包,不能卸";
|
|
196
|
+
readonly 'panels.market.add.reason.bundleInUse': "还有东西在用它,卸不掉";
|
|
197
|
+
readonly 'panels.market.add.reason.stopProfile': "这个 profile 没开热更新,得先停掉进程";
|
|
198
|
+
readonly 'panels.market.add.reason.staleApproval': "要允许的安装脚本已经变了,重新来一次";
|
|
199
|
+
readonly 'panels.market.add.reason.operationError': "pnpm 执行出错(详情见安装输出)";
|
|
200
|
+
readonly 'panels.market.add.reason.buildBlocked': "pnpm 拦下了安装脚本";
|
|
201
|
+
readonly 'panels.market.add.reason.pnpmMissing': "这台机器上没有 pnpm";
|
|
202
|
+
readonly 'panels.market.add.reason.noMatchingVersion': "源上没有符合这个版本范围的版本";
|
|
203
|
+
readonly 'panels.market.add.reason.diskFull': "磁盘满了";
|
|
204
|
+
readonly 'panels.market.add.reason.permission': "没有写权限";
|
|
205
|
+
readonly 'panels.market.add.reason.integrity': "下载内容校验不过";
|
|
206
|
+
readonly 'panels.market.add.reason.timeout': "太久没有输出,被中断了";
|
|
207
|
+
readonly 'panels.market.add.reason.network': "网络不通";
|
|
208
|
+
readonly 'panels.market.add.reason.notFound': "源上没有这个包";
|
|
209
|
+
readonly 'panels.market.add.reason.unknown': "没成功,但它没说是为什么(详情见安装输出的那一行)";
|
|
85
210
|
readonly 'blocker.fix.install': "帮我安装";
|
|
86
211
|
readonly 'blocker.fix.update': "帮我升级";
|
|
87
212
|
readonly 'blocker.fix.running': "正在执行…";
|
package/dist/i18n/zh.js
CHANGED
|
@@ -63,18 +63,23 @@ export const zh = {
|
|
|
63
63
|
'panels.market.install': '安装',
|
|
64
64
|
'panels.market.update': '更新',
|
|
65
65
|
'panels.market.uninstall': '卸载',
|
|
66
|
+
'panels.market.uninstallLabel': '卸载 {name}',
|
|
66
67
|
'panels.market.installing': '正在安装…',
|
|
67
68
|
'panels.market.updating': '正在更新…',
|
|
68
69
|
'panels.market.uninstalling': '正在卸载…',
|
|
69
|
-
'panels.market.
|
|
70
|
-
'panels.market.confirmUninstallDetail': '
|
|
71
|
-
'panels.market.
|
|
70
|
+
'panels.market.confirmUninstallTitle': '卸载「{name}」?',
|
|
71
|
+
'panels.market.confirmUninstallDetail': '卸载后它提供的功能会消失。',
|
|
72
|
+
'panels.market.confirmUninstallAck': '我明白:卸载后想再用,得重新装一遍。',
|
|
73
|
+
'panels.market.confirmYes': '卸载',
|
|
72
74
|
'panels.market.confirmNo': '取消',
|
|
73
75
|
'panels.market.failed': '没成功:{reason}',
|
|
74
76
|
'panels.market.needEnv': '先在启动工作台的终端里设 {env}',
|
|
75
77
|
'panels.market.noSource': '这个模块没声明怎么装,只能自己动手',
|
|
76
78
|
'panels.market.badSource': '安装方式没写全,只能自己动手',
|
|
77
79
|
'panels.market.empty': '暂无可用模块',
|
|
80
|
+
'panels.market.installedSection': '已装',
|
|
81
|
+
'panels.market.moduleUpdate': '有新版 {version}:安装完成后可能需要重启才生效。',
|
|
82
|
+
'panels.market.restartNeeded': '新版装好了,重启一次才生效。',
|
|
78
83
|
'panels.market.foot': '装好后到那个项目的面板页勾选它,模块才会出现。',
|
|
79
84
|
'panels.market.recheck': '重新检查更新',
|
|
80
85
|
'panels.market.checkUpdates': '检查更新',
|
|
@@ -82,6 +87,126 @@ export const zh = {
|
|
|
82
87
|
'panels.market.justNow': '刚刚',
|
|
83
88
|
'panels.market.minutesAgo': '{n} 分钟前',
|
|
84
89
|
'panels.market.hoursAgo': '{n} 小时前',
|
|
90
|
+
'panels.market.add.description': '输入模块的包名、Git 仓库地址或本地目录路径。',
|
|
91
|
+
'panels.market.add.specPlaceholder': '例如 @dsh-workbench/module-hello',
|
|
92
|
+
'panels.market.add.guideToggle': '模块安装引导和示例',
|
|
93
|
+
'panels.market.add.guideHide': '收起引导',
|
|
94
|
+
'panels.market.add.guideIdTitle': '包名',
|
|
95
|
+
'panels.market.add.guideIdExample': '@dsh-workbench/module-hello',
|
|
96
|
+
'panels.market.add.guideIdHint': '模块包名即 npm 包名(如 dsh-workbench-module-xxx 或 @作者/模块名),社区模块的 README 安装命令中 dsh plugin add 或 pnpm add 之后的部分。',
|
|
97
|
+
'panels.market.add.guideGitTitle': 'Git 仓库地址',
|
|
98
|
+
'panels.market.add.guideGitExample': 'https://github.com/author/dsh-workbench-module-x',
|
|
99
|
+
'panels.market.add.guideGitHint': '模块在 GitHub 上的开源仓库地址,也支持其他 Git 仓库。',
|
|
100
|
+
'panels.market.add.guidePathTitle': '本地模块目录',
|
|
101
|
+
'panels.market.add.guidePathExample': '/Users/name/my-workbench-module',
|
|
102
|
+
'panels.market.add.guidePathHint': '本机上模块目录的绝对路径,适用于自行开发或已下载的模块。',
|
|
103
|
+
'panels.market.add.guideExampleLabel': '示例:',
|
|
104
|
+
'panels.market.add.guideFill': '填入示例',
|
|
105
|
+
'panels.market.add.guideSafety': '请确认模块来源可信。模块在本机以你的权限运行,来源不明的模块可能损坏工作台,或读取和泄露你的数据。',
|
|
106
|
+
'panels.market.add.registryLegend': '从哪个 npm 源下载模块',
|
|
107
|
+
'panels.market.add.registryOfficial': 'npm 官方源',
|
|
108
|
+
'panels.market.add.registryMirror': '中国大陆镜像源',
|
|
109
|
+
'panels.market.add.registryWithHost': '{name}({host})',
|
|
110
|
+
'panels.market.add.registryToggle': '安装源',
|
|
111
|
+
'panels.market.add.installVersion': '版本 {version}',
|
|
112
|
+
'panels.market.add.registryDefault': '默认安装源',
|
|
113
|
+
'panels.market.add.registryCustom': '自定义地址',
|
|
114
|
+
'panels.market.add.registryCustomPlaceholder': 'https://npm.example.com/',
|
|
115
|
+
'panels.market.add.registryCustomHint': '公司内网或私有 npm 源;需要登录的源,把凭据放在本机的 ~/.npmrc 里',
|
|
116
|
+
'panels.market.add.registryCustomInvalid': '请输入以 http:// 或 https:// 开头的地址',
|
|
117
|
+
'panels.market.add.run': '安装',
|
|
118
|
+
'panels.market.add.edit': '编辑',
|
|
119
|
+
'panels.market.add.changeRegistry': '更换安装源',
|
|
120
|
+
'panels.market.add.installingTitle': '模块安装中…',
|
|
121
|
+
'panels.market.add.installedTitle': '已安装',
|
|
122
|
+
'panels.market.add.failedTitle': '模块安装失败',
|
|
123
|
+
'panels.market.add.cancelledTitle': '已取消',
|
|
124
|
+
'panels.market.add.failureNetworkHost': '无法连接 {host}。Git 地址和 .tgz 直链不经过安装源,需要本机能直接访问它或配置代理;如果这个模块也发布到了 npm,请改填包名。',
|
|
125
|
+
'panels.market.add.problemInvalid': '无法识别这个包名或地址:{reason}',
|
|
126
|
+
'panels.market.add.problemInstalled': '该模块已安装',
|
|
127
|
+
'panels.market.add.problemNotFound': '未找到相关模块',
|
|
128
|
+
'panels.market.add.problemNotPackage': '该路径不存在或不是有效的模块包',
|
|
129
|
+
'panels.market.add.problemNotBundle': '这个包没有声明组合包,无法作为模块安装:{reason}',
|
|
130
|
+
'panels.market.add.problemNetwork': '无法连接模块源,请检查网络后重试',
|
|
131
|
+
'panels.market.add.problemUnknown': '无法获取模块信息:{reason}',
|
|
132
|
+
'panels.market.add.failureNetwork': '网络连接失败',
|
|
133
|
+
'panels.market.add.failureNotFound': '未找到相关模块',
|
|
134
|
+
'panels.market.add.failureNoMatchingVersion': '没有匹配的版本',
|
|
135
|
+
'panels.market.add.failureDiskFull': '磁盘空间不足,安装已停止',
|
|
136
|
+
'panels.market.add.failurePermission': '没有写入权限,无法安装',
|
|
137
|
+
'panels.market.add.failureBuildBlocked': '有依赖的安装脚本需要你允许后才能继续',
|
|
138
|
+
'panels.market.add.failureIntegrity': '下载的安装包校验失败',
|
|
139
|
+
'panels.market.add.failureTimeout': '安装超时',
|
|
140
|
+
'panels.market.add.failurePnpmMissing': '没有找到 pnpm,无法安装',
|
|
141
|
+
'panels.market.add.failureGeneric': '安装过程中出错,原因见安装详情',
|
|
142
|
+
'panels.market.add.approveTitle': '需要你允许安装脚本',
|
|
143
|
+
'panels.market.add.approveCaution': '只允许你信得过的包:安装脚本会以你的权限在这台机器上运行。',
|
|
144
|
+
'panels.market.add.approveRun': '允许并继续安装',
|
|
145
|
+
'panels.market.add.restart': '装好了,重启一次才生效。',
|
|
146
|
+
'panels.market.add.tookEffect': '已生效。',
|
|
147
|
+
'panels.market.add.details': '安装详情',
|
|
148
|
+
'panels.market.add.open': '添加模块',
|
|
149
|
+
'panels.market.add.title': '添加模块',
|
|
150
|
+
'panels.market.add.intro': '按包名装工作台模块。装在这台机器上,所有项目共用。',
|
|
151
|
+
'panels.market.add.specLabel': '包名',
|
|
152
|
+
'panels.market.add.specHint': '就是命令里 `dsh plugin add` 后面那一段:包名(可带 @版本)、git 地址、压缩包或本地绝对路径。',
|
|
153
|
+
'panels.market.add.exampleTitle': '示例',
|
|
154
|
+
'panels.market.add.exampleFill': '填入示例',
|
|
155
|
+
'panels.market.add.registryLabel': '安装源',
|
|
156
|
+
'panels.market.add.registryProfile': '这个 profile 配的源',
|
|
157
|
+
'panels.market.add.registryPnpm': 'pnpm 自己配的源',
|
|
158
|
+
'panels.market.add.check': '预检',
|
|
159
|
+
'panels.market.add.checking': '正在预检…',
|
|
160
|
+
'panels.market.add.change': '改一下',
|
|
161
|
+
'panels.market.add.previewTitle': '将要安装',
|
|
162
|
+
'panels.market.add.fieldName': '包名',
|
|
163
|
+
'panels.market.add.fieldVersion': '版本',
|
|
164
|
+
'panels.market.add.fieldDescription': '简介',
|
|
165
|
+
'panels.market.add.fieldSource': '来源',
|
|
166
|
+
'panels.market.add.install': '安装',
|
|
167
|
+
'panels.market.add.installing': '正在安装…',
|
|
168
|
+
'panels.market.add.cancel': '取消安装',
|
|
169
|
+
'panels.market.add.close': '关闭',
|
|
170
|
+
'panels.market.add.retry': '重试',
|
|
171
|
+
'panels.market.add.changeSource': '换源',
|
|
172
|
+
'panels.market.add.approveBuilds': '允许这些脚本并重试',
|
|
173
|
+
'panels.market.add.approveHint': '这几个包要跑安装脚本:{packages}',
|
|
174
|
+
'panels.market.add.doneApplied': '装好了,已经生效。',
|
|
175
|
+
'panels.market.add.doneRestart': '装好了,重启一次才生效。',
|
|
176
|
+
'panels.market.add.cancelled': '已取消。',
|
|
177
|
+
'panels.market.add.failed': '没成功:{reason}',
|
|
178
|
+
'panels.market.add.supplyInstalled': '它要的插件也装上了。',
|
|
179
|
+
'panels.market.add.supplyPending': '它要的插件重启后再装。',
|
|
180
|
+
'panels.market.add.supplyFailed': '它要的插件没装上:{reason}',
|
|
181
|
+
'panels.market.add.notModule': '这不是工作台模块(没有 dsh.workbench 声明),不会出现在面板上。',
|
|
182
|
+
'panels.market.add.removed': '已经移除了。',
|
|
183
|
+
'panels.market.add.removedRestart': '卸掉了,重启一次才彻底生效。',
|
|
184
|
+
'panels.market.add.remove': '移除它',
|
|
185
|
+
'panels.market.add.problem.invalidSpec': '这个写法不认:不能是空的,也不能以横杠开头。',
|
|
186
|
+
'panels.market.add.problem.alreadyInstalled': '这个包已经在 profile 里了(要换版本请带上 @版本)。',
|
|
187
|
+
'panels.market.add.problem.notFound': '源上没有这个包。',
|
|
188
|
+
'panels.market.add.problem.notAPackage': '这个位置没有包。',
|
|
189
|
+
'panels.market.add.problem.notABundle': '它是一个 npm 包,但不是 dsh 插件包(没有 bundle patch)。',
|
|
190
|
+
'panels.market.add.problem.network': '源连不上。',
|
|
191
|
+
'panels.market.add.problem.unknown': '预检没通过(原因未知)。',
|
|
192
|
+
'panels.market.add.reason.invalidSpec': '写法不认',
|
|
193
|
+
'panels.market.add.reason.incompatible': '它要的 dsh 版本和这台机器上的不一致',
|
|
194
|
+
'panels.market.add.reason.notBundle': '它不是一个 dsh 插件包',
|
|
195
|
+
'panels.market.add.reason.notRemovable': '它是安装自带的组合包,不能卸',
|
|
196
|
+
'panels.market.add.reason.bundleInUse': '还有东西在用它,卸不掉',
|
|
197
|
+
'panels.market.add.reason.stopProfile': '这个 profile 没开热更新,得先停掉进程',
|
|
198
|
+
'panels.market.add.reason.staleApproval': '要允许的安装脚本已经变了,重新来一次',
|
|
199
|
+
'panels.market.add.reason.operationError': 'pnpm 执行出错(详情见安装输出)',
|
|
200
|
+
'panels.market.add.reason.buildBlocked': 'pnpm 拦下了安装脚本',
|
|
201
|
+
'panels.market.add.reason.pnpmMissing': '这台机器上没有 pnpm',
|
|
202
|
+
'panels.market.add.reason.noMatchingVersion': '源上没有符合这个版本范围的版本',
|
|
203
|
+
'panels.market.add.reason.diskFull': '磁盘满了',
|
|
204
|
+
'panels.market.add.reason.permission': '没有写权限',
|
|
205
|
+
'panels.market.add.reason.integrity': '下载内容校验不过',
|
|
206
|
+
'panels.market.add.reason.timeout': '太久没有输出,被中断了',
|
|
207
|
+
'panels.market.add.reason.network': '网络不通',
|
|
208
|
+
'panels.market.add.reason.notFound': '源上没有这个包',
|
|
209
|
+
'panels.market.add.reason.unknown': '没成功,但它没说是为什么(详情见安装输出的那一行)',
|
|
85
210
|
'blocker.fix.install': '帮我安装',
|
|
86
211
|
'blocker.fix.update': '帮我升级',
|
|
87
212
|
'blocker.fix.running': '正在执行…',
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export * from './components/LongTaskRow.js';
|
|
|
17
17
|
export * from './components/MockStrip.js';
|
|
18
18
|
export * from './components/ResourceStates.js';
|
|
19
19
|
export * from './components/SaveBar.js';
|
|
20
|
-
export * from './components/
|
|
20
|
+
export * from './components/TextField.js';
|
|
21
21
|
export * from './components/board-module.js';
|
|
22
22
|
export * from './components/icons.js';
|
|
23
23
|
export * from './config/constants.js';
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export * from './components/LongTaskRow.js';
|
|
|
17
17
|
export * from './components/MockStrip.js';
|
|
18
18
|
export * from './components/ResourceStates.js';
|
|
19
19
|
export * from './components/SaveBar.js';
|
|
20
|
-
export * from './components/
|
|
20
|
+
export * from './components/TextField.js';
|
|
21
21
|
export * from './components/board-module.js';
|
|
22
22
|
export * from './components/icons.js';
|
|
23
23
|
export * from './config/constants.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "工作台与模块共享的纯代码与契约类型:类型、纯逻辑、哑组件、平台解析。宿主侧的东西从 /host 进(不影响浏览器产物)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,15 +29,17 @@
|
|
|
29
29
|
"react": "*"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@arch-guard/core": "^0.
|
|
32
|
+
"@arch-guard/core": "^0.11.0",
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
|
|
33
34
|
"@types/node": "^24.19.0",
|
|
34
35
|
"@types/react": "^19.0.0",
|
|
35
36
|
"@vitest/coverage-v8": "^5.0.2",
|
|
36
37
|
"react": "^18.0.0",
|
|
38
|
+
"typescript": "5.9",
|
|
37
39
|
"vitest": "^5.0.2"
|
|
38
40
|
},
|
|
39
41
|
"scripts": {
|
|
40
|
-
"build": "tsc -p tsconfig.build.json",
|
|
42
|
+
"build": "tsc -p tsconfig.build.json && node scripts/copy-css.mjs",
|
|
41
43
|
"typecheck": "tsc --noEmit",
|
|
42
44
|
"test": "vitest run",
|
|
43
45
|
"coverage": "vitest run --coverage",
|
|
@@ -4,7 +4,11 @@ export type ProvisionAction =
|
|
|
4
4
|
| 'install'
|
|
5
5
|
| 'update'
|
|
6
6
|
| 'uninstall'
|
|
7
|
-
| 'update-dependency'
|
|
7
|
+
| 'update-dependency'
|
|
8
|
+
| 'install-bundle'
|
|
9
|
+
| 'update-bundle'
|
|
10
|
+
| 'remove-bundle'
|
|
11
|
+
| 'cancel-install';
|
|
8
12
|
|
|
9
13
|
export interface PluginStatePayload {
|
|
10
14
|
readonly name: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Translate } from '../api/dsh-client.js';
|
|
2
2
|
import type { ApprovalInput, UnitClientFace } from '../components/board-module.js';
|
|
3
3
|
import { h } from '../lib/react.js';
|
|
4
|
+
import { CodeBlock } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
5
|
+
import './ApprovalDetail.css';
|
|
4
6
|
|
|
5
7
|
interface ToolCallRoot {
|
|
6
8
|
readonly callId?: string;
|
|
@@ -53,5 +55,13 @@ export function ApprovalDetail(props: ApprovalDetailProps) {
|
|
|
53
55
|
const owner = (props.units ?? []).find((face) => face.approval?.tools.includes(input.tool) === true);
|
|
54
56
|
if (owner?.approval !== undefined) return <owner.approval.render input={input} t={t} />;
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
if (command === '') return null;
|
|
59
|
+
return (
|
|
60
|
+
<CodeBlock
|
|
61
|
+
code={command}
|
|
62
|
+
className="wb-approvalCommand"
|
|
63
|
+
copyLabel={t('blocker.copy')}
|
|
64
|
+
copiedLabel={t('env.copied')}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
57
67
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
|
|
2
|
+
.wb-cardHead {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: var(--wb-len-6);
|
|
6
|
+
flex: none;
|
|
7
|
+
padding: var(--wb-len-8) var(--wb-len-10) var(--wb-len-8) var(--wb-len-20);
|
|
8
|
+
border-bottom: 0.5px solid var(--dsw-alias-border-l2);
|
|
9
|
+
background: var(--dsw-alias-bg-layer-2);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.wb-cardTitle {
|
|
13
|
+
margin: 0;
|
|
14
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
15
|
+
line-height: var(--wb-line-18);
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
color: var(--dsw-alias-label-secondary);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.wb-cardMeta {
|
|
21
|
+
font-size: var(--dsw-font-xxxs-11-font-size);
|
|
22
|
+
line-height: var(--wb-line-16);
|
|
23
|
+
color: var(--dsw-alias-label-tertiary);
|
|
24
|
+
min-width: 0;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.wb-cardMeta::before {
|
|
31
|
+
content: '\00b7';
|
|
32
|
+
margin-right: var(--wb-len-6);
|
|
33
|
+
color: var(--dsw-alias-label-tertiary);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.wb-cardOpen {
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
margin-left: auto;
|
|
42
|
+
flex: none;
|
|
43
|
+
width: var(--wb-len-22);
|
|
44
|
+
height: var(--wb-len-22);
|
|
45
|
+
padding: var(--wb-len-4);
|
|
46
|
+
border-radius: var(--wb-radius-6);
|
|
47
|
+
color: var(--dsw-alias-label-tertiary);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.wb-cardOpen ~ .wb-cardRefresh {
|
|
51
|
+
margin-left: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.wb-cardOpen:hover {
|
|
55
|
+
color: var(--dsw-alias-label-primary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.wb-cardRefresh {
|
|
59
|
+
margin-left: auto;
|
|
60
|
+
flex: none;
|
|
61
|
+
width: var(--wb-len-22);
|
|
62
|
+
height: var(--wb-len-22);
|
|
63
|
+
padding: var(--wb-len-4);
|
|
64
|
+
border-radius: var(--wb-radius-6);
|
|
65
|
+
color: var(--dsw-alias-label-tertiary);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.wb-cardRefresh:hover:not(:disabled) {
|
|
69
|
+
color: var(--dsw-alias-label-primary);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.wb-cardRefresh:disabled {
|
|
73
|
+
cursor: default;
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.wb-cardGear {
|
|
78
|
+
flex: none;
|
|
79
|
+
width: var(--wb-len-22);
|
|
80
|
+
height: var(--wb-len-22);
|
|
81
|
+
padding: var(--wb-len-3);
|
|
82
|
+
border-radius: var(--wb-radius-6);
|
|
83
|
+
color: var(--dsw-alias-label-tertiary);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wb-cardGear:hover:not(:disabled) {
|
|
87
|
+
color: var(--dsw-alias-label-primary);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.wb-cardRefresh.wb-spinning svg {
|
|
91
|
+
animation: wb-spin var(--wb-dur-0-9) linear infinite;
|
|
92
|
+
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from '../lib/react.js';
|
|
2
2
|
import type { Translate } from '../api/dsh-client.js';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
IconRefreshOutlineRegular,
|
|
6
|
+
IconRightUpOutlineRegular,
|
|
7
|
+
IconSettingsOutlineRegular,
|
|
8
|
+
Tooltip,
|
|
9
|
+
} from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
10
|
import { h } from '../lib/react.js';
|
|
11
|
+
import './CardHead.css';
|
|
5
12
|
|
|
6
13
|
export interface CardHeadProps {
|
|
7
14
|
readonly t: Translate;
|
|
@@ -36,38 +43,43 @@ export function CardHead({
|
|
|
36
43
|
<h2 className="wb-cardTitle">{title}</h2>
|
|
37
44
|
{meta === undefined ? null : <span className="wb-cardMeta">{meta}</span>}
|
|
38
45
|
{platformHref === undefined || platform === undefined ? null : (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
<Tooltip label={platformTitle ?? platform}>
|
|
47
|
+
<a
|
|
48
|
+
className="wb-iconButton wb-cardOpen"
|
|
49
|
+
href={platformHref}
|
|
50
|
+
target="_blank"
|
|
51
|
+
rel="noreferrer noopener"
|
|
52
|
+
aria-label={platform}
|
|
53
|
+
>
|
|
54
|
+
<IconRightUpOutlineRegular size={14} />
|
|
55
|
+
</a>
|
|
56
|
+
</Tooltip>
|
|
49
57
|
)}
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
className={`wb-iconButton wb-cardRefresh${refreshing ? ' wb-spinning' : ''}`}
|
|
53
|
-
aria-label={refreshLabel}
|
|
54
|
-
title={refreshLabel}
|
|
55
|
-
disabled={refreshing}
|
|
56
|
-
onClick={onRefresh}
|
|
57
|
-
>
|
|
58
|
-
<IconRefresh size={14} />
|
|
59
|
-
</button>
|
|
60
|
-
{gear === undefined || onToggleGear === undefined ? null : (
|
|
61
|
-
<button
|
|
58
|
+
<Tooltip label={refreshLabel}>
|
|
59
|
+
<Button
|
|
62
60
|
type="button"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
size="sm"
|
|
62
|
+
variant="ghost"
|
|
63
|
+
className={`wb-cardRefresh${refreshing ? ' wb-spinning' : ''}`}
|
|
64
|
+
aria-label={refreshLabel}
|
|
65
|
+
disabled={refreshing}
|
|
66
|
+
icon={<IconRefreshOutlineRegular size={14} />}
|
|
67
|
+
onClick={onRefresh}
|
|
68
|
+
/>
|
|
69
|
+
</Tooltip>
|
|
70
|
+
{gear === undefined || onToggleGear === undefined ? null : (
|
|
71
|
+
<Tooltip label={gear}>
|
|
72
|
+
<Button
|
|
73
|
+
type="button"
|
|
74
|
+
size="sm"
|
|
75
|
+
variant="ghost"
|
|
76
|
+
className={`wb-cardGear${gearOpen === true ? ' wb-iconButtonActive' : ''}`}
|
|
77
|
+
aria-label={gear}
|
|
78
|
+
aria-expanded={gearOpen === true}
|
|
79
|
+
icon={<IconSettingsOutlineRegular size={15} />}
|
|
80
|
+
onClick={onToggleGear}
|
|
81
|
+
/>
|
|
82
|
+
</Tooltip>
|
|
71
83
|
)}
|
|
72
84
|
</header>
|
|
73
85
|
);
|