@mastra/core 0.5.0-alpha.6 → 0.5.0-alpha.7

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.
@@ -107,7 +107,16 @@ var LibSQLStore = class extends MastraStorage {
107
107
  }
108
108
  async insert({ tableName, record }) {
109
109
  try {
110
- await this.client.execute(this.prepareStatement({ tableName, record }));
110
+ await this.client.execute(
111
+ this.prepareStatement({
112
+ tableName,
113
+ record: {
114
+ ...record,
115
+ createdAt: record.createdAt instanceof Date ? record.createdAt.toISOString() : record.createdAt,
116
+ updatedAt: record.updatedAt instanceof Date ? record.updatedAt.toISOString() : record.updatedAt
117
+ }
118
+ })
119
+ );
111
120
  } catch (error) {
112
121
  this.logger.error(`Error upserting into table ${tableName}: ${error}`);
113
122
  throw error;
@@ -137,7 +146,7 @@ var LibSQLStore = class extends MastraStorage {
137
146
  const parsed = Object.fromEntries(
138
147
  Object.entries(row || {}).map(([k, v]) => {
139
148
  try {
140
- return [k, typeof v === "string" ? JSON.parse(v) : v];
149
+ return [k, typeof v === "string" ? v.startsWith("{") || v.startsWith("[") ? JSON.parse(v) : v : v];
141
150
  } catch {
142
151
  return [k, v];
143
152
  }
@@ -1,4 +1,4 @@
1
- import { LibSQLStore } from './chunk-NTEKFUXY.js';
1
+ import { LibSQLStore } from './chunk-PFWSWJT7.js';
2
2
  import { InstrumentClass, OTLPTraceExporter, Telemetry } from './chunk-W5HVJX45.js';
3
3
  import { createLogger, LogLevel, noopLogger } from './chunk-3JSTLSIP.js';
4
4
  import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
@@ -1,5 +1,5 @@
1
1
  import { LibSQLVector } from './chunk-4DD2PP2R.js';
2
- import { LibSQLStore } from './chunk-NTEKFUXY.js';
2
+ import { LibSQLStore } from './chunk-PFWSWJT7.js';
3
3
  import { deepMerge } from './chunk-HBHPTMAC.js';
4
4
  import { MastraBase } from './chunk-4VHCCQ7P.js';
5
5
  import { existsSync } from 'fs';
package/dist/index.cjs CHANGED
@@ -3348,7 +3348,11 @@ var LibSQLStore = class extends MastraStorage {
3348
3348
  try {
3349
3349
  await this.client.execute(this.prepareStatement({
3350
3350
  tableName,
3351
- record
3351
+ record: {
3352
+ ...record,
3353
+ createdAt: record.createdAt instanceof Date ? record.createdAt.toISOString() : record.createdAt,
3354
+ updatedAt: record.updatedAt instanceof Date ? record.updatedAt.toISOString() : record.updatedAt
3355
+ }
3352
3356
  }));
3353
3357
  } catch (error) {
3354
3358
  this.logger.error(`Error upserting into table ${tableName}: ${error}`);
@@ -3387,7 +3391,7 @@ var LibSQLStore = class extends MastraStorage {
3387
3391
  const row = result.rows[0];
3388
3392
  const parsed = Object.fromEntries(Object.entries(row || {}).map(([k, v]) => {
3389
3393
  try {
3390
- return [k, typeof v === "string" ? JSON.parse(v) : v];
3394
+ return [k, typeof v === "string" ? v.startsWith("{") || v.startsWith("[") ? JSON.parse(v) : v : v];
3391
3395
  } catch {
3392
3396
  return [k, v];
3393
3397
  }
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@ import { MastraTTS } from './chunk-CLJYFFOS.js';
2
2
  import { Workflow } from './chunk-KBSR2LLT.js';
3
3
  export { Step, WhenConditionReturnValue, createStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isErrorEvent, isFinalState, isTransitionEvent, isVariableReference, mergeChildValue, recursivelyCheckForFinalState, updateStepInHierarchy } from './chunk-KBSR2LLT.js';
4
4
  import { Integration, OpenAPIToolset } from './chunk-PNZK456O.js';
5
- export { Mastra } from './chunk-UZBCMAM6.js';
6
- import { MastraMemory } from './chunk-OTU2RYEQ.js';
5
+ export { Mastra } from './chunk-WQP5UP2H.js';
6
+ import { MastraMemory } from './chunk-ZI46WXW6.js';
7
7
  import { MastraVector } from './chunk-QLYZGX5Z.js';
8
8
  export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-QABMKXI3.js';
9
9
  import { MastraStorage } from './chunk-7TZAPEAT.js';
@@ -672,7 +672,11 @@ var LibSQLStore = class extends MastraStorage {
672
672
  try {
673
673
  await this.client.execute(this.prepareStatement({
674
674
  tableName,
675
- record
675
+ record: {
676
+ ...record,
677
+ createdAt: record.createdAt instanceof Date ? record.createdAt.toISOString() : record.createdAt,
678
+ updatedAt: record.updatedAt instanceof Date ? record.updatedAt.toISOString() : record.updatedAt
679
+ }
676
680
  }));
677
681
  } catch (error) {
678
682
  this.logger.error(`Error upserting into table ${tableName}: ${error}`);
@@ -711,7 +715,7 @@ var LibSQLStore = class extends MastraStorage {
711
715
  const row = result.rows[0];
712
716
  const parsed = Object.fromEntries(Object.entries(row || {}).map(([k, v]) => {
713
717
  try {
714
- return [k, typeof v === "string" ? JSON.parse(v) : v];
718
+ return [k, typeof v === "string" ? v.startsWith("{") || v.startsWith("[") ? JSON.parse(v) : v : v];
715
719
  } catch {
716
720
  return [k, v];
717
721
  }
@@ -1 +1 @@
1
- export { Mastra } from '../chunk-UZBCMAM6.js';
1
+ export { Mastra } from '../chunk-WQP5UP2H.js';
@@ -473,7 +473,16 @@ var LibSQLStore = class extends MastraStorage {
473
473
  }
474
474
  async insert({ tableName, record }) {
475
475
  try {
476
- await this.client.execute(this.prepareStatement({ tableName, record }));
476
+ await this.client.execute(
477
+ this.prepareStatement({
478
+ tableName,
479
+ record: {
480
+ ...record,
481
+ createdAt: record.createdAt instanceof Date ? record.createdAt.toISOString() : record.createdAt,
482
+ updatedAt: record.updatedAt instanceof Date ? record.updatedAt.toISOString() : record.updatedAt
483
+ }
484
+ })
485
+ );
477
486
  } catch (error) {
478
487
  this.logger.error(`Error upserting into table ${tableName}: ${error}`);
479
488
  throw error;
@@ -503,7 +512,7 @@ var LibSQLStore = class extends MastraStorage {
503
512
  const parsed = Object.fromEntries(
504
513
  Object.entries(row || {}).map(([k, v]) => {
505
514
  try {
506
- return [k, typeof v === "string" ? JSON.parse(v) : v];
515
+ return [k, typeof v === "string" ? v.startsWith("{") || v.startsWith("[") ? JSON.parse(v) : v : v];
507
516
  } catch {
508
517
  return [k, v];
509
518
  }
@@ -1 +1 @@
1
- export { MastraMemory } from '../chunk-OTU2RYEQ.js';
1
+ export { MastraMemory } from '../chunk-ZI46WXW6.js';
@@ -468,7 +468,16 @@ var LibSQLStore = class extends MastraStorage {
468
468
  }
469
469
  async insert({ tableName, record }) {
470
470
  try {
471
- await this.client.execute(this.prepareStatement({ tableName, record }));
471
+ await this.client.execute(
472
+ this.prepareStatement({
473
+ tableName,
474
+ record: {
475
+ ...record,
476
+ createdAt: record.createdAt instanceof Date ? record.createdAt.toISOString() : record.createdAt,
477
+ updatedAt: record.updatedAt instanceof Date ? record.updatedAt.toISOString() : record.updatedAt
478
+ }
479
+ })
480
+ );
472
481
  } catch (error) {
473
482
  this.logger.error(`Error upserting into table ${tableName}: ${error}`);
474
483
  throw error;
@@ -498,7 +507,7 @@ var LibSQLStore = class extends MastraStorage {
498
507
  const parsed = Object.fromEntries(
499
508
  Object.entries(row || {}).map(([k, v]) => {
500
509
  try {
501
- return [k, typeof v === "string" ? JSON.parse(v) : v];
510
+ return [k, typeof v === "string" ? v.startsWith("{") || v.startsWith("[") ? JSON.parse(v) : v : v];
502
511
  } catch {
503
512
  return [k, v];
504
513
  }
@@ -1 +1 @@
1
- export { LibSQLStore as DefaultStorage, LibSQLStore } from '../../chunk-NTEKFUXY.js';
1
+ export { LibSQLStore as DefaultStorage, LibSQLStore } from '../../chunk-PFWSWJT7.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.5.0-alpha.6",
3
+ "version": "0.5.0-alpha.7",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",