@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.
- package/dist/agent/durable/index.cjs +1 -1
- package/dist/agent/durable/index.js +1 -1
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +1 -1
- package/dist/agent-controller/index.js +1 -1
- package/dist/{agent-controller-DDxEG9Nd.cjs → agent-controller-DhDQXNoI.cjs} +5 -5
- package/dist/{agent-controller-DYwtbG2-.js → agent-controller-DihwxeVJ.js} +5 -5
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-B8Lk1bt5.js → background-tasks-BoUX5G90.js} +1 -1
- package/dist/{background-tasks-LfQsDG6J.cjs → background-tasks-udYDvnlw.cjs} +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-CPgUrTDP.cjs → builder-B2n-bUbl.cjs} +2 -2
- package/dist/{builder-DLaSPG2u.js → builder-Cn1lOWio.js} +2 -2
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-BPxJYR70.js → channels-DA3oMfhF.js} +1 -1
- package/dist/{channels-DH9fKqmy.cjs → channels-HRrlHnwF.cjs} +1 -1
- package/dist/coding-agent/index.cjs +2 -2
- package/dist/coding-agent/index.js +2 -2
- package/dist/{constants-Bou0hEgY.cjs → constants-CFO8w780.cjs} +8 -0
- package/dist/{constants-CFWgIaqA.js → constants-CUv0mU2y.js} +8 -0
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +759 -749
- package/dist/docs/references/docs-harness-schedules.md +34 -0
- package/dist/docs/references/docs-signals-sending-signals.md +13 -0
- package/dist/docs/references/docs-signals-state-signals.md +1 -1
- package/dist/docs/references/reference-signals-time-signal-provider.md +35 -0
- package/dist/docs/references/reference-workspace-factory-sandbox.md +2 -0
- package/dist/evals/index.cjs +2 -2
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +2 -2
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/index.cjs +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/{llm-DeOr7BXy.cjs → llm-Bljw7LII.cjs} +2 -2
- package/dist/{llm-DGa7alUy.js → llm-CxHzqEEI.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-BErWwr50.js → manager-BimN8ZdV.js} +3 -3
- package/dist/{manager-B-pQMauy.cjs → manager-DVYVB-3O.cjs} +3 -3
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-B1BKkzX0.js → mastra-BpMvri3z.js} +17 -16
- package/dist/{mastra-CoWxmLQl.cjs → mastra-k8L1lFip.cjs} +17 -16
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-CGH6nAvh.cjs → model-CrDuEDRq.cjs} +1 -1
- package/dist/{model-Bz3zffBv.js → model-sUJDcX2v.js} +1 -1
- package/dist/{netlify-CzbukKO2.js → netlify-BEJ96z-w.js} +1 -1
- package/dist/{netlify-D7oirBdu.cjs → netlify-Td-JUUkt.cjs} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-DTaqnIYP.cjs → provider-registry-CCYXykIZ.cjs} +4 -4
- package/dist/{provider-registry-CdCkSE3h.js → provider-registry-DBG4hlGl.js} +4 -4
- package/dist/{registry-generator-CcgFsigf.cjs → registry-generator-BxiC9XcX.cjs} +1 -1
- package/dist/{registry-generator-Dbxm-MYh.js → registry-generator-D2lO3JJJ.js} +1 -1
- package/dist/{rehydrate-D7eaaJxI.cjs → rehydrate-BD0zOfc8.cjs} +2 -2
- package/dist/{rehydrate-BhmzzvtV.js → rehydrate-PRFAu8yl.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-59R9kE8Z.cjs → run-registry-BvMXuIb_.cjs} +530 -367
- package/dist/{run-registry-Du22tS_D.js → run-registry-Cqp-VFdv.js} +530 -367
- package/dist/{scheduler-B-VZUvv_.js → scheduler-0ShtMM1I.js} +71 -21
- package/dist/{scheduler-D00X03jQ.cjs → scheduler-CMjK0LoQ.cjs} +82 -20
- package/dist/signals/index.cjs +1 -1
- package/dist/signals/index.js +1 -1
- package/dist/signals/time-signal-provider.d.ts +8 -0
- package/dist/{signals-CIwzgkvN.cjs → signals-CbmgVwL-.cjs} +74 -7
- package/dist/{signals-BTfT-6DE.js → signals-Clupx3jz.js} +74 -7
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/knowledge/base.d.ts +33 -1
- package/dist/storage/domains/knowledge/inmemory.d.ts +2 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +20 -12
- package/dist/storage/domains/schedules/base.d.ts +31 -2
- package/dist/storage/domains/schedules/inmemory.d.ts +9 -2
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +3 -3
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-mYc-fHPF.cjs → stream-BIbVD8V8.cjs} +1 -1
- package/dist/{stream-C_oNulbg.js → stream-D607FmAx.js} +1 -1
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-Bi09dOW5.cjs → tool-loop-agent-Cnf7vONA.cjs} +3 -3
- package/dist/{tool-loop-agent-Du1BJO8a.js → tool-loop-agent-eyoY_TEX.js} +3 -3
- package/dist/{utils-nyjsIsHZ.js → utils-CQkzZUcK.js} +1 -1
- package/dist/{utils-BGq3p2MX.cjs → utils-O1TXaFUl.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-CcE7gP2j.cjs → validate-CEgWy7P0.cjs} +1 -1
- package/dist/{validate-q0hhKzA4.js → validate-CTWjOlWp.js} +1 -1
- package/dist/vector/index.cjs +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-DmJLbaGI.cjs → worker-CCDvbK3P.cjs} +2 -2
- package/dist/{worker-Dboi5I9k.js → worker-CCNb2aJe.js} +3 -3
- package/dist/{worker-Dzfx-9D0.cjs → worker-CI1joT3R.cjs} +3 -3
- package/dist/{worker-Wv2nS-Df.js → worker-D52cos24.js} +2 -2
- package/dist/{workflow-BPf1-mkb.cjs → workflow-BJL0qlPN.cjs} +3 -3
- package/dist/{workflow-CFfCkulP.js → workflow-DsmyWwxG.js} +3 -3
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +7 -5
- package/dist/workflows/index.js +6 -6
- package/dist/workflows/scheduler/claim.d.ts +51 -0
- package/dist/workflows/scheduler/index.d.ts +2 -0
- package/package.json +7 -7
package/dist/workflows/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
-
const require_stream = require("../stream-
|
|
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-
|
|
7
|
-
const require_validate = require("../validate-
|
|
8
|
-
const require_rehydrate = require("../rehydrate-
|
|
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;
|
package/dist/workflows/index.js
CHANGED
|
@@ -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-
|
|
2
|
-
import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-
|
|
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-
|
|
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-
|
|
7
|
-
import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-
|
|
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.
|
|
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/
|
|
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"
|