@jacklika/dsh-memory-curator 0.1.0-alpha.1 → 0.1.0-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 +25 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -12,6 +12,30 @@ import z from '@deepseek-ai/schemastery';
12
12
  import { ToolCallId } from '@deepseek-ai/dsh-llm';
13
13
  import { defineTool } from '@deepseek-ai/dsh-tools';
14
14
  import yaml from 'js-yaml';
15
+ /**
16
+ * Format a Date as an ISO-like string in Asia/Shanghai (+08:00).
17
+ * The project convention is to store all vault timestamps in Beijing time.
18
+ */
19
+ function formatBeijingTime(date) {
20
+ const parts = new Intl.DateTimeFormat('sv-SE', {
21
+ timeZone: 'Asia/Shanghai',
22
+ year: 'numeric',
23
+ month: '2-digit',
24
+ day: '2-digit',
25
+ hour: '2-digit',
26
+ minute: '2-digit',
27
+ second: '2-digit',
28
+ hour12: false,
29
+ }).formatToParts(date);
30
+ const get = (type) => parts.find((p) => p.type === type)?.value ?? '00';
31
+ const yyyy = get('year');
32
+ const MM = get('month');
33
+ const dd = get('day');
34
+ const HH = get('hour');
35
+ const mm = get('minute');
36
+ const ss = get('second');
37
+ return `${yyyy}-${MM}-${dd}T${HH}:${mm}:${ss}+08:00`;
38
+ }
15
39
  /** Cordis plugin name used by loader diagnostics. */
16
40
  export const name = 'memory-curator';
17
41
  /** Services required by the curator tools. */
@@ -210,7 +234,7 @@ export function apply(ctx, config) {
210
234
  };
211
235
  }
212
236
  }
213
- const now = new Date().toISOString();
237
+ const now = formatBeijingTime(new Date());
214
238
  const detailsText = args.details ? `\n\n## Details\n\n${args.details}` : '';
215
239
  const appendContent = `${args.summary}${detailsText}\n`;
216
240
  const frontmatter = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jacklika/dsh-memory-curator",
3
3
  "description": "Curator tools for the DSH memory vault: memory_recall before acting and memory_capture after significant work, with conflict detection and optional user approval.",
4
- "version": "0.1.0-alpha.1",
4
+ "version": "0.1.0-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },