@yugenlab/vaayu 0.1.9 → 0.1.11

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 (43) hide show
  1. package/chunks/{agentic-tool-loop-2FZK72JO.js → agentic-tool-loop-O3NUV7KG.js} +1 -1
  2. package/chunks/{chunk-UZ6OIVEC.js → chunk-2OBLQJYJ.js} +1 -1
  3. package/chunks/{chunk-PJEYJQ2C.js → chunk-3AYSJ7WB.js} +30 -18
  4. package/chunks/{chunk-U62ABYKD.js → chunk-67DXWEKG.js} +3 -3
  5. package/chunks/{chunk-6556EKOB.js → chunk-7AYYXHYZ.js} +25 -24
  6. package/chunks/{chunk-IGBRBFXX.js → chunk-7XV5ISV7.js} +7 -5
  7. package/chunks/{chunk-JAWZ7ANC.js → chunk-A3HOZBC5.js} +11 -7
  8. package/chunks/{chunk-LVE2EOOH.js → chunk-D46QTN3G.js} +126 -136
  9. package/chunks/{chunk-PRXQW76U.js → chunk-EG37M4QL.js} +17 -6
  10. package/chunks/{chunk-7UOXFHEB.js → chunk-F6RNEGFX.js} +480 -432
  11. package/chunks/{chunk-MJ74G5RB.js → chunk-G2QREGXK.js} +2 -2
  12. package/chunks/{chunk-DOQMEQ5S.js → chunk-JZTFJE7M.js} +39 -39
  13. package/chunks/{chunk-S2HDNNC7.js → chunk-LJUEMPLG.js} +638 -679
  14. package/chunks/{chunk-C76USAC5.js → chunk-QFGAB4XD.js} +13 -5
  15. package/chunks/{chunk-D3RVJGO7.js → chunk-QV4GPIPT.js} +118 -135
  16. package/chunks/{chunk-YJRXLRTE.js → chunk-V2ZIKDN4.js} +9 -8
  17. package/chunks/{chunk-YSC77CKZ.js → chunk-VCUJES75.js} +3276 -3526
  18. package/chunks/{chunk-OBYBBGHA.js → chunk-W4PVGBUH.js} +190 -189
  19. package/chunks/chunk-Z576WVLG.js +434 -0
  20. package/chunks/{chunk-NHRBVSN3.js → chunk-ZYY6N3SP.js} +117 -110
  21. package/chunks/{consolidation-indexer-CD6DS2HO.js → consolidation-indexer-VIWOP6VO.js} +8 -8
  22. package/chunks/{day-consolidation-U3X6P4ZG.js → day-consolidation-HMHSXIOM.js} +8 -4
  23. package/chunks/{src-ZAKUL232.js → dist-CY5NX2IK.js} +17 -17
  24. package/chunks/graphrag-T2QWNX57.js +14 -0
  25. package/chunks/{hierarchical-temporal-search-ETXYYJZK.js → hierarchical-temporal-search-U6DG74IR.js} +2 -2
  26. package/chunks/hybrid-search-BYTXCOXP.js +20 -0
  27. package/chunks/{memory-store-A6WOWLWC.js → memory-store-LEERUQGL.js} +3 -3
  28. package/chunks/periodic-consolidation-D6SSKZ7H.js +11 -0
  29. package/chunks/{postgres-WLH3D5HG.js → postgres-7GZDDX77.js} +2 -2
  30. package/chunks/{recall-IUPQCBYP.js → recall-LNRQVATQ.js} +7 -7
  31. package/chunks/search-BIODUW2P.js +19 -0
  32. package/chunks/{session-store-NDUDYAC7.js → session-store-O3TS7DUY.js} +5 -5
  33. package/chunks/{sqlite-DHUQGPR5.js → sqlite-7BC4DJTN.js} +2 -2
  34. package/chunks/vasana-engine-BJFHJVGM.js +30 -0
  35. package/gateway.js +31671 -24786
  36. package/package.json +1 -1
  37. package/pair-cli.js +1 -1
  38. package/chunks/chunk-TEQKXGIK.js +0 -752
  39. package/chunks/graphrag-LAZSXLLI.js +0 -14
  40. package/chunks/hybrid-search-TX6T3KYH.js +0 -20
  41. package/chunks/periodic-consolidation-4MACZE6S.js +0 -11
  42. package/chunks/search-HHSVHBXC.js +0 -19
  43. package/chunks/vasana-engine-G6BPOFX7.js +0 -10
