@linxin666/dsh-liangshen 0.3.14 → 0.3.16
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/lib/index.js +16 -6
- package/package.json +1 -1
- package/src/index.ts +17 -6
package/lib/index.js
CHANGED
|
@@ -453,13 +453,23 @@ function applyImpl(ctx, config) {
|
|
|
453
453
|
});
|
|
454
454
|
};
|
|
455
455
|
ctx.inject(["settings"], (settingsCtx) => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
456
|
+
try {
|
|
457
|
+
if (typeof settingsCtx.settings?.installSection === "function") settingsCtx.settings.installSection(ctx, LIANGSHEN_SETTINGS_NAMESPACE, Config, config ?? {}, {
|
|
458
|
+
setSource: (source) => {
|
|
459
|
+
current = source;
|
|
460
|
+
refresh();
|
|
461
|
+
},
|
|
462
|
+
onChange: refresh
|
|
463
|
+
});
|
|
464
|
+
else if (typeof settingsCtx.settings?.register === "function") {
|
|
465
|
+
const scope = settingsCtx.settings.register(LIANGSHEN_SETTINGS_NAMESPACE, Config, { base: config ?? {} });
|
|
466
|
+
current = () => scope?.get?.() ?? config ?? {};
|
|
467
|
+
scope?.watch?.(() => {
|
|
468
|
+
refresh();
|
|
469
|
+
});
|
|
459
470
|
refresh();
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
});
|
|
471
|
+
}
|
|
472
|
+
} catch {}
|
|
463
473
|
});
|
|
464
474
|
refresh();
|
|
465
475
|
ctx.effect(() => () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-liangshen",
|
|
3
3
|
"description": "LiangShen (梁神) agent preset for the dsh web GUI: a two-phase anchored-standard preset — the first model request exposes only the builtin Minimal exact two-tool surface (persistent bash plus str_replace_editor) with no runtime contexts or injected instructions (Minimal-aligned trajectory anchor), promotion is gated on the first minimal-like reasoning block with a fallback, and the wire then switches to PTC Mode (a single run_code tool over the full registry) with the ordinary injections returning afterwards. The preset files are synced into ~/.dsh/.agent-presets on host startup. Hot-pluggable — mounted via cordis.patch.yml + a profile node_modules symlink, no dsh source changes.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.16",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^22.19.0 || >=24.0.0"
|
package/src/index.ts
CHANGED
|
@@ -127,13 +127,24 @@ function applyImpl(ctx: Context, config?: Config): void {
|
|
|
127
127
|
// fields from this namespace; a settings edit re-runs refresh live, and
|
|
128
128
|
// deployments without a settings service keep the composition entry.
|
|
129
129
|
ctx.inject(['settings'], (settingsCtx) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
try {
|
|
131
|
+
if (typeof settingsCtx.settings?.installSection === 'function') {
|
|
132
|
+
settingsCtx.settings.installSection(ctx, LIANGSHEN_SETTINGS_NAMESPACE, Config, config ?? {}, {
|
|
133
|
+
setSource: (source) => {
|
|
134
|
+
current = source
|
|
135
|
+
refresh()
|
|
136
|
+
},
|
|
137
|
+
onChange: refresh,
|
|
138
|
+
})
|
|
139
|
+
} else if (typeof settingsCtx.settings?.register === 'function') {
|
|
140
|
+
const scope = settingsCtx.settings.register(LIANGSHEN_SETTINGS_NAMESPACE, Config, { base: config ?? {} })
|
|
141
|
+
current = () => scope?.get?.() ?? (config ?? {})
|
|
142
|
+
scope?.watch?.(() => { refresh() })
|
|
133
143
|
refresh()
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
}
|
|
145
|
+
} catch {
|
|
146
|
+
// Defensive fallback against settings registration differences
|
|
147
|
+
}
|
|
137
148
|
})
|
|
138
149
|
|
|
139
150
|
refresh()
|