clawvault 2.5.3 → 2.5.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.
@@ -2,7 +2,7 @@ import {
2
2
  QmdUnavailableError,
3
3
  hasQmd,
4
4
  qmdEmbed
5
- } from "./chunk-O7XHXF7F.js";
5
+ } from "./chunk-MAKNAHAW.js";
6
6
  import {
7
7
  resolveVaultPath
8
8
  } from "./chunk-MXSSG3QU.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  hasQmd,
3
3
  withQmdIndexArgs
4
- } from "./chunk-O7XHXF7F.js";
4
+ } from "./chunk-MAKNAHAW.js";
5
5
  import {
6
6
  DEFAULT_CATEGORIES
7
7
  } from "./chunk-2CDEETQN.js";
@@ -9,17 +9,24 @@ var BLOCKED_PATHS = [
9
9
  "node_modules"
10
10
  ];
11
11
  var SUPPORTED_METHODS = ["GET", "PUT", "DELETE", "MKCOL", "PROPFIND", "OPTIONS", "HEAD", "MOVE", "COPY"];
12
+ function toRequestSegments(requestPath) {
13
+ return requestPath.replace(/\\/g, "/").split("/").filter(Boolean);
14
+ }
15
+ function isWithinRoot(fullPath, rootPath) {
16
+ const resolvedRoot = path.resolve(rootPath);
17
+ const relative2 = path.relative(resolvedRoot, fullPath);
18
+ return !(relative2.startsWith("..") || path.isAbsolute(relative2));
19
+ }
12
20
  function isPathSafe(requestPath, rootPath) {
13
- if (requestPath.includes("..")) {
21
+ const pathParts = toRequestSegments(requestPath);
22
+ if (pathParts.includes("..")) {
14
23
  return false;
15
24
  }
16
- const normalizedPath = path.normalize(requestPath).replace(/^\/+/, "");
17
- const fullPath = path.resolve(rootPath, normalizedPath);
18
- const resolvedRoot = path.resolve(rootPath);
19
- if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {
25
+ const normalizedRelativePath = path.normalize(pathParts.join(path.sep));
26
+ const fullPath = path.resolve(rootPath, normalizedRelativePath);
27
+ if (!isWithinRoot(fullPath, rootPath)) {
20
28
  return false;
21
29
  }
22
- const pathParts = normalizedPath.split(path.sep);
23
30
  for (const part of pathParts) {
24
31
  if (BLOCKED_PATHS.includes(part)) {
25
32
  return false;
@@ -28,13 +35,13 @@ function isPathSafe(requestPath, rootPath) {
28
35
  return true;
29
36
  }
30
37
  function resolveWebDAVPath(requestPath, rootPath) {
31
- if (requestPath.includes("..")) {
38
+ const pathParts = toRequestSegments(requestPath);
39
+ if (pathParts.includes("..")) {
32
40
  return null;
33
41
  }
34
- const normalizedPath = path.normalize(requestPath).replace(/^\/+/, "");
35
- const fullPath = path.resolve(rootPath, normalizedPath);
36
- const resolvedRoot = path.resolve(rootPath);
37
- if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {
42
+ const normalizedRelativePath = path.normalize(pathParts.join(path.sep));
43
+ const fullPath = path.resolve(rootPath, normalizedRelativePath);
44
+ if (!isWithinRoot(fullPath, rootPath)) {
38
45
  return null;
39
46
  }
40
47
  return fullPath;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerTailscaleCommands
3
- } from "./chunk-NZ4ZZNSR.js";
3
+ } from "./chunk-THRJVD4L.js";
4
4
  import {
5
5
  registerObserveCommand
6
6
  } from "./chunk-OSMS7QIG.js";
@@ -9,10 +9,10 @@ import {
9
9
  } from "./chunk-2YDBJS7M.js";
10
10
  import {
11
11
  registerContextCommand
12
- } from "./chunk-GFJ3LIIB.js";
12
+ } from "./chunk-XAVB4GB4.js";
13
13
  import {
14
14
  registerEmbedCommand
15
- } from "./chunk-3FP5BJ42.js";
15
+ } from "./chunk-4QYGFWRM.js";
16
16
  import {
17
17
  registerInjectCommand
18
18
  } from "./chunk-GSD4ALSI.js";
@@ -6,7 +6,7 @@ import {
6
6
  hasQmd,
7
7
  qmdEmbed,
8
8
  qmdUpdate
9
- } from "./chunk-O7XHXF7F.js";
9
+ } from "./chunk-MAKNAHAW.js";
10
10
  import {
11
11
  DEFAULT_CATEGORIES,
12
12
  TYPE_TO_CATEGORY
@@ -235,14 +235,14 @@ var SearchEngine = class {
235
235
  for (const qr of qmdResults) {
236
236
  const filePath = this.qmdUriToPath(qr.file);
237
237
  const relativePath = this.vaultPath ? path.relative(this.vaultPath, filePath) : filePath;
238
- const normalizedRelativePath = relativePath.split(path.sep).join("/");
238
+ const normalizedRelativePath = relativePath.replace(/\\/g, "/");
239
239
  if (normalizedRelativePath.startsWith("ledger/archive/") || normalizedRelativePath.includes("/ledger/archive/")) {
240
240
  continue;
241
241
  }
242
- const docId = relativePath.replace(/\.md$/, "");
243
- let doc = this.documents.get(docId);
242
+ const docId = normalizedRelativePath.replace(/\.md$/, "");
243
+ let doc = this.documents.get(docId) ?? this.documents.get(docId.split("/").join(path.sep));
244
244
  const modifiedAt = this.resolveModifiedAt(doc, filePath);
245
- const parts = relativePath.split(path.sep);
245
+ const parts = normalizedRelativePath.split("/");
246
246
  const docCategory = parts.length > 1 ? parts[0] : "root";
247
247
  if (category && docCategory !== category) continue;
248
248
  if (tags && tags.length > 0 && doc) {
@@ -9,7 +9,7 @@ import {
9
9
  serveVault,
10
10
  stopTailscaleServe,
11
11
  syncWithPeer
12
- } from "./chunk-4GBPTBFJ.js";
12
+ } from "./chunk-TIGW564L.js";
13
13
  import {
14
14
  resolveVaultPath
15
15
  } from "./chunk-MXSSG3QU.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  WEBDAV_PREFIX,
3
3
  createWebDAVHandler
4
- } from "./chunk-CLE2HHNT.js";
4
+ } from "./chunk-IVRIKYFE.js";
5
5
 
6
6
  // src/lib/tailscale.ts
7
7
  import { spawnSync, spawn } from "child_process";
@@ -10,10 +10,10 @@ import {
10
10
  import {
11
11
  ClawVault,
12
12
  findVault
13
- } from "./chunk-AY4PGUVL.js";
13
+ } from "./chunk-KL4NAOMO.js";
14
14
  import {
15
15
  hasQmd
16
- } from "./chunk-O7XHXF7F.js";
16
+ } from "./chunk-MAKNAHAW.js";
17
17
  import {
18
18
  loadMemoryGraphIndex
19
19
  } from "./chunk-ZZA73MFY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ClawVault
3
- } from "./chunk-AY4PGUVL.js";
3
+ } from "./chunk-KL4NAOMO.js";
4
4
  import {
5
5
  parseObservationMarkdown
6
6
  } from "./chunk-FHFUXL6G.js";
package/dist/cli/index.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  registerCliCommands
3
- } from "../chunk-FG6RJMCN.js";
4
- import "../chunk-NZ4ZZNSR.js";
5
- import "../chunk-4GBPTBFJ.js";
6
- import "../chunk-CLE2HHNT.js";
3
+ } from "../chunk-JDLOL2PL.js";
4
+ import "../chunk-THRJVD4L.js";
5
+ import "../chunk-TIGW564L.js";
6
+ import "../chunk-IVRIKYFE.js";
7
7
  import "../chunk-OSMS7QIG.js";
