@deepseek-ai/dsh-tool-skill 0.2.1-alpha.1 → 0.2.1-alpha.2
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 +2 -0
- package/README.zh.md +2 -0
- package/lib/index.js +94 -4
- package/package.json +16 -14
package/README.i18n.yaml
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
17
17
|
/deepseek-ai-dsh-tool-skill/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 633cb494ab14a7ce
|
|
19
|
+
zh: 8647ccca09bf3e0a
|
|
20
20
|
/deepseek-ai-dsh-tool-skill/use-this-package/when-to-choose-it:
|
|
21
21
|
en: b7d33bd969826ee3
|
|
22
22
|
zh: 4e155a0f14b41541
|
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ Agents can discover and load skills during a session. Before the first request,
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
+
Skill discovery, catalog updates, and explicit skill invocation use the Session's current working directory.
|
|
29
|
+
|
|
28
30
|
Mount the plugin alongside the skill registry to give agents a session skill catalog and the `skill` loader tool. It requires `ctx.agents`, `ctx.tools`, and `ctx.skills`.
|
|
29
31
|
|
|
30
32
|
### When to choose it
|
package/README.zh.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import z from "@deepseek-ai/schemastery";
|
|
|
3
3
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
4
4
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
5
5
|
import "@deepseek-ai/cordis";
|
|
6
|
+
import "node:path";
|
|
6
7
|
import { escapeText, isModelInvocable, isSkillName, isUserInvocable, renderSkillContent } from "@deepseek-ai/dsh-skill";
|
|
7
8
|
//#region ../../util/brand/src/index.ts
|
|
8
9
|
/**
|
|
@@ -660,6 +661,94 @@ function SessionSeq(value) {
|
|
|
660
661
|
if (!Number.isSafeInteger(value) || value < 0 || Object.is(value, -0)) throw new TypeError(`SessionSeq must be a non-negative safe integer, got ${String(value)}`);
|
|
661
662
|
return brandNumber(value);
|
|
662
663
|
}
|
|
664
|
+
new Set([
|
|
665
|
+
"agent-preset/selected",
|
|
666
|
+
"agent/inbox/spliced",
|
|
667
|
+
"approval/asked",
|
|
668
|
+
"approval/decided",
|
|
669
|
+
"approval/policy",
|
|
670
|
+
"assistant/attempt",
|
|
671
|
+
"assistant/message",
|
|
672
|
+
"command/done",
|
|
673
|
+
"command/run",
|
|
674
|
+
"compaction/end",
|
|
675
|
+
"compaction/prune",
|
|
676
|
+
"compaction/start",
|
|
677
|
+
"compaction/summary",
|
|
678
|
+
"deliverables/presented",
|
|
679
|
+
"developer/message",
|
|
680
|
+
"feedback/message-delete",
|
|
681
|
+
"feedback/message-put",
|
|
682
|
+
"feedback/record",
|
|
683
|
+
"goal/change",
|
|
684
|
+
"hook/invoked",
|
|
685
|
+
"hook/result",
|
|
686
|
+
"image/offload",
|
|
687
|
+
"llm/retry",
|
|
688
|
+
"llm/retry-started",
|
|
689
|
+
"model/selection",
|
|
690
|
+
"permission/preset",
|
|
691
|
+
"plan/mode",
|
|
692
|
+
"request/context",
|
|
693
|
+
"request/header",
|
|
694
|
+
"sandbox/mode",
|
|
695
|
+
"schedule/change",
|
|
696
|
+
"session-log-deepseek/delivery-accepted",
|
|
697
|
+
"session/end-seed",
|
|
698
|
+
"session/title",
|
|
699
|
+
"session/title-llm-request",
|
|
700
|
+
"step/end",
|
|
701
|
+
"step/start",
|
|
702
|
+
"subagent/catalog",
|
|
703
|
+
"subagent/descriptor",
|
|
704
|
+
"subagent/model-selection-policy",
|
|
705
|
+
"system/message",
|
|
706
|
+
"team/member",
|
|
707
|
+
"team/message/delivered",
|
|
708
|
+
"team/message/queued",
|
|
709
|
+
"team/task",
|
|
710
|
+
"todo/write",
|
|
711
|
+
"tool-workflow/agent-end",
|
|
712
|
+
"tool-workflow/agent-start",
|
|
713
|
+
"tool-workflow/run-end",
|
|
714
|
+
"tool-workflow/run-start",
|
|
715
|
+
"tool/call",
|
|
716
|
+
"tool/ptc-dispatch",
|
|
717
|
+
"tool/ptc-dispatch-start",
|
|
718
|
+
"tool/result",
|
|
719
|
+
"turn/end",
|
|
720
|
+
"turn/start",
|
|
721
|
+
"user/message",
|
|
722
|
+
"web/deepseek-search-llm-request",
|
|
723
|
+
"working-directory/change",
|
|
724
|
+
"workspace/changes"
|
|
725
|
+
]);
|
|
726
|
+
new Set(["image/offload"]);
|
|
727
|
+
new Set([
|
|
728
|
+
"system/message",
|
|
729
|
+
"developer/message",
|
|
730
|
+
"user/message",
|
|
731
|
+
"assistant/message",
|
|
732
|
+
"tool/result"
|
|
733
|
+
]);
|
|
734
|
+
/**
|
|
735
|
+
* Deep structural equality over the session-event JSON value domain
|
|
736
|
+
* (null/boolean/number/string, arrays, plain objects). Replaces
|
|
737
|
+
* `node:util`'s isDeepStrictEqual to keep this module browser-safe.
|
|
738
|
+
*/
|
|
739
|
+
function isDeepEqualJson(a, b) {
|
|
740
|
+
if (a === b) return true;
|
|
741
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
742
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
743
|
+
return a.every((item, i) => isDeepEqualJson(item, b[i]));
|
|
744
|
+
}
|
|
745
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
746
|
+
const aKeys = Object.keys(a);
|
|
747
|
+
const bRecord = b;
|
|
748
|
+
if (aKeys.length !== Object.keys(b).length) return false;
|
|
749
|
+
return aKeys.every((key) => Object.hasOwn(b, key) && isDeepEqualJson(a[key], bRecord[key]));
|
|
750
|
+
}
|
|
751
|
+
new Set(["reasoningEffort", "maxTokens"]);
|
|
663
752
|
//#endregion
|
|
664
753
|
//#region lib/types/index.js
|
|
665
754
|
/**
|
|
@@ -671,7 +760,8 @@ const name = "tool-skill";
|
|
|
671
760
|
const inject = [
|
|
672
761
|
"agents",
|
|
673
762
|
"tools",
|
|
674
|
-
"skills"
|
|
763
|
+
"skills",
|
|
764
|
+
"workingDirectory"
|
|
675
765
|
];
|
|
676
766
|
const DEFAULT_CATALOG_DESCRIPTION_MAX_LENGTH = 500;
|
|
677
767
|
/** Durable entry list mirroring the rendered catalog lines, for non-model consumers. */
|
|
@@ -774,7 +864,7 @@ function apply(ctx, config = {}) {
|
|
|
774
864
|
async execute(args, exec) {
|
|
775
865
|
if (!isSkillName(args.name)) throw new Error(`invalid skill name "${args.name}"`);
|
|
776
866
|
const lookup = {
|
|
777
|
-
cwd: exec.agent
|
|
867
|
+
cwd: exec.agent === void 0 ? void 0 : await ctx.workingDirectory.ensure(exec.agent, exec.signal),
|
|
778
868
|
signal: exec.signal,
|
|
779
869
|
scope: exec.agent
|
|
780
870
|
};
|
|
@@ -808,7 +898,7 @@ function apply(ctx, config = {}) {
|
|
|
808
898
|
if (names.length === 0) return decision;
|
|
809
899
|
signal.throwIfAborted();
|
|
810
900
|
const lookup = {
|
|
811
|
-
cwd:
|
|
901
|
+
cwd: await ctx.workingDirectory.ensure(agent, signal),
|
|
812
902
|
signal,
|
|
813
903
|
scope: agent
|
|
814
904
|
};
|
|
@@ -841,7 +931,7 @@ function apply(ctx, config = {}) {
|
|
|
841
931
|
if (decision.kind === "reject") return decision;
|
|
842
932
|
signal.throwIfAborted();
|
|
843
933
|
const snapshot = ctx.tools.get(skillTool.name, agent) === skillTool ? await ctx.skills.snapshot({
|
|
844
|
-
cwd:
|
|
934
|
+
cwd: await ctx.workingDirectory.ensure(agent, signal),
|
|
845
935
|
signal,
|
|
846
936
|
scope: agent
|
|
847
937
|
}) : {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-skill",
|
|
3
3
|
"description": "Model-facing skill loading tool for the DeepSeek Harness",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,24 +27,26 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-agent": "0.2.1-alpha.
|
|
31
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
32
|
-
"@deepseek-ai/dsh-
|
|
30
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
31
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-skill": "0.2.1-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
|
|
33
34
|
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.2"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
38
|
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-agent": "0.2.1-alpha.
|
|
41
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.
|
|
42
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
43
|
-
"@deepseek-ai/dsh-scope": "0.2.1-alpha.
|
|
44
|
-
"@deepseek-ai/dsh-session": "0.2.1-alpha.
|
|
45
|
-
"@deepseek-ai/dsh-skill": "0.2.1-alpha.
|
|
46
|
-
"@deepseek-ai/dsh-skill-filesystem": "0.2.1-alpha.
|
|
47
|
-
"@deepseek-ai/dsh-tools": "0.2.1-alpha.
|
|
48
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
41
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-scope": "0.2.1-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-skill": "0.2.1-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-skill-filesystem": "0.2.1-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
|
|
49
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.2"
|
|
49
51
|
}
|
|
50
52
|
}
|