@deepseek-ai/dsh-tool-skill 0.1.2-alpha.3 → 0.1.2-alpha.5

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
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/skill/tool-skill/README.md
5
- README.md: c814f2cd78ed53576d1f52b1d47f16826e14e77e
6
- README.zh.md: c083f4d8419df9de3148343be857a4ea1b1522db
5
+ README.md: 458c1d1eb8f94496cb93b4c5512502d5aa77849a
6
+ README.zh.md: aa4ac4ad773f013b4aa7faea3abdd66230eca2e4
package/README.md CHANGED
@@ -77,7 +77,7 @@ The package is built on two ideas. First, the catalog is a durable projection, d
77
77
  | File | Role |
78
78
  |---|---|
79
79
  | [`src/index.ts`](src/index.ts) | Plugin entry: tool registration, catalog and gesture pre-step listeners, rendering and digest |
80
- | [`src/invariant.ts`](src/invariant.ts) | Invariant companion |
80
+ | | No runtime invariant companion is published; this model-facing adapter has no independent lifecycle stream; execution relations are owned by the capability seam it calls. |
81
81
 
82
82
  ### Catalog lifecycle
83
83
 
package/README.zh.md CHANGED
@@ -77,7 +77,7 @@ agent(智能体)可以在会话期间发现并加载 skill(技能):在
77
77
  | 文件 | 职责 |
78
78
  |---|---|
79
79
  | [`src/index.ts`](src/index.ts) | 插件入口:工具注册、目录与手势 pre-step 监听器、渲染与 digest |
80
- | [`src/invariant.ts`](src/invariant.ts) | 不变式伴生插件 |
80
+ | | 不发布运行时不变式伴生入口;这个模型侧 adapter 没有独立 lifecycle stream;执行关系由它调用的 capability seam 负责。 |
81
81
 
82
82
  ### 目录生命周期
83
83
 
package/lib/index.js CHANGED
@@ -2,7 +2,29 @@ import { createHash } from "node:crypto";
2
2
  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
+ import "@deepseek-ai/cordis";
5
6
  import { escapeText, isModelInvocable, isSkillName, isUserInvocable, renderSkillContent } from "@deepseek-ai/dsh-skill";
7
+ //#region ../../util/brand/src/index.ts
8
+ /**
9
+ * Apply a compile-time number brand without changing the value.
10
+ * @param value - number admitted by the domain that owns the target brand.
11
+ * @returns the same number with the requested compile-time brand.
12
+ */
13
+ function brandNumber(value) {
14
+ return value;
15
+ }
16
+ //#endregion
17
+ //#region ../../core/session/src/types.ts
18
+ /**
19
+ * Admit a numeric value as an existing Session event position.
20
+ * @param value - non-negative safe integer admitted by the owning log operation.
21
+ * @returns the same number with the Session-sequence brand.
22
+ */
23
+ function SessionSeq(value) {
24
+ if (!Number.isSafeInteger(value) || value < 0 || Object.is(value, -0)) throw new TypeError(`SessionSeq must be a non-negative safe integer, got ${String(value)}`);
25
+ return brandNumber(value);
26
+ }
27
+ //#endregion
6
28
  //#region lib/types/index.js
7
29
  /**
8
30
  * Durable session skill catalog and model-facing `skill` loader tool.
@@ -284,7 +306,7 @@ function digestCatalogEntries(entries) {
284
306
  * Entries of one durable catalog message, or undefined when the record is not a
285
307
  * usable catalog.
286
308
  *
287
- * `agent.session.events` may be a resumed, forked, or externally written seed,
309
+ * `agent.session.snapshotEvents()` may contain a resumed, forked, or externally written seed,
288
310
  * and seed validation only guarantees a source object with a non-empty `kind`;
289
311
  * no per-kind field is checked there. An unreadable record is therefore treated
290
312
  * as "not this plugin's catalog" — the posture the replaced content digest had —
@@ -308,10 +330,10 @@ function readCatalogEntries(source) {
308
330
  }
309
331
  function catalogHistory(agent) {
310
332
  const visible = new Set(agent.session.surface.nodes);
311
- const events = agent.session.events;
312
333
  let published = false;
313
- for (let index = events.length - 1; index >= 0; index -= 1) {
314
- const event = events[index];
334
+ for (let index = agent.session.seq - 1; index >= 0; index -= 1) {
335
+ const event = agent.session.eventAt(SessionSeq(index));
336
+ if (event === void 0) throw new Error(`skill catalog cannot read seq ${String(index)} below the current Session length`);
315
337
  if (event.type !== "user/message" || event.data.source.kind !== "skill-catalog") continue;
316
338
  const entries = readCatalogEntries(event.data.source);
317
339
  if (entries === void 0) continue;
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.1.2-alpha.3",
4
+ "version": "0.1.2-alpha.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,39 +18,32 @@
18
18
  "types": "./lib/types/index.d.ts",
19
19
  "default": "./lib/index.js"
20
20
  },
21
- "./invariant": {
22
- "types": "./lib/types/invariant.d.ts",
23
- "default": "./lib/invariant.js"
24
- },
25
21
  "./src/*": "./src/*",
26
22
  "./package.json": "./package.json"
27
23
  },
28
24
  "files": [
29
25
  "lib/index.js",
30
- "lib/invariant.js",
31
26
  "lib/types/**/*.d.ts"
