docspack 0.1.0 → 0.1.1
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/README.md +147 -27
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,59 +1,179 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<a href="https://docspack.dev"><img src="https://docspack.dev/logo.png" width="72" height="72" alt="docspack" /></a>
|
|
4
|
+
|
|
1
5
|
# docspack
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
Local, version-locked documentation packages for AI agents, indexed in SQLite and served over MCP.
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/docspack)
|
|
10
|
+
[](https://www.npmjs.com/package/docspack)
|
|
11
|
+
[](./LICENSE)
|
|
12
|
+
[](https://nodejs.org)
|
|
13
|
+
[](https://www.typescriptlang.org)
|
|
14
|
+
[](https://github.com/docspack/docspack/releases)
|
|
15
|
+
|
|
16
|
+
[Website](https://docspack.dev) ·
|
|
17
|
+
[Documentation](https://docspack.dev/llms.txt) ·
|
|
18
|
+
[GitHub](https://github.com/docspack/docspack) ·
|
|
19
|
+
[Releases](https://github.com/docspack/docspack/releases)
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
> **Publishing documentation for your own library?** You want `docspack init`, which
|
|
26
|
+
> scaffolds a documentation package. This README is mostly about consuming them.
|
|
27
|
+
|
|
28
|
+
> **Just want your agent to read the docs?** Three lines: install a docs package, run
|
|
29
|
+
> `docspack sync`, and paste one sentence into `AGENTS.md`. Jump to [Quick start](#quick-start).
|
|
30
|
+
|
|
31
|
+
## Overview
|
|
32
|
+
|
|
33
|
+
An AI coding agent answers from one of three places: its training data, which is frozen at
|
|
34
|
+
some past version; a docs site it fetches, which is whatever the vendor publishes today; or
|
|
35
|
+
nothing at all. None of those is the version in your lockfile.
|
|
4
36
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
37
|
+
docspack closes that gap by making documentation an ordinary npm dependency. A documentation
|
|
38
|
+
package (`@stripe/docspack`, `@docspack-community/jira`) holds Markdown split into chunks plus
|
|
39
|
+
a manifest describing them, and its version tracks the library's. `docspack sync` indexes the
|
|
40
|
+
ones this project depends on into one SQLite database per machine, and `docspack ask` answers
|
|
41
|
+
from that index — offline, bounded, and matched to what you actually installed.
|
|
9
42
|
|
|
10
|
-
|
|
43
|
+
The mental model: **publish → sync → ask.**
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **Version-locked** — answers come from the docs package resolved in your lockfile, never a
|
|
48
|
+
newer or older one. The index may hold five versions of a library; a project sees only its own.
|
|
49
|
+
- **Offline by construction** — `sync`, `ask`, `search` and `list` make no network requests.
|
|
50
|
+
They read `node_modules` and a local SQLite file.
|
|
51
|
+
- **Bounded responses** — 3 chunks and 3,000 tokens by default, counted from the manifest
|
|
52
|
+
before content is returned, so a query cannot overrun its budget.
|
|
53
|
+
- **No server, no resident context** — every agent already has a shell. One line in `AGENTS.md`
|
|
54
|
+
is the whole setup, and nothing runs when nobody is asking.
|
|
55
|
+
- **MCP when you want it** — `docspack mcp` serves the same index over the Model Context
|
|
56
|
+
Protocol, returning identical text, for clients that prefer a declared tool.
|
|
57
|
+
- **No native modules** — the index uses `node:sqlite` from the standard library.
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
npm install -D docspack
|
|
63
|
+
pnpm add -D docspack
|
|
64
|
+
yarn add -D docspack
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Requires Node 22.5 or newer.
|
|
68
|
+
|
|
69
|
+
## Quick start
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
# 1. Add a documentation package, the same way you add any dependency
|
|
11
73
|
pnpm add -D @acme/docspack
|
|
74
|
+
|
|
75
|
+
# 2. Index every docs package this project depends on
|
|
12
76
|
npx docspack sync
|
|
13
|
-
|
|
77
|
+
|
|
78
|
+
# 3. Ask it something
|
|
79
|
+
npx docspack ask "how do I verify a webhook signature"
|
|
14
80
|
```
|
|
15
81
|
|
|
16
|
-
|
|
82
|
+
Then give the agent access by pasting these two lines into `AGENTS.md` or `CLAUDE.md`:
|
|
17
83
|
|
|
18
|
-
```
|
|
84
|
+
```
|
|
85
|
+
Run `docspack ask "<question>"` for documentation on this project's
|
|
86
|
+
dependencies. It answers from the installed versions.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
That is the entire integration. No server to start, no per-client configuration.
|
|
90
|
+
|
|
91
|
+
<details>
|
|
92
|
+
<summary>Using MCP instead</summary>
|
|
93
|
+
|
|
94
|
+
```sh
|
|
19
95
|
claude mcp add docspack -- npx -y docspack mcp
|
|
20
96
|
```
|
|
21
97
|
|
|
22
|
-
The
|
|
23
|
-
best-ranked chunks
|
|
24
|
-
|
|
25
|
-
|
|
98
|
+
The server exposes `query_local_docs` (`query`, optional `packageFilter`), returns the
|
|
99
|
+
best-ranked chunks and caps a response at 3,000 tokens. It also exposes `record_docs_problem`,
|
|
100
|
+
the equivalent of `docspack feedback add` — it appends to a local file and cannot send
|
|
101
|
+
anything anywhere.
|
|
102
|
+
|
|
103
|
+
</details>
|
|
26
104
|
|
|
27
105
|
## Commands
|
|
28
106
|
|
|
107
|
+
Reading:
|
|
108
|
+
|
|
29
109
|
```
|
|
30
110
|
docspack sync Index the docs packages this project depends on
|
|
31
|
-
docspack
|
|
111
|
+
docspack ask <question> Answer from the local index — the command to give an agent
|
|
112
|
+
docspack search <query> Same index, formatted for a human reading the terminal
|
|
32
113
|
docspack list Show this project's docs packages and their index state
|
|
33
114
|
docspack verify Check the docs still describe the code you installed
|
|
34
115
|
docspack feedback <sub> Record documentation problems: add, list, submit, remove
|
|
35
|
-
docspack mcp
|
|
36
|
-
docspack build [source] Generate a docs package for publishing
|
|
116
|
+
docspack mcp Serve the index over MCP instead, as a long-lived process
|
|
37
117
|
docspack sources List curated sources that `docspack build` can fetch
|
|
38
118
|
```
|
|
39
119
|
|
|
40
|
-
|
|
120
|
+
Authoring:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
docspack init Scaffold a documentation package, then build and check it
|
|
124
|
+
docspack build [source] Generate the .llms/ payload for publishing
|
|
125
|
+
docspack doctor Check a package the way the indexer and a reviewer would
|
|
126
|
+
docspack preview <query> Answer a query from the local package, as an agent would
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Run `docspack --help` for every flag.
|
|
130
|
+
|
|
131
|
+
## Authoring a documentation package
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
npx docspack init # scaffold, build and check in one step
|
|
135
|
+
npx docspack build --from ./docs # Markdown, split at headings
|
|
136
|
+
npx docspack build --openapi ./openapi.json # one chunk per operation
|
|
137
|
+
npx docspack build stripe # from a project's public llms.txt
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`build` writes `.llms/manifest.json`, `.llms/chunks/*.md` and an `llms.txt` table of contents,
|
|
141
|
+
ready for `npm publish`. `docspack doctor --strict` checks the result the way the indexer and
|
|
142
|
+
a reviewer would.
|
|
41
143
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
144
|
+
Manifests validate against <https://docspack.dev/schema/v1.json>.
|
|
145
|
+
|
|
146
|
+
## Recording documentation problems
|
|
147
|
+
|
|
148
|
+
An agent holds the documentation, the installed library and a failing program at the same
|
|
149
|
+
moment — a signal that today evaporates. `docspack feedback add` captures it locally:
|
|
150
|
+
|
|
151
|
+
```sh
|
|
152
|
+
npx docspack feedback add --chunk @acme/docspack@1.4.0/api-auth \
|
|
153
|
+
--kind drift --evidence "client.setKey is not exported; setApiKey is"
|
|
45
154
|
```
|
|
46
155
|
|
|
47
|
-
|
|
48
|
-
|
|
156
|
+
Claims must be falsifiable. `drift` must name the identifier; `incorrect` and `missing` must
|
|
157
|
+
carry `--expected`, `--actual` and `--repro`. There is deliberately no kind for "this page is
|
|
158
|
+
confusing".
|
|
159
|
+
|
|
160
|
+
**Nothing is transmitted, and nothing can be** — docspack contains no code that sends a report
|
|
161
|
+
anywhere. `docspack feedback submit` prints a prefilled GitHub issue URL for vendors who opted
|
|
162
|
+
in from their own `package.json`, and a human decides whether to open it.
|
|
163
|
+
|
|
164
|
+
## Status
|
|
49
165
|
|
|
50
|
-
|
|
166
|
+
Pre-1.0 and versioned accordingly: minor releases may change behaviour. The package
|
|
167
|
+
specification is the part most worth depending on, and it is documented at
|
|
168
|
+
<https://docspack.dev/schema/v1.json>.
|
|
51
169
|
|
|
52
|
-
|
|
53
|
-
no native module to build.
|
|
170
|
+
## Related packages
|
|
54
171
|
|
|
55
|
-
|
|
172
|
+
| Package | Description |
|
|
173
|
+
| --- | --- |
|
|
174
|
+
| [`@docspack/registry`](https://www.npmjs.com/package/@docspack/registry) | Curated llms.txt sources for bootstrapping docs packages. |
|
|
175
|
+
| [`@docspack/docspack`](https://www.npmjs.com/package/@docspack/docspack) | docspack's own documentation, shipped as a docs package. |
|
|
56
176
|
|
|
57
177
|
## License
|
|
58
178
|
|
|
59
|
-
MIT
|
|
179
|
+
MIT — see [LICENSE](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docspack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Local, version-locked documentation packages for AI agents, indexed in SQLite and served over MCP.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"context",
|
|
15
15
|
"cli"
|
|
16
16
|
],
|
|
17
|
-
"homepage": "https://
|
|
17
|
+
"homepage": "https://docspack.dev",
|
|
18
18
|
"bugs": "https://github.com/docspack/docspack/issues",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"bin",
|
|
39
39
|
"dist",
|
|
40
|
+
"src",
|
|
40
41
|
"README.md",
|
|
41
|
-
"
|
|
42
|
+
"LICENSE"
|
|
42
43
|
],
|
|
43
44
|
"engines": {
|
|
44
45
|
"node": ">=22.5.0"
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
48
49
|
"turndown": "7.2.4",
|
|
49
50
|
"zod": "4.4.3",
|
|
50
|
-
"@docspack/registry": "^0.1.
|
|
51
|
+
"@docspack/registry": "^0.1.1"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@types/node": "26.2.0",
|