@wenaixi/dsh-superpower 7.5.4 → 7.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,7 +28,7 @@ dsh --profile web --dump-config | grep -A2 "@wenaixi/dsh-superpower"
28
28
  dsh --profile web # skills are available immediately
29
29
  ```
30
30
 
31
- Pin a version by appending `@<version>` (`@wenaixi/dsh-superpower@7.5.4`) or `#v7.5.4`.
31
+ Pin a version by appending `@<version>` (`@wenaixi/dsh-superpower@7.5.5`) or `#v7.5.5`.
32
32
 
33
33
  The old unscoped package name `dsh-superpower` is deprecated (`npm deprecate`); use the scoped one.
34
34
 
@@ -190,6 +190,10 @@ Since `v7.0.0` skill names follow upstream naming (no `superpower-` prefix) and
190
190
 
191
191
  `v7.5.0` shipped every skill with an English body (`SKILL.en.md`, upstream original adapted for DSH) beside the Chinese one, added a per-skill `中文 / English` switch, made English descriptions always start with `Superpower Skill: `, routed the same language preference to the model-side catalog and body, and made README.md English by default with a Chinese twin.
192
192
 
193
+ `v7.5.5` makes the whole panel follow the language button: the panel's own copy (title, bulk buttons, search box, hints, meta labels) switches with the skill descriptions instead of following the Host UI language.
194
+
195
+ `v7.5.4` republished under a fresh version: the 7.5.3 release hit an npm staged-publish conflict; the code is identical to 7.5.3.
196
+
193
197
  `v7.5.3` fixed the language button label: it now shows the target language based on the effective language (falling back to the Host language when the preference is unset), so an untouched panel correctly offers `English` and clicking it actually switches.
194
198
 
195
199
  `v7.5.2` moved the language switch to a single button at the top of the panel: it now controls all 15 skills at once, and while the `language` preference is unset the descriptions follow the Host UI language (settings language); once set, they stay fixed.
package/README.zh.md CHANGED
@@ -190,6 +190,10 @@ scripts/build-client.mjs # 复制客户端产物后校验内联清单与 sk
190
190
 
191
191
  `v7.5.0` 每个技能新增英文正文(`SKILL.en.md`,取自上游原版并做 DSH 专属化),与中文 `SKILL.md` 并存;面板每行新增「中文 / English」切换,英文描述一律以 `Superpower Skill: ` 开头;同一语言偏好同时决定模型侧目录描述与加载正文;README.md 改为默认英文并新增中文版 README.zh.md。
192
192
 
193
+ `v7.5.5` 面板自身文案(标题、批量按钮、搜索框、提示语、meta 标签)改为随语言按钮切换,不再跟随宿主界面语言。
194
+
195
+ `v7.5.4` 改版重发(7.5.3 发布遇 npm staged-publish 冲突,代码内容与 7.5.3 相同)。
196
+
193
197
  `v7.5.3` 修复语言按钮显示:按钮按生效语言(未调过时取宿主语言)显示目标语言,未调过时正确显示 English、点击真正切换。
194
198
 
195
199
  `v7.5.2` 语言切换按钮上移到面板顶部、全局一个;未调过时描述跟随宿主界面语言,调过后固定。
