@agentskit/doc-bridge 0.1.0-alpha.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/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0-alpha.1
4
+
5
+ Initial alpha — human↔agent documentation bridge.
6
+
7
+ ### Layer 0 (no API key)
8
+
9
+ - Versioned Zod schemas for AgentHandoff, AgentSearch, DocBridgeIndex, config, and MemoryCandidate.
10
+ - `ak-docs init` (demo ownership by default, `--no-demo` available), `index`, `query`, `search`, `list`, `gate run`, `mcp`, `ask`.
11
+ - Ownership handoffs from **config**, **agent-doc frontmatter** (`package` + `editRoot`), or monorepo discovery.
12
+ - `--config` resolves project root from the config file directory.
13
+ - MCP: `handoff.resolve`, `doc.search`, `doc.get`, `gate.status`, memory + retriever tools.
14
+ - Human adapters: plain markdown, Fumadocs, Docusaurus; gates for freshness, human links, OKF style.
15
+ - Memory pipeline: ingest → classify → promote drafts (HITL).
16
+ - Progressive CLI help (Core / Intelligence / Advanced).
17
+
18
+ ### Layer 1 (optional AgentsKit peers)
19
+
20
+ - `ak-docs rag ingest|search` via `@agentskit/rag` + `@agentskit/memory`.
21
+ - `ak-docs chat` and `ask --chat` via `@agentskit/ink` + adapters (`handoffFirst`).
22
+ - Optional peerDependencies — Layer 0 install stays lean.
23
+
24
+ ### Docs / packaging
25
+
26
+ - Positioning as human↔agent bridge; public consumers: for-agents, Registry, Playbook.
27
+ - Getting started, MCP, examples, chat-and-rag guides.
28
+ - Fixed package `main`/`types` exports for publish.
@@ -0,0 +1,7 @@
1
+ # Code of Conduct
2
+
3
+ Be respectful, direct, and constructive.
4
+
5
+ We do not accept harassment, threats, discriminatory language, or bad-faith disruption in issues, pull requests, discussions, or release channels.
6
+
7
+ Maintainers may hide, edit, or remove comments and may restrict participation when needed to keep the project usable for contributors.
@@ -0,0 +1,32 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve `@agentskit/doc-bridge`.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ pnpm install
9
+ pnpm typecheck
10
+ pnpm test
11
+ pnpm build
12
+ ```
13
+
14
+ ## Development rules
15
+
16
+ - Keep Layer 0 deterministic: no LLM/API key required for `init`, `index`, `query`, `list`, gates, or MCP handoff tools.
17
+ - Do not add private-repo assumptions to public docs, examples, defaults, or tests.
18
+ - Prefer existing helpers and Node APIs before adding dependencies.
19
+ - Add or update the smallest test that would fail if the behavior regresses.
20
+ - Public contract changes must update the relevant docs under `docs/spec/` or `docs/schemas/`.
21
+
22
+ ## Releases
23
+
24
+ Use Changesets for versioned changes:
25
+
26
+ ```bash
27
+ pnpm changeset
28
+ pnpm version-packages
29
+ pnpm release
30
+ ```
31
+
32
+ Do not publish from a dirty worktree.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentsKit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # doc-bridge
2
+
3
+ **npm:** [`@agentskit/doc-bridge`](https://www.npmjs.com/package/@agentskit/doc-bridge) · **CLI:** `ak-docs`
4
+
5
+ **Human↔agent documentation bridge** for any project — not a wiki, not a hosted RAG chat.
6
+
7
+ doc-bridge helps coding agents **find the right file, edit the right roots, run the right checks**, keeps **agent docs linked to human docs**, and turns **agent memory into project documentation** (with human approval). The core is deterministic and works **without any LLM or API key**.
8
+
9
+ Optional intelligence (RAG + terminal chat) uses public AgentsKit packages — install only when you want them.
10
+
11
+ ## Why this exists
12
+
13
+ | Pattern | Gap |
14
+ |---------|-----|
15
+ | Wiki + RAG | Explains; weak on *where to act* and proof docs match code |
16
+ | AGENTS.md alone | Great static rules; no ownership index, gates, or human bridge |
17
+ | Context7-class tools | Library docs for the model; not *your* monorepo routing |
18
+
19
+ doc-bridge ships **AgentHandoff** JSON:
20
+
21
+ ```json
22
+ {
23
+ "type": "agent-handoff",
24
+ "startHere": "docs/for-agents/packages/example.md",
25
+ "editRoots": ["src"],
26
+ "checks": ["npm test"],
27
+ "humanDoc": "/docs/guides/example"
28
+ }
29
+ ```
30
+
31
+ ## Four loops
32
+
33
+ | Loop | What you get |
34
+ |------|----------------|
35
+ | **Act** | CLI + MCP handoffs (`query`, `handoff.resolve`) |
36
+ | **Bridge** | Fumadocs / Docusaurus / plain-markdown ↔ agent corpus + gates |
37
+ | **Learn** | `memory ingest → classify → promote` drafts (HITL) |
38
+ | **Explain** | Optional `@agentskit/rag` + `@agentskit/ink` chat (`handoffFirst`) |
39
+
40
+ ## Quick start (< 2 minutes, no key)
41
+
42
+ ```bash
43
+ npm i -D @agentskit/doc-bridge
44
+ npx ak-docs init
45
+ npx ak-docs index
46
+ npx ak-docs query package example --agent
47
+ ```
48
+
49
+ `init` scaffolds config, a demo ownership target, and an `AGENTS.md` snippet.
50
+
51
+ ```bash
52
+ npx ak-docs list packages --text
53
+ npx ak-docs ask "where do I change example?"
54
+ npx ak-docs gate run
55
+ npx ak-docs mcp
56
+ ```
57
+
58
+ Full guide: **[docs/getting-started.md](docs/getting-started.md)**.
59
+
60
+ ## Surfaces
61
+
62
+ ### Layer 0 — always (no LLM)
63
+
64
+ | Surface | Purpose |
65
+ |---------|---------|
66
+ | **Index** | `DocBridgeIndex` + `contentHash` + `llms.txt` + capabilities |
67
+ | **CLI** | `query` / `search` / `list` / `ask` / `gate` / `memory` / `bootstrap` |
68
+ | **MCP** | `handoff.resolve`, `doc.search`, `doc.get`, … |
69
+ | **Gates** | Freshness, human-link validation, optional OKF style |
70
+ | **Plugins** | `pnpm-monorepo`, `fumadocs`, `docusaurus`, `plain-markdown` |
71
+
72
+ Ownership can come from **config**, **frontmatter** (`package` + `editRoot`), or **workspace discovery**.
73
+
74
+ ### Layer 1 — optional AgentsKit peers
75
+
76
+ ```bash
77
+ npm i -D @agentskit/rag @agentskit/ink @agentskit/adapters @agentskit/memory react
78
+ ```
79
+
80
+ ```bash
81
+ ak-docs rag ingest
82
+ ak-docs chat
83
+ ak-docs ask "how does auth work?" --chat
84
+ ```
85
+
86
+ See **[docs/chat-and-rag.md](docs/chat-and-rag.md)**.
87
+
88
+ ## Architecture
89
+
90
+ ```
91
+ Your repo
92
+ ├── docs/for-agents/ agent corpus
93
+ ├── docs/ or content/ human site (plugin)
94
+ ├── AGENTS.md
95
+ └── doc-bridge.config.*
96
+
97
+ Layer 0 — Index · CLI · MCP · Gates · Memory pipeline
98
+ Layer 1 — @agentskit/rag · adapters · ink chat (opt-in)
99
+ ```
100
+
101
+ **Trust model:** Layer 0 is merge-blocking truth. Layer 1 explains and drafts; humans and gates decide.
102
+
103
+ ## Who uses it (public)
104
+
105
+ Designed for and dogfooded on open AgentsKit surfaces:
106
+
107
+ - [for-agents docs](https://www.agentskit.io/docs/for-agents)
108
+ - [Registry](https://registry.agentskit.io/)
109
+ - [Playbook `llms.txt`](https://playbook.agentskit.io/llms.txt)
110
+
111
+ ## Configuration examples
112
+
113
+ | Profile | Example |
114
+ |---------|---------|
115
+ | Solo markdown | [`examples/minimal-plain-markdown.config.ts`](examples/minimal-plain-markdown.config.ts) |
116
+ | pnpm monorepo | [`examples/pnpm-monorepo.config.ts`](examples/pnpm-monorepo.config.ts) |
117
+ | Fumadocs + chat | [`examples/fumadocs-with-chat.config.ts`](examples/fumadocs-with-chat.config.ts) |
118
+ | Docusaurus + memory | [`examples/docusaurus-with-memory.config.ts`](examples/docusaurus-with-memory.config.ts) |
119
+
120
+ Contract: [`docs/spec/config-v1.md`](docs/spec/config-v1.md) · CLI: [`docs/spec/cli.md`](docs/spec/cli.md) · MCP: [`docs/mcp.md`](docs/mcp.md)
121
+
122
+ ## Status
123
+
124
+ **v0.1.0-alpha.1** — Layer 0 complete for daily use; Layer 1 RAG/chat wired via optional peers; not yet a guarantee of semver stability.
125
+
126
+ ```bash
127
+ pnpm install && pnpm build && pnpm test
128
+ ```
129
+
130
+ ## Contributing
131
+
132
+ - [CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](SECURITY.md) · [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) · [CHANGELOG.md](CHANGELOG.md)
133
+ - Positioning: [`docs/POSITIONING.md`](docs/POSITIONING.md)
134
+
135
+ ## License
136
+
137
+ MIT
package/SECURITY.md ADDED
@@ -0,0 +1,24 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ `@agentskit/doc-bridge` is currently in alpha. Security fixes target the latest published alpha.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Please do not open a public issue for security reports.
10
+
11
+ Email security reports to `security@agentskit.io` with:
12
+
13
+ - affected version or commit
14
+ - reproduction steps
15
+ - impact
16
+ - any suggested fix
17
+
18
+ We will acknowledge reports as soon as practical and coordinate disclosure before publishing details.
19
+
20
+ ## Security expectations
21
+
22
+ - Core commands must work without sending repository content to a network service.
23
+ - MCP `doc.get` must only read indexed docs inside the project root.
24
+ - Optional intelligence features must stay opt-in and provider-controlled by the user.
package/bin/ak-docs.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from '../dist/cli/program.js'
3
+
4
+ const code = runCli(process.argv.slice(2))
5
+ if (typeof code === 'number') process.exit(code)
6
+ if (code) process.exit(await code)
@@ -0,0 +1,3 @@
1
+ declare const runCli: (argv: readonly string[]) => number | undefined | Promise<number>;
2
+
3
+ export { runCli };