@agent-wiki/mcp 0.17.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +7 -0
- package/README.md +171 -0
- package/architecture.svg +58 -0
- package/dist/atlassian.d.ts +63 -0
- package/dist/atlassian.d.ts.map +1 -0
- package/dist/atlassian.js +596 -0
- package/dist/atlassian.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +391 -0
- package/dist/cli.js.map +1 -0
- package/dist/cobol/__tests__/call-boundary-lineage.test.d.ts +2 -0
- package/dist/cobol/__tests__/call-boundary-lineage.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/call-boundary-lineage.test.js +505 -0
- package/dist/cobol/__tests__/call-boundary-lineage.test.js.map +1 -0
- package/dist/cobol/__tests__/code-analysis.test.d.ts +2 -0
- package/dist/cobol/__tests__/code-analysis.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/code-analysis.test.js +465 -0
- package/dist/cobol/__tests__/code-analysis.test.js.map +1 -0
- package/dist/cobol/__tests__/db2-table-lineage.test.d.ts +2 -0
- package/dist/cobol/__tests__/db2-table-lineage.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/db2-table-lineage.test.js +182 -0
- package/dist/cobol/__tests__/db2-table-lineage.test.js.map +1 -0
- package/dist/cobol/__tests__/evidence-mapping.test.d.ts +2 -0
- package/dist/cobol/__tests__/evidence-mapping.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/evidence-mapping.test.js +49 -0
- package/dist/cobol/__tests__/evidence-mapping.test.js.map +1 -0
- package/dist/cobol/__tests__/extractors.test.d.ts +2 -0
- package/dist/cobol/__tests__/extractors.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/extractors.test.js +189 -0
- package/dist/cobol/__tests__/extractors.test.js.map +1 -0
- package/dist/cobol/__tests__/field-lineage.test.d.ts +2 -0
- package/dist/cobol/__tests__/field-lineage.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/field-lineage.test.js +329 -0
- package/dist/cobol/__tests__/field-lineage.test.js.map +1 -0
- package/dist/cobol/__tests__/graph.test.d.ts +2 -0
- package/dist/cobol/__tests__/graph.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/graph.test.js +456 -0
- package/dist/cobol/__tests__/graph.test.js.map +1 -0
- package/dist/cobol/__tests__/integration.test.d.ts +2 -0
- package/dist/cobol/__tests__/integration.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/integration.test.js +971 -0
- package/dist/cobol/__tests__/integration.test.js.map +1 -0
- package/dist/cobol/__tests__/lexer.test.d.ts +2 -0
- package/dist/cobol/__tests__/lexer.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/lexer.test.js +111 -0
- package/dist/cobol/__tests__/lexer.test.js.map +1 -0
- package/dist/cobol/__tests__/parser.test.d.ts +2 -0
- package/dist/cobol/__tests__/parser.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/parser.test.js +180 -0
- package/dist/cobol/__tests__/parser.test.js.map +1 -0
- package/dist/cobol/__tests__/variable-tracer.test.d.ts +2 -0
- package/dist/cobol/__tests__/variable-tracer.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/variable-tracer.test.js +256 -0
- package/dist/cobol/__tests__/variable-tracer.test.js.map +1 -0
- package/dist/cobol/__tests__/wiki-gen.test.d.ts +2 -0
- package/dist/cobol/__tests__/wiki-gen.test.d.ts.map +1 -0
- package/dist/cobol/__tests__/wiki-gen.test.js +76 -0
- package/dist/cobol/__tests__/wiki-gen.test.js.map +1 -0
- package/dist/cobol/call-boundary-lineage.d.ts +49 -0
- package/dist/cobol/call-boundary-lineage.d.ts.map +1 -0
- package/dist/cobol/call-boundary-lineage.js +159 -0
- package/dist/cobol/call-boundary-lineage.js.map +1 -0
- package/dist/cobol/db2-table-lineage.d.ts +45 -0
- package/dist/cobol/db2-table-lineage.d.ts.map +1 -0
- package/dist/cobol/db2-table-lineage.js +127 -0
- package/dist/cobol/db2-table-lineage.js.map +1 -0
- package/dist/cobol/evidence-mapping.d.ts +31 -0
- package/dist/cobol/evidence-mapping.d.ts.map +1 -0
- package/dist/cobol/evidence-mapping.js +27 -0
- package/dist/cobol/evidence-mapping.js.map +1 -0
- package/dist/cobol/extractors.d.ts +88 -0
- package/dist/cobol/extractors.d.ts.map +1 -0
- package/dist/cobol/extractors.js +297 -0
- package/dist/cobol/extractors.js.map +1 -0
- package/dist/cobol/field-lineage.d.ts +101 -0
- package/dist/cobol/field-lineage.d.ts.map +1 -0
- package/dist/cobol/field-lineage.js +603 -0
- package/dist/cobol/field-lineage.js.map +1 -0
- package/dist/cobol/graph.d.ts +182 -0
- package/dist/cobol/graph.d.ts.map +1 -0
- package/dist/cobol/graph.js +453 -0
- package/dist/cobol/graph.js.map +1 -0
- package/dist/cobol/lexer.d.ts +15 -0
- package/dist/cobol/lexer.d.ts.map +1 -0
- package/dist/cobol/lexer.js +251 -0
- package/dist/cobol/lexer.js.map +1 -0
- package/dist/cobol/parser.d.ts +13 -0
- package/dist/cobol/parser.d.ts.map +1 -0
- package/dist/cobol/parser.js +584 -0
- package/dist/cobol/parser.js.map +1 -0
- package/dist/cobol/plugin.d.ts +23 -0
- package/dist/cobol/plugin.d.ts.map +1 -0
- package/dist/cobol/plugin.js +507 -0
- package/dist/cobol/plugin.js.map +1 -0
- package/dist/cobol/types.d.ts +73 -0
- package/dist/cobol/types.d.ts.map +1 -0
- package/dist/cobol/types.js +9 -0
- package/dist/cobol/types.js.map +1 -0
- package/dist/cobol/variable-tracer.d.ts +31 -0
- package/dist/cobol/variable-tracer.d.ts.map +1 -0
- package/dist/cobol/variable-tracer.js +361 -0
- package/dist/cobol/variable-tracer.js.map +1 -0
- package/dist/cobol/wiki-gen.d.ts +18 -0
- package/dist/cobol/wiki-gen.d.ts.map +1 -0
- package/dist/cobol/wiki-gen.js +222 -0
- package/dist/cobol/wiki-gen.js.map +1 -0
- package/dist/code-analysis.d.ts +160 -0
- package/dist/code-analysis.d.ts.map +1 -0
- package/dist/code-analysis.js +53 -0
- package/dist/code-analysis.js.map +1 -0
- package/dist/evidence-search.d.ts +43 -0
- package/dist/evidence-search.d.ts.map +1 -0
- package/dist/evidence-search.js +112 -0
- package/dist/evidence-search.js.map +1 -0
- package/dist/evidence-search.test.d.ts +2 -0
- package/dist/evidence-search.test.d.ts.map +1 -0
- package/dist/evidence-search.test.js +98 -0
- package/dist/evidence-search.test.js.map +1 -0
- package/dist/evidence.d.ts +32 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +16 -0
- package/dist/evidence.js.map +1 -0
- package/dist/evidence.test.d.ts +2 -0
- package/dist/evidence.test.d.ts.map +1 -0
- package/dist/evidence.test.js +51 -0
- package/dist/evidence.test.js.map +1 -0
- package/dist/extraction.d.ts +40 -0
- package/dist/extraction.d.ts.map +1 -0
- package/dist/extraction.js +283 -0
- package/dist/extraction.js.map +1 -0
- package/dist/extraction.test.d.ts +5 -0
- package/dist/extraction.test.d.ts.map +1 -0
- package/dist/extraction.test.js +137 -0
- package/dist/extraction.test.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/queue.d.ts +52 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +139 -0
- package/dist/queue.js.map +1 -0
- package/dist/queue.test.d.ts +2 -0
- package/dist/queue.test.d.ts.map +1 -0
- package/dist/queue.test.js +161 -0
- package/dist/queue.test.js.map +1 -0
- package/dist/search.d.ts +163 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +653 -0
- package/dist/search.js.map +1 -0
- package/dist/search.test.d.ts +6 -0
- package/dist/search.test.d.ts.map +1 -0
- package/dist/search.test.js +551 -0
- package/dist/search.test.js.map +1 -0
- package/dist/server.d.ts +33 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +2530 -0
- package/dist/server.js.map +1 -0
- package/dist/server.test.d.ts +8 -0
- package/dist/server.test.d.ts.map +1 -0
- package/dist/server.test.js +2397 -0
- package/dist/server.test.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/dist/wiki.d.ts +496 -0
- package/dist/wiki.d.ts.map +1 -0
- package/dist/wiki.js +2677 -0
- package/dist/wiki.js.map +1 -0
- package/dist/wiki.test.d.ts +8 -0
- package/dist/wiki.test.d.ts.map +1 -0
- package/dist/wiki.test.js +1881 -0
- package/dist/wiki.test.js.map +1 -0
- package/docs/code-analysis-plugins.md +169 -0
- package/docs/configuration.md +135 -0
- package/docs/diagrams/cobol-analysis-flow.png +0 -0
- package/docs/diagrams/cobol-analysis-flow.svg +156 -0
- package/docs/evidence-envelope.md +176 -0
- package/docs/graph-1.gif +0 -0
- package/docs/legacy-code-knowledge-compiler-prd.md +511 -0
- package/docs/product-direction.md +120 -0
- package/docs/request-optimization.md +201 -0
- package/docs/search.md +266 -0
- package/docs/tools.md +269 -0
- package/graph-viewer/dist/cli.d.ts +3 -0
- package/graph-viewer/dist/cli.d.ts.map +1 -0
- package/graph-viewer/dist/cli.js +97 -0
- package/graph-viewer/dist/cli.js.map +1 -0
- package/graph-viewer/dist/graph.d.ts +14 -0
- package/graph-viewer/dist/graph.d.ts.map +1 -0
- package/graph-viewer/dist/graph.js +96 -0
- package/graph-viewer/dist/graph.js.map +1 -0
- package/graph-viewer/dist/index.d.ts +6 -0
- package/graph-viewer/dist/index.d.ts.map +1 -0
- package/graph-viewer/dist/index.js +4 -0
- package/graph-viewer/dist/index.js.map +1 -0
- package/graph-viewer/dist/parse.d.ts +10 -0
- package/graph-viewer/dist/parse.d.ts.map +1 -0
- package/graph-viewer/dist/parse.js +62 -0
- package/graph-viewer/dist/parse.js.map +1 -0
- package/graph-viewer/dist/server.d.ts +15 -0
- package/graph-viewer/dist/server.d.ts.map +1 -0
- package/graph-viewer/dist/server.js +168 -0
- package/graph-viewer/dist/server.js.map +1 -0
- package/graph-viewer/dist/types.d.ts +48 -0
- package/graph-viewer/dist/types.d.ts.map +1 -0
- package/graph-viewer/dist/types.js +2 -0
- package/graph-viewer/dist/types.js.map +1 -0
- package/graph-viewer/public/app.js +525 -0
- package/graph-viewer/public/index.html +68 -0
- package/graph-viewer/public/style.css +68 -0
- package/package.json +73 -0
- package/skills/aceclaw/SKILL.md +173 -0
- package/skills/agent-wiki/SKILL.md +184 -0
- package/skills/agent-wiki/references/tools-reference.md +368 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-wiki",
|
|
3
|
+
"description": "Agent-driven knowledge base with immutable raw sources, mutable wiki pages, BM25 search, code analysis, and self-checking lint. Use when managing knowledge bases, importing documents, writing wiki pages, or parsing source code.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Xinhua Chen"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# agent-wiki
|
|
2
|
+
|
|
3
|
+
**The knowledge base that makes AI agents smarter over time.**
|
|
4
|
+
|
|
5
|
+
Instead of retrieving raw fragments every query (RAG), your agent compiles, refines, and interlinks knowledge — like a team wiki that writes itself.
|
|
6
|
+
|
|
7
|
+
Works with Claude Code, Cursor, Windsurf, and any MCP client. Also installable as a native skill for Claude Code. No LLM built in — your agent IS the intelligence.
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@agent-wiki/mcp)
|
|
10
|
+
[](https://github.com/xinhuagu/agent-wiki/actions/workflows/ci.yml)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
[](https://modelcontextprotocol.io)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
|
|
15
|
+
### agent-wiki's built-in 3D graph view
|
|
16
|
+
|
|
17
|
+
Pages as nodes, `[[wikilinks]]` as edges, edits push live — included in the main package.
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="docs/graph-1.gif" alt="agent-wiki realtime 3D knowledge graph viewer — live-updating force-directed graph of Markdown pages and [[wikilinks]]" width="900" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### Option A: MCP Server (Cursor, Windsurf, Claude Desktop, any MCP client)
|
|
26
|
+
|
|
27
|
+
Add to your MCP client config:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"agent-wiki": {
|
|
33
|
+
"command": "npx",
|
|
34
|
+
"args": ["-y", "@agent-wiki/mcp", "serve", "--wiki-path", "/path/to/knowledge"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Option B: Native Skill (Claude Code)
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @agent-wiki/mcp
|
|
44
|
+
|
|
45
|
+
# Install as Claude Code plugin
|
|
46
|
+
agent-wiki install claude-code
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Option C: CLI only
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @agent-wiki/mcp call wiki_search '{"query": "deployment"}'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Option D: 3D Graph Viewer
|
|
56
|
+
|
|
57
|
+
See your wiki as a realtime 3D knowledge graph — edits push live via SSE. Included in the main package, no separate install needed.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install -g @agent-wiki/mcp
|
|
61
|
+
agent-wiki web --wiki-path ./wiki --open
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Heavy browser libs (3d-force-graph, three.js) load from a CDN at runtime. See
|
|
65
|
+
[graph-viewer/README.md](graph-viewer/README.md) for the full feature list and
|
|
66
|
+
interaction guide.
|
|
67
|
+
|
|
68
|
+
That's it. Your agent now has a persistent, structured knowledge base.
|
|
69
|
+
|
|
70
|
+
## Why Not RAG?
|
|
71
|
+
|
|
72
|
+
| | RAG | agent-wiki |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| **Approach** | Retrieve fragments at query time | Build and maintain compiled knowledge |
|
|
75
|
+
| **Memory** | Stateless — forgets after each query | Persistent — knowledge accumulates |
|
|
76
|
+
| **Quality** | Raw chunks, often noisy | Curated, structured, interlinked |
|
|
77
|
+
| **Cost** | Embedding + retrieval every query | One-time compilation, free reads |
|
|
78
|
+
| **Contradictions** | Invisible — buried in source docs | Flagged automatically by lint |
|
|
79
|
+
| **Source tracking** | Lost after retrieval | Full provenance chain (raw -> wiki) |
|
|
80
|
+
|
|
81
|
+
## Features
|
|
82
|
+
|
|
83
|
+
| Feature | Description |
|
|
84
|
+
|---------|-------------|
|
|
85
|
+
| **Batch Mode** | Generic `batch` tool + semantic pipelines — collapse multi-step workflows into single requests |
|
|
86
|
+
| **Knowledge Pipelines** | Unified `knowledge_ingest` modes — end-to-end ingest/digest/write-back loop without expanding the public tool surface |
|
|
87
|
+
| **Structured Extraction** | PDF (per-page), DOCX, XLSX (per-sheet), PPTX (per-slide) — segments with source provenance |
|
|
88
|
+
| **Immutable Sources** | SHA-256 verified `raw/` layer — write-once, tamper-proof, full provenance |
|
|
89
|
+
| **Knowledge Compilation** | Agent builds structured wiki pages from raw sources — not retrieve-and-forget |
|
|
90
|
+
| **BM25 Search** | Field-weighted scoring, synonym expansion, fuzzy matching, CJK tokenization — zero LLM |
|
|
91
|
+
| **Hybrid Search** | Optional BM25+vector re-ranking via `@xenova/transformers` — enable with one config line, no external API |
|
|
92
|
+
| **Auto-Classification** | Zero-LLM heuristic assigns entity types and tags across 10 categories |
|
|
93
|
+
| **Multi-Level Indexes** | Auto-generated `index.md` at every directory level — nested topic hierarchies with sub-topic navigation |
|
|
94
|
+
| **Self-Checking Lint** | Catches contradictions, broken links, orphan pages, stale content |
|
|
95
|
+
| **Coverage Report** | `raw_coverage` tells the agent which raw sources have not yet been compiled into any wiki page — drives active knowledge completion |
|
|
96
|
+
| **Atlassian Import** | One-command Confluence pages and Jira issues with full hierarchy. Supports both Atlassian Cloud (`*.atlassian.net`) and self-hosted Server / Data Center, with auto-routed API endpoints and Bearer / Basic auth handling. |
|
|
97
|
+
| **File Versioning** | Auto-version same-name files, query latest, list all versions |
|
|
98
|
+
| **COBOL Code Analysis** | AST parser handling fixed-format (with mainframe alphanumeric sequence areas) and free-format. Extracts CALL/PERFORM/COPY structure, LINKAGE SECTION, EXEC SQL, EXEC CICS, and file access modes. Cross-file knowledge graph with depth-bounded impact queries. Three field-lineage families: shared-copybook reuse, `CALL ... USING` boundary flow, and cross-program data flow via shared DB2 tables. |
|
|
99
|
+
| **Skill Install** | One-command install as native skill for Claude Code and compatible clients |
|
|
100
|
+
| **Git-Native** | Plain Markdown — diffable, blameable, revertable |
|
|
101
|
+
| **3D Graph Viewer** | Built-in — realtime 3D graph of pages and `[[wikilinks]]`, edits push live over SSE. Run `agent-wiki web`. |
|
|
102
|
+
|
|
103
|
+
## Architecture
|
|
104
|
+
|
|
105
|
+
Three immutability layers, inspired by how compilers work:
|
|
106
|
+
|
|
107
|
+
| Layer | Mutability | Role |
|
|
108
|
+
|-------|-----------|------|
|
|
109
|
+
| **raw/** | Immutable | Source documents — write-once, SHA-256 verified |
|
|
110
|
+
| **wiki/** | Mutable | Compiled knowledge — structured pages that improve over time |
|
|
111
|
+
| **schemas/** | Reference | Entity templates — consistent structure across knowledge types |
|
|
112
|
+
|
|
113
|
+
<p align="center">
|
|
114
|
+
<img src="architecture.svg" alt="agent-wiki architecture" width="700" />
|
|
115
|
+
</p>
|
|
116
|
+
|
|
117
|
+
## Design Principles
|
|
118
|
+
|
|
119
|
+
1. **Raw is immutable** — Source documents are write-once, SHA-256 verified. Ground truth never changes.
|
|
120
|
+
2. **Wiki is mutable** — Compiled knowledge improves with every interaction.
|
|
121
|
+
3. **No LLM dependency** — Zero API keys, zero cost per operation. Your agent IS the intelligence.
|
|
122
|
+
4. **Self-checking** — Lint catches structural issues and flags potential contradictions.
|
|
123
|
+
5. **Knowledge compounds** — Every write enriches the whole wiki. Synthesis creates higher-order understanding.
|
|
124
|
+
6. **Provenance matters** — Every wiki claim traces back to raw sources.
|
|
125
|
+
7. **Git-native** — Plain Markdown. Every change is diffable, blameable, and revertable.
|
|
126
|
+
|
|
127
|
+
## Integration
|
|
128
|
+
|
|
129
|
+
| Method | Best For | Setup |
|
|
130
|
+
|--------|----------|-------|
|
|
131
|
+
| **MCP Server** | Cursor, Windsurf, Claude Desktop, any MCP client | Add to `.mcp.json` |
|
|
132
|
+
| **Native Skill** | Claude Code (native plugin) | `agent-wiki install claude-code` |
|
|
133
|
+
| **CLI** | Any agent with shell access | `agent-wiki call <tool> '{json}'` |
|
|
134
|
+
| **3D Graph Viewer** | Visual exploration of the whole wiki | `agent-wiki web -w ./wiki` |
|
|
135
|
+
|
|
136
|
+
## Hybrid Search Setup
|
|
137
|
+
|
|
138
|
+
Upgrade from keyword-only to semantic search with two steps:
|
|
139
|
+
|
|
140
|
+
**1.** Add to `.agent-wiki.yaml`:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
search:
|
|
144
|
+
hybrid: true
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**2.** Run `wiki_admin` once to rebuild and embed all pages:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
agent-wiki call wiki_admin '{"action":"rebuild"}'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The first run downloads the `Xenova/all-MiniLM-L6-v2` model (~90 MB) from HuggingFace Hub and caches it locally. After that, every `wiki_write` automatically keeps the vector index up to date.
|
|
154
|
+
|
|
155
|
+
Hybrid mode blends BM25 + cosine similarity scores. If embedding fails for any reason, search falls back to pure BM25 — queries never fail.
|
|
156
|
+
|
|
157
|
+
See [Search configuration](docs/tools.md#hybrid-bm25vector-search) for weight tuning.
|
|
158
|
+
|
|
159
|
+
## Documentation
|
|
160
|
+
|
|
161
|
+
- [MCP Tools (15 public tools) & Entity Types](docs/tools.md)
|
|
162
|
+
- [Configuration, CLI & Security](docs/configuration.md)
|
|
163
|
+
- [Request Optimization — Batch Digest, Pagination, Context Limits](docs/request-optimization.md)
|
|
164
|
+
|
|
165
|
+
## Acknowledgment
|
|
166
|
+
|
|
167
|
+
Inspired by Andrej Karpathy's [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) concept — the idea that AI agents should compile and maintain knowledge, not just retrieve raw fragments. This project is an independent, full implementation of that vision.
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT
|
package/architecture.svg
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="420" viewBox="0 0 700 420">
|
|
2
|
+
<!-- White background -->
|
|
3
|
+
<rect width="700" height="420" fill="#ffffff"/>
|
|
4
|
+
|
|
5
|
+
<!-- Your AI Agent box -->
|
|
6
|
+
<rect x="200" y="20" width="300" height="70" rx="10" fill="#dae8fc" stroke="#6c8ebf" stroke-width="2"/>
|
|
7
|
+
<text x="350" y="45" font-family="Helvetica, Arial, sans-serif" font-size="16" font-weight="bold" fill="#333333" text-anchor="middle">Your AI Agent</text>
|
|
8
|
+
<text x="350" y="68" font-family="Helvetica, Arial, sans-serif" font-size="11" fill="#666666" text-anchor="middle">Claude Code · Cursor · Windsurf · Copilot</text>
|
|
9
|
+
|
|
10
|
+
<!-- MCP arrow -->
|
|
11
|
+
<line x1="350" y1="90" x2="350" y2="140" stroke="#666666" stroke-width="2"/>
|
|
12
|
+
<polygon points="344,135 350,145 356,135" fill="#666666"/>
|
|
13
|
+
<text x="380" y="120" font-family="Helvetica, Arial, sans-serif" font-size="11" fill="#999999">MCP (stdio)</text>
|
|
14
|
+
|
|
15
|
+
<!-- Main agent-wiki container -->
|
|
16
|
+
<rect x="40" y="145" width="620" height="250" rx="10" fill="#f5f5f5" stroke="#cccccc" stroke-width="2"/>
|
|
17
|
+
<text x="60" y="172" font-family="Helvetica, Arial, sans-serif" font-size="15" font-weight="bold" fill="#333333">agent-wiki</text>
|
|
18
|
+
|
|
19
|
+
<!-- raw/ box -->
|
|
20
|
+
<rect x="80" y="195" width="180" height="80" rx="8" fill="#fff2cc" stroke="#d6b656" stroke-width="2"/>
|
|
21
|
+
<text x="170" y="225" font-family="Helvetica, Arial, sans-serif" font-size="14" font-weight="bold" fill="#333333" text-anchor="middle">raw/</text>
|
|
22
|
+
<text x="170" y="245" font-family="Helvetica, Arial, sans-serif" font-size="10" fill="#888888" text-anchor="middle">Immutable sources</text>
|
|
23
|
+
<text x="170" y="260" font-family="Helvetica, Arial, sans-serif" font-size="10" fill="#888888" text-anchor="middle">SHA-256 verified</text>
|
|
24
|
+
|
|
25
|
+
<!-- compile arrow -->
|
|
26
|
+
<line x1="260" y1="235" x2="355" y2="235" stroke="#999999" stroke-width="2"/>
|
|
27
|
+
<polygon points="350,230 360,235 350,240" fill="#999999"/>
|
|
28
|
+
<text x="308" y="225" font-family="Helvetica, Arial, sans-serif" font-size="10" fill="#999999" text-anchor="middle">compile</text>
|
|
29
|
+
|
|
30
|
+
<!-- wiki/ box -->
|
|
31
|
+
<rect x="360" y="195" width="180" height="80" rx="8" fill="#d5e8d4" stroke="#82b366" stroke-width="2"/>
|
|
32
|
+
<text x="450" y="225" font-family="Helvetica, Arial, sans-serif" font-size="14" font-weight="bold" fill="#333333" text-anchor="middle">wiki/</text>
|
|
33
|
+
<text x="450" y="245" font-family="Helvetica, Arial, sans-serif" font-size="10" fill="#888888" text-anchor="middle">Structured Markdown</text>
|
|
34
|
+
<text x="450" y="260" font-family="Helvetica, Arial, sans-serif" font-size="10" fill="#888888" text-anchor="middle">9 entity types · wiki-links</text>
|
|
35
|
+
|
|
36
|
+
<!-- schemas/ box -->
|
|
37
|
+
<rect x="560" y="200" width="80" height="65" rx="6" fill="#e1d5e7" stroke="#9673a6" stroke-width="1.5"/>
|
|
38
|
+
<text x="600" y="228" font-family="Helvetica, Arial, sans-serif" font-size="12" font-weight="bold" fill="#333333" text-anchor="middle">schemas/</text>
|
|
39
|
+
<text x="600" y="248" font-family="Helvetica, Arial, sans-serif" font-size="9" fill="#888888" text-anchor="middle">9 templates</text>
|
|
40
|
+
|
|
41
|
+
<!-- schema arrow to wiki -->
|
|
42
|
+
<line x1="560" y1="235" x2="545" y2="235" stroke="#9673a6" stroke-width="1.5" stroke-dasharray="4,3"/>
|
|
43
|
+
<polygon points="548,231 540,235 548,239" fill="#9673a6"/>
|
|
44
|
+
|
|
45
|
+
<!-- Features bar -->
|
|
46
|
+
<rect x="80" y="310" width="540" height="45" rx="8" fill="#ffffff" stroke="#dddddd" stroke-width="1.5"/>
|
|
47
|
+
<text x="130" y="337" font-family="Helvetica, Arial, sans-serif" font-size="11" fill="#555555" text-anchor="middle">auto-classify</text>
|
|
48
|
+
<line x1="190" y1="318" x2="190" y2="347" stroke="#eeeeee" stroke-width="1"/>
|
|
49
|
+
<text x="260" y="337" font-family="Helvetica, Arial, sans-serif" font-size="11" fill="#555555" text-anchor="middle">self-checking lint</text>
|
|
50
|
+
<line x1="330" y1="318" x2="330" y2="347" stroke="#eeeeee" stroke-width="1"/>
|
|
51
|
+
<text x="400" y="337" font-family="Helvetica, Arial, sans-serif" font-size="11" fill="#555555" text-anchor="middle">SHA-256 integrity</text>
|
|
52
|
+
<line x1="470" y1="318" x2="470" y2="347" stroke="#eeeeee" stroke-width="1"/>
|
|
53
|
+
<text x="545" y="337" font-family="Helvetica, Arial, sans-serif" font-size="11" fill="#555555" text-anchor="middle">19 MCP tools</text>
|
|
54
|
+
|
|
55
|
+
<!-- lint arrow from features to raw -->
|
|
56
|
+
<line x1="170" y1="310" x2="170" y2="280" stroke="#dddddd" stroke-width="1" stroke-dasharray="3,3"/>
|
|
57
|
+
<line x1="450" y1="310" x2="450" y2="280" stroke="#dddddd" stroke-width="1" stroke-dasharray="3,3"/>
|
|
58
|
+
</svg>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlassian integration — Confluence and Jira importers.
|
|
3
|
+
*
|
|
4
|
+
* Fetches pages/issues via Atlassian Cloud REST APIs and saves them
|
|
5
|
+
* as immutable raw documents with full metadata (.meta.yaml sidecars).
|
|
6
|
+
*
|
|
7
|
+
* Security:
|
|
8
|
+
* - Auth tokens read from environment variables (never passed as args)
|
|
9
|
+
* - Host allowlist prevents SSRF to arbitrary Atlassian instances
|
|
10
|
+
* - Page/attachment limits prevent runaway recursion
|
|
11
|
+
* - Slugified filenames prevent directory traversal from titles
|
|
12
|
+
*/
|
|
13
|
+
export interface AtlassianConfig {
|
|
14
|
+
allowedHosts: string[];
|
|
15
|
+
maxPages: number;
|
|
16
|
+
maxAttachmentSize: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const ATLASSIAN_DEFAULTS: AtlassianConfig;
|
|
19
|
+
export interface ConfluencePageNode {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
file: string;
|
|
23
|
+
children: ConfluencePageNode[];
|
|
24
|
+
}
|
|
25
|
+
export interface ConfluenceImportResult {
|
|
26
|
+
pages: number;
|
|
27
|
+
tree: ConfluencePageNode;
|
|
28
|
+
files: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface JiraImportResult {
|
|
31
|
+
issueKey: string;
|
|
32
|
+
summary: string;
|
|
33
|
+
files: string[];
|
|
34
|
+
linkedIssues: string[];
|
|
35
|
+
importedCount: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function resolveAuth(authEnv: string): string;
|
|
38
|
+
export declare function validateHost(host: string, allowed: string[]): void;
|
|
39
|
+
export declare function slugify(title: string): string;
|
|
40
|
+
export type AtlassianDeployment = "cloud" | "server";
|
|
41
|
+
export declare function parseConfluenceUrl(url: string): {
|
|
42
|
+
host: string;
|
|
43
|
+
pageId: string;
|
|
44
|
+
deployment: AtlassianDeployment;
|
|
45
|
+
};
|
|
46
|
+
export declare function confluenceImport(url: string, rawDir: string, config: AtlassianConfig, opts?: {
|
|
47
|
+
recursive?: boolean;
|
|
48
|
+
depth?: number;
|
|
49
|
+
authEnv?: string;
|
|
50
|
+
}): Promise<ConfluenceImportResult>;
|
|
51
|
+
export declare function parseJiraUrl(url: string): {
|
|
52
|
+
host: string;
|
|
53
|
+
issueKey: string;
|
|
54
|
+
deployment: AtlassianDeployment;
|
|
55
|
+
};
|
|
56
|
+
export declare function jiraImport(url: string, rawDir: string, config: AtlassianConfig, opts?: {
|
|
57
|
+
includeComments?: boolean;
|
|
58
|
+
includeAttachments?: boolean;
|
|
59
|
+
includeLinks?: boolean;
|
|
60
|
+
linkDepth?: number;
|
|
61
|
+
authEnv?: string;
|
|
62
|
+
}): Promise<JiraImportResult>;
|
|
63
|
+
//# sourceMappingURL=atlassian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlassian.d.ts","sourceRoot":"","sources":["../src/atlassian.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAmBH,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,eAIhC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB;AAgBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAqBnD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAQlE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM7C;AAoBD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErD,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,GACV;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAkBnE;AA8JD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,eAAe,EACvB,IAAI,GAAE;IACJ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACb,GACL,OAAO,CAAC,sBAAsB,CAAC,CAsIjC;AAMD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GACV;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAYrE;AAED,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,eAAe,EACvB,IAAI,GAAE;IACJ,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACb,GACL,OAAO,CAAC,gBAAgB,CAAC,CAiS3B"}
|