8
8
  import "../chunk-P5EPF6MB.js";
9
9
  import "../chunk-2YDBJS7M.js";
10
10
  import "../chunk-YOSEUUNB.js";
11
- import "../chunk-GFJ3LIIB.js";
11
+ import "../chunk-XAVB4GB4.js";
12
12
  import "../chunk-IZEY5S74.js";
13
13
  import "../chunk-HRLWZGMA.js";
14
14
  import "../chunk-S2IG7VNM.js";
15
15
  import "../chunk-5GZFTAL7.js";
16
- import "../chunk-AY4PGUVL.js";
16
+ import "../chunk-KL4NAOMO.js";
17
17
  import "../chunk-FHFUXL6G.js";
18
- import "../chunk-3FP5BJ42.js";
19
- import "../chunk-O7XHXF7F.js";
18
+ import "../chunk-4QYGFWRM.js";
19
+ import "../chunk-MAKNAHAW.js";
20
20
  import "../chunk-GSD4ALSI.js";
21
21
  import "../chunk-K3CDT7IH.js";
22
22
  import "../chunk-ITPEXLHA.js";
@@ -3,10 +3,10 @@ import {
3
3
  contextCommand,
4
4
  formatContextMarkdown,
5
5
  registerContextCommand
6
- } from "../chunk-GFJ3LIIB.js";
7
- import "../chunk-AY4PGUVL.js";
6
+ } from "../chunk-XAVB4GB4.js";
7
+ import "../chunk-KL4NAOMO.js";
8
8
  import "../chunk-FHFUXL6G.js";
