@docsworth/cli 0.0.0-stage → 0.3.0
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 +55 -0
- package/README.md +238 -2
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +458 -0
- package/dist/core/acl.d.ts +37 -0
- package/dist/core/acl.js +136 -0
- package/dist/core/adopt.d.ts +68 -0
- package/dist/core/adopt.js +665 -0
- package/dist/core/audit-log.d.ts +133 -0
- package/dist/core/audit-log.js +290 -0
- package/dist/core/blocks.d.ts +35 -0
- package/dist/core/blocks.js +417 -0
- package/dist/core/codeowners.d.ts +62 -0
- package/dist/core/codeowners.js +133 -0
- package/dist/core/config.d.ts +101 -0
- package/dist/core/config.js +175 -0
- package/dist/core/coverage.d.ts +25 -0
- package/dist/core/coverage.js +41 -0
- package/dist/core/duration.d.ts +20 -0
- package/dist/core/duration.js +60 -0
- package/dist/core/edits.d.ts +13 -0
- package/dist/core/edits.js +20 -0
- package/dist/core/errors.d.ts +11 -0
- package/dist/core/errors.js +13 -0
- package/dist/core/frontmatter.d.ts +29 -0
- package/dist/core/frontmatter.js +49 -0
- package/dist/core/gate.d.ts +17 -0
- package/dist/core/gate.js +25 -0
- package/dist/core/gfm.d.ts +13 -0
- package/dist/core/gfm.js +244 -0
- package/dist/core/github.d.ts +152 -0
- package/dist/core/github.js +234 -0
- package/dist/core/host.d.ts +125 -0
- package/dist/core/host.js +22 -0
- package/dist/core/identity.d.ts +39 -0
- package/dist/core/identity.js +127 -0
- package/dist/core/init.d.ts +25 -0
- package/dist/core/init.js +86 -0
- package/dist/core/links.d.ts +82 -0
- package/dist/core/links.js +345 -0
- package/dist/core/lint.d.ts +16 -0
- package/dist/core/lint.js +149 -0
- package/dist/core/mcp/audit-transport.d.ts +16 -0
- package/dist/core/mcp/audit-transport.js +238 -0
- package/dist/core/mcp/server.d.ts +19 -0
- package/dist/core/mcp/server.js +216 -0
- package/dist/core/mcp/text.d.ts +14 -0
- package/dist/core/mcp/text.js +43 -0
- package/dist/core/mirror-view.d.ts +68 -0
- package/dist/core/mirror-view.js +367 -0
- package/dist/core/new-page.d.ts +52 -0
- package/dist/core/new-page.js +49 -0
- package/dist/core/policy.d.ts +10 -0
- package/dist/core/policy.js +30 -0
- package/dist/core/polish.d.ts +42 -0
- package/dist/core/polish.js +1000 -0
- package/dist/core/printable.d.ts +4 -0
- package/dist/core/printable.js +16 -0
- package/dist/core/references.d.ts +87 -0
- package/dist/core/references.js +1744 -0
- package/dist/core/repo.d.ts +46 -0
- package/dist/core/repo.js +118 -0
- package/dist/core/schema.d.ts +50 -0
- package/dist/core/schema.js +51 -0
- package/dist/core/search.d.ts +32 -0
- package/dist/core/search.js +132 -0
- package/dist/core/serve/auth.d.ts +23 -0
- package/dist/core/serve/auth.js +38 -0
- package/dist/core/serve/server.d.ts +21 -0
- package/dist/core/serve/server.js +138 -0
- package/dist/core/serve/sessions.d.ts +40 -0
- package/dist/core/serve/sessions.js +203 -0
- package/dist/core/serve/token.d.ts +10 -0
- package/dist/core/serve/token.js +96 -0
- package/dist/core/service.d.ts +473 -0
- package/dist/core/service.js +973 -0
- package/dist/core/sla.d.ts +16 -0
- package/dist/core/sla.js +20 -0
- package/dist/core/stale.d.ts +16 -0
- package/dist/core/stale.js +24 -0
- package/dist/core/tool-registry.d.ts +31 -0
- package/dist/core/tool-registry.js +80 -0
- package/dist/core/url.d.ts +4 -0
- package/dist/core/url.js +31 -0
- package/dist/core/verify-pages.d.ts +19 -0
- package/dist/core/verify-pages.js +110 -0
- package/dist/core/version.d.ts +22 -0
- package/dist/core/version.js +32 -0
- package/dist/core/writes.d.ts +58 -0
- package/dist/core/writes.js +113 -0
- package/dist/web/assets/index-8J-FUbb0.js +29 -0
- package/dist/web/assets/index-BGpAZzeM.css +1 -0
- package/dist/web/index.html +14 -0
- package/docs/format-spec.md +349 -0
- package/package.json +75 -4
- package/plugin/.claude-plugin/plugin.json +8 -0
- package/plugin/.mcp.json +8 -0
- package/plugin/bin/docsworth-mcp.mjs +46 -0
- package/plugin/skills/draft-runbook/SKILL.md +75 -0
- package/plugin/skills/polish-page/SKILL.md +64 -0
- package/plugin/skills/update-after-incident/SKILL.md +59 -0
- package/plugin/skills/verify-page/SKILL.md +46 -0
- package/templates/github/knowledge.yml +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
16
|
+
|
|
17
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
18
|
+
|
|
19
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
20
|
+
|
|
21
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
22
|
+
|
|
23
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
24
|
+
|
|
25
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
26
|
+
|
|
27
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
28
|
+
|
|
29
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
30
|
+
|
|
31
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
32
|
+
|
|
33
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
34
|
+
|
|
35
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
36
|
+
|
|
37
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
38
|
+
|
|
39
|
+
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
40
|
+
|
|
41
|
+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
42
|
+
|
|
43
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
44
|
+
|
|
45
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
46
|
+
|
|
47
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
50
|
+
|
|
51
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
52
|
+
|
|
53
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
54
|
+
|
|
55
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -1,3 +1,239 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Docsworth
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Your runbooks, owned, verified and executable by every agent.**
|
|
4
|
+
|
|
5
|
+
Docsworth is a git-native knowledge layer for coding agents. Pages are markdown in your
|
|
6
|
+
own repo. Every page has exactly one owning team in CODEOWNERS and a review date. Agents
|
|
7
|
+
reach the pages through an MCP server that cites only pages a team has verified within
|
|
8
|
+
their review window. Everything else comes back as *excluded: past review date, owned by
|
|
9
|
+
platform*, so the gap is visible rather than silently stale.
|
|
10
|
+
|
|
11
|
+
- **Customer-owned git.** Plain markdown in your GitHub repo; no lock-in, and it reviews
|
|
12
|
+
like code.
|
|
13
|
+
- **Enforced ownership.** `docsworth lint` fails CI unless each page's CODEOWNERS rule names
|
|
14
|
+
exactly one team, and that team matches the page.
|
|
15
|
+
- **Citation gate.** Only `canonical` pages inside their SLA are citable. The gate is
|
|
16
|
+
fixed and not configurable.
|
|
17
|
+
- **PR-only writes.** Agents propose edits and owners verify pages through pull
|
|
18
|
+
requests. Nothing writes to the default branch.
|
|
19
|
+
- **Polish without drift.** Agents can restructure and reword a page as a `polish`
|
|
20
|
+
PR. The server refuses one that changes a code block, inline code, a link, a number
|
|
21
|
+
or a negation word. The check reads pages as CommonMark does, and is fuzzed against
|
|
22
|
+
CommonMark's reference parser: no miss in 1.5 million mutated pages.
|
|
23
|
+
- **Mirror, don't migrate.** Read-only Confluence and Notion mirror, scored for
|
|
24
|
+
freshness, ownership and overlap with canonical pages. With `mirror.serve`, agents
|
|
25
|
+
see it as context they may never cite.
|
|
26
|
+
- **Skills compiler.** Verified runbooks compile into `SKILL.md` files that agents
|
|
27
|
+
execute.
|
|
28
|
+
- **Agents read free.** No metering on reads.
|
|
29
|
+
|
|
30
|
+
## 5-minute quickstart
|
|
31
|
+
|
|
32
|
+
You need Node 22.12+, a GitHub repo for your knowledge, and Claude Code.
|
|
33
|
+
|
|
34
|
+
Install the CLI from npm. It's `@docsworth/cli`: `agent-kb` and `docsworth` there are
|
|
35
|
+
not ours.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install --global @docsworth/cli
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cd your-knowledge-repo
|
|
43
|
+
docsworth init --team platform # config, CODEOWNERS, root map, a guide
|
|
44
|
+
docsworth lint . # 3 pages, 0 errors, 0 warnings
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`init` reads your GitHub org from the repo's remote; in a repo without one yet, add
|
|
48
|
+
`--org <your-org>`. Add `--ci` for a workflow that lints and compiles on every PR.
|
|
49
|
+
|
|
50
|
+
Install the Claude Code plugin from this repo's marketplace:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
claude plugin marketplace add docsworth/docsworth
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
claude plugin install docsworth@docsworth
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The plugin runs the published CLI through `npx`. To run your own install instead (Docsworth
|
|
61
|
+
pro needs it), set `DOCSWORTH_BIN` in Claude Code's environment to its absolute path, such
|
|
62
|
+
as `$(npm prefix -g)/bin/docsworth`.
|
|
63
|
+
|
|
64
|
+
Start Claude Code in the knowledge repo, or set `DOCSWORTH_KNOWLEDGE_DIR` to its path, then ask
|
|
65
|
+
*"How do I add a page to our knowledge base?"*. The answer cites
|
|
66
|
+
`guide-writing-pages`.
|
|
67
|
+
|
|
68
|
+
The server uses your own GitHub identity (`GITHUB_TOKEN`, `GH_TOKEN` or `gh auth
|
|
69
|
+
token`), so your repo and team permissions decide what you see.
|
|
70
|
+
|
|
71
|
+
## Adopting existing docs
|
|
72
|
+
|
|
73
|
+
Docs you already have, a Docusaurus site's say, become pages without moving a URL. With
|
|
74
|
+
them under `knowledge/` (or `knowledge_root` in `.knowledge/config.yaml` set to where they
|
|
75
|
+
are), after `init`:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
docsworth adopt --team docs # the frontmatter each page lacks, as drafts
|
|
79
|
+
docsworth lint .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`adopt` gives each page the fields it lacks, and keeps everything it has:
|
|
83
|
+
|
|
84
|
+
- a page's `id` is its own, else its file name, a Docusaurus number prefix removed, so the
|
|
85
|
+
site's URLs stay where they are;
|
|
86
|
+
- its owner comes from CODEOWNERS, else `--team`;
|
|
87
|
+
- a route link like `/guides/setup` becomes a relative link to the file,
|
|
88
|
+
`../guides/setup.md`;
|
|
89
|
+
- keys a site generator keeps, such as `sidebar_position`, go in `frontmatter.extra_fields`;
|
|
90
|
+
- images a site serves from its `static/` directory (`/img/x.png`) get a hint naming the
|
|
91
|
+
`static_dirs` line to add, after which lint reads them there.
|
|
92
|
+
|
|
93
|
+
A page or link it can't settle stays as it is, listed, and lint fails it until it's fixed
|
|
94
|
+
by hand: a category index like `guides/index.md`, two pages with one file name, a link to
|
|
95
|
+
nothing. `--dry-run` reports and writes nothing.
|
|
96
|
+
|
|
97
|
+
Adopted pages are drafts, so agents cite none of them yet. Once a team has read its pages:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
docsworth verify knowledge/guides # canonical, verified today
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Both commands only change files. Commit them and open a pull request, which CODEOWNERS
|
|
104
|
+
sends to the owning team.
|
|
105
|
+
|
|
106
|
+
If the site stays up, set `site_url` (`https://docs.example.com/docs/`) in the config.
|
|
107
|
+
Then a link to a page someone can't see reads `[restricted page]` by its full URL on the
|
|
108
|
+
site, as it already does by its route. A link without an extension that names nothing
|
|
109
|
+
reads `[restricted page]` too: a route can't be told from a hidden page's.
|
|
110
|
+
|
|
111
|
+
## Commands
|
|
112
|
+
|
|
113
|
+
| Command | What it does |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `docsworth init [dir]` | Scaffold config, CODEOWNERS, `knowledge/index.md`, a glossary and a writing guide. Never overwrites. |
|
|
116
|
+
| `docsworth lint [dir]` | Frontmatter, CODEOWNERS ownership, links and duplicate ids. Exit 1 on errors; overdue pages only warn. |
|
|
117
|
+
| `docsworth adopt [dir] [--team t]` | Existing pages get the frontmatter they lack, as drafts, and route links become `.md` links; lists what it can't settle. Working tree only; `--dry-run`. |
|
|
118
|
+
| `docsworth verify <paths…>` | The draft or canonical pages under the paths become canonical, verified today. Working tree only; `--dry-run`. |
|
|
119
|
+
| `docsworth stale [dir]` | Pages past their review SLA or without a team owner. |
|
|
120
|
+
| `docsworth coverage [dir] [--html f]` | Percentage team-owned and percentage verified within SLA, by team; optional static dashboard. |
|
|
121
|
+
| `docsworth digest [dir] [--send]` | Weekly per-team digest: due, overdue, most read by agents. Prints unless `--send`. |
|
|
122
|
+
| `docsworth mcp [dir]` | The MCP server (stdio): `search`, `read`, `list`, `stale`, `propose_edit`, `verify`, `draft_page`. Without `dir`, it serves `DOCSWORTH_KNOWLEDGE_DIR`, else the current directory. |
|
|
123
|
+
| `docsworth serve [dir]` | The web app at `127.0.0.1:4747` (overview, search, pages, teams, a link graph, capture), and the same server over HTTP for it and the browser extension, behind a token kept in your state directory (`--print-token`, `--rotate-token`, `--allow-extension <id>`). |
|
|
124
|
+
| `docsworth compile [dir] [--check]` | Canonical runbooks → `skills/<id>/SKILL.md`; `--check` exits 1 on drift. |
|
|
125
|
+
| `docsworth mirror [dir]` | Read-only Confluence and Notion mirror into `.knowledge/mirror`, scored. |
|
|
126
|
+
| `docsworth promote <mirror-id> --owner-team t` | Draft PR copying a mirrored page into `knowledge/`. |
|
|
127
|
+
| `docsworth audit [dir] [--bench d]` | Audit report: coverage, stale and overlapping pages, DIY accuracy score. |
|
|
128
|
+
| `docsworth bench run [dir]` | Citation benchmark: Claude on the raw wiki vs. the ungated layer vs. the gated layer. |
|
|
129
|
+
|
|
130
|
+
`--as-of YYYY-MM-DD` evaluates SLAs on a fixed date, for reproducible reports.
|
|
131
|
+
|
|
132
|
+
## How it works
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
knowledge/*.md ──lint (CI)──▶ CODEOWNERS: one team per page
|
|
136
|
+
│
|
|
137
|
+
├─▶ docsworth mcp ──▶ ACL filter (your GitHub teams) ──▶ citation gate ──▶ agent
|
|
138
|
+
│ propose_edit / verify ──▶ PR only
|
|
139
|
+
├─▶ docsworth compile ──▶ skills/<id>/SKILL.md
|
|
140
|
+
Confluence / Notion ──docsworth mirror──▶ .knowledge/mirror (scored, never citable) ──promote──▶ PR
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- [docs/format-spec.md](docs/format-spec.md): the format contract.
|
|
144
|
+
- [docs/security-model.md](docs/security-model.md): ACLs, writes and prompt injection.
|
|
145
|
+
Note that `acl` narrows what agents are served; it isn't confidentiality inside one
|
|
146
|
+
repo.
|
|
147
|
+
- [docs/enterprise/](docs/enterprise/README.md): for a security review. The two modes, what is
|
|
148
|
+
inherited from GitHub, a responsibility matrix, a data-flow diagram and a pre-filled
|
|
149
|
+
questionnaire. Vulnerabilities: [SECURITY.md](SECURITY.md).
|
|
150
|
+
- [docs/rollout.md](docs/rollout.md): org-wide rollout with managed settings.
|
|
151
|
+
|
|
152
|
+
## Try it on the example
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
npm install
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm run docsworth -- --as-of 2026-11-02 lint examples/acme
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npm run docsworth -- --as-of 2026-11-02 coverage examples/acme --html coverage.html
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npm run mirror-fixture -w @docsworth-pro/pro -- examples/acme
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm run docsworth -- --as-of 2026-11-02 audit examples/acme --out audit
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Browser extension
|
|
175
|
+
|
|
176
|
+
A side panel for Chrome (and other Chromium browsers) over `docsworth serve`. From the panel
|
|
177
|
+
you can search and read pages, or suggest an addition to one.
|
|
178
|
+
|
|
179
|
+
**Saving what you read.**
|
|
180
|
+
- **From the menu:** on any page, right-click and choose **Save page to Docsworth**, or
|
|
181
|
+
select some text and choose **Save selection to Docsworth**.
|
|
182
|
+
- **From the panel:** **Save this page** and **Save the selection** read the tab you opened
|
|
183
|
+
the panel from with the toolbar button.
|
|
184
|
+
- **In Gmail:** a **Save to Docsworth** button beside a thread's subject.
|
|
185
|
+
|
|
186
|
+
The page's main content or the selection arrives as markdown, with its headings, links,
|
|
187
|
+
code blocks and tables, and without what the page hides or its navigation. The panel first
|
|
188
|
+
shows the pages that may already cover it, each with **Add the capture here**, then a draft
|
|
189
|
+
page filled from it, with its source. Nothing is written until you open the PR. The
|
|
190
|
+
extension isn't in the Chrome Web Store yet: build it and load it unpacked.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npm run build -w @docsworth/extension
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
1. In Chrome, open `chrome://extensions`, turn on **Developer mode**, choose **Load
|
|
197
|
+
unpacked** and pick `packages/extension/dist`. Note the extension's id.
|
|
198
|
+
2. Start the server so it answers the extension:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
docsworth serve --allow-extension <the extension's id>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
3. Open the extension's options (its toolbar icon, then **Options**). Paste the link `serve`
|
|
205
|
+
printed, then choose **Connect**. Chrome forgets the token when it quits; paste it again
|
|
206
|
+
then (`docsworth serve --print-token` shows it).
|
|
207
|
+
|
|
208
|
+
What it can reach and keep, and why the token is safe from pages:
|
|
209
|
+
[docs/security-model.md](docs/security-model.md#the-browser-extension).
|
|
210
|
+
|
|
211
|
+
**Gmail checklist.** Gmail's markup isn't a contract. The tests run against Gmail-shaped
|
|
212
|
+
fixtures, so check these by hand, signed in, after loading a new build:
|
|
213
|
+
|
|
214
|
+
- [ ] An open thread shows **Save to Docsworth** beside its subject. The inbox list shows
|
|
215
|
+
none.
|
|
216
|
+
- [ ] Clicking it opens the side panel with "From Gmail", related pages, and a draft whose
|
|
217
|
+
title is the subject and whose body is the expanded messages, each with its sender's name
|
|
218
|
+
and no addresses.
|
|
219
|
+
- [ ] Moving to another thread moves the button with it. Clicking it while a draft is open
|
|
220
|
+
shows "Another capture is waiting" rather than replacing the draft.
|
|
221
|
+
- [ ] A thread with collapsed messages captures only the expanded ones: expand what you
|
|
222
|
+
want in the draft first.
|
|
223
|
+
|
|
224
|
+
## Development
|
|
225
|
+
|
|
226
|
+
The one verify target is `npm test`: a typecheck and the vitest suite, including an MCP
|
|
227
|
+
end-to-end test and the ACL matrix. It also builds, packs and installs the real tarball.
|
|
228
|
+
See [AGENTS.md](AGENTS.md), and [docs/releasing.md](docs/releasing.md) for releases.
|
|
229
|
+
|
|
230
|
+
## Status
|
|
231
|
+
|
|
232
|
+
v0.3. What's in it, and what hasn't been verified against the real thing yet, is in
|
|
233
|
+
[the release notes](docs/release-notes/v0.3.0.md).
|
|
234
|
+
|
|
235
|
+
## License
|
|
236
|
+
|
|
237
|
+
Apache-2.0. Docsworth pro (`@docsworth-pro/pro`: the mirror connectors, digest, reports,
|
|
238
|
+
the SIEM audit sink and the benchmark) is a separate package under its own, proprietary
|
|
239
|
+
licence.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
declare const program: Command;
|
|
4
|
+
/** "Now" for every SLA computation; --as-of pins it for reproducible reports. */
|
|
5
|
+
export declare function now(): Date;
|
|
6
|
+
/**
|
|
7
|
+
* The change happened but its outcome isn't in a required log: say so, and exit 3 (done,
|
|
8
|
+
* audit degraded) so automation can tell it from success (0) and failure (2).
|
|
9
|
+
*/
|
|
10
|
+
export declare const EXIT_AUDIT_DEGRADED = 3;
|
|
11
|
+
export { program };
|