@dikolab/kbdb 0.3.0 → 0.3.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/README.md +24 -43
- package/dist/bench/constants/corpus-defaults.constant.d.ts +3 -0
- package/dist/bench/functions/format-report.function.d.ts +11 -0
- package/dist/bench/functions/generate-corpus.function.d.ts +12 -0
- package/dist/bench/functions/measure-operation.function.d.ts +14 -0
- package/dist/bench/functions/seeded-rng.function.d.ts +11 -0
- package/dist/bench/functions/zipf-word.function.d.ts +13 -0
- package/dist/bench/index.d.ts +10 -0
- package/dist/bench/typings/bench-result.interface.d.ts +11 -0
- package/dist/bench/typings/bench-suite-result.interface.d.ts +10 -0
- package/dist/bench/typings/corpus-config.interface.d.ts +11 -0
- package/dist/bench/typings/corpus-section.interface.d.ts +9 -0
- package/dist/cli.cjs +63 -9
- package/dist/cli.cjs.map +2 -2
- package/dist/cli.mjs +63 -9
- package/dist/cli.mjs.map +2 -2
- package/dist/src/shared/auto-capture/classes/auto-capture-controller.class.d.ts +33 -0
- package/dist/src/shared/auto-capture/constants/auto-capture-defaults.constant.d.ts +8 -0
- package/dist/src/shared/auto-capture/functions/build-capture-prompt.function.d.ts +11 -0
- package/dist/src/shared/auto-capture/functions/evaluate-trigger.function.d.ts +12 -0
- package/dist/src/shared/auto-capture/index.d.ts +7 -0
- package/dist/src/shared/auto-capture/typings/auto-capture-config.interface.d.ts +13 -0
- package/dist/src/shared/auto-capture/typings/auto-capture-state.interface.d.ts +13 -0
- package/dist/src/shared/auto-capture/typings/auto-capture-trigger.interface.d.ts +7 -0
- package/dist/src/shared/cli/constants/global-help.constant.d.ts +8 -0
- package/dist/src/shared/cli/constants/leaf-help.constant.d.ts +7 -0
- package/dist/src/shared/cli/constants/memory-protocol-body.constant.d.ts +7 -0
- package/dist/src/shared/cli/constants/query-guidance-body.constant.d.ts +7 -0
- package/dist/src/shared/cli/constants/subcommand-help.constant.d.ts +8 -0
- package/dist/src/shared/cli/functions/collect-files.function.d.ts +13 -0
- package/dist/src/shared/cli/functions/compute-section-kbid.function.d.ts +15 -0
- package/dist/src/shared/cli/functions/format-mcp-output.function.d.ts +9 -0
- package/dist/src/shared/cli/functions/format-text-output.function.d.ts +9 -0
- package/dist/src/shared/cli/functions/generate-group-help.function.d.ts +11 -0
- package/dist/src/shared/cli/functions/handle-data-command.function.d.ts +16 -0
- package/dist/src/shared/cli/functions/handle-mcp.function.d.ts +15 -0
- package/dist/src/shared/cli/functions/handle-migrate.function.d.ts +15 -0
- package/dist/src/shared/cli/functions/hydrate-search-previews.function.d.ts +14 -0
- package/dist/src/shared/cli/functions/resolve-skill-names.function.d.ts +16 -0
- package/dist/src/shared/cli/functions/run-search.function.d.ts +1 -0
- package/dist/src/shared/cli/functions/version-gate.function.d.ts +15 -0
- package/dist/src/shared/cli/functions/wrap-command.function.d.ts +15 -0
- package/dist/src/shared/cli/typings/agent-create-client.interface.d.ts +42 -0
- package/dist/src/shared/cli/typings/agent-get-client.interface.d.ts +36 -0
- package/dist/src/shared/cli/typings/check-client.interface.d.ts +58 -0
- package/dist/src/shared/cli/typings/cli-deps.interface.d.ts +48 -0
- package/dist/src/shared/cli/typings/cli-options.interface.d.ts +2 -0
- package/dist/src/shared/cli/typings/disconnectable-client.interface.d.ts +26 -0
- package/dist/src/shared/cli/typings/dispatch-client.type.d.ts +27 -0
- package/dist/src/shared/cli/typings/learn-client.interface.d.ts +52 -0
- package/dist/src/shared/cli/typings/learn-io.interface.d.ts +5 -0
- package/dist/src/shared/cli/typings/search-client.interface.d.ts +71 -0
- package/dist/src/shared/embedding/classes/null-embedding-provider.class.d.ts +20 -0
- package/dist/src/shared/embedding/constants/near-duplicate-thresholds.constant.d.ts +15 -0
- package/dist/src/shared/embedding/functions/build-vector-index.function.d.ts +14 -0
- package/dist/src/shared/embedding/functions/cosine-similarity.function.d.ts +10 -0
- package/dist/src/shared/embedding/functions/detect-near-duplicates.function.d.ts +18 -0
- package/dist/src/shared/embedding/functions/jaccard-coefficient.function.d.ts +9 -0
- package/dist/src/shared/embedding/functions/read-vector-index-meta.function.d.ts +10 -0
- package/dist/src/shared/embedding/functions/rrf-fuse.function.d.ts +14 -0
- package/dist/src/shared/embedding/functions/search-vectors.function.d.ts +14 -0
- package/dist/src/shared/embedding/index.d.ts +16 -0
- package/dist/src/shared/embedding/typings/embedding-config.interface.d.ts +20 -0
- package/dist/src/shared/embedding/typings/embedding-provider.interface.d.ts +23 -0
- package/dist/src/shared/embedding/typings/near-duplicate-candidate.model.d.ts +23 -0
- package/dist/src/shared/embedding/typings/near-duplicate-result.model.d.ts +24 -0
- package/dist/src/shared/embedding/typings/vector-index-entry.model.d.ts +12 -0
- package/dist/src/shared/embedding/typings/vector-index-meta.model.d.ts +11 -0
- package/dist/src/shared/embedding/typings/vector-search-result.model.d.ts +7 -0
- package/dist/src/shared/mcp/constants/tool-agent-create.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-agent-delete.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-agent-get.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-agent-list.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-auto-capture-review.constant.d.ts +8 -0
- package/dist/src/shared/mcp/constants/tool-check.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-content.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-export.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-gc.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-learn.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-rebuild.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-recall.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-retrieve.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-search.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-skill-delete.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-skill-get.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-skill-learn.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-skill-list.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-status.constant.d.ts +3 -0
- package/dist/src/shared/mcp/constants/tool-unlearn.constant.d.ts +3 -0
- package/dist/src/shared/mcp/functions/as-boolean-or-undefined.function.d.ts +7 -0
- package/dist/src/shared/mcp/functions/as-string-array-or-undefined.function.d.ts +7 -0
- package/dist/src/shared/mcp/functions/as-string-array.function.d.ts +7 -0
- package/dist/src/shared/mcp/functions/as-string.function.d.ts +8 -0
- package/dist/src/shared/mcp/functions/build-skills-text.function.d.ts +18 -0
- package/dist/src/shared/mcp/functions/handle-agent-prompt.function.d.ts +14 -0
- package/dist/src/shared/mcp/functions/handle-mcp-request.function.d.ts +14 -0
- package/dist/src/shared/mcp/functions/handle-prompt-get.function.d.ts +4 -3
- package/dist/src/shared/mcp/functions/handle-skill-prompt.function.d.ts +16 -0
- package/dist/src/shared/mcp/functions/handle-tool-auto-capture-review.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/handle-tool-check.function.d.ts +11 -0
- package/dist/src/shared/mcp/functions/handle-tool-content.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/handle-tool-export.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/handle-tool-gc.function.d.ts +11 -0
- package/dist/src/shared/mcp/functions/handle-tool-learn.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/handle-tool-rebuild.function.d.ts +11 -0
- package/dist/src/shared/mcp/functions/handle-tool-retrieve.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/handle-tool-search.function.d.ts +13 -0
- package/dist/src/shared/mcp/functions/handle-tool-skill-delete.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/handle-tool-skill-get.function.d.ts +13 -0
- package/dist/src/shared/mcp/functions/handle-tool-skill-learn.function.d.ts +13 -0
- package/dist/src/shared/mcp/functions/handle-tool-skill-list.function.d.ts +11 -0
- package/dist/src/shared/mcp/functions/handle-tool-status.function.d.ts +11 -0
- package/dist/src/shared/mcp/functions/handle-tool-unlearn.function.d.ts +12 -0
- package/dist/src/shared/mcp/functions/parse-agent-meta.function.d.ts +14 -0
- package/dist/src/shared/mcp/functions/parse-skill-arguments.function.d.ts +11 -0
- package/dist/src/shared/mcp/functions/read-agent-meta.function.d.ts +17 -0
- package/dist/src/shared/mcp/functions/resolve-skill-refs.function.d.ts +23 -0
- package/dist/src/shared/mcp/functions/run-startup-health-check.function.d.ts +14 -0
- package/dist/src/shared/mcp/typings/mcp-capabilities.interface.d.ts +16 -0
- package/dist/src/shared/mcp/typings/mcp-client.interface.d.ts +2 -0
- package/dist/src/shared/mcp/typings/mcp-completion.interface.d.ts +43 -0
- package/dist/src/shared/mcp/typings/mcp-content-result.model.d.ts +9 -0
- package/dist/src/shared/mcp/typings/mcp-export-result.model.d.ts +11 -0
- package/dist/src/shared/mcp/typings/mcp-gc-result.model.d.ts +15 -0
- package/dist/src/shared/mcp/typings/mcp-integrity-check-result.model.d.ts +16 -0
- package/dist/src/shared/mcp/typings/mcp-integrity-error.model.d.ts +9 -0
- package/dist/src/shared/mcp/typings/mcp-notification.interface.d.ts +9 -0
- package/dist/src/shared/mcp/typings/mcp-rebuild-result.model.d.ts +9 -0
- package/dist/src/shared/mcp/typings/mcp-request.interface.d.ts +11 -0
- package/dist/src/shared/mcp/typings/mcp-resource-result.interface.d.ts +12 -0
- package/dist/src/shared/mcp/typings/mcp-resource-template.interface.d.ts +11 -0
- package/dist/src/shared/mcp/typings/mcp-response.interface.d.ts +18 -0
- package/dist/src/shared/mcp/typings/mcp-server-info.interface.d.ts +7 -0
- package/dist/src/shared/mcp/typings/mcp-server-state.interface.d.ts +16 -0
- package/dist/src/shared/mcp/typings/mcp-tool-annotations.interface.d.ts +32 -0
- package/dist/src/shared/mcp/typings/mcp-tool-definition.interface.d.ts +15 -0
- package/dist/src/shared/mcp/typings/mcp-tool-result.interface.d.ts +19 -0
- package/dist/src/shared/mcp/typings/mcp-worker-client.interface.d.ts +220 -0
- package/dist/src/shared/mcp/typings/tool-call-result.model.d.ts +17 -0
- package/dist/src/shared/sync/functions/build-import-report.function.d.ts +18 -0
- package/dist/src/shared/sync/functions/parse-export-entry.function.d.ts +11 -0
- package/dist/src/shared/sync/functions/resolve-conflict.function.d.ts +13 -0
- package/dist/src/shared/sync/functions/serialize-export-entry.function.d.ts +8 -0
- package/dist/src/shared/sync/index.d.ts +9 -0
- package/dist/src/shared/sync/typings/conflict-resolution.type.d.ts +8 -0
- package/dist/src/shared/sync/typings/export-entry.interface.d.ts +13 -0
- package/dist/src/shared/sync/typings/export-options.interface.d.ts +9 -0
- package/dist/src/shared/sync/typings/import-options.interface.d.ts +7 -0
- package/dist/src/shared/sync/typings/import-report.interface.d.ts +15 -0
- package/dist/src/shared/wasm-codec/functions/decode-one-recall-result.function.d.ts +14 -0
- package/dist/src/shared/wasm-codec/functions/decode-option-string.function.d.ts +12 -0
- package/dist/src/shared/wasm-codec/functions/decode-recall-document.function.d.ts +14 -0
- package/dist/src/shared/wasm-codec/functions/decode-recall-reference.function.d.ts +14 -0
- package/dist/src/shared/wasm-codec/functions/decode-recall-sibling.function.d.ts +13 -0
- package/dist/src/shared/wasm-codec/functions/decode-section-match.function.d.ts +15 -0
- package/dist/src/shared/wasm-codec/functions/decode-section-record-trailing.function.d.ts +14 -0
- package/dist/src/shared/wasm-codec/functions/decode-section-record.function.d.ts +14 -0
- package/dist/src/shared/wasm-codec/functions/decode-section-type.function.d.ts +13 -0
- package/dist/src/shared/wasm-codec/functions/decode-wasm-list.function.d.ts +17 -0
- package/dist/src/shared/wasm-codec/typings/add-section-input.model.d.ts +45 -0
- package/dist/src/shared/wasm-codec/typings/add-section-result.model.d.ts +27 -0
- package/dist/src/shared/wasm-codec/typings/document-manifest.model.d.ts +19 -0
- package/dist/src/shared/wasm-codec/typings/document-section.model.d.ts +12 -0
- package/dist/src/shared/wasm-codec/typings/item-decoder.type.d.ts +6 -0
- package/dist/src/shared/wasm-codec/typings/near-duplicate.model.d.ts +16 -0
- package/dist/src/shared/wasm-codec/typings/paged-search-result.model.d.ts +21 -0
- package/dist/src/shared/wasm-codec/typings/section-match.model.d.ts +31 -0
- package/dist/src/shared/wasm-codec/typings/section-record-trailing.model.d.ts +38 -0
- package/dist/src/shared/wasm-codec/typings/section-record.model.d.ts +66 -0
- package/dist/src/shared/wasm-codec/typings/section-type-result.model.d.ts +12 -0
- package/dist/src/shared/worker-client/functions/handle-ipc-data.function.d.ts +16 -0
- package/dist/src/shared/worker-client/functions/send-ipc-request.function.d.ts +19 -0
- package/dist/src/shared/worker-client/typings/add-section-result.model.d.ts +2 -0
- package/dist/src/shared/worker-client/typings/json-rpc-response.interface.d.ts +16 -0
- package/dist/src/shared/worker-client/typings/pending-call.interface.d.ts +7 -0
- package/dist/src/shared/worker-client/typings/recall-document.model.d.ts +16 -0
- package/dist/src/shared/worker-client/typings/recall-params.model.d.ts +15 -0
- package/dist/src/shared/worker-client/typings/recall-reference.model.d.ts +32 -0
- package/dist/src/shared/worker-client/typings/recall-sibling.model.d.ts +11 -0
- package/dist/src/shared/worker-client/typings/recall-single-result.model.d.ts +40 -0
- package/dist/src/shared/worker-daemon/classes/ipc-error.class.d.ts +17 -0
- package/dist/src/shared/worker-daemon/constants/wasm-method-map.constant.d.ts +16 -0
- package/dist/src/shared/worker-daemon/functions/build-ipc-error-response.function.d.ts +9 -0
- package/dist/src/shared/worker-daemon/functions/check-catalog-version.function.d.ts +9 -0
- package/dist/src/shared/worker-daemon/functions/check-preconditions.function.d.ts +10 -0
- package/dist/src/shared/worker-daemon/functions/detect-stale-pid.function.d.ts +15 -0
- package/dist/src/shared/worker-daemon/functions/dispatch-request.function.d.ts +35 -0
- package/dist/src/shared/worker-daemon/functions/handle-check-version.function.d.ts +23 -0
- package/dist/src/shared/worker-daemon/functions/handle-config-method.function.d.ts +11 -0
- package/dist/src/shared/worker-daemon/functions/handle-read-ops.function.d.ts +52 -0
- package/dist/src/shared/worker-daemon/functions/handle-write-ops.function.d.ts +44 -0
- package/dist/src/shared/worker-daemon/functions/parse-auto-capture-section.function.d.ts +14 -0
- package/dist/src/shared/worker-daemon/functions/parse-catalog-version.function.d.ts +10 -0
- package/dist/src/shared/worker-daemon/functions/parse-embedding-section.function.d.ts +13 -0
- package/dist/src/shared/worker-daemon/functions/parse-worker-toml.function.d.ts +11 -0
- package/dist/src/shared/worker-daemon/functions/run-startup-integrity-check.function.d.ts +18 -0
- package/dist/src/shared/worker-daemon/functions/scan-near-duplicates.function.d.ts +21 -0
- package/dist/src/shared/worker-daemon/functions/wasm-bridge.function.d.ts +51 -0
- package/dist/src/shared/worker-daemon/functions/wasm-memory-helpers.function.d.ts +22 -0
- package/dist/src/shared/worker-daemon/functions/write-lock.function.d.ts +32 -0
- package/dist/src/shared/worker-daemon/typings/allocator-ref.interface.d.ts +16 -0
- package/dist/src/shared/worker-daemon/typings/daemon-config.interface.d.ts +6 -0
- package/dist/src/shared/worker-daemon/typings/fs-adapter.interface.d.ts +22 -0
- package/dist/src/shared/worker-daemon/typings/handler-context.interface.d.ts +18 -0
- package/dist/src/shared/worker-daemon/typings/memory-ref.interface.d.ts +13 -0
- package/dist/src/shared/worker-daemon/typings/wasm-fn.type.d.ts +2 -0
- package/dist/src/shared/worker-daemon/typings/write-lock.interface.d.ts +15 -0
- package/dist/wasm/fs-database/kbdb_fs_database_bg.wasm +0 -0
- package/dist/wasm/kb-worker/kbdb_worker_bg.wasm +0 -0
- package/docs/details/mcp-server.md +4 -2
- package/docs/goals/auto-capture.md +378 -0
- package/docs/goals/benchmarking.md +296 -0
- package/docs/goals/concurrency.md +259 -0
- package/docs/goals/hybrid-search.md +436 -0
- package/docs/goals/semantic-dedup.md +229 -0
- package/docs/goals/sync.md +217 -0
- package/docs/modules/rust/fs-database/indexes/vectors.md +110 -0
- package/docs/modules/typescript/shared/auto-capture/module.md +73 -0
- package/docs/modules/typescript/shared/embedding/functions.md +94 -0
- package/docs/modules/typescript/shared/embedding/module.md +71 -0
- package/docs/modules/typescript/shared/embedding/typings.md +122 -0
- package/docs/overview.md +148 -166
- package/docs/release-notes/0.2.0.md +3 -3
- package/docs/release-notes/0.3.0.md +89 -0
- package/docs/release-notes/0.3.1.md +111 -0
- package/docs/release-notes/README.md +2 -0
- package/package.json +1 -1
- package/src/shared/auto-capture/classes/auto-capture-controller.class.ts +62 -0
- package/src/shared/auto-capture/constants/auto-capture-defaults.constant.ts +15 -0
- package/src/shared/auto-capture/functions/build-capture-prompt.function.ts +27 -0
- package/src/shared/auto-capture/functions/evaluate-trigger.function.ts +50 -0
- package/src/shared/auto-capture/index.ts +7 -0
- package/src/shared/auto-capture/typings/auto-capture-config.interface.ts +13 -0
- package/src/shared/auto-capture/typings/auto-capture-state.interface.ts +13 -0
- package/src/shared/auto-capture/typings/auto-capture-trigger.interface.ts +7 -0
- package/src/shared/cli/constants/global-help.constant.ts +73 -0
- package/src/shared/cli/constants/leaf-help.constant.ts +219 -0
- package/src/shared/cli/constants/memory-protocol-body.constant.ts +39 -0
- package/src/shared/cli/constants/query-guidance-body.constant.ts +37 -0
- package/src/shared/cli/constants/subcommand-help.constant.ts +195 -0
- package/src/shared/cli/functions/collect-files.function.ts +55 -0
- package/src/shared/cli/functions/compute-section-kbid.function.ts +49 -0
- package/src/shared/cli/functions/format-mcp-output.function.ts +41 -0
- package/src/shared/cli/functions/format-text-output.function.ts +42 -0
- package/src/shared/cli/functions/generate-group-help.function.ts +41 -0
- package/src/shared/cli/functions/handle-data-command.function.ts +67 -0
- package/src/shared/cli/functions/handle-mcp.function.ts +56 -0
- package/src/shared/cli/functions/handle-migrate.function.ts +64 -0
- package/src/shared/cli/functions/hydrate-search-previews.function.ts +29 -0
- package/src/shared/cli/functions/parse-args.function.ts +3 -0
- package/src/shared/cli/functions/resolve-skill-names.function.ts +43 -0
- package/src/shared/cli/functions/run-search.function.ts +2 -0
- package/src/shared/cli/functions/version-gate.function.ts +44 -0
- package/src/shared/cli/functions/wrap-command.function.ts +34 -0
- package/src/shared/cli/typings/agent-create-client.interface.ts +47 -0
- package/src/shared/cli/typings/agent-get-client.interface.ts +39 -0
- package/src/shared/cli/typings/check-client.interface.ts +66 -0
- package/src/shared/cli/typings/cli-deps.interface.ts +54 -0
- package/src/shared/cli/typings/cli-options.interface.ts +2 -0
- package/src/shared/cli/typings/disconnectable-client.interface.ts +29 -0
- package/src/shared/cli/typings/dispatch-client.type.ts +46 -0
- package/src/shared/cli/typings/learn-client.interface.ts +53 -0
- package/src/shared/cli/typings/learn-io.interface.ts +5 -0
- package/src/shared/cli/typings/search-client.interface.ts +73 -0
- package/src/shared/embedding/classes/null-embedding-provider.class.ts +29 -0
- package/src/shared/embedding/constants/near-duplicate-thresholds.constant.ts +17 -0
- package/src/shared/embedding/functions/build-vector-index.function.ts +79 -0
- package/src/shared/embedding/functions/cosine-similarity.function.ts +31 -0
- package/src/shared/embedding/functions/detect-near-duplicates.function.ts +69 -0
- package/src/shared/embedding/functions/jaccard-coefficient.function.ts +26 -0
- package/src/shared/embedding/functions/read-vector-index-meta.function.ts +44 -0
- package/src/shared/embedding/functions/rrf-fuse.function.ts +33 -0
- package/src/shared/embedding/functions/search-vectors.function.ts +59 -0
- package/src/shared/embedding/index.ts +20 -0
- package/src/shared/embedding/typings/embedding-config.interface.ts +23 -0
- package/src/shared/embedding/typings/embedding-provider.interface.ts +25 -0
- package/src/shared/embedding/typings/near-duplicate-candidate.model.ts +25 -0
- package/src/shared/embedding/typings/near-duplicate-result.model.ts +26 -0
- package/src/shared/embedding/typings/vector-index-entry.model.ts +13 -0
- package/src/shared/embedding/typings/vector-index-meta.model.ts +14 -0
- package/src/shared/embedding/typings/vector-search-result.model.ts +8 -0
- package/src/shared/mcp/classes/mcp-server.class.ts +6 -3
- package/src/shared/mcp/constants/tool-agent-create.constant.ts +39 -0
- package/src/shared/mcp/constants/tool-agent-delete.constant.ts +26 -0
- package/src/shared/mcp/constants/tool-agent-get.constant.ts +24 -0
- package/src/shared/mcp/constants/tool-agent-list.constant.ts +18 -0
- package/src/shared/mcp/constants/tool-auto-capture-review.constant.ts +32 -0
- package/src/shared/mcp/constants/tool-check.constant.ts +21 -0
- package/src/shared/mcp/constants/tool-content.constant.ts +29 -0
- package/src/shared/mcp/constants/tool-export.constant.ts +27 -0
- package/src/shared/mcp/constants/tool-gc.constant.ts +21 -0
- package/src/shared/mcp/constants/tool-learn.constant.ts +58 -0
- package/src/shared/mcp/constants/tool-rebuild.constant.ts +21 -0
- package/src/shared/mcp/constants/tool-recall.constant.ts +36 -0
- package/src/shared/mcp/constants/tool-retrieve.constant.ts +31 -0
- package/src/shared/mcp/constants/tool-search.constant.ts +51 -0
- package/src/shared/mcp/constants/tool-skill-delete.constant.ts +24 -0
- package/src/shared/mcp/constants/tool-skill-get.constant.ts +27 -0
- package/src/shared/mcp/constants/tool-skill-learn.constant.ts +37 -0
- package/src/shared/mcp/constants/tool-skill-list.constant.ts +18 -0
- package/src/shared/mcp/constants/tool-status.constant.ts +20 -0
- package/src/shared/mcp/constants/tool-unlearn.constant.ts +25 -0
- package/src/shared/mcp/functions/as-boolean-or-undefined.function.ts +11 -0
- package/src/shared/mcp/functions/as-string-array-or-undefined.function.ts +17 -0
- package/src/shared/mcp/functions/as-string-array.function.ts +15 -0
- package/src/shared/mcp/functions/as-string.function.ts +10 -0
- package/src/shared/mcp/functions/build-skills-text.function.ts +43 -0
- package/src/shared/mcp/functions/create-tool-definitions.function.ts +28 -0
- package/src/shared/mcp/functions/handle-agent-create.function.ts +1 -1
- package/src/shared/mcp/functions/handle-agent-prompt.function.ts +68 -0
- package/src/shared/mcp/functions/handle-mcp-request.function.ts +202 -0
- package/src/shared/mcp/functions/handle-prompt-get.function.ts +18 -12
- package/src/shared/mcp/functions/handle-skill-prompt.function.ts +44 -0
- package/src/shared/mcp/functions/handle-tool-auto-capture-review.function.ts +24 -0
- package/src/shared/mcp/functions/handle-tool-call.function.ts +18 -0
- package/src/shared/mcp/functions/handle-tool-check.function.ts +21 -0
- package/src/shared/mcp/functions/handle-tool-content.function.ts +23 -0
- package/src/shared/mcp/functions/handle-tool-export.function.ts +25 -0
- package/src/shared/mcp/functions/handle-tool-gc.function.ts +21 -0
- package/src/shared/mcp/functions/handle-tool-learn.function.ts +69 -0
- package/src/shared/mcp/functions/handle-tool-rebuild.function.ts +21 -0
- package/src/shared/mcp/functions/handle-tool-retrieve.function.ts +40 -0
- package/src/shared/mcp/functions/handle-tool-search.function.ts +47 -0
- package/src/shared/mcp/functions/handle-tool-skill-delete.function.ts +34 -0
- package/src/shared/mcp/functions/handle-tool-skill-get.function.ts +59 -0
- package/src/shared/mcp/functions/handle-tool-skill-learn.function.ts +61 -0
- package/src/shared/mcp/functions/handle-tool-skill-list.function.ts +39 -0
- package/src/shared/mcp/functions/handle-tool-status.function.ts +21 -0
- package/src/shared/mcp/functions/handle-tool-unlearn.function.ts +24 -0
- package/src/shared/mcp/functions/parse-agent-meta.function.ts +27 -0
- package/src/shared/mcp/functions/parse-skill-arguments.function.ts +36 -0
- package/src/shared/mcp/functions/read-agent-meta.function.ts +41 -0
- package/src/shared/mcp/functions/resolve-skill-refs.function.ts +50 -0
- package/src/shared/mcp/functions/run-startup-health-check.function.ts +34 -0
- package/src/shared/mcp/typings/mcp-capabilities.interface.ts +16 -0
- package/src/shared/mcp/typings/mcp-client.interface.ts +2 -0
- package/src/shared/mcp/typings/mcp-completion.interface.ts +45 -0
- package/src/shared/mcp/typings/mcp-content-result.model.ts +9 -0
- package/src/shared/mcp/typings/mcp-export-result.model.ts +11 -0
- package/src/shared/mcp/typings/mcp-gc-result.model.ts +15 -0
- package/src/shared/mcp/typings/mcp-integrity-check-result.model.ts +17 -0
- package/src/shared/mcp/typings/mcp-integrity-error.model.ts +15 -0
- package/src/shared/mcp/typings/mcp-notification.interface.ts +9 -0
- package/src/shared/mcp/typings/mcp-rebuild-result.model.ts +9 -0
- package/src/shared/mcp/typings/mcp-request.interface.ts +11 -0
- package/src/shared/mcp/typings/mcp-resource-result.interface.ts +12 -0
- package/src/shared/mcp/typings/mcp-resource-template.interface.ts +11 -0
- package/src/shared/mcp/typings/mcp-response.interface.ts +18 -0
- package/src/shared/mcp/typings/mcp-server-info.interface.ts +7 -0
- package/src/shared/mcp/typings/mcp-server-state.interface.ts +17 -0
- package/src/shared/mcp/typings/mcp-tool-annotations.interface.ts +32 -0
- package/src/shared/mcp/typings/mcp-tool-definition.interface.ts +16 -0
- package/src/shared/mcp/typings/mcp-tool-result.interface.ts +19 -0
- package/src/shared/mcp/typings/mcp-worker-client.interface.ts +243 -0
- package/src/shared/mcp/typings/tool-call-result.model.ts +18 -0
- package/src/shared/sync/functions/build-import-report.function.ts +40 -0
- package/src/shared/sync/functions/parse-export-entry.function.ts +45 -0
- package/src/shared/sync/functions/resolve-conflict.function.ts +31 -0
- package/src/shared/sync/functions/serialize-export-entry.function.ts +18 -0
- package/src/shared/sync/index.ts +9 -0
- package/src/shared/sync/typings/conflict-resolution.type.ts +8 -0
- package/src/shared/sync/typings/export-entry.interface.ts +13 -0
- package/src/shared/sync/typings/export-options.interface.ts +9 -0
- package/src/shared/sync/typings/import-options.interface.ts +7 -0
- package/src/shared/sync/typings/import-report.interface.ts +15 -0
- package/src/shared/wasm-codec/functions/decode-one-recall-result.function.ts +86 -0
- package/src/shared/wasm-codec/functions/decode-option-string.function.ts +24 -0
- package/src/shared/wasm-codec/functions/decode-recall-document.function.ts +59 -0
- package/src/shared/wasm-codec/functions/decode-recall-reference.function.ts +52 -0
- package/src/shared/wasm-codec/functions/decode-recall-sibling.function.ts +43 -0
- package/src/shared/wasm-codec/functions/decode-section-match.function.ts +80 -0
- package/src/shared/wasm-codec/functions/decode-section-record-trailing.function.ts +75 -0
- package/src/shared/wasm-codec/functions/decode-section-record.function.ts +85 -0
- package/src/shared/wasm-codec/functions/decode-section-type.function.ts +30 -0
- package/src/shared/wasm-codec/functions/decode-wasm-list.function.ts +31 -0
- package/src/shared/wasm-codec/typings/add-section-input.model.ts +45 -0
- package/src/shared/wasm-codec/typings/add-section-result.model.ts +28 -0
- package/src/shared/wasm-codec/typings/document-manifest.model.ts +20 -0
- package/src/shared/wasm-codec/typings/document-section.model.ts +12 -0
- package/src/shared/wasm-codec/typings/item-decoder.type.ts +10 -0
- package/src/shared/wasm-codec/typings/near-duplicate.model.ts +16 -0
- package/src/shared/wasm-codec/typings/paged-search-result.model.ts +22 -0
- package/src/shared/wasm-codec/typings/section-match.model.ts +31 -0
- package/src/shared/wasm-codec/typings/section-record-trailing.model.ts +38 -0
- package/src/shared/wasm-codec/typings/section-record.model.ts +66 -0
- package/src/shared/wasm-codec/typings/section-type-result.model.ts +12 -0
- package/src/shared/worker-client/functions/handle-ipc-data.function.ts +49 -0
- package/src/shared/worker-client/functions/send-ipc-request.function.ts +39 -0
- package/src/shared/worker-client/typings/add-section-result.model.ts +2 -0
- package/src/shared/worker-client/typings/json-rpc-response.interface.ts +17 -0
- package/src/shared/worker-client/typings/pending-call.interface.ts +7 -0
- package/src/shared/worker-client/typings/recall-document.model.ts +16 -0
- package/src/shared/worker-client/typings/recall-params.model.ts +15 -0
- package/src/shared/worker-client/typings/recall-reference.model.ts +32 -0
- package/src/shared/worker-client/typings/recall-sibling.model.ts +11 -0
- package/src/shared/worker-client/typings/recall-single-result.model.ts +41 -0
- package/src/shared/worker-daemon/classes/ipc-error.class.ts +22 -0
- package/src/shared/worker-daemon/constants/wasm-method-map.constant.ts +69 -0
- package/src/shared/worker-daemon/functions/build-ipc-error-response.function.ts +16 -0
- package/src/shared/worker-daemon/functions/check-catalog-version.function.ts +54 -0
- package/src/shared/worker-daemon/functions/check-preconditions.function.ts +28 -0
- package/src/shared/worker-daemon/functions/detect-stale-pid.function.ts +33 -0
- package/src/shared/worker-daemon/functions/dispatch-request.function.ts +190 -0
- package/src/shared/worker-daemon/functions/handle-check-version.function.ts +74 -0
- package/src/shared/worker-daemon/functions/handle-config-method.function.ts +27 -0
- package/src/shared/worker-daemon/functions/handle-read-ops.function.ts +236 -0
- package/src/shared/worker-daemon/functions/handle-write-ops.function.ts +257 -0
- package/src/shared/worker-daemon/functions/parse-auto-capture-section.function.ts +51 -0
- package/src/shared/worker-daemon/functions/parse-catalog-version.function.ts +20 -0
- package/src/shared/worker-daemon/functions/parse-embedding-section.function.ts +38 -0
- package/src/shared/worker-daemon/functions/parse-worker-toml.function.ts +104 -0
- package/src/shared/worker-daemon/functions/run-startup-integrity-check.function.ts +55 -0
- package/src/shared/worker-daemon/functions/scan-near-duplicates.function.ts +92 -0
- package/src/shared/worker-daemon/functions/wasm-bridge.function.ts +144 -0
- package/src/shared/worker-daemon/functions/wasm-memory-helpers.function.ts +41 -0
- package/src/shared/worker-daemon/functions/write-lock.function.ts +49 -0
- package/src/shared/worker-daemon/typings/allocator-ref.interface.ts +16 -0
- package/src/shared/worker-daemon/typings/daemon-config.interface.ts +7 -0
- package/src/shared/worker-daemon/typings/fs-adapter.interface.ts +22 -0
- package/src/shared/worker-daemon/typings/handler-context.interface.ts +19 -0
- package/src/shared/worker-daemon/typings/memory-ref.interface.ts +13 -0
- package/src/shared/worker-daemon/typings/wasm-fn.type.ts +2 -0
- package/src/shared/worker-daemon/typings/write-lock.interface.ts +13 -0
- package/src/wasm/fs-database/kbdb_fs_database_bg.wasm +0 -0
- package/src/wasm/kb-worker/kbdb_worker_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -12,50 +12,31 @@ required.
|
|
|
12
12
|
|
|
13
13
|
## What is kbdb?
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
**kbdb** is a knowledge base that stores your docs
|
|
20
|
-
in a plain folder on disk. No server to install.
|
|
21
|
-
No cloud account to create. It handles indexing
|
|
22
|
-
and fast search out of the box -- just point it
|
|
23
|
-
at your files and start searching.
|
|
24
|
-
|
|
25
|
-
It runs anywhere Node.js or Deno runs. Import your
|
|
26
|
-
Markdown files, and kbdb indexes them automatically.
|
|
15
|
+
**kbdb** stores your docs in a plain folder on
|
|
16
|
+
disk and makes them searchable. No server to
|
|
17
|
+
install. No cloud account. Import your Markdown
|
|
18
|
+
files, and kbdb indexes them automatically.
|
|
27
19
|
Search returns ranked results instantly.
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
search works
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
versions of the same source. Confidence scores
|
|
49
|
-
let agents tell strong matches from weak tail
|
|
50
|
-
results.
|
|
51
|
-
|
|
52
|
-
As a bonus, kbdb also works as an MCP server --
|
|
53
|
-
giving AI agents like Claude a searchable second
|
|
54
|
-
brain. Store skills, agent profiles, and
|
|
55
|
-
documentation that your AI can query across
|
|
56
|
-
sessions. Default skills (`query-guidance` and
|
|
57
|
-
`memory-protocol`) teach agents how to search
|
|
58
|
-
effectively and what to store.
|
|
21
|
+
It runs anywhere Node.js or Deno runs, and also
|
|
22
|
+
works as an [MCP](https://modelcontextprotocol.io/)
|
|
23
|
+
server -- giving AI agents like Claude a searchable
|
|
24
|
+
second brain that persists between sessions.
|
|
25
|
+
|
|
26
|
+
**How search works:** kbdb uses keyword matching
|
|
27
|
+
with stemming and synonym expansion (lexical
|
|
28
|
+
search, not AI embeddings). This keeps it fast,
|
|
29
|
+
offline, and deterministic. When an exact query
|
|
30
|
+
returns nothing, it automatically retries with
|
|
31
|
+
relaxed matching. Headings carry 2x ranking weight,
|
|
32
|
+
so clear headings improve results.
|
|
33
|
+
|
|
34
|
+
**Knowledge stays fresh:** Re-learn a file and kbdb
|
|
35
|
+
replaces the old version automatically.
|
|
36
|
+
Near-duplicate detection warns you before content
|
|
37
|
+
drifts. Integrity checks catch contradictions.
|
|
38
|
+
Confidence scores help agents tell strong matches
|
|
39
|
+
from weak ones.
|
|
59
40
|
|
|
60
41
|
---
|
|
61
42
|
|
|
@@ -167,7 +148,7 @@ for the full command list and examples.
|
|
|
167
148
|
|
|
168
149
|
kbdb runs as an
|
|
169
150
|
[MCP](https://modelcontextprotocol.io/) server
|
|
170
|
-
with
|
|
151
|
+
with 20 tools, so AI agents can search your docs,
|
|
171
152
|
recall context progressively, export snapshots,
|
|
172
153
|
store reusable skills, and build agent profiles --
|
|
173
154
|
a second brain that persists between sessions.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BenchSuiteResult } from '../typings/bench-suite-result.interface.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Formats benchmark results as a Markdown table.
|
|
4
|
+
*
|
|
5
|
+
* Renders a header row, a separator, and one data row per
|
|
6
|
+
* result in the suite.
|
|
7
|
+
*
|
|
8
|
+
* @param suite - completed benchmark suite to render
|
|
9
|
+
* @returns multi-line Markdown table string
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatReport(suite: BenchSuiteResult): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CorpusConfig } from '../typings/corpus-config.interface.ts';
|
|
2
|
+
import type { CorpusSection } from '../typings/corpus-section.interface.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a synthetic corpus of sections.
|
|
5
|
+
*
|
|
6
|
+
* Uses Zipfian word frequency distribution for realistic
|
|
7
|
+
* token patterns. Output is deterministic for the same seed.
|
|
8
|
+
*
|
|
9
|
+
* @param config - corpus generation parameters
|
|
10
|
+
* @returns array of generated corpus sections
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateCorpus(config: CorpusConfig): CorpusSection[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BenchResult } from '../typings/bench-result.interface.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Measures the duration of an async operation.
|
|
4
|
+
*
|
|
5
|
+
* Runs one warmup call then measures N iterations, returning
|
|
6
|
+
* the median duration. Uses `performance.now()` for timing.
|
|
7
|
+
*
|
|
8
|
+
* @param name - label for the operation
|
|
9
|
+
* @param corpusSize - corpus size associated with this run
|
|
10
|
+
* @param operation - the function to benchmark
|
|
11
|
+
* @param iterations - number of measured iterations (default 3)
|
|
12
|
+
* @returns benchmark result with median timing
|
|
13
|
+
*/
|
|
14
|
+
export declare function measureOperation(name: string, corpusSize: number, operation: () => Promise<void> | void, iterations?: number): Promise<BenchResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a deterministic pseudo-random number generator
|
|
3
|
+
* using a linear congruential algorithm.
|
|
4
|
+
*
|
|
5
|
+
* Each call to the returned function advances the internal
|
|
6
|
+
* state and returns the next value in [0, 1).
|
|
7
|
+
*
|
|
8
|
+
* @param seed - initial state for the LCG sequence
|
|
9
|
+
* @returns a stateful RNG function producing values in [0, 1)
|
|
10
|
+
*/
|
|
11
|
+
export declare function seededRng(seed: number): () => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selects a word index using Zipfian distribution.
|
|
3
|
+
*
|
|
4
|
+
* Higher-ranked words (lower indices) appear more frequently,
|
|
5
|
+
* modeling natural language word frequencies. Uses inverse CDF
|
|
6
|
+
* approximation: `floor(vocabSize * (1 - rng()^(1/s)))` where
|
|
7
|
+
* s ≈ 1.07 maps uniform random values to rank-biased indices.
|
|
8
|
+
*
|
|
9
|
+
* @param rng - stateful random number generator in [0, 1)
|
|
10
|
+
* @param vocabSize - total vocabulary size (exclusive upper bound)
|
|
11
|
+
* @returns integer index in [0, vocabSize)
|
|
12
|
+
*/
|
|
13
|
+
export declare function zipfWord(rng: () => number, vocabSize: number): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { CorpusConfig } from './typings/corpus-config.interface.ts';
|
|
2
|
+
export type { CorpusSection } from './typings/corpus-section.interface.ts';
|
|
3
|
+
export type { BenchResult } from './typings/bench-result.interface.ts';
|
|
4
|
+
export type { BenchSuiteResult } from './typings/bench-suite-result.interface.ts';
|
|
5
|
+
export { CORPUS_DEFAULTS } from './constants/corpus-defaults.constant.ts';
|
|
6
|
+
export { seededRng } from './functions/seeded-rng.function.ts';
|
|
7
|
+
export { zipfWord } from './functions/zipf-word.function.ts';
|
|
8
|
+
export { generateCorpus } from './functions/generate-corpus.function.ts';
|
|
9
|
+
export { measureOperation } from './functions/measure-operation.function.ts';
|
|
10
|
+
export { formatReport } from './functions/format-report.function.ts';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Result of a single benchmark run. */
|
|
2
|
+
export interface BenchResult {
|
|
3
|
+
/** Operation name. */
|
|
4
|
+
readonly operation: string;
|
|
5
|
+
/** Corpus size. */
|
|
6
|
+
readonly corpusSize: number;
|
|
7
|
+
/** Duration in milliseconds. */
|
|
8
|
+
readonly durationMs: number;
|
|
9
|
+
/** Operations per second. */
|
|
10
|
+
readonly opsPerSec: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BenchResult } from './bench-result.interface.ts';
|
|
2
|
+
/** Results from a complete benchmark suite. */
|
|
3
|
+
export interface BenchSuiteResult {
|
|
4
|
+
/** Individual benchmark results. */
|
|
5
|
+
readonly results: BenchResult[];
|
|
6
|
+
/** Timestamp of the run. */
|
|
7
|
+
readonly timestamp: string;
|
|
8
|
+
/** System info. */
|
|
9
|
+
readonly system: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Configuration for synthetic corpus generation. */
|
|
2
|
+
export interface CorpusConfig {
|
|
3
|
+
/** Number of sections to generate. */
|
|
4
|
+
readonly count: number;
|
|
5
|
+
/** Seed for deterministic RNG. */
|
|
6
|
+
readonly seed: number;
|
|
7
|
+
/** Average tokens per section. */
|
|
8
|
+
readonly avgTokens: number;
|
|
9
|
+
/** Vocabulary size. */
|
|
10
|
+
readonly vocabSize: number;
|
|
11
|
+
}
|
package/dist/cli.cjs
CHANGED
|
@@ -125,6 +125,9 @@ function parseArgs(argv) {
|
|
|
125
125
|
parseInt(argv[++i] ?? "", 10) || 0
|
|
126
126
|
);
|
|
127
127
|
break;
|
|
128
|
+
case "--algo":
|
|
129
|
+
options.algo = argv[++i];
|
|
130
|
+
break;
|
|
128
131
|
case "--title":
|
|
129
132
|
options.title = argv[++i];
|
|
130
133
|
break;
|
|
@@ -254,7 +257,8 @@ async function runSearch(client, options) {
|
|
|
254
257
|
query,
|
|
255
258
|
mode: options.mode,
|
|
256
259
|
limit: options.limit,
|
|
257
|
-
offset: options.offset
|
|
260
|
+
offset: options.offset,
|
|
261
|
+
algo: options.algo
|
|
258
262
|
});
|
|
259
263
|
return {
|
|
260
264
|
items: results.items.map((r) => ({
|
|
@@ -2447,6 +2451,11 @@ function createToolDefinitions() {
|
|
|
2447
2451
|
offset: {
|
|
2448
2452
|
type: "number",
|
|
2449
2453
|
description: "Number of results to skip for pagination (default: 0)"
|
|
2454
|
+
},
|
|
2455
|
+
algo: {
|
|
2456
|
+
type: "string",
|
|
2457
|
+
enum: ["lexical", "vector", "hybrid"],
|
|
2458
|
+
description: "Search algorithm (default: lexical)"
|
|
2450
2459
|
}
|
|
2451
2460
|
},
|
|
2452
2461
|
required: ["query"]
|
|
@@ -2860,6 +2869,27 @@ function createToolDefinitions() {
|
|
|
2860
2869
|
idempotentHint: true,
|
|
2861
2870
|
openWorldHint: false
|
|
2862
2871
|
}
|
|
2872
|
+
},
|
|
2873
|
+
{
|
|
2874
|
+
name: "auto-capture-review",
|
|
2875
|
+
description: "Review and approve pending auto-captured knowledge before storage.",
|
|
2876
|
+
inputSchema: {
|
|
2877
|
+
type: "object",
|
|
2878
|
+
properties: {
|
|
2879
|
+
action: {
|
|
2880
|
+
type: "string",
|
|
2881
|
+
enum: ["list", "approve", "reject"],
|
|
2882
|
+
description: "Action to perform on pending captures"
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
},
|
|
2886
|
+
annotations: {
|
|
2887
|
+
title: "Auto-Capture Review",
|
|
2888
|
+
readOnlyHint: false,
|
|
2889
|
+
destructiveHint: false,
|
|
2890
|
+
idempotentHint: true,
|
|
2891
|
+
openWorldHint: false
|
|
2892
|
+
}
|
|
2863
2893
|
}
|
|
2864
2894
|
];
|
|
2865
2895
|
}
|
|
@@ -2933,7 +2963,7 @@ async function handleAgentCreate(client, args) {
|
|
|
2933
2963
|
description
|
|
2934
2964
|
});
|
|
2935
2965
|
const allKbids = [metaResult.kbid, ...skills];
|
|
2936
|
-
const docid = await client.groupSections(name, allKbids);
|
|
2966
|
+
const docid = await client.groupSections(name, allKbids, "agent");
|
|
2937
2967
|
return {
|
|
2938
2968
|
content: [
|
|
2939
2969
|
{
|
|
@@ -3146,6 +3176,8 @@ async function handleToolCall(client, name, args) {
|
|
|
3146
3176
|
return await handleAgentGet(client, args);
|
|
3147
3177
|
case "agent-delete":
|
|
3148
3178
|
return await handleAgentDelete(client, args);
|
|
3179
|
+
case "auto-capture-review":
|
|
3180
|
+
return handleAutoCaptureReview();
|
|
3149
3181
|
default:
|
|
3150
3182
|
return {
|
|
3151
3183
|
content: [
|
|
@@ -3174,7 +3206,8 @@ async function handleSearch2(client, args) {
|
|
|
3174
3206
|
query: asString2(args["query"], ""),
|
|
3175
3207
|
mode: args["mode"],
|
|
3176
3208
|
limit: args["limit"],
|
|
3177
|
-
offset: args["offset"]
|
|
3209
|
+
offset: args["offset"],
|
|
3210
|
+
algo: args["algo"]
|
|
3178
3211
|
});
|
|
3179
3212
|
const stripped = {
|
|
3180
3213
|
...results,
|
|
@@ -3230,7 +3263,8 @@ async function handleLearn2(client, args) {
|
|
|
3230
3263
|
warnings: result.warnings ?? [],
|
|
3231
3264
|
near_duplicates: (result.near_duplicates ?? []).map((d) => ({
|
|
3232
3265
|
kbid: d.kbid,
|
|
3233
|
-
similarity: d.similarity
|
|
3266
|
+
similarity: d.similarity,
|
|
3267
|
+
...d.method !== void 0 ? { method: d.method } : {}
|
|
3234
3268
|
}))
|
|
3235
3269
|
};
|
|
3236
3270
|
return {
|
|
@@ -3478,6 +3512,19 @@ async function handleSkillDelete(client, args) {
|
|
|
3478
3512
|
]
|
|
3479
3513
|
};
|
|
3480
3514
|
}
|
|
3515
|
+
function handleAutoCaptureReview() {
|
|
3516
|
+
return {
|
|
3517
|
+
content: [
|
|
3518
|
+
{
|
|
3519
|
+
type: "text",
|
|
3520
|
+
text: JSON.stringify({
|
|
3521
|
+
pending: [],
|
|
3522
|
+
message: "No pending auto-captured knowledge entries."
|
|
3523
|
+
})
|
|
3524
|
+
}
|
|
3525
|
+
]
|
|
3526
|
+
};
|
|
3527
|
+
}
|
|
3481
3528
|
async function handleExport2(client, args) {
|
|
3482
3529
|
const path = typeof args["path"] === "string" ? args["path"] : void 0;
|
|
3483
3530
|
const result = await client.export(
|
|
@@ -3588,8 +3635,12 @@ function buildSkillsText(skillSections) {
|
|
|
3588
3635
|
${lines.join("\n")}`;
|
|
3589
3636
|
}
|
|
3590
3637
|
async function handleAgentPrompt(name, client) {
|
|
3591
|
-
const
|
|
3592
|
-
const
|
|
3638
|
+
const agentName = name.slice(6);
|
|
3639
|
+
const agents = await client.listDocumentsByType("agent");
|
|
3640
|
+
const doc = agents.find((a) => a.title === agentName);
|
|
3641
|
+
if (!doc) {
|
|
3642
|
+
throw new Error("agent not found: " + agentName);
|
|
3643
|
+
}
|
|
3593
3644
|
const sections = doc.sections;
|
|
3594
3645
|
const metaSection = sections.at(0);
|
|
3595
3646
|
const skillRefs = sections.slice(1);
|
|
@@ -3747,13 +3798,16 @@ var McpServer = class {
|
|
|
3747
3798
|
input: process.stdin,
|
|
3748
3799
|
terminal: false
|
|
3749
3800
|
});
|
|
3801
|
+
let pending = Promise.resolve();
|
|
3750
3802
|
await new Promise((resolve4) => {
|
|
3751
3803
|
rl.on("line", (line) => {
|
|
3752
|
-
|
|
3804
|
+
pending = pending.then(() => this.dispatchLine(line));
|
|
3753
3805
|
});
|
|
3754
3806
|
rl.on("close", () => {
|
|
3755
|
-
|
|
3756
|
-
|
|
3807
|
+
void pending.then(() => {
|
|
3808
|
+
this.client.disconnect();
|
|
3809
|
+
resolve4();
|
|
3810
|
+
});
|
|
3757
3811
|
});
|
|
3758
3812
|
});
|
|
3759
3813
|
}
|