QingZ11 relayed a user whose Doubao translator, behind magpie, had Mem
recall added to every translation. The plugin had one global recall
switch, so the only way out was turning memory off for every agent.
skipAgents (option, and "Apps without memory" on the plugin page) lists
apps by the agent name magpie gives a request (ctx.agent, the Agent
column on magpie's Usage page). A listed app's request is treated like
another machine's: no search, no Context Bundle, no capture, nothing
sent to Mem, request unchanged, reported "skipped". Names compare
without case, spaces or punctuation, so "Claude Code" matches
claude-code. A list or a comma-separated string (ASCII or full-width
comma). Default empty: nothing changes for anyone who doesn't set it.
Run (mote, at this tree on origin/main 1a3a138):
- HOME=$(mktemp -d) bun test: 4529 pass, 0 fail, 9 skip (live checks).
- bun scripts/check.mjs: ok.
- Broken by hand: without the skipAgents check in run(), the new test
goes red (1 fail), green with it.
Not tried: a real magpie with a real translator app; the hook's ctx is
driven as magpie's host calls it, and the page script through its test.
43 lines
7.5 KiB
HTML
43 lines
7.5 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>Nowledge Mem</title><link rel="stylesheet" href="style.css">
|
||
<script src="_magpie/bridge.js" defer></script><script src="i18n.js" defer></script><script src="settings.js" defer></script></head>
|
||
<body><main>
|
||
<header class="page-head"><img class="brand" src="icon.svg" width="30" height="30" alt=""><div><h1>Nowledge Mem</h1><p data-t="intro">Recall your Mem memory in every agent behind Magpie.</p></div><div class="header-actions"><button id="configure" type="button" disabled data-t="configure">Configure connection</button><button id="test-saved" class="secondary" type="button" disabled data-t="testConnection">Test connection</button></div></header>
|
||
<section class="panel"><div class="section-heading"><h2 data-t="connection">Connection</h2><span id="configured" role="status"></span></div>
|
||
<dl class="connection-summary"><div><dt data-t="url">Server URL</dt><dd id="summary-url">—</dd></div><div><dt data-t="space">Space ID</dt><dd id="summary-space">—</dd></div><div><dt data-t="recall">Memory recall</dt><dd id="summary-recall">—</dd></div><div><dt data-t="skipAgents">Apps without memory</dt><dd id="summary-skip">—</dd></div><div><dt id="summary-capture-label" data-t="capture">Save conversations</dt><dd class="capture-status"><input id="summary-capture" class="slide-switch" type="checkbox" role="switch" disabled aria-labelledby="summary-capture-label" aria-describedby="capture-feedback"><span id="capture-state"></span></dd></div></dl>
|
||
<p id="capture-feedback" role="status" aria-live="polite" hidden></p></section>
|
||
<dialog id="settings" aria-labelledby="dialog-title" aria-describedby="dialog-description">
|
||
<div class="dialog-head">
|
||
<img class="brand" src="icon.svg" width="24" height="24" alt="">
|
||
<div><h2 id="dialog-title" data-t="dialogTitle">Connection settings</h2><p id="dialog-description" data-t="settingsIntro">Connect Magpie to your Nowledge Mem.</p></div>
|
||
<button id="close" class="icon-button" type="button" aria-label="Close">×</button>
|
||
</div>
|
||
<form id="form" novalidate><div class="dialog-body">
|
||
<fieldset class="settings-section"><legend><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="4" width="18" height="6" rx="2"/><rect x="3" y="14" width="18" height="6" rx="2"/><path d="M7 7h.01M7 17h.01M16 7h2M16 17h2"/></svg><span data-t="serviceSection">Mem service</span></legend>
|
||
<div class="fields">
|
||
<label for="url"><span data-t="url">Server URL</span><input id="url" type="url" placeholder="http://127.0.0.1:14242" autocomplete="off" spellcheck="false" aria-describedby="url-help"><small id="url-help" data-t="urlHelp">Local HTTP or remote HTTPS. No credentials in the URL.</small></label>
|
||
<label for="space"><span data-t="space">Space ID</span><input id="space" placeholder="default" autocomplete="off" spellcheck="false" aria-describedby="space-help"><small id="space-help" data-t="spaceHelp">Optional. Leave empty for the default Space.</small></label>
|
||
<label for="agent"><span data-t="agent">Agent ID</span><input id="agent" placeholder="default" autocomplete="off" spellcheck="false" aria-describedby="agent-help"><small id="agent-help" data-t="agentHelp">Optional. Selects an agent profile and its default Space in Mem.</small></label>
|
||
</div></fieldset>
|
||
<fieldset class="settings-section"><legend><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="8" cy="9" r="5"/><path d="m12 12 8 8h2v-4h-3v-3h-3"/></svg><span data-t="authSection">Authentication</span></legend>
|
||
<label for="key"><span data-t="key">API key</span></label><div class="secret-input"><input id="key" type="password" autocomplete="off" spellcheck="false" autocapitalize="off" aria-describedby="key-help"><button id="show-key" type="button" class="secret-toggle" aria-controls="key" aria-pressed="false" aria-label="Show key" title="Show key"><svg class="eye-show" viewBox="0 0 24 24" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg><svg class="eye-hide" viewBox="0 0 24 24" aria-hidden="true"><path d="m3 3 18 18M10.6 5.1A12 12 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.1 4.1M6.5 6.5A20 20 0 0 0 2 12s3.5 7 10 7a12 12 0 0 0 5.5-1.5M9.9 9.9a3 3 0 0 0 4.2 4.2"/></svg></button></div><small id="key-help" data-t="keyHelp">Leave empty when your Mem does not require a key. Saved in Magpie’s local plugin configuration.</small><small data-t="keyFallback">With this field empty, Magpie reads the variable named in apiKeyEnv (NMEM_API_KEY by default).</small>
|
||
</fieldset>
|
||
<fieldset class="settings-section"><legend><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v4M12 17v4M4.9 4.9l2.8 2.8M16.3 16.3l2.8 2.8M3 12h4M17 12h4M4.9 19.1l2.8-2.8M16.3 7.7l2.8-2.8"/></svg><span data-t="behaviorSection">What Magpie sends</span></legend>
|
||
<label class="switch-field" for="recall"><input id="recall" type="checkbox" role="switch"><span><strong data-t="recall">Memory recall</strong><small data-t="recallHelp">Search Mem with the latest user turn and add what it recalls to the request.</small></span></label>
|
||
<label class="switch-field" for="context"><input id="context" type="checkbox" role="switch"><span><strong data-t="contextLabel">Context Bundle</strong><small data-t="contextHelp">On a session’s first turn, also send your profile, rules and Working Memory.</small></span></label>
|
||
<label for="skip-agents"><span data-t="skipAgents">Apps without memory</span><input id="skip-agents" placeholder="Mozilla" autocomplete="off" spellcheck="false" aria-describedby="skip-agents-help"><small id="skip-agents-help" data-t="skipAgentsHelp">Optional. App names as Magpie’s Usage page shows them, separated by commas. Their requests get no recall and are never saved.</small></label>
|
||
<label class="switch-field" for="capture"><input id="capture" type="checkbox" role="switch"><span><strong data-t="capture">Save conversations</strong><small data-t="captureHelp">Off by default. Import completed conversations as Mem Threads, which Mem distills into Memory.</small></span></label>
|
||
</fieldset>
|
||
<p id="result" role="status" aria-live="polite" hidden></p>
|
||
</div><footer><span data-t="saveHelp">Advanced options are preserved.</span><div class="actions"><button id="cancel" class="secondary" type="button" data-t="cancel">Cancel</button><button id="save" type="button" disabled data-t="save">Save configuration</button></div></footer>
|
||
</form></dialog>
|
||
<section class="panel tools-panel" aria-labelledby="tools-title">
|
||
<h2 id="tools-title" data-t="toolsTitle">Memory tools</h2>
|
||
<p data-t="toolsIntro">This plugin does not add a Library entry. To give agents Mem’s tools, add Mem’s own MCP server once in Magpie’s Library › MCP, using the Server URL below (NMEM_API_URL when it is empty) and its key.</p>
|
||
</section>
|
||
<section class="data-notice" aria-labelledby="data-title"><h2 id="data-title" data-t="dataTitle">What is sent</h2><p data-t="recallDisclosure">Recall sends the latest user turn to the configured Mem URL (NMEM_API_URL when Server URL is empty, else the local default), even when saving conversations is off.</p><p data-t="captureDisclosure">Saving conversations is off by default. When enabled, completed user and assistant turns are imported to that Mem, plus client tool results unless captureTools is off.</p>
|
||
<p data-t="scopeDisclosure">Recall and saving apply to direct local requests and to the Magpie sharing key this computer writes into your own agents (magpie-key). Other gateway keys, a sharing key from another machine, and remote requests are not included.</p></section>
|
||
</main></body></html>
|