dsh-hypatia-auto-memory 2.1.1 → 2.2.0
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 +4 -1
- package/README.zh-CN.md +2 -0
- package/icon.svg +17 -0
- package/lib/client.js +523 -519
- package/lib/client.js.map +1 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +6 -2
- package/src/client/SettingsCard.module.css +106 -88
- package/src/client/SettingsCard.tsx +450 -442
- package/src/client/index.tsx +8 -4
- package/src/client/locales.ts +4 -2
package/src/client/index.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import type {} from '@deepseek-ai/dsh-client-ui-settings-plugins/client'
|
|
|
26
26
|
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
27
27
|
import { createElement } from 'react'
|
|
28
28
|
import { SettingsCard } from './SettingsCard'
|
|
29
|
-
import type { ConfigShape } from './SettingsCard'
|
|
29
|
+
import type { ConfigShape, SettingsCardSeat } from './SettingsCard'
|
|
30
30
|
import type { LoadConsolidationModelCatalog } from './consolidation-models'
|
|
31
31
|
import { MemoryView } from './MemoryView'
|
|
32
32
|
import { fetchMemory, fetchShelves, summarizeMemory } from './memory-client'
|
|
@@ -92,10 +92,14 @@ export function apply(ctx: Context): void {
|
|
|
92
92
|
// settings document only projects plugin Config forms, so the read-only
|
|
93
93
|
// inventory namespace this used to ride can no longer be published.
|
|
94
94
|
const loadShelfInventory: LoadShelfInventory = fetchShelves
|
|
95
|
-
|
|
95
|
+
// Each seat gets its own card instance: the Plugins page names the bundle
|
|
96
|
+
// above the card and starts it folded, while the Settings tab is the plugin's
|
|
97
|
+
// whole page and carries its name.
|
|
98
|
+
const renderCard = (seat: SettingsCardSeat) => (props: PropsLocale<typeof NS>) => createElement(SettingsCard, {
|
|
96
99
|
scope: form,
|
|
97
100
|
loadModelCatalog,
|
|
98
101
|
loadShelfInventory,
|
|
102
|
+
seat,
|
|
99
103
|
...props,
|
|
100
104
|
})
|
|
101
105
|
// The card exists only while the Host serves our namespace; whileServed owns
|
|
@@ -106,11 +110,11 @@ export function apply(ctx: Context): void {
|
|
|
106
110
|
installPluginCard(ctx, {
|
|
107
111
|
official: () => ctx.slots.register(
|
|
108
112
|
{ name: BUNDLE_CONFIG_SEAT, key: BUNDLE_NAME, locale: NS },
|
|
109
|
-
renderCard,
|
|
113
|
+
renderCard('official'),
|
|
110
114
|
),
|
|
111
115
|
settingsTab: () => ctx.slots.register(
|
|
112
116
|
{ name: SETTINGS_TAB_SEAT, id: NS, label: () => t('title'), locale: NS },
|
|
113
|
-
renderCard,
|
|
117
|
+
renderCard('settings-tab'),
|
|
114
118
|
),
|
|
115
119
|
onRefused: (seat, error) => {
|
|
116
120
|
console.warn(`[${BUNDLE_NAME}] configuration card refused by slot "${seat}"`, error)
|
package/src/client/locales.ts
CHANGED
|
@@ -10,6 +10,7 @@ export const zh = {
|
|
|
10
10
|
title: 'Hypatia Auto Memory',
|
|
11
11
|
description:
|
|
12
12
|
'自动将对话轮次记录到 Hypatia,并在新内容足够多时通过独立模型路由进行后台整合。',
|
|
13
|
+
configSection: '配置',
|
|
13
14
|
enable: '启用自动记忆',
|
|
14
15
|
autoApprove: '自动批准模型发起的 hypatia 命令',
|
|
15
16
|
autoApproveHint: '仅限不含管道、重定向、命令串联的纯 hypatia 调用;插件自身的写入不经过此路径。关闭后模型每次检索都会弹出批准框。保存后采集器会自动重启以应用新值。',
|
|
@@ -58,10 +59,10 @@ export const zh = {
|
|
|
58
59
|
advancedHint:
|
|
59
60
|
'高级字段(二进制、收集器上限、队列调优)可在「设置 → 插件」的本插件页,或 profile patch 的 {ns} 条目 config 下编辑。',
|
|
60
61
|
reset: '重置',
|
|
61
|
-
discard: '放弃',
|
|
62
62
|
save: '保存',
|
|
63
63
|
saving: '保存中…',
|
|
64
64
|
saveFailed: '保存失败:{message}',
|
|
65
|
+
saveFailedShort: '保存失败',
|
|
65
66
|
readOnly: '只读:当前上下文不可写入设置文档。',
|
|
66
67
|
unsaved: '未保存',
|
|
67
68
|
viewMemory: '记忆',
|
|
@@ -127,6 +128,7 @@ export const en = {
|
|
|
127
128
|
title: 'Hypatia Auto Memory',
|
|
128
129
|
description:
|
|
129
130
|
'Auto-memory logs conversation turns into Hypatia and runs background consolidation on a dedicated model route.',
|
|
131
|
+
configSection: 'Configuration',
|
|
130
132
|
enable: 'Enable auto-memory',
|
|
131
133
|
autoApprove: "Auto-approve the agent's own hypatia commands",
|
|
132
134
|
autoApproveHint: 'Only plain hypatia calls with no pipe, redirect or chaining; this plugin\'s own writes never take that path. With it off, every retrieval raises an approval prompt. Saving a change restarts the collector to apply it.',
|
|
@@ -175,10 +177,10 @@ export const en = {
|
|
|
175
177
|
advancedHint:
|
|
176
178
|
'Advanced fields (binaries, collector caps, queue tuning) can be edited in Settings → Plugins under this plugin, or under the {ns} entry\'s config in the profile patch.',
|
|
177
179
|
reset: 'Reset',
|
|
178
|
-
discard: 'Discard',
|
|
179
180
|
save: 'Save',
|
|
180
181
|
saving: 'Saving…',
|
|
181
182
|
saveFailed: 'Save failed: {message}',
|
|
183
|
+
saveFailedShort: 'Save failed',
|
|
182
184
|
readOnly: 'Read-only: settings document is not writable in this context.',
|
|
183
185
|
unsaved: 'Unsaved',
|
|
184
186
|
viewMemory: 'Memory',
|