9
- import "../chunk-O7XHXF7F.js";
9
+ import "../chunk-MAKNAHAW.js";
10
10
  import "../chunk-2CDEETQN.js";
11
11
  import "../chunk-ZZA73MFY.js";
12
12
  import "../chunk-Z2XBWN7A.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  doctor
3
- } from "../chunk-LMEMZGUV.js";
3
+ } from "../chunk-W2HNZC22.js";
4
4
  import "../chunk-7ZRP733D.js";
5
5
  import "../chunk-4VQTUVH7.js";
6
6
  import "../chunk-J7ZWCI2C.js";
@@ -8,9 +8,9 @@ import "../chunk-IZEY5S74.js";
8
8
  import "../chunk-HRLWZGMA.js";
9
9
  import "../chunk-S2IG7VNM.js";
10
10
  import "../chunk-5GZFTAL7.js";
11
- import "../chunk-AY4PGUVL.js";
11
+ import "../chunk-KL4NAOMO.js";
12
12
  import "../chunk-FHFUXL6G.js";
13
- import "../chunk-O7XHXF7F.js";
13
+ import "../chunk-MAKNAHAW.js";
14
14
  import "../chunk-ITPEXLHA.js";
15
15
  import "../chunk-2CDEETQN.js";
16
16
  import "../chunk-ZZA73MFY.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  embedCommand,
3
3
  registerEmbedCommand
4
- } from "../chunk-3FP5BJ42.js";
5
- import "../chunk-O7XHXF7F.js";
4
+ } from "../chunk-4QYGFWRM.js";
5
+ import "../chunk-MAKNAHAW.js";
6
6
  import "../chunk-MXSSG3QU.js";
7
7
  export {
8
8
  embedCommand,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  setupCommand
3
- } from "../chunk-M25QVSJM.js";
4
- import "../chunk-O7XHXF7F.js";
3
+ } from "../chunk-AXKYDCNN.js";
4
+ import "../chunk-MAKNAHAW.js";
5
5
  import "../chunk-2CDEETQN.js";
6
6
  export {
7
7
  setupCommand
@@ -10,11 +10,11 @@ import {
10
10
  import "../chunk-5GZFTAL7.js";
11
11
  import {
12
12
  ClawVault
13
- } from "../chunk-AY4PGUVL.js";
13
+ } from "../chunk-KL4NAOMO.js";
14
14
  import "../chunk-FHFUXL6G.js";
15
15
  import {
16
16
  qmdUpdate
17
- } from "../chunk-O7XHXF7F.js";
17
+ } from "../chunk-MAKNAHAW.js";
18
18
  import "../chunk-K3CDT7IH.js";
19
19
  import "../chunk-ITPEXLHA.js";
20
20
  import "../chunk-2CDEETQN.js";
@@ -13,13 +13,13 @@ import "../chunk-S2IG7VNM.js";
13
13
  import "../chunk-5GZFTAL7.js";
14
14
  import {
15
15
  ClawVault
16
- } from "../chunk-AY4PGUVL.js";
16
+ } from "../chunk-KL4NAOMO.js";
17
17
  import "../chunk-FHFUXL6G.js";
18
18
  import {
19
19
  QmdUnavailableError,
20
20
  hasQmd,
21
21
  withQmdIndexArgs
22
- } from "../chunk-O7XHXF7F.js";
22
+ } from "../chunk-MAKNAHAW.js";
23
23
  import "../chunk-ITPEXLHA.js";
24
24
  import "../chunk-2CDEETQN.js";
25
25
  import {
@@ -8,9 +8,9 @@ import {
8
8
  tailscaleServeCommand,
9
9
  tailscaleStatusCommand,
10
10
  tailscaleSyncCommand
11
- } from "../chunk-NZ4ZZNSR.js";
12
- import "../chunk-4GBPTBFJ.js";
13
- import "../chunk-CLE2HHNT.js";
11
+ } from "../chunk-THRJVD4L.js";
12
+ import "../chunk-TIGW564L.js";
13
+ import "../chunk-IVRIKYFE.js";
14
14
  import "../chunk-MXSSG3QU.js";
