@mastra/libsql 1.9.0-alpha.1 → 1.9.0-alpha.2
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 +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-core-mastra-class.md +9 -1
- package/dist/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/db/utils.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +2 -1
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.9.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added `getTraceLight` method to the observability storage, returning only lightweight span fields needed for timeline rendering. This avoids transferring heavy fields like `input`, `output`, `attributes`, and `metadata` when they are not needed. ([#15574](https://github.com/mastra-ai/mastra/pull/15574))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`20f59b8`](https://github.com/mastra-ai/mastra/commit/20f59b876cf91199efbc49a0e36b391240708f08), [`e2687a7`](https://github.com/mastra-ai/mastra/commit/e2687a7408790c384563816a9a28ed06735684c9), [`8f1b280`](https://github.com/mastra-ai/mastra/commit/8f1b280b7fe6999ec654f160cb69c1a8719e7a57), [`12df98c`](https://github.com/mastra-ai/mastra/commit/12df98c4904643d9481f5c78f3bed443725b4c96)]:
|
|
10
|
+
- @mastra/core@1.26.0-alpha.11
|
|
11
|
+
|
|
3
12
|
## 1.9.0-alpha.1
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -63,4 +63,12 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
63
63
|
|
|
64
64
|
**gateways** (`Record<string, MastraModelGateway>`): Custom model gateways to register for accessing AI models through alternative providers or private deployments. Structured as a key-value pair, with keys being the registry key (used for getGateway()) and values being gateway instances. (Default: `{}`)
|
|
65
65
|
|
|
66
|
-
**memory** (`Record<string, MastraMemory>`): Memory instances to register. These can be referenced by stored agents and resolved at runtime. Structured as a key-value pair, with keys being the registry key and values being memory instances. (Default: `{}`)
|
|
66
|
+
**memory** (`Record<string, MastraMemory>`): Memory instances to register. These can be referenced by stored agents and resolved at runtime. Structured as a key-value pair, with keys being the registry key and values being memory instances. (Default: `{}`)
|
|
67
|
+
|
|
68
|
+
**versions** (`VersionOverrides`): Global version overrides for sub-agent delegation. When a supervisor agent delegates to a sub-agent, these overrides determine which stored version of that sub-agent to use instead of the code-defined default. Requires the editor package to be configured. See \[Sub-agent versioning]\(/docs/editor/overview#sub-agent-versioning) for details.
|
|
69
|
+
|
|
70
|
+
**versions.agents** (`Record<string, VersionSelector>`): A map of agent IDs to their version selectors. Each selector can target a specific version by ID or by publication status.
|
|
71
|
+
|
|
72
|
+
**versions.agents.versionId** (`string`): The ID of a specific version to use.
|
|
73
|
+
|
|
74
|
+
**versions.agents.status** (`'draft' | 'published'`): Select the latest version with this publication status.
|
package/dist/index.cjs
CHANGED
|
@@ -1361,6 +1361,9 @@ function transformFromSqlRow({
|
|
|
1361
1361
|
const dateColumns = new Set(
|
|
1362
1362
|
Object.keys(storage.TABLE_SCHEMAS[tableName]).filter((key) => storage.TABLE_SCHEMAS[tableName][key].type === "timestamp").map((key) => key)
|
|
1363
1363
|
);
|
|
1364
|
+
const booleanColumns = new Set(
|
|
1365
|
+
Object.keys(storage.TABLE_SCHEMAS[tableName]).filter((key) => storage.TABLE_SCHEMAS[tableName][key].type === "boolean").map((key) => key)
|
|
1366
|
+
);
|
|
1364
1367
|
for (const [key, value] of Object.entries(sqlRow)) {
|
|
1365
1368
|
if (value === null || value === void 0) {
|
|
1366
1369
|
result[key] = value;
|
|
@@ -1374,6 +1377,10 @@ function transformFromSqlRow({
|
|
|
1374
1377
|
result[key] = storage.safelyParseJSON(value);
|
|
1375
1378
|
continue;
|
|
1376
1379
|
}
|
|
1380
|
+
if (booleanColumns.has(key)) {
|
|
1381
|
+
result[key] = Boolean(value);
|
|
1382
|
+
continue;
|
|
1383
|
+
}
|
|
1377
1384
|
result[key] = value;
|
|
1378
1385
|
}
|
|
1379
1386
|
return result;
|
|
@@ -7926,6 +7933,39 @@ var ObservabilityLibSQL = class extends storage.ObservabilityStorage {
|
|
|
7926
7933
|
);
|
|
7927
7934
|
}
|
|
7928
7935
|
}
|
|
7936
|
+
async getTraceLight(args) {
|
|
7937
|
+
const { traceId } = args;
|
|
7938
|
+
try {
|
|
7939
|
+
const spans = await this.#db.selectMany({
|
|
7940
|
+
tableName: storage.TABLE_SPANS,
|
|
7941
|
+
whereClause: { sql: " WHERE traceId = ?", args: [traceId] },
|
|
7942
|
+
orderBy: "startedAt ASC"
|
|
7943
|
+
});
|
|
7944
|
+
if (!spans || spans.length === 0) {
|
|
7945
|
+
return null;
|
|
7946
|
+
}
|
|
7947
|
+
return {
|
|
7948
|
+
traceId,
|
|
7949
|
+
spans: spans.map((span) => {
|
|
7950
|
+
const transformed = transformFromSqlRow({ tableName: storage.TABLE_SPANS, sqlRow: span });
|
|
7951
|
+
const { input, output, attributes, metadata, tags, links, ...light } = transformed;
|
|
7952
|
+
return light;
|
|
7953
|
+
})
|
|
7954
|
+
};
|
|
7955
|
+
} catch (error$1) {
|
|
7956
|
+
throw new error.MastraError(
|
|
7957
|
+
{
|
|
7958
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_TRACE_LIGHT", "FAILED"),
|
|
7959
|
+
domain: error.ErrorDomain.STORAGE,
|
|
7960
|
+
category: error.ErrorCategory.USER,
|
|
7961
|
+
details: {
|
|
7962
|
+
traceId
|
|
7963
|
+
}
|
|
7964
|
+
},
|
|
7965
|
+
error$1
|
|
7966
|
+
);
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7929
7969
|
async updateSpan(args) {
|
|
7930
7970
|
const { traceId, spanId, updates } = args;
|
|
7931
7971
|
try {
|