@dikolab/kbdb 0.4.0 → 0.4.3

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 (100) hide show
  1. package/README.md +30 -22
  2. package/dist/{chunk-BJPSPNGX.mjs → chunk-BJXEVALU.mjs} +115 -1
  3. package/dist/chunk-BJXEVALU.mjs.map +7 -0
  4. package/dist/cli.cjs +462 -79
  5. package/dist/cli.cjs.map +4 -4
  6. package/dist/cli.mjs +356 -79
  7. package/dist/cli.mjs.map +4 -4
  8. package/dist/kbdb-worker.cjs +413 -53
  9. package/dist/kbdb-worker.cjs.map +4 -4
  10. package/dist/mod.cjs +230 -54
  11. package/dist/mod.cjs.map +4 -4
  12. package/dist/mod.mjs +229 -53
  13. package/dist/mod.mjs.map +4 -4
  14. package/dist/src/shared/cli/typings/cli-options.interface.d.ts +5 -0
  15. package/dist/src/shared/embedding/classes/tfidf-embedding-provider.class.d.ts +28 -0
  16. package/dist/src/shared/embedding/constants/tfidf-defaults.constant.d.ts +4 -0
  17. package/dist/src/shared/embedding/functions/create-embedding-provider.function.d.ts +5 -2
  18. package/dist/src/shared/embedding/index.d.ts +2 -0
  19. package/dist/src/shared/log/constants/log-colors.constant.d.ts +5 -0
  20. package/dist/src/shared/log/constants/log-defaults.constant.d.ts +3 -0
  21. package/dist/src/shared/log/constants/log-icons.constant.d.ts +3 -0
  22. package/dist/src/shared/log/functions/configure-log.function.d.ts +12 -0
  23. package/dist/src/shared/log/functions/log.function.d.ts +28 -0
  24. package/dist/src/shared/log/functions/parse-log-level.function.d.ts +10 -0
  25. package/dist/src/shared/log/functions/resolve-log-level.function.d.ts +12 -0
  26. package/dist/src/shared/log/functions/write-stderr.function.d.ts +10 -0
  27. package/dist/src/shared/log/index.d.ts +10 -0
  28. package/dist/src/shared/log/typings/log-config.interface.d.ts +7 -0
  29. package/dist/src/shared/log/typings/log-level.type.d.ts +7 -0
  30. package/dist/src/shared/log/typings/log-output.interface.d.ts +4 -0
  31. package/dist/src/shared/version/constants/version.constant.d.ts +1 -1
  32. package/dist/src/shared/worker-client/classes/worker-client.class.d.ts +7 -0
  33. package/dist/src/shared/worker-client/functions/retry-on-timeout.function.d.ts +1 -0
  34. package/dist/src/shared/worker-daemon/classes/worker-daemon.class.d.ts +1 -0
  35. package/dist/src/shared/worker-daemon/functions/run-worker.function.d.ts +6 -1
  36. package/dist/src/shared/worker-daemon/typings/wasm-modules.interface.d.ts +5 -0
  37. package/dist/wasm/default-embedding/kbdb_default_embedding.d.ts +55 -0
  38. package/dist/wasm/default-embedding/kbdb_default_embedding.js +156 -0
  39. package/dist/wasm/default-embedding/kbdb_default_embedding_bg.wasm +0 -0
  40. package/dist/wasm/default-embedding/kbdb_default_embedding_bg.wasm.d.ts +12 -0
  41. package/dist/wasm/default-embedding/package.json +13 -0
  42. package/dist/wasm/fs-database/kbdb_fs_database_bg.wasm +0 -0
  43. package/dist/wasm/fs-migration/kbdb_fs_migration.d.ts +38 -0
  44. package/dist/wasm/fs-migration/kbdb_fs_migration.js +130 -0
  45. package/dist/wasm/fs-migration/kbdb_fs_migration_bg.wasm +0 -0
  46. package/dist/wasm/fs-migration/kbdb_fs_migration_bg.wasm.d.ts +9 -0
  47. package/dist/wasm/fs-migration/package.json +13 -0
  48. package/dist/wasm/kb-worker/kbdb_worker_bg.wasm +0 -0
  49. package/dist/wasm/query-parser/kbdb_query_parser_bg.wasm +0 -0
  50. package/dist/worker.mjs +306 -54
  51. package/dist/worker.mjs.map +4 -4
  52. package/docs/details/agent-tooling.md +10 -0
  53. package/docs/details/cli.md +29 -13
  54. package/docs/details/knowledge-base.md +15 -8
  55. package/docs/details/mcp-server.md +16 -1
  56. package/docs/details/search-and-ranking.md +6 -2
  57. package/docs/goals/cli.md +33 -4
  58. package/docs/goals/content-parser.md +1 -1
  59. package/docs/goals/hybrid-search.md +71 -42
  60. package/docs/goals/mcp.md +3 -1
  61. package/docs/goals/overview.md +1 -1
  62. package/docs/goals/query-parser.md +1 -1
  63. package/docs/goals/semantic-dedup.md +7 -3
  64. package/docs/goals/worker-daemon.md +31 -20
  65. package/docs/modules/overview.md +43 -22
  66. package/docs/modules/rust/embedding/module.md +91 -0
  67. package/docs/modules/rust/overview.md +56 -21
  68. package/docs/modules/rust/query-parser/functions/module.md +7 -5
  69. package/docs/modules/rust/query-parser/functions/pipeline.md +6 -138
  70. package/docs/modules/rust/query-parser/module.md +16 -22
  71. package/docs/modules/rust/query-parser/types/module.md +5 -4
  72. package/docs/modules/rust/query-parser/types/token.md +5 -1
  73. package/docs/modules/rust/shared/content-parser/functions.md +1 -1
  74. package/docs/modules/rust/shared/memory/module.md +1 -1
  75. package/docs/modules/rust/shared/module.md +33 -5
  76. package/docs/modules/rust/shared/pipeline/functions.md +141 -0
  77. package/docs/modules/rust/shared/pipeline/module.md +62 -0
  78. package/docs/modules/rust/shared/pipeline/types.md +43 -0
  79. package/docs/modules/rust/shared/section/module.md +1 -1
  80. package/docs/modules/rust/shared/section/types.md +1 -1
  81. package/docs/modules/typescript/cli.md +4 -2
  82. package/docs/modules/typescript/kbdb-worker.md +20 -5
  83. package/docs/modules/typescript/overview.md +28 -6
  84. package/docs/modules/typescript/shared/cli/functions.md +15 -4
  85. package/docs/modules/typescript/shared/cli/typings.md +21 -0
  86. package/docs/modules/typescript/shared/embedding/functions.md +30 -3
  87. package/docs/modules/typescript/shared/embedding/module.md +10 -4
  88. package/docs/modules/typescript/shared/embedding/typings.md +7 -5
  89. package/docs/modules/typescript/shared/log/constants.md +82 -0
  90. package/docs/modules/typescript/shared/log/functions.md +131 -0
  91. package/docs/modules/typescript/shared/log/module.md +153 -0
  92. package/docs/modules/typescript/shared/log/typings.md +82 -0
  93. package/docs/modules/typescript/shared/module.md +22 -6
  94. package/docs/modules/typescript/shared/worker-daemon/functions.md +19 -6
  95. package/docs/modules/typescript/shared/worker-daemon/module.md +5 -2
  96. package/docs/modules/typescript/shared/worker-daemon/typings.md +13 -7
  97. package/docs/release-notes/0.4.1.md +149 -0
  98. package/docs/release-notes/0.4.3.md +60 -0
  99. package/package.json +2 -2
  100. package/dist/chunk-BJPSPNGX.mjs.map +0 -7
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@dikolab/kbdb)](https://www.npmjs.com/package/@dikolab/kbdb)
4
4
  [![JSR](https://jsr.io/badges/@dikolab/kbdb)](https://jsr.io/@dikolab/kbdb)
5
- [![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
5
+ [![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/LICENSE)
6
6
 
7
7
  A file-based knowledge base database -- no external
8
8
  server to install.
@@ -10,7 +10,7 @@ server to install.
10
10
  [GitLab](https://gitlab.com/tech-slaves/knowledge-base-db)
11
11
  | [NPM](https://www.npmjs.com/package/@dikolab/kbdb)
12
12
  | [JSR](https://jsr.io/@dikolab/kbdb)
13
- | [License: ISC](LICENSE)
13
+ | [License: ISC](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/LICENSE)
14
14
 
15
15
  > **Status:** Beta -- actively developed. Core
16
16
  > features (search, recall, MCP) are stable and
@@ -39,11 +39,13 @@ automatically loosens the match so you still get the
39
39
  best available results.
40
40
 
41
41
  Want smarter results? Use `--algo hybrid` to blend
42
- keyword matching with AI-powered similarity --
43
- finding results even when different words describe
44
- the same concept. Hybrid mode needs an embedding
45
- provider; without one, use the default keyword-only
46
- search for fast, offline matching.
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.
47
49
 
48
50
  **Knowledge stays fresh:** Re-learn a file and kbdb
49
51
  replaces the old version automatically.
@@ -126,6 +128,12 @@ kbdb search "how does auth work" --algo hybrid \
126
128
  > omit it. You can also set `KBDB_DB_DIR` as an
127
129
  > environment variable.
128
130
 
131
+ > **Scripting:** Use `--non-interactive` or set
132
+ > `KBDB_NON_INTERACTIVE=1` to suppress prompts in
133
+ > scripts and CI pipelines. Commands that need a
134
+ > database will return an error instead of waiting
135
+ > for user input.
136
+
129
137
  **4. Recall context**
130
138
 
131
139
  ```sh
@@ -162,7 +170,7 @@ Build, search, and maintain your knowledge store.
162
170
  - **Rebuild** indexes if anything goes wrong
163
171
 
164
172
  See the
165
- [Knowledge Base Guide](docs/details/knowledge-base.md)
173
+ [Knowledge Base Guide](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/knowledge-base.md)
166
174
  for the full walkthrough, including export and backup.
167
175
 
168
176
  ---
@@ -186,7 +194,7 @@ Integrate kbdb with AI agents and custom tools.
186
194
  stop and restart the background process
187
195
 
188
196
  See the
189
- [Agent Tooling Guide](docs/details/agent-tooling.md)
197
+ [Agent Tooling Guide](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/agent-tooling.md)
190
198
  for MCP setup, skills, agents, and the library API.
191
199
 
192
200
  ---
@@ -222,7 +230,7 @@ or `dbPath` (the parent directory -- kbdb discovers
222
230
  `.kbdb` inside it).
223
231
 
224
232
  See the
225
- [Library API Reference](docs/details/library-api.md)
233
+ [Library API Reference](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/library-api.md)
226
234
  for the full API.
227
235
 
228
236
  ### Development Setup
@@ -245,10 +253,10 @@ HOST_UMASK=$(umask) docker compose run --rm dev bash
245
253
 
246
254
  Run `make benchmark` to measure search and rebuild
247
255
  latency at scale -- results are written to
248
- [docs/benchmark/benchmark.md](docs/benchmark/benchmark.md)
256
+ [docs/benchmark/benchmark.md](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/benchmark/benchmark.md)
249
257
  automatically.
250
258
 
251
- See the [Makefile](Makefile) for all available
259
+ See the [Makefile](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/Makefile) for all available
252
260
  build targets.
253
261
 
254
262
  ### Contributing
@@ -263,27 +271,27 @@ build targets.
263
271
 
264
272
  ## Documentation
265
273
 
266
- - [Knowledge Base Guide](docs/details/knowledge-base.md)
274
+ - [Knowledge Base Guide](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/knowledge-base.md)
267
275
  -- importing, searching, recall, export
268
- - [Agent Tooling Guide](docs/details/agent-tooling.md)
276
+ - [Agent Tooling Guide](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/agent-tooling.md)
269
277
  -- MCP, skills, agents, library API
270
- - [CLI Reference](docs/details/cli.md) -- full command
278
+ - [CLI Reference](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/cli.md) -- full command
271
279
  list with examples
272
- - [MCP Server Guide](docs/details/mcp-server.md) --
280
+ - [MCP Server Guide](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/mcp-server.md) --
273
281
  setup, tools, environment config
274
- - [Search and Ranking](docs/details/search-and-ranking.md)
282
+ - [Search and Ranking](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/search-and-ranking.md)
275
283
  -- how search works under the hood
276
- - [Storage Architecture](docs/details/storage.md) --
284
+ - [Storage Architecture](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/details/storage.md) --
277
285
  file formats and directory layout
278
- - [Benchmark Results](docs/benchmark/benchmark.md)
286
+ - [Benchmark Results](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/benchmark/benchmark.md)
279
287
  -- search and rebuild latency at scale
280
- - [Release Notes](docs/release-notes/)
281
- - [Architecture Overview](docs/overview.md)
288
+ - [Release Notes](https://gitlab.com/tech-slaves/knowledge-base-db/-/tree/main/docs/release-notes)
289
+ - [Architecture Overview](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/docs/overview.md)
282
290
 
283
291
  ---
284
292
 
285
293
  ## License
286
294
 
287
- ISC License -- see [LICENSE](LICENSE) for details.
295
+ ISC License -- see [LICENSE](https://gitlab.com/tech-slaves/knowledge-base-db/-/blob/main/LICENSE) for details.
288
296
 
289
297
  ---
@@ -56,6 +56,116 @@ function resolveWasmDir(scriptDir) {
56
56
  return joinPath(scriptDir, "wasm");
57
57
  }
58
58
 
59
+ // src/shared/log/typings/log-level.type.ts
60
+ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
61
+ LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
62
+ LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
63
+ LogLevel2[LogLevel2["WARNING"] = 2] = "WARNING";
64
+ LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
65
+ return LogLevel2;
66
+ })(LogLevel || {});
67
+
68
+ // src/shared/log/functions/parse-log-level.function.ts
69
+ var LOG_LEVEL_MAP = {
70
+ debug: 0 /* DEBUG */,
71
+ info: 1 /* INFO */,
72
+ warning: 2 /* WARNING */,
73
+ error: 3 /* ERROR */
74
+ };
75
+ function parseLogLevel(value) {
76
+ return LOG_LEVEL_MAP[value.toLowerCase()] ?? 2 /* WARNING */;
77
+ }
78
+
79
+ // src/shared/log/constants/log-colors.constant.ts
80
+ var ANSI_RESET = "\x1B[0m";
81
+ var LOG_COLORS = {
82
+ [0 /* DEBUG */]: "\x1B[37m",
83
+ [1 /* INFO */]: "\x1B[36m",
84
+ [2 /* WARNING */]: "\x1B[33m",
85
+ [3 /* ERROR */]: "\x1B[91m"
86
+ };
87
+
88
+ // src/shared/log/constants/log-icons.constant.ts
89
+ var LOG_ICONS = {
90
+ [0 /* DEBUG */]: "\u25B8",
91
+ [1 /* INFO */]: "\u2139",
92
+ [2 /* WARNING */]: "\u26A0",
93
+ [3 /* ERROR */]: "\u2716"
94
+ };
95
+
96
+ // src/shared/log/constants/log-defaults.constant.ts
97
+ var DEFAULT_LOG_LEVEL = 3 /* ERROR */;
98
+
99
+ // src/shared/log/functions/write-stderr.function.ts
100
+ function writeStderr(message) {
101
+ const g = globalThis;
102
+ const proc = g["process"];
103
+ if (proc?.stderr) {
104
+ proc.stderr.write(message);
105
+ return;
106
+ }
107
+ const deno = g["Deno"];
108
+ deno?.stderr.writeSync(new TextEncoder().encode(message));
109
+ }
110
+
111
+ // src/shared/log/functions/log.function.ts
112
+ var currentLevel = DEFAULT_LOG_LEVEL;
113
+ var outputs = {
114
+ [0 /* DEBUG */]: writeStderr,
115
+ [1 /* INFO */]: writeStderr,
116
+ [2 /* WARNING */]: writeStderr,
117
+ [3 /* ERROR */]: writeStderr
118
+ };
119
+ function setLogLevel(level) {
120
+ currentLevel = level;
121
+ }
122
+ function setLogOutput(level, output) {
123
+ outputs[level] = output;
124
+ }
125
+ function log(message, level = 3 /* ERROR */) {
126
+ if (level < currentLevel) {
127
+ return;
128
+ }
129
+ const color = LOG_COLORS[level];
130
+ const icon = LOG_ICONS[level];
131
+ const name = LogLevel[level];
132
+ const line = `${color}${icon} [${name}] ${message}${ANSI_RESET}
133
+ `;
134
+ outputs[level](line);
135
+ }
136
+
137
+ // src/shared/log/functions/resolve-log-level.function.ts
138
+ function resolveLogLevel(cliLevel) {
139
+ if (cliLevel !== void 0) {
140
+ return cliLevel;
141
+ }
142
+ const envValue = process.env["KBDB_LOG_LEVEL"];
143
+ if (envValue !== void 0) {
144
+ return parseLogLevel(envValue);
145
+ }
146
+ return DEFAULT_LOG_LEVEL;
147
+ }
148
+
149
+ // src/shared/log/functions/configure-log.function.ts
150
+ function configureLog(config) {
151
+ setLogLevel(config.level);
152
+ if (config.outputs === void 0) {
153
+ return;
154
+ }
155
+ const levels = [
156
+ 0 /* DEBUG */,
157
+ 1 /* INFO */,
158
+ 2 /* WARNING */,
159
+ 3 /* ERROR */
160
+ ];
161
+ for (const level of levels) {
162
+ const output = config.outputs[level];
163
+ if (output !== void 0) {
164
+ setLogOutput(level, output.write);
165
+ }
166
+ }
167
+ }
168
+
59
169
  // src/shared/worker-daemon/constants/daemon-defaults.constant.ts
60
170
  var DEFAULT_ITEM_LIMIT = 1e3;
61
171
  var DEFAULT_INDEX_LIMIT = 100;
@@ -210,8 +320,12 @@ export {
210
320
  joinPath,
211
321
  resolveWorkerScript,
212
322
  resolveWasmDir,
323
+ parseLogLevel,
324
+ log,
213
325
  computeSha256,
214
326
  getIpcPath,
327
+ resolveLogLevel,
328
+ configureLog,
215
329
  DEFAULT_ITEM_LIMIT,
216
330
  DEFAULT_INDEX_LIMIT,
217
331
  DEFAULT_TIMEOUT_MS,
@@ -220,4 +334,4 @@ export {
220
334
  DB_FORMAT_VERSION,
221
335
  parseWorkerToml
222
336
  };
223
- //# sourceMappingURL=chunk-BJPSPNGX.mjs.map
337
+ //# sourceMappingURL=chunk-BJXEVALU.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/dir-resolver/functions/resolve-base-dir.function.ts", "../src/shared/dir-resolver/functions/join-path.function.ts", "../src/shared/dir-resolver/functions/resolve-worker-script.function.ts", "../src/shared/dir-resolver/functions/resolve-wasm-dir.function.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/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": ["import 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", "import { 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", "import { 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", "import { 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", "import { 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", "import { joinPath } from './join-path.function.ts';\n\nexport function resolveWasmDir(scriptDir: string): string {\n return joinPath(scriptDir, 'wasm');\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", "import { 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", "import { 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", "import { 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", "import { 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", "/**\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", "import {\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", "import 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", "import 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", "/** 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", "import 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", "import 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", "import 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", "import 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", "/**\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", "import { 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", "import { 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": ";AAQO,SAAS,gBAAyB;AACtC,MAAI,OAAO,eAAe,eAAe,UAAU,YAAY;AAC5D,WAAO;AAAA,EACV;AACA,SAAO;AACV;;;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