@mastra/upstash 1.5.5-alpha.0 → 1.5.5
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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-rag-retrieval.md +11 -0
- package/dist/docs/references/reference-vectors-upstash.md +8 -4
- package/dist/index.cjs +13 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -25
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { saveScorePayloadSchema } from "@mastra/core/evals";
|
|
|
7
7
|
import { MastraVector } from "@mastra/core/vector";
|
|
8
8
|
import { Index } from "@upstash/vector";
|
|
9
9
|
import { BaseFilterTranslator } from "@mastra/core/vector/filter";
|
|
10
|
-
|
|
10
|
+
// src/cache/index.ts
|
|
11
11
|
/**
|
|
12
12
|
* Upstash Redis implementation of MastraServerCache.
|
|
13
13
|
*
|
|
@@ -49,8 +49,7 @@ var UpstashServerCache = class extends RedisServerCache$1 {
|
|
|
49
49
|
super({ client }, redisOptions);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
//#region src/storage/domains/utils.ts
|
|
52
|
+
// src/storage/domains/utils.ts
|
|
54
53
|
function getKey(tableName, keys) {
|
|
55
54
|
return `${tableName}:${Object.entries(keys).filter(([_, value]) => value !== void 0).map(([key, value]) => `${key}:${value}`).join(":")}`;
|
|
56
55
|
}
|
|
@@ -78,8 +77,7 @@ function processRecord(tableName, record) {
|
|
|
78
77
|
processedRecord
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
//#region src/storage/db/index.ts
|
|
80
|
+
// src/storage/db/index.ts
|
|
83
81
|
/**
|
|
84
82
|
* Resolves UpstashDomainConfig to a Redis client.
|
|
85
83
|
* Handles creating a new Redis client if url/token are provided.
|
|
@@ -165,8 +163,7 @@ var UpstashDB = class {
|
|
|
165
163
|
}
|
|
166
164
|
}
|
|
167
165
|
};
|
|
168
|
-
|
|
169
|
-
//#region src/storage/domains/background-tasks/index.ts
|
|
166
|
+
// src/storage/domains/background-tasks/index.ts
|
|
170
167
|
function toStorageRecord(task) {
|
|
171
168
|
return {
|
|
172
169
|
id: task.id,
|
|
@@ -350,8 +347,7 @@ var BackgroundTasksUpstash = class extends BackgroundTasksStorage {
|
|
|
350
347
|
return total;
|
|
351
348
|
}
|
|
352
349
|
};
|
|
353
|
-
|
|
354
|
-
//#region src/storage/domains/run-fencing.ts
|
|
350
|
+
// src/storage/domains/run-fencing.ts
|
|
355
351
|
function runClaimKey(claims, runId) {
|
|
356
352
|
return `${claims}:run_id:${runId}`;
|
|
357
353
|
}
|
|
@@ -583,8 +579,7 @@ function writeBatch(client, check) {
|
|
|
583
579
|
async function assertRunFence(client, check) {
|
|
584
580
|
if (check) await new FencedWriteBatch(client, check).exec();
|
|
585
581
|
}
|
|
586
|
-
|
|
587
|
-
//#region src/storage/domains/memory/index.ts
|
|
582
|
+
// src/storage/domains/memory/index.ts
|
|
588
583
|
function getThreadMessagesKey(threadId) {
|
|
589
584
|
return `thread:${threadId}:messages`;
|
|
590
585
|
}
|
|
@@ -1492,7 +1487,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
1492
1487
|
const aValue = new Date(a[field]).getTime();
|
|
1493
1488
|
const bValue = new Date(b[field]).getTime();
|
|
1494
1489
|
if (direction === "ASC") return aValue - bValue;
|
|
1495
|
-
|
|
1490
|
+
return bValue - aValue;
|
|
1496
1491
|
});
|
|
1497
1492
|
}
|
|
1498
1493
|
async cloneThread(args) {
|
|
@@ -1597,8 +1592,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
1597
1592
|
}
|
|
1598
1593
|
}
|
|
1599
1594
|
};
|
|
1600
|
-
|
|
1601
|
-
//#region src/storage/domains/scores/index.ts
|
|
1595
|
+
// src/storage/domains/scores/index.ts
|
|
1602
1596
|
/**
|
|
1603
1597
|
* Upstash-specific score row transformation.
|
|
1604
1598
|
* Uses default options (no timestamp conversion).
|
|
@@ -1877,8 +1871,7 @@ var ScoresUpstash = class extends ScoresStorage {
|
|
|
1877
1871
|
};
|
|
1878
1872
|
}
|
|
1879
1873
|
};
|
|
1880
|
-
|
|
1881
|
-
//#region src/storage/domains/workflows/index.ts
|
|
1874
|
+
// src/storage/domains/workflows/index.ts
|
|
1882
1875
|
var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
1883
1876
|
client;
|
|
1884
1877
|
#db;
|
|
@@ -2369,8 +2362,7 @@ var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
|
2369
2362
|
}
|
|
2370
2363
|
}
|
|
2371
2364
|
};
|
|
2372
|
-
|
|
2373
|
-
//#region src/storage/index.ts
|
|
2365
|
+
// src/storage/index.ts
|
|
2374
2366
|
/**
|
|
2375
2367
|
* Type guard for pre-configured client config
|
|
2376
2368
|
*/
|
|
@@ -2426,8 +2418,7 @@ var UpstashStore = class extends MastraCompositeStore {
|
|
|
2426
2418
|
}
|
|
2427
2419
|
async close() {}
|
|
2428
2420
|
};
|
|
2429
|
-
|
|
2430
|
-
//#region src/vector/filter.ts
|
|
2421
|
+
// src/vector/filter.ts
|
|
2431
2422
|
var UpstashFilterTranslator = class extends BaseFilterTranslator {
|
|
2432
2423
|
getSupportedOperators() {
|
|
2433
2424
|
return {
|
|
@@ -2573,8 +2564,7 @@ var UpstashFilterTranslator = class extends BaseFilterTranslator {
|
|
|
2573
2564
|
return `(${(Array.isArray(conditions) ? conditions.map((c) => this.translateNode(c)) : [this.translateNode(conditions)]).join(` ${operator} `)})`;
|
|
2574
2565
|
}
|
|
2575
2566
|
};
|
|
2576
|
-
|
|
2577
|
-
//#region src/vector/index.ts
|
|
2567
|
+
// src/vector/index.ts
|
|
2578
2568
|
var UpstashVector = class extends MastraVector {
|
|
2579
2569
|
client;
|
|
2580
2570
|
/**
|
|
@@ -2930,8 +2920,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2930
2920
|
}
|
|
2931
2921
|
}
|
|
2932
2922
|
};
|
|
2933
|
-
|
|
2934
|
-
//#region src/vector/prompt.ts
|
|
2923
|
+
// src/vector/prompt.ts
|
|
2935
2924
|
/**
|
|
2936
2925
|
* Vector store specific prompt that details supported operators and examples.
|
|
2937
2926
|
* This prompt helps users construct valid filters for Upstash Vector.
|
|
@@ -3009,7 +2998,6 @@ Example Complex Query:
|
|
|
3009
2998
|
]}
|
|
3010
2999
|
]
|
|
3011
3000
|
}`;
|
|
3012
|
-
//#endregion
|
|
3013
3001
|
export { BackgroundTasksUpstash, RedisServerCache, ScoresUpstash, StoreMemoryUpstash, UPSTASH_PROMPT, UpstashServerCache, UpstashStore, UpstashVector, WorkflowsUpstash, upstashPreset };
|
|
3014
3002
|
|
|
3015
3003
|
//# sourceMappingURL=index.js.map
|