@@ -144,4 +144,4 @@ async function runAgenticToolLoop(params) {
144
144
  export {
145
145
  runAgenticToolLoop
146
146
  };
147
- //# sourceMappingURL=agentic-tool-loop-2FZK72JO.js.map
147
+ //# sourceMappingURL=agentic-tool-loop-O3NUV7KG.js.map
@@ -195,4 +195,4 @@ export {
195
195
  MemoryError,
196
196
  getChitraguptaHome
197
197
  };
198
- //# sourceMappingURL=chunk-UZ6OIVEC.js.map
198
+ //# sourceMappingURL=chunk-2OBLQJYJ.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  getMemory,
3
3
  listMemoryScopes
4
- } from "./chunk-6556EKOB.js";
4
+ } from "./chunk-7AYYXHYZ.js";
5
5
  import {
6
6
  listSessions,
7
7
  loadSession
8
- } from "./chunk-NHRBVSN3.js";
8
+ } from "./chunk-ZYY6N3SP.js";
9
9
  import {
10
10
  initAgentSchema
11
- } from "./chunk-YJRXLRTE.js";
11
+ } from "./chunk-V2ZIKDN4.js";
12
12
  import {
13
13
  DatabaseManager
14
- } from "./chunk-U62ABYKD.js";
14
+ } from "./chunk-67DXWEKG.js";
15
15
 
16
- // ../chitragupta/packages/smriti/src/search.ts
16
+ // ../chitragupta/packages/smriti/dist/search.js
17
17
  var _dbInitialized = false;
