@deepseek-ai/dsh-skill-filesystem 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.
Files changed (2) hide show
  1. package/lib/index.js +17 -14
  2. package/package.json +10 -10
package/lib/index.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import { access, lstat, readFile, readdir, realpath, stat } from "node:fs/promises";
2
2
  import { unwatchFile, watchFile } from "node:fs";
3
3
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
- import { homedir } from "node:os";
5
4
  import chokidar from "chokidar";
6
5
  import z from "@deepseek-ai/schemastery";
7
6
  import { parse } from "yaml";
8
- import { canonicalizeWatchPath, resolveDshHome } from "@deepseek-ai/dsh-home-paths";
7
+ import { canonicalizeWatchPath, resolveAgentsHome, resolveDshHome } from "@deepseek-ai/dsh-home-paths";
9
8
  import { BUNDLED_SKILL_RANK, isSkillName } from "@deepseek-ai/dsh-skill";
10
9
  //#region lib/types/index.js
11
10
  /**
@@ -75,7 +74,7 @@ var FileSystemSkillProvider = class {
75
74
  this.name = config.providerName ?? "filesystem";
76
75
  this.includeDefaultRoots = config.includeDefaultRoots ?? true;
77
76
  this.dshHome = resolveDshHome(config.dshHome);
78
- this.agentsHome = resolve(config.agentsHome ?? process.env.DSH_AGENTS_HOME ?? join(homedir(), ".agents"));
77
+ this.agentsHome = resolveAgentsHome(config.agentsHome);
79
78
  this.customSkillDirs = (config.customSkillDirs ?? []).map((root) => resolve(root));
80
79
  this.watchManager = new SkillWatchManager(ctx, control.invalidate, resolveWatchConfig(config));
81
80
  control.signal.addEventListener("abort", () => {
@@ -382,13 +381,24 @@ var SkillWatchManager = class {
382
381
  usePolling: this.config.usePolling,
383
382
  interval: this.config.pollIntervalMs
384
383
  });
385
- const handle = {
386
- mode,
387
- close: () => watcher.close()
388
- };
389
384
  let ready = false;
390
385
  const readiness = Promise.withResolvers();
391
386
  const signal = this.lifecycle.signal;
387
+ const onError = (error) => {
388
+ if (!ready) {
389
+ readiness.reject(error);
390
+ return;
391
+ }
392
+ this.handleWatcherError(state, error);
393
+ };
394
+ const handle = {
395
+ mode,
396
+ close: () => {
397
+ const closing = watcher.close();
398
+ watcher.on("error", onError);
399
+ return closing;
400
+ }
401
+ };
392
402
  if (signal.aborted) {
393
403
  await this.closeWatcher(handle);
394
404
  signal.throwIfAborted();
@@ -397,13 +407,6 @@ var SkillWatchManager = class {
397
407
  readiness.reject(signal.reason);
398
408
  };
399
409
  signal.addEventListener("abort", onAbort, { once: true });
400
- const onError = (error) => {
401
- if (!ready) {
402
- readiness.reject(error);
403
- return;
404
- }
405
- this.handleWatcherError(state, error);
406
- };
407
410
  watcher.on("error", onError);
408
411
  watcher.once("ready", () => {
409
412
  ready = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-skill-filesystem",
3
3
  "description": "Local filesystem skill provider for the DeepSeek Harness",
4
- "version": "0.2.1-alpha.1",
4
+ "version": "0.2.1-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,20 +27,20 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
- "@deepseek-ai/dsh-fs": "0.2.1-alpha.1",
31
- "@deepseek-ai/dsh-home-paths": "0.2.1-alpha.1",
32
- "@deepseek-ai/dsh-skill": "0.2.1-alpha.1",
30
+ "@deepseek-ai/dsh-fs": "0.2.1-alpha.2",
31
+ "@deepseek-ai/dsh-home-paths": "0.2.1-alpha.2",
32
+ "@deepseek-ai/dsh-skill": "0.2.1-alpha.2",
33
33
  "@deepseek-ai/cordis": "~4.0.5-alpha.1"
34
34
  },
35
35
  "dependencies": {
36
36
  "chokidar": "^5.0.0",
37
- "yaml": "^2.4.2",
38
- "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
37
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.1",
38
+ "yaml": "^2.4.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@deepseek-ai/dsh-skill": "0.2.1-alpha.1",
42
- "@deepseek-ai/dsh-fs": "0.2.1-alpha.1",
43
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
44
- "@deepseek-ai/dsh-home-paths": "0.2.1-alpha.1"
41
+ "@deepseek-ai/dsh-fs": "0.2.1-alpha.2",
42
+ "@deepseek-ai/dsh-home-paths": "0.2.1-alpha.2",
43
+ "@deepseek-ai/dsh-skill": "0.2.1-alpha.2",
44
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1"
45
45
  }
46
46
  }