@linxin666/dsh-liangshen 0.4.9 → 0.4.11

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.
@@ -1,15 +1,21 @@
1
1
  /**
2
2
  * Family-shared chrome for plugin settings cards: a disclosure header naming
3
- * the plugin and what its settings govern, the controls inside, and the save
4
- * that writes them. Renders nothing while the namespace is unavailable — a
3
+ * the plugin and what its settings govern, the controls inside, and the line
4
+ * that reports a refused write. A pick is written the moment it is made and a
5
+ * typed value after a pause, so the card has no save button and nothing waits
6
+ * on the reader. Renders nothing while the namespace is unavailable — a
5
7
  * deployment that does not compose the owning plugin should show no trace of
6
8
  * it. Inlined into each consumer's client bundle; mirrors the official
7
9
  * ui-plugin-config PluginCard in a self-contained slice.
10
+ *
11
+ * Every field inside the body is one settings row: the label and its hint on
12
+ * the left, the control on the right, a hairline between two rows; a narrow
13
+ * card stacks the control under the text (settings-card.module.css).
8
14
  */
9
15
  import { type ReactNode } from 'react';
10
16
  import type { CardShell } from './settings-form.ts';
11
17
  /** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */
12
- export declare const CARD_COPY_KEYS: readonly ["settings.collapse", "settings.expand", "settings.notExposed", "settings.unsaved", "settings.readOnly", "settings.saveFailed", "settings.discard", "settings.save", "settings.saving"];
18
+ export declare const CARD_COPY_KEYS: readonly ["settings.collapse", "settings.expand", "settings.notExposed", "settings.readOnly", "settings.saveFailed"];
13
19
  /** Copy key the card chrome itself reads. */
14
20
  export type CardCopyKey = (typeof CARD_COPY_KEYS)[number];
15
21
  /** Key domain for the plugin's own copy (inferred per consumer). */
@@ -39,11 +45,11 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
39
45
  * seat.
40
46
  */
41
47
  icon?: ReactNode;
42
- /** The card's form state: availability, writability, and what a save would do. */
48
+ /** The card's form state: availability, writability, and how the last write went. */
43
49
  state: CardShell;
44
- /** Write every staged edit. */
50
+ /** Write every pending draft now: a text field's Enter or blur. */
45
51
  onSave: () => void;
46
- /** Drop every staged edit. */
52
+ /** Drop every pending draft: a text field's Escape. */
47
53
  onDiscard: () => void;
48
54
  /**
49
55
  * Id applied to the card's title element, so a header control (an immediate
@@ -70,15 +76,15 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
70
76
  */
71
77
  alwaysOpen?: boolean;
72
78
  /**
73
- * Hide the save/discard footer: cards whose body applies its own changes
74
- * immediately (an embedded external settings section) have no staged
75
- * edits, so the footer would sit there permanently disabled.
79
+ * Hide the line under the body that reports a refused write: a card whose
80
+ * body applies its own changes (an embedded external settings section)
81
+ * reports its own failures.
76
82
  */
77
83
  hideFooter?: boolean;
78
84
  /**
79
- * Optional control rendered at the header's trailing edge, before the pending
80
- * badge and the chevron. A card whose setting is one immediate flip (it
81
- * applies outside the staged form) puts its ToggleSwitch here, so the control
85
+ * Optional control rendered at the header's trailing edge, before the
86
+ * chevron. A card whose setting is one immediate flip (it
87
+ * applies outside the card's form) puts its ToggleSwitch here, so the control
82
88
  * is reachable without opening the card and matches a plugin card's shape.
83
89
  */
84
90
  headerAction?: ReactNode;
