@mastra/editor 0.14.6-alpha.0 → 0.14.6-alpha.2
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.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -77,7 +77,7 @@ var CrudEditorNamespace = class extends EditorNamespace {
|
|
|
77
77
|
async getById(id, options) {
|
|
78
78
|
this.ensureRegistered();
|
|
79
79
|
if (options?.versionId && options.versionNumber !== void 0) throw new Error("versionId and versionNumber cannot be used together");
|
|
80
|
-
const isVersionRequest = options?.versionId || options?.versionNumber || options?.status;
|
|
80
|
+
const isVersionRequest = options?.versionId !== void 0 || options?.versionNumber !== void 0 || options?.status !== void 0;
|
|
81
81
|
if (!isVersionRequest) {
|
|
82
82
|
const cached = this._cache.get(id);
|
|
83
83
|
if (cached) {
|
|
@@ -212,6 +212,7 @@ function resolvePath(context, path) {
|
|
|
212
212
|
let current = context;
|
|
213
213
|
for (const segment of segments) {
|
|
214
214
|
if (current === null || current === void 0 || typeof current !== "object") return;
|
|
215
|
+
if (!Object.prototype.hasOwnProperty.call(current, segment)) return;
|
|
215
216
|
current = current[segment];
|
|
216
217
|
}
|
|
217
218
|
return current;
|
|
@@ -306,7 +307,9 @@ function resolveStep(step, ctx) {
|
|
|
306
307
|
ctx.logger?.warn(`ProcessorProvider "${step.providerId}" not found for graph step "${step.id}"`);
|
|
307
308
|
return;
|
|
308
309
|
}
|
|
309
|
-
const
|
|
310
|
+
const parsed = provider.configSchema.safeParse(step.config);
|
|
311
|
+
if (!parsed.success) throw new Error(`Invalid configuration for processor graph step "${step.id}" (provider "${step.providerId}"): ${parsed.error.message}`);
|
|
312
|
+
const processor = provider.createProcessor(parsed.data);
|
|
310
313
|
const allProviderPhases = provider.availablePhases;
|
|
311
314
|
const enabledSet = new Set(step.enabledPhases);
|
|
312
315
|
if (allProviderPhases.some((p) => !enabledSet.has(p))) {
|
|
@@ -687,7 +690,7 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
687
690
|
return {
|
|
688
691
|
create: (input) => store.create({ agent: input }),
|
|
689
692
|
getByIdResolved: async (id, options) => {
|
|
690
|
-
if (options?.versionId || options?.versionNumber) {
|
|
693
|
+
if (options?.versionId || options?.versionNumber !== void 0) {
|
|
691
694
|
const agent = await store.getById(id);
|
|
692
695
|
if (!agent) return null;
|
|
693
696
|
const version = options.versionId ? await store.getVersion(options.versionId) : await store.getVersionByNumber(id, options.versionNumber);
|