18
18
  function getAgentDb() {
19
19
  const dbm = DatabaseManager.instance();
@@ -34,16 +34,20 @@ function _resetSearchDbInit() {
34
34
  }
35
35
  function sanitizeFts5Query(query) {
36
36
  const cleaned = query.replace(/[*^"(){}:]/g, "").replace(/\b(NOT|AND|OR|NEAR)\b/gi, "").trim();
37
- if (!cleaned) return "";
37
+ if (!cleaned)
38
+ return "";
38
39
  const terms = cleaned.split(/\s+/).filter((t) => t.length >= 2).map((t) => `"${t}"`).join(" ");
39
40
  return terms;
40
41
  }
41
42
  function recencyBoost(epochMs) {
42
43
  const ageMs = Date.now() - epochMs;
43
44
  const ageHours = ageMs / (1e3 * 60 * 60);
44
- if (ageHours < 1) return 1.5 - 0.2 * (ageHours / 1);
45
- if (ageHours < 24) return 1.3 - 0.2 * ((ageHours - 1) / 23);
46
- if (ageHours < 168) return 1.1 - 0.1 * ((ageHours - 24) / 144);
45
+ if (ageHours < 1)
46
+ return 1.5 - 0.2 * (ageHours / 1);
47
+ if (ageHours < 24)
48
+ return 1.3 - 0.2 * ((ageHours - 1) / 23);
49
+ if (ageHours < 168)
50
+ return 1.1 - 0.1 * ((ageHours - 24) / 144);
47
51
  return 1;
48
52
  }
49
53
  function recencyBoostIso(isoDate) {
@@ -201,7 +205,8 @@ var BM25Corpus = class {
201
205
  let score = 0;
202
206
  for (const term of queryTerms) {
203
207
  const tf = doc.tf.get(term) ?? 0;
204
- if (tf === 0) continue;
208
+ if (tf === 0)
209
+ continue;
205
210
  const idf = this.idf(term);
206
211
  const numerator = tf * (BM25_K1 + 1);
207
212
  const denominator = tf + BM25_K1 * (1 - BM25_B + BM25_B * (doc.length / (this.avgDl || 1)));
@@ -211,18 +216,21 @@ var BM25Corpus = class {
211
216
  }
212
217
  query(queryText) {
213
218
  const queryTerms = tokenize(queryText);
214
- if (queryTerms.length === 0) return [];
219
+ if (queryTerms.length === 0)
220
+ return [];
215
221
  const results = [];
216
222
  for (const doc of this.documents) {
217
223
  const score = this.scoreDocument(doc, queryTerms);
218
- if (score > 0) results.push({ payload: doc.payload, score });
224
+ if (score > 0)
225
+ results.push({ payload: doc.payload, score });
219
226
  }
220
227
  results.sort((a, b) => b.score - a.score);
221
228
  return results;
222
229
  }
223
230
  };
224
231
  function searchSessions(query, project) {
225
- if (!query || query.trim().length === 0) return [];
232
+ if (!query || query.trim().length === 0)
233
+ return [];
226
234
  try {
227
235
  return searchSessionsFts5(query, project);
228
236
  } catch (err) {
@@ -233,7 +241,8 @@ function searchSessions(query, project) {
233
241
  }
234
242
  function searchSessionsFts5(query, project) {
235
243
  const ftsQuery = sanitizeFts5Query(query);
236
- if (!ftsQuery) return [];
244
+ if (!ftsQuery)
245
+ return [];
237
246
  const db = getAgentDb();
238
247
  const sql = project ? `SELECT t.session_id, t.turn_number, t.content, f.rank,
239
248
  s.title, s.project, s.created_at, s.updated_at,
@@ -318,20 +327,23 @@ function searchSessionsBm25(query, project) {
318
327
  return boosted.map((s) => s.meta);
319
328
  }
320
329
  function searchMemory(query) {
321
- if (!query || query.trim().length === 0) return [];
330
+ if (!query || query.trim().length === 0)
331
+ return [];
322
332
  const scopes = listMemoryScopes();
323
333
  const corpus = new BM25Corpus();
324
334
  for (const scope of scopes) {
325
335
  try {
326
336
  const content = getMemory(scope);
327
- if (!content) continue;
337
+ if (!content)
338
+ continue;
328
339
  corpus.addDocument({ scope, content }, content);
329
340
  } catch {
330
341
  }
331
342
  }
332
343
  corpus.finalize();
333
344
  const results = corpus.query(query);
334
- if (results.length === 0) return [];
345
+ if (results.length === 0)
346
+ return [];
335
347
  const maxScore = results[0].score;
336
348
  return results.map((r) => ({
337
349
  scope: r.payload.scope,
@@ -346,4 +358,4 @@ export {
346
358
  searchSessions,
347
359
  searchMemory
348
360
  };
349
- //# sourceMappingURL=chunk-PJEYJQ2C.js.map
361
+ //# sourceMappingURL=chunk-3AYSJ7WB.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getChitraguptaHome
3
- } from "./chunk-UZ6OIVEC.js";
3
+ } from "./chunk-2OBLQJYJ.js";
4
4
 
5
- // ../chitragupta/packages/smriti/src/db/database.ts
5
+ // ../chitragupta/packages/smriti/dist/db/database.js
6
6
  import Database from "better-sqlite3";
7
7
  import fs from "fs";
8
8
  import path from "path";
@@ -120,4 +120,4 @@ var DatabaseManager = class _DatabaseManager {
120
120
  export {
121
121
  DatabaseManager
122
122
  };
123
- //# sourceMappingURL=chunk-U62ABYKD.js.map
123
+ //# sourceMappingURL=chunk-67DXWEKG.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  MemoryError,
3
3
  getChitraguptaHome
4
- } from "./chunk-UZ6OIVEC.js";
4
+ } from "./chunk-2OBLQJYJ.js";
5
5
 
6
- // ../chitragupta/packages/smriti/src/memory-store.ts
6
+ // ../chitragupta/packages/smriti/dist/memory-store.js
7
7
  import fs from "fs";
8
8
  import path from "path";
9
9
  import crypto from "crypto";
@@ -46,28 +46,27 @@ function scopeKey(scope) {
46
46
  }
47
47
  function getMemory(scope) {
48
48
  if (scope.type === "session") {
49
- throw new MemoryError(
50
- "Session memory is stored within the session file. Use loadSession() to access it."
51
- );
49
+ throw new MemoryError("Session memory is stored within the session file. Use loadSession() to access it.");
52
50
  }
53
51
  const filePath = resolveMemoryPath(scope);
54
- if (!filePath) return "";
52
+ if (!filePath)
53
+ return "";
55
54
  try {
56
55
  return fs.readFileSync(filePath, "utf-8");
57
56
  } catch (err) {
58
57
  const isNotFound = err.code === "ENOENT" || err instanceof Error && err.message.includes("ENOENT");
59
- if (isNotFound) return "";
58
+ if (isNotFound)
59
+ return "";
60
60
  throw new MemoryError(`Failed to read memory at ${filePath}: ${err}`);
61
61
  }
62
62
  }
63
63
  function updateMemory(scope, content) {
64
64
  if (scope.type === "session") {
65
- throw new MemoryError(
66
- "Session memory is stored within the session file. Use saveSession() to update it."
67
- );
65
+ throw new MemoryError("Session memory is stored within the session file. Use saveSession() to update it.");
68
66
  }
69
67
  const filePath = resolveMemoryPath(scope);
70
- if (!filePath) return Promise.resolve();
68
+ if (!filePath)
69
+ return Promise.resolve();
71
70
  const key = scopeKey(scope);
72
71
  const prev = memoryWriteQueues.get(key) ?? Promise.resolve();
73
72
  const next = prev.then(() => {
@@ -87,12 +86,11 @@ function updateMemory(scope, content) {
87
86
  }
88
87
  function appendMemory(scope, entry) {
89
88
  if (scope.type === "session") {
90
- throw new MemoryError(
91
- "Session memory is stored within the session file. Use addTurn() to append."
92
- );
89
+ throw new MemoryError("Session memory is stored within the session file. Use addTurn() to append.");
93
90
  }
94
91
  const filePath = resolveMemoryPath(scope);
95
- if (!filePath) return Promise.resolve();
92
+ if (!filePath)
93
+ return Promise.resolve();
96
94
  const key = scopeKey(scope);
97
95
  const prev = memoryWriteQueues.get(key) ?? Promise.resolve();
98
96
  const next = prev.then(() => {
@@ -111,7 +109,8 @@ ${entry}
111
109
  existing = fs.readFileSync(filePath, "utf-8");
112
110
  } catch (readErr) {
113
111
  const isNotFound = readErr.code === "ENOENT" || readErr instanceof Error && readErr.message.includes("ENOENT");
114
- if (!isNotFound) throw readErr;
112
+ if (!isNotFound)
113
+ throw readErr;
115
114
  }
116
115
  if (existing !== null) {
117
116
  const totalSize = Buffer.byteLength(existing, "utf-8") + Buffer.byteLength(formatted, "utf-8");
@@ -126,7 +125,8 @@ ${entry}
126
125
  fs.writeFileSync(filePath, header + formatted, "utf-8");
127
126
  }
128
127
  } catch (err) {
129
- if (err instanceof MemoryError) throw err;
128
+ if (err instanceof MemoryError)
129
+ throw err;
130
130
  throw new MemoryError(`Failed to append memory at ${filePath}: ${err}`);
131
131
  }
132
132
  }).finally(() => {
@@ -146,7 +146,8 @@ function truncateToFit(existing, incoming) {
146
146
  let size = Buffer.byteLength(header, "utf-8");
147
147
  for (let i = segments.length - 1; i >= 1; i--) {
148
148
  const segSize = Buffer.byteLength(ENTRY_SEPARATOR + segments[i], "utf-8");
149
- if (size + segSize > budget) break;
149
+ if (size + segSize > budget)
150
+ break;
150
151
  size += segSize;
151
152
  kept.unshift(segments[i]);
152
153
  }
@@ -155,18 +156,18 @@ function truncateToFit(existing, incoming) {
155
156
  }
156
157
  function deleteMemory(scope) {
157
158
  if (scope.type === "session") {
158
- throw new MemoryError(
159
- "Session memory is stored within the session file. Use deleteSession() to remove."
160
- );
159
+ throw new MemoryError("Session memory is stored within the session file. Use deleteSession() to remove.");
161
160
  }
162
161
  const filePath = resolveMemoryPath(scope);
163
- if (!filePath) return;
162
+ if (!filePath)
163
+ return;
164
164
  try {
165
165
  try {
166
166
  fs.unlinkSync(filePath);
167
167
  } catch (unlinkErr) {
168
168
  const isNotFound = unlinkErr.code === "ENOENT" || unlinkErr instanceof Error && unlinkErr.message.includes("ENOENT");
169
- if (!isNotFound) throw unlinkErr;
169
+ if (!isNotFound)
170
+ throw unlinkErr;
170
171
  }
171
172
  const dir = path.dirname(filePath);
172
173
  try {
@@ -243,4 +244,4 @@ export {
243
244
  deleteMemory,
244
245
  listMemoryScopes
245
246
  };
246
- //# sourceMappingURL=chunk-6556EKOB.js.map
247
+ //# sourceMappingURL=chunk-7AYYXHYZ.js.map
@@ -1,4 +1,4 @@
1
- // ../chitragupta/packages/smriti/src/hierarchical-temporal-search.ts
1
+ // ../chitragupta/packages/smriti/dist/hierarchical-temporal-search.js
2
2
  var DEPTH_BOOST = {
3
3
  yearly: 0.6,
4
4
  monthly: 0.8,
@@ -7,7 +7,7 @@ var DEPTH_BOOST = {
7
7
  async function hierarchicalTemporalSearch(query, options) {
8
8
  const limit = options?.limit ?? 10;
9
9
  const results = [];
10
- const { searchConsolidationSummaries } = await import("./consolidation-indexer-CD6DS2HO.js");
10
+ const { searchConsolidationSummaries } = await import("./consolidation-indexer-VIWOP6VO.js");
11
11
  const yearlyHits = await searchConsolidationSummaries(query, "yearly", {
12
12
  limit: 3,
13
13
  project: options?.project
@@ -22,7 +22,8 @@ async function hierarchicalTemporalSearch(query, options) {
22
22
  limit,
23
23
  project: options?.project
24
24
  });
25
- if (dailyHits.length === 0) return [];
25
+ if (dailyHits.length === 0)
26
+ return [];
26
27
  for (const hit of dailyHits) {
27
28
  results.push({
28
29
  score: hit.score * DEPTH_BOOST.daily,
@@ -110,7 +111,8 @@ function deduplicateAndSort(results, limit) {
110
111
  results.sort((a, b) => b.score - a.score);
111
112
  for (const r of results) {
112
113
  const key = `${r.level}:${r.period}`;
113
- if (seen.has(key)) continue;
114
+ if (seen.has(key))
115
+ continue;
114
116
  seen.add(key);
115
117
  unique.push(r);
116
118
  }
@@ -120,4 +122,4 @@ function deduplicateAndSort(results, limit) {
120
122
  export {
121
123
  hierarchicalTemporalSearch
122
124
  };
123
- //# sourceMappingURL=chunk-IGBRBFXX.js.map
125
+ //# sourceMappingURL=chunk-7XV5ISV7.js.map
@@ -1,4 +1,4 @@
1
- // ../chitragupta/packages/smriti/src/graphrag-scoring.ts
1
+ // ../chitragupta/packages/smriti/dist/graphrag-scoring.js
2
2
  var ALPHA = 0.6;
3
3
  var BETA = 0.25;
4
4
  var GAMMA = 0.15;
@@ -39,7 +39,8 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
39
39
  "no"
40
40
  ]);
41
41
  function cosineSimilarity(a, b) {
42
- if (a.length !== b.length) return 0;
42
+ if (a.length !== b.length)
43
+ return 0;
43
44
  let dotProduct = 0;
44
45
  let normA = 0;
45
46
  let normB = 0;
@@ -49,7 +50,8 @@ function cosineSimilarity(a, b) {
49
50
  normB += b[i] * b[i];
50
51
  }
51
52
  const denominator = Math.sqrt(normA) * Math.sqrt(normB);
52
- if (denominator === 0) return 0;
53
+ if (denominator === 0)
54
+ return 0;
53
55
  return dotProduct / denominator;
54
56
  }
55
57
  function estimateTokens(text) {
@@ -61,7 +63,8 @@ function tokenize(text) {
61
63
  function textMatchScore(query, docText) {
62
64
  const queryTokens = tokenize(query);
63
65
  const docTokens = tokenize(docText);
64
- if (queryTokens.length === 0 || docTokens.length === 0) return 0;
66
+ if (queryTokens.length === 0 || docTokens.length === 0)
67
+ return 0;
65
68
  const docTf = /* @__PURE__ */ new Map();
66
69
  for (const token of docTokens) {
67
70
  docTf.set(token, (docTf.get(token) ?? 0) + 1);
@@ -81,7 +84,7 @@ function textMatchScore(query, docText) {
81
84
  return Math.min(score, 1);
82
85
  }
83
86
 
84
- // ../chitragupta/packages/smriti/src/embedding-service.ts
87
+ // ../chitragupta/packages/smriti/dist/embedding-service.js
85
88
  var FALLBACK_DIM = 384;
86
89
  var DEFAULT_MAX_CACHE = 5e3;
87
90
  var MAX_CACHE_CEILING = 2e4;
@@ -155,7 +158,8 @@ var EmbeddingService = class {
155
158
  async getEmbedding(text) {
156
159
  const cacheKey = fnv1aHash(text);
157
160
  const cached = this.cache.get(cacheKey);
158
- if (cached) return cached;
161
+ if (cached)
162
+ return cached;
159
163
  let vector;
160
164
  if (this.provider) {
161
165
  if (this.providerAvailable === null) {
@@ -205,4 +209,4 @@ export {
205
209
  fallbackEmbedding,
206
210
  EmbeddingService
207
211
  };
208
- //# sourceMappingURL=chunk-JAWZ7ANC.js.map
212
+ //# sourceMappingURL=chunk-A3HOZBC5.js.map