@t0ken.ai/memoryx-openclaw-plugin 2.2.9 → 2.2.11

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.d.ts CHANGED
@@ -58,9 +58,8 @@ declare class MemoryXPlugin {
58
58
  list(limit?: number): Promise<any[]>;
59
59
  getAccountInfo(): Promise<{
60
60
  apiKey: string | null;
61
- projectId: string;
62
- userId: string | null;
63
- apiBaseUrl: string;
61
+ agentId: string | null;
62
+ agentType: string | null;
64
63
  initialized: boolean;
65
64
  quota?: any;
66
65
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA4CH,UAAU,YAAY;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,YAAY;IAClB,QAAQ,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,eAAe,EAAE,KAAK,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AA4CD,cAAM,aAAa;IACf,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,WAAW,CAAkB;gBAEzB,YAAY,CAAC,EAAE,YAAY;IAIjC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAad,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO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ugin {
224
224
  try {
225
225
  const sdk = await getSDK(this.pluginConfig);
226
226
  const info = await sdk.getAccountInfo();
227
+ const agentType = sdk.getAgentType();
227
228
  return {
228
229
  apiKey: info.apiKey,
229
- projectId: info.projectId,
230
- userId: info.userId,
231
- apiBaseUrl: info.apiBaseUrl,
230
+ agentId: info.agentId,
231
+ agentType: agentType,
232
232
  initialized: info.initialized,
233
233
  quota: info.quota
234
234
  };
@@ -236,9 +236,8 @@ class MemoryXPlugin {
236
236
  catch (e) {
237
237
  return {
238
238
  apiKey: null,
239
- projectId: "default",
240
- userId: null,
241
- apiBaseUrl: DEFAULT_API_BASE,
239
+ agentId: null,
240
+ agentType: null,
242
241
  initialized: false
243
242
  };
244
243
  }
@@ -496,31 +495,38 @@ export default {
496
495
  };
497
496
  }
498
497
  const lines = [
499
- "📊 MemoryX Account Information:",
500
- `API Key: ${accountInfo.apiKey || 'Not set'}`,
501
- `Project ID: ${accountInfo.projectId || 'default'}`,
502
- `User ID: ${accountInfo.userId || 'Not set'}`,
503
- `API Base URL: ${accountInfo.apiBaseUrl || DEFAULT_API_BASE}`,
504
- `Initialized: ${accountInfo.initialized ? 'Yes' : 'No'}`
498
+ "📊 MemoryX 账户信息:",
499
+ `API Key: ${accountInfo.apiKey || '未设置'}`,
500
+ `Agent ID: ${accountInfo.agentId || '未设置'}`,
501
+ `Agent Type: ${accountInfo.agentType || '未设置'}`,
502
+ `状态: ${accountInfo.initialized ? '✅ 已初始化' : '❌ 未初始化'}`
505
503
  ];
504
+ // 显示 quota 信息(搜索次数)
505
+ if (accountInfo.quota) {
506
+ const quota = accountInfo.quota;
507
+ if (quota.search_count !== undefined) {
508
+ const limit = quota.search_limit || '无限制';
509
+ lines.push(`搜索次数: ${quota.search_count}/${limit}`);
510
+ }
511
+ }
506
512
  if (accountInfo.apiKey) {
507
513
  lines.push("");
508
- lines.push("💡 Visit the portal to claim your agent and manage memories:");
514
+ lines.push("💡 访问 Portal 管理你的记忆:");
509
515
  lines.push(` https://t0ken.ai/portal?api_key=${accountInfo.apiKey}`);
510
516
  }
511
517
  return {
512
518
  content: [{ type: "text", text: lines.join("\n") }],
513
519
  details: {
514
520
  apiKey: accountInfo.apiKey,
515
- projectId: accountInfo.projectId,
516
- userId: accountInfo.userId,
517
- apiBaseUrl: accountInfo.apiBaseUrl
521
+ agentId: accountInfo.agentId,
522
+ agentType: accountInfo.agentType,
523
+ quota: accountInfo.quota
518
524
  }
519
525
  };
520
526
  }
521
527
  catch (error) {
522
528
  return {
523
- content: [{ type: "text", text: `Failed to get account info: ${error.message}` }],
529
+ content: [{ type: "text", text: `获取账户信息失败: ${error.message}` }],
524
530
  details: { error: error.message }
525
531
  };
526
532
  }
@@ -547,24 +553,25 @@ export default {
547
553
  if (result.isLimited) {
548
554
  api.logger.warn(`[MemoryX] ${result.upgradeHint}`);
549
555
  return {
550
- prependContext: `[System] ${result.upgradeHint}\n`
556
+ systemPrompt: `[MemoryX] ${result.upgradeHint}`
551
557
  };
552
558
  }
553
559
  if (result.memories.length === 0 && result.relatedMemories.length === 0)
554
560
  return;
555
- let context = "MemoryX by t0ken.ai found the following memories:\n";
561
+ // 使用 systemPrompt 而不是 prependContext
562
+ // systemPrompt 不会显示在用户聊天内容中
563
+ let context = "[MemoryX] Relevant memories from past conversations:\n";
556
564
  if (result.memories.length > 0) {
557
- context += "\n[Direct Memories]\n";
558
565
  context += result.memories.map(m => `- ${m.content}`).join("\n");
559
566
  }
560
567
  if (result.relatedMemories.length > 0) {
561
- context += "\n\n[Related Memories]\n";
568
+ if (result.memories.length > 0)
569
+ context += "\n";
562
570
  context += result.relatedMemories.map(m => `- ${m.content}`).join("\n");
563
571
  }
564
- context += "\n";
565
- api.logger.info(`[MemoryX] Recalled ${result.memories.length} direct + ${result.relatedMemories.length} related memories`);
572
+ api.logger.info(`[MemoryX] Injected ${result.memories.length} direct + ${result.relatedMemories.length} related memories into system prompt`);
566
573
  return {
567
- prependContext: context
574
+ systemPrompt: context
568
575
  };
569
576
  }
570
577
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t0ken.ai/memoryx-openclaw-plugin",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "description": "MemoryX real-time memory capture and recall plugin for OpenClaw (powered by @t0ken.ai/memoryx-sdk)",
5
5
  "type": "module",
6
6
  "author": "MemoryX Team",