@dikolab/kbdb 0.5.0 → 0.6.1
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 +50 -25
- package/README.md.bak +322 -0
- package/dist/README.md +322 -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 +11 -10
- 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
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
# worker-client/typings -- IPC Type Definitions
|
|
2
|
-
|
|
3
|
-
*Interfaces, type aliases, and error types for
|
|
4
|
-
worker-client IPC communication.*
|
|
5
|
-
|
|
6
|
-
## Source
|
|
7
|
-
|
|
8
|
-
`src/shared/worker-client/typings/`
|
|
9
|
-
|
|
10
|
-
## Typings
|
|
11
|
-
|
|
12
|
-
### `WorkerClientOptions`
|
|
13
|
-
|
|
14
|
-
**File:** `worker-client-options.interface.ts`
|
|
15
|
-
|
|
16
|
-
Options for configuring a `WorkerClient` connection.
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
interface WorkerClientOptions {
|
|
20
|
-
readonly dbPath?: string;
|
|
21
|
-
readonly contextPath?: string;
|
|
22
|
-
readonly autoSpawn?: boolean;
|
|
23
|
-
readonly connectTimeoutMs?: number;
|
|
24
|
-
readonly workerScript?: string;
|
|
25
|
-
readonly requestTimeoutMs?: number;
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
| Property | Description |
|
|
30
|
-
|--------------------|-----------------------------------|
|
|
31
|
-
| `dbPath` | Path to the directory containing |
|
|
32
|
-
| | the `.kbdb` folder; falls back to |
|
|
33
|
-
| | `process.cwd()` when omitted |
|
|
34
|
-
| `contextPath` | Absolute path to the context dir; |
|
|
35
|
-
| | skips `.kbdb` discovery when set |
|
|
36
|
-
| `autoSpawn` | Auto-spawns the daemon if needed; |
|
|
37
|
-
| | defaults to `true` |
|
|
38
|
-
| `connectTimeoutMs` | Max ms to wait for the PID file |
|
|
39
|
-
| | after spawning; defaults to 10000 |
|
|
40
|
-
| `workerScript` | Absolute path to the worker |
|
|
41
|
-
| | daemon script |
|
|
42
|
-
| `requestTimeoutMs` | Per-request timeout; default |
|
|
43
|
-
| | 30 000 ms |
|
|
44
|
-
|
|
45
|
-
### `SearchParams`
|
|
46
|
-
|
|
47
|
-
**File:** `search-params.model.ts`
|
|
48
|
-
|
|
49
|
-
Parameters for `WorkerClient.search()`.
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
interface SearchParams {
|
|
53
|
-
readonly query: string;
|
|
54
|
-
readonly mode?: 'sections' | 'documents' | 'stats';
|
|
55
|
-
readonly limit?: number;
|
|
56
|
-
readonly content?: boolean;
|
|
57
|
-
readonly offset?: number;
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
| Property | Description |
|
|
62
|
-
|-----------|---------------------------------|
|
|
63
|
-
| `query` | Search query string |
|
|
64
|
-
| `mode` | Result shape selector |
|
|
65
|
-
| `limit` | Max results (optional) |
|
|
66
|
-
| `content` | Include full section content in |
|
|
67
|
-
| | each result when `true` |
|
|
68
|
-
| `offset` | Zero-based result offset for |
|
|
69
|
-
| | pagination |
|
|
70
|
-
|
|
71
|
-
### `SearchResult`
|
|
72
|
-
|
|
73
|
-
**File:** `search-result.model.ts`
|
|
74
|
-
|
|
75
|
-
A single ranked result returned by a search query.
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
interface SearchResult {
|
|
79
|
-
readonly kbid: string;
|
|
80
|
-
readonly heading: string | null;
|
|
81
|
-
readonly type: string;
|
|
82
|
-
readonly docids: readonly string[];
|
|
83
|
-
readonly score: number;
|
|
84
|
-
readonly snippet: string;
|
|
85
|
-
readonly matched_terms: readonly string[];
|
|
86
|
-
readonly content?: string;
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
| Property | Description |
|
|
91
|
-
|-----------------|-------------------------------------|
|
|
92
|
-
| `kbid` | Knowledge-base identifier for the |
|
|
93
|
-
| | matched section |
|
|
94
|
-
| `heading` | Section heading, or `null` when not |
|
|
95
|
-
| | present |
|
|
96
|
-
| `type` | Semantic section type label |
|
|
97
|
-
| `docids` | Parent document IDs for the section |
|
|
98
|
-
| `score` | Relevance score from ranking engine |
|
|
99
|
-
| `snippet` | Short excerpt highlighting matched |
|
|
100
|
-
| | terms |
|
|
101
|
-
| `matched_terms` | Terms from the query that matched |
|
|
102
|
-
| | this section |
|
|
103
|
-
| `content` | Full section content; present only |
|
|
104
|
-
| | when `SearchParams.content` is true |
|
|
105
|
-
|
|
106
|
-
### `PagedSearchResult`
|
|
107
|
-
|
|
108
|
-
**File:** `paged-search-result.model.ts`
|
|
109
|
-
|
|
110
|
-
Paginated container returned by `WorkerClient.search()`.
|
|
111
|
-
|
|
112
|
-
```ts
|
|
113
|
-
interface PagedSearchResult {
|
|
114
|
-
readonly items: readonly SearchResult[];
|
|
115
|
-
readonly total: number;
|
|
116
|
-
readonly offset: number;
|
|
117
|
-
readonly limit: number;
|
|
118
|
-
readonly has_more: boolean;
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
| Property | Description |
|
|
123
|
-
|------------|--------------------------------------|
|
|
124
|
-
| `items` | Ranked search results for this page |
|
|
125
|
-
| `total` | Total matching sections across all |
|
|
126
|
-
| | pages |
|
|
127
|
-
| `offset` | Zero-based offset of this page |
|
|
128
|
-
| `limit` | Page size used for this query |
|
|
129
|
-
| `has_more` | `true` when results beyond this page |
|
|
130
|
-
| | exist
|
|
131
|
-
|
|
132
|
-
### `RecallParams`
|
|
133
|
-
|
|
134
|
-
**File:** `recall-params.model.ts`
|
|
135
|
-
|
|
136
|
-
Parameters for `WorkerClient.recall()`.
|
|
137
|
-
|
|
138
|
-
```ts
|
|
139
|
-
interface RecallParams {
|
|
140
|
-
readonly kbid?: string;
|
|
141
|
-
readonly kbids?: readonly string[];
|
|
142
|
-
readonly depth?: number;
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
| Property | Description |
|
|
147
|
-
|----------|--------------------------------------|
|
|
148
|
-
| `kbid` | Single section identifier to recall |
|
|
149
|
-
| `kbids` | Batch of section identifiers; cannot |
|
|
150
|
-
| | be used together with `kbid` |
|
|
151
|
-
| `depth` | Expansion depth: `0` = content only, |
|
|
152
|
-
| | `1` = include siblings, `2` = add |
|
|
153
|
-
| | references, `3` = add parent |
|
|
154
|
-
| | document manifests; clamped to 0--3 |
|
|
155
|
-
|
|
156
|
-
### `RecallResult`
|
|
157
|
-
|
|
158
|
-
**File:** `recall-result.model.ts`
|
|
159
|
-
|
|
160
|
-
A single section result from a recall operation,
|
|
161
|
-
optionally enriched with contextual data.
|
|
162
|
-
|
|
163
|
-
```ts
|
|
164
|
-
interface RecallResult {
|
|
165
|
-
readonly kbid: string;
|
|
166
|
-
readonly heading: string | null;
|
|
167
|
-
readonly type: string;
|
|
168
|
-
readonly content: string;
|
|
169
|
-
readonly docids: readonly string[];
|
|
170
|
-
readonly documents?: readonly RecallDocument[];
|
|
171
|
-
readonly back_references?: readonly RecallReference[];
|
|
172
|
-
readonly siblings?: readonly RecallSibling[];
|
|
173
|
-
readonly references?: readonly RecallReference[];
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
| Property | Description |
|
|
178
|
-
|-------------------|-------------------------------------|
|
|
179
|
-
| `kbid` | Knowledge-base identifier |
|
|
180
|
-
| `heading` | Section heading, or `null` |
|
|
181
|
-
| `type` | Semantic section type label |
|
|
182
|
-
| `content` | Full text content of the section |
|
|
183
|
-
| `docids` | Parent document IDs |
|
|
184
|
-
| `documents` | Parent document manifests; present |
|
|
185
|
-
| | at `depth >= 3` |
|
|
186
|
-
| `back_references` | Sections that reference this one; |
|
|
187
|
-
| | present at `depth >= 2` |
|
|
188
|
-
| `siblings` | Adjacent sections in the same |
|
|
189
|
-
| | document; present at `depth >= 1` |
|
|
190
|
-
| `references` | Forward references from this |
|
|
191
|
-
| | section; present at `depth >= 2` |
|
|
192
|
-
|
|
193
|
-
### `RecallDocument`
|
|
194
|
-
|
|
195
|
-
**File:** `recall-result.model.ts`
|
|
196
|
-
|
|
197
|
-
Parent document manifest included in a `RecallResult`
|
|
198
|
-
at `depth >= 3`.
|
|
199
|
-
|
|
200
|
-
```ts
|
|
201
|
-
interface RecallDocument {
|
|
202
|
-
readonly docid: string;
|
|
203
|
-
readonly title: string;
|
|
204
|
-
readonly sections: readonly {
|
|
205
|
-
readonly kbid: string;
|
|
206
|
-
readonly heading: string | null;
|
|
207
|
-
readonly type: string;
|
|
208
|
-
}[];
|
|
209
|
-
}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
| Property | Description |
|
|
213
|
-
|------------|----------------------------------------|
|
|
214
|
-
| `docid` | Document identifier |
|
|
215
|
-
| `title` | Document title |
|
|
216
|
-
| `sections` | Ordered list of section stubs in the |
|
|
217
|
-
| | document |
|
|
218
|
-
|
|
219
|
-
### `RecallSibling`
|
|
220
|
-
|
|
221
|
-
**File:** `recall-result.model.ts`
|
|
222
|
-
|
|
223
|
-
An adjacent section in the same document, returned
|
|
224
|
-
at `depth >= 1`.
|
|
225
|
-
|
|
226
|
-
```ts
|
|
227
|
-
interface RecallSibling {
|
|
228
|
-
readonly kbid: string;
|
|
229
|
-
readonly heading: string | null;
|
|
230
|
-
readonly type: string;
|
|
231
|
-
readonly content: string;
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
| Property | Description |
|
|
236
|
-
|-----------|-----------------------------------|
|
|
237
|
-
| `kbid` | Knowledge-base identifier |
|
|
238
|
-
| `heading` | Section heading, or `null` |
|
|
239
|
-
| `type` | Semantic section type label |
|
|
240
|
-
| `content` | Full text content of the sibling |
|
|
241
|
-
|
|
242
|
-
### `RecallReference`
|
|
243
|
-
|
|
244
|
-
**File:** `recall-result.model.ts`
|
|
245
|
-
|
|
246
|
-
A forward or back reference between sections,
|
|
247
|
-
returned at `depth >= 2`.
|
|
248
|
-
|
|
249
|
-
```ts
|
|
250
|
-
interface RecallReference {
|
|
251
|
-
readonly kbid: string;
|
|
252
|
-
readonly heading: string | null;
|
|
253
|
-
readonly type: string;
|
|
254
|
-
readonly marker_type: string;
|
|
255
|
-
readonly context_snippet: string;
|
|
256
|
-
readonly direction: 'forward' | 'back';
|
|
257
|
-
}
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
| Property | Description |
|
|
261
|
-
|-------------------|-----------------------------------|
|
|
262
|
-
| `kbid` | Knowledge-base identifier of the |
|
|
263
|
-
| | referenced section |
|
|
264
|
-
| `heading` | Section heading, or `null` |
|
|
265
|
-
| `type` | Semantic section type label |
|
|
266
|
-
| `marker_type` | Type of the link marker |
|
|
267
|
-
| `context_snippet` | Short excerpt around the marker |
|
|
268
|
-
| `direction` | `'forward'` when this section |
|
|
269
|
-
| | references the target; `'back'` |
|
|
270
|
-
| | when the target references this |
|
|
271
|
-
| | section |
|
|
272
|
-
|
|
273
|
-
### `Section`
|
|
274
|
-
|
|
275
|
-
**File:** `section.model.ts`
|
|
276
|
-
|
|
277
|
-
A content section stored in the knowledge base.
|
|
278
|
-
|
|
279
|
-
```ts
|
|
280
|
-
interface Section {
|
|
281
|
-
readonly kbid: string;
|
|
282
|
-
readonly docid?: string;
|
|
283
|
-
readonly sectionType: string;
|
|
284
|
-
readonly content: string;
|
|
285
|
-
readonly size: number;
|
|
286
|
-
readonly createdAt: number;
|
|
287
|
-
readonly checksum: string;
|
|
288
|
-
}
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
| Property | Description |
|
|
292
|
-
|---------------|-----------------------------------|
|
|
293
|
-
| `kbid` | Knowledge-base identifier |
|
|
294
|
-
| `docid` | Parent document ID (optional) |
|
|
295
|
-
| `sectionType` | Semantic type label |
|
|
296
|
-
| `content` | Raw text content |
|
|
297
|
-
| `size` | Byte size of stored content |
|
|
298
|
-
| `createdAt` | Unix epoch timestamp (ms) |
|
|
299
|
-
| `checksum` | SHA-256 checksum of content |
|
|
300
|
-
|
|
301
|
-
### `AddSectionParams`
|
|
302
|
-
|
|
303
|
-
**File:** `section.model.ts`
|
|
304
|
-
|
|
305
|
-
Parameters required to add or update a section.
|
|
306
|
-
|
|
307
|
-
```ts
|
|
308
|
-
interface AddSectionParams {
|
|
309
|
-
readonly sectionType: string;
|
|
310
|
-
readonly content: string;
|
|
311
|
-
readonly docid?: string;
|
|
312
|
-
}
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### `AddSectionResult`
|
|
316
|
-
|
|
317
|
-
**File:** `add-section-result.model.ts`
|
|
318
|
-
|
|
319
|
-
Result returned by the daemon after adding a new
|
|
320
|
-
section.
|
|
321
|
-
|
|
322
|
-
```ts
|
|
323
|
-
interface AddSectionResult {
|
|
324
|
-
readonly kbid: string;
|
|
325
|
-
readonly type: string;
|
|
326
|
-
readonly title?: string;
|
|
327
|
-
readonly description?: string;
|
|
328
|
-
readonly token_count: number;
|
|
329
|
-
readonly indexed_terms_count: number;
|
|
330
|
-
readonly elapsed_ms: number;
|
|
331
|
-
readonly attached: boolean;
|
|
332
|
-
}
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
`attached` is `true` when content already existed and
|
|
336
|
-
the provided `docid` was added to the existing
|
|
337
|
-
section's `docids` list.
|
|
338
|
-
|
|
339
|
-
### `RemoveSectionResult`
|
|
340
|
-
|
|
341
|
-
**File:** `remove-section-result.model.ts`
|
|
342
|
-
|
|
343
|
-
```ts
|
|
344
|
-
interface RemoveSectionResult {
|
|
345
|
-
readonly removed: boolean;
|
|
346
|
-
readonly elapsed_ms: number;
|
|
347
|
-
}
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
### `ContentResult`
|
|
351
|
-
|
|
352
|
-
**File:** `content-result.model.ts`
|
|
353
|
-
|
|
354
|
-
Result of a content composition operation.
|
|
355
|
-
|
|
356
|
-
```ts
|
|
357
|
-
interface ContentResult {
|
|
358
|
-
readonly type: 'text/markdown';
|
|
359
|
-
readonly data: string;
|
|
360
|
-
readonly total: number;
|
|
361
|
-
}
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
| Property | Description |
|
|
365
|
-
|----------|---------------------------------|
|
|
366
|
-
| `type` | Always `'text/markdown'` |
|
|
367
|
-
| `data` | Composed Markdown string |
|
|
368
|
-
| `total` | Character count of `data` |
|
|
369
|
-
|
|
370
|
-
### `StatusResult`
|
|
371
|
-
|
|
372
|
-
**File:** `status-result.model.ts`
|
|
373
|
-
|
|
374
|
-
Diagnostic status returned by the worker daemon.
|
|
375
|
-
|
|
376
|
-
```ts
|
|
377
|
-
interface StatusResult {
|
|
378
|
-
readonly initialized: boolean;
|
|
379
|
-
readonly contextPath: string;
|
|
380
|
-
readonly cacheStats: {
|
|
381
|
-
readonly contentCount: number;
|
|
382
|
-
readonly indexCount: number;
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
### `DaemonInfo`
|
|
388
|
-
|
|
389
|
-
**File:** `daemon-info.model.ts`
|
|
390
|
-
|
|
391
|
-
Location information for a running worker daemon
|
|
392
|
-
process.
|
|
393
|
-
|
|
394
|
-
```ts
|
|
395
|
-
interface DaemonInfo {
|
|
396
|
-
readonly pid: number;
|
|
397
|
-
readonly socketPath: string;
|
|
398
|
-
}
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
### `VersionCompatibility`
|
|
402
|
-
|
|
403
|
-
**File:** `version-status.model.ts`
|
|
404
|
-
|
|
405
|
-
Compatibility status categories returned by a database
|
|
406
|
-
version check.
|
|
407
|
-
|
|
408
|
-
```ts
|
|
409
|
-
type VersionCompatibility =
|
|
410
|
-
| 'compatible'
|
|
411
|
-
| 'needs_migration'
|
|
412
|
-
| 'too_new';
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
### `VersionStatus`
|
|
416
|
-
|
|
417
|
-
**File:** `version-status.model.ts`
|
|
418
|
-
|
|
419
|
-
Version compatibility status returned by
|
|
420
|
-
`WorkerClient.checkVersion()`.
|
|
421
|
-
|
|
422
|
-
```ts
|
|
423
|
-
interface VersionStatus {
|
|
424
|
-
readonly currentVersion: number;
|
|
425
|
-
readonly requiredVersion: number;
|
|
426
|
-
readonly status: VersionCompatibility;
|
|
427
|
-
}
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
### `MigrateResult`
|
|
431
|
-
|
|
432
|
-
**File:** `migrate-result.model.ts`
|
|
433
|
-
|
|
434
|
-
Report returned by the daemon after running database
|
|
435
|
-
migrations.
|
|
436
|
-
|
|
437
|
-
```ts
|
|
438
|
-
interface MigrateResult {
|
|
439
|
-
readonly oldVersion: number;
|
|
440
|
-
readonly newVersion: number;
|
|
441
|
-
readonly migrationsRun: number;
|
|
442
|
-
}
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
### `IntegrityCheckResult`
|
|
446
|
-
|
|
447
|
-
**File:** `integrity-check-result.model.ts`
|
|
448
|
-
|
|
449
|
-
Result of `WorkerClient.integrityCheck()`.
|
|
450
|
-
|
|
451
|
-
```ts
|
|
452
|
-
interface IntegrityCheckResult {
|
|
453
|
-
readonly ok: boolean;
|
|
454
|
-
readonly errors: IntegrityError[];
|
|
455
|
-
readonly sections_checked: number;
|
|
456
|
-
readonly documents_checked: number;
|
|
457
|
-
readonly references_checked: number;
|
|
458
|
-
readonly elapsed_ms: number;
|
|
459
|
-
}
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
`IntegrityError.type` values: `checksum_mismatch`,
|
|
463
|
-
`orphan_section`, `orphan_document`,
|
|
464
|
-
`broken_reference`, `type_mismatch`,
|
|
465
|
-
`circular_reference`.
|
|
466
|
-
|
|
467
|
-
### `GcResult`
|
|
468
|
-
|
|
469
|
-
**File:** `gc-result.model.ts`
|
|
470
|
-
|
|
471
|
-
Result of `WorkerClient.gc()`.
|
|
472
|
-
|
|
473
|
-
```ts
|
|
474
|
-
interface GcResult {
|
|
475
|
-
readonly removed_sections: number;
|
|
476
|
-
readonly removed_bytes: number;
|
|
477
|
-
readonly elapsed_ms: number;
|
|
478
|
-
}
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
### `RebuildResult`
|
|
482
|
-
|
|
483
|
-
**File:** `rebuild-result.model.ts`
|
|
484
|
-
|
|
485
|
-
Result of `WorkerClient.rebuildIndexes()`.
|
|
486
|
-
|
|
487
|
-
```ts
|
|
488
|
-
interface RebuildResult {
|
|
489
|
-
readonly sections_reindexed: number;
|
|
490
|
-
readonly terms_indexed: number;
|
|
491
|
-
readonly elapsed_ms: number;
|
|
492
|
-
}
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
### `WorkerClientError`
|
|
496
|
-
|
|
497
|
-
**File:** `worker-client-error.interface.ts`
|
|
498
|
-
|
|
499
|
-
An error returned by the worker daemon over JSON-RPC,
|
|
500
|
-
carrying a numeric error code alongside the message.
|
|
501
|
-
|
|
502
|
-
```ts
|
|
503
|
-
interface WorkerClientError extends Error {
|
|
504
|
-
readonly code: number;
|
|
505
|
-
}
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
The `code` property matches JSON-RPC 2.0 error codes
|
|
509
|
-
defined in the worker daemon spec.
|
|
510
|
-
|
|
511
|
-
No spec -- typings are compile-time only.
|