Files
plugins/packages/nowledge-mem/package.json
T
yetone debc0f7b53 nowledge-mem 0.1.4: a tailnet HTTP server from the page, and recallRemote/captureRemote opt-ins (#608)
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.
2026-11-02 02:38:06 +08:00

66 lines
1.5 KiB
JSON

{
"name": "@magpie-community/gateway-nowledge-mem",
"version": "0.1.4",
"description": "Nowledge Mem recall, Context Bundle and optional conversation capture at the Magpie gateway, for every connected harness",
"type": "module",
"files": [
"service.mjs",
"probe.mjs",
"mem.mjs",
"nowledge-mem.hooks.mjs",
"conversation.mjs",
"capture-filter.mjs",
"CAPTURE_FILTER.md",
"README.md",
"page"
],
"keywords": [
"magpie",
"magpie-gateway",
"nowledge-mem",
"memory",
"llm-gateway"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/nowledge-mem"
},
"magpie": {
"hooks": "./nowledge-mem.hooks.mjs",
"options": {
"apiKeyEnv": "NMEM_API_KEY",
"recall": true,
"contextBundle": true,
"maxMemories": 5,
"maxBytes": 6000,
"requestTimeoutMs": 900,
"recallBackoffMs": 30000,
"capture": false,
"captureTools": true,
"captureFilter": "off",
"captureCindy": false,
"recallRemote": false,
"captureRemote": false,
"port": 3479
},
"page": {
"title": "Nowledge Mem",
"file": "page/settings.html",
"icon": "page/icon.svg",
"service": {
"port": 3479,
"option": "port"
}
}
},
"scripts": {
"check": "bun test ./*.test.mjs"
},
"engines": {
"bun": ">=1.4.2"
},
"main": "./service.mjs"
}