dsh-one-click-polish 1.2.2 → 1.2.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.
Files changed (3) hide show
  1. package/client.js +11 -1
  2. package/index.js +14 -0
  3. package/package.json +1 -1
package/client.js CHANGED
@@ -289,6 +289,7 @@ window.__ModuleLoader__.load({
289
289
  'version.unknown': '查不到最新版本',
290
290
  'version.how': '怎么更新',
291
291
  'version.recheck': '重新检查',
292
+ 'version.updateHint': '卸载后按包名重装即可更新(dsh 不为第三方插件提供更新按钮)',
292
293
  'settings.explore': '检索预算',
293
294
  'settings.explore.hint': '标准/深度润色时会先查资料。这是查资料总共能用多久、最多查几轮。查完后再改写,两者互不占用。',
294
295
  'settings.explore.unit': '秒',
@@ -455,6 +456,7 @@ window.__ModuleLoader__.load({
455
456
  'version.unknown': 'Cannot reach npm',
456
457
  'version.how': 'How to update',
457
458
  'version.recheck': 'Check again',
459
+ 'version.updateHint': 'Uninstall and install by package name to update (dsh offers no update button for third-party plugins)',
458
460
  'settings.explore': 'Lookup budget',
459
461
  'settings.explore.hint': 'A standard or deep polish looks things up first. This is how long that may take in total, and how many rounds it may spend. The rewrite runs separately with its own budget.',
460
462
  'settings.explore.unit': 's',
@@ -591,6 +593,10 @@ window.__ModuleLoader__.load({
591
593
  .dsh-op-versionNew{display:flex;flex-wrap:wrap;align-items:center;gap:8px;
592
594
  font-size:11.5px;color:var(--dsw-alias-state-warn-primary)}
593
595
  .dsh-op-versionBad{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));opacity:.8}
596
+ /* The manual update instruction: present when a newer version exists, quiet enough
597
+ not to compete with the version numbers themselves. */
598
+ .dsh-op-versionHint{flex:1 1 100%;font-size:11px;line-height:16px;
599
+ color:var(--dsw-alias-label-secondary);opacity:.85}
594
600
  /* The busy-wait line: a live counter, so it is monospaced and does not reflow as
595
601
  the seconds tick, and it holds a fixed height so the panel does not jump. */
596
602
  .dsh-op-waiting{font-variant-numeric:tabular-nums;min-height:17px}
@@ -2539,7 +2545,11 @@ window.__ModuleLoader__.load({
2539
2545
  type: 'button',
2540
2546
  className: 'dsh-op-link',
2541
2547
  onClick: () => { void checkVersion(true) },
2542
- }, t('version.recheck')))
2548
+ }, t('version.recheck')),
2549
+ // dsh derives installTarget only from its official catalogue, so a
2550
+ // third-party plugin has no update button. State the manual step
2551
+ // rather than leaving the user to wonder where one is.
2552
+ h('span', { className: 'dsh-op-versionHint' }, t('version.updateHint')))
2543
2553
  : h('span', { className: 'dsh-op-hint dsh-op-hint--inline' }, t('version.latest')))),
2544
2554
  h('div', { className: 'dsh-op-card' },
2545
2555
  h('div', { className: 'dsh-op-cardTitle' }, t('settings.group.model')),
package/index.js CHANGED
@@ -609,6 +609,20 @@ function allowedRoots(ctx, agent) {
609
609
  function profileDir() {
610
610
  const fromEnv = process.env.DSH_PROFILE_DIR
611
611
  if (typeof fromEnv === 'string' && fromEnv !== '') return fromEnv
612
+
613
+ // Resolve from where this module actually lives: <profile>/node_modules/<pkg>/.
614
+ // That anchor stays correct whatever working directory the Host was launched with,
615
+ // and it is what keeps the run log and the resume checkpoint discoverable after an
616
+ // uninstall-and-reinstall: those files live in the profile rather than in the
617
+ // package, so they survive the uninstall and must still be found afterwards.
618
+ try {
619
+ const here = dirname(fileURLToPath(import.meta.url))
620
+ const profile = join(here, '..', '..')
621
+ if (existsSync(join(profile, 'package.json')) && existsSync(join(profile, 'cordis.patch.yml'))) {
622
+ return profile
623
+ }
624
+ } catch { /* fall through to the working-directory guess */ }
625
+
612
626
  try {
613
627
  const cwd = process.cwd()
614
628
  if (!existsSync(join(cwd, 'cordis.patch.yml'))) return null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-one-click-polish",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "One-click polish, expand and autopilot for the DeepSeek Harness composer: rewrite the draft with the model the session is switched to, expand a one-line wish into a task brief, or let an AI drive a goal round after round.",
5
5
  "keywords": [
6
6
  "dsh",