pluoki (on X) runs Mem on a Mac Studio reached over Tailscale. Two limits:
- page/settings.js validUrl() refused any http: URL to a non-loopback host
whatever allowInsecureHttp said, while mem.mjs honoured it, so
http://mac-studio.tailnet.ts.net:14242 could only be set by hand in
Options JSON and the page's Save and Test refused it. The dialog now has
an "Allow HTTP to another machine" switch (Mem service section, same
switch-field component as the others; help text: only on a network you
trust, e.g. Tailscale) that reads and writes allowInsecureHttp, and
validUrl follows it exactly as mem.mjs does; Test checks the saved
option. Turning it off removes the option. All five languages (en, zh,
zh-TW, ja, de) get the new strings; urlHelp and invalidUrl name the
switch.
- The hook took only origin local / magpie-key. recallRemote and
captureRemote (default false, typed booleans, in package.json's options
and the README) let remote and gateway-key requests in, each on its own,
as powercontext's do: captureRemote saves the conversation but recalls
nothing, and neither turns capture on. Unlike powercontext's, a missing
or unknown origin stays out even with both on. powercontext's page has
no switches for these, so this page doesn't either; its "What is sent"
text names the options. Sticky blocks were already keyed by origin.
Run (mote, at this tree on origin/main 53e3820):
- HOME=$(mktemp -d) bun test: 4557 pass, 0 fail, 9 skip (live checks).
- bun scripts/check.mjs: ok.
- The page in Playwright 1.62 chromium and webkit, served over local HTTP
with a stub bridge, in en/zh/zh-TW/ja/de: the tailnet URL is refused
with the switch off and saved with allowInsecureHttp: true with it on;
screenshots checked (en webkit, de chromium).
- Broken by hand, each red then green: validUrl ignoring the option, and
the page never writing it (tailnet page test red); captureRemote
granting recall, the old local-only line, unknown origins counted as
remote (new origin test red); both opt-ins on by default (new test plus
"remote and unknown origins stay out" and the gateway-key test red).
Not tried: a real Mem over a real tailnet, or in the real magpie app; the
hook is driven as magpie's host calls it, and the page through its test
and the Playwright stub.
44 lines
8.0 KiB
HTML
44 lines
8.0 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; HTTP to another machine needs the switch below. No credentials in the URL.</small></label>
|
||
<label class="switch-field" for="insecure-http"><input id="insecure-http" type="checkbox" role="switch"><span><strong data-t="insecureHttp">Allow HTTP to another machine</strong><small data-t="insecureHttpHelp">Only on a network you trust, e.g. Tailscale. Elsewhere your conversations and API key would cross the network unencrypted.</small></span></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. The recallRemote and captureRemote options let them in, each separately; saving does not grant recall.</p></section>
|
||
</main></body></html>
|