@mastra/libsql 1.22.0-alpha.1 → 1.22.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 +93 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-semantic-recall.md +19 -0
- package/dist/docs/references/docs-storage.md +1 -0
- package/dist/docs/references/integrations-channels-github.md +56 -9
- package/dist/docs/references/integrations-databases-libsql.md +16 -0
- package/dist/index.cjs +19 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts +3 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/dist/storage/domains/experiments/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +10 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2966,7 +2966,7 @@ var BackgroundTasksLibSQL = class BackgroundTasksLibSQL extends BackgroundTasksS
|
|
|
2966
2966
|
}
|
|
2967
2967
|
});
|
|
2968
2968
|
}
|
|
2969
|
-
async updateTask(taskId, update) {
|
|
2969
|
+
async updateTask(taskId, update, options) {
|
|
2970
2970
|
const setClauses = [];
|
|
2971
2971
|
const params = [];
|
|
2972
2972
|
if ("status" in update) {
|
|
@@ -3001,12 +3001,17 @@ var BackgroundTasksLibSQL = class BackgroundTasksLibSQL extends BackgroundTasksS
|
|
|
3001
3001
|
setClauses.push("completedAt = ?");
|
|
3002
3002
|
params.push(update.completedAt?.toISOString() ?? null);
|
|
3003
3003
|
}
|
|
3004
|
-
if (setClauses.length === 0) return;
|
|
3004
|
+
if (setClauses.length === 0) return false;
|
|
3005
3005
|
params.push(taskId);
|
|
3006
|
-
|
|
3007
|
-
|
|
3006
|
+
let where = "id = ?";
|
|
3007
|
+
if (options?.expectedStatus) {
|
|
3008
|
+
where += " AND status = ?";
|
|
3009
|
+
params.push(options.expectedStatus);
|
|
3010
|
+
}
|
|
3011
|
+
return (await this.#client.execute({
|
|
3012
|
+
sql: `UPDATE ${TABLE_BACKGROUND_TASKS} SET ${setClauses.join(", ")} WHERE ${where}`,
|
|
3008
3013
|
args: params
|
|
3009
|
-
});
|
|
3014
|
+
})).rowsAffected > 0;
|
|
3010
3015
|
}
|
|
3011
3016
|
async getTask(taskId) {
|
|
3012
3017
|
const row = (await this.#client.execute({
|
|
@@ -4616,6 +4621,7 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
|
|
|
4616
4621
|
"tags",
|
|
4617
4622
|
"comment",
|
|
4618
4623
|
"toolMockReport",
|
|
4624
|
+
"metadata",
|
|
4619
4625
|
"organizationId",
|
|
4620
4626
|
"projectId",
|
|
4621
4627
|
"attempt"
|
|
@@ -4762,6 +4768,7 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
|
|
|
4762
4768
|
input: safelyParseJSON(row.input),
|
|
4763
4769
|
output: row.output ? safelyParseJSON(row.output) : null,
|
|
4764
4770
|
groundTruth: row.groundTruth ? safelyParseJSON(row.groundTruth) : null,
|
|
4771
|
+
metadata: row.metadata ? safelyParseJSON(row.metadata) : null,
|
|
4765
4772
|
error: row.error ? safelyParseJSON(row.error) : null,
|
|
4766
4773
|
startedAt: ensureDate(row.startedAt),
|
|
4767
4774
|
completedAt: ensureDate(row.completedAt),
|
|
@@ -5064,6 +5071,7 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
|
|
|
5064
5071
|
input: input.input,
|
|
5065
5072
|
output: input.output,
|
|
5066
5073
|
groundTruth: input.groundTruth,
|
|
5074
|
+
metadata: input.metadata ?? null,
|
|
5067
5075
|
error: input.error ?? null,
|
|
5068
5076
|
startedAt: input.startedAt.toISOString(),
|
|
5069
5077
|
completedAt: input.completedAt.toISOString(),
|
|
@@ -5086,6 +5094,7 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
|
|
|
5086
5094
|
input: input.input,
|
|
5087
5095
|
output: input.output,
|
|
5088
5096
|
groundTruth: input.groundTruth,
|
|
5097
|
+
metadata: input.metadata ?? null,
|
|
5089
5098
|
error: input.error,
|
|
5090
5099
|
startedAt: input.startedAt,
|
|
5091
5100
|
completedAt: input.completedAt,
|
|
@@ -5140,7 +5149,7 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
|
|
|
5140
5149
|
await this.#client.execute({
|
|
5141
5150
|
sql: `UPDATE ${TABLE_EXPERIMENT_RESULTS} SET
|
|
5142
5151
|
"itemDatasetVersion" = ?, "organizationId" = ?, "projectId" = ?,
|
|
5143
|
-
"input" = ?, "output" = ?, "groundTruth" = ?, "error" = ?,
|
|
5152
|
+
"input" = ?, "output" = ?, "groundTruth" = ?, "metadata" = ?, "error" = ?,
|
|
5144
5153
|
"startedAt" = ?, "completedAt" = ?, "retryCount" = ?, "attempt" = ?,
|
|
5145
5154
|
"traceId" = ?, "status" = ?, "tags" = ?, "toolMockReport" = ?
|
|
5146
5155
|
WHERE "id" = ?`,
|
|
@@ -5151,6 +5160,7 @@ var ExperimentsLibSQL = class extends ExperimentsStorage {
|
|
|
5151
5160
|
JSON.stringify(input.input),
|
|
5152
5161
|
input.output != null ? JSON.stringify(input.output) : null,
|
|
5153
5162
|
input.groundTruth != null ? JSON.stringify(input.groundTruth) : null,
|
|
5163
|
+
input.metadata != null ? JSON.stringify(input.metadata) : null,
|
|
5154
5164
|
input.error != null ? JSON.stringify(input.error) : null,
|
|
5155
5165
|
input.startedAt.toISOString(),
|
|
5156
5166
|
input.completedAt.toISOString(),
|
|
@@ -14132,10 +14142,12 @@ var LibSQLStore = class extends MastraCompositeStore {
|
|
|
14132
14142
|
};
|
|
14133
14143
|
if ("url" in config) {
|
|
14134
14144
|
if (config.url.includes(":memory:")) this.shouldCacheInit = false;
|
|
14135
|
-
this.isLocalDb = config.url.startsWith("file:") || config.url.includes(":memory:");
|
|
14145
|
+
this.isLocalDb = (config.url.startsWith("file:") || config.url.includes(":memory:")) && !config.syncUrl;
|
|
14136
14146
|
this.client = createClient({
|
|
14137
14147
|
url: config.url,
|
|
14138
14148
|
...config.authToken ? { authToken: config.authToken } : {},
|
|
14149
|
+
...config.syncUrl ? { syncUrl: config.syncUrl } : {},
|
|
14150
|
+
...config.syncInterval !== void 0 ? { syncInterval: config.syncInterval } : {},
|
|
14139
14151
|
...this.isLocalDb ? { timeout: this.connectionTimeoutMs } : {}
|
|
14140
14152
|
});
|
|
14141
14153
|
this.pragmasReady = this.isLocalDb ? this.applyLocalPragmas() : Promise.resolve();
|