Files
plugins/packages/respire-memory/page/settings.html
T
luodaoyi f7e0dcb823 respire-memory 0.3.10: diary readback looks up the turn marker lexically and checks every matching candidate (#568)
respire-memory 0.3.10 (luodaoyi, follow-up to #553):

- readDiary looks up the turn's source hash with `diary-search --mode lexical` instead of hybrid, so unrelated semantic matches no longer fill (and overrun) the 4000-character readback budget. Ordinary model diary searches keep the hybrid default.
- readDiary checks every matching candidate (lexical limit 5) for the complete written body, instead of only the first match, so an earlier diary with the same deterministic marker no longer makes a real write "unconfirmed". Source id/version, Unicode ranges, overlap, budgets and no-replay checks are unchanged; any inconsistent fragment still fails closed.
- A model's diary-search/diary-fragment result is held to the requested --max-chars on the compact `details` JSON, in Unicode characters (was: whole envelope <= 8000 UTF-16 units). This is the Runtime's own contract (respire-cli docs/diary-fragments.md: the budget bounds compact-serialized `details`; crates/app/src/diary.rs budget()).
- Settings page and README tell first-time users to install the Respire CLI (`npm install -g rsrs-cli`, risense-ai/respire-cli) and start its Runtime before configuring the plugin; README install line uses the listing's short name `respire-memory`, which magpie's resolver accepts (registry.json name).

Reviewed head 507db0483db4c7caaa49208fb17c93ef436179e2, merged onto origin/main 8b01396, run on mote (macOS):
- packages/respire-memory: `node scripts/check.mjs` and `bun scripts/check.mjs` pass; `bun test` 1 pass 0 fail (Bun 1.4.2).
- root `bun scripts/check.mjs`: exit 0.
- Broken by hand, each red in scripts/check.mjs: readback search back to hybrid (diary-output-too-large); first candidate only (diary-readback-unconfirmed); throw instead of continue on a non-matching candidate; body check removed (missing rejection); old whole-envelope 8000 budget; budget check removed.
- Not guarded by a test (stayed green when broken): the exact budget boundary (only a 4033-vs-4000 fixture; a +33 slack passes), UTF-16 vs code-point counting (fixtures are ASCII), and on the now-lexical readback path the search's own budget check and the source_id filter (the over-budget/unrelated fixtures are hybrid-only).
- Tests use a local http server only; no network.
- Not tried: a real Respire Runtime (author's CI and NPM-LIVE-0.3.10 report cover that). Not on npm yet: first version needs an owner publish; magpie installs it from dist meanwhile.
2026-10-31 22:36:04 +08:00

46 lines
5.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>respire-memory</title><link rel="icon" href="icon.svg" type="image/svg+xml"><link rel="stylesheet" href="style.css">
<script src="_magpie/bridge.js" defer></script><script src="settings.js" defer></script>
</head>
<body><main>
<header><img class="brand brand-light" src="icon-respire-ai-memory-light.svg" width="46" height="46" alt=""><img class="brand brand-dark" src="icon-respire-ai-memory.svg" width="46" height="46" alt=""><div><h1>respire-memory</h1><p>吸即存,呼即取——让 AI Agent 在实践中积累经验,持续自进化。</p></div></header>
<section aria-labelledby="setup-title"><h2 id="setup-title">首次使用:先安装 Respire 本体</h2>
<p>此插件是 Magpie 的接入层,需要另行安装 <a href="https://github.com/risense-ai/respire-cli" target="_blank" rel="noopener noreferrer">Respire CLI(GitHub 安装说明)</a>。它提供记忆库与本地 Runtime;只安装插件还不能读存记忆。</p>
<ol><li>在自己的终端执行 <code>npm install -g rsrs-cli</code>,或从 <a href="https://github.com/risense-ai/respire-cli/releases" target="_blank" rel="noopener noreferrer">CLI Releases</a> 下载对应平台版本。</li>
<li>按 <a href="https://github.com/risense-ai/respire-cli/blob/main/docs/runtime.md" target="_blank" rel="noopener noreferrer">CLI Runtime 指南</a>准备账号、模型,启动并解锁本地 HTTP Runtime。</li>
<li>执行 <code>rsrs --client-only status --json</code> 确认连接,再在下方配置 Runtime 地址及归档生成模型并保存。</li></ol>
<p class="disclosure">插件不会代装 CLI、启动 Runtime 或管理账号;登录与解锁请在 Respire 中完成,不要在此页面输入密码或密钥。</p>
</section>
<form id="form">
<label for="url">本地 Runtime 地址</label>
<input id="url" type="url" required value="http://127.0.0.1:15169" autocomplete="off" spellcheck="false" aria-describedby="url-help">
<small id="url-help">仅连接 127.0.0.1 或 [::1]。请先通过 rsrs 准备好账号、模型和 Runtime。</small>
<label for="project">项目名称(可选)</label>
<input id="project" maxlength="256" autocomplete="off" aria-describedby="project-help">
<small id="project-help">填写后只召回该项目,并为新记录设置此项目。留空使用整个当前记忆库;工作目录不会自动成为项目边界。</small>
<label class="check"><input id="remember" type="checkbox" checked>处理“记住:”“remember:”等显式存储请求</label>
<label class="check"><input id="readOnly" type="checkbox">插件只读:禁止显式存储、采集和后台归档</label>
<label class="check"><input id="showMemoryStatus" type="checkbox">向模型提供 Memory、Used 和上次保存状态提示</label>
<label class="check"><input id="capture" type="checkbox">将每轮完成的对话保存到日记</label>
<p class="disclosure">开启采集后,用户与助手消息、工具参数和结果中的文件内容、命令输出均可能进入 Respire。日记仍按你的同步设置同步;这不会自动提炼为长期结论。</p>
<fieldset><legend>后台记忆整理</legend>
<label class="check"><input id="archive" type="checkbox" checked>每个完成回合自动存过程日记,并提炼、查重和整理长期记忆</label>
<label for="generationBaseUrl">生成服务地址(兼容 Chat Completions)</label>
<input id="generationBaseUrl" type="url" placeholder="https://provider.example/v1" autocomplete="off" spellcheck="false">
<label for="generationModel">生成模型名称</label><input id="generationModel" autocomplete="off" spellcheck="false">
<label for="authorizationEnv">服务凭据所在的环境变量名称</label><input id="authorizationEnv" value="RESPIRE_MAGPIE_AUTHORIZATION" autocomplete="off" spellcheck="false">
<small>仅填变量名,不在此处输入密钥。变量应在 Magpie 启动环境中配置;插件不会读取客户端私有登录凭据。</small>
<label for="stateDir">状态目录(可选,填写绝对路径)</label><input id="stateDir" autocomplete="off" spellcheck="false">
<small>留空使用用户目录的 .rsrs/magpie。状态与待处理证据加密保存在此处;密钥同目录保存,应按敏感资料保护整个目录。</small>
<p class="disclosure">完整读存流程需要配置生成服务。每轮自动归档默认开启;关闭或模型未配置时不能视为满足每轮必存。消息、工具结果与相关记忆会发送给此服务,并产生额外模型用量。宿主只在回复完成后通知,不能保证回复发出前已存;缺失历史或入队前丢失通知仍会漏记。只读开关在后续请求同步给 worker,不会撤销已接受的写入。</p>
</fieldset>
<button id="save" type="submit" disabled>保存配置</button>
<p id="status" role="status" aria-live="polite">正在读取配置…</p>
</form>
<section><h2>使用方式</h2><p>完成上方 Respire CLI 安装与配置后,召回自动执行。“/nomem”或“#nomem”只跳过本条召回;已开启的采集与后台归档仍可运行。存储是否成功以模型收到的引擎回执为准。</p><p>连接失败时先按 <a href="https://github.com/risense-ai/respire-cli" target="_blank" rel="noopener noreferrer">Respire CLI 说明</a>检查本体与 Runtime;原对话会继续。共享网关的其他调用者无法使用此插件读取或保存记忆。</p></section>
</main></body>
</html>