@linxin666/dsh-liangshen 0.3.23 → 0.4.0
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.i18n.yaml +2 -2
- package/README.md +55 -41
- package/README.zh.md +54 -40
- package/cordis.patch.yml +3 -2
- package/icon.svg +3 -0
- package/lib/client.js +1380 -29
- package/lib/client.js.map +1 -1
- package/lib/index.js +616 -367
- package/lib/types/announce.test.d.ts +10 -0
- package/lib/types/client/LiangShenSettingsCard.d.ts +78 -0
- package/lib/types/client/PluginSettingsCard.d.ts +137 -0
- package/lib/types/client/index.d.ts +57 -4
- package/lib/types/client/lever-controller.d.ts +16 -2
- package/lib/types/client/locales.d.ts +40 -1
- package/lib/types/client/main-session.d.ts +32 -0
- package/lib/types/client/plugin-card-seat.d.ts +103 -0
- package/lib/types/client/settings-form.d.ts +197 -0
- package/lib/types/composition.d.ts +116 -0
- package/lib/types/composition.test.d.ts +7 -0
- package/lib/types/core/lever.d.ts +6 -3
- package/lib/types/index.d.ts +160 -33
- package/lib/types/index.test.d.ts +5 -0
- package/package.json +27 -18
- package/presets/liangshen/NOTICE +4 -4
- package/presets/liangshen/agent.cordis.yml +168 -123
- package/presets/liangshen/fact-ledger.mjs +141 -0
- package/presets/liangshen/guard.mjs +426 -0
- package/presets/liangshen/minimal-prompt.mjs +73 -38
- package/presets/liangshen/paging.mjs +232 -0
- package/presets/liangshen/tool-activate.mjs +176 -0
- package/presets/liangshen/tool-catalog.mjs +615 -219
- package/presets/liangshen/working-context.mjs +222 -0
- package/src/announce.test.ts +248 -55
- package/src/client/LiangShenLever.module.css +2 -0
- package/src/client/LiangShenLever.tsx +41 -10
- package/src/client/LiangShenSettingsCard.tsx +233 -0
- package/src/client/PluginSettingsCard.tsx +555 -0
- package/src/client/index.ts +102 -5
- package/src/client/lever-controller.ts +76 -9
- package/src/client/locales.ts +79 -1
- package/src/client/main-session.ts +43 -0
- package/src/client/plugin-card-seat.ts +192 -0
- package/src/client/settings-card.module.css +418 -0
- package/src/client/settings-form.ts +442 -0
- package/src/composition.test.ts +294 -0
- package/src/composition.ts +554 -0
- package/src/core/lever.ts +7 -4
- package/src/index.test.ts +68 -1
- package/src/index.ts +293 -101
- package/tools/benchmark-live-run.mjs +193 -63
- package/lib/types/schema.d.ts +0 -18
- package/lib/types/schema.test.d.ts +0 -1
- package/lib/types/sync.d.ts +0 -47
- package/lib/types/sync.test.d.ts +0 -1
- package/presets/liangshen/custom-bash.mjs +0 -213
- package/src/schema.test.ts +0 -64
- package/src/schema.ts +0 -110
- package/src/sync.test.ts +0 -224
- package/src/sync.ts +0 -222
|
@@ -0,0 +1,197 @@
|
|
|
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.
|
|
8
|
+
*/
|
|
9
|
+
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
10
|
+
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
11
|
+
/** The write one field's staged text performs when the card is saved. */
|
|
12
|
+
export type FieldWrite = {
|
|
13
|
+
kind: 'set';
|
|
14
|
+
value: unknown;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'clear';
|
|
17
|
+
};
|
|
18
|
+
/** How one field converts between its stored value and its draft text. */
|
|
19
|
+
export interface FieldSpec {
|
|
20
|
+
/** Field name inside the namespace section. */
|
|
21
|
+
field: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the Host treats this field as a secret and redacts its value from
|
|
24
|
+
* the read-back (role('secret') in the section schema). Redacted secrets are
|
|
25
|
+
* never compared against the draft on save: the Host strips them from every
|
|
26
|
+
* wire view layer, so the settled snapshot carries nothing to read back. A
|
|
27
|
+
* staged secret set is judged by the mutation settling; the rest of its
|
|
28
|
+
* batch, when one exists, is still judged by read-back, and the atomic
|
|
29
|
+
* mutation lands every write or none.
|
|
30
|
+
*/
|
|
31
|
+
secret?: boolean;
|
|
32
|
+
/** Render a stored value as draft text; the empty string when the section carries none. */
|
|
33
|
+
format: (value: unknown) => string;
|
|
34
|
+
/**
|
|
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.
|
|
37
|
+
*/
|
|
38
|
+
parse: (text: string) => FieldWrite | undefined;
|
|
39
|
+
}
|
|
40
|
+
/** One field as the card renders it. */
|
|
41
|
+
export interface FieldState {
|
|
42
|
+
/** Draft text the control renders. */
|
|
43
|
+
text: string;
|
|
44
|
+
/** Whether saving would leave a user-layer entry for this field. */
|
|
45
|
+
overridden: boolean;
|
|
46
|
+
/** Whether the draft is not a value this field accepts, which blocks saving. */
|
|
47
|
+
invalid: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Form state every plugin settings card shares. */
|
|
50
|
+
export interface CardShell {
|
|
51
|
+
/** False while the namespace is still loading; the card renders nothing. */
|
|
52
|
+
available: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the namespace is actually served to this client. False when the
|
|
55
|
+
* Host deployment does not expose it (e.g. the owning plugin's settings
|
|
56
|
+
* domain is not mounted): the card renders an explanation
|
|
57
|
+
* instead of its form, so a missing namespace never looks like a missing
|
|
58
|
+
* plugin.
|
|
59
|
+
*/
|
|
60
|
+
exposed: boolean;
|
|
61
|
+
/** Whether the Host document accepts writes. */
|
|
62
|
+
writable: boolean;
|
|
63
|
+
/** Whether the form holds edits that a save would write. */
|
|
64
|
+
dirty: boolean;
|
|
65
|
+
/** Whether any staged draft is invalid, which blocks the save. */
|
|
66
|
+
invalid: boolean;
|
|
67
|
+
/** Whether a save is crossing the wire. */
|
|
68
|
+
saving: boolean;
|
|
69
|
+
/** Whether the last save did not land as staged; cleared by the next edit or save. */
|
|
70
|
+
failed: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The rejection code/message the Host returned for the last failed save,
|
|
73
|
+
* surfaced next to the generic failure text. Undefined while no save has
|
|
74
|
+
* failed (or the failure carried no server reason).
|
|
75
|
+
*/
|
|
76
|
+
failedReason?: string;
|
|
77
|
+
}
|
|
78
|
+
/** The write actions the card's slot entry injects. */
|
|
79
|
+
export interface CardActions {
|
|
80
|
+
/** Stage draft text for one field. */
|
|
81
|
+
edit: (field: string, text: string) => void;
|
|
82
|
+
/** Stage a clear, so saving lets the field re-inherit the composition layer. */
|
|
83
|
+
resetField: (field: string) => void;
|
|
84
|
+
/** Write every staged edit, then re-seed from what the Host accepted. */
|
|
85
|
+
save: () => void;
|
|
86
|
+
/** Drop every staged edit. */
|
|
87
|
+
discard: () => void;
|
|
88
|
+
}
|
|
89
|
+
/** One durable write inside the save's atomic form mutation. */
|
|
90
|
+
export interface BatchedWrite {
|
|
91
|
+
/** Field this entry writes. */
|
|
92
|
+
field: string;
|
|
93
|
+
/** set stores a value; unset drops the leaf. */
|
|
94
|
+
op: 'set' | 'unset';
|
|
95
|
+
/** Value for op set (absent for unset). */
|
|
96
|
+
value?: unknown;
|
|
97
|
+
}
|
|
98
|
+
/** Constraints a numeric field's accepted drafts must satisfy, mirroring the host schema. */
|
|
99
|
+
export interface NumberConstraints {
|
|
100
|
+
/** The accepted value must be a whole number. */
|
|
101
|
+
integer?: boolean;
|
|
102
|
+
/** The accepted value must be at least this. */
|
|
103
|
+
min?: number;
|
|
104
|
+
}
|
|
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. */
|
|
106
|
+
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;
|
|
109
|
+
/**
|
|
110
|
+
* A free-text field the Host treats as a secret and redacts from the read-back
|
|
111
|
+
* (role('secret') in the section schema). The card still edits it like text,
|
|
112
|
+
* but a save never compares the redacted value back: the staged set is judged
|
|
113
|
+
* by the mutation settling (see {@link FieldSpec.secret}).
|
|
114
|
+
*/
|
|
115
|
+
export declare function secretField(field: string): FieldSpec;
|
|
116
|
+
/** A boolean field, edited through true/false draft text. */
|
|
117
|
+
export declare function booleanField(field: string): FieldSpec;
|
|
118
|
+
/** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */
|
|
119
|
+
export declare function choiceField(field: string, choices: readonly string[]): FieldSpec;
|
|
120
|
+
/**
|
|
121
|
+
* Stages one card's edits over one settings namespace and writes them on save.
|
|
122
|
+
*
|
|
123
|
+
* The Host is the only authority on whether a value was accepted — its
|
|
124
|
+
* 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.
|
|
127
|
+
*/
|
|
128
|
+
export declare class CardForm<T> {
|
|
129
|
+
private readonly scope;
|
|
130
|
+
private readonly specs;
|
|
131
|
+
private readonly staged;
|
|
132
|
+
private readonly listeners;
|
|
133
|
+
/** The form subscription installed in the constructor; released by dispose(). */
|
|
134
|
+
private readonly disposeForm;
|
|
135
|
+
private disposed;
|
|
136
|
+
private saving;
|
|
137
|
+
private failed;
|
|
138
|
+
private failedReason;
|
|
139
|
+
/** @param scope - the bound configuration form for this card's namespace. */
|
|
140
|
+
constructor(scope: ConfigForm<T>, specs: FieldSpec[]);
|
|
141
|
+
/**
|
|
142
|
+
* Release the form subscription and every bound store listener. The card
|
|
143
|
+
* must call this on teardown; later calls are no-ops.
|
|
144
|
+
*/
|
|
145
|
+
dispose(): void;
|
|
146
|
+
/** Publish a projection of this form, rebuilt whenever the form or a draft changes. */
|
|
147
|
+
bind<S>(project: () => S): SnapshotStore<S>;
|
|
148
|
+
/** Read the card-level state: what the Host serves, and what a save would do. */
|
|
149
|
+
shell(): CardShell;
|
|
150
|
+
/** Read one field's state from the effective section and its staged draft. */
|
|
151
|
+
field(field: string): FieldState;
|
|
152
|
+
/** The actions the card's slot registration injects. */
|
|
153
|
+
actions(): CardActions;
|
|
154
|
+
/**
|
|
155
|
+
* Write every staged edit in one atomic form mutation, then re-seed from
|
|
156
|
+
* what the Host accepted.
|
|
157
|
+
*
|
|
158
|
+
* The whole batch rides one mutate, so cross-field validate hooks
|
|
159
|
+
* (baseURL+model) judge it as a unit: the Host either applies every write
|
|
160
|
+
* or refuses the batch. The form contract answers a refusal or a skipped
|
|
161
|
+
* write with `false` (it recovers with a fresh Host view instead of
|
|
162
|
+
* throwing), so the outcome is judged twice: the answer itself, and then the
|
|
163
|
+
* settled snapshot read back one planned write at a time. One missed write
|
|
164
|
+
* fails the whole save. A transport that rejects instead (the dsh-web bridge
|
|
165
|
+
* controller on a dead connection) reports through the same failure path
|
|
166
|
+
* with its rejection message. A save that did not land keeps its drafts, so
|
|
167
|
+
* the user can correct them instead of retyping.
|
|
168
|
+
* @returns settlement after the mutation and the read-back.
|
|
169
|
+
*/
|
|
170
|
+
save(): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Every staged edit a save would write. An entry whose draft is not a value
|
|
173
|
+
* its field accepts carries no write: the form is still dirty, and the save
|
|
174
|
+
* refuses rather than dropping the edit. A staged edit that matches the
|
|
175
|
+
* effective section is not a write at all.
|
|
176
|
+
* @returns the planned writes, in the order the fields were staged.
|
|
177
|
+
*/
|
|
178
|
+
private plan;
|
|
179
|
+
/**
|
|
180
|
+
* Read-back judgment for a planned set: the user layer must hold the
|
|
181
|
+
* intended value once the mutation has settled.
|
|
182
|
+
*/
|
|
183
|
+
private landedSet;
|
|
184
|
+
/**
|
|
185
|
+
* Read-back judgment for a planned unset: the field must be gone from the
|
|
186
|
+
* user layer once the mutation has settled.
|
|
187
|
+
*/
|
|
188
|
+
private landedUnset;
|
|
189
|
+
private stage;
|
|
190
|
+
private specOf;
|
|
191
|
+
private snapshotOf;
|
|
192
|
+
private sectionValue;
|
|
193
|
+
private baseValue;
|
|
194
|
+
private userLayer;
|
|
195
|
+
private stored;
|
|
196
|
+
private publish;
|
|
197
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The LiangShen preset's composition reader: just enough YAML to turn the
|
|
3
|
+
* bundled `presets/liangshen/agent.cordis.yml` — and the flat `preset.yml`
|
|
4
|
+
* display map beside it — into the declaration the agent-preset registry takes.
|
|
5
|
+
*
|
|
6
|
+
* Under 0.1.7 a preset is an ordinary registry declaration instead of a
|
|
7
|
+
* directory the harness discovers, so this plugin hands `ctx.agentPresets` the
|
|
8
|
+
* rows of its OWN composition. No YAML package is resolvable from this package
|
|
9
|
+
* and the harness's reader is not importable from here, so the subset is owned
|
|
10
|
+
* here; the shipped composition is the only file it must read, and tests fence
|
|
11
|
+
* it against that whole file. Supported: block maps and sequences, quoted and
|
|
12
|
+
* plain scalars, single-line flow sequences, literal and folded block scalars,
|
|
13
|
+
* comments, and `!!js` expressions preserved as data (`{ __jsExpr }`, the shape
|
|
14
|
+
* the Loader itself hands a plugin).
|
|
15
|
+
*
|
|
16
|
+
* Fail-closed: a construct outside the subset — anchors, aliases, tags other
|
|
17
|
+
* than `!!js`, nested flow collections, multiple documents, tabs — raises
|
|
18
|
+
* {@link CompositionError} rather than being guessed at, so an unreadable
|
|
19
|
+
* composition is refused instead of half-declared.
|
|
20
|
+
*
|
|
21
|
+
* Relative module names (`name: ./minimal-prompt.mjs`) are resolved against
|
|
22
|
+
* the preset directory handed to {@link readCompositionRows} and emitted as
|
|
23
|
+
* file URLs: the registry mounts a declaration under the DECLARING LOADER's
|
|
24
|
+
* base, so a relative name would otherwise be resolved outside this package.
|
|
25
|
+
* @module @linxin666/dsh-liangshen/composition
|
|
26
|
+
*/
|
|
27
|
+
import type { PresetDefinition } from '@deepseek-ai/dsh-agent-preset-registry';
|
|
28
|
+
/** A construct outside the supported subset, or malformed YAML. */
|
|
29
|
+
export declare class CompositionError extends Error {
|
|
30
|
+
constructor(message: string);
|
|
31
|
+
}
|
|
32
|
+
/** A Loader `!!js` expression preserved as data instead of executed. */
|
|
33
|
+
export interface JsExpression {
|
|
34
|
+
__jsExpr: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One parsed composition row. Deliberately loose: the Loader owns each child
|
|
38
|
+
* plugin's own schema, and this reader only has to preserve what the file says.
|
|
39
|
+
*/
|
|
40
|
+
export interface CompositionRow {
|
|
41
|
+
/** Row id; the settings overlay and the Loader's patch index address a row by it. */
|
|
42
|
+
id?: string;
|
|
43
|
+
/** Module specifier: a bare package name, a `cordis:` builtin, or a relative path. */
|
|
44
|
+
name?: string;
|
|
45
|
+
/** Whether this row's `config` is a nested entry list. */
|
|
46
|
+
group?: boolean;
|
|
47
|
+
/** Boolean or `!!js` expression. */
|
|
48
|
+
disabled?: unknown;
|
|
49
|
+
/** Shared-realm declarations of the group this row opens. */
|
|
50
|
+
isolate?: unknown;
|
|
51
|
+
/** Row configuration, or the nested entry list of a group row. */
|
|
52
|
+
config?: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Read the child plugin rows of one `agent.cordis.yml`.
|
|
56
|
+
* @param text - the raw composition document.
|
|
57
|
+
* @param baseDir - directory a relative row `name` resolves against (the preset's own directory).
|
|
58
|
+
* @returns the row list to hand the registry, relative names resolved to file URLs.
|
|
59
|
+
* @throws {CompositionError} on malformed YAML or a row the registry would reject.
|
|
60
|
+
*/
|
|
61
|
+
export declare function readCompositionRows(text: string, baseDir: string): PresetDefinition['plugins'];
|
|
62
|
+
/** The display text `preset.yml` contributes to a declaration. */
|
|
63
|
+
export interface PresetMetadata {
|
|
64
|
+
/** Display name the roster shows. */
|
|
65
|
+
name?: string;
|
|
66
|
+
/** One sentence on what the preset is for. */
|
|
67
|
+
description?: string;
|
|
68
|
+
/** Roster ordering rank. */
|
|
69
|
+
order?: number;
|
|
70
|
+
}
|
|
71
|
+
/** Read the single-line display scalars of one `preset.yml`. */
|
|
72
|
+
export declare function readPresetMetadata(text: string): PresetMetadata;
|
|
73
|
+
/**
|
|
74
|
+
* Build the registry declaration of one preset directory.
|
|
75
|
+
* @param id - preset identity the roster keys the declaration by.
|
|
76
|
+
* @param dir - absolute preset directory holding `agent.cordis.yml` and `preset.yml`.
|
|
77
|
+
* @returns the definition to submit to `ctx.agentPresets.register`.
|
|
78
|
+
* @throws {CompositionError} when either file is missing, unreadable, or unparsable.
|
|
79
|
+
*/
|
|
80
|
+
export declare function readPresetDefinition(id: string, dir: string): PresetDefinition;
|
|
81
|
+
/**
|
|
82
|
+
* The preset-row settings the plugin exposes in the web settings surface, as the
|
|
83
|
+
* values to apply to the declared composition.
|
|
84
|
+
*
|
|
85
|
+
* The settings surface edits the PLUGIN's own Config, while the values that
|
|
86
|
+
* shape a session live in the declared preset's rows; applying them here is what
|
|
87
|
+
* connects the two. Every field is optional — an absent value leaves the shipped
|
|
88
|
+
* row exactly as the composition declares it.
|
|
89
|
+
*/
|
|
90
|
+
export interface PresetOverrides {
|
|
91
|
+
/** The `tool-catalog` row's `presentation` value. */
|
|
92
|
+
presentation?: string;
|
|
93
|
+
/** The `guard` row's `enabled` switch. */
|
|
94
|
+
guardEnabled?: boolean;
|
|
95
|
+
/** The `guard` row's sensitivity preset. */
|
|
96
|
+
guardSensitivity?: string;
|
|
97
|
+
/** The `guard` row's per-step reasoning-character floor. */
|
|
98
|
+
guardStallReasoningChars?: number;
|
|
99
|
+
/** The `guard` row's slow-burn step cap. */
|
|
100
|
+
guardGlobalStallCap?: number;
|
|
101
|
+
/** The `guard` row's identical-argument failure count. */
|
|
102
|
+
guardEchoFailures?: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Apply the settings overlay to one parsed row list.
|
|
106
|
+
*
|
|
107
|
+
* Rows are addressed by their `id`, and only a row the composition actually
|
|
108
|
+
* carries is touched: the overlay narrows the shipped configuration, it never
|
|
109
|
+
* invents a mount the preset did not have. The shipped composition declares
|
|
110
|
+
* every key the overlay writes, so leaving a key absent only matters for a
|
|
111
|
+
* composition that dropped it.
|
|
112
|
+
* @param rows - the parsed composition rows.
|
|
113
|
+
* @param overrides - the operator's settings-surface choices.
|
|
114
|
+
* @returns a new row list with the overlay applied.
|
|
115
|
+
*/
|
|
116
|
+
export declare function applyPresetOverrides(rows: PresetDefinition['plugins'], overrides: PresetOverrides): PresetDefinition['plugins'];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The composition reader the preset declaration is built from. It is the only
|
|
3
|
+
* thing standing between the shipped `agent.cordis.yml` and the registry, and
|
|
4
|
+
* it must not guess: these tests fence the supported subset against the real
|
|
5
|
+
* file, the settings overlay, and every construct it refuses.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -41,9 +41,12 @@ export interface LeverFacts {
|
|
|
41
41
|
export declare function leverState(facts: LeverFacts): LeverState;
|
|
42
42
|
/**
|
|
43
43
|
* The preset a push-up restores: the preset the user was on before pulling the
|
|
44
|
-
* lever, else the deployment default
|
|
45
|
-
* LiangShen preset
|
|
46
|
-
* no
|
|
44
|
+
* lever, else the deployment default, else the first usable roster row that is
|
|
45
|
+
* not the LiangShen preset. A candidate is skipped when it is the LiangShen
|
|
46
|
+
* preset itself (restoring it would be a no-op) or when the roster no longer
|
|
47
|
+
* supplies it. That last resort is what keeps the push direction alive when the
|
|
48
|
+
* deployment default IS LiangShen mode: `fallback` is skipped then, and after a
|
|
49
|
+
* reload `previous` is gone, so without it the gesture would have no target.
|
|
47
50
|
*/
|
|
48
51
|
export declare function restoreTarget(facts: LeverFacts): string | undefined;
|
|
49
52
|
/** Whether the lever can act at all in its current state. */
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,54 +1,181 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dsh-liangshen — LiangShen (梁神) agent preset plugin.
|
|
3
3
|
*
|
|
4
|
-
* Host half only:
|
|
5
|
-
* harness
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* Host half only: at activation it DECLARES the bundled LiangShen agent preset
|
|
5
|
+
* to the harness's agent-preset registry (`ctx.agentPresets`), reading the
|
|
6
|
+
* composition rows of `presets/liangshen/agent.cordis.yml` and handing the
|
|
7
|
+
* registry a definition whose relative module paths resolve inside the bundled
|
|
8
|
+
* preset directory. Declare = enabled: the registry mounts the preset's rows
|
|
9
|
+
* eagerly and hands back a disposer this plugin owns, so disabling the plugin
|
|
10
|
+
* (or the row unloading) unmounts them, and nothing is written to the harness
|
|
11
|
+
* home. The registration is released in `ctx.effect`; the plugin's own Config
|
|
12
|
+
* is the settings page the Host generates for this profile entry, and a
|
|
13
|
+
* settings write re-declares the preset with the new values instead of
|
|
14
|
+
* remounting the row. The capability announcement is a system-prompt section
|
|
15
|
+
* that ships OFF by default (`announceToAgent: false`) and can be enabled in
|
|
16
|
+
* the web settings surface (plugin config) or the profile patch. No browser
|
|
17
|
+
* routes, no agent tools — the preset itself provides the tools.
|
|
11
18
|
*
|
|
12
|
-
* The preset combines a minimal persona with a
|
|
13
|
-
* the system prompt keeps a minimal persona with standing
|
|
14
|
-
* and workspace instructions, the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* The preset combines a minimal persona with a lifetime-declared tool
|
|
20
|
+
* presentation: the system prompt keeps a minimal persona with standing
|
|
21
|
+
* working discipline and workspace instructions, and the wire runs the SDK's
|
|
22
|
+
* 'both' presentation by default — the assembled native roster stays on the
|
|
23
|
+
* wire for ordinary work and the `run_code` transport sits co-resident for
|
|
24
|
+
* programmatic batch computation and wide fan-out, declared once per session
|
|
25
|
+
* instead of staged across a turn boundary ('native' and 'ptc' are one-line
|
|
26
|
+
* opt-outs). High-fan-out tool families
|
|
27
|
+
* (default `mcp__*`) stay paged out of the executed surface through the
|
|
28
|
+
* host's scoped tool restriction until the preset's own `tool_activate` tool
|
|
29
|
+
* loads their namespace (LRU cap three), with the activation state replayed
|
|
30
|
+
* from the durable session event stream. The tool catalog — listing exactly
|
|
31
|
+
* the tools the request carries plus the paged-out namespace summaries — and a
|
|
32
|
+
* one-line working-context projection travel as durable user messages,
|
|
33
|
+
* republished only on change.
|
|
22
34
|
*/
|
|
23
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
35
|
+
import type { Context, Volatile } from '@deepseek-ai/cordis';
|
|
24
36
|
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
25
|
-
import z from 'schemastery';
|
|
37
|
+
import z from '@deepseek-ai/schemastery';
|
|
26
38
|
/** Stable cordis plugin name. */
|
|
27
39
|
export declare const name = "liangshen";
|
|
28
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Settings namespace of the plugin. Under the 0.1.7 settings contract a
|
|
42
|
+
* plugin's own Config IS its settings page and the namespace IS the profile
|
|
43
|
+
* entry id, so this is the row id the standalone bundle patch inserts; the
|
|
44
|
+
* aggregate install names the generated `web-ui-liangshen` row and the family
|
|
45
|
+
* binder resolves between the two.
|
|
46
|
+
*/
|
|
29
47
|
export declare const LIANGSHEN_SETTINGS_NAMESPACE: SettingsNamespace;
|
|
30
48
|
/** Prompt assembly must exist before the announcement section can register. */
|
|
31
49
|
export declare const inject: string[];
|
|
32
|
-
/**
|
|
50
|
+
/** The wire presentations the preset's tool catalog accepts. */
|
|
51
|
+
export declare const PRESENTATION_OPTIONS: readonly ["ptc", "native", "both"];
|
|
52
|
+
/** Sensitivity presets for the circuit breaker's adaptive thresholds. */
|
|
53
|
+
export declare const SENSITIVITY_OPTIONS: readonly ["conservative", "balanced", "aggressive"];
|
|
54
|
+
/** One wire presentation. */
|
|
55
|
+
export type Presentation = (typeof PRESENTATION_OPTIONS)[number];
|
|
56
|
+
/** One circuit-breaker sensitivity preset. */
|
|
57
|
+
export type GuardSensitivity = (typeof SENSITIVITY_OPTIONS)[number];
|
|
58
|
+
/**
|
|
59
|
+
* One activation field as the Host hands it over: a stable reference whose
|
|
60
|
+
* `get()` reads the value committed for this instance (a settings write updates
|
|
61
|
+
* it in place, without remounting the row), or the plain value a profile patch
|
|
62
|
+
* or a hand-built test context passes.
|
|
63
|
+
*/
|
|
64
|
+
export type ConfigField<T> = Volatile<T> | T | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Plugin config, validated by the same-named schemastery schema.
|
|
67
|
+
*
|
|
68
|
+
* Every field is `volatile()`: the Host serves exactly the volatile fields of a
|
|
69
|
+
* Config as this entry's settings form and refuses writes anywhere else, and a
|
|
70
|
+
* volatile write is committed into the references this activation holds instead
|
|
71
|
+
* of remounting the row.
|
|
72
|
+
*/
|
|
33
73
|
export interface Config {
|
|
34
|
-
/** Master switch: when false, neither
|
|
35
|
-
enabled?: boolean
|
|
74
|
+
/** Master switch: when false, neither the preset declaration nor the announcement runs. */
|
|
75
|
+
enabled?: ConfigField<boolean>;
|
|
36
76
|
/** When true, a system-prompt section announces the plugin (default false — keep prompts clean unless the user opts in). */
|
|
37
|
-
announceToAgent?: boolean
|
|
77
|
+
announceToAgent?: ConfigField<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Wire presentation written into the declared preset's tool-catalog row.
|
|
80
|
+
* `both` (default) keeps the assembled roster and the `run_code` transport
|
|
81
|
+
* co-resident; `native` keeps only the roster; `ptc` collapses the wire to
|
|
82
|
+
* the transport.
|
|
83
|
+
*/
|
|
84
|
+
presentation?: ConfigField<Presentation>;
|
|
85
|
+
/** Master switch for the runtime degeneration circuit breaker (default true). */
|
|
86
|
+
guardEnabled?: ConfigField<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Sensitivity preset scaling the breaker's adaptive thresholds
|
|
89
|
+
* (default 'balanced'). 'conservative' interrupts less, 'aggressive' fires earlier.
|
|
90
|
+
*/
|
|
91
|
+
guardSensitivity?: ConfigField<GuardSensitivity>;
|
|
92
|
+
/**
|
|
93
|
+
* Reasoning characters one zero-output step must reach for the per-step
|
|
94
|
+
* ladder to fire (default 8000, calibrated against V4.1's 384K max output).
|
|
95
|
+
*/
|
|
96
|
+
guardStallReasoningChars?: ConfigField<number>;
|
|
97
|
+
/**
|
|
98
|
+
* Consecutive output-free reasoning steps that trip the slow-burn ladder
|
|
99
|
+
* (default 4).
|
|
100
|
+
*/
|
|
101
|
+
guardGlobalStallCap?: ConfigField<number>;
|
|
102
|
+
/** Identical-argument tool failures in a row that trip the echo ladder (default 3). */
|
|
103
|
+
guardEchoFailures?: ConfigField<number>;
|
|
38
104
|
}
|
|
39
|
-
export declare const Config: z<
|
|
105
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
106
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
107
|
+
announceToAgent: z<boolean, boolean, "volatile-defined">;
|
|
108
|
+
presentation: z<"ptc" | "native" | "both", "ptc" | "native" | "both", "volatile-defined">;
|
|
109
|
+
guardEnabled: z<boolean, boolean, "volatile-defined">;
|
|
110
|
+
guardSensitivity: z<"conservative" | "balanced" | "aggressive", "conservative" | "balanced" | "aggressive", "volatile-defined">;
|
|
111
|
+
guardStallReasoningChars: z<number, number, "volatile-defined">;
|
|
112
|
+
guardGlobalStallCap: z<number, number, "volatile-defined">;
|
|
113
|
+
guardEchoFailures: z<number, number, "volatile-defined">;
|
|
114
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
115
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
116
|
+
announceToAgent: z<boolean, boolean, "volatile-defined">;
|
|
117
|
+
presentation: z<"ptc" | "native" | "both", "ptc" | "native" | "both", "volatile-defined">;
|
|
118
|
+
guardEnabled: z<boolean, boolean, "volatile-defined">;
|
|
119
|
+
guardSensitivity: z<"conservative" | "balanced" | "aggressive", "conservative" | "balanced" | "aggressive", "volatile-defined">;
|
|
120
|
+
guardStallReasoningChars: z<number, number, "volatile-defined">;
|
|
121
|
+
guardGlobalStallCap: z<number, number, "volatile-defined">;
|
|
122
|
+
guardEchoFailures: z<number, number, "volatile-defined">;
|
|
123
|
+
}>>, "plain">;
|
|
124
|
+
/** The settings the runtime acts on, every field read at its use site. */
|
|
125
|
+
export interface ResolvedConfig {
|
|
126
|
+
/** Whether the preset is declared at all. */
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
/** Whether the announcement section registers. */
|
|
129
|
+
announceToAgent: boolean;
|
|
130
|
+
/** Wire presentation the declared preset's tool-catalog row carries. */
|
|
131
|
+
presentation: Presentation;
|
|
132
|
+
/** Breaker master switch written into the declared preset's guard row. */
|
|
133
|
+
guardEnabled: boolean;
|
|
134
|
+
/** Breaker sensitivity written into the declared preset's guard row. */
|
|
135
|
+
guardSensitivity: GuardSensitivity;
|
|
136
|
+
/** Per-step reasoning-character floor written into the guard row. */
|
|
137
|
+
guardStallReasoningChars: number;
|
|
138
|
+
/** Slow-burn step cap written into the guard row. */
|
|
139
|
+
guardGlobalStallCap: number;
|
|
140
|
+
/** Echo-ladder failure count written into the guard row. */
|
|
141
|
+
guardEchoFailures: number;
|
|
142
|
+
}
|
|
143
|
+
/** Schema defaults, re-read for hand-built test contexts. */
|
|
144
|
+
export declare const DEFAULT_CONFIG: ResolvedConfig;
|
|
145
|
+
/**
|
|
146
|
+
* Read the effective settings of this activation.
|
|
147
|
+
* @param config - the config the Host passed to the activation.
|
|
148
|
+
* @returns every field resolved against the schema defaults.
|
|
149
|
+
*/
|
|
150
|
+
export declare function resolveConfig(config?: Config): ResolvedConfig;
|
|
40
151
|
/** Model-facing announcement: plugin presence, principle, and limits. */
|
|
41
|
-
export declare const LIANGSHEN_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-liangshen \u63D2\u4EF6\uFF08\u6881\u795E\u6A21\u5F0F agent preset\uFF09\uFF1A\u65B0\u5EFA\u4F1A\u8BDD\u7684\u9884\u8BBE\u9009\u62E9\u5668\u4E2D\u53EF\u9009\u300C\u6881\u795E\u6A21\u5F0F\u300D\u3002\u539F\u7406\uFF1A\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4FDD\u6301\u6781\u7B80 persona\uFF08minimal-prompt \u653E\u884C\u8BE5\u6BB5\u4E0E plan \u6A21\u5F0F\u7684 plan:policy\uFF09\uFF0Cpersona \u5185\u7F6E\u672C\u6A21\u5F0F\u5DE5\u4F5C\u7EAA\u5F8B\uFF08\u601D\
|
|
42
|
-
export { dshHome } from './dsh-home.ts';
|
|
43
|
-
/** Absolute path of the bundled preset tree inside this package. */
|
|
44
|
-
export declare function bundledPresetsRoot(): string;
|
|
152
|
+
export declare const LIANGSHEN_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-liangshen \u63D2\u4EF6\uFF08\u6881\u795E\u6A21\u5F0F agent preset\uFF09\uFF1A\u65B0\u5EFA\u4F1A\u8BDD\u7684\u9884\u8BBE\u9009\u62E9\u5668\u4E2D\u53EF\u9009\u300C\u6881\u795E\u6A21\u5F0F\u300D\u3002\u539F\u7406\uFF1A\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4FDD\u6301\u6781\u7B80 persona\uFF08minimal-prompt \u653E\u884C\u8BE5\u6BB5\u4E0E plan \u6A21\u5F0F\u7684 plan:policy\uFF09\uFF0Cpersona \u5185\u7F6E\u672C\u6A21\u5F0F\u5DE5\u4F5C\u7EAA\u5F8B\uFF08\u53CD\u601D\u7194\u65AD\u2014\u2014\u540C\u4E00\u5047\u8BBE\u63A8\u6F14\u4E0D\u8D85\u8FC7\u4E24\u8F6E\u3001\u7F3A\u4E8B\u5B9E\u7ACB\u5373\u95ED\u5408\u601D\u8003\u5E76\u8C03\u7528\u539F\u751F\u68C0\u6D4B\u5DE5\u5177\uFF1B\u884C\u52A8\u5BFC\u5411\u2014\u2014\u601D\u8003\u53EA\u51B3\u5B9A\u4E0B\u4E00\u6B65\u5177\u4F53\u64CD\u4F5C\u3001\u4E0D\u5728\u601D\u8003\u4E2D\u9884\u6F14\u4EE3\u7801\u5B9E\u73B0\uFF1B\u5E76\u53D1\u63A2\u7D22\u2014\u2014\u591A\u5904\u72EC\u7ACB\u68C0\u67E5\u6216\u641C\u7D22\u5728\u5355\u8F6E\u5185\u5E76\u53D1\u53D1\u5C04\u591A\u4E2A\u5DE5\u5177\u8C03\u7528\uFF1BYAGNI/PDCA\u2014\u2014\u5355\u6B65\u9A8C\u8BC1\u5355\u4E00\u5047\u8BBE\u3001\u4E0D\u5199\u5197\u4F59\u6CE8\u91CA\uFF1B\u6709\u754C\u6536\u655B\u2014\u2014\u4E0D\u65E0\u9650\u4E0B\u94BB\u4F9D\u8D56\u94FE\u3001\u524D\u7F6E\u68C0\u67E5\u6700\u591A2-3\u8F6E\u540E\u7ACB\u5373\u6536\u655B\u5E76\u4F5C\u7B54\u6216\u7F16\u8F91\uFF09\uFF0C\u5E76\u5728\u7EC4\u88C5\u65F6\u8FFD\u52A0\u5DE5\u4F5C\u533A\u76EE\u5F55\u884C Your working directory is <cwd>.\u3002AGENTS.md \u5DE5\u4F5C\u533A\u6307\u4EE4\u9ED8\u8BA4\u4EA4\u8FD8\u5BBF\u4E3B\u81EA\u8EAB\u7684 agent-instructions \u884C\uFF0C\u4EE5 user \u89D2\u8272\u6CE8\u5165\uFF0C\u672C\u63D2\u4EF6\u4E0D\u8FFD\u52A0\u4EFB\u4F55\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6BB5\u3001\u4E5F\u4E0D\u6539\u52A8 pre-step \u7684\u6D88\u606F\u6279\u6B21\uFF1B\u53EF\u9009 instructionSource: system-prompt \u624D\u7531\u672C\u63D2\u4EF6\u5728\u7EC4\u88C5\u65F6\u8BFB\u53D6 AGENTS.md \u94FE\u5E76\u8FFD\u52A0 workspace-instructions \u6BB5\uFF0865536 \u5B57\u8282\u9884\u7B97\uFF0C\u6BCF\u6B21\u7EC4\u88C5\u91CD\u8BFB\uFF09\u3002wire \u5448\u73B0\u7531 tool-catalog \u6309\u4F1A\u8BDD\u4E00\u6B21\u58F0\u660E\uFF0C\u53D6\u503C 'both'\uFF08\u9ED8\u8BA4\uFF1A\u539F\u751F\u6E05\u5355\u4E0E run_code \u540C\u9A7B\uFF0C\u539F\u751F\u76F4\u8C03\u4F18\u5148\u3001run_code \u7528\u4E8E\u7A0B\u5E8F\u5316\u6279\u5904\u7406\u4E0E\u5E76\u53D1\u6247\u51FA\uFF09\u3001'native'\uFF08\u7EC4\u88C5\u51FA\u7684\u539F\u751F\u6E05\u5355\uFF09\u6216 'ptc'\uFF08wire \u6536\u62E2\u4E3A\u552F\u4E00\u7684 run_code\uFF09\uFF0C\u5E76\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u754C\u9762\u5207\u6362\uFF08\u5199\u5165\u6240\u58F0\u660E\u9884\u8BBE\u7684 tool-catalog \u884C\uFF09\uFF1B\u672A\u6302\u8F7D code runtime \u65F6\u4E0D\u505A\u58F0\u660E\uFF0C\u4F1A\u8BDD\u8FD0\u884C\u539F\u751F\u5DE5\u5177\u9762\u3002\u6E29\u548C\u5DE5\u5177\u5206\u9875\u51FA\u5382\u5F00\u542F\uFF08pagedToolPatterns \u9ED8\u8BA4 ['mcp__*']\uFF09\uFF1A\u5339\u914D\u5DE5\u5177\u5728\u6FC0\u6D3B\u524D\u88AB\u4F5C\u7528\u57DF\u7EA7\u5DE5\u5177\u9650\u5236\u79FB\u51FA\u53EF\u89C1\u9762\uFF08\u65E2\u4E0D\u5728 wire\uFF0C\u4E5F\u4E0D\u5728\u751F\u6210\u7684 SDK \u58F0\u660E\u4E2D\uFF09\uFF0C\u76EE\u5F55\u6D88\u606F\u5217\u51FA\u5E38\u9A7B\u5DE5\u5177\u7B7E\u540D\u4E0E\u672A\u6FC0\u6D3B\u547D\u540D\u7A7A\u95F4\u6458\u8981\uFF0C\u8C03\u7528 tool_activate({ namespace }) \u6309\u9700\u6FC0\u6D3B\uFF08LRU \u4E0A\u9650 3 \u4E2A\u6D3B\u8DC3\u547D\u540D\u7A7A\u95F4\uFF0C\u9A71\u9010\u6700\u4E45\u672A\u7528\uFF09\uFF1B\u6FC0\u6D3B\u72B6\u6001\u4ECE\u6301\u4E45\u4F1A\u8BDD\u4E8B\u4EF6\u6D41\u91CD\u5EFA\uFF0Cresume/\u538B\u7F29\u540E\u81EA\u7136\u6062\u590D\u3002\u8FD0\u884C\u65F6\u9000\u5316\u7194\u65AD\u5668\uFF08guard\uFF09\u4ECE\u4E8B\u4EF6\u6D41\u6298\u53E0\u505C\u6446\uFF08\u8FDE\u7EED\u96F6\u4EA7\u51FA\u957F\u601D\u8003\uFF09\u4E0E\u7A7A\u8F6C\uFF08\u540C\u53C2\u91CD\u590D\u5931\u8D25\uFF09\u4FE1\u53F7\uFF0C\u6BCF episode \u89E6\u53D1\u4E00\u6B21\uFF1A\u6CE8\u5165\u7194\u65AD\u6D88\u606F\u5E76\u628A\u63A8\u7406\u6863\u4F4D\u4E34\u65F6\u4E0B\u8C03\u4E00\u6863\uFF08max\u2192high\u2192low\uFF0C\u7A97\u53E3 3 \u4E2A\u8BF7\u6C42\uFF09\uFF1B\u65E0\u4FE1\u53F7\u65F6\u4ECE\u4E0D\u6539\u5199\u8BF7\u6C42\u3002\u5173\u952E\u4E8B\u5B9E\u767B\u8BB0\u7C3F\uFF08fact_register\uFF09\u8BA9\u6A21\u578B\u628A\u786C\u7EA6\u675F/\u5DF2\u786E\u8BA4\u51B3\u7B56/\u5931\u8D25\u8DEF\u5F84\u767B\u8BB0\u4E3A\u5355\u884C\u4E8B\u5B9E\uFF0C\u968F working-context \u884C\u6BCF\u6B65\u6295\u5C04\u8FDB\u5C40\u90E8\u6CE8\u610F\u529B\u7A97\u53E3\u3002working-context \u63D2\u4EF6\u5728 pre-step \u6CE8\u5165\u5355\u884C [Working Context: ...] \u5C31\u8FD1\u72B6\u6001\u6295\u5C04\uFF08plan \u6A21\u5F0F\u3001\u6D3B\u8DC3\u547D\u540D\u7A7A\u95F4\u3001\u8FDB\u884C\u4E2D todo\u3001\u767B\u8BB0\u4E8B\u5B9E\uFF0C\u5168\u90E8\u4ECE\u4E8B\u4EF6\u6D41\u6298\u53E0\uFF0C\u8BFB\u4E0D\u5230\u5219\u7701\u7565\uFF0C\u5168\u90E8\u4E3A\u7A7A\u5219\u4E0D\u6CE8\u5165\uFF09\u3002\u5386\u53F2\u5DE5\u5177\u7ED3\u679C\u4FEE\u526A\u4E3A 4096 \u5B57\u7B26\u9608\u503C\uFF08head 2048 / tail 1024\uFF09\u3002\u6587\u4EF6\u64CD\u4F5C\u53D7\u5BBF\u4E3B\u6C99\u7BB1\u7EA6\u675F\uFF1Bshell \u5728\u6BCF\u4E2A\u5E73\u53F0\u90FD\u6302\u4E0A\u6E38\u6807\u51C6 Stdio \u6808\uFF08POSIX \u4E3A bash\uFF0CWindows \u4E3A pwsh\uFF09\uFF0C\u5E26\u7B80\u77ED\u63CF\u8FF0\u6807\u9898\u5361\u7247\u4E0E\u786E\u5B9A\u6027\u9000\u51FA\u7801\u3002\u771F\u5B9E\u63A8\u7406\u63A2\u9488\u901A\u8FC7\u4E0D\u7B49\u4E8E\u6A21\u5F0F\u96C6\u6210\u901A\u8FC7\uFF0C\u66F4\u4E0D\u7B49\u4E8E\u7EDF\u8BA1\u6548\u679C\u63D0\u5347\u3002\u9884\u8BBE\u7531\u63D2\u4EF6\u5728\u6FC0\u6D3B\u65F6\u5411 agent-preset registry \u76F4\u63A5\u6CE8\u518C\uFF08\u4E0D\u5199\u4EFB\u4F55\u9884\u8BBE\u76EE\u5F55\uFF09\uFF0C\u63D2\u4EF6\u505C\u7528\u5373\u6CE8\u9500\uFF1B\u9ED8\u8BA4\u9884\u8BBE\u7531\u7528\u6237\u81EA\u884C\u9009\u62E9\u3002\u7528\u6237\u63D0\u5230\u300C\u6881\u795E\u6A21\u5F0F / \u951A\u5B9A\u6A21\u5F0F / anchored standard\u300D\u65F6\u5373\u6307\u672C\u63D2\u4EF6\uFF0C\u8BF7\u636E\u6B64\u534F\u4F5C\u3002";
|
|
45
153
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
|
|
154
|
+
* Absolute path of the bundled LiangShen preset directory: the composition,
|
|
155
|
+
* the display map, and the preset-local `.mjs` plugins this plugin declares.
|
|
156
|
+
* @returns the preset directory as a filesystem path.
|
|
157
|
+
*/
|
|
158
|
+
export declare function bundledPresetDir(): string;
|
|
159
|
+
/**
|
|
160
|
+
* Mount the plugin: declare the bundled preset, register the announcement
|
|
161
|
+
* section when announceToAgent is on (off by default), and re-declare on every
|
|
162
|
+
* committed settings write.
|
|
50
163
|
* @param ctx - host plugin context carrying systemPrompt.
|
|
51
164
|
* @param config - resolved plugin config (schema defaults applied by the loader).
|
|
52
165
|
*/
|
|
53
166
|
export declare const apply: typeof applyImpl;
|
|
54
167
|
declare function applyImpl(ctx: Context, config?: Config): void;
|
|
168
|
+
declare module '@deepseek-ai/cordis' {
|
|
169
|
+
interface Events {
|
|
170
|
+
/**
|
|
171
|
+
* Volatile config values were committed into the running fiber without a
|
|
172
|
+
* remount; dispatched to the owning fiber only. Spelled here because the
|
|
173
|
+
* Loader package is not a dependency of this plugin, with the Loader's own
|
|
174
|
+
* shape so the two declarations merge when a Host program carries both.
|
|
175
|
+
* @param paths - changed config paths as key arrays; every value is committed before dispatch.
|
|
176
|
+
* @mode emit
|
|
177
|
+
*/
|
|
178
|
+
'loader/volatile-update'(paths: readonly (readonly string[])[]): void;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export {};
|