okforge 0.6.2__py3-none-any.whl

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 (54) hide show
  1. okforge-0.6.2.dist-info/METADATA +144 -0
  2. okforge-0.6.2.dist-info/RECORD +54 -0
  3. okforge-0.6.2.dist-info/WHEEL +4 -0
  4. okforge-0.6.2.dist-info/entry_points.txt +3 -0
  5. okforge-0.6.2.dist-info/licenses/LICENSE +190 -0
  6. openkb/__init__.py +13 -0
  7. openkb/__main__.py +5 -0
  8. openkb/_skills/openkb-deck-editorial/SKILL.md +185 -0
  9. openkb/_skills/openkb-deck-neon/SKILL.md +300 -0
  10. openkb/_skills/openkb-html-critic/SKILL.md +140 -0
  11. openkb/agent/__init__.py +1 -0
  12. openkb/agent/_markdown.py +370 -0
  13. openkb/agent/chat.py +963 -0
  14. openkb/agent/chat_session.py +271 -0
  15. openkb/agent/compiler.py +2435 -0
  16. openkb/agent/linter.py +119 -0
  17. openkb/agent/query.py +470 -0
  18. openkb/agent/skill_runner.py +216 -0
  19. openkb/agent/skills.py +124 -0
  20. openkb/agent/tools.py +404 -0
  21. openkb/cli.py +3032 -0
  22. openkb/config.py +337 -0
  23. openkb/converter.py +270 -0
  24. openkb/deck/__init__.py +34 -0
  25. openkb/deck/creator.py +122 -0
  26. openkb/deck/validator.py +246 -0
  27. openkb/frontmatter.py +138 -0
  28. openkb/images.py +260 -0
  29. openkb/indexer.py +196 -0
  30. openkb/links.py +84 -0
  31. openkb/lint.py +694 -0
  32. openkb/locks.py +243 -0
  33. openkb/log.py +22 -0
  34. openkb/mutation.py +458 -0
  35. openkb/okf.py +120 -0
  36. openkb/prompts/__init__.py +22 -0
  37. openkb/prompts/skill_create.md +214 -0
  38. openkb/schema.py +93 -0
  39. openkb/skill/__init__.py +102 -0
  40. openkb/skill/creator.py +224 -0
  41. openkb/skill/evaluator.py +490 -0
  42. openkb/skill/generator.py +125 -0
  43. openkb/skill/marketplace.py +118 -0
  44. openkb/skill/tools.py +103 -0
  45. openkb/skill/validator.py +277 -0
  46. openkb/skill/workspace.py +188 -0
  47. openkb/state.py +127 -0
  48. openkb/templates/graph.html +907 -0
  49. openkb/topic_tree.py +229 -0
  50. openkb/topic_tree_llm.py +104 -0
  51. openkb/tree_renderer.py +170 -0
  52. openkb/url_ingest.py +282 -0
  53. openkb/visualize.py +79 -0
  54. openkb/watcher.py +101 -0
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: okforge
3
+ Version: 0.6.2
4
+ Summary: okforge: a local-first LLM knowledge-base engine
5
+ Project-URL: Repository, https://github.com/okforge/okforge
6
+ Project-URL: Homepage, https://github.com/okforge/okforge
7
+ Project-URL: Issues, https://github.com/okforge/okforge/issues
8
+ Author: designcomputer
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: agents,ai,document,knowledge-base,llm,pageindex,rag,retrieval
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: click==8.4.0
23
+ Requires-Dist: json-repair==0.59.10
24
+ Requires-Dist: litellm==1.87.2
25
+ Requires-Dist: openai-agents==0.17.3
26
+ Requires-Dist: pageindex==0.3.0.dev1
27
+ Requires-Dist: portalocker==3.2.0
28
+ Requires-Dist: prompt-toolkit==3.0.52
29
+ Requires-Dist: python-dotenv==1.2.2
30
+ Requires-Dist: pyyaml==6.0.3
31
+ Requires-Dist: rich==15.0.0
32
+ Requires-Dist: trafilatura==2.0.0
33
+ Requires-Dist: watchdog==6.0.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: mypy==1.15.0; extra == 'dev'
36
+ Requires-Dist: pytest-asyncio==1.3.0; extra == 'dev'
37
+ Requires-Dist: pytest==9.0.3; extra == 'dev'
38
+ Requires-Dist: ruff==0.9.7; extra == 'dev'
39
+ Requires-Dist: types-pyyaml==6.0.12.20260518; extra == 'dev'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # okforge
43
+
44
+ A local-first LLM knowledge-base engine. Point it at your documents;
45
+ it builds an interlinked wiki — per-document summaries, cross-document
46
+ concept and entity pages, extracted images, and real page citations
47
+ back to source. The wiki is plain Markdown with YAML frontmatter,
48
+ readable in Obsidian or any editor, and queryable from a CLI, a chat
49
+ REPL, or any MCP client.
50
+
51
+ ## Why
52
+
53
+ Most retrieval setups hand an LLM a pile of raw chunks and hope. okforge
54
+ instead compiles your sources into curated pages *ahead of time* —
55
+ concepts and entities that already synthesize what's spread across
56
+ many documents, each claim traceable back to a `(p. N)` citation in
57
+ the original source. That matters most for models with limited
58
+ context, including small models running entirely on your own hardware:
59
+ they don't have to reconstruct an answer from scratch every query, and
60
+ what they do say is checkable against a specific page, not just
61
+ plausible-sounding.
62
+
63
+ The output follows the [Open Knowledge Format (OKF)](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md) —
64
+ typed frontmatter, relative links, a predictable directory layout — so
65
+ the wiki a KB produces is portable, not locked to okforge itself.
66
+
67
+ ## Install
68
+
69
+ ```bash
70
+ pip install git+https://github.com/okforge/okforge@main
71
+ ```
72
+
73
+ ## Quick start
74
+
75
+ ```bash
76
+ mkdir my-kb && cd my-kb
77
+ okforge init # scaffold raw/, wiki/, .openkb/ (--json for scripts)
78
+ okforge add paper.md # ingest (pre-convert non-md/pdf inputs first)
79
+ okforge query "What does the paper conclude?"
80
+ okforge chat # interactive REPL over the wiki
81
+ okforge list --json # machine-readable state (also: status, okf-lint)
82
+ okforge describe "One line about this project." # curated description
83
+ ```
84
+
85
+ Non-Markdown, non-PDF inputs (docx, pptx, scans, photo catalogs, …)
86
+ need converting to Markdown first, by a tool that understands your
87
+ material — a page-aware OCR script, for example. A sibling
88
+ `<doc>.pages.json` page array is what enables real `(p. N)` citations
89
+ in the generated summaries.
90
+
91
+ The query agent reads curated pages first, then drills for detail with
92
+ a built-in `grep_wiki` lexical search (locate-then-read) rather than
93
+ re-embedding everything. `okf-lint` checks a wiki bundle's OKF
94
+ conformance.
95
+
96
+ Configuration lives in `.openkb/config.yaml` (model, language, entity
97
+ types, …) and `~/.config/openkb/global.yaml` (KB registry, default
98
+ KB). The LLM endpoint is configured litellm-style — any
99
+ OpenAI-compatible server works, including a local llama.cpp instance.
100
+
101
+ ### Topic tree (experimental, per-KB opt-in)
102
+
103
+ For knowledge bases that outgrow a flat concept list: set
104
+ `topic_tree: true` in `.openkb/config.yaml`, then run `okforge
105
+ reindex`. Existing concepts cluster into named `concepts/<topic>/`
106
+ directories, each with a `_topic.md` summary node; later ingests place
107
+ new concepts by tree descent, and queries gain a `read_topic`
108
+ navigation tool for browsing top-down instead of scanning a flat list.
109
+
110
+ ## Wiki layout
111
+
112
+ ```
113
+ wiki/
114
+ index.md # document + concept index
115
+ summaries/<doc>.md # per-document summary (page citations when available)
116
+ concepts/<name>.md # cross-document concept pages
117
+ entities/<name>.md # named people/places/organizations/works
118
+ sources/<doc>.md # ingested source text
119
+ sources/<doc>.json # per-page text + images (when page-aware)
120
+ sources/images/<doc>/ # extracted images
121
+ log.md # append-only ingest log
122
+ ```
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ uv run --extra dev python -m pytest tests/ # test suite
128
+ uv run --extra dev ruff check openkb tests # lint
129
+ uv run --extra dev ruff format openkb tests # format
130
+ ```
131
+
132
+ ## Origins
133
+
134
+ okforge began as a hard fork of [VectifyAI/OpenKB](https://github.com/VectifyAI/OpenKB),
135
+ in the spirit of Karpathy's LLM-wiki idea, and has since diverged
136
+ deliberately rather than tracking it — local-only by default, its own
137
+ document-conversion boundary, and OKF conformance as a first-class
138
+ goal rather than an incidental format.
139
+
140
+ ## License
141
+
142
+ Apache-2.0. Portions originate from the upstream OpenKB project
143
+ (copyright the original authors); okforge-specific changes are
144
+ maintained at [okforge/okforge](https://github.com/okforge/okforge).
@@ -0,0 +1,54 @@
1
+ openkb/__init__.py,sha256=0Sb2HnBQ4OKYPL88QXkVf4dSQHIT0IC2GNQuuqsU7j4,450
2
+ openkb/__main__.py,sha256=lLkF5bqDRrywM-WEwoCLp185CyEL7kyeG_YZ7IR54ds,88
3
+ openkb/cli.py,sha256=y1SbLkt1pKpgLfeygQK6QpXymTfW2XTjTDSZTfl9Vvk,109718
4
+ openkb/config.py,sha256=wfNd59gJ290U7qIv6QcadaFTLDgoDH-ize-4isIcygk,11754
5
+ openkb/converter.py,sha256=ZCqC9XNWBjT54ynws4aTbT_fM4rUNbGwx5SJqJE8BQc,10768
6
+ openkb/frontmatter.py,sha256=KvYOVkDesPOuz7oGdlt0L13r3hzFf0Kj3_3ZrK_JQnM,4871
7
+ openkb/images.py,sha256=xs2sT8ZsHnvbLItIlMQwLY86QcHQRgw0jQos-udj8z4,10344
8
+ openkb/indexer.py,sha256=Wh_KNFyhTshGsSUQGZtw6MXfUYzbJ6_dA-_BXVLYG34,6556
9
+ openkb/links.py,sha256=Z7leVXVILjXYD3M3ZieGm1yZhSRBuiyH09WzOu6XDVQ,3470
10
+ openkb/lint.py,sha256=6qPgktbKgIsyvOin4O3yMI9Jj1r1ImuKqbR1XC_Jt1A,25601
11
+ openkb/locks.py,sha256=C-TvU_Lh6uiAzmBtW0wIzD4kRxsd0l0AKTLqgTYY6xY,8102
12
+ openkb/log.py,sha256=lojwiE_4FQU3zFUd9KpnZHpnF_ZOtHW3BKGePWlYdfo,696
13
+ openkb/mutation.py,sha256=DxgqeneYPsOmuUcohvDfgzs5mWA5gY1Tiqbqs4hug3U,19906
14
+ openkb/okf.py,sha256=ZaaY_6dD0mtyQbOE0TKuqQk_EfqZPjRB69Y7XnlRTVs,4755
15
+ openkb/schema.py,sha256=0ewr9P1hHPknb-Ppf9PK_E6t7lwAXv8jXBNQSOQkyQI,4466
16
+ openkb/state.py,sha256=3zvtDzGfZBqNqw6U_i2xvkaJEXERcOWSVGipkiTuSqo,4990
17
+ openkb/topic_tree.py,sha256=T-5wKqyWnE40uxdGfPUucVN5KIQRRqMwNLtVfXcG87U,8783
18
+ openkb/topic_tree_llm.py,sha256=SCq7wYaaymtCk2RyA3lBRVWqTZVetLkkiBuyDvKmlI8,3231
19
+ openkb/tree_renderer.py,sha256=Ianh7iVU00UWekWtWMc32zjMP0_RgVW2rJ-xJ9K73Oc,6720
20
+ openkb/url_ingest.py,sha256=2fbBGyoshy6tHTwlpme9R4sASbWI8pJNIwb5LWDiijw,10489
21
+ openkb/visualize.py,sha256=X-QPmUwgTm4JXCdASu16u1msh8wGp-pXbIU4aaJx53Y,3070
22
+ openkb/watcher.py,sha256=jj3pe_3kihQaBz2_ttirzY6JNg4YYd7qYKkBtNkpLWw,3318
23
+ openkb/agent/__init__.py,sha256=LKcEDM1kfIRXjo-qW051lxpVqwxE0ViDrBw9rwjjV4s,75
24
+ openkb/agent/_markdown.py,sha256=jAmosiPlmjnSZuEVA8Trb2yS6dQSpMtjctw6pcw3QNU,10751
25
+ openkb/agent/chat.py,sha256=z7Zm616nM7K8R6NPR9yudfnb9Oz2NUGQvxFu19-PtvI,32480
26
+ openkb/agent/chat_session.py,sha256=t84HVwhxFEOjTNNCiK3ij2wuWeBzJh4jKDKcyhG5YY4,8658
27
+ openkb/agent/compiler.py,sha256=P_3bbKtJQOa-WGk6OOT8GTQQarhOK1x9yGvvEcxD61Y,95007
28
+ openkb/agent/linter.py,sha256=LBLUqfrhlIm80uPlo2qR_zrZU9FRzvRGdsHcVKx1gA4,4312
29
+ openkb/agent/query.py,sha256=wvOld-blIktK2fZ-G7_W6KwiAzxeJmhPAJO1tQubmRY,19211
30
+ openkb/agent/skill_runner.py,sha256=n7C_OYPmNRjnA45xsfvRkvvfK_3zmbqosjZyuaK-k08,8577
31
+ openkb/agent/skills.py,sha256=bP5SLi6tTv2NRybQ_TYdvu2iXVGVzQNhf5b_joJiHyw,4374
32
+ openkb/agent/tools.py,sha256=-bGZU749xm-fCqMKuC3KU0t3Q5G-QZ9zw6nYiyV099U,15226
33
+ openkb/deck/__init__.py,sha256=1DWI4g6n4TKwsXdICQJDwbUsOy0nU0AJJKOLQ-kG3rQ,1084
34
+ openkb/deck/creator.py,sha256=OEYXhGormS_4umqn_inZKzrYm8mIvB2RQ_Diy0xQIoU,4383
35
+ openkb/deck/validator.py,sha256=NPHeuK1dEuG3PNqksI9LVbcz7XHGnlR70EPOgntYRZY,9181
36
+ openkb/prompts/__init__.py,sha256=DwUAzAi6-JsDFEqqbr52MR0S-GOf59adry1oj_ZaFNs,621
37
+ openkb/prompts/skill_create.md,sha256=gM60bkCoNGjAMa-BxeQ35DIhK2WrecbsUKk4CIAsKto,9433
38
+ openkb/skill/__init__.py,sha256=WjXlNxl5QpvSYf7zl6-3KWEwFB4SBVBalAQyODRCpjI,3401
39
+ openkb/skill/creator.py,sha256=S9RauPFtj8OdmN3EBGCDsBrYnnoyBwjuFNhnMK9vnUQ,8294
40
+ openkb/skill/evaluator.py,sha256=n_FkUgdRMYjrm7KRmeX6VeXqDieLTziwb1q7pyOFFFM,19702
41
+ openkb/skill/generator.py,sha256=LH2IoqycN7q6hvBEpDDkDTAY0QmnipZ7-_qSFNzNSwg,4841
42
+ openkb/skill/marketplace.py,sha256=5EtrI86MSd1tT3Wi86C9J_wwg-Eyj511q9GOArMav9k,4208
43
+ openkb/skill/tools.py,sha256=FedIQhjK8mNxmzAe0hV412anLRFiecB_Zz6JBfPcfeM,3787
44
+ openkb/skill/validator.py,sha256=eOACGe6OIP7kVouBHq9ebt2CHTUInTL21GvhSbLUGp8,10905
45
+ openkb/skill/workspace.py,sha256=kdrmtL79RIRwpJNv5XJoeqfW39WSL-5mK-ZlS0e8PaY,6071
46
+ openkb/templates/graph.html,sha256=YIfe1NOgPhfpj_BQ8rUMwnE4hHGbTt1EvP4caBa--TA,45993
47
+ openkb/_skills/openkb-deck-editorial/SKILL.md,sha256=Zv3HYka3Jg5bLHbX7TS_7cy5wc3yUK0om3HAVPJVb7k,8454
48
+ openkb/_skills/openkb-deck-neon/SKILL.md,sha256=neLaMmrthkV9rAbflZa7DcGVQFNTwMGExPmpGKpQIjk,17222
49
+ openkb/_skills/openkb-html-critic/SKILL.md,sha256=FvVHURhg_NVE2N5zXKT3HuiE6Rblb06ekgakjpc6aF0,5606
50
+ okforge-0.6.2.dist-info/METADATA,sha256=UAfjqo3Zum_Gorc7BALN14p543ht43_eHQQERExb0J0,5846
51
+ okforge-0.6.2.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
52
+ okforge-0.6.2.dist-info/entry_points.txt,sha256=XklTsZ1nZA0oX_11QdzkXtHSuhKtnE56eBBIEd5tdM4,67
53
+ okforge-0.6.2.dist-info/licenses/LICENSE,sha256=J6AWg5EfUKRAYbFR3gelkPflBxL_ipfRzf-cOVqNtzI,10761
54
+ okforge-0.6.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ okforge = openkb.cli:cli
3
+ openkb = openkb.cli:cli
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Vectify AI
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
openkb/__init__.py ADDED
@@ -0,0 +1,13 @@
1
+ """OpenKB package (distributed as okforge; import package kept as openkb)."""
2
+
3
+ from importlib.metadata import PackageNotFoundError
4
+ from importlib.metadata import version as _version
5
+
6
+ try:
7
+ __version__ = _version("okforge")
8
+ except PackageNotFoundError:
9
+ # Fallback for environments still carrying the pre-fork distribution.
10
+ try:
11
+ __version__ = _version("openkb")
12
+ except PackageNotFoundError:
13
+ __version__ = "0.0.0+unknown"
openkb/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Allow running okforge as ``python -m openkb``."""
2
+
3
+ from openkb.cli import cli
4
+
5
+ cli()
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: openkb-deck-editorial
3
+ description: |
4
+ Use when the user asks the openkb chat to make a deck / slide presentation /
5
+ PPT / slides / 演示稿 / 幻灯片 from their compiled KB content. Generates a
6
+ polished single-file HTML deck in the Editorial Monocle visual direction
7
+ (warm cream background, serif type, brick-red accent) — designed to be
8
+ opened in a browser, full-screened, and shared. Does NOT apply to
9
+ generating skills (that's `openkb skill new`), long-form research reports,
10
+ or interactive prototypes.
11
+ od:
12
+ mode: deck
13
+ output_path_template: "output/decks/{slug}/index.html"
14
+ deck_grammar:
15
+ kind_attr: data-type
16
+ required: [cover, closing]
17
+ allowed: [cover, chapter, thesis, quote, compare, data, closing]
18
+ min_distinct: 4
19
+ max_consecutive_same: 2
20
+ ---
21
+
22
+ # Editorial Monocle deck skill
23
+
24
+ You are designing a presentation, not writing a research report. Each
25
+ slide carries one idea. Visual structure carries the narrative.
26
+
27
+ ## How this skill is invoked
28
+
29
+ The user typed something like "make a deck about X" inside `openkb chat`.
30
+ You have wiki-read tools in your normal tool set, plus a `write_file`
31
+ tool that can write under `output/**`, plus a shell tool you can use to
32
+ read this SKILL.md and any files in `skills/openkb-deck-editorial/` if
33
+ needed.
34
+
35
+ Pick a kebab-case slug for the deck (e.g. `transformers-pitch`) and
36
+ write the output to `output/decks/<slug>/index.html`.
37
+
38
+ ## Required output
39
+
40
+ Exactly one file: `output/decks/<slug>/index.html`.
41
+
42
+ It must be **self-contained**: no external `<link rel="stylesheet">`,
43
+ no external `<script src="…">`, no remote `<img>`. All CSS goes in a
44
+ single inline `<style>` in `<head>`. Helper JS for keyboard navigation
45
+ goes in a single inline `<script>` at end of `<body>`.
46
+
47
+ The body is a sequence of `<section class="slide" data-type="...">`
48
+ blocks. Each `data-type` must be one of the 7 values listed in §
49
+ "Slide grammar" below. The deck supports keyboard navigation: ← / →
50
+ move between slides, `F` toggles fullscreen, `P` triggers print.
51
+
52
+ ## Design system: Editorial Monocle
53
+
54
+ Use this fixed design system. Do not improvise nearby colors, do not
55
+ introduce gradients, do not bring in emojis. This is the **only**
56
+ non-monochrome palette in the entire deck.
57
+
58
+ ### Color palette
59
+
60
+ ```css
61
+ :root {
62
+ --bg: #f3eee1; /* oklch(94% 0.03 80) — warm cream paper */
63
+ --ink: #1a1612; /* oklch(15% 0.01 50) — warm near-black */
64
+ --muted: #7a6e55; /* oklch(55% 0.04 75) — labels / metadata */
65
+ --rule: #d4cfc0; /* oklch(82% 0.02 75) — thin separator */
66
+ --accent: #a4341c; /* oklch(45% 0.16 30) — brick red, the ONLY non-monochrome */
67
+ --highlight: #fff3a8; /* oklch(95% 0.10 95) — marker highlighter ONLY */
68
+ }
69
+ ```
70
+
71
+ ### Type system
72
+
73
+ ```css
74
+ font-family-serif: "Charter", "Iowan Old Style", "Times New Roman", Georgia, serif;
75
+ font-family-sans: "Inter", -apple-system, "Helvetica Neue", sans-serif; /* labels only */
76
+ ```
77
+
78
+ Type scale (size / line-height / letter-spacing):
79
+
80
+ * `--type-display`: 56px / 1.05 / -1px — cover/chapter big titles
81
+ * `--type-title`: 38px / 1.10 / -0.5px — normal slide titles
82
+ * `--type-body`: 18px / 1.55 / 0 — body copy
83
+ * `--type-quote`: 28px / 1.30 / -0.3px italic — pull quotes
84
+ * `--type-label`: 10px / 1.0 / 2.5px uppercase — top/bottom label tracks
85
+
86
+ ### Frame (every slide)
87
+
88
+ * 16:9 aspect ratio: `aspect-ratio: 16/9; width: 100vw; max-width: 1280px;`
89
+ * Per-slide padding: 64px top/bottom, 80px left/right.
90
+ * **10px brick-red bar on the right edge of every slide.** The deck's
91
+ visual signature. 4px reads as invisible at presentation scale.
92
+ * Top label row: left = chapter id (e.g. "CHAPTER 03"), right = source mark.
93
+ * Bottom folio row: left = `N / Total`, right = source short label.
94
+
95
+ ### Composition rules
96
+
97
+ * **Cover title (`.display`)** must use `max-width: 18ch` (NOT 10ch).
98
+ Never wrap an article ("the", "an", "to") onto its own line.
99
+ * **Data slides** must center the big number horizontally on the slide
100
+ (`.data-body { align-items: center; text-align: center }` for
101
+ `data-type="data"` only — leave other slide types left-aligned).
102
+ Body copy beneath stays centered, max-width 38em.
103
+ * **Cover and closing slides**: `.cover-body, .closing-body { max-width: 26em }`.
104
+
105
+ ### Keyboard nav hint
106
+
107
+ ```css
108
+ .kbd { opacity: 0; transition: opacity .25s ease; }
109
+ body:hover .kbd { opacity: .55; }
110
+ ```
111
+
112
+ ## Slide grammar (7 permitted `data-type` values)
113
+
114
+ | `data-type` | Use | Visual signature |
115
+ |---|---|---|
116
+ | `cover` | First slide: tag + huge title + 1-line subtitle | Display type, left-aligned, never centered |
117
+ | `chapter` | Section divider: oversize number + chapter name | Number 120px brick-red, name 38px serif |
118
+ | `thesis` | A single claim + a short explanation | Title fills ~60% height, explanation small bottom |
119
+ | `quote` | Italic pull-quote + attribution | Centered, serif italic 28px, generous whitespace |
120
+ | `compare` | Two-column comparison: header + 3-5 lines each side | 1px brick-red vertical rule between columns |
121
+ | `data` | One number + label + one-line interpretation | Number 120-160px brick-red, micro-copy 12px |
122
+ | `closing` | Mirrors `cover`; thanks / next steps | Same scale as cover but content closes the arc |
123
+
124
+ **Cover/closing exception:** the `cover` and `closing` slides have no
125
+ chapter context, so the top-left label is the deck identifier
126
+ ("OPENKB") instead of a `CHAPTER NN` id.
127
+
128
+ ## Working method
129
+
130
+ 1. **Survey first.** Use your wiki-read tools to list `concepts/` and
131
+ `summaries/`, and read `wiki/index.md`. Form a mental map before
132
+ committing to what the deck argues.
133
+ 2. **Choose a narrative arc.** Write a one-line thesis, then an 8-12
134
+ step arc (problem → tension → resolution, or whatever shape the
135
+ intent calls for). Each step becomes 1-2 slides, landing the final
136
+ deck in the 8-15 range required by §Self-check.
137
+ 3. **Read the relevant content.** For each concept the arc touches,
138
+ read the concept page. For each document a concept cites, read at
139
+ least one targeted slice of the source. **This is where the
140
+ specific arguments, named techniques, worked examples, and
141
+ counter-cases live. The deck is only as expert as the depth of
142
+ source reading you do here. Generic restatements of the topic are
143
+ a failure mode — your deck will read as a definition-grade
144
+ summary, not an expert briefing.**
145
+ 4. **Outline the slides.** Map each step to one or more slides with
146
+ concrete `data-type` assignments. Vary `data-type` — at least 4
147
+ distinct types, no run of 3+ consecutive same type.
148
+ 5. **Write `output/decks/<slug>/index.html`** in one `write_file`
149
+ call. Inline all CSS, inline the keyboard nav JS, use inline
150
+ `<svg>` only for any graphics (v1 does not embed bitmap images).
151
+ 6. **Revise.** Re-read against §Failure modes below; touch at least
152
+ one slide if anything matches.
153
+ 7. **Self-check** the 5 invariants in §Self-check; fix anything that
154
+ fails.
155
+ 8. Report back to the user with: the deck path and a one-line summary
156
+ of the arc you chose.
157
+
158
+ ## Failure modes (negative checklist)
159
+
160
+ 1. **Bullet dump** — slide with > 5 bullet points. Cut to 3 strongest
161
+ or restructure into a `compare` / `data` slide.
162
+ 2. **Wall of text** — slide body > ~80 words. Cut, or split.
163
+ 3. **Visual monotony** — 3+ consecutive slides with the same `data-type`.
164
+ 4. **Centered everything** — only `quote` and `closing` are centered.
165
+ 5. **AI slop palette** — any color outside the 6-value palette: no
166
+ blue/purple gradients, no emoji, no rainbow accents.
167
+ 6. **Generic titles** — "Introduction" / "Background" / "Conclusion"
168
+ as a slide title. Title must carry specific content.
169
+ 7. **Definition-grade content** — slide body is just "X is Y where Y
170
+ is …" with no named technique, no number, no concrete example, no
171
+ quote from the source. If you can't name *something specific* on a
172
+ slide, the wiki may not have the depth — re-read the source pages
173
+ (step 3) before settling for a definition.
174
+
175
+ ## Self-check (before reporting back)
176
+
177
+ 1. Does `output/decks/<slug>/index.html` exist and contain no external
178
+ `<link>` or `<script src=>`?
179
+ 2. Is there at least one `data-type="cover"` and one
180
+ `data-type="closing"`?
181
+ 3. Is the total slide count between 8 and 15?
182
+ 4. Are at least 4 distinct `data-type` values used?
183
+ 5. Is there no run of 3+ consecutive slides with the same `data-type`?
184
+
185
+ If any answer is no, revise and re-run this self-check.