dsh-composer-predictions 1.2.4 → 1.2.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/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.2.5] - 2026-10-25
10
+
11
+ ### Changed
12
+
13
+ - The **Settings → General** row draws its own switch instead of loading
14
+ `@deepseek-ai/dsh-client-ui-primitives`. A harness-side change to that package
15
+ could previously fail the whole plugin at load; the markup, theme tokens and
16
+ behaviour are unchanged.
17
+ - The README comparison table names the Settings switch.
18
+
19
+
9
20
  ## [1.2.4] - 2026-10-25
10
21
 
11
22
  ### Fixed
package/README.md CHANGED
@@ -40,9 +40,10 @@ for you.
40
40
  | Streamed rendering | ✅ SSE (`/v2`) | not documented | ✅ | ✅ |
41
41
  | Recent tool calls and outcomes in the prompt | ✅ | — | — | — |
42
42
  | Cache | ✅ per turn + per draft | ✅ | ✅ | not documented |
43
+ | Switch off in Settings, no uninstall | ✅ Settings → General | ✅ Settings section | not documented | not documented |
43
44
 
44
45
  "—" means the feature is not mentioned in that package's README as of
45
- 2026-10-24, not that it is impossible. If all you want is an after-turn
46
+ 2026-10-25, not that it is impossible. If all you want is an after-turn
46
47
  suggestion, `dsh-composer-prediction` is a perfectly good, more established
47
48
  choice — this plugin is for people who also want the caret continuation and
48
49
  keyboard-only candidate switching.
package/client.js CHANGED
@@ -20,7 +20,38 @@ window.__ModuleLoader__.load({
20
20
  factory(require) {
21
21
  const React = require('react')
22
22
  const h = React.createElement
23
- const { Switch } = require('@deepseek-ai/dsh-client-ui-primitives')
23
+
24
+ /**
25
+ * Local switch button. The host's own switch is a harness Client package,
26
+ * which a bundle must not load: it can change without notice, and a throw
27
+ * would take the whole plugin down. This reproduces its markup, CSS and
28
+ * behaviour with plugin-owned classes and theme tokens only.
29
+ */
30
+ const SWITCH_CSS = [
31
+ '.cp-switch{box-sizing:border-box;position:relative;flex:0 0 auto;width:36px;height:20px;padding:2px;border:0;border-radius:999px;background:var(--dsw-alias-border-l3);cursor:pointer}',
32
+ '.cp-switch[aria-checked="true"]{background:var(--dsw-alias-brand-primary)}',
33
+ '.cp-switch:disabled{cursor:default;opacity:.5}',
34
+ '.cp-switch:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}',
35
+ '.cp-switch__thumb{display:block;width:16px;height:16px;border-radius:50%;background:var(--dsw-alias-label-primary-foreground);transition:transform .12s}',
36
+ '.cp-switch[aria-checked="false"] .cp-switch__thumb{background:var(--dsw-alias-switch-thumb)}',
37
+ '.cp-switch[aria-checked="true"] .cp-switch__thumb{transform:translate(16px)}',
38
+ ].join('')
39
+
40
+ function Switch({ checked, label, onChange, disabled }) {
41
+ return h(
42
+ 'button',
43
+ {
44
+ type: 'button',
45
+ role: 'switch',
46
+ 'aria-checked': checked === true ? 'true' : 'false',
47
+ 'aria-label': label,
48
+ className: 'cp-switch',
49
+ disabled: disabled === true,
50
+ onClick: () => onChange(checked !== true),
51
+ },
52
+ h('span', { className: 'cp-switch__thumb', 'aria-hidden': 'true' }),
53
+ )
54
+ }
24
55
 
25
56
  const NS = 'composer-predictions'
26
57
  const ENDPOINT = '/composer-prediction/v2'
@@ -92,6 +123,7 @@ window.__ModuleLoader__.load({
92
123
  function PredictionsSetting({ t }) {
93
124
  const checked = useEnabled()
94
125
  return h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 24, padding: '16px 0', borderBottom: '0.5px solid var(--dsw-alias-border-l2)' } },
126
+ h('style', null, SWITCH_CSS),
95
127
  h('div', null,
96
128
  h('div', { style: { fontSize: 14, lineHeight: '20px' } }, t('enabled')),
97
129
  h('div', { style: { fontSize: 12, lineHeight: '18px', marginTop: 4, color: 'var(--dsw-alias-label-secondary)' } }, t('description')),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-composer-predictions",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Tab autocomplete for the DeepSeek Harness desktop and web composer: next-message ghost text, inline draft completion and keyboard candidate cycling",
5
5
  "type": "module",
6
6
  "license": "MIT",