@modelstudio/modelstudio-memory-for-openclaw 1.0.3 → 1.0.5

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/index.ts CHANGED
@@ -78,6 +78,7 @@ const ALLOWED_KEYS = [
78
78
  "captureMaxMessages",
79
79
  "recallMinPromptLength",
80
80
  "recallCacheTtlMs",
81
+ "enabled",
81
82
  ];
82
83
 
83
84
  function assertAllowedKeys(
@@ -92,10 +93,14 @@ function assertAllowedKeys(
92
93
 
93
94
  const modelstudioMemoryConfigSchema = {
94
95
  parse(value: unknown): BailianMemoryConfig {
95
- if (!value || typeof value !== "object" || Array.isArray(value)) {
96
- throw new Error("modelstudio-memory-for-openclaw config required");
97
- }
98
- const cfg = value as Record<string, unknown>;
96
+ let raw =
97
+ value && typeof value === "object" && !Array.isArray(value)
98
+ ? (value as Record<string, unknown>)
99
+ : {};
100
+ const cfg =
101
+ "config" in raw && raw.config && typeof raw.config === "object" && !Array.isArray(raw.config)
102
+ ? (raw.config as Record<string, unknown>)
103
+ : raw;
99
104
  assertAllowedKeys(cfg, ALLOWED_KEYS, "modelstudio-memory-for-openclaw config");
100
105
 
101
106
  // apiKey: allow empty at parse time; tools return config prompt when missing
@@ -726,7 +731,7 @@ const modelstudioMemoryPlugin = {
726
731
  if (!cfg.apiKey) {
727
732
  return {
728
733
  prependSystemContext:
729
- "Note: Memory plugin is not configured (apiKey missing). Long-term memory is disabled. Ask the user to add apiKey to ~/.openclaw/openclaw.json under plugins.entries.modelstudio-memory-for-openclaw.config and restart the gateway.",
734
+ "IMPORTANT: The memory plugin (modelstudio-memory-for-openclaw) is NOT configured. apiKey is required. Long-term memory is completely disabled until configured. You MUST proactively inform the user: add apiKey to ~/.openclaw/openclaw.json under plugins.entries.modelstudio-memory-for-openclaw.config, then restart the gateway. Get API Key: https://help.aliyun.com/zh/model-studio/get-api-key",
730
735
  };
731
736
  }
732
737
  const prompt = extractTextContent(event.prompt);
@@ -3,7 +3,7 @@
3
3
  "name": "modelstudio-memory-for-openclaw",
4
4
  "description": "阿里云百炼长期记忆服务,提供自动记忆捕获和召回能力",
5
5
  "kind": "memory",
6
- "version": "1.0.3",
6
+ "version": "1.0.5",
7
7
  "configSchema": {
8
8
  "type": "object",
9
9
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelstudio/modelstudio-memory-for-openclaw",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "阿里云百炼长期记忆服务 OpenClaw 插件",
6
6
  "license": "Apache-2.0",