@hasna/knowledge 0.2.20 → 0.2.22
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 +38 -0
- package/bin/open-knowledge-mcp.js +927 -24
- package/bin/open-knowledge.js +153 -71
- package/docs/architecture/ai-native-knowledge-base.md +16 -0
- package/package.json +1 -1
- package/src/auth.ts +123 -0
- package/src/cli.ts +153 -10
- package/src/remote-client.ts +268 -0
- package/src/service.ts +142 -0
- package/src/storage-contract.ts +28 -0
- package/src/wiki-compiler.ts +711 -0
- package/src/workspace.ts +11 -0
package/README.md
CHANGED
|
@@ -65,12 +65,22 @@ open-knowledge paths --scope project --json
|
|
|
65
65
|
# Inspect local/S3 artifact storage and source ownership
|
|
66
66
|
open-knowledge storage status --scope project --json
|
|
67
67
|
|
|
68
|
+
# Configure optional hosted mode and inspect remote contracts
|
|
69
|
+
open-knowledge setup --mode hosted --api-url https://knowledge.hasna.xyz --scope project --json
|
|
70
|
+
open-knowledge auth whoami --scope project --json
|
|
71
|
+
open-knowledge remote contracts --scope project --json
|
|
72
|
+
|
|
68
73
|
# Initialize the project SQLite catalog
|
|
69
74
|
open-knowledge db init --scope project
|
|
70
75
|
|
|
71
76
|
# Initialize scalable wiki/schema/index/log artifacts
|
|
72
77
|
open-knowledge wiki init --scope project
|
|
73
78
|
|
|
79
|
+
# Compile cited wiki pages, file approved answers, and lint wiki health
|
|
80
|
+
open-knowledge wiki compile "handbook policy" --title "Handbook Policy" --scope project --json
|
|
81
|
+
open-knowledge wiki file-answer "How do we cite policy?" --content "Use cited source context." --approve-write --scope project --json
|
|
82
|
+
open-knowledge wiki lint --scope project --json
|
|
83
|
+
|
|
74
84
|
# Ingest an open-files source manifest into the project SQLite catalog
|
|
75
85
|
open-knowledge ingest manifest ./open-files-manifest.jsonl --scope project --json
|
|
76
86
|
|
|
@@ -204,6 +214,23 @@ knowledge bucket/prefix while `open-files` remains the source of truth for raw
|
|
|
204
214
|
source bytes. The command also reports artifact classes, allowed source ref
|
|
205
215
|
schemes, and warnings for non-scalable or unsafe config.
|
|
206
216
|
|
|
217
|
+
### setup / auth / remote
|
|
218
|
+
```bash
|
|
219
|
+
open-knowledge setup --mode local [--scope project] [--json]
|
|
220
|
+
open-knowledge setup --mode hosted [--api-url https://knowledge.hasna.xyz] [--scope project] [--json]
|
|
221
|
+
open-knowledge auth login --api-key <key> [--email you@example.com] [--org <slug>] [--scope project] [--json]
|
|
222
|
+
open-knowledge auth whoami [--scope project] [--json]
|
|
223
|
+
open-knowledge auth logout [--scope project] [--json]
|
|
224
|
+
open-knowledge remote status [--scope project] [--json]
|
|
225
|
+
open-knowledge remote contracts [--scope project] [--json]
|
|
226
|
+
```
|
|
227
|
+
Hosted mode mirrors the `open-skills` open-core pattern: the OSS package stays
|
|
228
|
+
local-first, while `hosted.api_url`, `KNOWLEDGE_API_URL`, and
|
|
229
|
+
`KNOWLEDGE_API_KEY` define an optional remote client boundary. Credentials are
|
|
230
|
+
stored locally in `~/.hasna/knowledge/auth.json` or supplied by env vars.
|
|
231
|
+
`remote contracts` prints the typed registry/search/ask/build/sync/status/logs
|
|
232
|
+
and artifact API contract that a future SaaS wrapper can implement.
|
|
233
|
+
|
|
207
234
|
### db
|
|
208
235
|
```bash
|
|
209
236
|
open-knowledge db init [--scope project]
|
|
@@ -215,11 +242,22 @@ Initialize or inspect the versioned SQLite catalog at
|
|
|
215
242
|
### wiki
|
|
216
243
|
```bash
|
|
217
244
|
open-knowledge wiki init [--scope project]
|
|
245
|
+
open-knowledge wiki compile [query|source-ref...] [--title <title>] [--limit <n>] [--scope project] [--json]
|
|
246
|
+
open-knowledge wiki file-answer <prompt> --content <answer> [--approve-write] [--scope project] [--json]
|
|
247
|
+
open-knowledge wiki lint [--scope project] [--json]
|
|
218
248
|
```
|
|
219
249
|
Create starter generated-knowledge artifacts through the artifact store:
|
|
220
250
|
`schemas/v1.md`, `indexes/root.md`, `wiki/README.md`, and a dated JSONL log
|
|
221
251
|
partition.
|
|
222
252
|
|
|
253
|
+
`wiki compile` turns existing source chunks into a cited Markdown page under
|
|
254
|
+
`wiki/generated/`, updates `knowledge_indexes`, records citations and a concept
|
|
255
|
+
backlink, and appends a JSONL log partition. `wiki file-answer` keeps answer
|
|
256
|
+
filing as a dry run unless `--approve-write` is supplied, then writes a cited
|
|
257
|
+
answer note under `wiki/answers/`. `wiki lint` checks generated pages for
|
|
258
|
+
missing citations, stale citations, duplicate titles, orphan pages, unresolved
|
|
259
|
+
source refs, contradiction markers, and new article candidates.
|
|
260
|
+
|
|
223
261
|
### source
|
|
224
262
|
```bash
|
|
225
263
|
open-knowledge source resolve <source-ref> [--purpose knowledge_answer|knowledge_index] [--limit <n>] [--scope project] [--json]
|