@mastra/editor 0.16.5-alpha.1 → 0.16.5-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 CHANGED
@@ -12,7 +12,7 @@ let _mastra_core_workflows = require("@mastra/core/workflows");
12
12
  let _mastra_core_utils = require("@mastra/core/utils");
13
13
  let crypto$1 = require("crypto");
14
14
  let _mastra_core_evals = require("@mastra/core/evals");
15
- //#region src/namespaces/base.ts
15
+ // src/namespaces/base.ts
16
16
  /**
17
17
  * Base class for all editor namespaces.
18
18
  * Provides shared infrastructure: mastra/logger access and registration check.
@@ -134,8 +134,7 @@ var CrudEditorNamespace = class extends EditorNamespace {
134
134
  }
135
135
  }
136
136
  };
137
- //#endregion
138
- //#region src/rule-evaluator.ts
137
+ // src/rule-evaluator.ts
139
138
  /**
140
139
  * Resolves a dot-notation path against a context object.
141
140
  */
@@ -191,8 +190,7 @@ function evaluateRuleGroup(ruleGroup, context) {
191
190
  if (ruleGroup.operator === "AND") return results.every(Boolean);
192
191
  return results.some(Boolean);
193
192
  }
194
- //#endregion
195
- //#region src/template-engine.ts
193
+ // src/template-engine.ts
196
194
  /**
197
195
  * TemplateEngine: Simple variable interpolation for prompt block content.
198
196
  *
@@ -248,8 +246,7 @@ function renderTemplate(template, context) {
248
246
  return match;
249
247
  });
250
248
  }
251
- //#endregion
252
- //#region src/instruction-builder.ts
249
+ // src/instruction-builder.ts
253
250
  /**
254
251
  * Resolves an array of instruction blocks into a final instruction string.
255
252
  *
@@ -296,8 +293,7 @@ async function resolveInstructionBlocks(blocks, context, deps) {
296
293
  }
297
294
  return segments.join("\n\n");
298
295
  }
299
- //#endregion
300
- //#region src/processor-graph-hydrator.ts
296
+ // src/processor-graph-hydrator.ts
301
297
  const PASSTHROUGH_STEP_PREFIX = "passthrough-";
302
298
  /**
303
299
  * Override a hydrated workflow step's ID so it derives from the unique
@@ -489,8 +485,7 @@ function hydrateProcessorGraph(graph, mode, ctx) {
489
485
  function selectFirstMatchingGraph(variants, context) {
490
486
  for (const variant of variants) if (!variant.rules || evaluateRuleGroup(variant.rules, context)) return variant.value;
491
487
  }
492
- //#endregion
493
- //#region src/namespaces/mcp.ts
488
+ // src/namespaces/mcp.ts
494
489
  var EditorMCPNamespace = class EditorMCPNamespace extends CrudEditorNamespace {
495
490
  onCacheEvict(_id) {}
496
491
  async getStorageAdapter() {
@@ -551,8 +546,7 @@ var EditorMCPNamespace = class EditorMCPNamespace extends CrudEditorNamespace {
551
546
  };
552
547
  }
553
548
  };
554
- //#endregion
555
- //#region src/namespaces/versioned-update.ts
549
+ // src/namespaces/versioned-update.ts
556
550
  function getProvidedSnapshotFields(input, snapshotFields) {
557
551
  const config = {};
558
552
  for (const field of snapshotFields) if (input[field] !== void 0) config[field] = input[field];
@@ -604,8 +598,7 @@ async function createVersionFromSnapshotUpdate({ store, parentId, parentIdField,
604
598
  }
605
599
  throw lastError;
606
600
  }
607
- //#endregion
608
- //#region src/namespaces/workspace-identity.ts
601
+ // src/namespaces/workspace-identity.ts
609
602
  /**
610
603
  * `JSON.stringify` with deterministic key ordering at every level.
611
604
  *
@@ -640,8 +633,7 @@ function computeInlineWorkspaceIdentity(config) {
640
633
  configHash
641
634
  };
642
635
  }
643
- //#endregion
644
- //#region src/namespaces/agent.ts
636
+ // src/namespaces/agent.ts
645
637
  const AGENT_SNAPSHOT_CONFIG_FIELDS = [
646
638
  "name",
647
639
  "description",
@@ -1830,8 +1822,7 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
1830
1822
  return new _mastra_core_workspace.CompositeVersionedSkillSource(versionedEntries, blobStore);
1831
1823
  }
1832
1824
  };
1833
- //#endregion
1834
- //#region src/namespaces/mcp-server.ts
1825
+ // src/namespaces/mcp-server.ts
1835
1826
  var EditorMCPServerNamespace = class extends CrudEditorNamespace {
1836
1827
  onCacheEvict(_id) {}
1837
1828
  async hydrate(resolved) {
@@ -1937,8 +1928,7 @@ var EditorMCPServerNamespace = class extends CrudEditorNamespace {
1937
1928
  };
1938
1929
  }
1939
1930
  };
1940
- //#endregion
1941
- //#region src/namespaces/prompt.ts
1931
+ // src/namespaces/prompt.ts
1942
1932
  const PROMPT_BLOCK_SNAPSHOT_CONFIG_FIELDS = [
1943
1933
  "name",
1944
1934
  "description",
@@ -2080,8 +2070,7 @@ var EditorPromptNamespace = class extends CrudEditorNamespace {
2080
2070
  });
2081
2071
  }
2082
2072
  };
2083
- //#endregion
2084
- //#region src/namespaces/scorer.ts
2073
+ // src/namespaces/scorer.ts
2085
2074
  var EditorScorerNamespace = class extends CrudEditorNamespace {
2086
2075
  constructor(..._args) {
2087
2076
  super(..._args);
@@ -2200,8 +2189,7 @@ Explain your reasoning for this score in a clear, concise paragraph.`;
2200
2189
  return null;
2201
2190
  }
2202
2191
  };
2203
- //#endregion
2204
- //#region src/workspace-tools-config.ts
2192
+ // src/workspace-tools-config.ts
2205
2193
  function toRuntimeWorkspaceToolsConfig(stored) {
2206
2194
  const config = {};
2207
2195
  if (stored.enabled !== void 0) config.enabled = stored.enabled;
@@ -2227,8 +2215,7 @@ function toStorageWorkspaceToolsConfig(config) {
2227
2215
  if (Object.keys(tools).length > 0) stored.tools = tools;
2228
2216
  return Object.keys(stored).length > 0 ? stored : void 0;
2229
2217
  }
2230
- //#endregion
2231
- //#region src/namespaces/workspace.ts
2218
+ // src/namespaces/workspace.ts
2232
2219
  var EditorWorkspaceNamespace = class extends CrudEditorNamespace {
2233
2220
  onCacheEvict(_id) {}
2234
2221
  /**
@@ -2373,8 +2360,7 @@ var EditorWorkspaceNamespace = class extends CrudEditorNamespace {
2373
2360
  };
2374
2361
  }
2375
2362
  };
2376
- //#endregion
2377
- //#region src/namespaces/skill.ts
2363
+ // src/namespaces/skill.ts
2378
2364
  var EditorSkillNamespace = class extends CrudEditorNamespace {
2379
2365
  onCacheEvict(_id) {}
2380
2366
  async getStorageAdapter() {
@@ -2441,8 +2427,7 @@ var EditorSkillNamespace = class extends CrudEditorNamespace {
2441
2427
  return resolved;
2442
2428
  }
2443
2429
  };
2444
- //#endregion
2445
- //#region src/namespaces/favorites.ts
2430
+ // src/namespaces/favorites.ts
2446
2431
  /**
2447
2432
  * Favorites namespace.
2448
2433
  *
@@ -2500,8 +2485,7 @@ var EditorFavoritesNamespace = class extends EditorNamespace {
2500
2485
  return store;
2501
2486
  }
2502
2487
  };
2503
- //#endregion
2504
- //#region src/providers.ts
2488
+ // src/providers.ts
2505
2489
  const localFilesystemProvider = {
2506
2490
  id: "local",
2507
2491
  name: "Local Filesystem",
@@ -2562,8 +2546,7 @@ const localSandboxProvider = {
2562
2546
  },
2563
2547
  createSandbox: (config) => new _mastra_core_workspace.LocalSandbox(config)
2564
2548
  };
2565
- //#endregion
2566
- //#region src/snapshots-match.ts
2549
+ // src/snapshots-match.ts
2567
2550
  /**
2568
2551
  * Compare a resolved workspace's config fields against a runtime snapshot.
2569
2552
  * Returns true if all snapshot config fields match.
@@ -2591,8 +2574,7 @@ function snapshotsMatch(stored, runtime) {
2591
2574
  }
2592
2575
  return true;
2593
2576
  }
2594
- //#endregion
2595
- //#region src/index.ts
2577
+ // src/index.ts
2596
2578
  var MastraEditor = class {
2597
2579
  constructor(config) {
2598
2580
  this.__builderResolved = false;
@@ -2877,7 +2859,6 @@ Learn more: https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE`);
2877
2859
  return blobStore;
2878
2860
  }
2879
2861
  };
2880
- //#endregion
2881
2862
  exports.CrudEditorNamespace = CrudEditorNamespace;
2882
2863
  exports.EditorAgentNamespace = EditorAgentNamespace;
2883
2864
  exports.EditorFavoritesNamespace = EditorFavoritesNamespace;