@mastra/core 1.87.0-alpha.13 → 1.87.0-alpha.15

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.
Files changed (130) hide show
  1. package/dist/agent/durable/index.cjs +1 -1
  2. package/dist/agent/durable/index.js +1 -1
  3. package/dist/agent/index.cjs +2 -2
  4. package/dist/agent/index.js +2 -2
  5. package/dist/agent-builder/ee/index.cjs +1 -1
  6. package/dist/agent-builder/ee/index.js +1 -1
  7. package/dist/agent-controller/index.cjs +1 -1
  8. package/dist/agent-controller/index.js +1 -1
  9. package/dist/{agent-controller-DDxEG9Nd.cjs → agent-controller-DhDQXNoI.cjs} +5 -5
  10. package/dist/{agent-controller-DYwtbG2-.js → agent-controller-DihwxeVJ.js} +5 -5
  11. package/dist/background-tasks/index.cjs +1 -1
  12. package/dist/background-tasks/index.js +1 -1
  13. package/dist/{background-tasks-B8Lk1bt5.js → background-tasks-BoUX5G90.js} +1 -1
  14. package/dist/{background-tasks-LfQsDG6J.cjs → background-tasks-udYDvnlw.cjs} +1 -1
  15. package/dist/browser/index.cjs +1 -1
  16. package/dist/browser/index.js +1 -1
  17. package/dist/{builder-CPgUrTDP.cjs → builder-B2n-bUbl.cjs} +2 -2
  18. package/dist/{builder-DLaSPG2u.js → builder-Cn1lOWio.js} +2 -2
  19. package/dist/channels/index.cjs +2 -2
  20. package/dist/channels/index.js +2 -2
  21. package/dist/{channels-BPxJYR70.js → channels-DA3oMfhF.js} +1 -1
  22. package/dist/{channels-DH9fKqmy.cjs → channels-HRrlHnwF.cjs} +1 -1
  23. package/dist/coding-agent/index.cjs +2 -2
  24. package/dist/coding-agent/index.js +2 -2
  25. package/dist/{constants-Bou0hEgY.cjs → constants-CFO8w780.cjs} +8 -0
  26. package/dist/{constants-CFWgIaqA.js → constants-CUv0mU2y.js} +8 -0
  27. package/dist/datasets/index.cjs +2 -2
  28. package/dist/datasets/index.js +2 -2
  29. package/dist/docs/SKILL.md +1 -1
  30. package/dist/docs/assets/SOURCE_MAP.json +759 -749
  31. package/dist/docs/references/docs-harness-schedules.md +34 -0
  32. package/dist/docs/references/docs-signals-sending-signals.md +13 -0
  33. package/dist/docs/references/docs-signals-state-signals.md +1 -1
  34. package/dist/docs/references/reference-signals-time-signal-provider.md +35 -0
  35. package/dist/docs/references/reference-workspace-factory-sandbox.md +2 -0
  36. package/dist/evals/index.cjs +2 -2
  37. package/dist/evals/index.js +2 -2
  38. package/dist/evals/scoreTraces/index.cjs +2 -2
  39. package/dist/evals/scoreTraces/index.js +2 -2
  40. package/dist/harness/index.cjs +1 -1
  41. package/dist/harness/index.js +1 -1
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/knowledge/index.cjs +1 -1
  45. package/dist/knowledge/index.js +1 -1
  46. package/dist/llm/index.cjs +3 -3
  47. package/dist/llm/index.js +3 -3
  48. package/dist/{llm-DeOr7BXy.cjs → llm-Bljw7LII.cjs} +2 -2
  49. package/dist/{llm-DGa7alUy.js → llm-CxHzqEEI.js} +2 -2
  50. package/dist/loop/index.cjs +2 -2
  51. package/dist/loop/index.js +2 -2
  52. package/dist/{manager-BErWwr50.js → manager-BimN8ZdV.js} +3 -3
  53. package/dist/{manager-B-pQMauy.cjs → manager-DVYVB-3O.cjs} +3 -3
  54. package/dist/mastra/index.cjs +1 -1
  55. package/dist/mastra/index.js +1 -1
  56. package/dist/{mastra-B1BKkzX0.js → mastra-BpMvri3z.js} +17 -16
  57. package/dist/{mastra-CoWxmLQl.cjs → mastra-k8L1lFip.cjs} +17 -16
  58. package/dist/memory/index.cjs +2 -2
  59. package/dist/memory/index.js +2 -2
  60. package/dist/{model-CGH6nAvh.cjs → model-CrDuEDRq.cjs} +1 -1
  61. package/dist/{model-Bz3zffBv.js → model-sUJDcX2v.js} +1 -1
  62. package/dist/{netlify-CzbukKO2.js → netlify-BEJ96z-w.js} +1 -1
  63. package/dist/{netlify-D7oirBdu.cjs → netlify-Td-JUUkt.cjs} +1 -1
  64. package/dist/notifications/index.cjs +1 -1
  65. package/dist/notifications/index.js +1 -1
  66. package/dist/processor-provider/index.cjs +1 -1
  67. package/dist/processor-provider/index.js +1 -1
  68. package/dist/processors/index.cjs +2 -2
  69. package/dist/processors/index.js +2 -2
  70. package/dist/{provider-registry-DTaqnIYP.cjs → provider-registry-CCYXykIZ.cjs} +4 -4
  71. package/dist/{provider-registry-CdCkSE3h.js → provider-registry-DBG4hlGl.js} +4 -4
  72. package/dist/{registry-generator-CcgFsigf.cjs → registry-generator-BxiC9XcX.cjs} +1 -1
  73. package/dist/{registry-generator-Dbxm-MYh.js → registry-generator-D2lO3JJJ.js} +1 -1
  74. package/dist/{rehydrate-D7eaaJxI.cjs → rehydrate-BD0zOfc8.cjs} +2 -2
  75. package/dist/{rehydrate-BhmzzvtV.js → rehydrate-PRFAu8yl.js} +2 -2
  76. package/dist/relevance/index.cjs +2 -2
  77. package/dist/relevance/index.js +2 -2
  78. package/dist/{run-registry-59R9kE8Z.cjs → run-registry-BvMXuIb_.cjs} +530 -367
  79. package/dist/{run-registry-Du22tS_D.js → run-registry-Cqp-VFdv.js} +530 -367
  80. package/dist/{scheduler-B-VZUvv_.js → scheduler-0ShtMM1I.js} +71 -21
  81. package/dist/{scheduler-D00X03jQ.cjs → scheduler-CMjK0LoQ.cjs} +82 -20
  82. package/dist/signals/index.cjs +1 -1
  83. package/dist/signals/index.js +1 -1
  84. package/dist/signals/time-signal-provider.d.ts +8 -0
  85. package/dist/{signals-CIwzgkvN.cjs → signals-CbmgVwL-.cjs} +74 -7
  86. package/dist/{signals-BTfT-6DE.js → signals-Clupx3jz.js} +74 -7
  87. package/dist/storage/constants.cjs +1 -1
  88. package/dist/storage/constants.js +1 -1
  89. package/dist/storage/domains/knowledge/base.d.ts +33 -1
  90. package/dist/storage/domains/knowledge/inmemory.d.ts +2 -0
  91. package/dist/storage/domains/knowledge/pages-inmemory.d.ts +20 -12
  92. package/dist/storage/domains/schedules/base.d.ts +31 -2
  93. package/dist/storage/domains/schedules/inmemory.d.ts +9 -2
  94. package/dist/storage/index.cjs +3 -3
  95. package/dist/storage/index.js +3 -3
  96. package/dist/stream/index.cjs +2 -2
  97. package/dist/stream/index.js +2 -2
  98. package/dist/{stream-mYc-fHPF.cjs → stream-BIbVD8V8.cjs} +1 -1
  99. package/dist/{stream-C_oNulbg.js → stream-D607FmAx.js} +1 -1
  100. package/dist/test-utils/llm-mock.cjs +1 -1
  101. package/dist/test-utils/llm-mock.js +1 -1
  102. package/dist/tool-loop-agent/index.cjs +1 -1
  103. package/dist/tool-loop-agent/index.js +1 -1
  104. package/dist/{tool-loop-agent-Bi09dOW5.cjs → tool-loop-agent-Cnf7vONA.cjs} +3 -3
  105. package/dist/{tool-loop-agent-Du1BJO8a.js → tool-loop-agent-eyoY_TEX.js} +3 -3
  106. package/dist/{utils-nyjsIsHZ.js → utils-CQkzZUcK.js} +1 -1
  107. package/dist/{utils-BGq3p2MX.cjs → utils-O1TXaFUl.cjs} +1 -1
  108. package/dist/utils.cjs +1 -1
  109. package/dist/utils.js +1 -1
  110. package/dist/{validate-CcE7gP2j.cjs → validate-CEgWy7P0.cjs} +1 -1
  111. package/dist/{validate-q0hhKzA4.js → validate-CTWjOlWp.js} +1 -1
  112. package/dist/vector/index.cjs +1 -1
  113. package/dist/vector/index.js +1 -1
  114. package/dist/worker/index.cjs +1 -1
  115. package/dist/worker/index.js +1 -1
  116. package/dist/{worker-DmJLbaGI.cjs → worker-CCDvbK3P.cjs} +2 -2
  117. package/dist/{worker-Dboi5I9k.js → worker-CCNb2aJe.js} +3 -3
  118. package/dist/{worker-Dzfx-9D0.cjs → worker-CI1joT3R.cjs} +3 -3
  119. package/dist/{worker-Wv2nS-Df.js → worker-D52cos24.js} +2 -2
  120. package/dist/{workflow-BPf1-mkb.cjs → workflow-BJL0qlPN.cjs} +3 -3
  121. package/dist/{workflow-CFfCkulP.js → workflow-DsmyWwxG.js} +3 -3
  122. package/dist/workflows/builder/index.cjs +1 -1
  123. package/dist/workflows/builder/index.js +1 -1
  124. package/dist/workflows/evented/index.cjs +1 -1
  125. package/dist/workflows/evented/index.js +1 -1
  126. package/dist/workflows/index.cjs +7 -5
  127. package/dist/workflows/index.js +6 -6
  128. package/dist/workflows/scheduler/claim.d.ts +51 -0
  129. package/dist/workflows/scheduler/index.d.ts +2 -0
  130. package/package.json +7 -7
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../run-registry-59R9kE8Z.cjs");
3
- const require_stream = require("../stream-mYc-fHPF.cjs");
2
+ const require_run_registry = require("../run-registry-BvMXuIb_.cjs");
3
+ const require_stream = require("../stream-BIbVD8V8.cjs");
4
4
  const require_predicate_index = require("../predicate/index.cjs");
