okfy-ai 0.1.2
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 +21 -0
- package/README.md +115 -0
- package/assets/demo.gif +0 -0
- package/assets/logo.svg +14 -0
- package/dist/chunk-C46QXZDU.js +1013 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +151 -0
- package/dist/index.d.ts +179 -0
- package/dist/index.js +40 -0
- package/docs/mcp-clients.md +278 -0
- package/examples/README.md +98 -0
- package/examples/bundles/okfy-docs/concepts/index.md +14 -0
- package/examples/bundles/okfy-docs/concepts/okf-bundle.md +33 -0
- package/examples/bundles/okfy-docs/concepts/progressive-disclosure.md +26 -0
- package/examples/bundles/okfy-docs/guides/import-local-markdown.md +31 -0
- package/examples/bundles/okfy-docs/guides/index.md +14 -0
- package/examples/bundles/okfy-docs/guides/serve-over-mcp.md +29 -0
- package/examples/bundles/okfy-docs/index.md +22 -0
- package/examples/bundles/okfy-docs/okfy-example.json +10 -0
- package/examples/bundles/okfy-docs/reference/index.md +13 -0
- package/examples/bundles/okfy-docs/reference/mcp-tools.md +36 -0
- package/examples/bundles/stripe-checkout-small/index.md +21 -0
- package/examples/bundles/stripe-checkout-small/okfy-example.json +11 -0
- package/examples/bundles/stripe-checkout-small/quickstart.md +26 -0
- package/examples/bundles/stripe-checkout-small/sessions.md +20 -0
- package/examples/bundles/stripe-checkout-small/webhooks.md +19 -0
- package/examples/local-markdown/concepts/okf-bundle.md +19 -0
- package/examples/local-markdown/concepts/progressive-disclosure.md +15 -0
- package/examples/local-markdown/guides/import-local-markdown.md +20 -0
- package/examples/local-markdown/guides/serve-over-mcp.md +17 -0
- package/examples/local-markdown/index.md +11 -0
- package/examples/local-markdown/okfy-example.json +10 -0
- package/examples/local-markdown/reference/mcp-tools.md +25 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 okfy contributors
|
|
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,115 @@
|
|
|
1
|
+
# okfy-ai
|
|
2
|
+
|
|
3
|
+
Turn docs into agent-readable Open Knowledge Format bundles.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Run without installing:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx -y okfy-ai demo
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g okfy-ai
|
|
17
|
+
okfy demo
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Requires Node.js 20+.
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
Convert a docs site into an OKF bundle:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx -y okfy-ai crawl https://docs.stripe.com/checkout --out ./stripe-checkout-okf --max-pages 25
|
|
28
|
+
npx -y okfy-ai validate ./stripe-checkout-okf
|
|
29
|
+
npx -y okfy-ai inspect ./stripe-checkout-okf
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Serve it to an MCP client:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx -y okfy-ai serve ./stripe-checkout-okf --mcp
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Local Markdown
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx -y okfy-ai import ./docs --out ./docs-okf --source-name "Project docs" --force
|
|
42
|
+
npx -y okfy-ai validate ./docs-okf
|
|
43
|
+
npx -y okfy-ai serve ./docs-okf --mcp
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## MCP Config
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"docs-okf": {
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": ["-y", "okfy-ai", "serve", "./docs-okf", "--mcp"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Ask your agent:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
Use the docs-okf MCP server. Search for the relevant topic, read the best matching concepts, inspect neighbors if needed, and answer with source URLs.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## CLI Commands
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
okfy crawl <url> --out <dir>
|
|
69
|
+
okfy import <path> --out <dir>
|
|
70
|
+
okfy validate <bundle>
|
|
71
|
+
okfy inspect <bundle>
|
|
72
|
+
okfy serve <bundle> --mcp
|
|
73
|
+
okfy demo
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## MCP Tools
|
|
77
|
+
|
|
78
|
+
| Tool | Purpose |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `bundle_summary` | Show bundle stats and validation status. |
|
|
81
|
+
| `search_concepts` | Search concept previews by query, type, or tags. |
|
|
82
|
+
| `read_concept` | Read one concept body, frontmatter, links, backlinks, and source. |
|
|
83
|
+
| `get_neighbors` | Traverse outbound links and backlinks around a concept. |
|
|
84
|
+
| `list_types` | List concept types and counts. |
|
|
85
|
+
| `list_tags` | List tags and counts. |
|
|
86
|
+
|
|
87
|
+
## What okfy Generates
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
docs site or Markdown folder
|
|
91
|
+
-> OKF bundle: Markdown files + YAML frontmatter + links
|
|
92
|
+
-> MCP server: search_concepts, read_concept, get_neighbors
|
|
93
|
+
-> source-backed agent answers
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Each source page or Markdown file becomes one OKF concept in v0.1. Generated bundles are plain files, so they can be opened, reviewed, diffed, committed, and served locally.
|
|
97
|
+
|
|
98
|
+
## Security Defaults
|
|
99
|
+
|
|
100
|
+
- Crawls respect `robots.txt` by default.
|
|
101
|
+
- Crawls stay same-origin by default.
|
|
102
|
+
- Page count, depth, response size, and concurrency are capped.
|
|
103
|
+
- Private network targets are rejected by default for URL crawls.
|
|
104
|
+
- HTML and Markdown are treated as text. Scripts are not executed.
|
|
105
|
+
- MCP tools are read-only in v0.1.
|
|
106
|
+
|
|
107
|
+
## Links
|
|
108
|
+
|
|
109
|
+
- GitHub: https://github.com/0dust/OKFy
|
|
110
|
+
- MCP client setup: https://github.com/0dust/OKFy/blob/main/docs/mcp-clients.md
|
|
111
|
+
- OKF: https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT.
|
package/assets/demo.gif
ADDED
|
Binary file
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="220" viewBox="0 0 720 220" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">okfy</title>
|
|
3
|
+
<desc id="desc">okfy wordmark with linked knowledge nodes</desc>
|
|
4
|
+
<rect width="720" height="220" rx="28" fill="#f7f5ef"/>
|
|
5
|
+
<g transform="translate(54 44)">
|
|
6
|
+
<path d="M34 28h74c22 0 40 18 40 40v20c0 22-18 40-40 40H34C12 128-6 110-6 88V68c0-22 18-40 40-40Z" fill="#20342d"/>
|
|
7
|
+
<circle cx="36" cy="78" r="18" fill="#d6f36a"/>
|
|
8
|
+
<circle cx="106" cy="58" r="12" fill="#f7f5ef"/>
|
|
9
|
+
<circle cx="108" cy="100" r="12" fill="#f7f5ef"/>
|
|
10
|
+
<path d="M52 73 94 61M53 84l43 13" stroke="#d6f36a" stroke-width="9" stroke-linecap="round"/>
|
|
11
|
+
<path d="M190 124V31h32v36h10l26-36h37l-35 46 38 47h-39l-28-36h-9v36h-32Zm123 0V31h77v27h-45v15h39v26h-39v25h-32Zm95 0 34-52-32-41h38l15 21 15-21h36l-33 43 38 50h-39l-19-26-18 26h-35Zm127 0V92l-36-61h37l16 32 17-32h35l-37 61v32h-32Z" fill="#20342d"/>
|
|
12
|
+
</g>
|
|
13
|
+
<text x="360" y="184" text-anchor="middle" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="20" letter-spacing="1.5" fill="#5f5a4f">OPEN KNOWLEDGE FORMAT FOR AGENTS</text>
|
|
14
|
+
</svg>
|