@fonlan/dsh-gitmemo 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/lib/mem.js +9 -1
  2. package/package.json +1 -1
package/lib/mem.js CHANGED
@@ -118,6 +118,10 @@ function normalizeEntryFile(file, memDir, baseDir) {
118
118
  }
119
119
  return "entries/" + normalized;
120
120
  }
121
+ /** Treat blank optional path arguments as omitted. */
122
+ function blankToUndefined(value) {
123
+ return value !== undefined && value.trim().length === 0 ? undefined : value;
124
+ }
121
125
  /** Reject paths that could escape the memory repo. */
122
126
  function isSafeEntryPath(file) {
123
127
  if (file.startsWith("/") || file.includes("../") || file.endsWith("/..") || file.includes("\\") || file.includes(":")) {
@@ -425,7 +429,11 @@ export class GitMemo {
425
429
  */
426
430
  async write(options) {
427
431
  await ensureInit(this.memDir, this.config.gitTimeoutMs);
428
- const { title, content, contentFile, file, body, bodyFile } = options;
432
+ const { title, content } = options;
433
+ const contentFile = blankToUndefined(options.contentFile);
434
+ const file = blankToUndefined(options.file);
435
+ const body = options.body;
436
+ const bodyFile = blankToUndefined(options.bodyFile);
429
437
  if (title === undefined || title.trim().length === 0) {
430
438
  throw new Error("gitmemo: write requires --title");
431
439
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonlan/dsh-gitmemo",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Git-backed long-term memory for DeepSeek Harness: a local .mem git repo with mem_search / mem_read / mem_write / mem_delete tools, auto-managed by the agent with zero manual steps.",
5
5
  "author": "fonlan",
6
6
  "publishConfig": {