5
5
  const require_schedules = require("../schedules-BZS8McF7.cjs");
6
- const require_scheduler = require("../scheduler-D00X03jQ.cjs");
7
- const require_validate = require("../validate-CcE7gP2j.cjs");
8
- const require_rehydrate = require("../rehydrate-D7eaaJxI.cjs");
6
+ const require_scheduler = require("../scheduler-CMjK0LoQ.cjs");
7
+ const require_validate = require("../validate-CEgWy7P0.cjs");
8
+ const require_rehydrate = require("../rehydrate-BD0zOfc8.cjs");
9
9
  // src/workflows/state-reader.ts
10
10
  const getStep = (state, stepId) => state.steps?.[stepId];
11
11
  const getFirstStepResult = (step) => {
@@ -84,6 +84,7 @@ exports.analyzeMapConfig = require_validate.analyzeMapConfig;
84
84
  exports.applyStateDelta = require_run_registry.applyStateDelta;
85
85
  exports.assertTimeTravelGraphMatchesSnapshot = require_run_registry.assertTimeTravelGraphMatchesSnapshot;
86
86
  exports.assertValidDynamicWorkflow = require_validate.assertValidDynamicWorkflow;
87
+ exports.claimScheduleFire = require_scheduler.claimScheduleFire;
87
88
  exports.cleanStepResult = require_run_registry.cleanStepResult;
88
89
  exports.cloneStep = require_run_registry.cloneStep$1;
89
90
  exports.cloneWorkflow = require_run_registry.cloneWorkflow;
@@ -137,6 +138,7 @@ exports.predicateToCondition = require_run_registry.predicateToCondition;
137
138
  exports.rehydrateWorkflow = require_rehydrate.rehydrateWorkflow;
138
139
  exports.resolveForeachConcurrency = require_run_registry.resolveForeachConcurrency;
139
140
  exports.runCountDeprecationMessage = require_run_registry.runCountDeprecationMessage;
141
+ exports.runScheduleTick = require_scheduler.runScheduleTick;
140
142
  exports.schemaCompatibility = require_validate.schemaCompatibility;
141
143
  exports.setLongTimeout = require_run_registry.setLongTimeout;
142
144
  exports.toJsonSchemaOrUndefined = require_validate.toJsonSchemaOrUndefined;
@@ -1,10 +1,10 @@
1
- import { $c as createMappingStep, Ac as cloneStep, Al as validateStepSuspendData, Cl as resolveForeachConcurrency, Dl as validateStepRequestContext, El as validateStepInput, Fc as evaluatePredicate, Gs as createEventedWorkflow, Il as workflowTermination, Ks as createWorkflow, Mc as isProcessor, Ml as getEntryId, Nc as mapVariable, Nl as getEntryWorkflow, Oc as Run, Ol as validateStepResumeData, Pc as predicateToCondition, Sl as omitPriorSuspensionFields, Tl as setLongTimeout, Vc as DefaultExecutionEngine, Ws as cloneWorkflow, Yc as ExecutionEngine, _l as getStepIds, al as abortableSleep, bl as isSingleStepEntry, cl as cleanStepResult, dl as createTimeTravelExecutionParams, el as createStepFromAgent, fl as defineLazyWriter, gl as getSingleStepEntryId, hl as getResumeLabelsByStepId, il as RESUME_SNAPSHOT_WAIT_STATUSES, jc as createStep, jl as waitForSuspendedSnapshot, kc as Workflow, kl as validateStepStateData, ll as createDeprecationProxy, ml as getRestartStartIndex, nl as createStepFromTool, ol as applyStateDelta, pl as defineStateAccessors, rl as RESUME_SNAPSHOT_POLL_INTERVAL_MS, sl as assertTimeTravelGraphMatchesSnapshot, tc as computeScheduleDefinitionHash, tl as createStepFromClassifier, ul as createRestartExecutionParams, vl as hydrateSerializedStepErrors, wl as runCountDeprecationMessage, xl as omitPriorCompletionFields, yl as isEntryFinished } from "../run-registry-Du22tS_D.js";
2
- import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-C_oNulbg.js";
1
+ import { $c as createMappingStep, Ac as cloneStep, Al as validateStepSuspendData, Cl as resolveForeachConcurrency, Dl as validateStepRequestContext, El as validateStepInput, Fc as evaluatePredicate, Gs as createEventedWorkflow, Il as workflowTermination, Ks as createWorkflow, Mc as isProcessor, Ml as getEntryId, Nc as mapVariable, Nl as getEntryWorkflow, Oc as Run, Ol as validateStepResumeData, Pc as predicateToCondition, Sl as omitPriorSuspensionFields, Tl as setLongTimeout, Vc as DefaultExecutionEngine, Ws as cloneWorkflow, Yc as ExecutionEngine, _l as getStepIds, al as abortableSleep, bl as isSingleStepEntry, cl as cleanStepResult, dl as createTimeTravelExecutionParams, el as createStepFromAgent, fl as defineLazyWriter, gl as getSingleStepEntryId, hl as getResumeLabelsByStepId, il as RESUME_SNAPSHOT_WAIT_STATUSES, jc as createStep, jl as waitForSuspendedSnapshot, kc as Workflow, kl as validateStepStateData, ll as createDeprecationProxy, ml as getRestartStartIndex, nl as createStepFromTool, ol as applyStateDelta, pl as defineStateAccessors, rl as RESUME_SNAPSHOT_POLL_INTERVAL_MS, sl as assertTimeTravelGraphMatchesSnapshot, tc as computeScheduleDefinitionHash, tl as createStepFromClassifier, ul as createRestartExecutionParams, vl as hydrateSerializedStepErrors, wl as runCountDeprecationMessage, xl as omitPriorCompletionFields, yl as isEntryFinished } from "../run-registry-Cqp-VFdv.js";
2
+ import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-D607FmAx.js";
3
3
  import { derivePredicateLabel, predicateSchema } from "../predicate/index.js";
4
4
  import { _ as validateCron, h as computeNextFireAt } from "../schedules-DZfSx-7P.js";
5
- import { n as WorkflowScheduler, t as Scheduler } from "../scheduler-B-VZUvv_.js";
6
- import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-q0hhKzA4.js";
7
- import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-BhmzzvtV.js";
5
+ import { i as runScheduleTick, n as WorkflowScheduler, r as claimScheduleFire, t as Scheduler } from "../scheduler-0ShtMM1I.js";
6
+ import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-CTWjOlWp.js";
7
+ import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-PRFAu8yl.js";
8
8
  // src/workflows/state-reader.ts
9
9
  const getStep = (state, stepId) => state.steps?.[stepId];
10
10
  const getFirstStepResult = (step) => {
@@ -70,4 +70,4 @@ function createWorkflowStateReader(state) {
70
70
  getResumeLabels: () => getWorkflowResumeLabels(state)
71
71
  };
72
72
  }
73
- export { DefaultExecutionEngine, ExecutionEngine, RESUME_SNAPSHOT_POLL_INTERVAL_MS, RESUME_SNAPSHOT_WAIT_STATUSES, Run, Scheduler, Workflow, WorkflowScheduler, abortableSleep, analyzeMapConfig, applyStateDelta, assertTimeTravelGraphMatchesSnapshot, assertValidDynamicWorkflow, cleanStepResult, cloneStep, cloneWorkflow, collectNestedWorkflowIds, computeNextFireAt, computeScheduleDefinitionHash, createDeprecationProxy, createEventedWorkflow, createMappingStep, createRestartExecutionParams, createStep, createStepFromAgent, createStepFromClassifier, createStepFromTool, createTimeTravelExecutionParams, createWorkflow, createWorkflowStateReader, defineLazyWriter, defineStateAccessors, derivePredicateLabel, entryOptionFields, evaluatePredicate, forEachSingleStepEntry, forEachSingleStepEntryWithPath, getEntryId, getEntryWorkflow, getRestartStartIndex, getResumeLabelsByStepId, getSingleStepEntryId, getStepIds, getStepResult, getStepResultAsync, getWorkflowResumeLabel, getWorkflowResumeLabels, getWorkflowStepOutput, getWorkflowStepPayload, getWorkflowSuspendedStep, getWorkflowSuspendedSteps, hydrateSerializedStepErrors, inferGraphSchemas, isEntryFinished, isProcessor, isSingleStepEntry, jsonSchemaToZod, mapVariable, omitPriorCompletionFields, omitPriorSuspensionFields, parseMapConfig, predicateSchema, predicateToCondition, rehydrateWorkflow, resolveForeachConcurrency, runCountDeprecationMessage, schemaCompatibility, setLongTimeout, toJsonSchemaOrUndefined, toStorableGraph, validateCron, validateDynamicWorkflow, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData, validateStorableJsonSchema, validateWorkflowRefs, validateWorkflowSchemas, validateWorkflowStructure, waitForSuspendedSnapshot, workflowTermination };
73
+ export { DefaultExecutionEngine, ExecutionEngine, RESUME_SNAPSHOT_POLL_INTERVAL_MS, RESUME_SNAPSHOT_WAIT_STATUSES, Run, Scheduler, Workflow, WorkflowScheduler, abortableSleep, analyzeMapConfig, applyStateDelta, assertTimeTravelGraphMatchesSnapshot, assertValidDynamicWorkflow, claimScheduleFire, cleanStepResult, cloneStep, cloneWorkflow, collectNestedWorkflowIds, computeNextFireAt, computeScheduleDefinitionHash, createDeprecationProxy, createEventedWorkflow, createMappingStep, createRestartExecutionParams, createStep, createStepFromAgent, createStepFromClassifier, createStepFromTool, createTimeTravelExecutionParams, createWorkflow, createWorkflowStateReader, defineLazyWriter, defineStateAccessors, derivePredicateLabel, entryOptionFields, evaluatePredicate, forEachSingleStepEntry, forEachSingleStepEntryWithPath, getEntryId, getEntryWorkflow, getRestartStartIndex, getResumeLabelsByStepId, getSingleStepEntryId, getStepIds, getStepResult, getStepResultAsync, getWorkflowResumeLabel, getWorkflowResumeLabels, getWorkflowStepOutput, getWorkflowStepPayload, getWorkflowSuspendedStep, getWorkflowSuspendedSteps, hydrateSerializedStepErrors, inferGraphSchemas, isEntryFinished, isProcessor, isSingleStepEntry, jsonSchemaToZod, mapVariable, omitPriorCompletionFields, omitPriorSuspensionFields, parseMapConfig, predicateSchema, predicateToCondition, rehydrateWorkflow, resolveForeachConcurrency, runCountDeprecationMessage, runScheduleTick, schemaCompatibility, setLongTimeout, toJsonSchemaOrUndefined, toStorableGraph, validateCron, validateDynamicWorkflow, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData, validateStorableJsonSchema, validateWorkflowRefs, validateWorkflowSchemas, validateWorkflowStructure, waitForSuspendedSnapshot, workflowTermination };
@@ -0,0 +1,51 @@
1
+ import type { Schedule, SchedulesStorage } from '../../storage/domains/schedules/base.js';
2
+ /**
3
+ * Deterministic per occurrence. Unscoped rows keep `sched_<id>_<fireAt>`; a
4
+ * tenant's row adds its encoded tenant so equal ids in two tenants never share
5
+ * a run id.
6
+ */
7
+ export declare function scheduleRunId(schedule: Pick<Schedule, 'id' | 'nextFireAt' | 'tenantId'>): string;
8
+ export interface ClaimedScheduleFire {
9
+ schedule: Schedule;
10
+ /** Deterministic per occurrence, so every process derives the same id. */
11
+ runId: string;
12
+ actualFireAt: number;
13
+ }
14
+ /**
15
+ * Claim one occurrence of a due schedule: advance `nextFireAt` with a
16
+ * compare-and-swap so only one caller across processes wins it. Returns
17
+ * undefined when another caller won, or the row was paused or changed.
18
+ * Throws when the cron can't produce a next fire time.
19
+ */
20
+ export declare function claimScheduleFire({ store, schedule, now, }: {
21
+ store: SchedulesStorage;
22
+ schedule: Schedule;
23
+ now: number;
24
+ }): Promise<ClaimedScheduleFire | undefined>;
25
+ export interface DueScheduleFire {
26
+ schedule: Schedule;
27
+ /** Deterministic per occurrence; use it to name or dedupe the dispatched work. */
28
+ runId: string;
29
+ scheduledFireAt: number;
30
+ }
31
+ /**
32
+ * One scheduler tick without a timer. Lists due tenant schedules (of every
33
+ * tenant on the root store, or one tenant's on its view), hands each
34
+ * occurrence to `dispatch`, and only then advances the row. Schedules without
35
+ * a tenant belong to the in-process `Scheduler` and are never touched here, so
36
+ * one occurrence is never fired by both. A failed dispatch leaves the row due for the next tick; a
37
+ * crash after dispatch re-dispatches the same `runId` next tick, so `dispatch`
38
+ * must be idempotent on it (e.g. a named queue task). Hosts that drive ticks
39
+ * from outside the process (a cron job calling an HTTP route) call this.
40
+ * `onError` receives every failed occurrence; a failing dispatch stays due and
41
+ * fails again each tick, so log or alert on it.
42
+ * Returns the occurrences this tick dispatched and advanced.
43
+ */
44
+ export declare function runScheduleTick({ store, now, limit, dispatch, onError, }: {
45
+ store: SchedulesStorage;
46
+ now: number;
47
+ limit?: number;
48
+ dispatch: (fire: DueScheduleFire) => Promise<void>;
49
+ onError: (error: unknown, schedule: Schedule) => void;
50
+ }): Promise<DueScheduleFire[]>;
51
+ //# sourceMappingURL=claim.d.ts.map
@@ -1,3 +1,5 @@
1
+ export { claimScheduleFire, runScheduleTick } from './claim.js';
2
+ export type { ClaimedScheduleFire, DueScheduleFire } from './claim.js';
1
3
  export { computeNextFireAt, validateCron } from './cron.js';
2
4
  export { computeScheduleDefinitionHash } from './definition-hash.js';
3
5
  export { Scheduler, WorkflowScheduler } from './scheduler.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "1.87.0-alpha.13",
3
+ "version": "1.87.0-alpha.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -987,18 +987,18 @@
987
987
  "zod": "^4.6.7",
988
988
  "zod-v3": "npm:zod@3.25.76",
989
989
  "@internal/ai-sdk-v5": "0.0.99",
990
- "@internal/ai-v7": "0.0.99",
991
- "@internal/ai-sdk-v4": "0.0.99",
992
- "@internal/ai-v6": "0.0.99",
993
990
  "@internal/auth": "0.0.40",
991
+ "@internal/ai-sdk-v4": "0.0.99",
994
992
  "@internal/core": "0.1.4",
995
993
  "@internal/deployer": "0.0.5",
994
+ "@internal/external-types": "0.0.102",
996
995
  "@internal/lint": "0.0.152",
996
+ "@internal/llm-recorder": "0.0.88",
997
997
  "@internal/test-utils": "0.0.88",
998
+ "@internal/ai-v6": "0.0.99",
998
999
  "@internal/types-builder": "0.0.127",
999
- "@internal/llm-recorder": "0.0.88",
1000
- "@internal/voice": "0.0.48",
1001
- "@internal/external-types": "0.0.102"
1000
+ "@internal/ai-v7": "0.0.99",
1001
+ "@internal/voice": "0.0.48"
1002
1002
  },
1003
1003
  "engines": {
1004
1004
  "node": ">=22.13.0"