@@ -118,7 +124,7 @@ export interface FieldProps {
118
124
  hintTitle?: string;
119
125
  /** Draft text this control renders. */
120
126
  text: string;
121
- /** True when saving would leave a user-layer entry for this field. */
127
+ /** True when the field holds a user-layer entry over the inherited value. */
122
128
  overridden: boolean;
123
129
  /** True when the draft is not a value this field accepts. */
124
130
  invalid: boolean;
@@ -130,17 +136,29 @@ export interface FieldProps {
130
136
  invalidLabel: string;
131
137
  /** Disables every control (read-only document, or an unavailable namespace). */
132
138
  disabled: boolean;
133
- /** Stage draft text. */
139
+ /** Take new draft text; the card writes it as the field's entry rule says. */
134
140
  onEdit: (text: string) => void;
135
- /** Stage a clear so the field re-inherits the composition layer. */
141
+ /** Clear the field at once so it re-inherits the composition layer. */
136
142
  onReset: () => void;
137
143
  }
138
- /** A staged value field. `numeric` only hints the keypad: which drafts a field accepts is decided by its spec. */
144
+ /**
145
+ * A typed value field. Its draft is written after a pause in typing, at once on
146
+ * Enter or when focus leaves, and Escape puts the stored value back. `numeric`
147
+ * only hints the keypad: which drafts a field accepts is decided by its spec.
148
+ * A field given a `range` also offers the coarse slider bubble: dragging fills
149
+ * the draft live and releasing writes it.
150
+ */
139
151
  export declare function ValueField(props: FieldProps & {
140
152
  /** Hints a numeric keypad without narrowing what the control accepts. */
141
153
  numeric?: boolean;
142
154
  /** Placeholder shown while the draft is empty. */
143
155
  placeholder?: string;
156
+ /** Bounds of a numeric field, for the coarse slider; the spec still judges every draft. */
157
+ range?: {
158
+ min: number;
159
+ max: number;
160
+ step: number;
161
+ };
144
162
  }): import("react").JSX.Element;
145
163
  interface SelectOption {
146
164
  value: string;
@@ -151,8 +169,8 @@ interface SelectOption {
151
169
  * renders the legacy native `<select>` untouched, so element-level skin
152
170
  * selectors keep working; under the default appearance it renders a
153
171
  * self-drawn `role="listbox"` popup whose open/close is transition-animated.
154
- * Staged cards reach it through BooleanField/ChoiceField; immediate-apply
155
- * editors (the side-card prefs) bind it directly through onEdit.
172
+ * Cards reach it through BooleanField/ChoiceField; editors outside a card
173
+ * (the side-card prefs) bind it directly through onEdit.
156
174
  * 双模式下拉框:皮肤激活时用原生 select,默认外观用自绘动画弹层。
157
175
  */
158
176
  export declare function SelectField(props: {
@@ -163,7 +181,25 @@ export declare function SelectField(props: {
163
181
  invalid: boolean;
164
182
  onEdit: (text: string) => void;
165
183
  }): import("react").JSX.Element;
166
- /** A staged boolean field: 继承 / 开 / 关. */
184
+ /**
185
+ * A visible segmented group for a small set of mutually exclusive values.
186
+ * Every option stays on screen, so inherit/on/off and short enum fields take
187
+ * one click without opening a popup. The pressed option carries the group's
188
+ * sliding highlight and `aria-pressed`; the group takes the field label as its
189
+ * accessible name.
190
+ */
191
+ export declare function SegmentField(props: {
192
+ id: string;
193
+ label: string;
194
+ options: ReadonlyArray<SelectOption>;
195
+ value: string;
196
+ disabled: boolean;
197
+ invalid: boolean;
198
+ onEdit: (text: string) => void;
199
+ }): import("react").JSX.Element;
200
+ /** How a small single-choice field presents its options. */
201
+ export type FieldPresentation = 'select' | 'segment';
202
+ /** A boolean field: 继承 / 开 / 关. */
167
203
  export declare function BooleanField(props: FieldProps & {
168
204
  /** Copy for the inherit option. */
169
205
  inheritLabel: string;
@@ -171,8 +207,10 @@ export declare function BooleanField(props: FieldProps & {
171
207
  onLabel: string;
172
208
  /** Copy for the off option. */
173
209
  offLabel: string;
210
+ /** Defaults to the visible segments: the three answers always fit on one row. */
211
+ presentation?: FieldPresentation;
174
212
  }): import("react").JSX.Element;
175
- /** A staged enumerated field rendered as a select. */
213
+ /** An enumerated field, selecting or segmenting its small choice set. */
176
214
  export declare function ChoiceField(props: FieldProps & {
177
215
  /** Copy for the inherit option (draft text is the empty string). */
178
216
  inheritLabel: string;
@@ -181,13 +219,22 @@ export declare function ChoiceField(props: FieldProps & {
181
219
  value: string;
182
220
  label: string;
183
221
  }>;
222
+ /**
223
+ * Visible segmented options for a short fixed set; defaults to the compact
224
+ * select, which also suits a list whose length follows the deployment.
225
+ */
226
+ presentation?: FieldPresentation;
184
227
  }): import("react").JSX.Element;
185
228
  /**
186
- * An immediate boolean toggle drawn as a switch track, for a setting that
187
- * applies on flip rather than through a staged save. It is a real button with
229
+ * A boolean toggle drawn as a switch track, for a setting that is only on or
230
+ * off and applies on flip. It is a real button with
188
231
  * `role="switch"` and `aria-checked`, so keyboard and assistive activation
189
232
  * arrive as a click and the state is announced instead of inferred from a
190
233
  * checkbox tick.
234
+ *
235
+ * The thumb bounces across only once the reader has pressed this switch: the
236
+ * press writes the mark that arms the bounce, so a page opening, a TAB
237
+ * switching back or a value arriving from elsewhere draws every thumb at rest.
191
238
  */
192
239
  export declare function ToggleSwitch(props: {
193
240
  /** Id of the element naming the switch (the card's title). */
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Coarse adjustment for a bounded number: resting the pointer on the control
3
+ * (or moving focus into it) raises a small bubble holding a slider across the
4
+ * field's whole range, so a large change is one drag instead of many presses
5
+ * or a retyped value. The control itself stays the precise entry.
6
+ *
7
+ * The bubble belongs to the anchor's subtree, so moving from the control onto
8
+ * the bubble never counts as leaving. It opens after a short rest and closes a
9
+ * moment after the pointer and focus have both gone, so crossing the control
10
+ * on the way elsewhere does not flash it. While a drag is in progress the
11
+ * bubble stays put even if the pointer strays off it.
12
+ *
13
+ * Dragging reports each value through `onInput`, so the field shows it live;
14
+ * releasing the thumb, or a key press on it, reports `onCommit` once. The
15
+ * bubble opens on the side of the control that has room inside the nearest
16
+ * scrolling ancestor, so a row near the top of a settings page does not hang
17
+ * its bubble under the page edge.
18
+ */
19
+ import { type ReactNode } from 'react';
20
+ /** Props of {@link RangeBubble}. */
21
+ export interface RangeBubbleProps {
22
+ /** Lowest value the slider reaches. */
23
+ min: number;
24
+ /** Highest value the slider reaches. */
25
+ max: number;
26
+ /** Slider granularity. */
27
+ step: number;
28
+ /** Current value; a value outside the range parks the thumb at the nearer end. */
29
+ value: number;
30
+ /** Accessible name of the slider. */
31
+ label: string;
32
+ /** Disables the bubble along with the control. */
33
+ disabled?: boolean;
34
+ /** Each value while the thumb moves. */
35
+ onInput: (value: number) => void;
36
+ /** The value the thumb was released on, once per drag or key press. */
37
+ onCommit: (value: number) => void;
38
+ /** The precise control the bubble hangs off. */
39
+ children: ReactNode;
40
+ }
41
+ /**
42
+ * Render the control with its coarse-adjustment bubble.
43
+ * @param props - the range, the value and the two report callbacks.
44
+ * @returns the anchor holding the control and the bubble.
45
+ */
46
+ export declare function RangeBubble(props: RangeBubbleProps): ReactNode;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The family's segmented control: a quiet track whose options share one
3
+ * highlight that slides to the pressed option, instead of each option fading
4
+ * its own background out and the next one in. The settings fields' small
5
+ * choices and the Web Extensions TAB strip both render through it, so the two
6
+ * read as one control.
7
+ *
8
+ * The caller builds the option buttons and marks the pressed one with
9
+ * `data-active`; the group measures that button after every render and writes
10
+ * its box as four custom properties, and the stylesheet draws the highlight
11
+ * there (`.segmentGroup[data-pill]::before`). Attribute and first placement
12
+ * land in the same task, so the highlight appears in place and only later
13
+ * changes slide. A ResizeObserver re-measures when the group or an option
14
+ * changes size: a longer locale, a font arriving, a container growing, a
15
+ * strip wrapping onto a second line.
16
+ */
17
+ import { type HTMLAttributes, type ReactNode } from 'react';
18
+ /** Props of {@link SegmentGroup}: the track's own attributes and the option buttons. */
19
+ export interface SegmentGroupProps extends HTMLAttributes<HTMLDivElement> {
20
+ /** The option buttons; the pressed one carries `data-active`. */
21
+ children: ReactNode;
22
+ }
23
+ /**
24
+ * Render a segmented track around the caller's option buttons.
25
+ * @param props - the track's attributes (role, accessible name, key handler) and its options.
26
+ * @returns the track.
27
+ */
28
+ export declare function SegmentGroup(props: SegmentGroupProps): ReactNode;
@@ -39,10 +39,6 @@ export declare const zh: {
39
39
  'settings.readOnly': string;
40
40
  'settings.expand': string;
41
41
  'settings.collapse': string;
42
- 'settings.save': string;
43
- 'settings.saving': string;
44
- 'settings.discard': string;
45
- 'settings.unsaved': string;
46
42
  'settings.saveFailed': string;
47
43
  'settings.invalidValue': string;
48
44
  'presentation.ptc': string;
@@ -47,6 +47,8 @@ export declare const FAMILY_GROUP_SERVICE = "webUiSettings";
47
47
  export interface PluginCardSlots {
48
48
  /** Contribution of one card entry. */
49
49
  register(options: never, component: never): unknown;
50
+ /** Declaration probe: a target seat may appear after this plugin applies. */
51
+ spec?(key: string): unknown;
50
52
  }
51
53
  /** The slice of the client context a card contribution needs. */
52
54
  export interface PluginCardContext {
@@ -1,14 +1,15 @@
1
1
  /**
2
- * Staged form model behind the plugin settings card. A card stages what the
3
- * user types and writes it only when they save — the settings write is a
4
- * durable, revision-fenced document mutation, so staging keeps what is on
5
- * screen exactly what a save would store. Family-shared slice inlined into
6
- * each plugin's client bundle; mirrors the official ui-plugin-config
7
- * card-store pattern.
2
+ * Form model behind the plugin settings card. Every control applies itself:
3
+ * a pick (a segment, a select option, a reset) writes the moment it is made,
4
+ * and typed text writes once typing pauses or the reader leaves the field.
5
+ * Between the edit and the write the edit is held here as a draft, so what is
6
+ * on screen is exactly what the write will store; a write the Host refuses
7
+ * puts a pick back to the stored value and keeps typed text for correcting.
8
+ * Family-shared slice inlined into each plugin's client bundle.
8
9
  */
9
10
  import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
10
11
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
11
- /** The write one field's staged text performs when the card is saved. */
12
+ /** The write one field's draft text performs when it is applied. */
12
13
  export type FieldWrite = {
13
14
  kind: 'set';
14
15
  value: unknown;
@@ -19,6 +20,12 @@ export type FieldWrite = {
19
20
  export interface FieldSpec {
20
21
  /** Field name inside the namespace section. */
21
22
  field: string;
23
+ /**
24
+ * How the reader enters a value, which decides when it is written: a `pick`
25
+ * is a whole value at once and applies immediately; `type` is text arriving
26
+ * a keystroke at a time and applies once typing pauses or the field is left.
27
+ */
28
+ entry: 'pick' | 'type';
22
29
  /**
23
30
  * Whether the Host treats this field as a secret and redacts its value from
24
31
  * the read-back (role('secret') in the section schema). Redacted secrets are
@@ -32,8 +39,9 @@ export interface FieldSpec {
32
39
  /** Render a stored value as draft text; the empty string when the section carries none. */
33
40
  format: (value: unknown) => string;
34
41
  /**
35
- * The write this draft text stages, or undefined when the text is not a
36
- * value this field accepts — which blocks the save rather than discarding it.
42
+ * The write this draft text performs, or undefined when the text is not a
43
+ * value this field accepts — which holds the draft unwritten rather than
44
+ * discarding it.
37
45
  */
38
46
  parse: (text: string) => FieldWrite | undefined;
39
47
  }
@@ -41,9 +49,9 @@ export interface FieldSpec {
41
49
  export interface FieldState {
42
50
  /** Draft text the control renders. */
43
51
  text: string;
44
- /** Whether saving would leave a user-layer entry for this field. */
52
+ /** Whether the field leaves (or will leave) a user-layer entry. */
45
53
  overridden: boolean;
46
- /** Whether the draft is not a value this field accepts, which blocks saving. */
54
+ /** Whether the draft is not a value this field accepts, which holds it unwritten. */
47
55
  invalid: boolean;
48
56
  }
49
57
  /** Form state every plugin settings card shares. */
@@ -60,13 +68,13 @@ export interface CardShell {
60
68
  exposed: boolean;
61
69
  /** Whether the Host document accepts writes. */
62
70
  writable: boolean;
63
- /** Whether the form holds edits that a save would write. */
71
+ /** Whether the form holds drafts not yet written (typed text waiting for its pause). */
64
72
  dirty: boolean;
65
- /** Whether any staged draft is invalid, which blocks the save. */
73
+ /** Whether any draft is invalid, which holds it unwritten. */
66
74
  invalid: boolean;
67
- /** Whether a save is crossing the wire. */
75
+ /** Whether a write is crossing the wire. */
68
76
  saving: boolean;
69
- /** Whether the last save did not land as staged; cleared by the next edit or save. */
77
+ /** Whether the last write did not land; cleared by the next edit or write. */
70
78
  failed: boolean;
71
79
  /**
72
80
  * The rejection code/message the Host returned for the last failed save,
@@ -77,15 +85,17 @@ export interface CardShell {
77
85
  }
78
86
  /** The write actions the card's slot entry injects. */
79
87
  export interface CardActions {
80
- /** Stage draft text for one field. */
88
+ /** Take draft text for one field; a pick writes at once, typed text after a pause. */
81
89
  edit: (field: string, text: string) => void;
82
- /** Stage a clear, so saving lets the field re-inherit the composition layer. */
90
+ /** Clear one field at once, so it re-inherits the composition layer. */
83
91
  resetField: (field: string) => void;
84
- /** Write every staged edit, then re-seed from what the Host accepted. */
92
+ /** Write every pending draft now (a text field's Enter or blur), then re-seed from what the Host accepted. */
85
93
  save: () => void;
86
- /** Drop every staged edit. */
94
+ /** Drop every pending draft, putting each control back to the stored value (a text field's Escape). */
87
95
  discard: () => void;
88
96
  }
97
+ /** How long typed text rests before it is written. */
98
+ export declare const TYPE_PAUSE_MS = 600;
89
99
  /** One durable write inside the save's atomic form mutation. */
90
100
  export interface BatchedWrite {
91
101
  /** Field this entry writes. */
@@ -102,10 +112,13 @@ export interface NumberConstraints {
102
112
  /** The accepted value must be at least this. */
103
113
  min?: number;
104
114
  }
105
- /** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints blocks the save. */
115
+ /** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints stays unwritten. */
106
116
  export declare function numberField(field: string, constraints?: NumberConstraints): FieldSpec;
107
- /** A free-text field. An empty draft clears the field. */
108
- export declare function textField(field: string): FieldSpec;
117
+ /**
118
+ * A free-text field. An empty draft clears the field. `entry` is `pick` when
119
+ * the text arrives whole from a picker (a preset or a reasoning level).
120
+ */
121
+ export declare function textField(field: string, entry?: FieldSpec['entry']): FieldSpec;
109
122
  /**
110
123
  * A free-text field the Host treats as a secret and redacts from the read-back
111
124
  * (role('secret') in the section schema). The card still edits it like text,
@@ -118,12 +131,14 @@ export declare function booleanField(field: string): FieldSpec;
118
131
  /** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */
119
132
  export declare function choiceField(field: string, choices: readonly string[]): FieldSpec;
120
133
  /**
121
- * Stages one card's edits over one settings namespace and writes them on save.
134
+ * Applies one card's edits to one settings namespace as the reader makes them.
122
135
  *
123
136
  * The Host is the only authority on whether a value was accepted — its
124
137
  * validators own the constraints no schema can express — so the outcome is
125
- * read back from the section rather than predicted here. A save that did not
126
- * land keeps its drafts, so the user can correct them instead of retyping.
138
+ * read back from the section rather than predicted here. A write that did not
139
+ * land puts each pick back to the stored value, the way a switch that could not
140
+ * flip springs back, and keeps typed text so the reader can correct it instead
141
+ * of retyping.
127
142
  */
128
143
  export declare class CardForm<T> {
129
144
  private readonly scope;
@@ -133,6 +148,8 @@ export declare class CardForm<T> {
133
148
  /** The form subscription installed in the constructor; released by dispose(). */
134
149
  private readonly disposeForm;
135
150
  private disposed;
151
+ /** The pending write of typed text, waiting for typing to pause. */
152
+ private typePause;
136
153
  private saving;
137
154
  /** A save asked for while one was in flight; it runs once the first settles (#1754). */
138
155
  private saveQueued;
@@ -147,47 +164,46 @@ export declare class CardForm<T> {
147
164
  dispose(): void;
148
165
  /** Publish a projection of this form, rebuilt whenever the form or a draft changes. */
149
166
  bind<S>(project: () => S): SnapshotStore<S>;
150
- /** Read the card-level state: what the Host serves, and what a save would do. */
167
+ /** Read the card-level state: what the Host serves, and what is still waiting to be written. */
151
168
  shell(): CardShell;
152
169
  /** Read one field's state from the effective section and its staged draft. */
153
170
  field(field: string): FieldState;
154
171
  /** The actions the card's slot registration injects. */
155
172
  actions(): CardActions;
156
173
  /**
157
- * Write every staged edit in one atomic form mutation, then re-seed from
158
- * what the Host accepted.
174
+ * Run one write, and re-run it once if another was asked for while this one
175
+ * was still in flight.
159
176
  *
160
- * The whole batch rides one mutate, so cross-field validate hooks
161
- * (baseURL+model) judge it as a unit: the Host either applies every write
162
- * or refuses the batch. The form contract answers a refusal or a skipped
163
- * write with `false` (it recovers with a fresh Host view instead of
164
- * throwing), so the outcome is judged twice: the answer itself, and then the
165
- * settled snapshot read back one planned write at a time. One missed write
166
- * fails the whole save. A transport that rejects instead (the dsh-web bridge
167
- * controller on a dead connection) reports through the same failure path
168
- * with its rejection message. A save that did not land keeps its drafts, so
169
- * the user can correct them instead of retyping.
177
+ * A write is a Host round trip that also drives the profile reconcile, and
178
+ * the Host runs it inside one exclusive transaction. Answering an edit that
179
+ * arrives mid-flight by returning immediately dropped it with no explanation
180
+ * (#1754). Serializing instead means an edit made while another write is
181
+ * still settling is written against the settled state.
170
182
  * @returns settlement after the mutation and the read-back.
171
183
  */
184
+ requestSave(): Promise<void>;
172
185
  /**
173
- * Run one save, and re-run it once if another was asked for while this one
174
- * was still in flight.
186
+ * Write every valid draft in one atomic form mutation, then re-seed from
187
+ * what the Host accepted. A draft the field does not accept stays on screen,
188
+ * unwritten, without holding the others back.
175
189
  *
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.
190
+ * The batch rides one mutate, so cross-field validate hooks (baseURL+model)
191
+ * judge it as a unit: the Host either applies every write or refuses the
192
+ * batch. The form contract answers a refusal or a skipped write with `false`
193
+ * (it recovers with a fresh Host view instead of throwing), so the outcome is
194
+ * judged twice: the answer itself, and then the settled snapshot read back
195
+ * one planned write at a time. One missed write fails the whole batch. A
196
+ * transport that rejects instead (the dsh-web bridge controller on a dead
197
+ * connection) reports through the same failure path with its rejection
198
+ * message. A batch that did not land puts its picks and clears back to the
199
+ * stored value and keeps its typed text, so the reader can correct it.
183
200
  * @returns settlement after the mutation and the read-back.
184
201
  */
185
- requestSave(): Promise<void>;
186
202
  save(): Promise<void>;
187
203
  /**
188
- * Every staged edit a save would write. An entry whose draft is not a value
189
- * its field accepts carries no write: the form is still dirty, and the save
190
- * refuses rather than dropping the edit. A staged edit that matches the
204
+ * Every staged edit a write would carry. An entry whose draft is not a value
205
+ * its field accepts carries no write: the form is still dirty, and the draft
206
+ * stays on screen rather than being dropped. A staged edit that matches the
191
207
  * effective section is not a write at all.
192
208
  * @returns the planned writes, in the order the fields were staged.
193
209
  */
@@ -202,7 +218,13 @@ export declare class CardForm<T> {
202
218
  * user layer once the mutation has settled.
203
219
  */
204
220
  private landedUnset;
221
+ /**
222
+ * Take one edit and schedule its write: a pick or a clear is written now,
223
+ * typed text once typing has rested for TYPE_PAUSE_MS.
224
+ */
205
225
  private stage;
226
+ /** Write every pending draft now, taking the place of a waiting pause. */
227
+ private applyNow;
206
228
  private specOf;
207
229
  private snapshotOf;
208
230
  private sectionValue;
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: `ptc` by default (the wire collapses to `run_code` and every other tool is reached through the generated SDK), with `native` as the explicit assembled-roster option. 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 reachable 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.9",
4
+ "version": "0.4.11",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "engines": {
@@ -149,6 +149,7 @@ export function LiangShenSettingsCard(props: LiangShenSettingsCardProps) {
149
149
  label={t('settings.presentation')}
150
150
  hint={t('settings.presentationHint')}
151
151
  choices={PRESENTATION_CHOICES.map(choice => ({ value: choice, label: t(`presentation.${choice}`) }))}
152
+ presentation="segment"
152
153
  {...fieldProps}
153
154
  {...state.presentation}
154
155
  onEdit={(text) => { props.edit('presentation', text) }}