@mastra/editor 0.16.0-alpha.3 → 0.16.0-alpha.4

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
@@ -259,7 +259,7 @@ function renderTemplate(template, context) {
259
259
  */
260
260
  async function resolveInstructionBlocks(blocks, context, deps) {
261
261
  const segments = [];
262
- const blockIds = Array.from(new Set(blocks.filter((b) => b.type === "prompt_block_ref").map((b) => b.id)));
262
+ const blockIds = Array.from(new Set(blocks.filter((b) => b.type === "prompt_block_ref").filter((b) => !b.rules || evaluateRuleGroup(b.rules, context)).map((b) => b.id)));
263
263
  const resolvedBlocksMap = /* @__PURE__ */ new Map();
264
264
  if (blockIds.length > 0) {
265
265
  const resolveOptions = deps.includeDrafts ? { status: "draft" } : void 0;
@@ -283,6 +283,7 @@ async function resolveInstructionBlocks(blocks, context, deps) {
283
283
  if (rendered.trim()) segments.push(rendered);
284
284
  continue;
285
285
  }
286
+ if (block.rules && !evaluateRuleGroup(block.rules, context)) continue;
286
287
  const resolved = resolvedBlocksMap.get(block.id);
287
288
  if (!resolved) continue;
288
289
  if (!deps.includeDrafts && resolved.status !== "published") continue;