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.
Files changed (2) hide show
  1. package/README.md +147 -27
  2. 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
- **Local, version-locked documentation for AI agents.**
7
+ Local, version-locked documentation packages for AI agents, indexed in SQLite and served over MCP.
8
+
9
+ [![npm](https://img.shields.io/npm/v/docspack.svg)](https://www.npmjs.com/package/docspack)
10
+ [![downloads](https://img.shields.io/npm/dm/docspack.svg)](https://www.npmjs.com/package/docspack)
11
+ [![license](https://img.shields.io/npm/l/docspack.svg)](./LICENSE)
12
+ [![node](https://img.shields.io/node/v/docspack.svg)](https://nodejs.org)
13
+ [![types](https://img.shields.io/badge/types-TypeScript%20strict-blue.svg)](https://www.typescriptlang.org)
14
+ [![status](https://img.shields.io/badge/status-experimental-orange.svg)](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
- Documentation ships as npm packages (`@stripe/docspack`, `@docspack-community/jira`).
6
- `docspack` indexes the ones your project depends on into a global SQLite database with
7
- FTS5, and serves them to agents over MCP — offline, instant, and matched to the exact
8
- versions you installed.
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
- ```bash
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
- npx docspack search "webhook signature"
77
+
78
+ # 3. Ask it something
79
+ npx docspack ask "how do I verify a webhook signature"
14
80
  ```
15
81
 
16
- Give an agent access with one command:
82
+ Then give the agent access by pasting these two lines into `AGENTS.md` or `CLAUDE.md`:
17
83
 
18
- ```bash
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 MCP server exposes `query_local_docs` (`query`, optional `packageFilter`), returns the
23
- best-ranked chunks, and caps a response at 3,000 tokens. It also exposes
24
- `record_docs_problem`, the equivalent of `docspack feedback add` — it appends to a local file
25
- and cannot send anything anywhere.
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 search <query> Full-text search the local index
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 Run the MCP server over stdio
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
- ## Authoring
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
- ```bash
43
- npx docspack build --from ./docs --name @acme/docspack --pkg-version 1.4.0
44
- npx docspack build --openapi ./openapi.json --name @acme/docspack --pkg-version 1.4.0
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
- Writes `.llms/manifest.json`, `.llms/chunks/*.md` and an `llms.txt` table of contents,
48
- ready for `npm publish`.
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
- ## Requirements
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
- Node 22.5 or newer — the index uses `node:sqlite` from the standard library, so there is
53
- no native module to build.
170
+ ## Related packages
54
171
 
55
- Full documentation: https://github.com/docspack/docspack
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.0",
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://github.com/docspack/docspack#readme",
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
- "src"
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.0"
51
+ "@docspack/registry": "^0.1.1"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/node": "26.2.0",