chatluna-plugin-livingmemory 0.0.8 → 0.0.10

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # chatluna-plugin-livingmemory
2
2
 
3
- ChatLuna v2 的长期记忆插件,支持记忆提取与召回、Dream 整理、用户画像和预设人设卡片。可单独使用;与原生 memory 同时启用时,两者各自提取、保存和注入记忆。
3
+ LivingSystem 生态下构筑的长期记忆插件,让 bot 的记忆带上生动的人格化色彩。通过异步、非阻塞的记忆召回和记忆整理流程让 bot 记叙共度的时光。
4
+
5
+ LivingMemory 不建议与原生 memory 同时启用,两者各自提取、保存和注入记忆,可能会导致额外的 token 开销与其他未知问题。
4
6
 
5
7
  ## 构建
6
8
 
@@ -12,6 +14,8 @@ ChatLuna v2 的长期记忆插件,支持记忆提取与召回、Dream 整理
12
14
  yarn build
13
15
  ```
14
16
 
17
+ 开发 WebUI 时,在插件目录运行 `yarn dev` 并保持运行,另开终端在模板项目根目录运行 `yarn start`。保存 `client/` 下的改动后,已打开的 LivingMemory 页面会自动更新。首次使用前先执行一次 `yarn build`;修改服务端或 Worker 后仍需重新构建并重启实例。
18
+
15
19
  ## 配套服务
16
20
 
17
21
  必需服务:
package/client/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Context } from 'cordis'
2
+ import './page.css'
2
3
  import zh from './locales/zh.yml'
3
4
  import en from './locales/en.yml'
4
5
  import type {} from '../src/contracts/webui_live.ts'
@@ -79,10 +79,14 @@ jobs.dreamRunning: 'Dream is already running for “{preset}”'
79
79
  jobs.dreamInsufficient: 'Not enough memories in “{preset}” to run Dream'
80
80
  jobs.rebuildIndex: Rebuild vector index
81
81
  jobs.empty: No jobs recorded yet
82
- job.kind.extract: Extract
82
+ jobs.startedAt: Started
83
+ jobs.finishedAt: Finished
84
+ jobs.id: Job ID
85
+ jobs.detail: View original record
86
+ job.kind.extract: Memory extraction
83
87
  job.kind.dream: Dream
84
- job.kind.recall: Recall
85
- job.kind.index: Index
88
+ job.kind.recall: Memory recall
89
+ job.kind.index: Index maintenance
86
90
  job.status.pending: Pending
87
91
  job.status.running: Running
88
92
  job.status.completed: Completed
@@ -106,6 +110,13 @@ tab.profiles: Profiles
106
110
  tab.snapshots: Snapshots
107
111
 
108
112
  profiles.empty: No user profile has been generated for this preset
113
+ profiles.directory: User directory
114
+ profiles.linkedMemories: Linked memories
115
+ profiles.search: Search by name or user ID
116
+ profiles.clearSearch: Clear search
117
+ profiles.noMatch: No matching users
118
+ profiles.noMemories: This profile has no linked memories.
119
+ profiles.unavailableMemories: 'Linked memories no longer available: {count}.'
109
120
  profiles.hint: The profile is distilled from linked memories; once saved it is no longer overwritten automatically.
110
121
  profiles.sourceCount: '{count} linked memories'
111
122
  profiles.regenerate: Regenerate
@@ -119,10 +119,14 @@ jobs.dreamRunning: 「{preset}」已有 Dream 在运行
119
119
  jobs.dreamInsufficient: 「{preset}」可整理的记忆不足
120
120
  jobs.rebuildIndex: 重建向量索引
121
121
  jobs.empty: 还没有任务记录
122
- job.kind.extract: 提取
123
- job.kind.dream: Dream
124
- job.kind.recall: 召回
125
- job.kind.index: 索引
122
+ jobs.startedAt: 开始
123
+ jobs.finishedAt: 结束
124
+ jobs.id: 任务 ID
125
+ jobs.detail: 查看原始记录
126
+ job.kind.extract: 记忆提取
127
+ job.kind.dream: Dream 整理
128
+ job.kind.recall: 记忆召回
129
+ job.kind.index: 索引维护
126
130
  job.status.pending: 排队中
127
131
  job.status.running: 运行中
128
132
  job.status.completed: 已完成
@@ -146,6 +150,13 @@ tab.profiles: 用户画像
146
150
  tab.snapshots: 快照
147
151
 
148
152
  profiles.empty: 还没有为这个预设生成过用户画像
153
+ profiles.directory: 用户目录
154
+ profiles.linkedMemories: 关联记忆
155
+ profiles.search: 搜索昵称或用户 ID
156
+ profiles.clearSearch: 清除搜索
157
+ profiles.noMatch: 没有找到匹配的用户
158
+ profiles.noMemories: 这份画像没有关联记忆。
159
+ profiles.unavailableMemories: '有 {count} 条关联记忆已无法查看。'
149
160
  profiles.hint: 画像由模型从关联记忆提炼;保存后不再被自动生成覆盖。
150
161
  profiles.sourceCount: '关联 {count} 条记忆'
151
162
  profiles.regenerate: 重新生成
@@ -0,0 +1,65 @@
1
+ main:has(.livingmemory-page),
2
+ .livingmemory-page,
3
+ .livingmemory-page .overflow-y-auto {
4
+ scrollbar-width: none;
5
+ }
6
+
7
+ .livingmemory-profile {
8
+ --disclosure-duration: 280ms;
9
+ --group-inset: clamp(1rem, 2.5cqi, 2rem);
10
+ max-width: 64rem;
11
+ margin-inline: auto;
12
+ padding-inline: clamp(1rem, 3%, 2.5rem);
13
+ padding-block-start: clamp(1rem, 3cqi, 3rem);
14
+ }
15
+
16
+ .livingmemory-profile-group {
17
+ border-radius: 1.125rem;
18
+ background: color-mix(in srgb, var(--card) 85%, var(--muted));
19
+ color: var(--card-foreground);
20
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 60%, transparent),
21
+ 0 2px 8px rgb(0 0 0 / 4%);
22
+ }
23
+
24
+ .livingmemory-profile-reading {
25
+ padding: var(--group-inset);
26
+ }
27
+
28
+ .livingmemory-profile-trigger {
29
+ border-radius: inherit;
30
+ padding: 1rem var(--group-inset);
31
+ }
32
+
33
+ .livingmemory-profile-list {
34
+ padding: 0 var(--group-inset) .5rem;
35
+ }
36
+
37
+ .livingmemory-profile-sources {
38
+ height: var(--collapsible-panel-height);
39
+ overflow: hidden;
40
+ transition: height var(--disclosure-duration) linear, opacity var(--disclosure-duration) linear;
41
+ }
42
+
43
+ .livingmemory-profile-sources:is([data-starting-style], [data-ending-style]) {
44
+ height: 0;
45
+ opacity: 0;
46
+ }
47
+
48
+ .livingmemory-profile-chevron {
49
+ width: .5rem;
50
+ height: .5rem;
51
+ border: solid currentColor;
52
+ border-width: 1.5px 1.5px 0 0;
53
+ transform: rotate(45deg);
54
+ transition: transform var(--disclosure-duration) linear;
55
+ }
56
+
57
+ [aria-expanded="true"] > .livingmemory-profile-chevron {
58
+ transform: rotate(135deg);
59
+ }
60
+
61
+ @media (prefers-reduced-motion: reduce) {
62
+ .livingmemory-profile {
63
+ --disclosure-duration: 0s;
64
+ }
65
+ }