@mastra/pg 0.13.2-alpha.0 → 0.13.2-alpha.1
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +33 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +33 -14
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +1 -1
- package/dist/storage/domains/scores/index.d.ts +1 -1
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/traces/index.d.ts +1 -1
- package/dist/storage/domains/workflows/index.d.ts +1 -1
- package/dist/vector/index.d.ts +2 -2
- package/dist/vector/performance.helpers.d.ts +1 -1
- package/dist/vector/sql-builder.d.ts +1 -1
- package/package.json +5 -4
- package/src/storage/domains/scores/index.ts +35 -16
- package/src/storage/domains/traces/index.ts +5 -5
- package/tsup.config.ts +2 -7
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/pg
|
|
2
2
|
|
|
3
|
+
## 0.13.2-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2871020: update safelyParseJSON to check for value of param when handling parse
|
|
8
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
9
|
+
- Updated dependencies [cb36de0]
|
|
10
|
+
- Updated dependencies [a82b851]
|
|
11
|
+
- Updated dependencies [41a0a0e]
|
|
12
|
+
- Updated dependencies [2871020]
|
|
13
|
+
- Updated dependencies [4a406ec]
|
|
14
|
+
- Updated dependencies [5d377e5]
|
|
15
|
+
- @mastra/core@0.13.0-alpha.2
|
|
16
|
+
|
|
3
17
|
## 0.13.2-alpha.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2296,17 +2296,17 @@ var StoreOperationsPG = class extends storage.StoreOperations {
|
|
|
2296
2296
|
}
|
|
2297
2297
|
};
|
|
2298
2298
|
function transformScoreRow(row) {
|
|
2299
|
-
let input = void 0;
|
|
2300
|
-
if (row.input) {
|
|
2301
|
-
try {
|
|
2302
|
-
input = JSON.parse(row.input);
|
|
2303
|
-
} catch {
|
|
2304
|
-
input = row.input;
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
2299
|
return {
|
|
2308
2300
|
...row,
|
|
2309
|
-
input,
|
|
2301
|
+
input: storage.safelyParseJSON(row.input),
|
|
2302
|
+
scorer: storage.safelyParseJSON(row.scorer),
|
|
2303
|
+
preprocessStepResult: storage.safelyParseJSON(row.preprocessStepResult),
|
|
2304
|
+
analyzeStepResult: storage.safelyParseJSON(row.analyzeStepResult),
|
|
2305
|
+
metadata: storage.safelyParseJSON(row.metadata),
|
|
2306
|
+
output: storage.safelyParseJSON(row.output),
|
|
2307
|
+
additionalContext: storage.safelyParseJSON(row.additionalContext),
|
|
2308
|
+
runtimeContext: storage.safelyParseJSON(row.runtimeContext),
|
|
2309
|
+
entity: storage.safelyParseJSON(row.entity),
|
|
2310
2310
|
createdAt: row.createdAtZ || row.createdAt,
|
|
2311
2311
|
updatedAt: row.updatedAtZ || row.updatedAt
|
|
2312
2312
|
};
|
|
@@ -2374,7 +2374,7 @@ var ScoresPG = class extends storage.ScoresStorage {
|
|
|
2374
2374
|
perPage: pagination.perPage,
|
|
2375
2375
|
hasMore: Number(total?.count) > (pagination.page + 1) * pagination.perPage
|
|
2376
2376
|
},
|
|
2377
|
-
scores: result
|
|
2377
|
+
scores: result.map(transformScoreRow)
|
|
2378
2378
|
};
|
|
2379
2379
|
} catch (error$1) {
|
|
2380
2380
|
throw new error.MastraError(
|
|
@@ -2390,13 +2390,32 @@ var ScoresPG = class extends storage.ScoresStorage {
|
|
|
2390
2390
|
async saveScore(score) {
|
|
2391
2391
|
try {
|
|
2392
2392
|
const scoreId = crypto.randomUUID();
|
|
2393
|
-
const {
|
|
2393
|
+
const {
|
|
2394
|
+
scorer,
|
|
2395
|
+
preprocessStepResult,
|
|
2396
|
+
analyzeStepResult,
|
|
2397
|
+
metadata,
|
|
2398
|
+
input,
|
|
2399
|
+
output,
|
|
2400
|
+
additionalContext,
|
|
2401
|
+
runtimeContext,
|
|
2402
|
+
entity,
|
|
2403
|
+
...rest
|
|
2404
|
+
} = score;
|
|
2394
2405
|
await this.operations.insert({
|
|
2395
2406
|
tableName: storage.TABLE_SCORERS,
|
|
2396
2407
|
record: {
|
|
2397
2408
|
id: scoreId,
|
|
2398
2409
|
...rest,
|
|
2399
|
-
input: JSON.stringify(input),
|
|
2410
|
+
input: JSON.stringify(input) || "",
|
|
2411
|
+
output: JSON.stringify(output) || "",
|
|
2412
|
+
scorer: scorer ? JSON.stringify(scorer) : null,
|
|
2413
|
+
preprocessStepResult: preprocessStepResult ? JSON.stringify(preprocessStepResult) : null,
|
|
2414
|
+
analyzeStepResult: analyzeStepResult ? JSON.stringify(analyzeStepResult) : null,
|
|
2415
|
+
metadata: metadata ? JSON.stringify(metadata) : null,
|
|
2416
|
+
additionalContext: additionalContext ? JSON.stringify(additionalContext) : null,
|
|
2417
|
+
runtimeContext: runtimeContext ? JSON.stringify(runtimeContext) : null,
|
|
2418
|
+
entity: entity ? JSON.stringify(entity) : null,
|
|
2400
2419
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2401
2420
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2402
2421
|
}
|
|
@@ -2445,7 +2464,7 @@ var ScoresPG = class extends storage.ScoresStorage {
|
|
|
2445
2464
|
perPage: pagination.perPage,
|
|
2446
2465
|
hasMore: Number(total?.count) > (pagination.page + 1) * pagination.perPage
|
|
2447
2466
|
},
|
|
2448
|
-
scores: result
|
|
2467
|
+
scores: result.map(transformScoreRow)
|
|
2449
2468
|
};
|
|
2450
2469
|
} catch (error$1) {
|
|
2451
2470
|
throw new error.MastraError(
|
|
@@ -2490,7 +2509,7 @@ var ScoresPG = class extends storage.ScoresStorage {
|
|
|
2490
2509
|
perPage: pagination.perPage,
|
|
2491
2510
|
hasMore: Number(total?.count) > (pagination.page + 1) * pagination.perPage
|
|
2492
2511
|
},
|
|
2493
|
-
scores: result
|
|
2512
|
+
scores: result.map(transformScoreRow)
|
|
2494
2513
|
};
|
|
2495
2514
|
} catch (error$1) {
|
|
2496
2515
|
throw new error.MastraError(
|