@linxin666/dsh-liangshen 0.4.3 → 0.4.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.
@@ -24,6 +24,13 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
24
24
  descriptionKey: TKey;
25
25
  /** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */
26
26
  descriptionNode?: ReactNode;
27
+ /**
28
+ * Optional leading mark identifying the plugin. A card without one keeps the
29
+ * plain official header shape, so the chrome stays a readable sibling of the
30
+ * built-in PluginCard wherever a family plugin lands in the official bundle
31
+ * seat.
32
+ */
33
+ icon?: ReactNode;
27
34
  /** The card's form state: availability, writability, and what a save would do. */
28
35
  state: CardShell;
29
36
  /** Write every staged edit. */
@@ -134,6 +134,8 @@ export declare class CardForm<T> {
134
134
  private readonly disposeForm;
135
135
  private disposed;
136
136
  private saving;
137
+ /** A save asked for while one was in flight; it runs once the first settles (#1754). */
138
+ private saveQueued;
137
139
  private failed;
138
140
  private failedReason;
139
141
  /** @param scope - the bound configuration form for this card's namespace. */
@@ -167,6 +169,20 @@ export declare class CardForm<T> {
167
169
  * the user can correct them instead of retyping.
168
170
  * @returns settlement after the mutation and the read-back.
169
171
  */
172
+ /**
173
+ * Run one save, and re-run it once if another was asked for while this one
174
+ * was still in flight.
175
+ *
176
+ * A save is a Host round trip that also drives the profile reconcile, and
177
+ * the Host runs that write inside one exclusive transaction. Answering a
178
+ * press that arrives mid-flight by returning immediately dropped the edit
179
+ * with no explanation, which is the "the save button stops working after a
180
+ * few rounds" report (#1754). Serializing instead means a save pressed while
181
+ * another is still settling runs against the settled state - which is what
182
+ * the operator meant by pressing it again.
183
+ * @returns settlement after the mutation and the read-back.
184
+ */
185
+ requestSave(): Promise<void>;
170
186
  save(): Promise<void>;
171
187
  /**
172
188
  * Every staged edit a save would write. An entry whose draft is not a value
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-liangshen",
3
3
  "description": "LiangShen (梁神) agent preset plus its composer lever for the dsh web GUI. The host half declares the bundled preset to the harness's agent-preset registry at activation (declare = enabled), so the preset is selectable for new sessions without writing anything into the harness home; the preset keeps a minimal persona with standing working discipline while the harness's own user-role agent-instructions injection delivers the workspace instructions (the optional `instructionSource: system-prompt` mode lifts them into the prompt instead), and declares one tool presentation for the session's whole lifetime (default `presentation: 'both'`, where the wire collapses to the `run_code` transport and every other tool is reached through the generated SDK; `native` keeps the assembled roster, `ptc` keeps only the transport). High-fan-out tool families (default `mcp__*`) stay paged out of the wire until the preset's own `tool_activate` tool loads their namespace (LRU cap three, state replayed from the durable session event stream), and the tool catalog — exactly the on-wire tools plus paged-out namespace summaries — and a one-line working-context projection travel as durable user messages republished only on change. The browser half adds a slot-machine lever left of the model selector on the new-session screen to toggle the mode. Hot-pluggable via cordis.patch.yml + profile symlink, no dsh source changes.",
4
- "version": "0.4.3",
4
+ "version": "0.4.5",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "engines": {
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dsh": {
25
25
  "engines": {
26
- "dsh": ">=0.1.7-rc.2"
26
+ "dsh": ">=0.2.0-rc.2"
27
27
  },
28
28
  "bundle": {
29
29
  "patch": "./cordis.patch.yml"
@@ -40,25 +40,25 @@
40
40
  }
41
41
  },
42
42
  "peerDependencies": {
43
- "@deepseek-ai/dsh": ">=0.1.7-rc.2"
43
+ "@deepseek-ai/dsh": ">=0.2.0-rc.2"
44
44
  },
45
45
  "dependencies": {
46
46
  "@deepseek-ai/schemastery": "^3.18.4"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/cordis": "^4.0.4",
50
- "@deepseek-ai/dsh-agent-preset-registry": "^0.1.7-rc.2",
51
- "@deepseek-ai/dsh-api-remotes": "^0.1.7-rc.2",
52
- "@deepseek-ai/dsh-api-session-controller": "^0.1.7-rc.2",
53
- "@deepseek-ai/dsh-client-connection": "^0.1.7-rc.2",
54
- "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.2",
55
- "@deepseek-ai/dsh-client-store": "^0.1.7-rc.2",
56
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.2",
57
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.2",
58
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.2",
59
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.2",
60
- "@deepseek-ai/dsh-settings": "^0.1.7-rc.2",
61
- "@deepseek-ai/dsh-system-prompt": "^0.1.7-rc.2",
50
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.2.0-rc.2",
51
+ "@deepseek-ai/dsh-api-remotes": "^0.2.0-rc.2",
52
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.0-rc.2",
53
+ "@deepseek-ai/dsh-client-connection": "^0.2.0-rc.2",
54
+ "@deepseek-ai/dsh-client-locale": "^0.2.0-rc.2",
55
+ "@deepseek-ai/dsh-client-store": "^0.2.0-rc.2",
56
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.2",
57
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.0-rc.2",
58
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.2",
59
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.2",
60
+ "@deepseek-ai/dsh-settings": "^0.2.0-rc.2",
61
+ "@deepseek-ai/dsh-system-prompt": "^0.2.0-rc.2",
62
62
  "@testing-library/react": "^16.1.0",
63
63
  "@types/node": "^22.20.0",
64
64
  "@types/react": "~18.3.1",
@@ -41,6 +41,13 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
41
41
  descriptionKey: TKey
42
42
  /** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */
43
43
  descriptionNode?: ReactNode
44
+ /**
45
+ * Optional leading mark identifying the plugin. A card without one keeps the
46
+ * plain official header shape, so the chrome stays a readable sibling of the
47
+ * built-in PluginCard wherever a family plugin lands in the official bundle
48
+ * seat.
49
+ */
50
+ icon?: ReactNode
44
51
  /** The card's form state: availability, writability, and what a save would do. */
45
52
  state: CardShell
46
53
  /** Write every staged edit. */
@@ -91,6 +98,7 @@ export function PluginSettingsCard<TKey extends string = string>(props: PluginSe
91
98
  const header = alwaysOpen === true
92
99
  ? (
93
100
  <div className={css.headerStatic}>
101
+ {props.icon !== undefined ? <span className={css.mark} aria-hidden="true">{props.icon}</span> : null}
94
102
  <span className={css.headText}>
95
103
  <span className={css.name} title={title}>{title}</span>
96
104
  <span className={css.description} title={description}>{props.descriptionNode ?? description}</span>
@@ -106,6 +114,7 @@ export function PluginSettingsCard<TKey extends string = string>(props: PluginSe
106
114
  aria-label={`${props.t(open ? 'settings.collapse' : 'settings.expand')}: ${title}`}
107
115
  onClick={() => { setOpen(!open) }}
108
116
  >
117
+ {props.icon !== undefined ? <span className={css.mark} aria-hidden="true">{props.icon}</span> : null}
109
118
  <span className={css.headText}>
110
119
  <span className={css.name} title={title}>{title}</span>
111
120
  <span className={css.description} title={description}>{props.descriptionNode ?? description}</span>
@@ -36,8 +36,8 @@
36
36
  border: 0;
37
37
  border-radius: 12px;
38
38
  align-items: center;
39
- gap: 12px;
40
- padding: 14px 16px;
39
+ gap: 13px;
40
+ padding: 16px;
41
41
  display: flex;
42
42
  }
43
43
 
@@ -51,8 +51,8 @@
51
51
  box-sizing: border-box;
52
52
  border-radius: 12px;
53
53
  align-items: center;
54
- gap: 12px;
55
- padding: 14px 16px;
54
+ gap: 13px;
55
+ padding: 16px;
56
56
  display: flex;
57
57
  }
58
58
 
@@ -64,6 +64,25 @@
64
64
  display: flex;
65
65
  }
66
66
 
67
+ /* Optional leading plugin mark: a quiet tile that takes the ink color on
68
+ hover and while the card is open, so the whole row reads as one control. */
69
+ .mark {
70
+ flex: none;
71
+ display: grid;
72
+ place-items: center;
73
+ width: 34px;
74
+ height: 34px;
75
+ border-radius: 10px;
76
+ background: var(--dsw-alias-bg-module-platform);
77
+ color: var(--dsw-alias-label-secondary);
78
+ transition: color 0.16s;
79
+ }
80
+
81
+ .header:hover .mark,
82
+ .cardOpen .mark {
83
+ color: var(--dsw-alias-label-primary);
84
+ }
85
+
67
86
  .name {
68
87
  color: var(--dsw-alias-label-primary);
69
88
  font-size: 15px;
@@ -95,7 +114,13 @@
95
114
  .chevron {
96
115
  color: var(--dsw-alias-label-tertiary);
97
116
  flex: none;
98
- transition: transform 0.16s;
117
+ width: 16px;
118
+ height: 16px;
119
+ transition: transform 0.16s, color 0.16s;
120
+ }
121
+
122
+ .header:hover .chevron {
123
+ color: var(--dsw-alias-label-secondary);
99
124
  }
100
125
 
101
126
  .chevronOpen {
@@ -406,6 +431,7 @@
406
431
  @media (prefers-reduced-motion: reduce) {
407
432
  .card,
408
433
  .header,
434
+ .mark,
409
435
  .chevron,
410
436
  .chevronOpen,
411
437
  .discard,
@@ -215,6 +215,8 @@ export class CardForm<T> {
215
215
  private readonly disposeForm: () => void
216
216
  private disposed = false
217
217
  private saving = false
218
+ /** A save asked for while one was in flight; it runs once the first settles (#1754). */
219
+ private saveQueued = false
218
220
  private failed = false
219
221
  private failedReason: string | undefined
220
222
 
@@ -283,7 +285,7 @@ export class CardForm<T> {
283
285
  resetField: (field) => {
284
286
  this.stage(field, { text: this.specOf(field).format(this.baseValue(field)), clear: true })
285
287
  },
286
- save: () => { void this.save() },
288
+ save: () => { void this.requestSave() },
287
289
  discard: () => {
288
290
  if (this.staged.size === 0 && !this.failed) return
289
291
  this.staged.clear()
@@ -310,6 +312,30 @@ export class CardForm<T> {
310
312
  * the user can correct them instead of retyping.
311
313
  * @returns settlement after the mutation and the read-back.
312
314
  */
315
+ /**
316
+ * Run one save, and re-run it once if another was asked for while this one
317
+ * was still in flight.
318
+ *
319
+ * A save is a Host round trip that also drives the profile reconcile, and
320
+ * the Host runs that write inside one exclusive transaction. Answering a
321
+ * press that arrives mid-flight by returning immediately dropped the edit
322
+ * with no explanation, which is the "the save button stops working after a
323
+ * few rounds" report (#1754). Serializing instead means a save pressed while
324
+ * another is still settling runs against the settled state - which is what
325
+ * the operator meant by pressing it again.
326
+ * @returns settlement after the mutation and the read-back.
327
+ */
328
+ async requestSave(): Promise<void> {
329
+ if (this.saving) {
330
+ this.saveQueued = true
331
+ return
332
+ }
333
+ await this.save()
334
+ if (!this.saveQueued) return
335
+ this.saveQueued = false
336
+ await this.requestSave()
337
+ }
338
+
313
339
  async save(): Promise<void> {
314
340
  const plan = this.plan()
315
341
  const valid = plan.filter((item): item is PlannedWrite & { judge: () => boolean } => item.judge !== undefined)