@lon-ask/dockit 0.1.1 → 0.1.4
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/LICENSE +21 -674
- package/README.md +618 -328
- package/SKILL.md +61 -110
- package/apps/client/dist/assets/{index-CqOXxsEZ.js → index-DzadxeQH.js} +2 -2
- package/apps/client/dist/index.html +1 -1
- package/apps/client/index.html +12 -0
- package/apps/client/package.json +26 -0
- package/apps/client/src/App.tsx +18 -0
- package/apps/client/src/api/client.ts +54 -0
- package/apps/client/src/components/BuildPanel.tsx +77 -0
- package/apps/client/src/components/DocViewer.tsx +76 -0
- package/apps/client/src/components/EntryDetail.tsx +322 -0
- package/apps/client/src/components/EntryForm.tsx +117 -0
- package/apps/client/src/components/EntryList.tsx +165 -0
- package/apps/client/src/components/GlobalSearchBar.tsx +166 -0
- package/apps/client/src/components/Layout.tsx +57 -0
- package/apps/client/src/components/SearchBar.tsx +103 -0
- package/apps/client/src/components/SourceForm.tsx +497 -0
- package/apps/client/src/hooks/useTheme.ts +19 -0
- package/apps/client/src/index.css +77 -0
- package/apps/client/src/main.tsx +13 -0
- package/apps/client/src/types.ts +105 -0
- package/apps/client/vite.config.ts +13 -0
- package/apps/server/dist/core/domain/entry.js +20 -0
- package/apps/server/dist/core/domain/entry.js.map +1 -0
- package/apps/server/dist/core/domain/errors.js +33 -0
- package/apps/server/dist/core/domain/errors.js.map +1 -0
- package/apps/server/dist/core/domain/knowledge-graph.js +2 -0
- package/apps/server/dist/core/domain/knowledge-graph.js.map +1 -0
- package/apps/server/dist/core/domain/types.js +2 -0
- package/apps/server/dist/core/domain/types.js.map +1 -0
- package/apps/server/dist/core/ports/IBuildRepository.js +2 -0
- package/apps/server/dist/core/ports/IBuildRepository.js.map +1 -0
- package/apps/server/dist/core/ports/IDocumentNormalizer.js +2 -0
- package/apps/server/dist/core/ports/IDocumentNormalizer.js.map +1 -0
- package/apps/server/dist/core/ports/IDocumentStore.js +2 -0
- package/apps/server/dist/core/ports/IDocumentStore.js.map +1 -0
- package/apps/server/dist/core/ports/IEntryReadModel.js +2 -0
- package/apps/server/dist/core/ports/IEntryReadModel.js.map +1 -0
- package/apps/server/dist/core/ports/IEntryRepository.js +2 -0
- package/apps/server/dist/core/ports/IEntryRepository.js.map +1 -0
- package/apps/server/dist/core/ports/IKnowledgeGraph.js +2 -0
- package/apps/server/dist/core/ports/IKnowledgeGraph.js.map +1 -0
- package/apps/server/dist/core/ports/IPathResolver.js +2 -0
- package/apps/server/dist/core/ports/IPathResolver.js.map +1 -0
- package/apps/server/dist/core/ports/ISearchEngine.js +2 -0
- package/apps/server/dist/core/ports/ISearchEngine.js.map +1 -0
- package/apps/server/dist/core/ports/ISourceProcessor.js +2 -0
- package/apps/server/dist/core/ports/ISourceProcessor.js.map +1 -0
- package/apps/server/dist/core/ports/ISourceRepository.js +2 -0
- package/apps/server/dist/core/ports/ISourceRepository.js.map +1 -0
- package/apps/server/dist/core/usecases/BuildUseCase.js +76 -0
- package/apps/server/dist/core/usecases/BuildUseCase.js.map +1 -0
- package/apps/server/dist/core/usecases/ConfigUseCase.js +62 -0
- package/apps/server/dist/core/usecases/ConfigUseCase.js.map +1 -0
- package/apps/server/dist/core/usecases/SearchUseCase.js +17 -0
- package/apps/server/dist/core/usecases/SearchUseCase.js.map +1 -0
- package/apps/server/dist/index.js +86 -0
- package/apps/server/dist/index.js.map +1 -0
- package/apps/server/dist/infrastructure/filesystem/FileSystemDocumentStore.js +25 -0
- package/apps/server/dist/infrastructure/filesystem/FileSystemDocumentStore.js.map +1 -0
- package/apps/server/dist/infrastructure/graph/GraphSearchDecorator.js +42 -0
- package/apps/server/dist/infrastructure/graph/GraphSearchDecorator.js.map +1 -0
- package/apps/server/dist/infrastructure/graph/GraphifyKnowledgeGraph.js +145 -0
- package/apps/server/dist/infrastructure/graph/GraphifyKnowledgeGraph.js.map +1 -0
- package/apps/server/dist/infrastructure/graph/index.js +3 -0
- package/apps/server/dist/infrastructure/graph/index.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteBuildRepository.js +21 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteBuildRepository.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryReadModel.js +11 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryReadModel.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryRepository.js +59 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteEntryRepository.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteSourceRepository.js +47 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/SqliteSourceRepository.js.map +1 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/connection.js +50 -0
- package/apps/server/dist/infrastructure/persistence/sqlite/connection.js.map +1 -0
- package/apps/server/dist/infrastructure/search/SearchEngineFactory.js +32 -0
- package/apps/server/dist/infrastructure/search/SearchEngineFactory.js.map +1 -0
- package/apps/server/dist/infrastructure/search/json/JsonSearchEngine.js +147 -0
- package/apps/server/dist/infrastructure/search/json/JsonSearchEngine.js.map +1 -0
- package/apps/server/dist/infrastructure/search/vector/EmbeddingService.js +23 -0
- package/apps/server/dist/infrastructure/search/vector/EmbeddingService.js.map +1 -0
- package/apps/server/dist/infrastructure/search/vector/VectorSearchEngine.js +378 -0
- package/apps/server/dist/infrastructure/search/vector/VectorSearchEngine.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/AntoraSourceProcessor.js +11 -0
- package/apps/server/dist/infrastructure/source-processors/AntoraSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/AsciidocSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/AsciidocSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/DocumentNormalizer.js +11 -0
- package/apps/server/dist/infrastructure/source-processors/DocumentNormalizer.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/GithubMarkdownSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/GithubMarkdownSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/MavenSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/MavenSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/PathResolver.js +5 -0
- package/apps/server/dist/infrastructure/source-processors/PathResolver.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/SourceCodeSourceProcessor.js +269 -0
- package/apps/server/dist/infrastructure/source-processors/SourceCodeSourceProcessor.js.map +1 -0
- package/apps/server/dist/infrastructure/source-processors/ZipSourceProcessor.js +9 -0
- package/apps/server/dist/infrastructure/source-processors/ZipSourceProcessor.js.map +1 -0
- package/apps/server/dist/mcp-http.js +93 -0
- package/apps/server/dist/mcp-http.js.map +1 -0
- package/apps/server/dist/mcp.js +339 -0
- package/apps/server/dist/mcp.js.map +1 -0
- package/apps/server/dist/routes/build.js +89 -0
- package/apps/server/dist/routes/build.js.map +1 -0
- package/apps/server/dist/routes/entries.js +52 -0
- package/apps/server/dist/routes/entries.js.map +1 -0
- package/apps/server/dist/routes/graph.js +58 -0
- package/apps/server/dist/routes/graph.js.map +1 -0
- package/apps/server/dist/routes/search.js +24 -0
- package/apps/server/dist/routes/search.js.map +1 -0
- package/apps/server/dist/routes/sources.js +100 -0
- package/apps/server/dist/routes/sources.js.map +1 -0
- package/apps/server/dist/routes/viewer.js +22 -0
- package/apps/server/dist/routes/viewer.js.map +1 -0
- package/apps/server/dist/services/antora.js +222 -0
- package/apps/server/dist/services/antora.js.map +1 -0
- package/apps/server/dist/services/asciidoc.js +206 -0
- package/apps/server/dist/services/asciidoc.js.map +1 -0
- package/apps/server/dist/services/configLoader.js +150 -0
- package/apps/server/dist/services/configLoader.js.map +1 -0
- package/apps/server/dist/services/githubMarkdown.js +221 -0
- package/apps/server/dist/services/githubMarkdown.js.map +1 -0
- package/apps/server/dist/services/maven.js +148 -0
- package/apps/server/dist/services/maven.js.map +1 -0
- package/apps/server/dist/services/normalizer.js +42 -0
- package/apps/server/dist/services/normalizer.js.map +1 -0
- package/apps/server/dist/services/paths.js +5 -0
- package/apps/server/dist/services/paths.js.map +1 -0
- package/apps/server/dist/services/textExtractor.js +46 -0
- package/apps/server/dist/services/textExtractor.js.map +1 -0
- package/apps/server/dist/services/zip.js +63 -0
- package/apps/server/dist/services/zip.js.map +1 -0
- package/apps/server/package.json +38 -0
- package/apps/server/src/infrastructure/source-processors/SourceCodeSourceProcessor.ts +9 -2
- package/bin/commands/dev.ts +2 -2
- package/bin/commands/serve.ts +2 -2
- package/package.json +22 -4
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dockit
|
|
3
|
-
description: Documentation index and search tool
|
|
3
|
+
description: Documentation index and search tool providing on-demand framework/library docs and source code knowledge graphs for LLM context
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: opencode
|
|
6
6
|
metadata:
|
|
@@ -8,147 +8,98 @@ metadata:
|
|
|
8
8
|
workflow: documentation
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Search and retrieve documentation for frameworks and libraries (e.g., Quarkus, Spring Boot, React)
|
|
13
|
-
- Provide API documentation, class references, and configuration guides
|
|
14
|
-
- Fetch full document content for LLM context via CLI or MCP tools
|
|
11
|
+
# ⚠️ CRITICAL: USE DOCKIT, NOT GREP
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
Use this skill when the user asks about:
|
|
18
|
-
- How to use a specific framework or library
|
|
19
|
-
- API documentation, class references, or configuration reference
|
|
20
|
-
- Any technology listed in available dockit entries
|
|
13
|
+
**When a dockit entry exists for the codebase, dockit's graph and search tools MUST be used for ALL structural queries. Do NOT use grep, rg, find, glob, or any text search tool for questions about code imports, dependencies, structure, architecture, or relationships.**
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
Dockit's knowledge graph (Graphify Tree-sitter AST) has already parsed every import, call, and inheritance edge. Using grep for structural questions is slower AND less accurate. You are discarding pre-parsed structural data to re-parse text — this is wasteful and produces worse results.
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
| Question | ✅ Use dockit | ❌ Do NOT use |
|
|
18
|
+
|----------|------------|-------------|
|
|
19
|
+
| "What files import X?" | `dockit graph query <entry> "X"` | `grep`, `rg`, `glob` |
|
|
20
|
+
| "What does X depend on?" | `dockit graph explain <entry> "X"` | Reading files, `grep "import"` |
|
|
21
|
+
| "Does UI import server code?" | `dockit graph path <entry> "A" "B"` | Manually checking imports |
|
|
22
|
+
| "Most critical modules?" | `dockit graph gods <entry>` | Guessing, `ls`, `wc -l` |
|
|
23
|
+
| "How are A and B connected?" | `dockit graph path <entry> "A" "B"` | Tracing imports across files |
|
|
24
|
+
| "Docs for X?" | `dockit search <entry> "X"` | `grep "X"` on docs |
|
|
25
|
+
| "Find all files about X" | `dockit search <entry> "X"` or `dockit graph query <entry> "X"` | `grep -r "X"` |
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
**Only use grep / glob when:**
|
|
28
|
+
1. No dockit entry exists for the target codebase (not yet built)
|
|
29
|
+
2. You have already found the right files via dockit and now need to read their content
|
|
30
|
+
3. The question is about raw text patterns, not code structure
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
Searches documentation. Always provide the entry name as the first argument when you know which framework the question is about.
|
|
32
|
+
**If a source-code entry is built (status = ready): graph tools get priority. Every time. No exceptions.**
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
# Scoped to a specific entry (recommended)
|
|
34
|
-
dockit search react "how to create a hook"
|
|
35
|
-
dockit search quarkus "configure cache"
|
|
34
|
+
## What dockit does
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
dockit search "cache"
|
|
39
|
-
```
|
|
36
|
+
Dockit is a local documentation hub. It indexes documentation from multiple sources (GitHub Markdown, AsciiDoc, Antora, Maven Javadoc, ZIP archives) and builds source code knowledge graphs (Tree-sitter AST via Graphify). It provides hybrid TF-IDF + vector semantic search across all indexed content.
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
Searches and fetches full document content for the top N results (default 3). This is the **primary command for LLMs** — it combines search + content retrieval in one step.
|
|
38
|
+
Run it from the terminal — no server process required. No internet needed after build.
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
# Get full content for top 3 results
|
|
46
|
-
dockit search react "useState" --get-top
|
|
40
|
+
## Installation
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @lon-ask/dockit
|
|
50
44
|
```
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
Fetches full content of a specific document by path (from search results).
|
|
46
|
+
Or use `npx` without installing:
|
|
54
47
|
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
```bash
|
|
49
|
+
npx @lon-ask/dockit <command>
|
|
50
|
+
```
|
|
57
51
|
|
|
58
|
-
|
|
52
|
+
All data is stored in `~/.dockit/` by default. Override with `DOCKIT_DATA_DIR`.
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
Determine which documentation entry is relevant:
|
|
62
|
-
- "How do I use useState in React?" → entry: `react`
|
|
63
|
-
- "How to configure cache in Quarkus?" → entry: `quarkus`
|
|
54
|
+
## When to use dockit
|
|
64
55
|
|
|
65
|
-
|
|
56
|
+
Use when you need:
|
|
57
|
+
- Up-to-date framework/library documentation instead of stale training data
|
|
58
|
+
- API reference, class docs, or configuration guides
|
|
59
|
+
- Source code structure analysis (imports, calls, inheritance graphs)
|
|
60
|
+
- To find which files/modules a function touches in a codebase
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
**Global search** (no entry) — returns top result per entry:
|
|
69
|
-
```bash
|
|
70
|
-
dockit search "cache"
|
|
71
|
-
```
|
|
62
|
+
## Entry Types and Behavior
|
|
72
63
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Always scope to the entry once you know which framework the user is asking about.
|
|
64
|
+
| Entry has | `dockit search` | `dockit graph` |
|
|
65
|
+
|-----------|----------------|-----------------|
|
|
66
|
+
| Docs only | Returns results | No graph available |
|
|
67
|
+
| Source code only | Returns empty | Use graph tools |
|
|
68
|
+
| Docs + code | Returns results (graph-boosted) | Graph tools work |
|
|
79
69
|
|
|
80
|
-
|
|
81
|
-
Strip conversational filler. Keep only technical terms:
|
|
70
|
+
## Build Status
|
|
82
71
|
|
|
83
|
-
|
|
84
|
-
|---------------|------------|
|
|
85
|
-
| "How do I create a custom hook in React?" | `"create custom hook"` |
|
|
86
|
-
| "What is the latest Quarkus feature for caching?" | `"cache latest feature"` |
|
|
72
|
+
Entries start as `pending`. Build them before searching:
|
|
87
73
|
|
|
88
|
-
### Step 4: Handle missing builds
|
|
89
|
-
If an entry shows status `pending` or `error`, build it first:
|
|
90
74
|
```bash
|
|
91
|
-
dockit build
|
|
92
|
-
dockit status
|
|
75
|
+
dockit build quarkus
|
|
76
|
+
dockit status quarkus # wait for "ready"
|
|
93
77
|
```
|
|
94
78
|
|
|
95
|
-
|
|
79
|
+
If an entry shows `error`, check the build log via `dockit status <entry> --json`.
|
|
96
80
|
|
|
97
|
-
|
|
81
|
+
## MCP Tools
|
|
82
|
+
|
|
83
|
+
If configured as an MCP server, use these tools instead of CLI:
|
|
98
84
|
|
|
99
85
|
| MCP Tool | CLI Equivalent |
|
|
100
86
|
|----------|----------------|
|
|
101
87
|
| `dockit_list_entries` | `dockit list` |
|
|
88
|
+
| `dockit_find_entry` | — |
|
|
102
89
|
| `dockit_global_search` | `dockit search "query"` |
|
|
103
90
|
| `dockit_search` | `dockit search <entry> "query"` |
|
|
104
91
|
| `dockit_get_doc` | `dockit get <entry> <path>` |
|
|
105
|
-
| `dockit_build`
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
|
|
111
|
-
## Source Code Entries (Knowledge Graph)
|
|
112
|
-
|
|
113
|
-
For entries with `source-code` sources, the primary query mechanism is the **knowledge graph** instead of text search. Graphify's Tree-sitter AST pass parses 15+ languages and produces structural edges (*calls*, *imports*, *inherits*).
|
|
114
|
-
|
|
115
|
-
### Graph MCP Tools
|
|
116
|
-
|
|
117
|
-
| Tool | Description |
|
|
118
|
-
|------|-------------|
|
|
119
|
-
| `dockit_graph_query <entry> <query>` | Search graph nodes by name, file, or type |
|
|
120
|
-
| `dockit_graph_path <entry> <from> <to>` | Find shortest dependency path between two nodes |
|
|
121
|
-
| `dockit_graph_explain <entry> <node>` | Get node details with edges and connections |
|
|
122
|
-
| `dockit_graph_gods <entry>` | List most connected (highest-degree) nodes |
|
|
123
|
-
|
|
124
|
-
### Behavior by Entry Type
|
|
92
|
+
| `dockit_build` | `dockit build <entry>` |
|
|
93
|
+
| `dockit_build_status` | `dockit status <entry>` |
|
|
94
|
+
| `dockit_graph_query` | `dockit graph query` |
|
|
95
|
+
| `dockit_graph_path` | `dockit graph path` |
|
|
96
|
+
| `dockit_graph_explain` | `dockit graph explain` |
|
|
97
|
+
| `dockit_graph_gods` | `dockit graph gods` |
|
|
125
98
|
|
|
126
|
-
|
|
127
|
-
|------------|--------|-------------|
|
|
128
|
-
| Source-code only | `dockit search` returns empty | Use `dockit_graph_*` tools |
|
|
129
|
-
| Mixed (docs + code) | `dockit search` works + results graph-boosted | `dockit_graph_*` tools work |
|
|
130
|
-
| Docs only | `dockit search` works | No graph tools |
|
|
99
|
+
## Key Constraints
|
|
131
100
|
|
|
132
|
-
## Notes
|
|
133
101
|
- Documentation is plain text extracted from HTML
|
|
134
|
-
- Content is truncated at
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
After answering with documentation content, always display the source in a table at the end:
|
|
140
|
-
|
|
141
|
-
| Field | Value |
|
|
142
|
-
|-------|-------|
|
|
143
|
-
| **Type** | `<source type>` |
|
|
144
|
-
| **Label** | `<source label>` |
|
|
145
|
-
| **Repo** | `<repoUrl>` |
|
|
146
|
-
| **Source Path** | `<sourcePath>` |
|
|
147
|
-
| **Version** | `<entry version>` |
|
|
148
|
-
|
|
149
|
-
To get source details, use `--json` flag with search or check `dockit list --json`. Source fields come from the entry's `sources` array in `dockit.yaml`:
|
|
150
|
-
- `type` — source type (e.g., `github-markdown`, `asciidoc`, `maven`, `source-code`)
|
|
151
|
-
- `label` — human-readable label
|
|
152
|
-
- `repoUrl` or `localPath` — repository URL or local path
|
|
153
|
-
- `sourcePath` — path within the repo
|
|
154
|
-
- Entry `version` — the version of the documentation entry
|
|
102
|
+
- Content is truncated at 50 KB per document
|
|
103
|
+
- Documents must be built before searchable (status = `ready`)
|
|
104
|
+
- Knowledge graph requires `graphify` Python package and source-code source type
|
|
105
|
+
- All data is local. No cloud, no API keys required
|