@moxt-ai/mobius 0.0.363 → 0.0.365

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.
Files changed (38) hide show
  1. package/dist/{chunk-DXA4UBI6.js → chunk-CIFHYTEO.js} +28 -8
  2. package/dist/{chunk-DXA4UBI6.js.map → chunk-CIFHYTEO.js.map} +2 -2
  3. package/dist/{chunk-DPKJ73U5.js → chunk-N7ZIXRER.js} +2 -4
  4. package/dist/{chunk-DPKJ73U5.js.map → chunk-N7ZIXRER.js.map} +2 -2
  5. package/dist/{chunk-ZW36FH6L.js → chunk-OLZ2M2YY.js} +2 -2
  6. package/dist/cli/handler/daemon/index.d.ts.map +1 -1
  7. package/dist/cli/handler/daemon/index.js +2 -0
  8. package/dist/cli/handler/daemon/index.js.map +1 -1
  9. package/dist/cli/handler/daemon/release.d.ts +4 -0
  10. package/dist/cli/handler/daemon/release.d.ts.map +1 -0
  11. package/dist/cli/handler/daemon/release.js +13 -0
  12. package/dist/cli/handler/daemon/release.js.map +1 -0
  13. package/dist/{cli-VFDSSFNB.js → cli-OOWFDWWI.js} +48 -4
  14. package/dist/{cli-VFDSSFNB.js.map → cli-OOWFDWWI.js.map} +4 -4
  15. package/dist/cli.js +3 -3
  16. package/dist/daemon/lifecycle/worker.d.ts +2 -0
  17. package/dist/daemon/lifecycle/worker.d.ts.map +1 -1
  18. package/dist/daemon/lifecycle/worker.js +26 -0
  19. package/dist/daemon/lifecycle/worker.js.map +1 -1
  20. package/dist/engine/runtime/run.d.ts +3 -0
  21. package/dist/engine/runtime/run.d.ts.map +1 -1
  22. package/dist/engine/runtime/run.js +2 -0
  23. package/dist/engine/runtime/run.js.map +1 -1
  24. package/dist/engine/runtime/runtime-loop.d.ts +2 -0
  25. package/dist/engine/runtime/runtime-loop.d.ts.map +1 -1
  26. package/dist/engine/runtime/runtime-loop.js +1 -0
  27. package/dist/engine/runtime/runtime-loop.js.map +1 -1
  28. package/dist/engine/session/process/agent-process-pool.d.ts +5 -0
  29. package/dist/engine/session/process/agent-process-pool.d.ts.map +1 -1
  30. package/dist/engine/session/process/agent-process-pool.js +27 -10
  31. package/dist/engine/session/process/agent-process-pool.js.map +1 -1
  32. package/dist/engine/session/process/runtime-agent-processes.d.ts +9 -0
  33. package/dist/engine/session/process/runtime-agent-processes.d.ts.map +1 -0
  34. package/dist/engine/session/process/runtime-agent-processes.js +15 -0
  35. package/dist/engine/session/process/runtime-agent-processes.js.map +1 -0
  36. package/dist/engine.js +2 -2
  37. package/package.json +2 -4
  38. /package/dist/{chunk-ZW36FH6L.js.map → chunk-OLZ2M2YY.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  __export,
4
4
  __using,
5
5
  package_default
6
- } from "./chunk-DPKJ73U5.js";
6
+ } from "./chunk-N7ZIXRER.js";
7
7
 
8
8
  // src/engine/runtime/relay/runtime-revocation.ts
9
9
  var runtimeRevocationCloseCode = 1008;
@@ -89743,15 +89743,32 @@ var AgentProcessPool = class {
89743
89743
  return;
89744
89744
  }
89745
89745
  this.#idleTimeouts.delete(id);
89746
- if (this.#stopping || this.#slots.get(id) !== slot || slot.retention.isBusy()) {
89747
- return;
89748
- }
89749
- const retirement = slot.retention.retireIdle();
89750
- this.#idleRetirements.add(retirement);
89751
- void retirement.catch((error62) => console.error("The idle Agent process could not be released", error62)).finally(() => this.#idleRetirements.delete(retirement));
89746
+ void this.#retireIdle(id, slot);
89752
89747
  }, ACP_PROCESS_IDLE_TIMEOUT_MILLISECONDS);
89753
89748
  this.#idleTimeouts.set(id, timeout);
89754
89749
  };
89750
+ #retireIdle = async (id, slot) => {
89751
+ if (this.#stopping || this.#slots.get(id) !== slot || slot.kind !== "retained" || slot.retention.isBusy()) {
89752
+ return;
89753
+ }
89754
+ this.#cancelIdleTimeout(id);
89755
+ const retirement = slot.retention.retireIdle();
89756
+ this.#idleRetirements.add(retirement);
89757
+ try {
89758
+ await retirement;
89759
+ } catch (error62) {
89760
+ console.error("The idle Agent process could not be released", error62);
89761
+ } finally {
89762
+ this.#idleRetirements.delete(retirement);
89763
+ }
89764
+ };
89765
+ /**
89766
+ * Releases every retained process that is not working now, as its idle deadline would.
89767
+ * Native clients, such as an Agent's own terminal, can then take over their conversations.
89768
+ */
89769
+ retireIdleProcesses = async () => {
89770
+ await Promise.all([...this.#slots].map(async ([id, slot]) => await this.#retireIdle(id, slot)));
89771
+ };
89755
89772
  /** Stop scheduling before Runtime shutdown and drain teardowns already in flight. */
89756
89773
  stopIdleReclamation = async () => {
89757
89774
  this.#stopping = true;
@@ -93072,6 +93089,7 @@ async function runRuntime(config2, parentSignal, timer = systemTimer, options =
93072
93089
  catalogPublished = true;
93073
93090
  announceReadiness();
93074
93091
  });
93092
+ const removeAgentProcesses = options.agentProcesses?.add(processes);
93075
93093
  try {
93076
93094
  while (!signal.aborted) {
93077
93095
  connectionEpoch += 1;
@@ -93113,6 +93131,7 @@ async function runRuntime(config2, parentSignal, timer = systemTimer, options =
93113
93131
  await waitForRelayRetry(signal, timer);
93114
93132
  }
93115
93133
  } finally {
93134
+ removeAgentProcesses?.();
93116
93135
  shutdown.abort();
93117
93136
  operations.beginShutdown();
93118
93137
  await activeSessions.close();
@@ -93246,6 +93265,7 @@ var RuntimeLoop = class {
93246
93265
  this.#state = { kind: "running", config: config2 };
93247
93266
  await runRuntime(config2, signal, void 0, {
93248
93267
  ...this.#options.turnActivity === void 0 ? {} : { turnActivity: this.#options.turnActivity },
93268
+ ...this.#options.agentProcesses === void 0 ? {} : { agentProcesses: this.#options.agentProcesses },
93249
93269
  onExecutionCountChange: (count) => {
93250
93270
  this.#options.onExecutionCountChange?.(count);
93251
93271
  },
@@ -93389,4 +93409,4 @@ export {
93389
93409
  * MIT Licensed
93390
93410
  *)
93391
93411
  */
93392
- //# sourceMappingURL=chunk-DXA4UBI6.js.map
93412
+ //# sourceMappingURL=chunk-CIFHYTEO.js.map