xiaozuoassistant 0.1.67 → 0.1.68

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.
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍇</text></svg>" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>xiaozuoAssistant</title>
8
- <script type="module" crossorigin src="/assets/index-o23m3BxJ.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-zJd3h_35.css">
8
+ <script type="module" crossorigin src="/assets/index-nFPB_0LE.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-B5Qw98nG.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
@@ -318,6 +318,30 @@ app.post('/api/user/profile', async (req, res) => {
318
318
  res.status(500).json({ error: String(e?.message || e) });
319
319
  }
320
320
  });
321
+ // 手动触发记忆归档
322
+ app.post('/api/sessions/:id/archive', async (req, res) => {
323
+ try {
324
+ const sessionId = req.params.id;
325
+ const session = await memory.getSession(sessionId);
326
+ if (!session) {
327
+ res.status(404).json({ error: 'Session not found' });
328
+ return;
329
+ }
330
+ // 强制触发一次归档逻辑,忽略时间间隔检查
331
+ // 我们复用 MemoryManager 的 runSessionArchiving,但需要它支持指定 session
332
+ // 或者我们在这里手动调用类似的逻辑,为了复用,建议在 MemoryManager 中公开一个 archiveSession 方法
333
+ // 由于 MemoryManager.runSessionArchiving 是批量处理,我们暂时修改 MemoryManager 来支持单个 Session 归档
334
+ // 或者简单地,我们在 index.ts 里调用 memory.runSessionArchiving(),它会扫描所有 session,
335
+ // 但为了强制归档,我们需要重置 lastArchivedAt 为 0 (或者很久以前)
336
+ // 方案:先更新 lastArchivedAt 为 0,然后调用 runSessionArchiving
337
+ await memory.updateSessionMeta(sessionId, { lastArchivedAt: 0 });
338
+ await memory.runSessionArchiving();
339
+ res.json({ status: 'success', message: 'Session archived successfully.' });
340
+ }
341
+ catch (e) {
342
+ res.status(500).json({ status: 'error', message: e.message });
343
+ }
344
+ });
321
345
  // 手动触发记忆维护
322
346
  app.post('/api/scheduler/run', async (req, res) => {
323
347
  try {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "xiaozuoassistant",
3
3
  "private": false,
4
4
  "description": "Your personal, locally-hosted AI assistant for office productivity.",
5
- "version": "0.1.67",
5
+ "version": "0.1.68",
6
6
  "author": "mantle.lau",
7
7
  "license": "MIT",
8
8
  "repository": {