@jacklika/dsh-tool-memory-filesystem 0.1.3-alpha.3 → 0.1.3-alpha.4

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/lib/index.js CHANGED
@@ -12,6 +12,7 @@ import { readdir, readFile, realpath, rename, rm, stat, writeFile, mkdir } from
12
12
  import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
13
13
  import z from '@deepseek-ai/schemastery';
14
14
  import { defineTool } from '@deepseek-ai/dsh-tools';
15
+ import { formatBeijingTime } from '@jacklika/dsh-memory-time';
15
16
  import yaml from 'js-yaml';
16
17
  /**
17
18
  * Compute a vault-relative note id from an absolute path. The result always
@@ -20,31 +21,6 @@ import yaml from 'js-yaml';
20
21
  export function vaultRelativeId(root, absolutePath) {
21
22
  return relative(root, absolutePath).replace(/\\/g, '/');
22
23
  }
23
- /**
24
- * Format a Date as an ISO-like string in Asia/Shanghai (+08:00).
25
- * The project convention is to store all vault timestamps in Beijing time.
26
- * Keep this in sync with the helper in `@jacklika/dsh-memory-curator`.
27
- */
28
- export function formatBeijingTime(date) {
29
- const parts = new Intl.DateTimeFormat('sv-SE', {
30
- timeZone: 'Asia/Shanghai',
31
- year: 'numeric',
32
- month: '2-digit',
33
- day: '2-digit',
34
- hour: '2-digit',
35
- minute: '2-digit',
36
- second: '2-digit',
37
- hour12: false,
38
- }).formatToParts(date);
39
- const get = (type) => parts.find((p) => p.type === type)?.value ?? '00';
40
- const yyyy = get('year');
41
- const MM = get('month');
42
- const dd = get('day');
43
- const HH = get('hour');
44
- const mm = get('minute');
45
- const ss = get('second');
46
- return `${yyyy}-${MM}-${dd}T${HH}:${mm}:${ss}+08:00`;
47
- }
48
24
  /** Cordis plugin name used by loader diagnostics. */
49
25
  export const name = 'tool-memory-filesystem';
50
26
  /** Services required by the wiki/memory tool suite. */
@@ -17,12 +17,6 @@ export type * from './types.ts';
17
17
  * uses POSIX separators so note ids are stable across Windows, macOS, and Linux.
18
18
  */
19
19
  export declare function vaultRelativeId(root: string, absolutePath: string): string;
20
- /**
21
- * Format a Date as an ISO-like string in Asia/Shanghai (+08:00).
22
- * The project convention is to store all vault timestamps in Beijing time.
23
- * Keep this in sync with the helper in `@jacklika/dsh-memory-curator`.
24
- */
25
- export declare function formatBeijingTime(date: Date): string;
26
20
  /** Cordis plugin name used by loader diagnostics. */
27
21
  export declare const name = "tool-memory-filesystem";
28
22
  /** Services required by the wiki/memory tool suite. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jacklika/dsh-tool-memory-filesystem",
3
3
  "description": "Model-facing wiki/memory tools over a local Markdown vault: read, search, and write notes with Obsidian-style links and YAML frontmatter.",
4
- "version": "0.1.3-alpha.3",
4
+ "version": "0.1.3-alpha.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,7 +32,8 @@
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
34
  "@deepseek-ai/schemastery": "3.18.4",
35
- "js-yaml": "^4.2.0"
35
+ "js-yaml": "^4.2.0",
36
+ "@jacklika/dsh-memory-time": "^0.1.0-alpha.0"
36
37
  },
37
38
  "peerDependencies": {
38
39
  "@deepseek-ai/cordis": "4.0.4",