@pananfly/dsh-llm-wiki
Repository: https://github.com/pananfly/dsh-llm-wiki · npm: @pananfly/dsh-llm-wiki
中文 | English
DeepSeek Harness (DSH) native port of pi-llm-wiki. Provides a self-maintaining, Obsidian-compatible OKF v0.2 knowledge vault directly inside DSH sessions.
Zero usage change ("用法不要改变"): Keep the exact same 16 slash commands, 17 tools, .llm-wiki/ OKF v0.2 vault format, and personal vault fallback while running seamlessly on DSH's Cordis architecture.
Features
- Full DSH Cordis Native Plugin: Plugs into DSH lifecycle via
cordis.patch.yml and apply(ctx, config) with @deepseek-ai/schemastery schema validation.
- Dual-Host Compatibility: Runs as a DSH native plugin (
ctx.tools, ctx.commands, ctx.systemPrompt, ctx.tools.guard) or as a Pi / Oh-My-Pi extension (default(pi)).
- 17 Agent Tools: Strict DSH JSON-Schema compliance verified against official
@deepseek-ai/dsh-tools assertSupportedJsonSchema.
- 16 Slash Commands:
- Direct fast inspection commands (
/wiki-status, /wiki-lint, /wiki-dashboard, /wiki-settings, /wiki-model, /wiki-trajectories).
- Collaborative agent prompts (
/wiki-init, /wiki-ingest, /wiki-query, /wiki-record, /wiki-retro, /wiki-skills, /wiki-digest, /wiki-discover, /wiki-run, /wiki-req).
- Obsidian OKF v0.2 Vault: Standard Markdown pages with YAML frontmatter, wikilinks (
[[target]] and [text](/folder/page.md)), automatic backlink index, and atomic metadata projection.
- DSH Vault Guardrails: Intercepts
fs_write, str_replace_editor, and shell modifications via ctx.tools.guard to protect immutable raw sources, meta projections, and INDEX.md. Auto-rebuilds metadata on page edits via tools/result hook.
- Ambient Recall & System Prompt: Automatically retrieves relevant project knowledge and injects it through
ctx.systemPrompt.section without polluting conversation turns or invalidating provider prompt caches.
Installation
In DeepSeek Harness (DSH)
dsh plugin --profile web add /path/to/dsh-llm-wiki
dsh plugin --profile web add @pananfly/dsh-llm-wiki
dsh --profile web
Automatic Bundle Injection (cordis.patch.yml)
When installed, cordis.patch.yml automatically mounts the plugin into DSH:
- insert:
- id: dsh-llm-wiki
name: "@pananfly/dsh-llm-wiki"
config:
ambientRecall: true
autoBootstrap: true
notices: true
ambientPersonalVault: true
trajectories: true
Configuration Options
ambientRecall | boolean | true | Automatically recall relevant knowledge into system prompt on agent turns |
autoBootstrap | boolean | true | Automatically bootstrap a pending vault when none exists |
notices | boolean | true | Emit status line notices when pages are recalled |
ambientPersonalVault | boolean | true | Fallback to personal vault (~/.llm-wiki/) when project vault is absent |
trajectories | boolean | true | Enable trajectory working memory and skill distillation tools |
Slash Commands (16)
/wiki-status | Instant | Display wiki health, page counts by type, orphan count, and blocking issues |
/wiki-lint [--fix] | Instant | Audit wikilinks, OKF schema, frontmatter syntax, and auto-repair |
/wiki-dashboard | Instant | Print comprehensive vault summary table and statistics |
/wiki-settings | Instant | Inspect background task models, embedding provider, and configuration |
/wiki-model | Instant | View or switch model used for background synthesis & embeddings |
/wiki-trajectories | Instant | Toggle or check status of trajectory skill distillation |
/wiki-init [topic] | Workflow | Guide the agent to bootstrap and structure an OKF v0.2 vault |
/wiki-ingest [file/url] | Workflow | Extract, categorize, summarize, and link new knowledge sources |
/wiki-query <question> | Workflow | Run multi-source hybrid search across the vault to answer inquiries |
/wiki-record | Workflow | Turn current conversation learnings into structured wiki pages |
/wiki-retro | Workflow | Conduct session retrospective and capture durable insights |
/wiki-skills | Workflow | Distill reusable workflows and techniques into vault skills |
/wiki-digest | Workflow | Synthesize recent changes and create structured summaries |
/wiki-discover | Workflow | Identify knowledge gaps, contradictions, and missing connections |
/wiki-run | Workflow | Run scheduled vault maintenance and recurring workflows |
/wiki-req | Workflow | Manage atomic requirement specifications and traceability links |
Tools (17)
All tools are registered into ctx.tools and validated against DSH's supported JSON Schema rules:
wiki_bootstrap: Initialize an OKF v0.2 vault with topic, mode, schema, and directory layout.
wiki_capture_source: Ingest raw source content (URL, Markdown, text) into immutable raw/sources/.
wiki_ingest: Synthesize captured sources into typed knowledge pages (wiki/sources/, wiki/entities/).
wiki_ensure_page: Create or update typed wiki pages with automatic frontmatter and backlinks.
wiki_search: Search vault pages by keywords, tags, types, or categories.
wiki_lint: Health-check wikilinks, frontmatter schemas, orphans, and broken references.
wiki_status: Retrieve structured JSON snapshot of wiki metrics and health.
wiki_rebuild_meta: Rebuild registry.json, backlinks.json, and directory index files.
wiki_reindex_embeddings: Regenerate vector embeddings for semantic hybrid search.
wiki_log_event: Append audit events to meta/events.jsonl.
wiki_watch: Track file changes and trigger incremental indexing.
wiki_recall: Query the vault for relevant pages with similarity ranking and link expansion.
wiki_retro: Extract insights and learnings from conversational trajectories.
wiki_observe: Record episodic agent observations during task execution.
wiki_capture_trajectory: Save execution trajectories for working-memory analysis.
wiki_distill_skills: Distill procedural capabilities into reusable skill specifications.
wiki_recall_skill: Search and activate distilled skills for current problem context.
Vault Architecture (OKF v0.2)
.llm-wiki/ # Project vault (or ~/.llm-wiki/ for personal fallback)
├── config.json # Vault settings: topic, mode, knowledge_format
├── WIKI_SCHEMA.md # Machine-readable ownership & linking rules
├── raw/ # Immutable captured inputs
│ └── sources/ # Source packets (manifest.json, extracted.md)
├── wiki/ # Human & model editable knowledge pages
│ ├── entities/ # Tools, people, organizations, systems
│ ├── concepts/ # Patterns, architectures, algorithms
│ ├── sources/ # Processed source document summaries
│ ├── syntheses/ # Cross-domain synthesis & tension maps
│ └── requirements/ # Atomic system requirements
└── meta/ # Generated projections (do NOT edit manually)
├── events.jsonl # Append-only authoritative activity log
├── registry.json # Page catalog, metadata index
├── backlinks.json # Inbound/outbound graph index
└── index.md # Rendered table of contents
Development
pnpm install
pnpm build
pnpm typecheck
pnpm test
License
MIT © pananfly