@mastra/convex 1.7.5-alpha.0 → 1.7.5

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as mastraCache, i as mastraStorage, n as mastraNativeVectorMutation, r as mastraNativeVectorQuery, t as mastraNativeVectorAction } from "./server-DCzSpppl.js";
1
+ import { a as mastraCache, i as mastraStorage, n as mastraNativeVectorMutation, r as mastraNativeVectorQuery, t as mastraNativeVectorAction } from "./server-CedrKoHl.js";
2
2
  import { TABLE_BACKGROUND_TASKS, TABLE_CHANNEL_CONFIG, TABLE_CHANNEL_INSTALLATIONS, TABLE_MESSAGES, TABLE_OBSERVATIONAL_MEMORY, TABLE_RESOURCES, TABLE_SCHEDULES, TABLE_SCHEDULE_TRIGGERS, TABLE_SCORERS, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, defineMastraNativeVectorTable, mastraBackgroundTasksTable, mastraCacheListItemsTable, mastraCacheTable, mastraChannelConfigTable, mastraChannelInstallationsTable, mastraDocumentsTable, mastraMessagesTable, mastraObservationalMemoryTable, mastraResourcesTable, mastraScheduleTriggersTable, mastraSchedulesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from "./schema.js";
3
3
  import { MastraServerCache } from "@mastra/core/cache";
4
4
  import { BackgroundTasksStorage, ChannelsStorage, MastraCompositeStore, MemoryStorage, RUN_FENCE_CONFLICT_ERROR_ID, RunFenceConflictError, SchedulesStorage, ScoresStorage, TABLE_BACKGROUND_TASKS as TABLE_BACKGROUND_TASKS$1, TABLE_CHANNEL_CONFIG as TABLE_CHANNEL_CONFIG$1, TABLE_CHANNEL_INSTALLATIONS as TABLE_CHANNEL_INSTALLATIONS$1, TABLE_MEMORY_RUN_FENCES, TABLE_MESSAGES as TABLE_MESSAGES$1, TABLE_RESOURCES as TABLE_RESOURCES$1, TABLE_SCHEDULES as TABLE_SCHEDULES$1, TABLE_SCHEDULE_TRIGGERS as TABLE_SCHEDULE_TRIGGERS$1, TABLE_SCORERS as TABLE_SCORERS$1, TABLE_THREADS as TABLE_THREADS$1, TABLE_WORKFLOW_RUN_OWNERS, TABLE_WORKFLOW_SNAPSHOT as TABLE_WORKFLOW_SNAPSHOT$1, WorkflowsStorage, calculatePagination, createStorageErrorId, createVectorErrorId, executeRetentionPrune, filterByDateRange, normalizePerPage, normalizeScheduleTarget, resolveRetentionTargets, resolveRunFence, retentionCutoffMs, safelyParseJSON, storageMessageMatchesMetadataFilter, validateStorageMetadataFilter } from "@mastra/core/storage";
@@ -1228,13 +1228,14 @@ var MemoryConvex = class MemoryConvex extends MemoryStorage {
1228
1228
  }
1229
1229
  async init() {}
1230
1230
  async prune(policies, options) {
1231
+ const targets = resolveRetentionTargets({
1232
+ policies,
1233
+ descriptor: MemoryConvex.retentionTables,
1234
+ order: ["runFences"]
1235
+ });
1231
1236
  return executeRetentionPrune({
1232
1237
  domain: "memory",
1233
- targets: resolveRetentionTargets({
1234
- policies,
1235
- descriptor: MemoryConvex.retentionTables,
1236
- order: ["runFences"]
1237
- }),
1238
+ targets,
1238
1239
  options,
1239
1240
  cutoffFor: (target, now) => retentionCutoffMs(target.policy, now),
1240
1241
  deleteBatch: (_target, cutoff, limit) => pruneRunClaims(this.#client, TABLE_MEMORY_RUN_FENCES, "retiredAt", Number(cutoff), limit)
@@ -2332,13 +2333,14 @@ var WorkflowsConvex = class WorkflowsConvex extends WorkflowsStorage {
2332
2333
  }
2333
2334
  async init() {}
2334
2335
  async prune(policies, options) {
2336
+ const targets = resolveRetentionTargets({
2337
+ policies,
2338
+ descriptor: WorkflowsConvex.retentionTables,
2339
+ order: ["runOwnership"]
2340
+ });
2335
2341
  return executeRetentionPrune({
2336
2342
  domain: "workflows",
2337
- targets: resolveRetentionTargets({
2338
- policies,
2339
- descriptor: WorkflowsConvex.retentionTables,
2340
- order: ["runOwnership"]
2341
- }),
2343
+ targets,
2342
2344
  options,
2343
2345
  cutoffFor: (target, now) => retentionCutoffMs(target.policy, now),
2344
2346
  deleteBatch: (_target, cutoff, limit) => pruneRunClaims(this.#client, TABLE_WORKFLOW_RUN_OWNERS, "updatedAt", Number(cutoff), limit)