chatluna-plugin-livingmemory 0.0.2 → 0.0.3
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 +8 -3
- package/client/guide-panel.tsx +45 -0
- package/client/locales/en.yml +34 -0
- package/client/locales/zh.yml +34 -0
- package/client/page.tsx +32 -12
- package/client/settings-panel.tsx +66 -0
- package/dist/.vite/manifest.json +1 -1
- package/dist/client.css +1 -1
- package/dist/client.js +1 -1
- package/dist/page-CQcDlyjD.js +3 -0
- package/lib/contracts/memory.d.ts +6 -3
- package/lib/contracts/memory.d.ts.map +1 -1
- package/lib/contracts/webui.d.ts +1 -1
- package/lib/contracts/webui.d.ts.map +1 -1
- package/lib/contracts/webui_live.d.ts +4 -0
- package/lib/contracts/webui_live.d.ts.map +1 -1
- package/lib/contracts/workflows.d.ts +3 -3
- package/lib/contracts/workflows.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +67 -50
- package/lib/index.js.map +1 -1
- package/lib/routing.d.ts +2 -0
- package/lib/routing.d.ts.map +1 -1
- package/lib/service/conversation_hooks.d.ts +1 -0
- package/lib/service/conversation_hooks.d.ts.map +1 -1
- package/lib/service/memory/helpers.d.ts +3 -1
- package/lib/service/memory/helpers.d.ts.map +1 -1
- package/lib/service/persistence/repository.d.ts +3 -3
- package/lib/service/persistence/repository.d.ts.map +1 -1
- package/lib/service/persistence/snapshots.d.ts +3 -3
- package/lib/service/persistence/snapshots.d.ts.map +1 -1
- package/lib/service/workflows/recall/coordinator.d.ts +3 -10
- package/lib/service/workflows/recall/coordinator.d.ts.map +1 -1
- package/lib/service.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/contracts/memory.ts +7 -3
- package/src/contracts/webui.ts +1 -1
- package/src/contracts/webui_live.ts +1 -0
- package/src/contracts/workflows.ts +3 -2
- package/dist/page-IsLg0kiw.js +0 -3
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ yarn build
|
|
|
33
33
|
| `enableConversationIsolation` | boolean | `false` | 只检索当前会话与全局记忆 |
|
|
34
34
|
| `recallIntervalMessages` | number | `20` | 有聊天记录时,首次唤醒即召回;之后在唤醒时按新增聊天条数触发。`0` 关闭自动召回 |
|
|
35
35
|
| `recallHistoryMessages` | number | `20` | 每次唤醒时,用于召回和画像注入的最近聊天条数 |
|
|
36
|
+
| `snapshotScope` | string | `conversation` | 记忆快照范围:会话独立快照(`conversation`)或同一预设内共享(`preset`)。开启隔离会话检索时使用独立快照。 |
|
|
36
37
|
| `snapshotMaxLines` | number | `5` | 记忆快照的最大行数 |
|
|
37
38
|
| `extractionWindowMessages` | number | `60` | 未提取消息达到该条数时提取(0—360);`0` 关闭 |
|
|
38
39
|
| `enableAutoDream` | boolean | `true` | 提取保存新记忆后自动整理 |
|
|
@@ -40,7 +41,9 @@ yarn build
|
|
|
40
41
|
|
|
41
42
|
## 插件配置
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
在 **LivingMemory → 插件配置** 调整模型、记忆工具、画像生成和调试选项,点「保存设置」后对所有预设生效。
|
|
45
|
+
|
|
46
|
+
模型项取值 `无` 表示未配置。重排序模型是可选的;不启用时,检索沿用向量和关键词的综合排序。
|
|
44
47
|
|
|
45
48
|
### 基础配置
|
|
46
49
|
|
|
@@ -54,8 +57,8 @@ yarn build
|
|
|
54
57
|
| --- | --- | --- | --- |
|
|
55
58
|
| `mainModel` | string | `无` | 主 LLM:提取记忆、Dream、用户画像 |
|
|
56
59
|
| `subModel` | string | `无` | 子 LLM:召回记忆 |
|
|
57
|
-
| `embeddingModel` | string | `无` |
|
|
58
|
-
| `rerankModel` | string | `无` |
|
|
60
|
+
| `embeddingModel` | string | `无` | 嵌入模型:将记忆和查询文本转换为向量,用于检索与 Dream |
|
|
61
|
+
| `rerankModel` | string | `无` | 重排序模型(可选):按候选记忆与查询的相关性重新排序 |
|
|
59
62
|
|
|
60
63
|
### 工具配置
|
|
61
64
|
|
|
@@ -86,6 +89,8 @@ yarn build
|
|
|
86
89
|
|
|
87
90
|
在 WebUI 的「能力」中打开 `/livingmemory`,可按预设查看记忆、用户画像、人设卡片、快照和任务,也可以测试召回效果。写操作需要权限等级 4。
|
|
88
91
|
|
|
92
|
+
首次使用可打开「插件指南」,按步骤配置模型、设置对话规则,并用一条记忆测试检索。
|
|
93
|
+
|
|
89
94
|
在「记忆」页点「新建记忆」,选择目标预设或输入新的预设 ID。已有条目可点「编辑」修改正文、关联用户、情绪和重要度等内容。
|
|
90
95
|
|
|
91
96
|
可逐条勾选记忆,也可全选当前筛选的所有结果(含其他页)。永久删除选中记忆前需要确认;清空整个预设时,需输入弹窗中包含预设名的完整短语。
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Button } from '@chatluna/ui-kit'
|
|
2
|
+
import { useTranslate } from '@chatluna/ui-client/client'
|
|
3
|
+
|
|
4
|
+
export function GuidePanel({ onOpenSettings }: { onOpenSettings(): void }) {
|
|
5
|
+
const t = useTranslate('livingmemory')
|
|
6
|
+
return (
|
|
7
|
+
<article className="mx-auto w-full max-w-3xl space-y-8 pb-6">
|
|
8
|
+
<section>
|
|
9
|
+
<h2 className="text-lg font-semibold">{t('guide.start')}</h2>
|
|
10
|
+
<ol className="mt-3 list-decimal space-y-4 pl-6 marker:font-semibold marker:text-primary">
|
|
11
|
+
{['models', 'rules', 'check'].map(step => (
|
|
12
|
+
<li key={step} className="pl-1">
|
|
13
|
+
<h3 className="font-medium">{t(`guide.${step}.title`)}</h3>
|
|
14
|
+
<p className="mt-1 text-sm leading-relaxed text-muted-foreground">{t(`guide.${step}.text`)}</p>
|
|
15
|
+
{step === 'models' && <Button variant="outline" className="mt-2" onClick={onOpenSettings}>{t('guide.openSettings')}</Button>}
|
|
16
|
+
</li>
|
|
17
|
+
))}
|
|
18
|
+
</ol>
|
|
19
|
+
</section>
|
|
20
|
+
<section>
|
|
21
|
+
<h2 className="text-lg font-semibold">{t('guide.dream.title')}</h2>
|
|
22
|
+
<p className="mt-2 text-sm leading-relaxed">{t('guide.dream.intro')}</p>
|
|
23
|
+
<dl className="mt-4 space-y-3">
|
|
24
|
+
{['auto', 'manual', 'result'].map(topic => (
|
|
25
|
+
<div key={topic}>
|
|
26
|
+
<dt className="font-medium">{t(`guide.dream.${topic}.title`)}</dt>
|
|
27
|
+
<dd className="mt-1 text-sm leading-relaxed text-muted-foreground">{t(`guide.dream.${topic}.text`)}</dd>
|
|
28
|
+
</div>
|
|
29
|
+
))}
|
|
30
|
+
</dl>
|
|
31
|
+
</section>
|
|
32
|
+
<section>
|
|
33
|
+
<h2 className="text-lg font-semibold">{t('guide.questions')}</h2>
|
|
34
|
+
<dl className="mt-1 divide-y divide-border">
|
|
35
|
+
{['interval', 'overheard', 'sharing', 'profiles'].map(topic => (
|
|
36
|
+
<div key={topic} className="py-3">
|
|
37
|
+
<dt className="font-medium">{t(`guide.${topic}.title`)}</dt>
|
|
38
|
+
<dd className="mt-1 text-sm leading-relaxed text-muted-foreground">{t(`guide.${topic}.text`)}</dd>
|
|
39
|
+
</div>
|
|
40
|
+
))}
|
|
41
|
+
</dl>
|
|
42
|
+
</section>
|
|
43
|
+
</article>
|
|
44
|
+
)
|
|
45
|
+
}
|
package/client/locales/en.yml
CHANGED
|
@@ -107,6 +107,7 @@ profiles.sourceCount: '{count} linked memories'
|
|
|
107
107
|
profiles.regenerate: Regenerate
|
|
108
108
|
profiles.delete: Delete
|
|
109
109
|
|
|
110
|
+
snapshots.presetShared: Shared preset snapshot
|
|
110
111
|
snapshots.empty: No recall snapshot yet
|
|
111
112
|
snapshots.conversation: 'Conversation {id}'
|
|
112
113
|
snapshots.noContent: This snapshot is empty
|
|
@@ -126,3 +127,36 @@ search.empty: No memory matched
|
|
|
126
127
|
search.scores: 'cosine {cosine} · keywords {keyword} · boosted {boosted}'
|
|
127
128
|
preset.actions: Preset actions
|
|
128
129
|
tab.navigation: Memory management
|
|
130
|
+
tab.settings: Plugin configuration
|
|
131
|
+
tab.guide: Plugin guide
|
|
132
|
+
guide.start: Getting started
|
|
133
|
+
guide.models.title: Choose your models
|
|
134
|
+
guide.models.text: Under Plugin configuration → Model configuration, choose your models. The main model extracts and organizes memories and generates profiles. The recall model decides whether to look up memories. The embedding model converts memories and queries into vectors so the plugin can compare their meanings. An optional reranker reorders the candidate memories by their relevance to the query. Select Save settings to apply these choices to all presets in this plugin instance.
|
|
135
|
+
guide.openSettings: Open plugin configuration
|
|
136
|
+
guide.rules.title: Choose which conversations use automatic extraction
|
|
137
|
+
guide.rules.text: Open Conversation rules → Capabilities → LivingMemory and set the extraction interval. The default is 60 chat messages. To enable automatic extraction in just one group, set the global interval to 0 and that group’s interval to 60.
|
|
138
|
+
guide.check.title: Try a search with one memory
|
|
139
|
+
guide.check.text: Under Memories, select New memory, choose a preset, and save “I drink my coffee without sugar.” Under Recall test for the same preset, search for “How do I like my coffee?” to see the matches. The test leaves snapshots unchanged. Under Snapshots you can read the snapshot from an actual chat. Expand Recall details to see the search terms and matching memories.
|
|
140
|
+
guide.questions: Common settings
|
|
141
|
+
guide.interval.title: How does the recall interval differ from the history length?
|
|
142
|
+
guide.interval.text: Both settings default to 20 messages. The interval controls when recall runs. The first wake triggers recall if chat history exists. On each later wake, recall runs if the number of new chat messages since the previous recall reaches your chosen interval. Set the interval to 0 to disable automatic recall. The history length controls how many recent messages the bot reads at each wake.
|
|
143
|
+
guide.overheard.title: When can chat between group members trigger extraction?
|
|
144
|
+
guide.overheard.text: Overheard extraction is off by default. Group chatter alone will not trigger extraction. Once the bot replies, the plugin counts unprocessed messages up to that reply, including earlier chatter, and starts extraction if the interval has been reached. With overheard extraction on, group members can reach the threshold on their own without calling the bot or waiting for a reply.
|
|
145
|
+
guide.sharing.title: Can two groups using the same preset share a snapshot?
|
|
146
|
+
guide.sharing.text: Each conversation has its own snapshot by default. To share one between two groups using the same preset, select preset sharing in both groups’ conversation rules. The groups share recall results; each still reads its own chat history and tracks its own recall interval. A group with conversation isolation enabled always uses its own snapshot and searches only its own and global memories within the preset.
|
|
147
|
+
guide.profiles.title: How do I use existing user profiles in a chat?
|
|
148
|
+
guide.profiles.text: By default, profiles are updated after extraction or Dream, and each person needs at least three linked active memories. You can change these settings under Plugin configuration. To use existing profiles during a chat, enable profile injection in the conversation rule (off by default). The bot receives profiles for users who spoke in the recent messages covered by the recall history length.
|
|
149
|
+
guide.dream.title: How Dream organizes memories
|
|
150
|
+
guide.dream.intro: Dream uses the main model to compare memories and decide which to keep, update, merge, split, or archive. For example, “I take my coffee without sugar” and “I like unsweetened coffee” can become a single preference. Choose a main model with a context window of at least 200k tokens for Dream.
|
|
151
|
+
guide.dream.auto.title: Automatic runs start with newly extracted memories
|
|
152
|
+
guide.dream.auto.text: Conversation rules enable Dream after extraction by default. For each newly saved memory, Dream looks for related active memories already in the same preset and reviews them together. If it finds no related older memory, the new entry stays as it is.
|
|
153
|
+
guide.dream.manual.title: Manual runs review a whole preset
|
|
154
|
+
guide.dream.manual.text: Once a preset has at least 30 active memories, select it under Memories and click Run Dream. Dream groups its active memories by similarity and reviews each group in turn. The 30-memory minimum applies only to manual runs.
|
|
155
|
+
guide.dream.result.title: See what changed
|
|
156
|
+
guide.dream.result.text: Open Jobs for the same preset to see how many memories Dream processed, which operations it performed, and any errors. Changes are saved directly to Memories. To see the original entries after a merge or split, change the status filter to Archived.
|
|
157
|
+
settings.scope: Plugin settings apply to all presets.
|
|
158
|
+
settings.save: Save settings
|
|
159
|
+
settings.discard: Discard changes
|
|
160
|
+
settings.saved: Settings saved
|
|
161
|
+
settings.noEntry: This instance was not loaded from a configuration file and cannot be edited here.
|
|
162
|
+
settings.noSchema: The LivingMemory configuration form is unavailable.
|
package/client/locales/zh.yml
CHANGED
|
@@ -12,6 +12,39 @@ transfer.imported: 已导入到「{target}」:{entries} 条记忆、{profiles}
|
|
|
12
12
|
empty.noPreset: 还没有预设数据。可以新建第一条记忆,也可以从文件导入。
|
|
13
13
|
|
|
14
14
|
tab.entries: 记忆
|
|
15
|
+
tab.settings: 插件配置
|
|
16
|
+
tab.guide: 插件指南
|
|
17
|
+
guide.start: 第一次使用
|
|
18
|
+
guide.models.title: 配置模型
|
|
19
|
+
guide.models.text: 在「插件配置 → 模型配置」选择模型。主模型提取和整理记忆、生成画像;召回模型判断当前聊天是否需要查找记忆。嵌入模型将记忆和查询文本转换为向量,供插件比较语义相似度。重排序模型是可选的:它根据查询与每条候选记忆的相关性,重新排列检索结果。点「保存设置」后,这些选择对当前插件实例的所有预设生效。
|
|
20
|
+
guide.openSettings: 打开插件配置
|
|
21
|
+
guide.rules.title: 选择在哪些对话中自动提取记忆
|
|
22
|
+
guide.rules.text: 在「对话规则 → 能力 → LivingMemory」设置「自动提取间隔」,默认是 60 条聊天消息。要只在某个群自动提取,把全局间隔设为 0,再把该群规则的间隔设为 60。
|
|
23
|
+
guide.check.title: 用一条记忆试试检索
|
|
24
|
+
guide.check.text: 在「记忆」页点「新建记忆」,选好预设,写下“我喝咖啡不加糖”并保存。到同一预设的「召回测试」搜索“我喜欢喝什么咖啡”,查看检索结果。测试不会更新快照。实际聊天的快照正文在「快照」页查看,展开「召回详情」可以看到搜索词和命中的记忆。
|
|
25
|
+
guide.questions: 常用设置怎么选?
|
|
26
|
+
guide.interval.title: 「自动召回间隔」和「召回上下文条数」有什么区别?
|
|
27
|
+
guide.interval.text: 两项都在对话规则中,默认都是 20 条。「自动召回间隔」决定何时查找记忆:首次唤醒时已有聊天就会召回;之后每次唤醒时,如果距上次召回的新增消息数达到你设置的间隔,就再次召回。间隔设为 0 会关闭自动召回。「召回上下文条数」决定每次唤醒时向前读多少条聊天。
|
|
28
|
+
guide.overheard.title: 群友之间的闲聊什么时候会触发提取?
|
|
29
|
+
guide.overheard.text: 「提取旁听消息」默认关闭:群友一直闲聊时不会触发提取。等机器人回复后,插件才统计截至这条回复的未处理消息;先前的闲聊也计入条数,达到间隔就提取。开启后,群友的消息达到间隔就会触发提取,无需叫机器人或等它回复。
|
|
30
|
+
guide.sharing.title: 同一预设下的两个群能共用快照吗?
|
|
31
|
+
guide.sharing.text: 默认每个会话各用一份快照。要让同一预设下的两个群共用一份,在两个群的对话规则中都选择「记忆快照范围 → 预设共享快照」。共享的是召回结果,两个群仍各自读取聊天记录、计算召回间隔。开启「隔离会话检索」的群始终使用独立快照,并且只检索该预设下本群和全局的记忆。
|
|
32
|
+
guide.profiles.title: 已经生成了用户画像,怎样在聊天中使用?
|
|
33
|
+
guide.profiles.text: 默认在提取或 Dream 整理后更新画像,每位用户至少需要 3 条关联的活跃记忆。这些条件在「插件配置」中调整。要让机器人在聊天中使用已有画像,还需在对话规则中打开「注入用户画像」(默认关闭)。注入哪些人的画像,取决于本次召回上下文里有哪些用户发过言。
|
|
34
|
+
guide.dream.title: Dream 如何整理记忆
|
|
35
|
+
guide.dream.intro: Dream 让主模型对照已有的记忆,决定哪些该保留、更新、合并、拆分或归档。例如,“我喝咖啡不加糖”和“我喜欢无糖咖啡”可以合并成一条偏好。使用 Dream 时,请选择上下文窗口至少为 200k tokens 的主模型。
|
|
36
|
+
guide.dream.auto.title: 自动整理:从刚提取的新记忆开始
|
|
37
|
+
guide.dream.auto.text: 对话规则中的「提取后整理新记忆」默认开启。每次自动提取保存新记忆后,Dream 会为每条新记忆查找同一预设下相关的活跃旧记忆,放在一起整理。找不到相关旧记忆时,新条目保持原样。
|
|
38
|
+
guide.dream.manual.title: 手动整理:检查整个预设
|
|
39
|
+
guide.dream.manual.text: 预设里至少有 30 条活跃记忆时,可以在「记忆」页选择该预设,点「运行 Dream」。Dream 会把活跃记忆按内容相关性分组,逐组检查。30 条的门槛只用于手动整理。
|
|
40
|
+
guide.dream.result.title: 查看整理结果
|
|
41
|
+
guide.dream.result.text: 在同一预设的「任务」页查看处理条数、操作统计和失败原因。改动会直接保存到「记忆」页;要查看合并或拆分前的原条目,把状态筛选切到「已归档」。
|
|
42
|
+
settings.scope: 插件设置对所有预设生效。
|
|
43
|
+
settings.save: 保存设置
|
|
44
|
+
settings.discard: 放弃更改
|
|
45
|
+
settings.saved: 设置已保存
|
|
46
|
+
settings.noEntry: 当前实例未通过配置文件加载,无法在此编辑。
|
|
47
|
+
settings.noSchema: 无法读取 LivingMemory 的配置表单。
|
|
15
48
|
tab.jobs: 任务
|
|
16
49
|
tab.personas: 人设卡片
|
|
17
50
|
|
|
@@ -109,6 +142,7 @@ profiles.sourceCount: '关联 {count} 条记忆'
|
|
|
109
142
|
profiles.regenerate: 重新生成
|
|
110
143
|
profiles.delete: 删除
|
|
111
144
|
|
|
145
|
+
snapshots.presetShared: 预设共享快照
|
|
112
146
|
snapshots.empty: 还没有召回快照
|
|
113
147
|
snapshots.conversation: '会话 {id}'
|
|
114
148
|
snapshots.noContent: 快照内容为空
|
package/client/page.tsx
CHANGED
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
} from '@chatluna/ui-client/client'
|
|
32
32
|
import type { Translate } from '@chatluna/ui-client/client'
|
|
33
33
|
import { PresetActions } from './preset-actions.tsx'
|
|
34
|
+
import { SettingsPanel } from './settings-panel.tsx'
|
|
35
|
+
import { GuidePanel } from './guide-panel.tsx'
|
|
34
36
|
import { MemoryEntryEditor } from './memory-entry-editor.tsx'
|
|
35
37
|
import { MemoryDeletionDialog, type DeleteMemoriesTarget } from './memory-deletion-dialog.tsx'
|
|
36
38
|
import type { MemoryListFilter } from '../src/contracts/rpc.ts'
|
|
@@ -62,13 +64,8 @@ const formatTime = (at: number | null | undefined) => {
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
type StatusFilter = 'active' | 'archived' | 'all'
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
| 'profiles'
|
|
68
|
-
| 'personas'
|
|
69
|
-
| 'snapshots'
|
|
70
|
-
| 'jobs'
|
|
71
|
-
| 'search'
|
|
67
|
+
const tabs = ['entries', 'profiles', 'personas', 'snapshots', 'jobs', 'search', 'settings', 'guide'] as const
|
|
68
|
+
type Tab = (typeof tabs)[number]
|
|
72
69
|
|
|
73
70
|
/** 管理页:记忆检索与编辑、任务列表、人设卡片、预设导入导出。 */
|
|
74
71
|
export function LivingMemoryPage() {
|
|
@@ -81,6 +78,19 @@ export function LivingMemoryPage() {
|
|
|
81
78
|
const [creating, setCreating] = React.useState(false)
|
|
82
79
|
const [clearTarget, setClearTarget] = React.useState<string>()
|
|
83
80
|
const [tab, setTab] = React.useState<Tab>('entries')
|
|
81
|
+
const panel = React.useRef<HTMLDivElement>(null)
|
|
82
|
+
const previousTab = React.useRef(tab)
|
|
83
|
+
|
|
84
|
+
React.useLayoutEffect(() => {
|
|
85
|
+
if (previousTab.current === tab) return
|
|
86
|
+
previousTab.current = tab
|
|
87
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
|
|
88
|
+
const animation = panel.current?.animate(
|
|
89
|
+
[{ opacity: 0, transform: 'translateY(4px)' }, { opacity: 1, transform: 'none' }],
|
|
90
|
+
{ duration: 160, easing: 'ease-out' }
|
|
91
|
+
)
|
|
92
|
+
return () => animation?.cancel()
|
|
93
|
+
}, [tab])
|
|
84
94
|
|
|
85
95
|
const active = selection.presetId ?? presets[0]
|
|
86
96
|
|
|
@@ -89,6 +99,8 @@ export function LivingMemoryPage() {
|
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
function renderPanel() {
|
|
102
|
+
if (tab === 'settings') return null
|
|
103
|
+
if (tab === 'guide') return <GuidePanel onOpenSettings={() => setTab('settings')} />
|
|
92
104
|
if (active === undefined) return (
|
|
93
105
|
<div className="flex flex-col items-center gap-3">
|
|
94
106
|
<EmptyState title={t('empty.noPreset')} />
|
|
@@ -116,7 +128,7 @@ export function LivingMemoryPage() {
|
|
|
116
128
|
<div className="flex h-full min-w-0 flex-col gap-4 overflow-y-auto p-4 sm:p-6">
|
|
117
129
|
<header className="flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-b border-border pb-2">
|
|
118
130
|
<nav className="flex max-w-full items-center gap-1 overflow-x-auto" aria-label={t('tab.navigation')}>
|
|
119
|
-
{
|
|
131
|
+
{tabs.map(key => (
|
|
120
132
|
<button key={key} type="button" aria-current={tab === key ? 'page' : undefined}
|
|
121
133
|
className="shrink-0 border-b-2 border-transparent px-2 py-2 text-sm text-muted-foreground hover:text-foreground focus-visible:outline-ring focus-visible:-outline-offset-2 aria-[current=page]:border-primary aria-[current=page]:font-medium aria-[current=page]:text-foreground"
|
|
122
134
|
onClick={() => setTab(key)}>
|
|
@@ -124,10 +136,10 @@ export function LivingMemoryPage() {
|
|
|
124
136
|
</button>
|
|
125
137
|
))}
|
|
126
138
|
</nav>
|
|
127
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
139
|
+
{tab !== 'settings' && tab !== 'guide' && <div className="flex flex-wrap items-center gap-2">
|
|
128
140
|
<PresetPicker presets={presets} value={active} onChange={selectPreset} />
|
|
129
141
|
<PresetActions presetId={active} onClear={setClearTarget} />
|
|
130
|
-
</div>
|
|
142
|
+
</div>}
|
|
131
143
|
</header>
|
|
132
144
|
{creating && (
|
|
133
145
|
<MemoryEntryEditor presetId={active ?? ''} presets={presets}
|
|
@@ -148,7 +160,12 @@ export function LivingMemoryPage() {
|
|
|
148
160
|
}} />
|
|
149
161
|
)}
|
|
150
162
|
<Warnings warnings={status.data?.warnings ?? []} />
|
|
151
|
-
{
|
|
163
|
+
<div ref={panel} className="flex min-h-0 min-w-0 flex-1 flex-col">
|
|
164
|
+
{renderPanel()}
|
|
165
|
+
<React.Activity mode={tab === 'settings' ? 'visible' : 'hidden'}>
|
|
166
|
+
<SettingsPanel />
|
|
167
|
+
</React.Activity>
|
|
168
|
+
</div>
|
|
152
169
|
</div>
|
|
153
170
|
)
|
|
154
171
|
}
|
|
@@ -689,6 +706,9 @@ function SnapshotsPanel({ presetId }: { presetId: string }) {
|
|
|
689
706
|
|
|
690
707
|
function SnapshotRow({ snapshot }: { snapshot: LivingMemorySnapshotView }) {
|
|
691
708
|
const t = useT()
|
|
709
|
+
const owner = snapshot.conversationId === null
|
|
710
|
+
? t('snapshots.presetShared')
|
|
711
|
+
: snapshot.conversationLabel ?? t('snapshots.conversation', { id: snapshot.conversationId })
|
|
692
712
|
function deleteSnapshot() {
|
|
693
713
|
void callAction('livingmemory.deleteSnapshot', { id: snapshot.id }).catch(report)
|
|
694
714
|
}
|
|
@@ -696,7 +716,7 @@ function SnapshotRow({ snapshot }: { snapshot: LivingMemorySnapshotView }) {
|
|
|
696
716
|
<li className="flex flex-col gap-2 rounded-md border border-border p-3 text-sm">
|
|
697
717
|
<div className="flex flex-wrap items-center gap-2">
|
|
698
718
|
<span className="min-w-0 break-words font-medium">
|
|
699
|
-
{
|
|
719
|
+
{owner}
|
|
700
720
|
</span>
|
|
701
721
|
<span className="ml-auto text-xs text-muted-foreground">
|
|
702
722
|
{formatTime(snapshot.createdAt)}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Alert, Button, Skeleton } from '@chatluna/ui-kit'
|
|
3
|
+
import { toast, useAction, useLive, useLocale, useTranslate } from '@chatluna/ui-client/client'
|
|
4
|
+
import { deepEqual, SchemaForm, useFormValidation } from '@chatluna/ui-schema-form/client'
|
|
5
|
+
import type { PluginDocument } from '@chatluna/runtime-webui'
|
|
6
|
+
|
|
7
|
+
export function SettingsPanel() {
|
|
8
|
+
const t = useTranslate('livingmemory')
|
|
9
|
+
const entry = useLive('livingmemory.settingsEntry')
|
|
10
|
+
if (entry.error) return <Alert variant="destructive">{entry.error}</Alert>
|
|
11
|
+
if (!entry.data) {
|
|
12
|
+
if (entry.status === 'ready') return <Alert>{t('settings.noEntry')}</Alert>
|
|
13
|
+
return <Skeleton className="h-32 w-full" />
|
|
14
|
+
}
|
|
15
|
+
return <InstanceSettings key={entry.data.id} id={entry.data.id} name={entry.data.name} />
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function InstanceSettings({ id, name }: { id: string; name: string }) {
|
|
19
|
+
const t = useTranslate('livingmemory')
|
|
20
|
+
const locale = useLocale()
|
|
21
|
+
const runtime = useLive('plugins.runtime', { name, locale: locale.active.startsWith('zh') ? 'zh' : 'en' })
|
|
22
|
+
const document = useLive('plugins.document', { id })
|
|
23
|
+
const validation = useFormValidation()
|
|
24
|
+
const [draft, setDraft] = React.useState<{ base: PluginDocument; values: PluginDocument['values'] }>()
|
|
25
|
+
|
|
26
|
+
function discard() {
|
|
27
|
+
setDraft(undefined)
|
|
28
|
+
validation.reset()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const save = useAction('plugins.save', {
|
|
32
|
+
onSuccess: () => {
|
|
33
|
+
discard()
|
|
34
|
+
toast.success(t('settings.saved'))
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
const error = runtime.error || document.error || runtime.data?.error
|
|
38
|
+
if (error) return <Alert variant="destructive">{error}</Alert>
|
|
39
|
+
if (!runtime.data || !document.data) return <Skeleton className="h-32 w-full" />
|
|
40
|
+
if (!runtime.data.schema) return <Alert variant="destructive">{t('settings.noSchema')}</Alert>
|
|
41
|
+
|
|
42
|
+
// 修改期间保留打开表单时的版本,避免覆盖其他入口随后保存的配置。
|
|
43
|
+
const base = draft?.base ?? document.data
|
|
44
|
+
function change(values: PluginDocument['values']) {
|
|
45
|
+
setDraft(deepEqual(values, base.values) ? undefined : { base, values })
|
|
46
|
+
}
|
|
47
|
+
function submit() {
|
|
48
|
+
if (draft && validation.attempt()) void save({ id, config: draft.values, revision: draft.base.revision })
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<section className="mx-auto w-full max-w-3xl space-y-4">
|
|
53
|
+
<div className="sticky top-0 z-10 flex flex-wrap items-center justify-between gap-2 bg-background py-2">
|
|
54
|
+
<p className="text-sm text-muted-foreground">{t('settings.scope')}</p>
|
|
55
|
+
<div className="flex gap-2">
|
|
56
|
+
<Button variant="outline" disabled={!draft || save.pending} onClick={discard}>{t('settings.discard')}</Button>
|
|
57
|
+
<Button disabled={!draft || save.pending || save.offline} onClick={submit}>{t('settings.save')}</Button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<fieldset disabled={save.pending} className="min-w-0">
|
|
61
|
+
<SchemaForm schema={runtime.data.schema} formId={`plugin:${id}`} initial={base.values}
|
|
62
|
+
value={draft?.values ?? base.values} credentials={base.credentials} validation={validation} onChange={change} />
|
|
63
|
+
</fieldset>
|
|
64
|
+
</section>
|
|
65
|
+
)
|
|
66
|
+
}
|
package/dist/.vite/manifest.json
CHANGED
package/dist/client.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-content:""}}}@layer utilities{@layer plugin{.\@container{container-type:inline-size}.row-span-4{grid-row:span 4/span 4}.row-start-3{grid-row-start:3}.row-start-4{grid-row-start:4}.mt-1{margin-top:var(--spacing,.25rem)}.mt-3{margin-top:calc(var(--spacing,.25rem) * 3)}.mr-2{margin-right:calc(var(--spacing,.25rem) * 2)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-\[30px\]{height:30px}.h-full{height:100%}.max-h-\[3lh\]{max-height:3lh}.max-h-\[85dvh\]{max-height:85dvh}.max-h-\[min\(55vh\,var\(--available-height\)\)\]{max-height:min(55vh, var(--available-height))}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing,.25rem) * 8)}.w-28{width:calc(var(--spacing,.25rem) * 28)}.w-32{width:calc(var(--spacing,.25rem) * 32)}.w-40{width:calc(var(--spacing,.25rem) * 40)}.w-48{width:calc(var(--spacing,.25rem) * 48)}.w-64{width:calc(var(--spacing,.25rem) * 64)}.w-full{width:100%}.max-w-\[min\(32rem\,var\(--available-width\)\)\]{max-width:min(32rem, var(--available-width))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.cursor-pointer{cursor:pointer}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-rows-subgrid{grid-template-rows:subgrid}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing,.25rem)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-2\.5{gap:calc(var(--spacing,.25rem) * 2.5)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.gap-4{gap:calc(var(--spacing,.25rem) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing,.25rem) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing,.25rem) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing,.25rem) * 3)}.gap-x-4{column-gap:calc(var(--spacing,.25rem) * 4)}.gap-y-0{row-gap:0}.gap-y-0\.5{row-gap:calc(var(--spacing,.25rem) * .5)}.gap-y-1{row-gap:var(--spacing,.25rem)}.gap-y-2{row-gap:calc(var(--spacing,.25rem) * 2)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-b-xl{border-bottom-right-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/40{border-color:color-mix(in oklab, var(--color-amber-500,oklch(76.9% .188 70.08)) 40%, transparent)}}.border-border{border-color:var(--border)}.border-transparent{border-color:#0000}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/10{background-color:color-mix(in oklab, var(--color-amber-500,oklch(76.9% .188 70.08)) 10%, transparent)}}.bg-card{background-color:var(--card)}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/30{background-color:color-mix(in oklab, var(--muted) 30%, transparent)}}.p-3{padding:calc(var(--spacing,.25rem) * 3)}.p-4{padding:calc(var(--spacing,.25rem) * 4)}.px-2{padding-inline:calc(var(--spacing,.25rem) * 2)}.px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}.py-1\.5{padding-block:calc(var(--spacing,.25rem) * 1.5)}.py-2{padding-block:calc(var(--spacing,.25rem) * 2)}.pt-2{padding-top:calc(var(--spacing,.25rem) * 2)}.pt-3{padding-top:calc(var(--spacing,.25rem) * 3)}.pb-1\.5{padding-bottom:calc(var(--spacing,.25rem) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing,.25rem) * 2)}.pb-2\.5{padding-bottom:calc(var(--spacing,.25rem) * 2.5)}.pb-3{padding-bottom:calc(var(--spacing,.25rem) * 3)}.pl-5{padding-left:calc(var(--spacing,.25rem) * 5)}.text-base{font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.leading-6{--tw-leading:calc(var(--spacing,.25rem) * 6);line-height:calc(var(--spacing,.25rem) * 6)}.leading-relaxed{--tw-leading:var(--leading-relaxed,1.625);line-height:var(--leading-relaxed,1.625)}.leading-snug{--tw-leading:var(--leading-snug,1.375);line-height:var(--leading-snug,1.375)}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.font-semibold{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-card-foreground,.text-card-foreground\/85{color:var(--card-foreground)}@supports (color:color-mix(in lab, red, red)){.text-card-foreground\/85{color:color-mix(in oklab, var(--card-foreground) 85%, transparent)}}.text-destructive{color:var(--destructive)}.text-muted-foreground{color:var(--muted-foreground)}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.running{animation-play-state:running}}@media (hover:hover){.hover\:text-foreground:hover{color:var(--foreground)}}.focus-visible\:-outline-offset-2:focus-visible{outline-offset:calc(2px * -1)}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.aria-\[current\=page\]\:border-primary[aria-current=page]{border-color:var(--primary)}.aria-\[current\=page\]\:font-medium[aria-current=page]{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.aria-\[current\=page\]\:text-foreground[aria-current=page]{color:var(--foreground)}.data-indeterminate\:border-primary[data-indeterminate]{border-color:var(--primary)}.data-indeterminate\:before\:h-0\.5[data-indeterminate]:before{content:var(--tw-content);height:calc(var(--spacing,.25rem) * .5)}.data-indeterminate\:before\:w-2[data-indeterminate]:before{content:var(--tw-content);width:calc(var(--spacing,.25rem) * 2)}.data-indeterminate\:before\:bg-primary[data-indeterminate]:before{content:var(--tw-content);background-color:var(--primary)}.data-\[selected\=true\]\:border-primary[data-selected=true]{border-color:var(--primary)}@media (min-width:40rem){.sm\:w-64{width:calc(var(--spacing,.25rem) * 64)}.sm\:max-w-2xl{max-width:var(--container-2xl,42rem)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:p-6{padding:calc(var(--spacing,.25rem) * 6)}}@container (min-width:38rem){.\@min-\[38rem\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container (min-width:57rem){.\@min-\[57rem\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width:76rem){.\@min-\[76rem\]\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.data-indeterminate\:\[\&\>span\]\:hidden[data-indeterminate]>span{display:none}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial;--tw-content:""}}}@layer utilities{@layer plugin{.\@container{container-type:inline-size}.visible{visibility:visible}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.row-span-4{grid-row:span 4/span 4}.row-start-3{grid-row-start:3}.row-start-4{grid-row-start:4}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing,.25rem)}.mt-2{margin-top:calc(var(--spacing,.25rem) * 2)}.mt-3{margin-top:calc(var(--spacing,.25rem) * 3)}.mt-4{margin-top:calc(var(--spacing,.25rem) * 4)}.mr-2{margin-right:calc(var(--spacing,.25rem) * 2)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-32{height:calc(var(--spacing,.25rem) * 32)}.h-\[30px\]{height:30px}.h-full{height:100%}.max-h-\[3lh\]{max-height:3lh}.max-h-\[85dvh\]{max-height:85dvh}.max-h-\[min\(55vh\,var\(--available-height\)\)\]{max-height:min(55vh, var(--available-height))}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing,.25rem) * 8)}.w-28{width:calc(var(--spacing,.25rem) * 28)}.w-32{width:calc(var(--spacing,.25rem) * 32)}.w-40{width:calc(var(--spacing,.25rem) * 40)}.w-48{width:calc(var(--spacing,.25rem) * 48)}.w-64{width:calc(var(--spacing,.25rem) * 64)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl,48rem)}.max-w-\[min\(32rem\,var\(--available-width\)\)\]{max-width:min(32rem, var(--available-width))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.cursor-pointer{cursor:pointer}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-rows-subgrid{grid-template-rows:subgrid}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing,.25rem)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-2\.5{gap:calc(var(--spacing,.25rem) * 2.5)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.gap-4{gap:calc(var(--spacing,.25rem) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing,.25rem) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing,.25rem) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing,.25rem) * 3)}.gap-x-4{column-gap:calc(var(--spacing,.25rem) * 4)}.gap-y-0{row-gap:0}.gap-y-0\.5{row-gap:calc(var(--spacing,.25rem) * .5)}.gap-y-1{row-gap:var(--spacing,.25rem)}.gap-y-2{row-gap:calc(var(--spacing,.25rem) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)){border-color:var(--border)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-b-xl{border-bottom-right-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/40{border-color:color-mix(in oklab, var(--color-amber-500,oklch(76.9% .188 70.08)) 40%, transparent)}}.border-border{border-color:var(--border)}.border-transparent{border-color:#0000}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/10{background-color:color-mix(in oklab, var(--color-amber-500,oklch(76.9% .188 70.08)) 10%, transparent)}}.bg-background{background-color:var(--background)}.bg-card{background-color:var(--card)}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/30{background-color:color-mix(in oklab, var(--muted) 30%, transparent)}}.p-3{padding:calc(var(--spacing,.25rem) * 3)}.p-4{padding:calc(var(--spacing,.25rem) * 4)}.px-2{padding-inline:calc(var(--spacing,.25rem) * 2)}.px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}.py-1\.5{padding-block:calc(var(--spacing,.25rem) * 1.5)}.py-2{padding-block:calc(var(--spacing,.25rem) * 2)}.py-3{padding-block:calc(var(--spacing,.25rem) * 3)}.pt-2{padding-top:calc(var(--spacing,.25rem) * 2)}.pt-3{padding-top:calc(var(--spacing,.25rem) * 3)}.pb-1\.5{padding-bottom:calc(var(--spacing,.25rem) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing,.25rem) * 2)}.pb-2\.5{padding-bottom:calc(var(--spacing,.25rem) * 2.5)}.pb-3{padding-bottom:calc(var(--spacing,.25rem) * 3)}.pb-6{padding-bottom:calc(var(--spacing,.25rem) * 6)}.pl-1{padding-left:var(--spacing,.25rem)}.pl-5{padding-left:calc(var(--spacing,.25rem) * 5)}.pl-6{padding-left:calc(var(--spacing,.25rem) * 6)}.text-base{font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}.text-lg{font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)))}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.leading-6{--tw-leading:calc(var(--spacing,.25rem) * 6);line-height:calc(var(--spacing,.25rem) * 6)}.leading-relaxed{--tw-leading:var(--leading-relaxed,1.625);line-height:var(--leading-relaxed,1.625)}.leading-snug{--tw-leading:var(--leading-snug,1.375);line-height:var(--leading-snug,1.375)}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.font-semibold{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-card-foreground,.text-card-foreground\/85{color:var(--card-foreground)}@supports (color:color-mix(in lab, red, red)){.text-card-foreground\/85{color:color-mix(in oklab, var(--card-foreground) 85%, transparent)}}.text-destructive{color:var(--destructive)}.text-muted-foreground{color:var(--muted-foreground)}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.running{animation-play-state:running}}.marker\:font-semibold ::marker{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.marker\:font-semibold::marker{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.marker\:font-semibold ::-webkit-details-marker{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.marker\:font-semibold::-webkit-details-marker{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.marker\:text-primary ::marker{color:var(--primary)}.marker\:text-primary::marker{color:var(--primary)}.marker\:text-primary ::-webkit-details-marker{color:var(--primary)}.marker\:text-primary::-webkit-details-marker{color:var(--primary)}@media (hover:hover){.hover\:text-foreground:hover{color:var(--foreground)}}.focus-visible\:-outline-offset-2:focus-visible{outline-offset:calc(2px * -1)}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.aria-\[current\=page\]\:border-primary[aria-current=page]{border-color:var(--primary)}.aria-\[current\=page\]\:font-medium[aria-current=page]{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.aria-\[current\=page\]\:text-foreground[aria-current=page]{color:var(--foreground)}.data-indeterminate\:border-primary[data-indeterminate]{border-color:var(--primary)}.data-indeterminate\:before\:h-0\.5[data-indeterminate]:before{content:var(--tw-content);height:calc(var(--spacing,.25rem) * .5)}.data-indeterminate\:before\:w-2[data-indeterminate]:before{content:var(--tw-content);width:calc(var(--spacing,.25rem) * 2)}.data-indeterminate\:before\:bg-primary[data-indeterminate]:before{content:var(--tw-content);background-color:var(--primary)}.data-\[selected\=true\]\:border-primary[data-selected=true]{border-color:var(--primary)}@media (min-width:40rem){.sm\:w-64{width:calc(var(--spacing,.25rem) * 64)}.sm\:max-w-2xl{max-width:var(--container-2xl,42rem)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:p-6{padding:calc(var(--spacing,.25rem) * 6)}}@container (min-width:38rem){.\@min-\[38rem\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container (min-width:57rem){.\@min-\[57rem\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width:76rem){.\@min-\[76rem\]\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.data-indeterminate\:\[\&\>span\]\:hidden[data-indeterminate]>span{display:none}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={"preset.placeholder":`选择预设`,"preset.actions":`预设操作`,"tab.navigation":`记忆管理`,"transfer.export":`导出记忆`,"transfer.import":`导入记忆`,"transfer.confirmTitle":`导入到「{target}」?`,"transfer.preview":`文件导出自「{source}」,包含 {entries} 条记忆、{profiles} 份画像和 {speakers} 位说话者。`,"transfer.merge":`相同 ID 的记忆和同一说话者的画像会被覆盖,其他记忆保留。`,"transfer.confirm":`确认导入`,"transfer.invalid":`无法识别该文件。请选择 LivingMemory 导出的 JSON 文件(格式版本 1–5)。`,"transfer.imported":`已导入到「{target}」:{entries} 条记忆、{profiles} 份画像、{speakers} 位说话者。`,"empty.noPreset":`还没有预设数据。可以新建第一条记忆,也可以从文件导入。`,"tab.entries":`记忆`,"tab.jobs":`任务`,"tab.personas":`人设卡片`,"status.active":`活跃`,"status.archived":`已归档`,"status.all":`全部`,"type.all":`全部类型`,"type.identity":`身份`,"type.preference":`偏好`,"type.fact":`事实`,"type.plan":`计划`,"type.context":`背景`,"type.other":`其他`,"entries.search":`搜索内容、摘要或关键词`,"entries.total":`共 {count} 条`,"entries.empty":`这里还没有记忆`,"entries.edit":`编辑`,"entries.create":`新建记忆`,"entries.editTitle":`编辑记忆`,"entries.created":`已创建记忆`,"entries.saved":`已保存记忆`,"entries.choosePreset":`选择或输入预设 ID`,"entries.noSpeakers":`未关联用户`,"entries.archive":`归档`,"entries.archiveCount":`归档({count})`,"entries.archivedCount":`已归档 {count} 条记忆`,"entries.purge":`彻底删除`,"deletion.selectEntry":`选择记忆:{label}`,"deletion.selectPage":`全选本页`,"deletion.selectAll":`全选`,"deletion.selectMatches":`选择全部 {count} 条结果`,"deletion.selected":`已选 {count} 条`,"deletion.deselect":`清除选择`,"deletion.confirmDelete":`确认彻底删除`,"deletion.entryWarning":`将永久删除预设「{preset}」中的 {count} 条记忆,删除后无法恢复。`,"deletion.deleted":`已删除 {count} 条记忆`,"deletion.clearPreset":`清空预设数据`,"deletion.clearWarning":`预设「{preset}」的数据清空后无法恢复。`,"deletion.typePhrase":`输入以下完整语句以确认清空`,"deletion.phrase":`我确认清空预设 {preset} 的全部记忆、用户画像、人设卡片、快照和任务记录`,"deletion.confirmClear":`确认清空`,"deletion.cleared":`已清空预设「{preset}」的数据`,"field.keywords":`关键词(每行一个,最多 {max} 个)`,"field.preset":`预设`,"field.summary":`摘要`,"field.type":`类型`,"field.status":`状态`,"field.sentiment":`情绪`,"field.importance":`重要度`,"field.speakers":`关联用户`,"field.source":`来源`,"field.createdAt":`创建`,"field.updatedAt":`更新`,"field.content":`内容`,"jobs.dream":`运行 Dream`,"jobs.dreamStarted":`「{preset}」的 Dream 已启动`,"jobs.dreamRunning":`「{preset}」已有 Dream 在运行`,"jobs.dreamInsufficient":`「{preset}」可整理的记忆不足`,"jobs.rebuildIndex":`重建向量索引`,"jobs.empty":`还没有任务记录`,"job.kind.extract":`提取`,"job.kind.dream":`Dream`,"job.kind.recall":`召回`,"job.kind.index":`索引`,"job.status.pending":`排队中`,"job.status.running":`运行中`,"job.status.completed":`已完成`,"job.status.partial":`部分完成`,"job.status.failed":`失败`,"personas.empty":`当前预设还没有人设卡片`,"personas.stale":`预设已变更`,"personas.reset":`重新生成`,"personas.hint":`卡片由预设的 system 部分摘录生成;手工保存后不再被自动覆盖。`,"persona.source.generated":`自动生成`,"persona.source.manual":`手工编辑`,"common.save":`保存`,"common.cancel":`取消`,"common.edit":`编辑`,"common.prev":`上一页`,"common.next":`下一页`,"tab.profiles":`用户画像`,"tab.snapshots":`快照`,"profiles.empty":`还没有为这个预设生成过用户画像`,"profiles.hint":`画像由模型从关联记忆提炼;保存后不再被自动生成覆盖。`,"profiles.sourceCount":`关联 {count} 条记忆`,"profiles.regenerate":`重新生成`,"profiles.delete":`删除`,"snapshots.empty":`还没有召回快照`,"snapshots.conversation":`会话 {id}`,"snapshots.noContent":`快照内容为空`,"snapshots.details":`召回详情`,"snapshots.searchTexts":`搜索词`,"snapshots.noSearch":`本次没有搜索`,"snapshots.matches":`召回的记忆({count} 条)`,"common.delete":`删除`,"tab.search":`召回测试`,"search.text":`搜索文本(第一人称描述)`,"search.keywords":`关键词(逗号分隔,选填)`,"search.run":`搜索`,"search.empty":`未找到匹配的记忆`,"search.scores":`cosine {cosine} · 关键词 {keyword} · 加权 {boosted}`},t={"preset.placeholder":`Select a preset`,"transfer.export":`Export memories`,"transfer.import":`Import memories`,"transfer.confirmTitle":`Import into “{target}”?`,"transfer.preview":`Export from “{source}”: {entries} memories, {profiles} profiles and {speakers} speakers.`,"transfer.merge":`Memories with matching IDs and profiles for the same speaker will be replaced. Other memories are kept.`,"transfer.confirm":`Confirm import`,"transfer.invalid":`Choose a JSON file exported by LivingMemory (format versions 1–5).`,"transfer.imported":`Imported into “{target}”: {entries} memories, {profiles} profiles and {speakers} speakers.`,"empty.noPreset":`No preset data yet. Create your first memory or import a file.`,"tab.entries":`Memories`,"tab.jobs":`Jobs`,"tab.personas":`Personas`,"status.active":`Active`,"status.archived":`Archived`,"status.all":`All`,"type.all":`All types`,"type.identity":`Identity`,"type.preference":`Preference`,"type.fact":`Fact`,"type.plan":`Plan`,"type.context":`Context`,"type.other":`Other`,"entries.search":`Search content, summary or keywords`,"entries.total":`{count} entries`,"entries.empty":`No memories here yet`,"entries.edit":`Edit`,"entries.create":`New memory`,"entries.editTitle":`Edit memory`,"entries.created":`Memory created`,"entries.saved":`Memory saved`,"entries.choosePreset":`Select or enter a preset ID`,"entries.noSpeakers":`No users linked`,"entries.archive":`Archive`,"entries.archiveCount":`Archive ({count})`,"entries.archivedCount":`Archived {count} memories`,"entries.purge":`Delete`,"deletion.selectEntry":`Select memory: {label}`,"deletion.selectPage":`Select this page`,"deletion.selectAll":`Select all`,"deletion.selectMatches":`Select all {count} results`,"deletion.selected":`{count} selected`,"deletion.deselect":`Clear selection`,"deletion.confirmDelete":`Confirm permanent deletion`,"deletion.entryWarning":`Permanently delete {count} memories from “{preset}”? This cannot be undone.`,"deletion.deleted":`Deleted {count} memories`,"deletion.clearPreset":`Clear preset data`,"deletion.clearWarning":`Clearing the data in “{preset}” cannot be undone.`,"deletion.typePhrase":`Type the following sentence to confirm`,"deletion.phrase":`I confirm clearing all memories, user profiles, persona cards, snapshots and job records for preset {preset}`,"deletion.confirmClear":`Confirm clearing`,"deletion.cleared":`Cleared data for “{preset}”`,"field.keywords":`Keywords (one per line, up to {max})`,"field.preset":`Preset`,"field.summary":`Summary`,"field.type":`Type`,"field.status":`Status`,"field.sentiment":`Sentiment`,"field.importance":`Importance`,"field.speakers":`Linked users`,"field.source":`Source`,"field.createdAt":`Created`,"field.updatedAt":`Updated`,"field.content":`Content`,"jobs.dream":`Run Dream`,"jobs.dreamStarted":`Dream started for “{preset}”`,"jobs.dreamRunning":`Dream is already running for “{preset}”`,"jobs.dreamInsufficient":`Not enough memories in “{preset}” to run Dream`,"jobs.rebuildIndex":`Rebuild vector index`,"jobs.empty":`No jobs recorded yet`,"job.kind.extract":`Extract`,"job.kind.dream":`Dream`,"job.kind.recall":`Recall`,"job.kind.index":`Index`,"job.status.pending":`Pending`,"job.status.running":`Running`,"job.status.completed":`Completed`,"job.status.partial":`Partial`,"job.status.failed":`Failed`,"personas.empty":`This preset has no persona card yet`,"personas.stale":`Preset changed`,"personas.reset":`Regenerate`,"personas.hint":`The card is distilled from the preset's system section; once saved by hand it is no longer overwritten automatically.`,"persona.source.generated":`Generated`,"persona.source.manual":`Edited by hand`,"common.save":`Save`,"common.cancel":`Cancel`,"common.edit":`Edit`,"common.prev":`Previous`,"common.next":`Next`,"tab.profiles":`Profiles`,"tab.snapshots":`Snapshots`,"profiles.empty":`No user profile has been generated for this preset`,"profiles.hint":`The profile is distilled from linked memories; once saved it is no longer overwritten automatically.`,"profiles.sourceCount":`{count} linked memories`,"profiles.regenerate":`Regenerate`,"profiles.delete":`Delete`,"snapshots.empty":`No recall snapshot yet`,"snapshots.conversation":`Conversation {id}`,"snapshots.noContent":`This snapshot is empty`,"snapshots.details":`Recall details`,"snapshots.searchTexts":`Search terms`,"snapshots.noSearch":`No search was made`,"snapshots.matches":`Recalled memories ({count})`,"common.delete":`Delete`,"tab.search":`Recall test`,"search.text":`Search text (first-person description)`,"search.keywords":`Keywords (comma separated, optional)`,"search.run":`Search`,"search.empty":`No memory matched`,"search.scores":`cosine {cosine} · keywords {keyword} · boosted {boosted}`,"preset.actions":`Preset actions`,"tab.navigation":`Memory management`};function n(n){n.locale.register(`livingmemory`,{zh:e,en:t}),n.slots.route({path:`/livingmemory`,page:async()=>(await import(`./page-IsLg0kiw.js`)).LivingMemoryPage,title:`LivingMemory`,icon:`brain`,order:36,group:`capabilities`,groupOrder:36})}export{n as default};
|
|
1
|
+
var e={"preset.placeholder":`选择预设`,"preset.actions":`预设操作`,"tab.navigation":`记忆管理`,"transfer.export":`导出记忆`,"transfer.import":`导入记忆`,"transfer.confirmTitle":`导入到「{target}」?`,"transfer.preview":`文件导出自「{source}」,包含 {entries} 条记忆、{profiles} 份画像和 {speakers} 位说话者。`,"transfer.merge":`相同 ID 的记忆和同一说话者的画像会被覆盖,其他记忆保留。`,"transfer.confirm":`确认导入`,"transfer.invalid":`无法识别该文件。请选择 LivingMemory 导出的 JSON 文件(格式版本 1–5)。`,"transfer.imported":`已导入到「{target}」:{entries} 条记忆、{profiles} 份画像、{speakers} 位说话者。`,"empty.noPreset":`还没有预设数据。可以新建第一条记忆,也可以从文件导入。`,"tab.entries":`记忆`,"tab.settings":`插件配置`,"tab.guide":`插件指南`,"guide.start":`第一次使用`,"guide.models.title":`配置模型`,"guide.models.text":`在「插件配置 → 模型配置」选择模型。主模型提取和整理记忆、生成画像;召回模型判断当前聊天是否需要查找记忆。嵌入模型将记忆和查询文本转换为向量,供插件比较语义相似度。重排序模型是可选的:它根据查询与每条候选记忆的相关性,重新排列检索结果。点「保存设置」后,这些选择对当前插件实例的所有预设生效。`,"guide.openSettings":`打开插件配置`,"guide.rules.title":`选择在哪些对话中自动提取记忆`,"guide.rules.text":`在「对话规则 → 能力 → LivingMemory」设置「自动提取间隔」,默认是 60 条聊天消息。要只在某个群自动提取,把全局间隔设为 0,再把该群规则的间隔设为 60。`,"guide.check.title":`用一条记忆试试检索`,"guide.check.text":`在「记忆」页点「新建记忆」,选好预设,写下“我喝咖啡不加糖”并保存。到同一预设的「召回测试」搜索“我喜欢喝什么咖啡”,查看检索结果。测试不会更新快照。实际聊天的快照正文在「快照」页查看,展开「召回详情」可以看到搜索词和命中的记忆。`,"guide.questions":`常用设置怎么选?`,"guide.interval.title":`「自动召回间隔」和「召回上下文条数」有什么区别?`,"guide.interval.text":`两项都在对话规则中,默认都是 20 条。「自动召回间隔」决定何时查找记忆:首次唤醒时已有聊天就会召回;之后每次唤醒时,如果距上次召回的新增消息数达到你设置的间隔,就再次召回。间隔设为 0 会关闭自动召回。「召回上下文条数」决定每次唤醒时向前读多少条聊天。`,"guide.overheard.title":`群友之间的闲聊什么时候会触发提取?`,"guide.overheard.text":`「提取旁听消息」默认关闭:群友一直闲聊时不会触发提取。等机器人回复后,插件才统计截至这条回复的未处理消息;先前的闲聊也计入条数,达到间隔就提取。开启后,群友的消息达到间隔就会触发提取,无需叫机器人或等它回复。`,"guide.sharing.title":`同一预设下的两个群能共用快照吗?`,"guide.sharing.text":`默认每个会话各用一份快照。要让同一预设下的两个群共用一份,在两个群的对话规则中都选择「记忆快照范围 → 预设共享快照」。共享的是召回结果,两个群仍各自读取聊天记录、计算召回间隔。开启「隔离会话检索」的群始终使用独立快照,并且只检索该预设下本群和全局的记忆。`,"guide.profiles.title":`已经生成了用户画像,怎样在聊天中使用?`,"guide.profiles.text":`默认在提取或 Dream 整理后更新画像,每位用户至少需要 3 条关联的活跃记忆。这些条件在「插件配置」中调整。要让机器人在聊天中使用已有画像,还需在对话规则中打开「注入用户画像」(默认关闭)。注入哪些人的画像,取决于本次召回上下文里有哪些用户发过言。`,"guide.dream.title":`Dream 如何整理记忆`,"guide.dream.intro":`Dream 让主模型对照已有的记忆,决定哪些该保留、更新、合并、拆分或归档。例如,“我喝咖啡不加糖”和“我喜欢无糖咖啡”可以合并成一条偏好。使用 Dream 时,请选择上下文窗口至少为 200k tokens 的主模型。`,"guide.dream.auto.title":`自动整理:从刚提取的新记忆开始`,"guide.dream.auto.text":`对话规则中的「提取后整理新记忆」默认开启。每次自动提取保存新记忆后,Dream 会为每条新记忆查找同一预设下相关的活跃旧记忆,放在一起整理。找不到相关旧记忆时,新条目保持原样。`,"guide.dream.manual.title":`手动整理:检查整个预设`,"guide.dream.manual.text":`预设里至少有 30 条活跃记忆时,可以在「记忆」页选择该预设,点「运行 Dream」。Dream 会把活跃记忆按内容相关性分组,逐组检查。30 条的门槛只用于手动整理。`,"guide.dream.result.title":`查看整理结果`,"guide.dream.result.text":`在同一预设的「任务」页查看处理条数、操作统计和失败原因。改动会直接保存到「记忆」页;要查看合并或拆分前的原条目,把状态筛选切到「已归档」。`,"settings.scope":`插件设置对所有预设生效。`,"settings.save":`保存设置`,"settings.discard":`放弃更改`,"settings.saved":`设置已保存`,"settings.noEntry":`当前实例未通过配置文件加载,无法在此编辑。`,"settings.noSchema":`无法读取 LivingMemory 的配置表单。`,"tab.jobs":`任务`,"tab.personas":`人设卡片`,"status.active":`活跃`,"status.archived":`已归档`,"status.all":`全部`,"type.all":`全部类型`,"type.identity":`身份`,"type.preference":`偏好`,"type.fact":`事实`,"type.plan":`计划`,"type.context":`背景`,"type.other":`其他`,"entries.search":`搜索内容、摘要或关键词`,"entries.total":`共 {count} 条`,"entries.empty":`这里还没有记忆`,"entries.edit":`编辑`,"entries.create":`新建记忆`,"entries.editTitle":`编辑记忆`,"entries.created":`已创建记忆`,"entries.saved":`已保存记忆`,"entries.choosePreset":`选择或输入预设 ID`,"entries.noSpeakers":`未关联用户`,"entries.archive":`归档`,"entries.archiveCount":`归档({count})`,"entries.archivedCount":`已归档 {count} 条记忆`,"entries.purge":`彻底删除`,"deletion.selectEntry":`选择记忆:{label}`,"deletion.selectPage":`全选本页`,"deletion.selectAll":`全选`,"deletion.selectMatches":`选择全部 {count} 条结果`,"deletion.selected":`已选 {count} 条`,"deletion.deselect":`清除选择`,"deletion.confirmDelete":`确认彻底删除`,"deletion.entryWarning":`将永久删除预设「{preset}」中的 {count} 条记忆,删除后无法恢复。`,"deletion.deleted":`已删除 {count} 条记忆`,"deletion.clearPreset":`清空预设数据`,"deletion.clearWarning":`预设「{preset}」的数据清空后无法恢复。`,"deletion.typePhrase":`输入以下完整语句以确认清空`,"deletion.phrase":`我确认清空预设 {preset} 的全部记忆、用户画像、人设卡片、快照和任务记录`,"deletion.confirmClear":`确认清空`,"deletion.cleared":`已清空预设「{preset}」的数据`,"field.keywords":`关键词(每行一个,最多 {max} 个)`,"field.preset":`预设`,"field.summary":`摘要`,"field.type":`类型`,"field.status":`状态`,"field.sentiment":`情绪`,"field.importance":`重要度`,"field.speakers":`关联用户`,"field.source":`来源`,"field.createdAt":`创建`,"field.updatedAt":`更新`,"field.content":`内容`,"jobs.dream":`运行 Dream`,"jobs.dreamStarted":`「{preset}」的 Dream 已启动`,"jobs.dreamRunning":`「{preset}」已有 Dream 在运行`,"jobs.dreamInsufficient":`「{preset}」可整理的记忆不足`,"jobs.rebuildIndex":`重建向量索引`,"jobs.empty":`还没有任务记录`,"job.kind.extract":`提取`,"job.kind.dream":`Dream`,"job.kind.recall":`召回`,"job.kind.index":`索引`,"job.status.pending":`排队中`,"job.status.running":`运行中`,"job.status.completed":`已完成`,"job.status.partial":`部分完成`,"job.status.failed":`失败`,"personas.empty":`当前预设还没有人设卡片`,"personas.stale":`预设已变更`,"personas.reset":`重新生成`,"personas.hint":`卡片由预设的 system 部分摘录生成;手工保存后不再被自动覆盖。`,"persona.source.generated":`自动生成`,"persona.source.manual":`手工编辑`,"common.save":`保存`,"common.cancel":`取消`,"common.edit":`编辑`,"common.prev":`上一页`,"common.next":`下一页`,"tab.profiles":`用户画像`,"tab.snapshots":`快照`,"profiles.empty":`还没有为这个预设生成过用户画像`,"profiles.hint":`画像由模型从关联记忆提炼;保存后不再被自动生成覆盖。`,"profiles.sourceCount":`关联 {count} 条记忆`,"profiles.regenerate":`重新生成`,"profiles.delete":`删除`,"snapshots.presetShared":`预设共享快照`,"snapshots.empty":`还没有召回快照`,"snapshots.conversation":`会话 {id}`,"snapshots.noContent":`快照内容为空`,"snapshots.details":`召回详情`,"snapshots.searchTexts":`搜索词`,"snapshots.noSearch":`本次没有搜索`,"snapshots.matches":`召回的记忆({count} 条)`,"common.delete":`删除`,"tab.search":`召回测试`,"search.text":`搜索文本(第一人称描述)`,"search.keywords":`关键词(逗号分隔,选填)`,"search.run":`搜索`,"search.empty":`未找到匹配的记忆`,"search.scores":`cosine {cosine} · 关键词 {keyword} · 加权 {boosted}`},t={"preset.placeholder":`Select a preset`,"transfer.export":`Export memories`,"transfer.import":`Import memories`,"transfer.confirmTitle":`Import into “{target}”?`,"transfer.preview":`Export from “{source}”: {entries} memories, {profiles} profiles and {speakers} speakers.`,"transfer.merge":`Memories with matching IDs and profiles for the same speaker will be replaced. Other memories are kept.`,"transfer.confirm":`Confirm import`,"transfer.invalid":`Choose a JSON file exported by LivingMemory (format versions 1–5).`,"transfer.imported":`Imported into “{target}”: {entries} memories, {profiles} profiles and {speakers} speakers.`,"empty.noPreset":`No preset data yet. Create your first memory or import a file.`,"tab.entries":`Memories`,"tab.jobs":`Jobs`,"tab.personas":`Personas`,"status.active":`Active`,"status.archived":`Archived`,"status.all":`All`,"type.all":`All types`,"type.identity":`Identity`,"type.preference":`Preference`,"type.fact":`Fact`,"type.plan":`Plan`,"type.context":`Context`,"type.other":`Other`,"entries.search":`Search content, summary or keywords`,"entries.total":`{count} entries`,"entries.empty":`No memories here yet`,"entries.edit":`Edit`,"entries.create":`New memory`,"entries.editTitle":`Edit memory`,"entries.created":`Memory created`,"entries.saved":`Memory saved`,"entries.choosePreset":`Select or enter a preset ID`,"entries.noSpeakers":`No users linked`,"entries.archive":`Archive`,"entries.archiveCount":`Archive ({count})`,"entries.archivedCount":`Archived {count} memories`,"entries.purge":`Delete`,"deletion.selectEntry":`Select memory: {label}`,"deletion.selectPage":`Select this page`,"deletion.selectAll":`Select all`,"deletion.selectMatches":`Select all {count} results`,"deletion.selected":`{count} selected`,"deletion.deselect":`Clear selection`,"deletion.confirmDelete":`Confirm permanent deletion`,"deletion.entryWarning":`Permanently delete {count} memories from “{preset}”? This cannot be undone.`,"deletion.deleted":`Deleted {count} memories`,"deletion.clearPreset":`Clear preset data`,"deletion.clearWarning":`Clearing the data in “{preset}” cannot be undone.`,"deletion.typePhrase":`Type the following sentence to confirm`,"deletion.phrase":`I confirm clearing all memories, user profiles, persona cards, snapshots and job records for preset {preset}`,"deletion.confirmClear":`Confirm clearing`,"deletion.cleared":`Cleared data for “{preset}”`,"field.keywords":`Keywords (one per line, up to {max})`,"field.preset":`Preset`,"field.summary":`Summary`,"field.type":`Type`,"field.status":`Status`,"field.sentiment":`Sentiment`,"field.importance":`Importance`,"field.speakers":`Linked users`,"field.source":`Source`,"field.createdAt":`Created`,"field.updatedAt":`Updated`,"field.content":`Content`,"jobs.dream":`Run Dream`,"jobs.dreamStarted":`Dream started for “{preset}”`,"jobs.dreamRunning":`Dream is already running for “{preset}”`,"jobs.dreamInsufficient":`Not enough memories in “{preset}” to run Dream`,"jobs.rebuildIndex":`Rebuild vector index`,"jobs.empty":`No jobs recorded yet`,"job.kind.extract":`Extract`,"job.kind.dream":`Dream`,"job.kind.recall":`Recall`,"job.kind.index":`Index`,"job.status.pending":`Pending`,"job.status.running":`Running`,"job.status.completed":`Completed`,"job.status.partial":`Partial`,"job.status.failed":`Failed`,"personas.empty":`This preset has no persona card yet`,"personas.stale":`Preset changed`,"personas.reset":`Regenerate`,"personas.hint":`The card is distilled from the preset's system section; once saved by hand it is no longer overwritten automatically.`,"persona.source.generated":`Generated`,"persona.source.manual":`Edited by hand`,"common.save":`Save`,"common.cancel":`Cancel`,"common.edit":`Edit`,"common.prev":`Previous`,"common.next":`Next`,"tab.profiles":`Profiles`,"tab.snapshots":`Snapshots`,"profiles.empty":`No user profile has been generated for this preset`,"profiles.hint":`The profile is distilled from linked memories; once saved it is no longer overwritten automatically.`,"profiles.sourceCount":`{count} linked memories`,"profiles.regenerate":`Regenerate`,"profiles.delete":`Delete`,"snapshots.presetShared":`Shared preset snapshot`,"snapshots.empty":`No recall snapshot yet`,"snapshots.conversation":`Conversation {id}`,"snapshots.noContent":`This snapshot is empty`,"snapshots.details":`Recall details`,"snapshots.searchTexts":`Search terms`,"snapshots.noSearch":`No search was made`,"snapshots.matches":`Recalled memories ({count})`,"common.delete":`Delete`,"tab.search":`Recall test`,"search.text":`Search text (first-person description)`,"search.keywords":`Keywords (comma separated, optional)`,"search.run":`Search`,"search.empty":`No memory matched`,"search.scores":`cosine {cosine} · keywords {keyword} · boosted {boosted}`,"preset.actions":`Preset actions`,"tab.navigation":`Memory management`,"tab.settings":`Plugin configuration`,"tab.guide":`Plugin guide`,"guide.start":`Getting started`,"guide.models.title":`Choose your models`,"guide.models.text":`Under Plugin configuration → Model configuration, choose your models. The main model extracts and organizes memories and generates profiles. The recall model decides whether to look up memories. The embedding model converts memories and queries into vectors so the plugin can compare their meanings. An optional reranker reorders the candidate memories by their relevance to the query. Select Save settings to apply these choices to all presets in this plugin instance.`,"guide.openSettings":`Open plugin configuration`,"guide.rules.title":`Choose which conversations use automatic extraction`,"guide.rules.text":`Open Conversation rules → Capabilities → LivingMemory and set the extraction interval. The default is 60 chat messages. To enable automatic extraction in just one group, set the global interval to 0 and that group’s interval to 60.`,"guide.check.title":`Try a search with one memory`,"guide.check.text":`Under Memories, select New memory, choose a preset, and save “I drink my coffee without sugar.” Under Recall test for the same preset, search for “How do I like my coffee?” to see the matches. The test leaves snapshots unchanged. Under Snapshots you can read the snapshot from an actual chat. Expand Recall details to see the search terms and matching memories.`,"guide.questions":`Common settings`,"guide.interval.title":`How does the recall interval differ from the history length?`,"guide.interval.text":`Both settings default to 20 messages. The interval controls when recall runs. The first wake triggers recall if chat history exists. On each later wake, recall runs if the number of new chat messages since the previous recall reaches your chosen interval. Set the interval to 0 to disable automatic recall. The history length controls how many recent messages the bot reads at each wake.`,"guide.overheard.title":`When can chat between group members trigger extraction?`,"guide.overheard.text":`Overheard extraction is off by default. Group chatter alone will not trigger extraction. Once the bot replies, the plugin counts unprocessed messages up to that reply, including earlier chatter, and starts extraction if the interval has been reached. With overheard extraction on, group members can reach the threshold on their own without calling the bot or waiting for a reply.`,"guide.sharing.title":`Can two groups using the same preset share a snapshot?`,"guide.sharing.text":`Each conversation has its own snapshot by default. To share one between two groups using the same preset, select preset sharing in both groups’ conversation rules. The groups share recall results; each still reads its own chat history and tracks its own recall interval. A group with conversation isolation enabled always uses its own snapshot and searches only its own and global memories within the preset.`,"guide.profiles.title":`How do I use existing user profiles in a chat?`,"guide.profiles.text":`By default, profiles are updated after extraction or Dream, and each person needs at least three linked active memories. You can change these settings under Plugin configuration. To use existing profiles during a chat, enable profile injection in the conversation rule (off by default). The bot receives profiles for users who spoke in the recent messages covered by the recall history length.`,"guide.dream.title":`How Dream organizes memories`,"guide.dream.intro":`Dream uses the main model to compare memories and decide which to keep, update, merge, split, or archive. For example, “I take my coffee without sugar” and “I like unsweetened coffee” can become a single preference. Choose a main model with a context window of at least 200k tokens for Dream.`,"guide.dream.auto.title":`Automatic runs start with newly extracted memories`,"guide.dream.auto.text":`Conversation rules enable Dream after extraction by default. For each newly saved memory, Dream looks for related active memories already in the same preset and reviews them together. If it finds no related older memory, the new entry stays as it is.`,"guide.dream.manual.title":`Manual runs review a whole preset`,"guide.dream.manual.text":`Once a preset has at least 30 active memories, select it under Memories and click Run Dream. Dream groups its active memories by similarity and reviews each group in turn. The 30-memory minimum applies only to manual runs.`,"guide.dream.result.title":`See what changed`,"guide.dream.result.text":`Open Jobs for the same preset to see how many memories Dream processed, which operations it performed, and any errors. Changes are saved directly to Memories. To see the original entries after a merge or split, change the status filter to Archived.`,"settings.scope":`Plugin settings apply to all presets.`,"settings.save":`Save settings`,"settings.discard":`Discard changes`,"settings.saved":`Settings saved`,"settings.noEntry":`This instance was not loaded from a configuration file and cannot be edited here.`,"settings.noSchema":`The LivingMemory configuration form is unavailable.`};function n(n){n.locale.register(`livingmemory`,{zh:e,en:t}),n.slots.route({path:`/livingmemory`,page:async()=>(await import(`./page-CQcDlyjD.js`)).LivingMemoryPage,title:`LivingMemory`,icon:`brain`,order:36,group:`capabilities`,groupOrder:36})}export{n as default};
|