@deepagents/experimental 7.1.0 → 7.1.1

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
@@ -3666,6 +3666,7 @@ var ApprovalController = class _ApprovalController {
3666
3666
  };
3667
3667
 
3668
3668
  // packages/experimental/src/zukhruf/runtime/conversation-status/projector.ts
3669
+ import { MemoryStore, Mutex } from "@zukhruf/mutex";
3669
3670
  import { EventEmitter, on } from "node:events";
3670
3671
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
3671
3672
  import {
@@ -3706,7 +3707,7 @@ var ConversationStatusProjector = class _ConversationStatusProjector {
3706
3707
  #changeSource;
3707
3708
  #emitter = new EventEmitter();
3708
3709
  #last = /* @__PURE__ */ new Map();
3709
- #publishing = /* @__PURE__ */ new Map();
3710
+ #publishing = new Mutex(new MemoryStore());
3710
3711
  #subscribers = 0;
3711
3712
  #remote;
3712
3713
  constructor(options) {
@@ -3843,13 +3844,7 @@ var ConversationStatusProjector = class _ConversationStatusProjector {
3843
3844
  }
3844
3845
  #serialize(conversation, step) {
3845
3846
  const key = _ConversationStatusProjector.#key(conversation);
3846
- const previous = this.#publishing.get(key) ?? Promise.resolve();
3847
- const next = previous.then(() => step(key));
3848
- this.#publishing.set(key, next);
3849
- void next.finally(() => {
3850
- if (this.#publishing.get(key) === next) this.#publishing.delete(key);
3851
- });
3852
- return next;
3847
+ return this.#publishing.acquire(key, () => step(key));
3853
3848
  }
3854
3849
  async #project(conversation, key) {
3855
3850
  let change;