@mastra/mssql 0.0.0-rag-chunk-extract-llm-option-20250926183645 → 0.0.0-roamin-openaivoice-speak-options-passing-20250926163614
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/CHANGELOG.md +3 -7
- package/dist/index.cjs +2 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -78
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +0 -8
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +0 -9
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { MastraStorage, LegacyEvalsStorage, StoreOperations, TABLE_WORKFLOW_SNAP
|
|
|
3
3
|
import sql2 from 'mssql';
|
|
4
4
|
import { parseSqlIdentifier, parseFieldKey } from '@mastra/core/utils';
|
|
5
5
|
import { MessageList } from '@mastra/core/agent';
|
|
6
|
-
import { saveScorePayloadSchema } from '@mastra/core/scores';
|
|
7
6
|
|
|
8
7
|
// src/storage/index.ts
|
|
9
8
|
function getSchemaName(schema) {
|
|
@@ -1474,19 +1473,6 @@ var ScoresMSSQL = class extends ScoresStorage {
|
|
|
1474
1473
|
}
|
|
1475
1474
|
}
|
|
1476
1475
|
async saveScore(score) {
|
|
1477
|
-
let validatedScore;
|
|
1478
|
-
try {
|
|
1479
|
-
validatedScore = saveScorePayloadSchema.parse(score);
|
|
1480
|
-
} catch (error) {
|
|
1481
|
-
throw new MastraError(
|
|
1482
|
-
{
|
|
1483
|
-
id: "MASTRA_STORAGE_MSSQL_STORE_SAVE_SCORE_VALIDATION_FAILED",
|
|
1484
|
-
domain: ErrorDomain.STORAGE,
|
|
1485
|
-
category: ErrorCategory.THIRD_PARTY
|
|
1486
|
-
},
|
|
1487
|
-
error
|
|
1488
|
-
);
|
|
1489
|
-
}
|
|
1490
1476
|
try {
|
|
1491
1477
|
const scoreId = crypto.randomUUID();
|
|
1492
1478
|
const {
|
|
@@ -1500,7 +1486,7 @@ var ScoresMSSQL = class extends ScoresStorage {
|
|
|
1500
1486
|
runtimeContext,
|
|
1501
1487
|
entity,
|
|
1502
1488
|
...rest
|
|
1503
|
-
} =
|
|
1489
|
+
} = score;
|
|
1504
1490
|
await this.operations.insert({
|
|
1505
1491
|
tableName: TABLE_SCORERS,
|
|
1506
1492
|
record: {
|
|
@@ -1685,60 +1671,6 @@ var ScoresMSSQL = class extends ScoresStorage {
|
|
|
1685
1671
|
);
|
|
1686
1672
|
}
|
|
1687
1673
|
}
|
|
1688
|
-
async getScoresBySpan({
|
|
1689
|
-
traceId,
|
|
1690
|
-
spanId,
|
|
1691
|
-
pagination
|
|
1692
|
-
}) {
|
|
1693
|
-
try {
|
|
1694
|
-
const request = this.pool.request();
|
|
1695
|
-
request.input("p1", traceId);
|
|
1696
|
-
request.input("p2", spanId);
|
|
1697
|
-
const totalResult = await request.query(
|
|
1698
|
-
`SELECT COUNT(*) as count FROM ${getTableName({ indexName: TABLE_SCORERS, schemaName: getSchemaName(this.schema) })} WHERE [traceId] = @p1 AND [spanId] = @p2`
|
|
1699
|
-
);
|
|
1700
|
-
const total = totalResult.recordset[0]?.count || 0;
|
|
1701
|
-
if (total === 0) {
|
|
1702
|
-
return {
|
|
1703
|
-
pagination: {
|
|
1704
|
-
total: 0,
|
|
1705
|
-
page: pagination.page,
|
|
1706
|
-
perPage: pagination.perPage,
|
|
1707
|
-
hasMore: false
|
|
1708
|
-
},
|
|
1709
|
-
scores: []
|
|
1710
|
-
};
|
|
1711
|
-
}
|
|
1712
|
-
const limit = pagination.perPage + 1;
|
|
1713
|
-
const dataRequest = this.pool.request();
|
|
1714
|
-
dataRequest.input("p1", traceId);
|
|
1715
|
-
dataRequest.input("p2", spanId);
|
|
1716
|
-
dataRequest.input("p3", limit);
|
|
1717
|
-
dataRequest.input("p4", pagination.page * pagination.perPage);
|
|
1718
|
-
const result = await dataRequest.query(
|
|
1719
|
-
`SELECT * FROM ${getTableName({ indexName: TABLE_SCORERS, schemaName: getSchemaName(this.schema) })} WHERE [traceId] = @p1 AND [spanId] = @p2 ORDER BY [createdAt] DESC OFFSET @p4 ROWS FETCH NEXT @p3 ROWS ONLY`
|
|
1720
|
-
);
|
|
1721
|
-
return {
|
|
1722
|
-
pagination: {
|
|
1723
|
-
total: Number(total),
|
|
1724
|
-
page: pagination.page,
|
|
1725
|
-
perPage: pagination.perPage,
|
|
1726
|
-
hasMore: result.recordset.length > pagination.perPage
|
|
1727
|
-
},
|
|
1728
|
-
scores: result.recordset.slice(0, pagination.perPage).map((row) => transformScoreRow(row))
|
|
1729
|
-
};
|
|
1730
|
-
} catch (error) {
|
|
1731
|
-
throw new MastraError(
|
|
1732
|
-
{
|
|
1733
|
-
id: "MASTRA_STORAGE_MSSQL_STORE_GET_SCORES_BY_SPAN_FAILED",
|
|
1734
|
-
domain: ErrorDomain.STORAGE,
|
|
1735
|
-
category: ErrorCategory.THIRD_PARTY,
|
|
1736
|
-
details: { traceId, spanId }
|
|
1737
|
-
},
|
|
1738
|
-
error
|
|
1739
|
-
);
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
1674
|
};
|
|
1743
1675
|
var TracesMSSQL = class extends TracesStorage {
|
|
1744
1676
|
pool;
|
|
@@ -2228,8 +2160,7 @@ var MSSQLStore = class extends MastraStorage {
|
|
|
2228
2160
|
resourceWorkingMemory: true,
|
|
2229
2161
|
hasColumn: true,
|
|
2230
2162
|
createTable: true,
|
|
2231
|
-
deleteMessages: true
|
|
2232
|
-
getScoresBySpan: true
|
|
2163
|
+
deleteMessages: true
|
|
2233
2164
|
};
|
|
2234
2165
|
}
|
|
2235
2166
|
/** @deprecated use getEvals instead */
|
|
@@ -2427,13 +2358,6 @@ var MSSQLStore = class extends MastraStorage {
|
|
|
2427
2358
|
pagination: _pagination
|
|
2428
2359
|
});
|
|
2429
2360
|
}
|
|
2430
|
-
async getScoresBySpan({
|
|
2431
|
-
traceId,
|
|
2432
|
-
spanId,
|
|
2433
|
-
pagination: _pagination
|
|
2434
|
-
}) {
|
|
2435
|
-
return this.stores.scores.getScoresBySpan({ traceId, spanId, pagination: _pagination });
|
|
2436
|
-
}
|
|
2437
2361
|
};
|
|
2438
2362
|
|
|
2439
2363
|
export { MSSQLStore };
|