dsh-agent-skills 0.1.7 → 0.1.10
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.md +2 -0
- package/lib/client.js +35 -9
- package/lib/client.js.map +2 -2
- package/lib/preset-manager.d.ts +1 -1
- package/lib/preset-manager.js +122 -26
- package/lib/preset-manager.js.map +1 -1
- package/lib/restart.js +26 -5
- package/lib/restart.js.map +1 -1
- package/lib/runtime.js +9 -1
- package/lib/runtime.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# dsh-agent-skills
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/dsh-agent-skills)
|
|
4
|
+
[](https://www.npmjs.com/package/dsh-agent-skills)
|
|
4
5
|
[](./LICENSE)
|
|
5
6
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
7
|
+
[](https://github.com/zp-home/dsh-recommend)
|
|
6
8
|
|
|
7
9
|
在 DeepSeek Harness 的设置页中查看、启停和管理本地 Agent Skills。
|
|
8
10
|
|
package/lib/client.js
CHANGED
|
@@ -236,7 +236,12 @@ function AgentSkillsSection({ api, t }) {
|
|
|
236
236
|
const [view, setView] = (0, import_react.useState)(void 0);
|
|
237
237
|
const [takeover, setTakeover] = (0, import_react.useState)(void 0);
|
|
238
238
|
const [takeoverRestartRequired, setTakeoverRestartRequired] = (0, import_react.useState)(false);
|
|
239
|
-
const [restarting,
|
|
239
|
+
const [restarting, setRestartingState] = (0, import_react.useState)(false);
|
|
240
|
+
const restartingRef = (0, import_react.useRef)(false);
|
|
241
|
+
const setRestarting = (0, import_react.useCallback)((next) => {
|
|
242
|
+
restartingRef.current = next;
|
|
243
|
+
setRestartingState(next);
|
|
244
|
+
}, []);
|
|
240
245
|
const [busy, setBusy] = (0, import_react.useState)(true);
|
|
241
246
|
const [error51, setError] = (0, import_react.useState)("");
|
|
242
247
|
const [query, setQuery] = (0, import_react.useState)("");
|
|
@@ -266,24 +271,38 @@ function AgentSkillsSection({ api, t }) {
|
|
|
266
271
|
setPendingSkillCount(changed);
|
|
267
272
|
}, [rememberBaseline]);
|
|
268
273
|
const load = (0, import_react.useCallback)(async (refresh = () => api.list()) => {
|
|
274
|
+
if (restartingRef.current) return;
|
|
269
275
|
setError("");
|
|
270
|
-
|
|
276
|
+
let result2;
|
|
277
|
+
try {
|
|
278
|
+
result2 = await refresh();
|
|
279
|
+
} catch (error52) {
|
|
280
|
+
if (restartingRef.current) return;
|
|
281
|
+
setError(t("errorLoad", { message: error52 instanceof Error ? error52.message : String(error52) }));
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
271
284
|
if (result2.ok) {
|
|
272
285
|
rememberBaseline(result2.value);
|
|
273
286
|
setView(result2.value);
|
|
274
|
-
} else {
|
|
287
|
+
} else if (!restartingRef.current) {
|
|
275
288
|
setError(t("errorLoad", { message: result2.error.message }));
|
|
276
289
|
}
|
|
277
290
|
}, [api, rememberBaseline, t]);
|
|
278
291
|
const loadTakeover = (0, import_react.useCallback)(async (refresh = () => api.takeoverStatus()) => {
|
|
279
|
-
|
|
292
|
+
if (restartingRef.current) return;
|
|
293
|
+
let result2;
|
|
294
|
+
try {
|
|
295
|
+
result2 = await refresh();
|
|
296
|
+
} catch {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
280
299
|
if (result2.ok) {
|
|
281
300
|
setTakeover(result2.value);
|
|
282
301
|
const pending = readPendingRestart();
|
|
283
302
|
const stillPending = result2.value.boot !== void 0 && pending?.boot === result2.value.boot && result2.value.enabled !== pending.baselineEnabled;
|
|
284
303
|
setTakeoverRestartRequired(stillPending);
|
|
285
304
|
if (pending !== void 0 && !stillPending) writePendingRestart(void 0);
|
|
286
|
-
} else {
|
|
305
|
+
} else if (!restartingRef.current) {
|
|
287
306
|
setError(t("errorLoad", { message: result2.error.message }));
|
|
288
307
|
}
|
|
289
308
|
}, [api, t]);
|
|
@@ -292,11 +311,12 @@ function AgentSkillsSection({ api, t }) {
|
|
|
292
311
|
void Promise.all([load(), loadTakeover()]).finally(() => setBusy(false));
|
|
293
312
|
}, [load, loadTakeover]);
|
|
294
313
|
(0, import_react.useEffect)(() => {
|
|
314
|
+
if (restarting) return;
|
|
295
315
|
const timer = window.setInterval(() => {
|
|
296
316
|
void load();
|
|
297
317
|
}, 5e3);
|
|
298
318
|
return () => window.clearInterval(timer);
|
|
299
|
-
}, [load]);
|
|
319
|
+
}, [load, restarting]);
|
|
300
320
|
const mutate = (0, import_react.useCallback)(async (operation, trackSkillChanges = false) => {
|
|
301
321
|
setSaving(true);
|
|
302
322
|
setError("");
|
|
@@ -386,7 +406,7 @@ function AgentSkillsSection({ api, t }) {
|
|
|
386
406
|
} catch {
|
|
387
407
|
}
|
|
388
408
|
retry();
|
|
389
|
-
}, [api, restarting, t, takeover?.boot]);
|
|
409
|
+
}, [api, restarting, setRestarting, t, takeover?.boot]);
|
|
390
410
|
const toggleDirExpanded = (path) => {
|
|
391
411
|
setDirExpanded((prev) => {
|
|
392
412
|
const next = new Set(prev);
|
|
@@ -640,12 +660,18 @@ var CSS = `
|
|
|
640
660
|
--as-warning: #d29922;
|
|
641
661
|
--as-warning-soft: rgba(210, 153, 34, 0.12);
|
|
642
662
|
--as-radius: 8px;
|
|
643
|
-
color-scheme: light dark;
|
|
644
663
|
-webkit-font-smoothing: antialiased;
|
|
645
664
|
}
|
|
646
665
|
|
|
647
666
|
.as-wrap { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 860px; }
|
|
648
|
-
|
|
667
|
+
/* The settings shell paints its panel with --dsw-alias-bg-layer-2 (see
|
|
668
|
+
SettingsRoot .panel). The sticky band covers scrolling content, so it must
|
|
669
|
+
use that same surface; layer-1 is a *different* color in dark palettes and
|
|
670
|
+
in themed skins, which left a lighter/darker block above the page. The
|
|
671
|
+
fallback stays a system color only for hosts without the DSH tokens: since
|
|
672
|
+
color-scheme is inherited from the document, that too follows the app
|
|
673
|
+
theme instead of the OS preference. */
|
|
674
|
+
.as-sticky-top { position: sticky; top: 0; z-index: 4; display: flex; flex-direction: column; gap: 14px; padding-bottom: 1px; background: var(--dsw-alias-bg-layer-2, Canvas); }
|
|
649
675
|
.as-title { font-size: 20px; font-weight: 650; margin: 0; line-height: 1.3; }
|
|
650
676
|
.as-subtitle { font-size: 13px; color: var(--as-muted); margin: 0; line-height: 1.5; }
|
|
651
677
|
.as-search { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--as-border); background: transparent; color: inherit; font-size: 13px; outline: none; }
|