fix(memory-wiki): route bridge CLI through gateway

Route Memory Wiki bridge-mode status, doctor, and bridge import CLI paths through Gateway RPC when bridge artifact reads are active, while preserving local/offline fallbacks.

Harden Gateway CLI rendering and imported-source writes: validate RPC response shapes, bound response strings before rendering/JSON serialization, sanitize/escape terminal-controlled output, avoid redundant JSON forwarding, and replace imported source pages through a temp-file rename path with symlink and hardlink regressions.

Fixes #65722
Fixes #65976
Fixes #66082
Fixes #67979
Fixes #68371
Fixes #68828
Fixes #69019
Fixes #70181
Fixes #70242
Fixes #70842

Thanks @moorsecopers99, @vincentkoc, and @prasad-yashdeep.
This commit is contained in:
Vincent Koc
2026-04-28 03:22:12 -07:00
committed by GitHub
parent f12dedb5c8
commit e2f3044b8f
7 changed files with 748 additions and 20 deletions

View File

@@ -68,10 +68,18 @@ Inspect current vault mode, health, and Obsidian CLI availability.
Use this first when you are unsure whether the vault is initialized, bridge mode
is healthy, or Obsidian integration is available.
When bridge mode is active and configured to read memory artifacts, this command
queries the running Gateway so it sees the same active memory plugin context as
agent/runtime memory.
### `wiki doctor`
Run wiki health checks and surface configuration or vault problems.
When bridge mode is active and configured to read memory artifacts, this command
queries the running Gateway before building the report. Disabled bridge imports
and bridge configs that do not read memory artifacts remain local/offline.
Typical issues include:
- bridge mode enabled without public memory artifacts
@@ -168,6 +176,11 @@ source pages.
Use this in `bridge` mode when you want the latest exported memory artifacts
pulled into the wiki vault.
For active bridge artifact reads, the CLI routes the import through Gateway RPC
so the import uses the runtime memory plugin context. If bridge imports are
disabled or artifact reads are turned off, the command keeps the local/offline
zero-import behavior.
### `wiki unsafe-local import`
Import from explicitly configured local paths in `unsafe-local` mode.