Files
plugins/packages/nowledge-mem/page/settings.html
T
yetone dda4afdc36 nowledge-mem 0.1.6: requestTimeoutMs and the hook budget go up to 30s (#926)
A deep Mem search can take longer than 5s, and the page refused any
requestTimeoutMs over 5000 or gatewayTimeoutMs over 10000. Both now go up
to 30000; the defaults (1500 and magpie's 1000) are unchanged. magpie
v0.1.3538 (yetone/magpie#5890) runs a hook up to its own 30s budget;
the README says an older magpie cuts anything over 10s.

- validate.js, settings page and labels (en, zh, zh-TW, ja, de): 50-30000
  and 100-30000.
- nowledge-mem-agent checked: its 10000 ms values are fixed internal
  timeouts, not user options with a cap; unchanged.
- slow-recall.test.mjs: a fixture server answers /memories/search after
  6100 ms; requestTimeoutMs 15000 recalls it, 30001 is invalid, and a
  caller abort stops the fetch at once (the server sees the abort) and
  keeps the request as it came.

Run (wsl-run, magpie-desktop): bun test packages/nowledge-mem
packages/nowledge-mem-agent: 161 pass, 2 skip (live Mem and the
Playwright layout check, skipped as on main), 0 fail; bun
scripts/check.mjs: rc 0. The README's magpie version was filled in after
that run.
Not tried: a real Nowledge Mem server with a slow deep search.

Reported-by: aboat0625-cpu
2026-11-10 15:31:40 +08:00

67 lines
13 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="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–30000)</span><input id="request-timeout" aria-describedby="defaults-help" type="number" min="50" max="30000" 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–30000)</span><input id="gateway-timeout" aria-describedby="defaults-help" type="number" min="100" max="30000" 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>