Skip to content

Commit ae0356d

Browse files
committed
refactor(bailian-memo-dsh): remove pause/resume functionality and update documentation
- Eliminated pause and resume methods from the MemoCardController and associated UI elements in MemoCard. - Updated README.md and README.zh.md to reflect changes in plugin control, emphasizing the use of a switch for enabling/disabling the plugin without data loss. - Removed references to pause/resume in localization files to align with the updated functionality. - Cleaned up CSS by removing the dangerButton class, streamlining button styles.
1 parent 9cf5883 commit ae0356d

6 files changed

Lines changed: 4 additions & 52 deletions

File tree

‎packages/bailian-memo-dsh/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The installed bundle row also exposes **Configure** for `bailian-memo-dsh#tool-b
3535
- **Personal identity:** `~/.bailian/personal-memory/config.json` (`status`: `unconfigured` / `initializing` / `active` / `paused`)
3636
- **Plugin settings (Volatile):** real toggles for `enabled`, `autoRecall`, and `autoCurate`, plus the visible `recallTopK` result limit and `minScore` threshold (default 0). The threshold applies to automatic recall and to manual search when `min_score` is omitted. `workspaceId` and curator options also live in dsh settings. The endpoint uses the fixed default Memory host.
3737
- **Secrets:** never stored in the personal config file; the UI shows only whether the effective credential is configured and its source category, never its value
38-
- **Safe controls:** pause/resume keeps cloud data; the page does not expose a full wipe
38+
- **Plugin control:** use the switch in the installed plugins list to enable or disable the plugin. The settings page has no pause/resume buttons and does not expose a full wipe; cloud data is kept.
3939
- **Diagnostics:** async writes distinguish submitted, succeeded with changes, succeeded without changes, and failed. Empty searches include a sanitized scope (hashes and lengths only); `bailian_memo_search` accepts optional `min_score`.
4040

4141
On first startup, an absent dsh `workspaceId` is seeded from the personal identity binding, then from the active `bl` profile. Explicit dsh values are preserved. `configInitialized` records this migration, so clearing a setting does not reimport it on restart. Missing API keys may be seeded into the plugin-specific dsh `BAILIAN_MEMO_API_KEY` credential; requests never fall back to `bl` or environment workspace values.

‎packages/bailian-memo-dsh/README.zh.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dsh plugin --profile <profile> add /path/to/cli/packages/bailian-memo-dsh
3535
- **个人身份:** `~/.bailian/personal-memory/config.json`(`status`:`unconfigured` / `initializing` / `active` / `paused`)
3636
- **插件设置(Volatile):** `enabled`、`autoRecall`、`autoCurate` 使用真实开关,并直接显示 `recallTopK` 召回结果数量和 `minScore` 最小分数阈值(默认 0)。该阈值用于自动召回,也用于未传 `min_score` 的手动检索。`workspaceId` 与 curator 参数同样保存在 dsh 设置中;端点使用固定的 Memory 默认域名。
3737
- **密钥:** 不写入个人配置文件;设置页只显示当前生效凭据是否已配置及其来源类别,绝不显示值
38-
- **安全控制:** 暂停/恢复会保留云端数据;页面不提供全量清除
38+
- **插件控制:** 通过已安装插件列表右侧的开关启用或停用插件。设置页不再提供暂停/恢复按钮,也不提供全量清除;云端数据保留。
3939
- **诊断:** 异步写入会区分已提交、成功且有变更、成功但无变更和失败。空检索会附带只含哈希与长度的脱敏范围;`bailian_memo_search` 支持可选 `min_score`。
4040

4141
自动更新将 API Key 与 Workspace 视为同一组凭据,先发起只读 Memory 请求验证,再保存两者并显示**凭据已更新**。若 `BAILIAN_MEMO_API_KEY` 来自启动 dsh 的环境变量,它具有更高优先级且无法在页面中替换:请在启动 dsh 的 Shell 或服务中取消该变量、重启 dsh 后重试。

‎packages/bailian-memo-dsh/src/web/MemoCard.module.css‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@
180180

181181
.primaryButton,
182182
.secondaryButton,
183-
.dangerButton,
184183
.resetButton {
185184
padding: 7px 12px;
186185
border-radius: 7px;
@@ -200,12 +199,6 @@
200199
background: transparent;
201200
}
202201

203-
.dangerButton {
204-
color: #b33838;
205-
border-color: color-mix(in srgb, #b33838 45%, transparent);
206-
background: transparent;
207-
}
208-
209202
.resetButton {
210203
padding: 4px 7px;
211204
border: 0;
@@ -215,7 +208,6 @@
215208

216209
.primaryButton:disabled,
217210
.secondaryButton:disabled,
218-
.dangerButton:disabled,
219211
.resetButton:disabled {
220212
opacity: 0.5;
221213
cursor: not-allowed;

‎packages/bailian-memo-dsh/src/web/MemoCard.tsx‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ export function MemoCard(props: MemoCardProps) {
9191
const personal = state.personal;
9292
const canEnable =
9393
!personal || personal.status === "unconfigured" || personal.status === "initializing";
94-
const canPause = personal?.status === "active";
95-
const canResume = personal?.status === "paused";
9694
const autofillStatus = state.consoleLoginStatus;
9795
const loginWaiting = autofillStatus?.phase === "waiting";
9896
return (
@@ -114,28 +112,6 @@ export function MemoCard(props: MemoCardProps) {
114112
) : null}
115113
</div>
116114
) : null}
117-
<div className={css.actions}>
118-
{canPause ? (
119-
<button
120-
type="button"
121-
className={css.dangerButton}
122-
disabled={state.busy}
123-
onClick={() => void props.pause()}
124-
>
125-
{t("pause")}
126-
</button>
127-
) : null}
128-
{canResume ? (
129-
<button
130-
type="button"
131-
className={css.primaryButton}
132-
disabled={state.busy}
133-
onClick={() => void props.resume()}
134-
>
135-
{t("resume")}
136-
</button>
137-
) : null}
138-
</div>
139115
</section>
140116

141117
<section className={css.section} aria-labelledby="bailian-memo-connection-heading">

‎packages/bailian-memo-dsh/src/web/locales.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export const en = {
3939
apiKeyGet: "Get",
4040
fromEnv: "Set by the environment (read-only here)",
4141
enable: "Enable personal memory",
42-
pause: "Pause personal memory",
43-
resume: "Resume personal memory",
4442
consoleLogin: "Fetch from console login",
4543
autofillHint:
4644
"Sign in to the Bailian console to fill in that account’s API key and workspace id.",
@@ -52,7 +50,7 @@ export const en = {
5250
environmentOverrideGuidance:
5351
"BAILIAN_MEMO_API_KEY from the environment that launched dsh takes priority. Unset it in that shell or service and restart dsh before using automatic credential update.",
5452
consent:
55-
"By enabling, selected conversation fragments are sent to Bailian cloud for long-term memory and a basic profile, which may incur charges. Ordinary personal facts may be remembered automatically; sensitive data only when you explicitly ask. Passwords and secrets are never stored. You can pause at any time without deleting cloud data.",
53+
"By enabling, selected conversation fragments are sent to Bailian cloud for long-term memory and a basic profile, which may incur charges. Ordinary personal facts may be remembered automatically; sensitive data only when you explicitly ask. Passwords and secrets are never stored. You can disable the plugin at any time using the switch in the installed plugins list without deleting cloud data.",
5654
automaticTitle: "Automatic behavior",
5755
automaticHint: "Changes are staged until you select Save.",
5856
automaticEnabled: "Automatic memory",
@@ -139,8 +137,6 @@ export const zh: Record<MemoSettingsLocaleKey, string> = {
139137
apiKeyGet: "去获取",
140138
fromEnv: "来自环境变量(此处只读)",
141139
enable: "启用个人记忆",
142-
pause: "暂停个人记忆",
143-
resume: "恢复个人记忆",
144140
consoleLogin: "自动获取",
145141
autofillHint: "登录百炼控制台,自动填入该账号的 API 密钥与工作空间 ID。",
146142
autofillConfigured: "已配置完成,点击按钮重新获取该账号的 API 密钥与工作空间 ID。",
@@ -150,7 +146,7 @@ export const zh: Record<MemoSettingsLocaleKey, string> = {
150146
environmentOverrideGuidance:
151147
"启动 dsh 的环境变量 BAILIAN_MEMO_API_KEY 优先级更高。请在启动 dsh 的 Shell 或服务中取消该变量并重启 dsh,然后再自动更新凭据。",
152148
consent:
153-
"启用即表示同意将选定的对话片段发送到百炼云端,用于长期记忆和基础画像,并可能产生费用。普通个人信息可能自动记忆;敏感信息仅在你明确要求时保存。密码和密钥永不保存。你可以随时暂停,暂停不会删除云端数据。",
149+
"启用即表示同意将选定的对话片段发送到百炼云端,用于长期记忆和基础画像,并可能产生费用。普通个人信息可能自动记忆;敏感信息仅在你明确要求时保存。密码和密钥永不保存。你可以随时通过已安装插件列表右侧的开关停用插件,不会删除云端数据。",
154150
automaticTitle: "自动行为",
155151
automaticHint: "修改会暂存,点击“保存”后生效。",
156152
automaticEnabled: "自动记忆",

‎packages/bailian-memo-dsh/src/web/memo-card-controller.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export interface MemoCardFace extends SettingsFormActions {
112112
memoCard: SnapshotStore<MemoCardState>;
113113
};
114114
enable: () => Promise<void>;
115-
pause: () => Promise<void>;
116-
resume: () => Promise<void>;
117115
consoleLogin: () => Promise<void>;
118116
refresh: () => Promise<void>;
119117
setWorkspaceDraft: (text: string) => void;
@@ -316,14 +314,6 @@ export class MemoCardController {
316314
});
317315
}
318316

319-
async pause(): Promise<void> {
320-
await this.post("/plugins/bailian-memo-dsh/pause");
321-
}
322-
323-
async resume(): Promise<void> {
324-
await this.post("/plugins/bailian-memo-dsh/resume");
325-
}
326-
327317
async consoleLogin(): Promise<void> {
328318
await this.post("/plugins/bailian-memo-dsh/console-login", { site: "domestic" });
329319
}
@@ -367,8 +357,6 @@ export class MemoCardController {
367357
refreshProfileSchemas: () => this.refreshProfileSchemas(),
368358
hooks: { memoCard: this.store },
369359
enable: () => this.enable(),
370-
pause: () => this.pause(),
371-
resume: () => this.resume(),
372360
consoleLogin: () => this.consoleLogin(),
373361
refresh: () => this.refresh(),
374362
setWorkspaceDraft: (text) => this.setWorkspaceDraft(text),

0 commit comments

Comments
 (0)