@mastra/mysql 0.2.0 → 0.3.0-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 +13 -0
- package/dist/index.cjs +29 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -7
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/datasets/index.d.ts.map +1 -1
- package/dist/storage/domains/experiments/index.d.ts.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @mastra/mysql
|
|
2
2
|
|
|
3
|
+
## 0.3.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The MySQL store now rejects item-level tool mocks with a clear error instead of silently dropping them. Tool mock persistence is not yet supported on MySQL, so saving a dataset item with `toolMocks` (or an experiment result with a `toolMockReport`) fails fast rather than discarding the data. ([#18036](https://github.com/mastra-ai/mastra/pull/18036))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Fixed: `mastra build` output no longer hangs on the first storage-touching request when an app uses `LibSQLStore`, `PostgresStore`, or `MySQLStore` with observational memory. `mastra dev` was unaffected; only the bundled `mastra start` output deadlocked. No code changes or `bundler.externals` workaround required on the app side after upgrading. ([#18302](https://github.com/mastra-ai/mastra/pull/18302))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`65f255a`](https://github.com/mastra-ai/mastra/commit/65f255a38667beb6ceeadabfa9eb5059bfec8298), [`4a88c6e`](https://github.com/mastra-ai/mastra/commit/4a88c6e2bdce316f8d7551b4ec3449b0b06fc71c), [`87a17ef`](https://github.com/mastra-ai/mastra/commit/87a17efbd725aca6639febdc5e69e2abb3048689), [`e11ff30`](https://github.com/mastra-ai/mastra/commit/e11ff301408bf1731dca2fb7fbfcd8c819500a35), [`9d2c946`](https://github.com/mastra-ai/mastra/commit/9d2c946d0859e90ae4bcec5beeb1da7398d2ad1e), [`f1ec385`](https://github.com/mastra-ai/mastra/commit/f1ec385386f62b1a0847ec5353ae2bb169d1c3d9), [`e14986f`](https://github.com/mastra-ai/mastra/commit/e14986f6e5478d6384d04ff9a7f9a79a46a8b529), [`0be490f`](https://github.com/mastra-ai/mastra/commit/0be490fabb538c5a7de796ea0aff7d04a0bea1f3), [`0be490f`](https://github.com/mastra-ai/mastra/commit/0be490fabb538c5a7de796ea0aff7d04a0bea1f3), [`974f614`](https://github.com/mastra-ai/mastra/commit/974f614e083bd68278536f94453f7b320b86a3c7), [`31be1cf`](https://github.com/mastra-ai/mastra/commit/31be1cf5f2a7b5eef12f6123a40653b4d8115c16)]:
|
|
14
|
+
- @mastra/core@1.46.0-alpha.3
|
|
15
|
+
|
|
3
16
|
## 0.2.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2058,6 +2058,21 @@ var DatasetsMySQL = class _DatasetsMySQL extends storage.DatasetsStorage {
|
|
|
2058
2058
|
#indexes;
|
|
2059
2059
|
/** Tables managed by this domain */
|
|
2060
2060
|
static MANAGED_TABLES = [storage.TABLE_DATASETS, storage.TABLE_DATASET_ITEMS, storage.TABLE_DATASET_VERSIONS];
|
|
2061
|
+
/**
|
|
2062
|
+
* Item-level tool mocks are not persisted by the MySQL adapter. Reject writes
|
|
2063
|
+
* that carry them so the feature fails loudly here instead of silently dropping
|
|
2064
|
+
* the mocks and then running tools live during experiments.
|
|
2065
|
+
*/
|
|
2066
|
+
#rejectToolMocks(toolMocks) {
|
|
2067
|
+
if (Array.isArray(toolMocks) && toolMocks.length > 0) {
|
|
2068
|
+
throw new error.MastraError({
|
|
2069
|
+
id: "MYSQL_DATASET_TOOL_MOCKS_UNSUPPORTED",
|
|
2070
|
+
domain: error.ErrorDomain.STORAGE,
|
|
2071
|
+
category: error.ErrorCategory.USER,
|
|
2072
|
+
text: "Tool mocks are not supported on the MySQL storage adapter. Use a supported adapter (LibSQL, PostgreSQL, MongoDB, or Spanner) to persist dataset item tool mocks."
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2061
2076
|
/**
|
|
2062
2077
|
* Returns default index definitions for the datasets domain tables.
|
|
2063
2078
|
* Currently no default indexes are defined for datasets.
|
|
@@ -2362,6 +2377,7 @@ var DatasetsMySQL = class _DatasetsMySQL extends storage.DatasetsStorage {
|
|
|
2362
2377
|
}
|
|
2363
2378
|
// --- SCD-2 item mutations ---
|
|
2364
2379
|
async _doAddItem(args) {
|
|
2380
|
+
this.#rejectToolMocks(args.toolMocks);
|
|
2365
2381
|
const connection = await this.pool.getConnection();
|
|
2366
2382
|
try {
|
|
2367
2383
|
await connection.beginTransaction();
|
|
@@ -2423,6 +2439,7 @@ var DatasetsMySQL = class _DatasetsMySQL extends storage.DatasetsStorage {
|
|
|
2423
2439
|
}
|
|
2424
2440
|
}
|
|
2425
2441
|
async _doUpdateItem(args) {
|
|
2442
|
+
this.#rejectToolMocks(args.toolMocks);
|
|
2426
2443
|
const existing = await this.getItemById({ id: args.id });
|
|
2427
2444
|
if (!existing) {
|
|
2428
2445
|
throw new error.MastraError({
|
|
@@ -2765,6 +2782,9 @@ var DatasetsMySQL = class _DatasetsMySQL extends storage.DatasetsStorage {
|
|
|
2765
2782
|
}
|
|
2766
2783
|
// --- Bulk operations (SCD-2 internally) ---
|
|
2767
2784
|
async _doBatchInsertItems(input) {
|
|
2785
|
+
for (const item of input.items) {
|
|
2786
|
+
this.#rejectToolMocks(item.toolMocks);
|
|
2787
|
+
}
|
|
2768
2788
|
const dataset = await this.getDatasetById({ id: input.datasetId });
|
|
2769
2789
|
if (!dataset) {
|
|
2770
2790
|
throw new error.MastraError({
|
|
@@ -3241,6 +3261,14 @@ var ExperimentsMySQL = class _ExperimentsMySQL extends storage.ExperimentsStorag
|
|
|
3241
3261
|
}
|
|
3242
3262
|
}
|
|
3243
3263
|
async addExperimentResult(input) {
|
|
3264
|
+
if (input.toolMockReport) {
|
|
3265
|
+
throw new error.MastraError({
|
|
3266
|
+
id: "MYSQL_EXPERIMENT_TOOL_MOCK_REPORT_UNSUPPORTED",
|
|
3267
|
+
domain: error.ErrorDomain.STORAGE,
|
|
3268
|
+
category: error.ErrorCategory.USER,
|
|
3269
|
+
text: "Tool mock reports are not supported on the MySQL storage adapter. Use a supported adapter (LibSQL, PostgreSQL, MongoDB, or Spanner) to persist experiment tool mock reports."
|
|
3270
|
+
});
|
|
3271
|
+
}
|
|
3244
3272
|
try {
|
|
3245
3273
|
const id = input.id ?? crypto$1.randomUUID();
|
|
3246
3274
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -4794,12 +4822,7 @@ var MemoryMySQL = class _MemoryMySQL extends storage.MemoryStorage {
|
|
|
4794
4822
|
await this.operations.createTable({ tableName: storage.TABLE_THREADS, schema: storage.TABLE_SCHEMAS[storage.TABLE_THREADS] });
|
|
4795
4823
|
await this.operations.createTable({ tableName: storage.TABLE_MESSAGES, schema: storage.TABLE_SCHEMAS[storage.TABLE_MESSAGES] });
|
|
4796
4824
|
await this.operations.createTable({ tableName: storage.TABLE_RESOURCES, schema: storage.TABLE_SCHEMAS[storage.TABLE_RESOURCES] });
|
|
4797
|
-
|
|
4798
|
-
try {
|
|
4799
|
-
const { OBSERVATIONAL_MEMORY_TABLE_SCHEMA } = await import('@mastra/core/storage');
|
|
4800
|
-
omSchema = OBSERVATIONAL_MEMORY_TABLE_SCHEMA?.[OM_TABLE];
|
|
4801
|
-
} catch {
|
|
4802
|
-
}
|
|
4825
|
+
const omSchema = storage.OBSERVATIONAL_MEMORY_TABLE_SCHEMA?.[OM_TABLE];
|
|
4803
4826
|
if (omSchema) {
|
|
4804
4827
|
await this.operations.createTable({
|
|
4805
4828
|
tableName: OM_TABLE,
|