@mastra/libsql 1.6.0-alpha.0 → 1.6.1-alpha.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/CHANGELOG.md +26 -0
- package/dist/index.cjs +17 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/docs/SKILL.md +0 -50
- package/dist/docs/assets/SOURCE_MAP.json +0 -6
- package/dist/docs/references/docs-agents-agent-approval.md +0 -377
- package/dist/docs/references/docs-agents-agent-memory.md +0 -212
- package/dist/docs/references/docs-agents-network-approval.md +0 -275
- package/dist/docs/references/docs-agents-networks.md +0 -290
- package/dist/docs/references/docs-memory-memory-processors.md +0 -316
- package/dist/docs/references/docs-memory-message-history.md +0 -260
- package/dist/docs/references/docs-memory-overview.md +0 -45
- package/dist/docs/references/docs-memory-semantic-recall.md +0 -272
- package/dist/docs/references/docs-memory-storage.md +0 -261
- package/dist/docs/references/docs-memory-working-memory.md +0 -400
- package/dist/docs/references/docs-observability-overview.md +0 -70
- package/dist/docs/references/docs-observability-tracing-exporters-default.md +0 -211
- package/dist/docs/references/docs-rag-retrieval.md +0 -521
- package/dist/docs/references/docs-workflows-snapshots.md +0 -238
- package/dist/docs/references/guides-agent-frameworks-ai-sdk.md +0 -140
- package/dist/docs/references/reference-core-getMemory.md +0 -50
- package/dist/docs/references/reference-core-listMemory.md +0 -56
- package/dist/docs/references/reference-core-mastra-class.md +0 -66
- package/dist/docs/references/reference-memory-memory-class.md +0 -147
- package/dist/docs/references/reference-storage-composite.md +0 -235
- package/dist/docs/references/reference-storage-dynamodb.md +0 -282
- package/dist/docs/references/reference-storage-libsql.md +0 -135
- package/dist/docs/references/reference-vectors-libsql.md +0 -305
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.6.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed non-deterministic query ordering by adding secondary sort on id for dataset and dataset item queries. ([#13399](https://github.com/mastra-ai/mastra/pull/13399))
|
|
8
|
+
|
|
9
|
+
- Prompt blocks can now define their own variables schema (`requestContextSchema`), allowing you to create reusable prompt blocks with typed variable placeholders. The server now correctly computes and returns draft/published status for prompt blocks. Existing databases are automatically migrated when upgrading. ([#13351](https://github.com/mastra-ai/mastra/pull/13351))
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`24284ff`](https://github.com/mastra-ai/mastra/commit/24284ffae306ddf0ab83273e13f033520839ef40), [`f5097cc`](https://github.com/mastra-ai/mastra/commit/f5097cc8a813c82c3378882c31178320cadeb655), [`71e237f`](https://github.com/mastra-ai/mastra/commit/71e237fa852a3ad9a50a3ddb3b5f3b20b9a8181c), [`13a291e`](https://github.com/mastra-ai/mastra/commit/13a291ebb9f9bca80befa0d9166b916bb348e8e9), [`397af5a`](https://github.com/mastra-ai/mastra/commit/397af5a69f34d4157f51a7c8da3f1ded1e1d611c), [`d4701f7`](https://github.com/mastra-ai/mastra/commit/d4701f7e24822b081b70f9c806c39411b1a712e7), [`2b40831`](https://github.com/mastra-ai/mastra/commit/2b40831dcca2275c9570ddf09b7f25ba3e8dc7fc), [`6184727`](https://github.com/mastra-ai/mastra/commit/6184727e812bf7a65cee209bacec3a2f5a16e923), [`6f6385b`](https://github.com/mastra-ai/mastra/commit/6f6385be5b33687cd21e71fc27e972e6928bb34c), [`14aba61`](https://github.com/mastra-ai/mastra/commit/14aba61b9cff76d72bc7ef6f3a83ae2c5d059193), [`dd9dd1c`](https://github.com/mastra-ai/mastra/commit/dd9dd1c9ae32ae79093f8c4adde1732ac6357233)]:
|
|
12
|
+
- @mastra/core@1.7.0-alpha.0
|
|
13
|
+
|
|
14
|
+
## 1.6.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Added MCP server table and CRUD operations to storage adapters, enabling MCP server configurations to be persisted alongside agents and workflows. ([#13357](https://github.com/mastra-ai/mastra/pull/13357))
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Added storage schema support for processor graphs on stored agents. ([#13357](https://github.com/mastra-ai/mastra/pull/13357))
|
|
23
|
+
|
|
24
|
+
- Storage adapters now return `suggestedContinuation` and `currentTask` fields on Observational Memory activation, enabling agents to maintain conversational context across activation boundaries. ([#13357](https://github.com/mastra-ai/mastra/pull/13357))
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`0d9efb4`](https://github.com/mastra-ai/mastra/commit/0d9efb47992c34aa90581c18b9f51f774f6252a5), [`5caa13d`](https://github.com/mastra-ai/mastra/commit/5caa13d1b2a496e2565ab124a11de9a51ad3e3b9), [`940163f`](https://github.com/mastra-ai/mastra/commit/940163fc492401d7562301e6f106ccef4fefe06f), [`47892c8`](https://github.com/mastra-ai/mastra/commit/47892c85708eac348209f99f10f9a5f5267e11c0), [`45bb78b`](https://github.com/mastra-ai/mastra/commit/45bb78b70bd9db29678fe49476cd9f4ed01bfd0b), [`70eef84`](https://github.com/mastra-ai/mastra/commit/70eef84b8f44493598fdafa2980a0e7283415eda), [`d84e52d`](https://github.com/mastra-ai/mastra/commit/d84e52d0f6511283ddd21ed5fe7f945449d0f799), [`24b80af`](https://github.com/mastra-ai/mastra/commit/24b80af87da93bb84d389340181e17b7477fa9ca), [`608e156`](https://github.com/mastra-ai/mastra/commit/608e156def954c9604c5e3f6d9dfce3bcc7aeab0), [`2b2e157`](https://github.com/mastra-ai/mastra/commit/2b2e157a092cd597d9d3f0000d62b8bb4a7348ed), [`59d30b5`](https://github.com/mastra-ai/mastra/commit/59d30b5d0cb44ea7a1c440e7460dfb57eac9a9b5), [`453693b`](https://github.com/mastra-ai/mastra/commit/453693bf9e265ddccecef901d50da6caaea0fbc6), [`78d1c80`](https://github.com/mastra-ai/mastra/commit/78d1c808ad90201897a300af551bcc1d34458a20), [`c204b63`](https://github.com/mastra-ai/mastra/commit/c204b632d19e66acb6d6e19b11c4540dd6ad5380), [`742a417`](https://github.com/mastra-ai/mastra/commit/742a417896088220a3b5560c354c45c5ca6d88b9)]:
|
|
27
|
+
- @mastra/core@1.6.0
|
|
28
|
+
|
|
3
29
|
## 1.6.0-alpha.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3163,7 +3163,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3163
3163
|
const limitValue = perPageInput === false ? total : perPage;
|
|
3164
3164
|
const end = perPageInput === false ? total : start + perPage;
|
|
3165
3165
|
const result = await this.#client.execute({
|
|
3166
|
-
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASETS)} FROM ${storage.TABLE_DATASETS} ORDER BY createdAt DESC LIMIT ? OFFSET ?`,
|
|
3166
|
+
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASETS)} FROM ${storage.TABLE_DATASETS} ORDER BY createdAt DESC, id ASC LIMIT ? OFFSET ?`,
|
|
3167
3167
|
args: [limitValue, start]
|
|
3168
3168
|
});
|
|
3169
3169
|
return {
|
|
@@ -3404,7 +3404,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3404
3404
|
async getItemsByVersion({ datasetId, version }) {
|
|
3405
3405
|
try {
|
|
3406
3406
|
const result = await this.#client.execute({
|
|
3407
|
-
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASET_ITEMS)} FROM ${storage.TABLE_DATASET_ITEMS} WHERE datasetId = ? AND datasetVersion <= ? AND (validTo IS NULL OR validTo > ?) AND isDeleted = 0 ORDER BY createdAt DESC`,
|
|
3407
|
+
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASET_ITEMS)} FROM ${storage.TABLE_DATASET_ITEMS} WHERE datasetId = ? AND datasetVersion <= ? AND (validTo IS NULL OR validTo > ?) AND isDeleted = 0 ORDER BY createdAt DESC, id ASC`,
|
|
3408
3408
|
args: [datasetId, version, version]
|
|
3409
3409
|
});
|
|
3410
3410
|
return result.rows?.map((row) => this.transformItemRow(row)) ?? [];
|
|
@@ -3470,7 +3470,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3470
3470
|
const limitValue2 = perPageInput === false ? total2 : perPage2;
|
|
3471
3471
|
const end2 = perPageInput === false ? total2 : start2 + perPage2;
|
|
3472
3472
|
const result2 = await this.#client.execute({
|
|
3473
|
-
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASET_ITEMS)} FROM ${storage.TABLE_DATASET_ITEMS} ${whereClause2} ORDER BY createdAt DESC LIMIT ? OFFSET ?`,
|
|
3473
|
+
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASET_ITEMS)} FROM ${storage.TABLE_DATASET_ITEMS} ${whereClause2} ORDER BY createdAt DESC, id ASC LIMIT ? OFFSET ?`,
|
|
3474
3474
|
args: [...queryParams2, limitValue2, start2]
|
|
3475
3475
|
});
|
|
3476
3476
|
return {
|
|
@@ -3507,7 +3507,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3507
3507
|
const limitValue = perPageInput === false ? total : perPage;
|
|
3508
3508
|
const end = perPageInput === false ? total : start + perPage;
|
|
3509
3509
|
const result = await this.#client.execute({
|
|
3510
|
-
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASET_ITEMS)} FROM ${storage.TABLE_DATASET_ITEMS} ${whereClause} ORDER BY createdAt DESC LIMIT ? OFFSET ?`,
|
|
3510
|
+
sql: `SELECT ${buildSelectColumns(storage.TABLE_DATASET_ITEMS)} FROM ${storage.TABLE_DATASET_ITEMS} ${whereClause} ORDER BY createdAt DESC, id ASC LIMIT ? OFFSET ?`,
|
|
3511
3511
|
args: [...queryParams, limitValue, start]
|
|
3512
3512
|
});
|
|
3513
3513
|
return {
|
|
@@ -7465,6 +7465,11 @@ var PromptBlocksLibSQL = class extends storage.PromptBlocksStorage {
|
|
|
7465
7465
|
async init() {
|
|
7466
7466
|
await this.#db.createTable({ tableName: storage.TABLE_PROMPT_BLOCKS, schema: storage.PROMPT_BLOCKS_SCHEMA });
|
|
7467
7467
|
await this.#db.createTable({ tableName: storage.TABLE_PROMPT_BLOCK_VERSIONS, schema: storage.PROMPT_BLOCK_VERSIONS_SCHEMA });
|
|
7468
|
+
await this.#db.alterTable({
|
|
7469
|
+
tableName: storage.TABLE_PROMPT_BLOCK_VERSIONS,
|
|
7470
|
+
schema: storage.PROMPT_BLOCK_VERSIONS_SCHEMA,
|
|
7471
|
+
ifNotExists: ["requestContextSchema"]
|
|
7472
|
+
});
|
|
7468
7473
|
await this.#client.execute(
|
|
7469
7474
|
`CREATE UNIQUE INDEX IF NOT EXISTS idx_prompt_block_versions_block_version ON "${storage.TABLE_PROMPT_BLOCK_VERSIONS}" ("blockId", "versionNumber")`
|
|
7470
7475
|
);
|
|
@@ -7609,12 +7614,14 @@ var PromptBlocksLibSQL = class extends storage.PromptBlocksStorage {
|
|
|
7609
7614
|
}
|
|
7610
7615
|
async list(args) {
|
|
7611
7616
|
try {
|
|
7612
|
-
const { page = 0, perPage: perPageInput, orderBy, authorId, metadata, status
|
|
7617
|
+
const { page = 0, perPage: perPageInput, orderBy, authorId, metadata, status } = args || {};
|
|
7613
7618
|
const { field, direction } = this.parseOrderBy(orderBy);
|
|
7614
7619
|
const conditions = [];
|
|
7615
7620
|
const queryParams = [];
|
|
7616
|
-
|
|
7617
|
-
|
|
7621
|
+
if (status) {
|
|
7622
|
+
conditions.push("status = ?");
|
|
7623
|
+
queryParams.push(status);
|
|
7624
|
+
}
|
|
7618
7625
|
if (authorId !== void 0) {
|
|
7619
7626
|
conditions.push("authorId = ?");
|
|
7620
7627
|
queryParams.push(authorId);
|
|
@@ -7634,7 +7641,7 @@ var PromptBlocksLibSQL = class extends storage.PromptBlocksStorage {
|
|
|
7634
7641
|
queryParams.push(typeof value === "string" ? value : JSON.stringify(value));
|
|
7635
7642
|
}
|
|
7636
7643
|
}
|
|
7637
|
-
const whereClause = `WHERE ${conditions.join(" AND ")}
|
|
7644
|
+
const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
7638
7645
|
const countResult = await this.#client.execute({
|
|
7639
7646
|
sql: `SELECT COUNT(*) as count FROM "${storage.TABLE_PROMPT_BLOCKS}" ${whereClause}`,
|
|
7640
7647
|
args: queryParams
|
|
@@ -7693,6 +7700,7 @@ var PromptBlocksLibSQL = class extends storage.PromptBlocksStorage {
|
|
|
7693
7700
|
description: input.description ?? null,
|
|
7694
7701
|
content: input.content,
|
|
7695
7702
|
rules: input.rules ?? null,
|
|
7703
|
+
requestContextSchema: input.requestContextSchema ?? null,
|
|
7696
7704
|
changedFields: input.changedFields ?? null,
|
|
7697
7705
|
changeMessage: input.changeMessage ?? null,
|
|
7698
7706
|
createdAt: now.toISOString()
|
|
@@ -7920,6 +7928,7 @@ var PromptBlocksLibSQL = class extends storage.PromptBlocksStorage {
|
|
|
7920
7928
|
description: row.description ?? void 0,
|
|
7921
7929
|
content: row.content,
|
|
7922
7930
|
rules: safeParseJSON(row.rules),
|
|
7931
|
+
requestContextSchema: safeParseJSON(row.requestContextSchema),
|
|
7923
7932
|
changedFields: safeParseJSON(row.changedFields),
|
|
7924
7933
|
changeMessage: row.changeMessage ?? void 0,
|
|
7925
7934
|
createdAt: new Date(row.createdAt)
|