@dikolab/kbdb 0.5.0 → 0.6.0
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/CLA.md +68 -0
- package/LICENSE +676 -12
- package/LICENSING.md +58 -0
- package/README.md +47 -24
- package/README.md.bak +320 -0
- package/dist/README.md +320 -0
- package/dist/{chunk-BJXEVALU.mjs → chunk-QLJ33C74.mjs} +44 -44
- package/dist/chunk-QLJ33C74.mjs.map +7 -0
- package/dist/cli.cjs +550 -232
- package/dist/cli.cjs.map +4 -4
- package/dist/cli.d.ts +0 -8
- package/dist/cli.mjs +483 -154
- package/dist/cli.mjs.map +4 -4
- package/dist/kbdb-worker.cjs +36 -5
- package/dist/kbdb-worker.cjs.map +3 -3
- package/dist/mod.cjs +89 -30
- package/dist/mod.cjs.map +4 -4
- package/dist/mod.mjs +88 -30
- package/dist/mod.mjs.map +4 -4
- package/dist/src/cli.d.ts +0 -8
- package/dist/src/shared/cli/constants/defaults.constant.d.ts +1 -1
- package/dist/src/shared/cli/constants/recfile-command-field-map.constant.d.ts +8 -0
- package/dist/src/shared/cli/constants/recfile-field-maps.constant.d.ts +21 -0
- package/dist/src/shared/cli/functions/compute-directory-level.function.d.ts +14 -0
- package/dist/src/shared/cli/functions/dispatch-command.function.d.ts +2 -28
- package/dist/src/shared/cli/functions/format-command-output.function.d.ts +14 -0
- package/dist/src/shared/cli/functions/format-db-not-found.function.d.ts +20 -0
- package/dist/src/shared/cli/functions/format-output.function.d.ts +1 -0
- package/dist/src/shared/cli/functions/format-recfile-output.function.d.ts +11 -0
- package/dist/src/shared/cli/functions/render-recfile-value.function.d.ts +11 -0
- package/dist/src/shared/cli/functions/resolve-db-dir.function.d.ts +24 -0
- package/dist/src/shared/cli/functions/resolve-recfile-key.function.d.ts +9 -0
- package/dist/src/shared/cli/functions/run-db-path.function.d.ts +10 -0
- package/dist/src/shared/cli/functions/run-export.function.d.ts +8 -4
- package/dist/src/shared/cli/functions/run-import.function.d.ts +4 -0
- package/dist/src/shared/cli/functions/run-learn.function.d.ts +12 -0
- package/dist/src/shared/cli/index.d.ts +4 -1
- package/dist/src/shared/cli/typings/cli-options.interface.d.ts +9 -2
- package/dist/src/shared/cli/typings/db-resolution.interface.d.ts +9 -0
- package/dist/src/shared/cli/typings/recfile-field-map.type.d.ts +10 -0
- package/dist/src/shared/version/constants/version.constant.d.ts +1 -1
- package/dist/src/shared/wasm-codec/functions/decode-option-u8.function.d.ts +9 -0
- package/dist/src/shared/wasm-codec/functions/decode-section-records.function.d.ts +4 -0
- package/dist/src/shared/wasm-codec/functions/encode-add-section-params.function.d.ts +2 -45
- package/dist/src/shared/wasm-codec/functions/encode-update-section-params.function.d.ts +10 -1
- package/dist/src/shared/wasm-codec/index.d.ts +1 -1
- package/dist/src/shared/wasm-codec/typings/add-section-input.model.d.ts +6 -0
- package/dist/src/shared/wasm-codec/typings/section-record-trailing.model.d.ts +5 -0
- package/dist/src/shared/wasm-codec/typings/section-record.model.d.ts +5 -0
- package/dist/src/shared/worker-client/functions/build-deno-permissions.function.d.ts +11 -0
- package/dist/src/shared/worker-client/functions/read-crash-reason.function.d.ts +9 -0
- package/dist/src/shared/worker-client/functions/resolve-spawn-script.function.d.ts +6 -0
- package/dist/src/shared/worker-client/functions/spawn-daemon.function.d.ts +1 -1
- package/dist/src/shared/worker-client/typings/section.model.d.ts +5 -0
- package/dist/src/shared/worker-client/typings/worker-client-options.interface.d.ts +0 -6
- package/dist/src/shared/worker-daemon/functions/count-files.function.d.ts +12 -0
- package/dist/src/shared/worker-daemon/functions/handle-import.function.d.ts +2 -0
- package/dist/src/shared/worker-daemon/functions/handle-read-ops.function.d.ts +8 -0
- package/dist/src/shared/worker-daemon/functions/validate-daemon-path.function.d.ts +15 -0
- package/dist/src/worker.d.ts +0 -7
- package/dist/wasm/default-embedding/kbdb_default_embedding_bg.wasm +0 -0
- package/dist/wasm/default-embedding/package.json +1 -1
- package/dist/wasm/fs-database/kbdb_fs_database_bg.wasm +0 -0
- package/dist/wasm/fs-database/package.json +1 -1
- package/dist/wasm/fs-migration/package.json +1 -1
- package/dist/wasm/kb-worker/kbdb_worker_bg.wasm +0 -0
- package/dist/wasm/kb-worker/package.json +1 -1
- package/dist/wasm/query-parser/kbdb_query_parser_bg.wasm +0 -0
- package/dist/wasm/query-parser/package.json +1 -1
- package/dist/worker.d.ts +0 -7
- package/dist/worker.mjs +37 -6
- package/dist/worker.mjs.map +3 -3
- package/package.json +10 -9
- package/dist/chunk-BJXEVALU.mjs.map +0 -7
- package/dist/src/shared/cli/functions/resolve-raw-db-path.function.d.ts +0 -10
- package/docs/details/README.md +0 -30
- package/docs/details/agent-tooling.md +0 -132
- package/docs/details/cli.md +0 -777
- package/docs/details/knowledge-base.md +0 -180
- package/docs/details/library-api.md +0 -495
- package/docs/details/mcp-server.md +0 -482
- package/docs/details/search-and-ranking.md +0 -575
- package/docs/details/storage.md +0 -531
- package/docs/goals/agents.md +0 -751
- package/docs/goals/architecture.svg +0 -198
- package/docs/goals/auto-capture.md +0 -378
- package/docs/goals/benchmarking.md +0 -296
- package/docs/goals/cli.md +0 -2654
- package/docs/goals/concurrency.md +0 -259
- package/docs/goals/content-composer.md +0 -609
- package/docs/goals/content-parser.md +0 -279
- package/docs/goals/database.md +0 -1679
- package/docs/goals/document.md +0 -368
- package/docs/goals/hybrid-search.md +0 -465
- package/docs/goals/mcp.md +0 -1541
- package/docs/goals/overview.md +0 -124
- package/docs/goals/query-parser.md +0 -373
- package/docs/goals/query-result.md +0 -860
- package/docs/goals/semantic-dedup.md +0 -233
- package/docs/goals/skills.md +0 -810
- package/docs/goals/sync.md +0 -217
- package/docs/goals/worker-client.md +0 -1005
- package/docs/goals/worker-daemon.md +0 -1547
- package/docs/modules/overview.md +0 -319
- package/docs/modules/rust/embedding/module.md +0 -91
- package/docs/modules/rust/fs-database/functions/document.md +0 -48
- package/docs/modules/rust/fs-database/functions/integrity.md +0 -79
- package/docs/modules/rust/fs-database/functions/io.md +0 -87
- package/docs/modules/rust/fs-database/functions/module.md +0 -22
- package/docs/modules/rust/fs-database/functions/query-exec.md +0 -44
- package/docs/modules/rust/fs-database/functions/section.md +0 -76
- package/docs/modules/rust/fs-database/indexes/btree.md +0 -35
- package/docs/modules/rust/fs-database/indexes/corpus.md +0 -61
- package/docs/modules/rust/fs-database/indexes/inverted.md +0 -60
- package/docs/modules/rust/fs-database/indexes/module.md +0 -64
- package/docs/modules/rust/fs-database/indexes/positional.md +0 -39
- package/docs/modules/rust/fs-database/indexes/vectors.md +0 -110
- package/docs/modules/rust/fs-database/module.md +0 -150
- package/docs/modules/rust/fs-database/types/catalog.md +0 -53
- package/docs/modules/rust/fs-database/types/module.md +0 -12
- package/docs/modules/rust/fs-database/types/section.md +0 -127
- package/docs/modules/rust/kb-worker/functions/compose.md +0 -57
- package/docs/modules/rust/kb-worker/functions/module.md +0 -20
- package/docs/modules/rust/kb-worker/functions/retrieve.md +0 -194
- package/docs/modules/rust/kb-worker/functions/search.md +0 -173
- package/docs/modules/rust/kb-worker/functions/write.md +0 -172
- package/docs/modules/rust/kb-worker/module.md +0 -171
- package/docs/modules/rust/kb-worker/types/cache.md +0 -90
- package/docs/modules/rust/kb-worker/types/context.md +0 -26
- package/docs/modules/rust/kb-worker/types/module.md +0 -16
- package/docs/modules/rust/kb-worker/types/status.md +0 -29
- package/docs/modules/rust/kb-worker/types/token.md +0 -50
- package/docs/modules/rust/overview.md +0 -531
- package/docs/modules/rust/query-parser/functions/extract.md +0 -56
- package/docs/modules/rust/query-parser/functions/module.md +0 -18
- package/docs/modules/rust/query-parser/functions/parse.md +0 -33
- package/docs/modules/rust/query-parser/functions/pipeline.md +0 -9
- package/docs/modules/rust/query-parser/functions/rank.md +0 -85
- package/docs/modules/rust/query-parser/module.md +0 -131
- package/docs/modules/rust/query-parser/types/cache.md +0 -39
- package/docs/modules/rust/query-parser/types/keyphrase.md +0 -71
- package/docs/modules/rust/query-parser/types/module.md +0 -18
- package/docs/modules/rust/query-parser/types/token.md +0 -46
- package/docs/modules/rust/shared/content-composer/functions.md +0 -114
- package/docs/modules/rust/shared/content-composer/module.md +0 -147
- package/docs/modules/rust/shared/content-composer/types.md +0 -93
- package/docs/modules/rust/shared/content-parser/functions.md +0 -72
- package/docs/modules/rust/shared/content-parser/module.md +0 -99
- package/docs/modules/rust/shared/content-parser/types.md +0 -71
- package/docs/modules/rust/shared/corpus/module.md +0 -24
- package/docs/modules/rust/shared/corpus/types.md +0 -141
- package/docs/modules/rust/shared/document/module.md +0 -25
- package/docs/modules/rust/shared/document/types.md +0 -154
- package/docs/modules/rust/shared/encode/module.md +0 -22
- package/docs/modules/rust/shared/encode/traits.md +0 -304
- package/docs/modules/rust/shared/error/module.md +0 -28
- package/docs/modules/rust/shared/error/types.md +0 -302
- package/docs/modules/rust/shared/kbid/module.md +0 -24
- package/docs/modules/rust/shared/kbid/types.md +0 -147
- package/docs/modules/rust/shared/memory/functions.md +0 -209
- package/docs/modules/rust/shared/memory/module.md +0 -24
- package/docs/modules/rust/shared/module.md +0 -196
- package/docs/modules/rust/shared/pipeline/functions.md +0 -141
- package/docs/modules/rust/shared/pipeline/module.md +0 -62
- package/docs/modules/rust/shared/pipeline/types.md +0 -43
- package/docs/modules/rust/shared/query/module.md +0 -27
- package/docs/modules/rust/shared/query/types.md +0 -236
- package/docs/modules/rust/shared/section/module.md +0 -25
- package/docs/modules/rust/shared/section/types.md +0 -294
- package/docs/modules/rust/shared/term/module.md +0 -25
- package/docs/modules/rust/shared/term/types.md +0 -139
- package/docs/modules/typescript/cli.md +0 -131
- package/docs/modules/typescript/kbdb-worker.md +0 -150
- package/docs/modules/typescript/overview.md +0 -400
- package/docs/modules/typescript/shared/auto-capture/module.md +0 -73
- package/docs/modules/typescript/shared/cli/constants.md +0 -23
- package/docs/modules/typescript/shared/cli/functions.md +0 -809
- package/docs/modules/typescript/shared/cli/module.md +0 -138
- package/docs/modules/typescript/shared/cli/typings.md +0 -197
- package/docs/modules/typescript/shared/embedding/functions.md +0 -200
- package/docs/modules/typescript/shared/embedding/module.md +0 -77
- package/docs/modules/typescript/shared/embedding/typings.md +0 -124
- package/docs/modules/typescript/shared/hash/functions.md +0 -20
- package/docs/modules/typescript/shared/hash/module.md +0 -21
- package/docs/modules/typescript/shared/log/constants.md +0 -82
- package/docs/modules/typescript/shared/log/functions.md +0 -131
- package/docs/modules/typescript/shared/log/module.md +0 -153
- package/docs/modules/typescript/shared/log/typings.md +0 -82
- package/docs/modules/typescript/shared/mcp/classes.md +0 -179
- package/docs/modules/typescript/shared/mcp/functions.md +0 -386
- package/docs/modules/typescript/shared/mcp/module.md +0 -160
- package/docs/modules/typescript/shared/mcp/typings.md +0 -529
- package/docs/modules/typescript/shared/module.md +0 -110
- package/docs/modules/typescript/shared/platform/functions.md +0 -42
- package/docs/modules/typescript/shared/platform/module.md +0 -25
- package/docs/modules/typescript/shared/runtime/functions.md +0 -26
- package/docs/modules/typescript/shared/runtime/module.md +0 -27
- package/docs/modules/typescript/shared/runtime/typings.md +0 -13
- package/docs/modules/typescript/shared/version/module.md +0 -27
- package/docs/modules/typescript/shared/wasm-codec/functions.md +0 -391
- package/docs/modules/typescript/shared/wasm-codec/module.md +0 -98
- package/docs/modules/typescript/shared/worker-client/classes.md +0 -264
- package/docs/modules/typescript/shared/worker-client/functions.md +0 -175
- package/docs/modules/typescript/shared/worker-client/module.md +0 -92
- package/docs/modules/typescript/shared/worker-client/typings.md +0 -511
- package/docs/modules/typescript/shared/worker-daemon/classes.md +0 -239
- package/docs/modules/typescript/shared/worker-daemon/constants.md +0 -37
- package/docs/modules/typescript/shared/worker-daemon/functions.md +0 -234
- package/docs/modules/typescript/shared/worker-daemon/module.md +0 -118
- package/docs/modules/typescript/shared/worker-daemon/typings.md +0 -132
- package/docs/overview.md +0 -191
- package/docs/release-notes/0.1.0.md +0 -189
- package/docs/release-notes/0.1.1.md +0 -46
- package/docs/release-notes/0.1.2.md +0 -38
- package/docs/release-notes/0.1.3.md +0 -42
- package/docs/release-notes/0.2.0.md +0 -147
- package/docs/release-notes/0.3.0.md +0 -89
- package/docs/release-notes/0.3.1.md +0 -121
- package/docs/release-notes/0.3.2.md +0 -64
- package/docs/release-notes/0.4.0.md +0 -80
- package/docs/release-notes/0.4.1.md +0 -149
- package/docs/release-notes/0.4.3.md +0 -60
- package/docs/release-notes/0.5.0.md +0 -41
- package/docs/release-notes/README.md +0 -16
package/dist/README.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# @dikolab/kbdb
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@dikolab/kbdb)
|
|
4
|
+
[](https://jsr.io/@dikolab/kbdb)
|
|
5
|
+
[](https://gitlab.com/diko316/knowledge-base-db/-/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
A file-based knowledge base database -- no external
|
|
8
|
+
server to install.
|
|
9
|
+
|
|
10
|
+
[GitLab](https://gitlab.com/diko316/knowledge-base-db)
|
|
11
|
+
| [NPM](https://www.npmjs.com/package/@dikolab/kbdb)
|
|
12
|
+
| [JSR](https://jsr.io/@dikolab/kbdb)
|
|
13
|
+
| [License: AGPL-3.0](https://gitlab.com/diko316/knowledge-base-db/-/blob/main/LICENSE)
|
|
14
|
+
|
|
15
|
+
> **Status:** Beta -- actively developed. Core
|
|
16
|
+
> features (search, recall, MCP) are stable and
|
|
17
|
+
> tested.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## What is kbdb?
|
|
22
|
+
|
|
23
|
+
**kbdb** stores your docs in a plain folder on
|
|
24
|
+
disk and makes them searchable. No external server
|
|
25
|
+
to install. No cloud account. Import your Markdown
|
|
26
|
+
files, and kbdb indexes them automatically.
|
|
27
|
+
Search returns ranked results instantly.
|
|
28
|
+
|
|
29
|
+
It runs anywhere Node.js or Deno runs, and also
|
|
30
|
+
works as an [MCP](https://modelcontextprotocol.io/)
|
|
31
|
+
server -- giving AI agents like Claude a searchable
|
|
32
|
+
second brain that persists between sessions.
|
|
33
|
+
|
|
34
|
+
**How search works:** kbdb uses **keyword search** by
|
|
35
|
+
default -- synonyms are expanded, terms are ranked
|
|
36
|
+
by relevance, and headings carry 2× weight in
|
|
37
|
+
scoring. When an exact query finds nothing, kbdb
|
|
38
|
+
automatically loosens the match so you still get the
|
|
39
|
+
best available results.
|
|
40
|
+
|
|
41
|
+
Want smarter results? Use `--algo hybrid` to blend
|
|
42
|
+
keyword matching with similarity search -- finding
|
|
43
|
+
results even when different words describe the same
|
|
44
|
+
concept. The default **TF-IDF** embedding provider
|
|
45
|
+
works offline with zero setup. Swap it for a
|
|
46
|
+
third-party provider (local ONNX model or remote
|
|
47
|
+
API) in `worker.toml` when you need richer
|
|
48
|
+
embeddings.
|
|
49
|
+
|
|
50
|
+
**Knowledge stays fresh:** Re-learn a file and kbdb
|
|
51
|
+
replaces the old version automatically.
|
|
52
|
+
Near-duplicate detection warns you before content
|
|
53
|
+
drifts. Integrity checks catch contradictions.
|
|
54
|
+
Confidence scores help agents tell strong matches
|
|
55
|
+
from weak ones.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Getting Started
|
|
60
|
+
|
|
61
|
+
### What You Need
|
|
62
|
+
|
|
63
|
+
One of these (pick whichever you already have):
|
|
64
|
+
|
|
65
|
+
- **Node.js** version 20 or newer --
|
|
66
|
+
[Download](https://nodejs.org/)
|
|
67
|
+
- **Deno** version 2 or newer --
|
|
68
|
+
[Download](https://deno.com/)
|
|
69
|
+
|
|
70
|
+
That's it. No database server. No extra tools.
|
|
71
|
+
|
|
72
|
+
### Install
|
|
73
|
+
|
|
74
|
+
**Using Node.js:**
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
npm install -g @dikolab/kbdb
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Using Deno:**
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
deno install -Agf jsr:@dikolab/kbdb/cli
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Try It Out
|
|
87
|
+
|
|
88
|
+
**1. Create a knowledge base**
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
kbdb db init --db ./my-kb
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This creates a `.kbdb` folder that holds all your
|
|
95
|
+
data.
|
|
96
|
+
|
|
97
|
+
**2. Feed it your docs**
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
kbdb learn ./docs --db ./my-kb
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Point it at a folder of Markdown files. kbdb reads
|
|
104
|
+
them, breaks them into sections, and builds a
|
|
105
|
+
search index. Add `--tags design,v2` to tag
|
|
106
|
+
sections for scoping, `--replace` to update
|
|
107
|
+
existing sections from the same source, or
|
|
108
|
+
`--level 2` to set the hierarchical depth
|
|
109
|
+
(1 = broadest, 6 = narrowest). When learning a
|
|
110
|
+
directory, level is auto-detected from folder
|
|
111
|
+
depth.
|
|
112
|
+
|
|
113
|
+
**3. Search**
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
kbdb search "how does auth work" --db ./my-kb
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Results are ranked by relevance with snippets
|
|
120
|
+
showing where your terms matched. Output defaults
|
|
121
|
+
to **recfile** format (one `field: value` per
|
|
122
|
+
line) for easy grepping. Use `--format json` for
|
|
123
|
+
machine-readable JSON, or `--offset` to page
|
|
124
|
+
through large result sets.
|
|
125
|
+
|
|
126
|
+
To try hybrid search (keyword + AI similarity):
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
kbdb search "how does auth work" --algo hybrid \
|
|
130
|
+
--db ./my-kb
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
> **Tip:** `--db` is optional. If you're already
|
|
134
|
+
> inside a directory with a `.kbdb` folder, just
|
|
135
|
+
> omit it. You can also set `KBDB_DB_DIR` as an
|
|
136
|
+
> environment variable.
|
|
137
|
+
|
|
138
|
+
> **Scripting:** Add `--format json` to get
|
|
139
|
+
> structured JSON output for parsing. Use
|
|
140
|
+
> `--non-interactive` or set
|
|
141
|
+
> `KBDB_NON_INTERACTIVE=1` to suppress prompts in
|
|
142
|
+
> CI pipelines.
|
|
143
|
+
|
|
144
|
+
**4. Recall context**
|
|
145
|
+
|
|
146
|
+
```sh
|
|
147
|
+
kbdb recall <kbid> --depth 1 --db ./my-kb
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Start with a search result's kbid and expand
|
|
151
|
+
context progressively: depth 0 gives the section
|
|
152
|
+
content, depth 1 adds parent documents and
|
|
153
|
+
back-references, depth 2 adds siblings and forward
|
|
154
|
+
references, depth 3 includes full text of
|
|
155
|
+
referenced sections.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Knowledge Base
|
|
160
|
+
|
|
161
|
+
Build, search, and maintain your knowledge store.
|
|
162
|
+
|
|
163
|
+
- **Import** Markdown and plain text files with
|
|
164
|
+
tags and source tracking
|
|
165
|
+
- **Smart updates** -- re-learning a file replaces
|
|
166
|
+
the old version instead of duplicating it
|
|
167
|
+
- **Search** with three algorithms: keyword
|
|
168
|
+
(default), AI similarity, or hybrid (both)
|
|
169
|
+
- **Auto-fallback** -- if your exact query finds
|
|
170
|
+
nothing, kbdb loosens the match automatically
|
|
171
|
+
- **Recall** sections with progressive context --
|
|
172
|
+
from a quick summary to full related content
|
|
173
|
+
- **Export** -- snapshot your knowledge base for
|
|
174
|
+
backup
|
|
175
|
+
- **Verify** database integrity and clean up
|
|
176
|
+
stale data
|
|
177
|
+
- **Rebuild** indexes if anything goes wrong
|
|
178
|
+
|
|
179
|
+
See the
|
|
180
|
+
[Knowledge Base Guide](https://diko316.gitlab.io/knowledge-base-db/details/knowledge-base)
|
|
181
|
+
for the full walkthrough, including export and backup.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Agent Tooling
|
|
186
|
+
|
|
187
|
+
Integrate kbdb with AI agents and custom tools.
|
|
188
|
+
|
|
189
|
+
- **MCP server** with 20 tools -- search, recall,
|
|
190
|
+
learn, export, and more
|
|
191
|
+
- **Skills** -- store reusable prompt templates
|
|
192
|
+
with fill-in-the-blank arguments
|
|
193
|
+
- **Agents** -- create AI agent profiles that
|
|
194
|
+
combine a persona with skills
|
|
195
|
+
- **Auto-capture** -- the MCP server can
|
|
196
|
+
proactively suggest knowledge to store from
|
|
197
|
+
your conversations
|
|
198
|
+
- **Daemon resilience** -- configurable request
|
|
199
|
+
timeout and automatic retry with daemon respawn
|
|
200
|
+
- **Worker daemon** lifecycle management --
|
|
201
|
+
stop and restart the background process
|
|
202
|
+
- **Granular Deno permissions** -- the daemon
|
|
203
|
+
runs with scoped permissions instead of
|
|
204
|
+
`--allow-all`
|
|
205
|
+
- **Path confinement** -- the daemon rejects
|
|
206
|
+
path traversal (`..`) in export/import
|
|
207
|
+
|
|
208
|
+
See the
|
|
209
|
+
[Agent Tooling Guide](https://diko316.gitlab.io/knowledge-base-db/details/agent-tooling)
|
|
210
|
+
for MCP setup, skills, agents, and the library API.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## For Developers
|
|
215
|
+
|
|
216
|
+
### Library API
|
|
217
|
+
|
|
218
|
+
Use kbdb programmatically in your Node.js or Deno
|
|
219
|
+
project:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
import { createWorkerClient } from '@dikolab/kbdb';
|
|
223
|
+
|
|
224
|
+
// Spawns a background worker if not already running
|
|
225
|
+
const client = await createWorkerClient({
|
|
226
|
+
contextPath: '/path/to/.kbdb',
|
|
227
|
+
requestTimeoutMs: 30_000,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const results = await client.search({
|
|
231
|
+
query: 'authentication',
|
|
232
|
+
limit: 10,
|
|
233
|
+
offset: 0,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
console.log(results.items);
|
|
237
|
+
client.disconnect();
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Pass `contextPath` (the `.kbdb` directory itself)
|
|
241
|
+
or `dbPath` (the parent directory -- kbdb discovers
|
|
242
|
+
`.kbdb` inside it).
|
|
243
|
+
|
|
244
|
+
See the
|
|
245
|
+
[Library API Reference](https://diko316.gitlab.io/knowledge-base-db/details/library-api)
|
|
246
|
+
for the full API.
|
|
247
|
+
|
|
248
|
+
### Development Setup
|
|
249
|
+
|
|
250
|
+
```sh
|
|
251
|
+
git clone https://gitlab.com/diko316/knowledge-base-db.git
|
|
252
|
+
cd knowledge-base-db
|
|
253
|
+
npm install
|
|
254
|
+
npm test
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Docker
|
|
258
|
+
|
|
259
|
+
A Docker setup is included with all build tools
|
|
260
|
+
(Node.js, Deno, Rust, wasm-pack):
|
|
261
|
+
|
|
262
|
+
```sh
|
|
263
|
+
HOST_UMASK=$(umask) docker compose run --rm dev bash
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Run `make benchmark` to measure search and rebuild
|
|
267
|
+
latency at scale -- results are written to
|
|
268
|
+
[docs/benchmark/benchmark.md](https://diko316.gitlab.io/knowledge-base-db/benchmark/benchmark)
|
|
269
|
+
automatically.
|
|
270
|
+
|
|
271
|
+
See the [Makefile](https://gitlab.com/diko316/knowledge-base-db/-/blob/main/Makefile) for all available
|
|
272
|
+
build targets.
|
|
273
|
+
|
|
274
|
+
### Contributing
|
|
275
|
+
|
|
276
|
+
1. Fork the repository
|
|
277
|
+
2. Create a feature branch
|
|
278
|
+
3. Make your changes and add tests
|
|
279
|
+
4. Run `npm test` and `npm run lint`
|
|
280
|
+
5. Open a merge request
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Documentation
|
|
285
|
+
|
|
286
|
+
- [Knowledge Base Guide](https://diko316.gitlab.io/knowledge-base-db/details/knowledge-base)
|
|
287
|
+
-- importing, searching, recall, export
|
|
288
|
+
- [Agent Tooling Guide](https://diko316.gitlab.io/knowledge-base-db/details/agent-tooling)
|
|
289
|
+
-- MCP, skills, agents, library API
|
|
290
|
+
- [CLI Reference](https://diko316.gitlab.io/knowledge-base-db/details/cli) -- full command
|
|
291
|
+
list with examples
|
|
292
|
+
- [MCP Server Guide](https://diko316.gitlab.io/knowledge-base-db/details/mcp-server) --
|
|
293
|
+
setup, tools, environment config
|
|
294
|
+
- [Search and Ranking](https://diko316.gitlab.io/knowledge-base-db/details/search-and-ranking)
|
|
295
|
+
-- how search works under the hood
|
|
296
|
+
- [Storage Architecture](https://diko316.gitlab.io/knowledge-base-db/details/storage) --
|
|
297
|
+
file formats and directory layout
|
|
298
|
+
- [Benchmark Results](https://diko316.gitlab.io/knowledge-base-db/benchmark/benchmark)
|
|
299
|
+
-- search and rebuild latency at scale
|
|
300
|
+
- [Release Notes](https://diko316.gitlab.io/knowledge-base-db/release-notes/)
|
|
301
|
+
- [Architecture Overview](https://diko316.gitlab.io/knowledge-base-db/overview)
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## License
|
|
306
|
+
|
|
307
|
+
This project is dual-licensed:
|
|
308
|
+
|
|
309
|
+
- **Open source** under the
|
|
310
|
+
[GNU Affero General Public License v3.0](https://gitlab.com/diko316/knowledge-base-db/-/blob/main/LICENSE)
|
|
311
|
+
(`AGPL-3.0-only`)
|
|
312
|
+
- **Commercial license** available for closed-source
|
|
313
|
+
or SaaS use
|
|
314
|
+
|
|
315
|
+
Versions `<= 0.5.0` remain under the ISC license.
|
|
316
|
+
|
|
317
|
+
See [LICENSING.md](./LICENSING.md) for details and
|
|
318
|
+
contact information.
|
|
319
|
+
|
|
320
|
+
---
|
|
@@ -16,46 +16,6 @@ function getArgs() {
|
|
|
16
16
|
return process.argv.slice(2);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
// src/shared/dir-resolver/functions/resolve-base-dir.function.ts
|
|
20
|
-
import { dirname } from "node:path";
|
|
21
|
-
import { fileURLToPath } from "node:url";
|
|
22
|
-
function resolveScriptDir(entryUrl, entryDirname) {
|
|
23
|
-
if (entryDirname) return entryDirname;
|
|
24
|
-
if (entryUrl.startsWith("file:"))
|
|
25
|
-
return dirname(fileURLToPath(entryUrl));
|
|
26
|
-
return dirname(entryUrl);
|
|
27
|
-
}
|
|
28
|
-
function resolveBaseDir(entryUrl, entryDirname) {
|
|
29
|
-
const scriptDir = typeof __dirname !== "undefined" ? __dirname : resolveScriptDir(entryUrl, entryDirname);
|
|
30
|
-
return { scriptDir, cwd: process.cwd() };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// src/shared/dir-resolver/functions/join-path.function.ts
|
|
34
|
-
import { join } from "node:path";
|
|
35
|
-
function isRemoteUrl(path) {
|
|
36
|
-
return path.startsWith("http://") || path.startsWith("https://");
|
|
37
|
-
}
|
|
38
|
-
function joinPath(base, ...segments) {
|
|
39
|
-
if (isRemoteUrl(base)) {
|
|
40
|
-
const trailing = base.endsWith("/") ? "" : "/";
|
|
41
|
-
return base + trailing + segments.join("/");
|
|
42
|
-
}
|
|
43
|
-
return join(base, ...segments);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/shared/dir-resolver/functions/resolve-worker-script.function.ts
|
|
47
|
-
function resolveWorkerScript(scriptDir, runtime) {
|
|
48
|
-
if (runtime === "deno") {
|
|
49
|
-
return joinPath(scriptDir, "worker.ts");
|
|
50
|
-
}
|
|
51
|
-
return joinPath(scriptDir, "kbdb-worker.cjs");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// src/shared/dir-resolver/functions/resolve-wasm-dir.function.ts
|
|
55
|
-
function resolveWasmDir(scriptDir) {
|
|
56
|
-
return joinPath(scriptDir, "wasm");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
19
|
// src/shared/log/typings/log-level.type.ts
|
|
60
20
|
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
61
21
|
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
|
|
@@ -134,6 +94,46 @@ function log(message, level = 3 /* ERROR */) {
|
|
|
134
94
|
outputs[level](line);
|
|
135
95
|
}
|
|
136
96
|
|
|
97
|
+
// src/shared/dir-resolver/functions/resolve-base-dir.function.ts
|
|
98
|
+
import { dirname } from "node:path";
|
|
99
|
+
import { fileURLToPath } from "node:url";
|
|
100
|
+
function resolveScriptDir(entryUrl, entryDirname) {
|
|
101
|
+
if (entryDirname) return entryDirname;
|
|
102
|
+
if (entryUrl.startsWith("file:"))
|
|
103
|
+
return dirname(fileURLToPath(entryUrl));
|
|
104
|
+
return dirname(entryUrl);
|
|
105
|
+
}
|
|
106
|
+
function resolveBaseDir(entryUrl, entryDirname) {
|
|
107
|
+
const scriptDir = typeof __dirname !== "undefined" ? __dirname : resolveScriptDir(entryUrl, entryDirname);
|
|
108
|
+
return { scriptDir, cwd: process.cwd() };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/shared/dir-resolver/functions/join-path.function.ts
|
|
112
|
+
import { join } from "node:path";
|
|
113
|
+
function isRemoteUrl(path) {
|
|
114
|
+
return path.startsWith("http://") || path.startsWith("https://");
|
|
115
|
+
}
|
|
116
|
+
function joinPath(base, ...segments) {
|
|
117
|
+
if (isRemoteUrl(base)) {
|
|
118
|
+
const trailing = base.endsWith("/") ? "" : "/";
|
|
119
|
+
return base + trailing + segments.join("/");
|
|
120
|
+
}
|
|
121
|
+
return join(base, ...segments);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// src/shared/dir-resolver/functions/resolve-wasm-dir.function.ts
|
|
125
|
+
function resolveWasmDir(scriptDir) {
|
|
126
|
+
return joinPath(scriptDir, "wasm");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// src/shared/dir-resolver/functions/resolve-worker-script.function.ts
|
|
130
|
+
function resolveWorkerScript(scriptDir, runtime) {
|
|
131
|
+
if (runtime === "deno") {
|
|
132
|
+
return joinPath(scriptDir, "worker.ts");
|
|
133
|
+
}
|
|
134
|
+
return joinPath(scriptDir, "kbdb-worker.cjs");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
137
|
// src/shared/log/functions/resolve-log-level.function.ts
|
|
138
138
|
function resolveLogLevel(cliLevel) {
|
|
139
139
|
if (cliLevel !== void 0) {
|
|
@@ -315,14 +315,14 @@ function getIpcPath(ctx) {
|
|
|
315
315
|
export {
|
|
316
316
|
detectRuntime,
|
|
317
317
|
getArgs,
|
|
318
|
+
parseLogLevel,
|
|
319
|
+
log,
|
|
320
|
+
computeSha256,
|
|
318
321
|
resolveBaseDir,
|
|
319
322
|
isRemoteUrl,
|
|
320
323
|
joinPath,
|
|
321
324
|
resolveWorkerScript,
|
|
322
325
|
resolveWasmDir,
|
|
323
|
-
parseLogLevel,
|
|
324
|
-
log,
|
|
325
|
-
computeSha256,
|
|
326
326
|
getIpcPath,
|
|
327
327
|
resolveLogLevel,
|
|
328
328
|
configureLog,
|
|
@@ -334,4 +334,4 @@ export {
|
|
|
334
334
|
DB_FORMAT_VERSION,
|
|
335
335
|
parseWorkerToml
|
|
336
336
|
};
|
|
337
|
-
//# sourceMappingURL=chunk-
|
|
337
|
+
//# sourceMappingURL=chunk-QLJ33C74.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/runtime/functions/detect-runtime.ts", "../src/shared/runtime/functions/get-args.ts", "../src/shared/log/typings/log-level.type.ts", "../src/shared/log/functions/parse-log-level.function.ts", "../src/shared/log/constants/log-colors.constant.ts", "../src/shared/log/constants/log-icons.constant.ts", "../src/shared/log/constants/log-defaults.constant.ts", "../src/shared/log/functions/write-stderr.function.ts", "../src/shared/log/functions/log.function.ts", "../src/shared/dir-resolver/functions/resolve-base-dir.function.ts", "../src/shared/dir-resolver/functions/join-path.function.ts", "../src/shared/dir-resolver/functions/resolve-wasm-dir.function.ts", "../src/shared/dir-resolver/functions/resolve-worker-script.function.ts", "../src/shared/log/functions/resolve-log-level.function.ts", "../src/shared/log/functions/configure-log.function.ts", "../src/shared/worker-daemon/constants/daemon-defaults.constant.ts", "../src/shared/worker-daemon/functions/parse-embedding-section.function.ts", "../src/shared/auto-capture/constants/auto-capture-defaults.constant.ts", "../src/shared/worker-daemon/functions/parse-auto-capture-section.function.ts", "../src/shared/worker-daemon/functions/parse-worker-toml.function.ts", "../src/shared/hash/functions/compute-sha256.ts", "../src/shared/platform/functions/get-ipc-path.function.ts", "../src/shared/platform/functions/get-tmpdir.function.ts"],
|
|
4
|
+
"sourcesContent": ["// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { Runtime } from '../typings/runtime.ts';\n\n/**\n * Detects the current JavaScript runtime environment.\n *\n * Returns `'deno'` when the global `Deno` object is present,\n * otherwise returns `'node'`.\n */\nexport function detectRuntime(): Runtime {\n if (typeof globalThis !== 'undefined' && 'Deno' in globalThis) {\n return 'deno';\n }\n return 'node';\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { detectRuntime } from './detect-runtime.ts';\n\n/**\n * Returns the command-line arguments for the current runtime.\n *\n * In Deno, reads `Deno.args`; in Node.js, slices `process.argv`\n * past the interpreter and script entries.\n */\nexport function getArgs(): string[] {\n if (detectRuntime() === 'deno') {\n const g = globalThis as Record<string, unknown>;\n const deno = g['Deno'] as { args: string[] } | undefined;\n return deno?.args ?? [];\n }\n return process.argv.slice(2);\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\n/** Verbosity levels, ordered from most to least verbose. */\nexport enum LogLevel {\n DEBUG = 0,\n INFO = 1,\n WARNING = 2,\n ERROR = 3,\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { LogLevel } from '../typings/log-level.type.ts';\n\n/** Map from lowercase level name to LogLevel enum value. */\nconst LOG_LEVEL_MAP: Readonly<Record<string, LogLevel>> = {\n debug: LogLevel.DEBUG,\n info: LogLevel.INFO,\n warning: LogLevel.WARNING,\n error: LogLevel.ERROR,\n};\n\n/**\n * Parses a string into a `LogLevel` enum value.\n *\n * Matching is case-insensitive. Returns `LogLevel.WARNING` for\n * any unrecognized value, including empty strings.\n *\n * @param value - the raw string to parse (e.g. from a CLI flag)\n */\nexport function parseLogLevel(value: string): LogLevel {\n return LOG_LEVEL_MAP[value.toLowerCase()] ?? LogLevel.WARNING;\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { LogLevel } from '../typings/log-level.type.ts';\n\n/** ANSI escape sequence that resets all text formatting. */\nexport const ANSI_RESET = '\\x1b[0m';\n\n/** ANSI foreground color code applied to each log level's output. */\nexport const LOG_COLORS: Record<LogLevel, string> = {\n [LogLevel.DEBUG]: '\\x1b[37m',\n [LogLevel.INFO]: '\\x1b[36m',\n [LogLevel.WARNING]: '\\x1b[33m',\n [LogLevel.ERROR]: '\\x1b[91m',\n};\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { LogLevel } from '../typings/log-level.type.ts';\n\n/** Single-character icon used as visual prefix for each log level. */\nexport const LOG_ICONS: Record<LogLevel, string> = {\n [LogLevel.DEBUG]: '\u25B8',\n [LogLevel.INFO]: '\u2139',\n [LogLevel.WARNING]: '\u26A0',\n [LogLevel.ERROR]: '\u2716',\n};\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { LogLevel } from '../typings/log-level.type.ts';\n\n/** Default log level used when no CLI flag or env var is set. */\nexport const DEFAULT_LOG_LEVEL = LogLevel.ERROR;\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\n/**\n * Writes a string to the process standard error stream.\n *\n * Works on both Node.js (via `process.stderr.write`) and Deno\n * (via `Deno.stderr.writeSync`). Silently does nothing when\n * neither runtime API is available.\n *\n * @param message - the string to write to stderr\n */\nexport function writeStderr(message: string): void {\n const g = globalThis as Record<string, unknown>;\n const proc = g['process'] as\n | { stderr: { write: (s: string) => void } }\n | undefined;\n if (proc?.stderr) {\n proc.stderr.write(message);\n return;\n }\n const deno = g['Deno'] as\n | { stderr: { writeSync: (b: Uint8Array) => void } }\n | undefined;\n deno?.stderr.writeSync(new TextEncoder().encode(message));\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport {\n ANSI_RESET,\n LOG_COLORS,\n} from '../constants/log-colors.constant.ts';\nimport { LOG_ICONS } from '../constants/log-icons.constant.ts';\nimport { DEFAULT_LOG_LEVEL } from '../constants/log-defaults.constant.ts';\nimport { LogLevel } from '../typings/log-level.type.ts';\nimport { writeStderr } from './write-stderr.function.ts';\n\n/** A function that receives a formatted log line. */\ntype OutputFn = (message: string) => void;\n\nlet currentLevel: LogLevel = DEFAULT_LOG_LEVEL;\n\nconst outputs: Record<LogLevel, OutputFn> = {\n [LogLevel.DEBUG]: writeStderr,\n [LogLevel.INFO]: writeStderr,\n [LogLevel.WARNING]: writeStderr,\n [LogLevel.ERROR]: writeStderr,\n};\n\n/**\n * Sets the minimum log level. Messages below this level are\n * suppressed. Used internally by `configureLog`.\n */\nexport function setLogLevel(level: LogLevel): void {\n currentLevel = level;\n}\n\n/**\n * Overrides the output function for a specific log level.\n * Used internally by `configureLog`.\n *\n * @param level - the log level whose output to replace\n * @param output - function that receives the formatted message\n */\nexport function setLogOutput(level: LogLevel, output: OutputFn): void {\n outputs[level] = output;\n}\n\n/**\n * Writes a formatted, colorized log message to the configured\n * output for the given level. Messages below the current level\n * are silently discarded.\n *\n * Format: `\\x1b[COLORm ICON [LEVEL_NAME] message\\x1b[0m\\n`\n *\n * @param message - the text to log\n * @param level - severity level; defaults to `LogLevel.ERROR`\n */\nexport function log(\n message: string,\n level: LogLevel = LogLevel.ERROR,\n): void {\n if (level < currentLevel) {\n return;\n }\n const color = LOG_COLORS[level];\n const icon = LOG_ICONS[level];\n const name = LogLevel[level];\n const line = `${color}${icon} [${name}] ${message}${ANSI_RESET}\\n`;\n outputs[level](line);\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { BaseDir } from '../typings/base-dir.interface.ts';\n\nexport function resolveScriptDir(\n entryUrl: string,\n entryDirname?: string,\n): string {\n if (entryDirname) return entryDirname;\n if (entryUrl.startsWith('file:'))\n return dirname(fileURLToPath(entryUrl));\n return dirname(entryUrl);\n}\n\nexport function resolveBaseDir(\n entryUrl: string,\n entryDirname?: string,\n): BaseDir {\n const scriptDir =\n typeof __dirname !== 'undefined'\n ? __dirname\n : resolveScriptDir(entryUrl, entryDirname);\n return { scriptDir, cwd: process.cwd() };\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { join } from 'node:path';\n\nexport function isRemoteUrl(path: string): boolean {\n return path.startsWith('http://') || path.startsWith('https://');\n}\n\nexport function joinPath(base: string, ...segments: string[]): string {\n if (isRemoteUrl(base)) {\n const trailing = base.endsWith('/') ? '' : '/';\n return base + trailing + segments.join('/');\n }\n return join(base, ...segments);\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { joinPath } from './join-path.function.ts';\n\nexport function resolveWasmDir(scriptDir: string): string {\n return joinPath(scriptDir, 'wasm');\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { joinPath } from './join-path.function.ts';\n\nimport type { Runtime } from '../../runtime/typings/runtime.ts';\n\nexport function resolveWorkerScript(\n scriptDir: string,\n runtime: Runtime,\n): string {\n if (runtime === 'deno') {\n return joinPath(scriptDir, 'worker.ts');\n }\n return joinPath(scriptDir, 'kbdb-worker.cjs');\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { LogLevel } from '../typings/log-level.type.ts';\nimport { DEFAULT_LOG_LEVEL } from '../constants/log-defaults.constant.ts';\nimport { parseLogLevel } from './parse-log-level.function.ts';\n\n/**\n * Resolves the active log level from CLI flags or the environment.\n *\n * Priority order:\n * 1. `cliLevel` when provided (CLI flag takes highest priority)\n * 2. `KBDB_LOG_LEVEL` environment variable, parsed via `parseLogLevel`\n * 3. `DEFAULT_LOG_LEVEL` (`LogLevel.ERROR`) when neither is set\n *\n * @param cliLevel - explicit level passed from a CLI flag, if any\n */\nexport function resolveLogLevel(cliLevel?: LogLevel): LogLevel {\n if (cliLevel !== undefined) {\n return cliLevel;\n }\n const envValue = process.env['KBDB_LOG_LEVEL'];\n if (envValue !== undefined) {\n return parseLogLevel(envValue);\n }\n return DEFAULT_LOG_LEVEL;\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { LogConfig } from '../typings/log-config.interface.ts';\nimport { LogLevel } from '../typings/log-level.type.ts';\nimport { setLogLevel, setLogOutput } from './log.function.ts';\n\n/**\n * Applies a log configuration, setting the active log level and\n * optionally overriding the output target for individual levels.\n *\n * Only levels listed in `config.outputs` are affected; all other\n * level outputs remain unchanged. Calling this function multiple\n * times is safe -- the last call's settings take effect.\n *\n * @param config - desired log level and optional per-level outputs\n */\nexport function configureLog(config: LogConfig): void {\n setLogLevel(config.level);\n if (config.outputs === undefined) {\n return;\n }\n const levels: LogLevel[] = [\n LogLevel.DEBUG,\n LogLevel.INFO,\n LogLevel.WARNING,\n LogLevel.ERROR,\n ];\n for (const level of levels) {\n const output = config.outputs[level];\n if (output !== undefined) {\n setLogOutput(level, output.write);\n }\n }\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\n/** Default maximum number of items held in daemon memory. */\nexport const DEFAULT_ITEM_LIMIT = 1000;\n\n/** Default maximum number of index entries held in daemon memory. */\nexport const DEFAULT_INDEX_LIMIT = 100;\n\n/**\n * Default idle timeout in milliseconds before the daemon shuts\n * down automatically (5 minutes).\n */\nexport const DEFAULT_TIMEOUT_MS = 300_000;\n\n/**\n * Default time-to-live in milliseconds for each cached item\n * (1 minute).\n */\nexport const DEFAULT_ITEM_TTL_MS = 60_000;\n\n/** Filename of the daemon configuration file inside `.kbdb/`. */\nexport const WORKER_TOML_FILENAME = 'worker.toml';\n\n/**\n * Database format version the daemon supports.\n *\n * Read from `catalog.toml` at startup. If the catalog version\n * differs, the daemon prints a structured error to stderr and\n * exits with code 1 before loading any WASM modules.\n */\nexport const DB_FORMAT_VERSION = 1;\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { EmbeddingConfig } from '../../embedding/typings/embedding-config.interface.ts';\n\n/**\n * Parses key-value pairs from a `[embedding]` TOML section into an\n * `EmbeddingConfig`.\n *\n * Recognises: `provider`, `model`, `endpoint`, `dimensions`.\n * Unknown keys are silently ignored. Returns `undefined` when the\n * `provider` key is absent from the supplied entries.\n *\n * @param entries - key-value pairs from inside the `[embedding]`\n * section\n */\nexport function parseEmbeddingSection(\n entries: ReadonlyMap<string, string>,\n): EmbeddingConfig | undefined {\n const provider = entries.get('provider') as\n | EmbeddingConfig['provider']\n | undefined;\n\n if (!provider) {\n return undefined;\n }\n\n const model = entries.get('model');\n const endpoint = entries.get('endpoint');\n const dimensionsRaw = entries.get('dimensions');\n const dimensions = dimensionsRaw\n ? parseInt(dimensionsRaw, 10) || undefined\n : undefined;\n\n return {\n provider,\n ...(model !== undefined ? { model } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(dimensions !== undefined ? { dimensions } : {}),\n };\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { AutoCaptureConfig } from '../typings/auto-capture-config.interface.ts';\n\n/**\n * Default configuration for the auto-capture feature.\n *\n * Auto-capture is disabled by default. Enable it in\n * `worker.toml` under `[auto_capture]`.\n */\nexport const AUTO_CAPTURE_DEFAULTS: AutoCaptureConfig = {\n enabled: false,\n triggerAfterToolCalls: 5,\n minIntervalMs: 60_000,\n maxCapturesPerSession: 10,\n dryRun: false,\n};\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { AutoCaptureConfig } from '../../auto-capture/typings/auto-capture-config.interface.ts';\nimport { AUTO_CAPTURE_DEFAULTS } from '../../auto-capture/constants/auto-capture-defaults.constant.ts';\n\n/**\n * Parses key-value pairs from an `[auto_capture]` TOML section\n * into an `AutoCaptureConfig`.\n *\n * Recognised keys: `enabled`, `trigger_after_tool_calls`,\n * `min_interval_ms`, `max_captures_per_session`, `dry_run`.\n * Unknown keys are silently ignored. Falls back to\n * `AUTO_CAPTURE_DEFAULTS` for any absent key.\n *\n * @param entries - key-value pairs from inside the\n * `[auto_capture]` section\n */\nexport function parseAutoCaptureSection(\n entries: ReadonlyMap<string, string>,\n): AutoCaptureConfig {\n const enabled = entries.has('enabled')\n ? entries.get('enabled') === 'true'\n : AUTO_CAPTURE_DEFAULTS.enabled;\n\n const dryRun = entries.has('dry_run')\n ? entries.get('dry_run') === 'true'\n : AUTO_CAPTURE_DEFAULTS.dryRun;\n\n const triggerRaw = entries.get('trigger_after_tool_calls');\n const triggerAfterToolCalls = triggerRaw\n ? parseInt(triggerRaw, 10) ||\n AUTO_CAPTURE_DEFAULTS.triggerAfterToolCalls\n : AUTO_CAPTURE_DEFAULTS.triggerAfterToolCalls;\n\n const intervalRaw = entries.get('min_interval_ms');\n const minIntervalMs = intervalRaw\n ? parseInt(intervalRaw, 10) || AUTO_CAPTURE_DEFAULTS.minIntervalMs\n : AUTO_CAPTURE_DEFAULTS.minIntervalMs;\n\n const capRaw = entries.get('max_captures_per_session');\n const maxCapturesPerSession = capRaw\n ? parseInt(capRaw, 10) ||\n AUTO_CAPTURE_DEFAULTS.maxCapturesPerSession\n : AUTO_CAPTURE_DEFAULTS.maxCapturesPerSession;\n\n return {\n enabled,\n triggerAfterToolCalls,\n minIntervalMs,\n maxCapturesPerSession,\n dryRun,\n };\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport type { DaemonConfig } from '../typings/daemon-config.interface.ts';\nimport {\n DEFAULT_ITEM_LIMIT,\n DEFAULT_INDEX_LIMIT,\n DEFAULT_TIMEOUT_MS,\n DEFAULT_ITEM_TTL_MS,\n} from '../constants/daemon-defaults.constant.ts';\nimport { parseEmbeddingSection } from './parse-embedding-section.function.ts';\nimport { parseAutoCaptureSection } from './parse-auto-capture-section.function.ts';\n\ninterface RootAccum {\n itemLimit: number;\n indexLimit: number;\n timeoutMs: number;\n itemTtlMs: number;\n}\n\nfunction applyRootKey(\n acc: RootAccum,\n key: string,\n value: string,\n): void {\n switch (key) {\n case 'item_limit':\n acc.itemLimit = parseInt(value, 10) || DEFAULT_ITEM_LIMIT;\n break;\n case 'index_limit':\n acc.indexLimit = parseInt(value, 10) || DEFAULT_INDEX_LIMIT;\n break;\n case 'timeout_ms':\n acc.timeoutMs = parseInt(value, 10) || DEFAULT_TIMEOUT_MS;\n break;\n case 'item_ttl_ms':\n acc.itemTtlMs = parseInt(value, 10) || DEFAULT_ITEM_TTL_MS;\n break;\n default:\n break;\n }\n}\n\n/**\n * Parses a `worker.toml` file body into a partial `DaemonConfig`.\n *\n * Handles `[embedding]` sub-sections and root key-value pairs.\n * Unknown keys are silently ignored.\n *\n * @param text - raw content of `worker.toml`\n * @param contextPath - daemon context directory path\n */\nexport function parseWorkerToml(\n text: string,\n contextPath: string,\n): DaemonConfig {\n let section = '';\n const embeddingEntries = new Map<string, string>();\n const autoCaptureEntries = new Map<string, string>();\n const acc: RootAccum = {\n itemLimit: DEFAULT_ITEM_LIMIT,\n indexLimit: DEFAULT_INDEX_LIMIT,\n timeoutMs: DEFAULT_TIMEOUT_MS,\n itemTtlMs: DEFAULT_ITEM_TTL_MS,\n };\n\n for (const line of text.split('\\n')) {\n const trimmed = line.trim();\n if (trimmed === '[embedding]') {\n section = 'embedding';\n continue;\n }\n if (trimmed === '[auto_capture]') {\n section = 'auto_capture';\n continue;\n }\n if (trimmed.startsWith('[')) {\n section = '';\n continue;\n }\n if (trimmed.startsWith('#') || !trimmed.includes('=')) continue;\n const eqIdx = trimmed.indexOf('=');\n const key = trimmed.slice(0, eqIdx).trim();\n const value = trimmed.slice(eqIdx + 1).trim();\n if (section === 'embedding') {\n embeddingEntries.set(key, value);\n continue;\n }\n if (section === 'auto_capture') {\n autoCaptureEntries.set(key, value);\n continue;\n }\n applyRootKey(acc, key, value);\n }\n\n const embedding = parseEmbeddingSection(embeddingEntries);\n const autoCapture =\n autoCaptureEntries.size > 0\n ? parseAutoCaptureSection(autoCaptureEntries)\n : undefined;\n return {\n contextPath,\n ...acc,\n ...(embedding !== undefined ? { embedding } : {}),\n ...(autoCapture !== undefined ? { autoCapture } : {}),\n };\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\n/**\n * Computes the SHA-256 hash of a UTF-8 string.\n *\n * Uses the Web Crypto API (`crypto.subtle`), which is available\n * in both Deno and Node.js >= 20 without additional imports.\n *\n * @param input - the string to hash\n * @returns lowercase hex-encoded SHA-256 digest (64 characters)\n */\nexport async function computeSha256(input: string): Promise<string> {\n const data = new TextEncoder().encode(input);\n const hash = await crypto.subtle.digest('SHA-256', data);\n const bytes = new Uint8Array(hash);\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('');\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { join } from 'node:path';\nimport { getTmpdir } from './get-tmpdir.function.ts';\n\n/**\n * Returns the platform-appropriate IPC socket path for a given\n * context identifier.\n *\n * On Windows, returns a named pipe path (`\\\\.\\pipe\\kbdb-<ctx>`).\n * On POSIX systems, returns a Unix domain socket path under the\n * system temp directory (`<tmpdir>/kbdb-<ctx>.sock`).\n *\n * @param ctx - unique context identifier embedded in the path\n */\nexport function getIpcPath(ctx: string): string {\n if (process.platform === 'win32') {\n return `\\\\\\\\.\\\\pipe\\\\kbdb-${ctx}`;\n }\n return join(getTmpdir(), `kbdb-${ctx}.sock`);\n}\n", "// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright (C) 2026 Diko Tech Slave\n\nimport { tmpdir } from 'node:os';\n\n/**\n * Returns the operating system's default temporary directory path.\n */\nexport function getTmpdir(): string {\n return tmpdir();\n}\n"],
|
|
5
|
+
"mappings": ";AAWO,SAAS,gBAAyB;AACtC,MAAI,OAAO,eAAe,eAAe,UAAU,YAAY;AAC5D,WAAO;AAAA,EACV;AACA,SAAO;AACV;;;ACLO,SAAS,UAAoB;AACjC,MAAI,cAAc,MAAM,QAAQ;AAC7B,UAAM,IAAI;AACV,UAAM,OAAO,EAAE,MAAM;AACrB,WAAO,MAAM,QAAQ,CAAC;AAAA,EACzB;AACA,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC9B;;;ACdO,IAAK,WAAL,kBAAKA,cAAL;AACJ,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,aAAU,KAAV;AACA,EAAAA,oBAAA,WAAQ,KAAR;AAJS,SAAAA;AAAA,GAAA;;;ACEZ,IAAM,gBAAoD;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACH;AAUO,SAAS,cAAc,OAAyB;AACpD,SAAO,cAAc,MAAM,YAAY,CAAC;AAC3C;;;ACjBO,IAAM,aAAa;AAGnB,IAAM,aAAuC;AAAA,EACjD,cAAe,GAAG;AAAA,EAClB,aAAc,GAAG;AAAA,EACjB,gBAAiB,GAAG;AAAA,EACpB,cAAe,GAAG;AACrB;;;ACRO,IAAM,YAAsC;AAAA,EAChD,cAAe,GAAG;AAAA,EAClB,aAAc,GAAG;AAAA,EACjB,gBAA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