The Nowledge Mem page's dialog now sets every option the hook reads, on Magpie's released bridge (options.get/set only), by SadWood. - One Settings dialog: connection, key (an empty field keeps the saved key; Remove saved key / Undo), API key variable, recall and remote recall, Context Bundle, apps without memory, capture and remote capture, the human-dialogue filter (a switch, Cindy only with it on, tool results only with it off) and the advanced numbers. Remote HTTP needs the Advanced exception. - A × beside a field that holds an explicit value returns it to the default. Saving re-reads the options, writes only edited fields, and refuses (keeping the draft) when one of them, or a gate's remote grant or the endpoint behind a newly allowed HTTP exception, changed elsewhere. - page/validate.js is shared by the page and resolveOptions, so both refuse the same values. - The footer wraps at narrow widths (German Save was cut off at 380px). - No native select. Every language has every key; the English fallback loop is gone. Reviewed at 75a09d19e, run merged onto main04f3608(main's later24cd0b9touches packages/cursor only). Mac mini, Bun 1.4.2, temp HOME: - packages/nowledge-mem: 130 pass, 2 skip (live Mem, Linux-only Chrome layout), 0 fail. - whole repo bun test: 4699 pass, 12 skip, 0 fail. bun scripts/check.mjs: exit 0. - PR CI at this head ran the Linux Chrome layout test (pass, 30 layouts) and 4587 pass. - Browser harness: page/ framed with sandbox="allow-scripts", magpie's CSP and magpie's real pagebridge.js; Chromium and WebKit, en/zh/zh-TW/ja/de, 320/380/900px, light/dark (60 runs). No request beyond the page's own files, no console or page errors, the key never in the DOM, no select, no overflow, key field password again after show/close/reopen, recallRemote shown but disabled while recall is off. Flows (en 380, both engines): editing Space gives one options.set keeping custom, apiKey, requestTimeoutMs:900, skipAgents and recallRemote; http://100.64.0.5 refused until the HTTP exception is on, then saved; a Space changed elsewhere conflicts and writes nothing; Bearer key replaces and empties the field; Remove saved key deletes apiKey; turning recall on keeps recallRemote. Broken by hand: - Main's footer CSS back: the harness flags 12 runs (en 320, de 320/380, both engines). - settings.js dependency check off: "enabling a global gate conflicts…" and "enabling HTTP exception conflicts…" go red. - validateExplicitOptions removed from resolveOptions: two hook option tests go red. Not tried: a real Mem server.
67 lines
13 KiB
HTML
67 lines
13 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="validate.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">Settings</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">Nowledge Mem settings</h2><p id="dialog-description" data-t="settingsIntro">Configure connection, recall and saving.</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 without credentials in the URL. Remote HTTP requires the advanced exception. Empty uses NMEM_API_URL or the local default.</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>
|
||
<label for="host-agent"><span data-t="hostAgent">Host agent ID</span><input id="host-agent" autocomplete="off" aria-describedby="host-agent-help"><small id="host-agent-help" data-t="hostAgentHelp">Empty derives an identity from the harness.</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-storage 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>
|
||
<button id="key-clear" type="button" class="secondary key-clear" aria-pressed="false" hidden>Remove saved key</button>
|
||
<small id="key-storage" data-t="keyHelp">Saved in Magpie’s local plugin configuration.</small>
|
||
<small id="key-help" data-t="keyActionHelp">Clearing the saved value falls back to the environment variable; it does not disable it.</small>
|
||
<label for="key-env"><span data-t="keyEnv">API key environment variable</span><input id="key-env" placeholder="NMEM_API_KEY" aria-describedby="key-env-help"><small id="key-env-help" data-t="keyEnvHelp">Only NMEM_* names are accepted. Empty uses NMEM_API_KEY.</small></label>
|
||
</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" aria-describedby="recall-help"><span><strong data-t="recall">Memory recall</strong><small id="recall-help" 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="recall-remote"><input id="recall-remote" type="checkbox" role="switch" aria-describedby="recall-remote-help"><span><strong data-t="recallRemote">Recall for remote and other gateway keys</strong><small id="recall-remote-help" data-t="recallRemoteHelp">Requires recall. May share the configured Mem memories and Context Bundle with all such clients. This is not tenant isolation.</small></span></label>
|
||
<label class="switch-field" for="context"><input id="context" type="checkbox" role="switch" aria-describedby="context-help"><span><strong data-t="contextLabel">Context Bundle</strong><small id="context-help" 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" aria-describedby="capture-help"><span><strong data-t="capture">Save conversations</strong><small id="capture-help" data-t="captureHelp">Off by default. Import completed conversations as Mem Threads, which Mem distills into Memory.</small></span></label>
|
||
<label class="switch-field" for="capture-remote"><input id="capture-remote" type="checkbox" role="switch" aria-describedby="capture-remote-help"><span><strong data-t="captureRemote">Save remote and other gateway conversations</strong><small id="capture-remote-help" data-t="captureRemoteHelp">Requires saving conversations. Saves conversations from all such clients to this Mem.</small></span></label>
|
||
</fieldset>
|
||
<fieldset class="settings-section"><legend><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16l-6 7v5l-4 2v-7z"/></svg><span data-t="filterSection">Saving and filtering</span></legend><div class="fields">
|
||
<label class="switch-field" for="capture-tools"><input id="capture-tools" type="checkbox" aria-describedby="capture-tools-help"><span><strong data-t="captureTools">Include client tool results</strong><small id="capture-tools-help" data-t="captureToolsHelp">Used only when the human-dialogue filter is off.</small></span></label>
|
||
<label class="switch-field" for="capture-filter"><input id="capture-filter" type="checkbox" role="switch" aria-describedby="filter-help"><span><strong data-t="humanOnly">Only human dialogue</strong><small id="filter-help" data-t="filterHelp">Exclude tool results from saved conversations.</small></span></label>
|
||
<label class="switch-field" for="capture-cindy"><input id="capture-cindy" type="checkbox" aria-describedby="cindy-help"><span><strong data-t="captureCindy">Clean recognized Cindy wrappers in human mode</strong><small id="cindy-help" data-t="cindyHelp">Available when only human dialogue is enabled.</small></span></label>
|
||
</div></fieldset>
|
||
<fieldset class="settings-section"><legend><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h16M4 17h16M8 4v6M16 14v6"/></svg><span data-t="advanced">Advanced</span></legend><div class="fields">
|
||
<label for="max-memories"><span data-t="maxMemories">Maximum memories (1–20)</span><input id="max-memories" aria-describedby="defaults-help" type="number" min="1" max="20" placeholder="5"></label>
|
||
<label for="max-bytes"><span data-t="maxBytes">Recall bytes (512–32768)</span><input id="max-bytes" aria-describedby="defaults-help" type="number" min="512" max="32768" placeholder="6000"></label>
|
||
<label for="request-timeout"><span data-t="requestTimeout">Request timeout ms (50–5000)</span><input id="request-timeout" aria-describedby="defaults-help" type="number" min="50" max="5000" placeholder="1500"></label>
|
||
<label for="recall-backoff"><span data-t="recallBackoff">Recall backoff ms (100–300000)</span><input id="recall-backoff" aria-describedby="defaults-help" type="number" min="100" max="300000" placeholder="30000"></label>
|
||
<label for="gateway-timeout"><span data-t="gatewayTimeout">Host hook timeout ms (100–10000)</span><input id="gateway-timeout" aria-describedby="defaults-help" type="number" min="100" max="10000" placeholder="1000"></label>
|
||
<label for="port"><span data-t="port">Connection-test port (1024–65535)</span><input id="port" aria-describedby="defaults-help" type="number" min="1024" max="65535" placeholder="3479"></label>
|
||
<label class="switch-field" for="insecure"><input id="insecure" type="checkbox" aria-describedby="insecure-help"><span><strong data-t="insecure">Allow HTTP to a non-local server (credentials travel unencrypted)</strong><small id="insecure-help" data-t="insecureHelp">Use only on a trusted network.</small></span></label>
|
||
<small id="defaults-help" data-t="defaultsHelp">Empty fields inherit the environment where supported, otherwise use the shown default. Unchanged values remain as configured. The host timeout can end a request first.</small>
|
||
</div></fieldset>
|
||
<small data-t="concurrencyHelp">Saving merges your edits into the latest settings, but another editor saving at the same moment can still overwrite them. Use one editor at a time. Very large integers in options may be rounded.</small>
|
||
<p id="result" role="status" aria-live="polite" hidden></p>
|
||
</div><footer><span><span data-t="saveHelp">Unchanged and unlisted options are preserved.</span></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">By default, 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. The recallRemote and captureRemote options let them in, each separately; saving does not grant recall.</p></section>
|
||
</main></body></html>
|