okfy-ai 0.1.2 → 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/README.md +81 -24
- package/assets/logo-dark.png +0 -0
- package/assets/logo-light.png +0 -0
- package/dist/{chunk-C46QXZDU.js → chunk-QE5W5AJS.js} +326 -105
- package/dist/cli.js +67 -9
- package/dist/index.d.ts +45 -1
- package/dist/index.js +1 -1
- package/docs/mcp-clients.md +32 -10
- package/examples/README.md +7 -7
- package/examples/bundles/okfy-docs/concepts/index.md +3 -13
- package/examples/bundles/okfy-docs/guides/import-local-markdown.md +2 -2
- package/examples/bundles/okfy-docs/guides/index.md +3 -13
- package/examples/bundles/okfy-docs/guides/serve-over-mcp.md +1 -1
- package/examples/bundles/okfy-docs/home.md +22 -0
- package/examples/bundles/okfy-docs/index.md +8 -22
- package/examples/bundles/okfy-docs/okfy-example.json +2 -2
- package/examples/bundles/okfy-docs/reference/index.md +2 -12
- package/examples/bundles/stripe-checkout-small/home.md +21 -0
- package/examples/bundles/stripe-checkout-small/index.md +4 -19
- package/examples/bundles/stripe-checkout-small/okfy-example.json +1 -2
- package/examples/local-markdown/guides/import-local-markdown.md +2 -2
- package/examples/local-markdown/guides/serve-over-mcp.md +1 -1
- package/examples/local-markdown/okfy-example.json +2 -2
- package/package.json +5 -3
- package/assets/logo.svg +0 -14
package/README.md
CHANGED
|
@@ -1,27 +1,59 @@
|
|
|
1
1
|
# okfy-ai
|
|
2
2
|
|
|
3
|
-
Turn docs into agent-readable Open Knowledge Format bundles.
|
|
3
|
+
Turn docs into agent-readable Open Knowledge Format v0.1-conformant bundles, then serve them to Claude, Codex, Cursor, or any MCP client.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Use With Agents
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Create a bundle:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx -y okfy-ai
|
|
10
|
+
npx -y okfy-ai crawl https://docs.stripe.com/checkout --out ./stripe-checkout-okf --max-pages 25
|
|
11
|
+
npx -y okfy-ai validate ./stripe-checkout-okf
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Add it to an MCP client:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"stripe-okf": {
|
|
20
|
+
"command": "npx",
|
|
21
|
+
"args": ["-y", "okfy-ai", "serve", "./stripe-checkout-okf", "--mcp"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Ask your agent:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Use the stripe-okf MCP server. Search for Checkout Sessions, read the most relevant concepts, inspect neighbors if needed, and explain the minimum backend flow with source URLs.
|
|
11
31
|
```
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
## Client Setup
|
|
34
|
+
|
|
35
|
+
Claude Code:
|
|
14
36
|
|
|
15
37
|
```bash
|
|
16
|
-
|
|
17
|
-
okfy demo
|
|
38
|
+
claude mcp add --transport stdio stripe-okf -- npx -y okfy-ai serve ./stripe-checkout-okf --mcp
|
|
18
39
|
```
|
|
19
40
|
|
|
20
|
-
|
|
41
|
+
Codex:
|
|
42
|
+
|
|
43
|
+
```toml
|
|
44
|
+
[mcp_servers.stripe_okf]
|
|
45
|
+
command = "npx"
|
|
46
|
+
args = ["-y", "okfy-ai", "serve", "./stripe-checkout-okf", "--mcp"]
|
|
47
|
+
startup_timeout_sec = 20
|
|
48
|
+
tool_timeout_sec = 60
|
|
49
|
+
enabled = true
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Claude Desktop, Cursor, and other `mcpServers` clients can use the JSON config above. More setup: https://github.com/0dust/OKFy/blob/main/docs/mcp-clients.md
|
|
21
53
|
|
|
22
|
-
##
|
|
54
|
+
## Create Bundles
|
|
23
55
|
|
|
24
|
-
|
|
56
|
+
Docs website:
|
|
25
57
|
|
|
26
58
|
```bash
|
|
27
59
|
npx -y okfy-ai crawl https://docs.stripe.com/checkout --out ./stripe-checkout-okf --max-pages 25
|
|
@@ -29,37 +61,58 @@ npx -y okfy-ai validate ./stripe-checkout-okf
|
|
|
29
61
|
npx -y okfy-ai inspect ./stripe-checkout-okf
|
|
30
62
|
```
|
|
31
63
|
|
|
32
|
-
|
|
64
|
+
Local Markdown:
|
|
33
65
|
|
|
34
66
|
```bash
|
|
35
|
-
npx -y okfy-ai
|
|
67
|
+
npx -y okfy-ai import ./docs --out ./docs-okf --source-name "Project docs" --force
|
|
68
|
+
npx -y okfy-ai validate ./docs-okf
|
|
36
69
|
```
|
|
37
70
|
|
|
38
|
-
##
|
|
71
|
+
## Optional CLI Install
|
|
72
|
+
|
|
73
|
+
You do not need global install for MCP configs. `npx -y okfy-ai ...` is usually better because the MCP client can launch okfy directly.
|
|
74
|
+
|
|
75
|
+
Install only if you want shorter local commands:
|
|
39
76
|
|
|
40
77
|
```bash
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
npx -y okfy-ai serve ./docs-okf --mcp
|
|
78
|
+
npm install -g okfy-ai
|
|
79
|
+
okfy demo
|
|
44
80
|
```
|
|
45
81
|
|
|
46
|
-
|
|
82
|
+
`okfy-ai` is the npm package name. `okfy` is the installed CLI command.
|
|
83
|
+
|
|
84
|
+
Requires Node.js 20+.
|
|
85
|
+
|
|
86
|
+
After installing, this MCP config is equivalent:
|
|
47
87
|
|
|
48
88
|
```json
|
|
49
89
|
{
|
|
50
90
|
"mcpServers": {
|
|
51
91
|
"docs-okf": {
|
|
52
|
-
"command": "
|
|
53
|
-
"args": ["
|
|
92
|
+
"command": "okfy",
|
|
93
|
+
"args": ["serve", "./docs-okf", "--mcp"]
|
|
54
94
|
}
|
|
55
95
|
}
|
|
56
96
|
}
|
|
57
97
|
```
|
|
58
98
|
|
|
59
|
-
|
|
99
|
+
## Demo
|
|
60
100
|
|
|
61
|
-
```
|
|
62
|
-
|
|
101
|
+
```bash
|
|
102
|
+
npx -y okfy-ai demo
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## No-Install MCP Config
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"docs-okf": {
|
|
111
|
+
"command": "npx",
|
|
112
|
+
"args": ["-y", "okfy-ai", "serve", "./docs-okf", "--mcp"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
63
116
|
```
|
|
64
117
|
|
|
65
118
|
## CLI Commands
|
|
@@ -93,14 +146,18 @@ docs site or Markdown folder
|
|
|
93
146
|
-> source-backed agent answers
|
|
94
147
|
```
|
|
95
148
|
|
|
96
|
-
Each source page or Markdown file becomes one OKF concept in v0.1.
|
|
149
|
+
Each non-reserved source page or Markdown file becomes one OKF concept in v0.1. `index.md` and `log.md` are reserved files, not concepts, and generated indexes are plain Markdown. Concept counts, search, graph links, types, tags, and `read_concept` exclude reserved files.
|
|
150
|
+
|
|
151
|
+
Validation errors are limited to OKF conformance: malformed or missing concept frontmatter, missing `type`, or invalid reserved-file structure. Broken internal links and missing indexes are warnings.
|
|
97
152
|
|
|
98
153
|
## Security Defaults
|
|
99
154
|
|
|
100
155
|
- Crawls respect `robots.txt` by default.
|
|
101
156
|
- Crawls stay same-origin by default.
|
|
102
157
|
- Page count, depth, response size, and concurrency are capped.
|
|
103
|
-
- Private network targets are rejected by default for URL crawls.
|
|
158
|
+
- Private network URL literals and redirects to private targets are rejected by default for URL crawls.
|
|
159
|
+
- Preflight DNS-resolved private targets are rejected before fetch; fetch-time DNS is not IP-pinned.
|
|
160
|
+
- `--force` refuses unsafe output directories such as `.`, `/`, the home dir, repo root, input path, input parent, and symlink output dirs unless an explicit dangerous override is provided.
|
|
104
161
|
- HTML and Markdown are treated as text. Scripts are not executed.
|
|
105
162
|
- MCP tools are read-only in v0.1.
|
|
106
163
|
|
|
Binary file
|
|
Binary file
|