-
Notifications
You must be signed in to change notification settings - Fork 4
Read Only Viewer
Language: English · 简体中文
lwc view starts a local browser interface for inspecting one live Wiki. It is a foreground, loopback-only server that reads current state without migrating, refreshing, indexing, or mutating the project.
Use it to understand a Wiki visually. Use the CLI for every write, recovery, and acceptance workflow.
lwc --scope project view
lwc --scope project view --port 4173 --no-openThe default port is 0, so the operating system selects an available port. Startup prints JSON containing the URL, bound address, read_only=true, and whether LWC opened a browser.
Without --no-open, LWC tries the platform browser launcher. If that fails, open the printed URL manually. Press Ctrl+C in the launching terminal to stop the server.
Viewer is a live-Wiki command. It rejects --scope all and a changeset selector.
| Section | Data shown | Boundary |
|---|---|---|
| Overview | Database path, revision, operation ID, Page and Source counts | Current selected Wiki |
| Pages | Page list and rendered Markdown body | At most 1,000 listed Pages |
| Sources | Source ID, title or origin, and byte count | At most 1,000 listed Sources |
| Knowledge graph | Links between canonical Wiki Pages | At most 1,000 nodes and 5,000 edges |
| Code graph | Nodes and edges from the project CodeGraph database | Available only after lwc cg init; at most 1,000 nodes and 5,000 edges |
| Word graph | Query-bounded term-to-document sample | 25 documents and 30 terms per page |
The Knowledge graph tab is the Wiki Page-link network. It is assembled from canonical Pages and [[wikilinks]]; it is not a dump of the external Grafeo/SurrealDB document graph.
The Code graph tab reads the existing project-local CodeGraph database in SQLite read-only mode. Viewer never downloads CodeGraph, runs cg init, or refreshes the index. If the index is unavailable, the tab reports how to initialize it outside Viewer.
The Word graph starts empty. Enter up to eight searchable terms; LWC retrieves a bounded candidate page of documents and then derives only the terms and memberships inside that sample.
The browser requests 25 documents and 30 terms at a time and exposes Previous/Next pagination. The API clamps larger requests and reports truncation diagnostics. This design prevents dense token data from loading as one global graph.
See Word graph for tokenization, limits, and interpretation rules.
Knowledge, code, and word graphs share one local 3D relationship view:
- drag to rotate;
- scroll to zoom;
- labels remain attached to nodes;
- higher-degree nodes receive stronger visual emphasis;
- the footer reports visible node and edge counts and whether a bound truncated the view.
The visualization is for exploration, not a graph consistency check. Use the relevant CLI commands for exact nodes, paths, impact, Work, and verification.
Viewer starts in English. Use the 中文 / EN control to switch interface language. The choice is stored in browser local storage.
Only interface copy changes. LWC does not translate authored Page bodies, Source titles, identifiers, code symbols, or graph labels.
Viewer:
- binds only to
127.0.0.1; - exposes GET and HEAD routes; write methods receive HTTP 405;
- opens Wiki and CodeGraph databases read-only;
- never initializes or switches a graph engine;
- never starts document-graph construction or CodeGraph indexing;
- never refreshes historical Source revisions;
- serves embedded JavaScript and CSS without a CDN or Node.js runtime;
- sanitizes rendered Markdown and removes scripts, active embeds, images, inline style attributes, and style elements;
- sends a restrictive Content Security Policy and
nosniffheaders.
Starting Viewer and reading every endpoint must leave durable project state unchanged. SQLite may maintain transient read-lock bookkeeping, but Viewer does not perform a canonical or derived write.
Loopback binding prevents direct network exposure; it is not an authentication layer. Other processes running as the same host user may still reach the random local port while Viewer is active.
- Do not proxy the URL to a public interface.
- Do not run Viewer on an untrusted shared account.
- Stop it after inspection.
- Treat Page bodies, Source origins, code paths, and graph labels as potentially sensitive project data.
The server embeds all assets and sets frame-ancestors 'none', but browser extensions and local malware remain outside LWC's trust boundary.
Viewer uses these local read APIs:
GET /api/status
GET /api/pages?limit=1000&offset=0
GET /api/pages/{slug}
GET /api/sources?limit=1000&offset=0
GET /api/graphs/knowledge
GET /api/graphs/code
GET /api/graphs/words?query=...&limit=25&term_limit=30&offset=0
These endpoints are an implementation surface for the embedded UI, not a versioned remote integration API. Automation should prefer the stable lwc JSON CLI or read-only MCP tool.
-
view_bind_failed: choose port0or another free loopback port. - Browser did not open: rerun with
--no-openand use the printed URL. - Code graph unavailable: run
lwc --scope project cg status, then initialize outside Viewer with explicit consent when needed. - Word graph rejects a query: provide one to eight searchable terms.
- Graph looks truncated: use CLI graph exploration or the next Word graph sample instead of increasing the whole visualization without bounds.
- Data looks stale: stop Viewer, repair or refresh through the appropriate CLI workflow, verify it, and start a new Viewer process.
A Viewer inspection is complete when:
- startup reports loopback URL and
read_only=true; - the intended Page, Source, or bounded graph sample is visible;
- unavailable graph capabilities remain disabled rather than being initialized implicitly;
- CLI verification is used for any conclusion about correctness;
- Ctrl+C stops the foreground server and closes the port;
- durable Wiki and index state did not change because of Viewer requests.
LWC Wiki
- Home · 首页
- Project overview · 项目简介
- Basic concepts · 基本概念
- Use cases · 应用场景
- Installation and upgrades · 安装与升级
- Quick start · 快速开始
- Persistent memory · 持久记忆体系
- Agent workflow and memory policy · Agent 工作流与主动记忆策略
- Sources and ingestion · 来源与知识整合
- Wiki pages and provenance · Wiki 页面与来源证明
- Search and context · 搜索与上下文载入
- Document knowledge graph · 文档知识图(记忆图网)
- Code graph · 代码图
- Word graph · 词图
- Tags and strong context · 标签与强上下文
- Document conversion · 文档转换
-
MCP server and
lwc_explore· MCP 服务与lwc_explore - Skills, Hooks, and Instructions · Skills、Hooks 与 Instructions
- AgentTarget installation · AgentTarget 安装与集成
- Changesets · Changeset 原子变更
- Work system · Work 任务系统
- Checkpoints and rollback · Checkpoint、恢复与回滚
- Read-only Viewer · 只读可视化界面
- Architecture overview · 总体架构
- Storage and data model · 存储与数据模型
- Retrieval and indexing · 检索与索引设计
- Graph projection and performance · 图投影与性能设计
- MCP, Hooks, and AgentTarget design · MCP、Hook 与 AgentTarget 设计
- Safety and trust boundaries · 安全模型与信任边界
- Maintenance and diagnostics · 维护与诊断
- Troubleshooting and FAQ · 故障排查与常见问题
- Migration and compatibility · 迁移与版本兼容
- Support and issue reporting · 获取帮助与问题反馈
- CLI and configuration reference · CLI 与配置参考
- JSON output and error contract · JSON 输出与错误契约
- Limits and glossary · 系统限制与术语表
- Contributing and development · 贡献与开发指南
- Testing and release process · 测试与发布流程
- Wiki style guide · Wiki 编写规范