@mastra/mssql 0.3.0-alpha.0 → 0.3.0
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 +53 -0
- package/dist/index.cjs +28 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -23
- 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/package.json +7 -6
- package/src/storage/domains/scores/index.ts +29 -28
- package/tsup.config.ts +2 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './storage';
|
|
1
|
+
export * from './storage/index.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1381,28 +1381,17 @@ function parseJSON(jsonString) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
function transformScoreRow(row) {
|
|
1384
|
-
let input = void 0;
|
|
1385
|
-
let output = void 0;
|
|
1386
|
-
let preprocessStepResult = void 0;
|
|
1387
|
-
let analyzeStepResult = void 0;
|
|
1388
|
-
if (row.input) {
|
|
1389
|
-
input = parseJSON(row.input);
|
|
1390
|
-
}
|
|
1391
|
-
if (row.output) {
|
|
1392
|
-
output = parseJSON(row.output);
|
|
1393
|
-
}
|
|
1394
|
-
if (row.preprocessStepResult) {
|
|
1395
|
-
preprocessStepResult = parseJSON(row.preprocessStepResult);
|
|
1396
|
-
}
|
|
1397
|
-
if (row.analyzeStepResult) {
|
|
1398
|
-
analyzeStepResult = parseJSON(row.analyzeStepResult);
|
|
1399
|
-
}
|
|
1400
1384
|
return {
|
|
1401
1385
|
...row,
|
|
1402
|
-
input,
|
|
1403
|
-
|
|
1404
|
-
preprocessStepResult,
|
|
1405
|
-
analyzeStepResult,
|
|
1386
|
+
input: parseJSON(row.input),
|
|
1387
|
+
scorer: parseJSON(row.scorer),
|
|
1388
|
+
preprocessStepResult: parseJSON(row.preprocessStepResult),
|
|
1389
|
+
analyzeStepResult: parseJSON(row.analyzeStepResult),
|
|
1390
|
+
metadata: parseJSON(row.metadata),
|
|
1391
|
+
output: parseJSON(row.output),
|
|
1392
|
+
additionalContext: parseJSON(row.additionalContext),
|
|
1393
|
+
runtimeContext: parseJSON(row.runtimeContext),
|
|
1394
|
+
entity: parseJSON(row.entity),
|
|
1406
1395
|
createdAt: row.createdAt,
|
|
1407
1396
|
updatedAt: row.updatedAt
|
|
1408
1397
|
};
|
|
@@ -1447,16 +1436,32 @@ var ScoresMSSQL = class extends ScoresStorage {
|
|
|
1447
1436
|
async saveScore(score) {
|
|
1448
1437
|
try {
|
|
1449
1438
|
const scoreId = crypto.randomUUID();
|
|
1450
|
-
const {
|
|
1439
|
+
const {
|
|
1440
|
+
scorer,
|
|
1441
|
+
preprocessStepResult,
|
|
1442
|
+
analyzeStepResult,
|
|
1443
|
+
metadata,
|
|
1444
|
+
input,
|
|
1445
|
+
output,
|
|
1446
|
+
additionalContext,
|
|
1447
|
+
runtimeContext,
|
|
1448
|
+
entity,
|
|
1449
|
+
...rest
|
|
1450
|
+
} = score;
|
|
1451
1451
|
await this.operations.insert({
|
|
1452
1452
|
tableName: TABLE_SCORERS,
|
|
1453
1453
|
record: {
|
|
1454
1454
|
id: scoreId,
|
|
1455
1455
|
...rest,
|
|
1456
|
-
input: JSON.stringify(input),
|
|
1457
|
-
output: JSON.stringify(output),
|
|
1456
|
+
input: JSON.stringify(input) || "",
|
|
1457
|
+
output: JSON.stringify(output) || "",
|
|
1458
1458
|
preprocessStepResult: preprocessStepResult ? JSON.stringify(preprocessStepResult) : null,
|
|
1459
1459
|
analyzeStepResult: analyzeStepResult ? JSON.stringify(analyzeStepResult) : null,
|
|
1460
|
+
metadata: metadata ? JSON.stringify(metadata) : null,
|
|
1461
|
+
additionalContext: additionalContext ? JSON.stringify(additionalContext) : null,
|
|
1462
|
+
runtimeContext: runtimeContext ? JSON.stringify(runtimeContext) : null,
|
|
1463
|
+
entity: entity ? JSON.stringify(entity) : null,
|
|
1464
|
+
scorer: scorer ? JSON.stringify(scorer) : null,
|
|
1460
1465
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1461
1466
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1462
1467
|
}
|