package/lib/client.js CHANGED
@@ -34,7 +34,7 @@ window.__ModuleLoader__.load({
34
34
  var SKILL_SOURCE = 'bundled';
35
35
  /* 面板所在的包版本。写死而非从宿主取:浏览器侧读不到 package.json,
36
36
  而版本号正是排查「装的是哪一版、界面是不是这一版」时唯一能直接看到的东西。 */
37
- var PACKAGE_VERSION = '7.5.4';
37
+ var PACKAGE_VERSION = '7.5.5';
38
38
  var NS = 'dsh-superpower';
39
39
  var DISABLED_FIELD = 'disabled';
40
40
  /* v7.3.0 及之前的双侧禁言表。面板写入成功后会把它们 unset,
@@ -226,10 +226,13 @@ window.__ModuleLoader__.load({
226
226
  * props.actions 是本面板独占的写操作面。
227
227
  */
228
228
  function SkillSwitchPanel(props) {
229
- var t = props.t;
230
229
  var form = props.actions.form;
231
230
  var state = props.useSwitches(function (value) { return value; });
232
231
  var hostActive = props.useLocaleActive(function (v) { return v && v.preference === 'en' ? 'en' : 'zh'; });
232
+ var language = readLanguage(state.value);
233
+ var effective = language === undefined ? hostActive : language;
234
+ /* 面板 UI 文案按生效语言选词典(宿主界面语言对技能面板不再生效,与语言按钮一致)。 */
235
+ var uiText = function (key) { return (effective === 'zh' ? zh : en)[key]; };
233
236
 
234
237
  var keywordState = React.useState('');
235
238
  var keyword = keywordState[0];
@@ -243,8 +246,8 @@ window.__ModuleLoader__.load({
243
246
 
244
247
  if (state.status !== 'ready') {
245
248
  return h('div', { className: 'spSw' },
246
- h('h4', { className: 'spSwTitle' }, t('title')),
247
- h('p', { className: 'spSwIntro' }, t('hostUnavailable')));
249
+ h('h4', { className: 'spSwTitle' }, uiText('title')),
250
+ h('p', { className: 'spSwIntro' }, uiText('hostUnavailable')));
248
251
  }
249
252
 
250
253
  var value = state.value || {};
@@ -281,76 +284,76 @@ window.__ModuleLoader__.load({
281
284
  h('p', { className: 'spSwDesc' }, skillText(skill)),
282
285
  failure ? h('p', { className: 'spSwErr', role: 'alert' }, failure) : null),
283
286
  h('div', { className: 'spSwSwitch' },
284
- h('span', { className: 'spSwSwitchLabel' }, t('invocable')),
287
+ h('span', { className: 'spSwSwitchLabel' }, uiText('invocable')),
285
288
  h(P.Switch, {
286
289
  checked: on,
287
290
  disabled: busy,
288
- label: t('invocable') + ' ' + skill.name,
289
- title: t('invocableHint'),
291
+ label: uiText('invocable') + ' ' + skill.name,
292
+ title: uiText('invocableHint'),
290
293
  onChange: function (next) {
291
- submit(form, t, [skill.name], next ? 'enable' : 'disable', setPending, setFailures);
294
+ submit(form, uiText, [skill.name], next ? 'enable' : 'disable', setPending, setFailures);
292
295
  },
293
296
  })));
294
297
  });
295
298
 
296
299
  return h('div', { className: 'spSw' },
297
- h('h4', { className: 'spSwTitle' }, t('title')),
298
- h('p', { className: 'spSwIntro' }, t('intro')),
300
+ h('h4', { className: 'spSwTitle' }, uiText('title')),
301
+ h('p', { className: 'spSwIntro' }, uiText('intro')),
299
302
  h('div', { className: 'spSwLangBar' },
300
303
  h('button', {
301
304
  className: 'spSwLangBtn',
302
305
  type: 'button',
303
306
  disabled: !writable,
304
- title: t('langTitle'),
307
+ title: uiText('langTitle'),
305
308
  onClick: function () {
306
309
  var effective = language === undefined ? hostActive : language;
307
- submit(form, t, ['language'], 'enable', setPending, setFailures,
310
+ submit(form, uiText, ['language'], 'enable', setPending, setFailures,
308
311
  [{ op: 'set', path: [LANGUAGE_FIELD], value: effective === 'zh' ? 'en' : 'zh' }]);
309
312
  },
310
313
  }, (language === undefined ? hostActive : language) === 'zh' ? SP_LANG_EN : SP_LANG_ZH)),
311
314
  h('ul', { className: 'spSwMeta' },
312
- h('li', { className: 'spSwMetaItem' }, t('provider'), h('code', null, PROVIDER_NAME)),
313
- h('li', { className: 'spSwMetaItem' }, t('rank'), h('code', null, String(PROVIDER_RANK))),
314
- h('li', { className: 'spSwMetaItem' }, t('source'), h('code', null, SKILL_SOURCE)),
315
- h('li', { className: 'spSwMetaItem' }, t('build'), h('code', null, PACKAGE_VERSION))),
315
+ h('li', { className: 'spSwMetaItem' }, uiText('provider'), h('code', null, PROVIDER_NAME)),
316
+ h('li', { className: 'spSwMetaItem' }, uiText('rank'), h('code', null, String(PROVIDER_RANK))),
317
+ h('li', { className: 'spSwMetaItem' }, uiText('source'), h('code', null, SKILL_SOURCE)),
318
+ h('li', { className: 'spSwMetaItem' }, uiText('build'), h('code', null, PACKAGE_VERSION))),
316
319
  h('div', { className: 'spSwBar' },
317
320
  h(P.Button, {
318
321
  variant: 'outline',
319
322
  size: 'sm',
320
323
  disabled: !writable,
321
- title: t('resetHint'),
324
+ title: uiText('resetHint'),
322
325
  onClick: function () {
323
- submit(form, t, allNames, 'enable', setPending, setFailures);
326
+ submit(form, uiText, allNames, 'enable', setPending, setFailures);
324
327
  },
325
- }, t('enableAll')),
328
+ }, uiText('enableAll')),
326
329
  h(P.Button, {
327
330
  variant: 'outline',
328
331
  size: 'sm',
329
332
  disabled: !writable,
330
- title: t('disableAllHint'),
333
+ title: uiText('disableAllHint'),
331
334
  onClick: function () {
332
- submit(form, t, allNames, 'disable', setPending, setFailures);
335
+ submit(form, uiText, allNames, 'disable', setPending, setFailures);
333
336
  },
334
- }, t('disableAll')),
337
+ }, uiText('disableAll')),
335
338
  h(P.Button, {
336
339
  variant: 'ghost',
337
340
  size: 'sm',
338
341
  disabled: !writable,
339
- title: t('resetHint'),
342
+ title: uiText('resetHint'),
340
343
  onClick: function () {
341
- submit(form, t, allNames, 'enable', setPending, setFailures);
344
+ submit(form, uiText, allNames, 'enable', setPending, setFailures);
342
345
  },
343
- }, t('resetAll')),
346
+ }, uiText('resetAll')),
344
347
  h(P.Input, {
345
348
  className: 'spSwSearch',
346
349
  type: 'search',
347
350
  value: keyword,
348
- placeholder: t('search'),
349
- 'aria-label': t('search'),
351
+ placeholder: uiText('search'),
352
+ 'aria-label': uiText('search'),
350
353
  onChange: function (event) { setKeyword(event.target.value); },
351
354
  })),
352
355
  shown.length === 0
353
- ? h('p', { className: 'spSwEmpty' }, t('empty'))
356
+ ? h('p', { className: 'spSwEmpty' }, uiText('empty'))
354
357
  : h('ul', { className: 'spSwList' }, rows));
355
358
  }
356
359
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenaixi/dsh-superpower",
3
- "version": "7.5.4",
3
+ "version": "7.5.5",
4
4
  "description": "obra/superpowers 的 DSH 移植版:15 个工程纪律技能(中英双语正文)注入 ctx.skills,含技能开关与语言切换面板",
5
5
  "type": "module",
6
6
  "main": "lib/superpowers.js",