@mastra/server 0.16.0 → 0.16.1-alpha.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 0.16.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`0662d02`](https://github.com/mastra-ai/mastra/commit/0662d02ef16916e67531890639fcd72c69cfb6e2), [`6189844`](https://github.com/mastra-ai/mastra/commit/61898448e65bda02bb814fb15801a89dc6476938), [`d7a8f59`](https://github.com/mastra-ai/mastra/commit/d7a8f59154b0621aec4f41a6b2ea2b3882f03cb7), [`4dda259`](https://github.com/mastra-ai/mastra/commit/4dda2593b6343f9258671de5fb237aeba3ef6bb7), [`defed1c`](https://github.com/mastra-ai/mastra/commit/defed1ca8040cc8d42e645c5a50a1bc52a4918d7), [`6991ced`](https://github.com/mastra-ai/mastra/commit/6991cedcb5a44a49d9fe58ef67926e1f96ba55b1), [`9cb9c42`](https://github.com/mastra-ai/mastra/commit/9cb9c422854ee81074989dd2d8dccc0500ba8d3e), [`8334859`](https://github.com/mastra-ai/mastra/commit/83348594d4f37b311ba4a94d679c5f8721d796d4)]:
8
+ - @mastra/core@0.16.1-alpha.0
9
+
3
10
  ## 0.16.0
4
11
 
5
12
  ### Minor Changes
@@ -8505,12 +8505,13 @@ var Memory = class extends MastraMemory {
8505
8505
  });
8506
8506
  this.threadConfig = mergedConfig;
8507
8507
  }
8508
- async validateThreadIsOwnedByResource(threadId, resourceId) {
8508
+ async validateThreadIsOwnedByResource(threadId, resourceId, config) {
8509
+ const resourceScope = typeof config?.semanticRecall === "object" && config?.semanticRecall?.scope === "resource";
8509
8510
  const thread = await this.storage.getThreadById({ threadId });
8510
- if (!thread) {
8511
+ if (!thread && !resourceScope) {
8511
8512
  throw new Error(`No thread found with id ${threadId}`);
8512
8513
  }
8513
- if (thread.resourceId !== resourceId) {
8514
+ if (thread && thread.resourceId !== resourceId) {
8514
8515
  throw new Error(
8515
8516
  `Thread with id ${threadId} is for resource with id ${thread.resourceId} but resource ${resourceId} was queried.`
8516
8517
  );
@@ -8534,14 +8535,14 @@ var Memory = class extends MastraMemory {
8534
8535
  selectBy,
8535
8536
  threadConfig
8536
8537
  }) {
8537
- if (resourceId) await this.validateThreadIsOwnedByResource(threadId, resourceId);
8538
+ const config = this.getMergedThreadConfig(threadConfig || {});
8539
+ if (resourceId) await this.validateThreadIsOwnedByResource(threadId, resourceId, config);
8538
8540
  const vectorResults = [];
8539
8541
  this.logger.debug(`Memory query() with:`, {
8540
8542
  threadId,
8541
8543
  selectBy,
8542
8544
  threadConfig
8543
8545
  });
8544
- const config = this.getMergedThreadConfig(threadConfig || {});
8545
8546
  this.checkStorageFeatureSupport(config);
8546
8547
  const defaultRange = DEFAULT_MESSAGE_RANGE;
8547
8548
  const defaultTopK = DEFAULT_TOP_K;
@@ -8640,8 +8641,8 @@ var Memory = class extends MastraMemory {
8640
8641
  vectorMessageSearch,
8641
8642
  config
8642
8643
  }) {
8643
- if (resourceId) await this.validateThreadIsOwnedByResource(threadId, resourceId);
8644
8644
  const threadConfig = this.getMergedThreadConfig(config || {});
8645
+ if (resourceId) await this.validateThreadIsOwnedByResource(threadId, resourceId, threadConfig);
8645
8646
  if (!threadConfig.lastMessages && !threadConfig.semanticRecall) {
8646
8647
  return {
8647
8648
  messages: [],
@@ -15666,5 +15667,5 @@ var sendAgentBuilderActionRunEventHandler = createAgentBuilderWorkflowHandler(
15666
15667
  );
15667
15668
 
15668
15669
  export { agent_builder_exports, cancelAgentBuilderActionRunHandler, createAgentBuilderActionRunHandler, getAgentBuilderActionByIdHandler, getAgentBuilderActionRunByIdHandler, getAgentBuilderActionRunExecutionResultHandler, getAgentBuilderActionRunsHandler, getAgentBuilderActionsHandler, resumeAgentBuilderActionHandler, resumeAsyncAgentBuilderActionHandler, sendAgentBuilderActionRunEventHandler, startAgentBuilderActionRunHandler, startAsyncAgentBuilderActionHandler, streamAgentBuilderActionHandler, streamVNextAgentBuilderActionHandler, watchAgentBuilderActionHandler };
15669
- //# sourceMappingURL=chunk-SADDGXIU.js.map
15670
- //# sourceMappingURL=chunk-SADDGXIU.js.map
15670
+ //# sourceMappingURL=chunk-6WSUBX7H.js.map
15671
+ //# sourceMappingURL=chunk-6WSUBX7H.js.map