@joshuaswarren/openclaw-engram 8.3.15 → 8.3.17

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
@@ -51,6 +51,7 @@ function normalizeOpenaiBaseUrl(value, source) {
51
51
  }
52
52
  var VALID_EFFORTS = ["none", "low", "medium", "high"];
53
53
  var VALID_TRIGGERS = ["smart", "every_n", "time_based"];
54
+ var VALID_IDENTITY_INJECTION_MODES = ["recovery_only", "minimal", "full"];
54
55
  var VALID_MEMORY_CATEGORIES = /* @__PURE__ */ new Set([
55
56
  "fact",
56
57
  "preference",
@@ -77,6 +78,9 @@ function parseConfig(raw) {
77
78
  const rawTrigger = cfg.triggerMode;
78
79
  const triggerMode = rawTrigger && VALID_TRIGGERS.includes(rawTrigger) ? rawTrigger : "smart";
79
80
  const memoryDir = typeof cfg.memoryDir === "string" && cfg.memoryDir.length > 0 ? cfg.memoryDir : DEFAULT_MEMORY_DIR;
81
+ const rawIdentityInjectionMode = cfg.identityInjectionMode;
82
+ const identityInjectionMode = rawIdentityInjectionMode && VALID_IDENTITY_INJECTION_MODES.includes(rawIdentityInjectionMode) ? rawIdentityInjectionMode : "recovery_only";
83
+ const identityContinuityEnabled = cfg.identityContinuityEnabled === true;
80
84
  const principalRules = Array.isArray(cfg.principalFromSessionKeyRules) ? cfg.principalFromSessionKeyRules.map((r) => ({
81
85
  match: typeof r?.match === "string" ? r.match : "",
82
86
  principal: typeof r?.principal === "string" ? r.principal : ""
@@ -129,6 +133,11 @@ function parseConfig(raw) {
129
133
  memoryDir,
130
134
  debug: cfg.debug === true,
131
135
  identityEnabled: cfg.identityEnabled !== false,
136
+ identityContinuityEnabled,
137
+ identityInjectionMode,
138
+ identityMaxInjectChars: typeof cfg.identityMaxInjectChars === "number" ? Math.max(0, Math.floor(cfg.identityMaxInjectChars)) : 1200,
139
+ continuityIncidentLoggingEnabled: typeof cfg.continuityIncidentLoggingEnabled === "boolean" ? cfg.continuityIncidentLoggingEnabled : identityContinuityEnabled,
140
+ continuityAuditEnabled: cfg.continuityAuditEnabled === true,
132
141
  injectQuestions: cfg.injectQuestions === true,
133
142
  commitmentDecayDays: typeof cfg.commitmentDecayDays === "number" ? cfg.commitmentDecayDays : 90,
134
143
  workspaceDir: typeof cfg.workspaceDir === "string" && cfg.workspaceDir.length > 0 ? cfg.workspaceDir : DEFAULT_WORKSPACE_DIR,