@context-vault/core 2.8.4 → 2.8.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@context-vault/core",
3
- "version": "2.8.4",
3
+ "version": "2.8.6",
4
4
  "type": "module",
5
5
  "description": "Shared core: capture, index, retrieve, tools, and utilities for context-vault",
6
6
  "main": "src/index.js",
@@ -16,8 +16,8 @@ const VEC_WEIGHT = 0.6;
16
16
  */
17
17
  export function buildFtsQuery(query) {
18
18
  const words = query
19
- .split(/\s+/)
20
- .map((w) => w.replace(/[*"()\-:^~{}]/g, ""))
19
+ .split(/[\s-]+/)
20
+ .map((w) => w.replace(/[*"():^~{}]/g, ""))
21
21
  .filter((w) => w.length > 0);
22
22
  if (!words.length) return null;
23
23
  return words.map((w) => `"${w}"`).join(" AND ");
@@ -26,6 +26,7 @@ function validateSaveInput({
26
26
  meta,
27
27
  source,
28
28
  identity_key,
29
+ expires_at,
29
30
  }) {
30
31
  if (kind !== undefined && kind !== null) {
31
32
  if (typeof kind !== "string" || kind.length > MAX_KIND_LENGTH) {
@@ -93,6 +94,14 @@ function validateSaveInput({
93
94
  );
94
95
  }
95
96
  }
97
+ if (expires_at !== undefined && expires_at !== null) {
98
+ if (
99
+ typeof expires_at !== "string" ||
100
+ isNaN(new Date(expires_at).getTime())
101
+ ) {
102
+ return err("expires_at must be a valid ISO date string", "INVALID_INPUT");
103
+ }
104
+ }
96
105
  return null;
97
106
  }
98
107
 
@@ -178,6 +187,7 @@ export async function handler(
178
187
  meta,
179
188
  source,
180
189
  identity_key,
190
+ expires_at,
181
191
  });
182
192
  if (inputErr) return inputErr;
183
193