15
15
  export {
16
16
  registerTailscaleCommands,
@@ -4,11 +4,11 @@ import {
4
4
  import "../chunk-7ZRP733D.js";
5
5
  import {
6
6
  ClawVault
7
- } from "../chunk-AY4PGUVL.js";
7
+ } from "../chunk-KL4NAOMO.js";
8
8
  import {
9
9
  parseObservationMarkdown
10
10
  } from "../chunk-FHFUXL6G.js";
11
- import "../chunk-O7XHXF7F.js";
11
+ import "../chunk-MAKNAHAW.js";
12
12
  import "../chunk-2CDEETQN.js";
13
13
  import "../chunk-ZZA73MFY.js";
14
14
  import {
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-ZKGY7WTT.js";
10
10
  import {
11
11
  setupCommand
12
- } from "./chunk-M25QVSJM.js";
12
+ } from "./chunk-AXKYDCNN.js";
13
13
  import {
14
14
  registerSyncBdCommand,
15
15
  syncBdCommand
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-4IV3R2F5.js";
30
30
  import {
31
31
  doctor
32
- } from "./chunk-LMEMZGUV.js";
32
+ } from "./chunk-W2HNZC22.js";
33
33
  import "./chunk-7ZRP733D.js";
34
34
  import {
35
35
  graphCommand,
@@ -49,7 +49,7 @@ import "./chunk-4VQTUVH7.js";
49
49
  import "./chunk-J7ZWCI2C.js";
50
50
  import {
51
51
  registerCliCommands
52
- } from "./chunk-FG6RJMCN.js";
52
+ } from "./chunk-JDLOL2PL.js";
53
53
  import {
54
54
  registerTailscaleCommands,
55
55
  registerTailscaleDiscoverCommand,
@@ -60,7 +60,7 @@ import {
60
60
  tailscaleServeCommand,
61
61
  tailscaleStatusCommand,
62
62
  tailscaleSyncCommand
63
- } from "./chunk-NZ4ZZNSR.js";
63
+ } from "./chunk-THRJVD4L.js";
64
64
  import {
65
65
  CLAWVAULT_SERVE_PATH,
66
66
  DEFAULT_SERVE_PORT,
@@ -81,8 +81,8 @@ import {
81
81
  serveVault,
82
82
  stopTailscaleServe,
83
83
  syncWithPeer
84
- } from "./chunk-4GBPTBFJ.js";
85
- import "./chunk-CLE2HHNT.js";
84
+ } from "./chunk-TIGW564L.js";
85
+ import "./chunk-IVRIKYFE.js";
86
86
  import {
87
87
  SessionWatcher,
88
88
  observeCommand,
@@ -106,7 +106,7 @@ import {
106
106
  normalizeContextProfileInput,
107
107
  registerContextCommand,
108
108
  resolveContextProfile
109
- } from "./chunk-GFJ3LIIB.js";
109
+ } from "./chunk-XAVB4GB4.js";
110
110
  import {
111
111
  getObserverStaleness,
112
112
  getScaledObservationThresholdBytes,
@@ -132,12 +132,12 @@ import {
132
132
  ClawVault,
133
133
  createVault,
134
134
  findVault
135
- } from "./chunk-AY4PGUVL.js";
135
+ } from "./chunk-KL4NAOMO.js";
136
136
  import "./chunk-FHFUXL6G.js";
137
137
  import {
138
138
  embedCommand,
139
139
  registerEmbedCommand
140
- } from "./chunk-3FP5BJ42.js";
140
+ } from "./chunk-4QYGFWRM.js";
141
141
  import {
142
142
  QMD_INSTALL_COMMAND,
143
143
  QMD_INSTALL_URL,
@@ -148,7 +148,7 @@ import {
148
148
  hasQmd,
149
149
  qmdEmbed,
150
150
  qmdUpdate
151
- } from "./chunk-O7XHXF7F.js";
151
+ } from "./chunk-MAKNAHAW.js";
152
152
  import {
153
153
  buildInjectionResult,
154
154
  deterministicInjectMatches,
@@ -21,8 +21,8 @@ import {
21
21
  serveVault,
22
22
  stopTailscaleServe,
23
23
  syncWithPeer
24
- } from "../chunk-4GBPTBFJ.js";
25
- import "../chunk-CLE2HHNT.js";
24
+ } from "../chunk-TIGW564L.js";
25
+ import "../chunk-IVRIKYFE.js";
26
26
  export {
27
27
  CLAWVAULT_SERVE_PATH,
28
28
  DEFAULT_SERVE_PORT,
@@ -14,7 +14,7 @@ import {
14
14
  handlePut,
15
15
  isPathSafe,
16
16
  resolveWebDAVPath
17
- } from "../chunk-CLE2HHNT.js";
17
+ } from "../chunk-IVRIKYFE.js";
18
18
  export {
19
19
  WEBDAV_PREFIX,
20
20
  checkAuth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawvault",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Structured memory system for AI agents — typed storage, knowledge graph, context profiles, canvas dashboards, neural graph themes, and Obsidian-native task views. An elephant never forgets. 🐘",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",