@deepseek-ai/dsh-tool-skill 0.2.1-alpha.1 → 0.2.1-alpha.3

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 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: 5c21d1ba71c1c3e1
19
- zh: 3e2505d4625b57b4
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
@@ -25,6 +25,8 @@ agent 可以在会话期间发现并加载 skill。在首次请求前,如果
25
25
  <a id="use-this-package"></a>
26
26
  ## 使用本包
27
27
 
28
+ 技能发现、目录更新与显式技能调用均使用 Session 的当前工作目录。
29
+
28
30
  与 skill 注册表一起挂载该插件,即可让 agent 拥有会话 skill 目录和 `skill` 加载工具。它需要 `ctx.agents`、`ctx.tools` 与 `ctx.skills`。
29
31
 
30
32
  ### 何时选择
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,96 @@ 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
+ "job/registered",
688
+ "job/settled",
689
+ "llm/retry",
690
+ "llm/retry-started",
691
+ "model/selection",
692
+ "permission/preset",
693
+ "plan/mode",
694
+ "request/context",
695
+ "request/header",
696
+ "sandbox/mode",
697
+ "schedule/change",
698
+ "session-log-deepseek/delivery-accepted",
699
+ "session/end-seed",
700
+ "session/title",
701
+ "session/title-llm-request",
702
+ "step/end",
703
+ "step/start",
704
+ "subagent/catalog",
705
+ "subagent/descriptor",
706
+ "subagent/model-selection-policy",
707
+ "system/message",
708
+ "team/member",
709
+ "team/message/delivered",
710
+ "team/message/queued",
711
+ "team/task",
712
+ "todo/write",
713
+ "tool-workflow/agent-end",
714
+ "tool-workflow/agent-start",
715
+ "tool-workflow/run-end",
716
+ "tool-workflow/run-start",
717
+ "tool/call",
718
+ "tool/ptc-dispatch",
719
+ "tool/ptc-dispatch-start",
720
+ "tool/result",
721
+ "turn/end",
722
+ "turn/start",
723
+ "user/message",
724
+ "web/deepseek-search-llm-request",
725
+ "working-directory/change",
726
+ "workspace/changes"
727
+ ]);
728
+ new Set(["image/offload"]);
729
+ new Set([
730
+ "system/message",
731
+ "developer/message",
732
+ "user/message",
733
+ "assistant/message",
734
+ "tool/result"
735
+ ]);
736
+ /**
737
+ * Deep structural equality over the session-event JSON value domain
738
+ * (null/boolean/number/string, arrays, plain objects). Replaces
739
+ * `node:util`'s isDeepStrictEqual to keep this module browser-safe.
740
+ */
741
+ function isDeepEqualJson(a, b) {
742
+ if (a === b) return true;
743
+ if (Array.isArray(a) || Array.isArray(b)) {
744
+ if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
745
+ return a.every((item, i) => isDeepEqualJson(item, b[i]));
746
+ }
747
+ if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
748
+ const aKeys = Object.keys(a);
749
+ const bRecord = b;
750
+ if (aKeys.length !== Object.keys(b).length) return false;
751
+ return aKeys.every((key) => Object.hasOwn(b, key) && isDeepEqualJson(a[key], bRecord[key]));
752
+ }
753
+ new Set(["reasoningEffort", "maxTokens"]);
663
754
  //#endregion
664
755
  //#region lib/types/index.js
665
756
  /**
@@ -671,7 +762,8 @@ const name = "tool-skill";
671
762
  const inject = [
672
763
  "agents",
673
764
  "tools",
674
- "skills"
765
+ "skills",
766
+ "workingDirectory"
675
767
  ];
676
768
  const DEFAULT_CATALOG_DESCRIPTION_MAX_LENGTH = 500;
677
769
  /** Durable entry list mirroring the rendered catalog lines, for non-model consumers. */
@@ -774,7 +866,7 @@ function apply(ctx, config = {}) {
774
866
  async execute(args, exec) {
775
867
  if (!isSkillName(args.name)) throw new Error(`invalid skill name "${args.name}"`);
776
868
  const lookup = {
777
- cwd: exec.agent?.session.header.cwd,
869
+ cwd: exec.agent === void 0 ? void 0 : await ctx.workingDirectory.ensure(exec.agent, exec.signal),
778
870
  signal: exec.signal,
779
871
  scope: exec.agent
780
872
  };
@@ -808,7 +900,7 @@ function apply(ctx, config = {}) {
808
900
  if (names.length === 0) return decision;
809
901
  signal.throwIfAborted();
810
902
  const lookup = {
811
- cwd: agent.session.header.cwd,
903
+ cwd: await ctx.workingDirectory.ensure(agent, signal),
812
904
  signal,
813
905
  scope: agent
814
906
  };
@@ -841,7 +933,7 @@ function apply(ctx, config = {}) {
841
933
  if (decision.kind === "reject") return decision;
842
934
  signal.throwIfAborted();
843
935
  const snapshot = ctx.tools.get(skillTool.name, agent) === skillTool ? await ctx.skills.snapshot({
844
- cwd: agent.session.header.cwd,
936
+ cwd: await ctx.workingDirectory.ensure(agent, signal),
845
937
  signal,
846
938
  scope: agent
847
939
  }) : {
package/locale/en.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "meta": {
3
+ "title": "tool-skill"
4
+ }
5
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "技能加载工具",
4
+ "description": "让 AI 按需加载技能说明。"
5
+ }
6
+ }
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.1",
4
+ "version": "0.2.1-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -19,32 +19,36 @@
19
19
  "default": "./lib/index.js"
20
20
  },
21
21
  "./src/*": "./src/*",
22
- "./package.json": "./package.json"
22
+ "./package.json": "./package.json",
23
+ "./locale/*.json": "./locale/*.json"
23
24
  },
24
25
  "files": [
26
+ "locale/*.json",
25
27
  "lib/index.js",
26
28
  "lib/types/**/*.d.ts"
27
29
  ],
28
30
  "license": "MIT",
29
31
  "peerDependencies": {
30
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
31
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
32
- "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
33
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
34
- "@deepseek-ai/dsh-skill": "0.2.1-alpha.1"
32
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
33
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
34
+ "@deepseek-ai/dsh-skill": "0.2.1-alpha.3",
35
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.3",
36
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
37
+ "@deepseek-ai/dsh-working-directory": "0.2.1-alpha.3"
35
38
  },
36
39
  "dependencies": {
37
- "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
40
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.2"
38
41
  },
39
42
  "devDependencies": {
40
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
41
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.1",
42
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
43
- "@deepseek-ai/dsh-scope": "0.2.1-alpha.1",
44
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
45
- "@deepseek-ai/dsh-skill": "0.2.1-alpha.1",
46
- "@deepseek-ai/dsh-skill-filesystem": "0.2.1-alpha.1",
47
- "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
48
- "@deepseek-ai/cordis": "~4.0.5-alpha.1"
43
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
44
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.3",
45
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
46
+ "@deepseek-ai/dsh-scope": "0.2.1-alpha.3",
47
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
48
+ "@deepseek-ai/dsh-skill": "0.2.1-alpha.3",
49
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.1-alpha.3",
50
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.3",
51
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
52
+ "@deepseek-ai/dsh-working-directory": "0.2.1-alpha.3"
49
53
  }
50
54
  }