dsh-mnemon 0.5.31 → 0.5.33

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/lib/contracts.js CHANGED
@@ -4,6 +4,8 @@ const MEMORY_PLUGIN_API_VERSION = "dsh-mnemon/plugin/v1";
4
4
  //#endregion
5
5
  //#region src/core/contracts/view.ts
6
6
  const COMPOSABLE_MEMORY_API_VERSION = "dsh-mnemon/v1";
7
+ /** Background work a Host runs for the turns of a Strategy that declares it. */
8
+ const MEMORY_STRATEGY_WORKFLOWS = ["idle-review", "runtime-capacity"];
7
9
  /** Extension target for every selected Strategy that declares the extension's standard slot. */
8
10
  const ANY_MEMORY_STRATEGY = "*";
9
11
  /** Strategy role list entry for a role-agnostic Strategy that may select any Source. */
@@ -42,4 +44,4 @@ const MEMORY_CAPABILITIES = [
42
44
  ];
43
45
  const MEMORY_SOURCE_MODES = ["eager", "routed"];
44
46
  //#endregion
45
- export { ANY_MEMORY_SOURCE_ROLE, ANY_MEMORY_STRATEGY, COMPOSABLE_MEMORY_API_VERSION, DEFAULT_MEMORY_VIEW_BUDGET, MEMORY_CAPABILITIES, MEMORY_PLUGIN_API_VERSION, MEMORY_SOURCE_MODES, MEMORY_VIEW_EXTENSION_SLOTS };
47
+ export { ANY_MEMORY_SOURCE_ROLE, ANY_MEMORY_STRATEGY, COMPOSABLE_MEMORY_API_VERSION, DEFAULT_MEMORY_VIEW_BUDGET, MEMORY_CAPABILITIES, MEMORY_PLUGIN_API_VERSION, MEMORY_SOURCE_MODES, MEMORY_STRATEGY_WORKFLOWS, MEMORY_VIEW_EXTENSION_SLOTS };
package/lib/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as provideMemoryRuntime } from "./runtime-Bk6lFgxd.js";
1
+ import { t as provideMemoryRuntime } from "./runtime-zuuBe8x1.js";
2
2
  //#region src/core/plugin.ts
3
3
  const name = "dsh-mnemon-core";
4
4
  const provide = ["mnemonMemory"];
@@ -225,6 +225,7 @@ function defineMemoryStrategy(definition) {
225
225
  if (manifest.deterministic !== true) throw new Error("memory Strategy must declare deterministic: true");
226
226
  if (typeof definition.compose !== "function") throw new Error(`memory Strategy compose() is required: ${typeId}`);
227
227
  if (definition.createTurn !== void 0 && typeof definition.createTurn !== "function") throw new Error("memory Strategy createTurn must be a function");
228
+ if (manifest.workflows !== void 0 && !Array.isArray(manifest.workflows)) throw new Error("memory Strategy workflows must be a list");
228
229
  const normalizedManifest = jsonClone({
229
230
  ...manifest,
230
231
  typeId,
@@ -233,7 +234,8 @@ function defineMemoryStrategy(definition) {
233
234
  maxSources: positiveInteger(manifest.maxSources, "memory Strategy maxSources", 1e3),
234
235
  maxRoutes: positiveInteger(manifest.maxRoutes, "memory Strategy maxRoutes", 1e3),
235
236
  maxActions: positiveInteger(manifest.maxActions, "memory Strategy maxActions", 1e3),
236
- ...manifest.extensionSlots === void 0 ? {} : { extensionSlots: uniqueIds(manifest.extensionSlots, "memory Strategy extension slot") }
237
+ ...manifest.extensionSlots === void 0 ? {} : { extensionSlots: uniqueIds(manifest.extensionSlots, "memory Strategy extension slot") },
238
+ ...manifest.workflows === void 0 ? {} : { workflows: uniqueIds(manifest.workflows, "memory Strategy workflow") }
237
239
  }, "memory Strategy manifest");
238
240
  return Object.freeze({
239
241
  manifest: normalizedManifest,
@@ -1,6 +1,6 @@
1
- import { a as memoryConfigurationDigest, c as record, d as truncate, f as withMemoryStorageLock, i as integer, l as stringArray, o as migrationLineage, s as receipt, t as defineMemoryStrategyConfiguration, u as text } from "./strategy-configuration-sVkKToSW.js";
1
+ import { a as memoryConfigurationDigest, c as record, d as truncate, f as withMemoryStorageLock, i as integer, l as stringArray, o as migrationLineage, s as receipt, t as defineMemoryStrategyConfiguration, u as text } from "./strategy-configuration-CLHxaPOb.js";
2
2
  import { COMPOSABLE_MEMORY_API_VERSION, MEMORY_VIEW_EXTENSION_SLOTS } from "./contracts.js";
3
- import { a as defineMemoryStrategy, i as defineMemorySource, o as defineMemoryStrategyExtension, r as defineMemoryPlugin } from "./definitions-j9QPbrXb.js";
3
+ import { a as defineMemoryStrategy, i as defineMemorySource, o as defineMemoryStrategyExtension, r as defineMemoryPlugin } from "./definitions-DU7MLBhu.js";
4
4
  //#region src/sdk/install.ts
5
5
  function locatedEntryId(ctx) {
6
6
  const located = ctx.get("loader", false)?.locate(ctx.fiber)?.trim();