32
27
  ],
33
28
  "license": "MIT",
34
29
  "peerDependencies": {
35
- "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
36
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
37
- "@deepseek-ai/dsh-agent": "^0.1.2-alpha.3",
38
- "@deepseek-ai/dsh-skill": "^0.1.2-alpha.3",
39
- "@deepseek-ai/dsh-tools": "^0.1.2-alpha.3",
40
- "@deepseek-ai/cordis": "^4.0.2"
30
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.5",
31
+ "@deepseek-ai/cordis": "^4.0.2",
32
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.5",
33
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.5",
34
+ "@deepseek-ai/dsh-skill": "^0.1.2-alpha.5"
41
35
  },
42
36
  "dependencies": {
43
37
  "@deepseek-ai/schemastery": "^3.18.2"
44
38
  },
45
39
  "devDependencies": {
46
- "@deepseek-ai/dsh-agent": "^0.1.2-alpha.3",
47
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
48
- "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
49
- "@deepseek-ai/dsh-scope": "^0.1.2-alpha.3",
50
- "@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
51
- "@deepseek-ai/dsh-skill-filesystem": "^0.1.2-alpha.3",
52
- "@deepseek-ai/dsh-skill": "^0.1.2-alpha.3",
53
- "@deepseek-ai/dsh-tools": "^0.1.2-alpha.3",
40
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.5",
41
+ "@deepseek-ai/dsh-scope": "^0.1.2-alpha.5",
42
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.5",
43
+ "@deepseek-ai/dsh-skill": "^0.1.2-alpha.5",
44
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.5",
45
+ "@deepseek-ai/dsh-skill-filesystem": "^0.1.2-alpha.5",
46
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.5",
54
47
  "@deepseek-ai/cordis": "^4.0.2"
55
48
  }
56
49
  }
package/lib/invariant.js DELETED
@@ -1,23 +0,0 @@
1
- //#region lib/types/invariant.js
2
- /**
3
- * Package-owned invariant companion for `@deepseek-ai/dsh-tool-skill`.
4
- * @module @deepseek-ai/dsh-tool-skill/invariant
5
- */
6
- const PACKAGE_NAME = "@deepseek-ai/dsh-tool-skill";
7
- /** Cordis companion plugin name. */
8
- const name = "tool-skill-invariant";
9
- /** Service required before the companion can reserve package ownership. */
10
- const inject = ["invariants"];
11
- /**
12
- * No runtime invariant: this model-facing adapter has no independent lifecycle stream; execution
13
- * relations are owned by the capability seam it calls.
14
- */
15
- const install = () => {};
16
- /**
17
- * Register this package's invariant companion.
18
- * @param ctx - Cordis context carrying the invariant service.
19
- * @returns the installed registration's disposer after setup succeeds.
20
- */
21
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
22
- //#endregion
23
- export { apply, inject, name };
@@ -1,16 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@deepseek-ai/dsh-tool-skill`.
3
- * @module @deepseek-ai/dsh-tool-skill/invariant
4
- */
5
- import type { Context } from '@deepseek-ai/cordis';
6
- /** Cordis companion plugin name. */
7
- export declare const name = "tool-skill-invariant";
8
- /** Service required before the companion can reserve package ownership. */
9
- export declare const inject: string[];
10
- /**
11
- * Register this package's invariant companion.
12
- * @param ctx - Cordis context carrying the invariant service.
13
- * @returns the installed registration's disposer after setup succeeds.
14
- */
15
- export declare const apply: (ctx: Context) => Promise<() => void>;
16
- //# sourceMappingURL=invariant.d.ts.map