@vpxa/kb 0.1.13 → 0.1.16
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 +65 -12
- package/package.json +14 -7
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -21
- package/packages/analyzers/dist/blast-radius-analyzer.js +5 -12
- package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -28
- package/packages/analyzers/dist/dependency-analyzer.js +6 -9
- package/packages/analyzers/dist/diagram-generator.d.ts +12 -9
- package/packages/analyzers/dist/diagram-generator.js +2 -4
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -36
- package/packages/analyzers/dist/entry-point-analyzer.js +4 -6
- package/packages/analyzers/dist/index.d.ts +12 -14
- package/packages/analyzers/dist/index.js +1 -1
- package/packages/analyzers/dist/knowledge-producer.d.ts +34 -26
- package/packages/analyzers/dist/knowledge-producer.js +17 -15
- package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -11
- package/packages/analyzers/dist/pattern-analyzer.js +2 -5
- package/packages/analyzers/dist/regex-call-graph.d.ts +6 -13
- package/packages/analyzers/dist/regex-call-graph.js +1 -1
- package/packages/analyzers/dist/structure-analyzer.d.ts +13 -10
- package/packages/analyzers/dist/structure-analyzer.js +2 -4
- package/packages/analyzers/dist/symbol-analyzer.d.ts +13 -9
- package/packages/analyzers/dist/symbol-analyzer.js +9 -13
- package/packages/analyzers/dist/ts-call-graph.d.ts +16 -14
- package/packages/analyzers/dist/ts-call-graph.js +1 -1
- package/packages/analyzers/dist/types.d.ts +82 -80
- package/packages/analyzers/dist/types.js +1 -0
- package/packages/chunker/dist/call-graph-extractor.d.ts +15 -12
- package/packages/chunker/dist/call-graph-extractor.js +1 -1
- package/packages/chunker/dist/chunker-factory.d.ts +16 -4
- package/packages/chunker/dist/chunker-factory.js +1 -1
- package/packages/chunker/dist/chunker.interface.d.ts +8 -5
- package/packages/chunker/dist/chunker.interface.js +1 -0
- package/packages/chunker/dist/code-chunker.d.ts +16 -13
- package/packages/chunker/dist/code-chunker.js +11 -14
- package/packages/chunker/dist/extractors/call-extractor.d.ts +24 -0
- package/packages/chunker/dist/extractors/call-extractor.js +1 -0
- package/packages/chunker/dist/extractors/entry-point-detector.d.ts +14 -0
- package/packages/chunker/dist/extractors/entry-point-detector.js +1 -0
- package/packages/chunker/dist/extractors/import-extractor.d.ts +14 -0
- package/packages/chunker/dist/extractors/import-extractor.js +1 -0
- package/packages/chunker/dist/extractors/pattern-detector.d.ts +14 -0
- package/packages/chunker/dist/extractors/pattern-detector.js +1 -0
- package/packages/chunker/dist/extractors/scope-resolver.d.ts +26 -0
- package/packages/chunker/dist/extractors/scope-resolver.js +1 -0
- package/packages/chunker/dist/extractors/symbol-extractor.d.ts +14 -0
- package/packages/chunker/dist/extractors/symbol-extractor.js +1 -0
- package/packages/chunker/dist/extractors/types.d.ts +36 -0
- package/packages/chunker/dist/extractors/types.js +1 -0
- package/packages/chunker/dist/generic-chunker.d.ts +14 -11
- package/packages/chunker/dist/generic-chunker.js +5 -5
- package/packages/chunker/dist/index.d.ts +19 -8
- package/packages/chunker/dist/index.js +1 -1
- package/packages/chunker/dist/markdown-chunker.d.ts +16 -13
- package/packages/chunker/dist/markdown-chunker.js +3 -10
- package/packages/chunker/dist/wasm/languages.d.ts +18 -0
- package/packages/chunker/dist/wasm/languages.js +1 -0
- package/packages/chunker/dist/wasm/query-executor.d.ts +70 -0
- package/packages/chunker/dist/wasm/query-executor.js +1 -0
- package/packages/chunker/dist/wasm/runtime.d.ts +44 -0
- package/packages/chunker/dist/wasm/runtime.js +1 -0
- package/packages/chunker/dist/wasm/types.d.ts +84 -0
- package/packages/chunker/dist/wasm/types.js +1 -0
- package/packages/chunker/dist/wasm-chunker.d.ts +23 -0
- package/packages/chunker/dist/wasm-chunker.js +6 -0
- package/packages/chunker/src/queries/go/calls.scm +11 -0
- package/packages/chunker/src/queries/go/entry-points.scm +20 -0
- package/packages/chunker/src/queries/go/imports.scm +6 -0
- package/packages/chunker/src/queries/go/patterns.scm +25 -0
- package/packages/chunker/src/queries/go/symbols.scm +26 -0
- package/packages/chunker/src/queries/java/calls.scm +10 -0
- package/packages/chunker/src/queries/java/entry-points.scm +27 -0
- package/packages/chunker/src/queries/java/imports.scm +11 -0
- package/packages/chunker/src/queries/java/patterns.scm +27 -0
- package/packages/chunker/src/queries/java/symbols.scm +28 -0
- package/packages/chunker/src/queries/javascript/calls.scm +21 -0
- package/packages/chunker/src/queries/javascript/entry-points.scm +31 -0
- package/packages/chunker/src/queries/javascript/imports.scm +32 -0
- package/packages/chunker/src/queries/javascript/patterns.scm +28 -0
- package/packages/chunker/src/queries/javascript/symbols.scm +52 -0
- package/packages/chunker/src/queries/python/calls.scm +11 -0
- package/packages/chunker/src/queries/python/entry-points.scm +21 -0
- package/packages/chunker/src/queries/python/imports.scm +14 -0
- package/packages/chunker/src/queries/python/patterns.scm +25 -0
- package/packages/chunker/src/queries/python/symbols.scm +17 -0
- package/packages/chunker/src/queries/rust/calls.scm +20 -0
- package/packages/chunker/src/queries/rust/entry-points.scm +7 -0
- package/packages/chunker/src/queries/rust/imports.scm +26 -0
- package/packages/chunker/src/queries/rust/patterns.scm +18 -0
- package/packages/chunker/src/queries/rust/symbols.scm +73 -0
- package/packages/chunker/src/queries/typescript/calls.scm +21 -0
- package/packages/chunker/src/queries/typescript/entry-points.scm +48 -0
- package/packages/chunker/src/queries/typescript/imports.scm +35 -0
- package/packages/chunker/src/queries/typescript/patterns.scm +47 -0
- package/packages/chunker/src/queries/typescript/symbols.scm +79 -0
- package/packages/chunker/wasm/tree-sitter-go.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-java.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-javascript.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-python.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-rust.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-typescript.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter.wasm +0 -0
- package/packages/cli/dist/commands/analyze.d.ts +6 -3
- package/packages/cli/dist/commands/analyze.js +2 -3
- package/packages/cli/dist/commands/context-cmds.d.ts +6 -3
- package/packages/cli/dist/commands/context-cmds.js +1 -1
- package/packages/cli/dist/commands/environment.d.ts +6 -3
- package/packages/cli/dist/commands/environment.js +1 -2
- package/packages/cli/dist/commands/execution.d.ts +6 -3
- package/packages/cli/dist/commands/execution.js +1 -1
- package/packages/cli/dist/commands/graph.d.ts +6 -3
- package/packages/cli/dist/commands/graph.js +5 -6
- package/packages/cli/dist/commands/init/adapters.d.ts +28 -0
- package/packages/cli/dist/commands/init/adapters.js +1 -0
- package/packages/cli/dist/commands/init/config.d.ts +10 -0
- package/packages/cli/dist/commands/init/config.js +3 -0
- package/packages/cli/dist/commands/init/constants.d.ts +18 -0
- package/packages/cli/dist/commands/init/constants.js +1 -0
- package/packages/cli/dist/commands/init/curated.d.ts +7 -0
- package/packages/cli/dist/commands/init/curated.js +1 -0
- package/packages/cli/dist/commands/init/global.d.ts +34 -0
- package/packages/cli/dist/commands/init/global.js +5 -0
- package/packages/cli/dist/commands/init/index.d.ts +28 -0
- package/packages/cli/dist/commands/init/index.js +5 -0
- package/packages/cli/dist/commands/init/scaffold.d.ts +23 -0
- package/packages/cli/dist/commands/init/scaffold.js +1 -0
- package/packages/cli/dist/commands/init/templates.d.ts +9 -0
- package/packages/cli/dist/commands/init/templates.js +165 -0
- package/packages/cli/dist/commands/knowledge.d.ts +6 -3
- package/packages/cli/dist/commands/knowledge.js +1 -1
- package/packages/cli/dist/commands/search.d.ts +6 -3
- package/packages/cli/dist/commands/search.js +1 -8
- package/packages/cli/dist/commands/system.d.ts +6 -3
- package/packages/cli/dist/commands/system.js +4 -7
- package/packages/cli/dist/commands/workspace.d.ts +6 -3
- package/packages/cli/dist/commands/workspace.js +1 -2
- package/packages/cli/dist/context.d.ts +7 -5
- package/packages/cli/dist/context.js +1 -1
- package/packages/cli/dist/helpers.d.ts +51 -48
- package/packages/cli/dist/helpers.js +5 -5
- package/packages/cli/dist/index.d.ts +4 -2
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/dist/kb-init.d.ts +48 -51
- package/packages/cli/dist/kb-init.js +1 -1
- package/packages/cli/dist/types.d.ts +8 -6
- package/packages/cli/dist/types.js +1 -0
- package/packages/core/dist/constants.d.ts +58 -34
- package/packages/core/dist/constants.js +1 -1
- package/packages/core/dist/content-detector.d.ts +8 -8
- package/packages/core/dist/content-detector.js +1 -1
- package/packages/core/dist/errors.d.ts +15 -13
- package/packages/core/dist/errors.js +1 -1
- package/packages/core/dist/global-registry.d.ts +62 -0
- package/packages/core/dist/global-registry.js +1 -0
- package/packages/core/dist/index.d.ts +7 -6
- package/packages/core/dist/index.js +1 -1
- package/packages/core/dist/logger.d.ts +19 -8
- package/packages/core/dist/logger.js +1 -1
- package/packages/core/dist/types.d.ts +107 -92
- package/packages/core/dist/types.js +1 -0
- package/packages/embeddings/dist/embedder.interface.d.ts +22 -20
- package/packages/embeddings/dist/embedder.interface.js +1 -0
- package/packages/embeddings/dist/index.d.ts +3 -3
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/embeddings/dist/onnx-embedder.d.ts +21 -23
- package/packages/embeddings/dist/onnx-embedder.js +1 -1
- package/packages/enterprise-bridge/dist/cache.d.ts +28 -0
- package/packages/enterprise-bridge/dist/cache.js +1 -0
- package/packages/enterprise-bridge/dist/er-client.d.ts +37 -0
- package/packages/enterprise-bridge/dist/er-client.js +1 -0
- package/packages/enterprise-bridge/dist/evolution-collector.d.ts +62 -0
- package/packages/enterprise-bridge/dist/evolution-collector.js +1 -0
- package/packages/enterprise-bridge/dist/index.d.ts +8 -0
- package/packages/enterprise-bridge/dist/index.js +1 -0
- package/packages/enterprise-bridge/dist/policy-store.d.ts +45 -0
- package/packages/enterprise-bridge/dist/policy-store.js +1 -0
- package/packages/enterprise-bridge/dist/push-adapter.d.ts +23 -0
- package/packages/enterprise-bridge/dist/push-adapter.js +1 -0
- package/packages/enterprise-bridge/dist/result-merger.d.ts +14 -0
- package/packages/enterprise-bridge/dist/result-merger.js +1 -0
- package/packages/enterprise-bridge/dist/types.d.ts +81 -0
- package/packages/enterprise-bridge/dist/types.js +1 -0
- package/packages/indexer/dist/file-hasher.d.ts +5 -3
- package/packages/indexer/dist/file-hasher.js +1 -1
- package/packages/indexer/dist/filesystem-crawler.d.ts +23 -21
- package/packages/indexer/dist/filesystem-crawler.js +1 -1
- package/packages/indexer/dist/graph-extractor.d.ts +9 -13
- package/packages/indexer/dist/graph-extractor.js +1 -1
- package/packages/indexer/dist/incremental-indexer.d.ts +49 -44
- package/packages/indexer/dist/incremental-indexer.js +1 -1
- package/packages/indexer/dist/index.d.ts +5 -5
- package/packages/indexer/dist/index.js +1 -1
- package/packages/server/dist/api.d.ts +3 -8
- package/packages/server/dist/api.js +1 -1
- package/packages/server/dist/config.d.ts +6 -3
- package/packages/server/dist/config.js +1 -1
- package/packages/server/dist/cross-workspace.d.ts +43 -0
- package/packages/server/dist/cross-workspace.js +1 -0
- package/packages/server/dist/curated-manager.d.ts +80 -78
- package/packages/server/dist/curated-manager.js +5 -10
- package/packages/server/dist/index.d.ts +1 -2
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/replay-interceptor.d.ts +6 -7
- package/packages/server/dist/replay-interceptor.js +1 -1
- package/packages/server/dist/resources/resources.d.ts +7 -4
- package/packages/server/dist/resources/resources.js +2 -2
- package/packages/server/dist/server.d.ts +37 -25
- package/packages/server/dist/server.js +1 -1
- package/packages/server/dist/tools/analyze.tools.d.ts +14 -11
- package/packages/server/dist/tools/analyze.tools.js +1 -3
- package/packages/server/dist/tools/audit.tool.d.ts +8 -5
- package/packages/server/dist/tools/audit.tool.js +1 -4
- package/packages/server/dist/tools/bridge.tools.d.ts +34 -0
- package/packages/server/dist/tools/bridge.tools.js +15 -0
- package/packages/server/dist/tools/evolution.tools.d.ts +7 -0
- package/packages/server/dist/tools/evolution.tools.js +5 -0
- package/packages/server/dist/tools/forge.tools.d.ts +13 -12
- package/packages/server/dist/tools/forge.tools.js +10 -13
- package/packages/server/dist/tools/forget.tool.d.ts +7 -4
- package/packages/server/dist/tools/forget.tool.js +1 -7
- package/packages/server/dist/tools/graph.tool.d.ts +7 -4
- package/packages/server/dist/tools/graph.tool.js +4 -5
- package/packages/server/dist/tools/list.tool.d.ts +7 -4
- package/packages/server/dist/tools/list.tool.js +2 -8
- package/packages/server/dist/tools/lookup.tool.d.ts +7 -4
- package/packages/server/dist/tools/lookup.tool.js +2 -9
- package/packages/server/dist/tools/onboard.tool.d.ts +8 -5
- package/packages/server/dist/tools/onboard.tool.js +2 -2
- package/packages/server/dist/tools/policy.tools.d.ts +7 -0
- package/packages/server/dist/tools/policy.tools.js +2 -0
- package/packages/server/dist/tools/produce.tool.d.ts +6 -3
- package/packages/server/dist/tools/produce.tool.js +2 -2
- package/packages/server/dist/tools/read.tool.d.ts +7 -4
- package/packages/server/dist/tools/read.tool.js +2 -6
- package/packages/server/dist/tools/reindex.tool.d.ts +10 -7
- package/packages/server/dist/tools/reindex.tool.js +3 -2
- package/packages/server/dist/tools/remember.tool.d.ts +8 -4
- package/packages/server/dist/tools/remember.tool.js +3 -5
- package/packages/server/dist/tools/replay.tool.d.ts +6 -3
- package/packages/server/dist/tools/replay.tool.js +2 -6
- package/packages/server/dist/tools/search.tool.d.ts +10 -5
- package/packages/server/dist/tools/search.tool.js +6 -22
- package/packages/server/dist/tools/status.tool.d.ts +12 -4
- package/packages/server/dist/tools/status.tool.js +2 -3
- package/packages/server/dist/tools/toolkit.tools.d.ts +36 -35
- package/packages/server/dist/tools/toolkit.tools.js +20 -24
- package/packages/server/dist/tools/update.tool.d.ts +7 -4
- package/packages/server/dist/tools/update.tool.js +1 -6
- package/packages/server/dist/tools/utility.tools.d.ts +15 -15
- package/packages/server/dist/tools/utility.tools.js +10 -23
- package/packages/server/dist/version-check.d.ts +5 -2
- package/packages/server/dist/version-check.js +1 -1
- package/packages/store/dist/graph-store.interface.d.ts +89 -87
- package/packages/store/dist/graph-store.interface.js +1 -0
- package/packages/store/dist/index.d.ts +6 -6
- package/packages/store/dist/index.js +1 -1
- package/packages/store/dist/lance-store.d.ts +37 -31
- package/packages/store/dist/lance-store.js +1 -1
- package/packages/store/dist/sqlite-graph-store.d.ts +43 -47
- package/packages/store/dist/sqlite-graph-store.js +13 -13
- package/packages/store/dist/store-factory.d.ts +11 -8
- package/packages/store/dist/store-factory.js +1 -1
- package/packages/store/dist/store.interface.d.ts +47 -47
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +61 -62
- package/packages/tools/dist/audit.js +4 -5
- package/packages/tools/dist/batch.d.ts +20 -18
- package/packages/tools/dist/batch.js +1 -1
- package/packages/tools/dist/changelog.d.ts +29 -27
- package/packages/tools/dist/changelog.js +2 -2
- package/packages/tools/dist/check.d.ts +42 -39
- package/packages/tools/dist/check.js +2 -2
- package/packages/tools/dist/checkpoint.d.ts +17 -15
- package/packages/tools/dist/checkpoint.js +1 -2
- package/packages/tools/dist/codemod.d.ts +35 -33
- package/packages/tools/dist/codemod.js +2 -2
- package/packages/tools/dist/compact.d.ts +34 -38
- package/packages/tools/dist/compact.js +2 -2
- package/packages/tools/dist/data-transform.d.ts +10 -8
- package/packages/tools/dist/data-transform.js +1 -1
- package/packages/tools/dist/dead-symbols.d.ts +29 -26
- package/packages/tools/dist/dead-symbols.js +2 -2
- package/packages/tools/dist/delegate.d.ts +26 -24
- package/packages/tools/dist/delegate.js +1 -5
- package/packages/tools/dist/diff-parse.d.ts +24 -22
- package/packages/tools/dist/diff-parse.js +3 -3
- package/packages/tools/dist/digest.d.ts +43 -46
- package/packages/tools/dist/digest.js +4 -5
- package/packages/tools/dist/dogfood-log.d.ts +49 -0
- package/packages/tools/dist/dogfood-log.js +2 -0
- package/packages/tools/dist/encode.d.ts +11 -9
- package/packages/tools/dist/encode.js +1 -1
- package/packages/tools/dist/env-info.d.ts +25 -23
- package/packages/tools/dist/env-info.js +1 -1
- package/packages/tools/dist/eval.d.ts +13 -11
- package/packages/tools/dist/eval.js +2 -3
- package/packages/tools/dist/evidence-map.d.ts +64 -62
- package/packages/tools/dist/evidence-map.js +2 -3
- package/packages/tools/dist/file-cache.d.ts +41 -0
- package/packages/tools/dist/file-cache.js +3 -0
- package/packages/tools/dist/file-summary.d.ts +50 -30
- package/packages/tools/dist/file-summary.js +2 -2
- package/packages/tools/dist/file-walk.d.ts +6 -4
- package/packages/tools/dist/file-walk.js +1 -1
- package/packages/tools/dist/find-examples.d.ts +26 -22
- package/packages/tools/dist/find-examples.js +3 -3
- package/packages/tools/dist/find.d.ts +39 -41
- package/packages/tools/dist/find.js +1 -1
- package/packages/tools/dist/forge-classify.d.ts +35 -39
- package/packages/tools/dist/forge-classify.js +2 -2
- package/packages/tools/dist/forge-ground.d.ts +58 -61
- package/packages/tools/dist/forge-ground.js +1 -1
- package/packages/tools/dist/git-context.d.ts +22 -20
- package/packages/tools/dist/git-context.js +3 -3
- package/packages/tools/dist/graph-query.d.ts +75 -79
- package/packages/tools/dist/graph-query.js +1 -1
- package/packages/tools/dist/guide.d.ts +14 -12
- package/packages/tools/dist/guide.js +1 -1
- package/packages/tools/dist/health.d.ts +13 -11
- package/packages/tools/dist/health.js +2 -2
- package/packages/tools/dist/http-request.d.ts +20 -18
- package/packages/tools/dist/http-request.js +1 -1
- package/packages/tools/dist/index.d.ts +55 -53
- package/packages/tools/dist/index.js +1 -1
- package/packages/tools/dist/lane.d.ts +28 -26
- package/packages/tools/dist/lane.js +6 -7
- package/packages/tools/dist/measure.d.ts +34 -30
- package/packages/tools/dist/measure.js +2 -2
- package/packages/tools/dist/onboard.d.ts +29 -27
- package/packages/tools/dist/onboard.js +17 -41
- package/packages/tools/dist/parse-output.d.ts +48 -46
- package/packages/tools/dist/parse-output.js +2 -2
- package/packages/tools/dist/path-resolver.d.ts +4 -2
- package/packages/tools/dist/path-resolver.js +1 -1
- package/packages/tools/dist/process-manager.d.ts +18 -16
- package/packages/tools/dist/process-manager.js +1 -1
- package/packages/tools/dist/queue.d.ts +28 -26
- package/packages/tools/dist/queue.js +1 -2
- package/packages/tools/dist/regex-test.d.ts +26 -24
- package/packages/tools/dist/regex-test.js +1 -1
- package/packages/tools/dist/rename.d.ts +28 -26
- package/packages/tools/dist/rename.js +2 -2
- package/packages/tools/dist/replay.d.ts +33 -31
- package/packages/tools/dist/replay.js +4 -6
- package/packages/tools/dist/response-envelope.d.ts +32 -30
- package/packages/tools/dist/response-envelope.js +1 -1
- package/packages/tools/dist/schema-validate.d.ts +15 -13
- package/packages/tools/dist/schema-validate.js +1 -1
- package/packages/tools/dist/scope-map.d.ts +45 -48
- package/packages/tools/dist/scope-map.js +1 -1
- package/packages/tools/dist/snippet.d.ts +26 -25
- package/packages/tools/dist/snippet.js +1 -1
- package/packages/tools/dist/stash.d.ts +13 -11
- package/packages/tools/dist/stash.js +1 -2
- package/packages/tools/dist/stratum-card.d.ts +27 -28
- package/packages/tools/dist/stratum-card.js +3 -5
- package/packages/tools/dist/symbol.d.ts +31 -26
- package/packages/tools/dist/symbol.js +3 -3
- package/packages/tools/dist/test-run.d.ts +19 -16
- package/packages/tools/dist/test-run.js +2 -2
- package/packages/tools/dist/text-utils.d.ts +6 -4
- package/packages/tools/dist/text-utils.js +2 -2
- package/packages/tools/dist/time-utils.d.ts +15 -13
- package/packages/tools/dist/time-utils.js +1 -1
- package/packages/tools/dist/trace.d.ts +26 -21
- package/packages/tools/dist/trace.js +2 -2
- package/packages/tools/dist/truncation.d.ts +6 -4
- package/packages/tools/dist/truncation.js +6 -13
- package/packages/tools/dist/watch.d.ts +28 -26
- package/packages/tools/dist/watch.js +1 -1
- package/packages/tools/dist/web-fetch.d.ts +35 -33
- package/packages/tools/dist/web-fetch.js +6 -12
- package/packages/tools/dist/web-search.d.ts +16 -14
- package/packages/tools/dist/web-search.js +1 -1
- package/packages/tools/dist/workset.d.ts +19 -17
- package/packages/tools/dist/workset.js +1 -2
- package/packages/tui/dist/App-CYLNJLr6.js +2 -0
- package/packages/tui/dist/App.d.ts +11 -6
- package/packages/tui/dist/App.js +1 -450
- package/packages/tui/dist/CuratedPanel-sYdZAICX.js +2 -0
- package/packages/tui/dist/LogPanel-DtMnoyXT.js +3 -0
- package/packages/tui/dist/SearchPanel-DREo6zgt.js +2 -0
- package/packages/tui/dist/StatusPanel-2ex8fLOO.js +2 -0
- package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
- package/packages/tui/dist/devtools-DUyj952l.js +7 -0
- package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +28 -0
- package/packages/tui/dist/index-B9VpfVPP.d.ts +13 -0
- package/packages/tui/dist/index.d.ts +3 -19
- package/packages/tui/dist/index.js +1 -476
- package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +316 -0
- package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -6
- package/packages/tui/dist/panels/CuratedPanel.js +1 -371
- package/packages/tui/dist/panels/LogPanel.d.ts +7 -3
- package/packages/tui/dist/panels/LogPanel.js +1 -449
- package/packages/tui/dist/panels/SearchPanel.d.ts +14 -8
- package/packages/tui/dist/panels/SearchPanel.js +1 -372
- package/packages/tui/dist/panels/StatusPanel.d.ts +11 -6
- package/packages/tui/dist/panels/StatusPanel.js +1 -371
- package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +150 -0
- package/scaffold/adapters/claude-code.mjs +20 -0
- package/scaffold/adapters/copilot.mjs +320 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Alpha.agent.md +21 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +21 -0
- package/scaffold/copilot/agents/Documenter.agent.md +42 -0
- package/scaffold/copilot/agents/Orchestrator.agent.md +104 -0
- package/scaffold/copilot/agents/Planner.agent.md +54 -0
- package/scaffold/copilot/agents/Refactor.agent.md +36 -0
- package/scaffold/copilot/agents/Researcher-Alpha.agent.md +20 -0
- package/scaffold/copilot/agents/Researcher-Beta.agent.md +20 -0
- package/scaffold/copilot/agents/Researcher-Delta.agent.md +20 -0
- package/scaffold/copilot/agents/Researcher-Gamma.agent.md +20 -0
- package/scaffold/definitions/agents.mjs +165 -0
- package/scaffold/definitions/bodies.mjs +292 -0
- package/scaffold/definitions/hooks.mjs +43 -0
- package/scaffold/definitions/models.mjs +56 -0
- package/scaffold/definitions/plugins.mjs +24 -0
- package/scaffold/definitions/prompts.mjs +145 -0
- package/scaffold/definitions/protocols.mjs +322 -0
- package/scaffold/definitions/tools.mjs +176 -0
- package/scaffold/general/agents/Architect-Reviewer-Alpha.agent.md +21 -0
- package/scaffold/general/agents/Architect-Reviewer-Beta.agent.md +21 -0
- package/scaffold/general/agents/Code-Reviewer-Alpha.agent.md +12 -0
- package/scaffold/general/agents/Code-Reviewer-Beta.agent.md +12 -0
- package/scaffold/general/agents/Debugger.agent.md +31 -0
- package/scaffold/general/agents/Documenter.agent.md +42 -0
- package/scaffold/general/agents/Explorer.agent.md +50 -0
- package/scaffold/general/agents/Frontend.agent.md +29 -0
- package/scaffold/general/agents/Implementer.agent.md +31 -0
- package/scaffold/general/agents/Orchestrator.agent.md +104 -0
- package/scaffold/general/agents/Planner.agent.md +55 -0
- package/scaffold/general/agents/README.md +57 -0
- package/scaffold/general/agents/Refactor.agent.md +36 -0
- package/scaffold/general/agents/Researcher-Alpha.agent.md +20 -0
- package/scaffold/general/agents/Researcher-Beta.agent.md +20 -0
- package/scaffold/general/agents/Researcher-Delta.agent.md +20 -0
- package/scaffold/general/agents/Researcher-Gamma.agent.md +20 -0
- package/scaffold/general/agents/Security.agent.md +42 -0
- package/scaffold/general/agents/_shared/adr-protocol.md +91 -0
- package/scaffold/general/agents/_shared/architect-reviewer-base.md +50 -0
- package/scaffold/general/agents/_shared/code-agent-base.md +88 -0
- package/scaffold/general/agents/_shared/code-reviewer-base.md +54 -0
- package/scaffold/general/agents/_shared/decision-protocol.md +27 -0
- package/scaffold/general/agents/_shared/forge-protocol.md +46 -0
- package/scaffold/general/agents/_shared/researcher-base.md +61 -0
- package/scaffold/general/agents/templates/adr-template.md +27 -0
- package/scaffold/general/agents/templates/execution-state.md +25 -0
- package/scaffold/general/prompts/ask.prompt.md +20 -0
- package/scaffold/general/prompts/debug.prompt.md +25 -0
- package/scaffold/general/prompts/design.prompt.md +22 -0
- package/scaffold/general/prompts/implement.prompt.md +26 -0
- package/scaffold/general/prompts/plan.prompt.md +24 -0
- package/scaffold/general/prompts/review.prompt.md +31 -0
- package/scaffold/generate.mjs +74 -0
- package/skills/adr-skill/SKILL.md +329 -0
- package/skills/adr-skill/assets/templates/adr-madr.md +89 -0
- package/skills/adr-skill/assets/templates/adr-readme.md +20 -0
- package/skills/adr-skill/assets/templates/adr-simple.md +46 -0
- package/skills/adr-skill/references/adr-conventions.md +95 -0
- package/skills/adr-skill/references/examples.md +193 -0
- package/skills/adr-skill/references/review-checklist.md +77 -0
- package/skills/adr-skill/references/template-variants.md +52 -0
- package/skills/adr-skill/scripts/bootstrap_adr.js +259 -0
- package/skills/adr-skill/scripts/new_adr.js +391 -0
- package/skills/adr-skill/scripts/set_adr_status.js +169 -0
- package/skills/brainstorming/SKILL.md +259 -0
- package/skills/brainstorming/scripts/frame-template.html +365 -0
- package/skills/brainstorming/scripts/helper.js +216 -0
- package/skills/brainstorming/scripts/server.cjs +9 -0
- package/skills/brainstorming/scripts/server.src.cjs +249 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +430 -0
- package/skills/c4-architecture/SKILL.md +295 -0
- package/skills/c4-architecture/references/advanced-patterns.md +552 -0
- package/skills/c4-architecture/references/c4-syntax.md +492 -0
- package/skills/c4-architecture/references/common-mistakes.md +437 -0
- package/skills/knowledge-base/SKILL.md +100 -10
- package/skills/lesson-learned/SKILL.md +105 -0
- package/skills/lesson-learned/references/anti-patterns.md +55 -0
- package/skills/lesson-learned/references/se-principles.md +109 -0
- package/skills/requirements-clarity/SKILL.md +324 -0
- package/skills/session-handoff/SKILL.md +189 -0
- package/skills/session-handoff/references/handoff-template.md +139 -0
- package/skills/session-handoff/references/resume-checklist.md +80 -0
- package/skills/session-handoff/scripts/check_staleness.js +269 -0
- package/skills/session-handoff/scripts/create_handoff.js +299 -0
- package/skills/session-handoff/scripts/list_handoffs.js +113 -0
- package/skills/session-handoff/scripts/validate_handoff.js +241 -0
- package/packages/chunker/dist/treesitter-chunker.d.ts +0 -47
- package/packages/chunker/dist/treesitter-chunker.js +0 -8
- package/packages/cli/dist/commands/init.d.ts +0 -10
- package/packages/cli/dist/commands/init.js +0 -308
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { IndexStats, KnowledgeRecord, SearchResult } from '@kb/core';
|
|
1
|
+
import { ContentType, IndexStats, KnowledgeOrigin, KnowledgeRecord, SearchResult, SourceType } from "@kb/core";
|
|
2
|
+
|
|
3
|
+
//#region packages/store/src/store.interface.d.ts
|
|
5
4
|
/** Options for searching the store */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
interface SearchOptions {
|
|
6
|
+
/** Maximum number of results to return */
|
|
7
|
+
limit?: number;
|
|
8
|
+
/** Minimum similarity score (0-1) */
|
|
9
|
+
minScore?: number;
|
|
10
|
+
/** Filter by content type */
|
|
11
|
+
contentType?: ContentType;
|
|
12
|
+
/** Filter by coarse source type (source, documentation, test, config, generated) */
|
|
13
|
+
sourceType?: SourceType;
|
|
14
|
+
/** Filter by origin */
|
|
15
|
+
origin?: KnowledgeOrigin;
|
|
16
|
+
/** Filter by category */
|
|
17
|
+
category?: string;
|
|
18
|
+
/** Filter by tags (any match) */
|
|
19
|
+
tags?: string[];
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
21
|
+
interface IKnowledgeStore {
|
|
22
|
+
/** Initialize the store (create tables, etc.) */
|
|
23
|
+
initialize(): Promise<void>;
|
|
24
|
+
/** Add or update records with their embedding vectors */
|
|
25
|
+
upsert(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
|
|
26
|
+
/** Search by vector similarity */
|
|
27
|
+
search(queryVector: Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
|
|
28
|
+
/** Get a specific record by ID */
|
|
29
|
+
getById(id: string): Promise<KnowledgeRecord | null>;
|
|
30
|
+
/** Delete records by source path (used during re-indexing) */
|
|
31
|
+
deleteBySourcePath(sourcePath: string): Promise<number>;
|
|
32
|
+
/** Delete a specific record by ID */
|
|
33
|
+
deleteById(id: string): Promise<boolean>;
|
|
34
|
+
/** Get all records for a source path */
|
|
35
|
+
getBySourcePath(sourcePath: string): Promise<KnowledgeRecord[]>;
|
|
36
|
+
/** Get index statistics */
|
|
37
|
+
getStats(): Promise<IndexStats>;
|
|
38
|
+
/** List all unique source paths in the store */
|
|
39
|
+
listSourcePaths(): Promise<string[]>;
|
|
40
|
+
/** Create a full-text search index on the content column for keyword search */
|
|
41
|
+
createFtsIndex(): Promise<void>;
|
|
42
|
+
/** Full-text keyword search (requires FTS index) */
|
|
43
|
+
ftsSearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
|
|
44
|
+
/** Drop the backing table entirely — used for hard resets (e.g. dimension changes) */
|
|
45
|
+
dropTable(): Promise<void>;
|
|
46
|
+
/** Close the store connection */
|
|
47
|
+
close(): Promise<void>;
|
|
49
48
|
}
|
|
50
|
-
//#
|
|
49
|
+
//#endregion
|
|
50
|
+
export { IKnowledgeStore, SearchOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -1,66 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/** Detail level (default: 'summary') */
|
|
15
|
-
detail?: 'summary' | 'full';
|
|
1
|
+
import { KBResponse } from "./response-envelope.js";
|
|
2
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
3
|
+
import { IKnowledgeStore } from "@kb/store";
|
|
4
|
+
|
|
5
|
+
//#region packages/tools/src/audit.d.ts
|
|
6
|
+
type AuditCheck = 'structure' | 'dependencies' | 'patterns' | 'health' | 'dead_symbols' | 'check' | 'entry_points';
|
|
7
|
+
interface AuditOptions {
|
|
8
|
+
/** Root path to audit (default: cwd) */
|
|
9
|
+
path?: string;
|
|
10
|
+
/** Which checks to run (default: all) */
|
|
11
|
+
checks?: AuditCheck[];
|
|
12
|
+
/** Detail level (default: 'summary') */
|
|
13
|
+
detail?: 'summary' | 'full';
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
interface AuditRecommendation {
|
|
16
|
+
priority: 'high' | 'medium' | 'low';
|
|
17
|
+
area: string;
|
|
18
|
+
message: string;
|
|
21
19
|
}
|
|
22
|
-
|
|
20
|
+
interface AuditData {
|
|
21
|
+
score: number;
|
|
22
|
+
structure?: {
|
|
23
|
+
files: number;
|
|
24
|
+
packages: number;
|
|
25
|
+
languages: Record<string, number>;
|
|
26
|
+
};
|
|
27
|
+
dependencies?: {
|
|
28
|
+
external: number;
|
|
29
|
+
internal: number;
|
|
30
|
+
};
|
|
31
|
+
patterns?: Array<{
|
|
32
|
+
name: string;
|
|
33
|
+
confidence: string;
|
|
34
|
+
count: number;
|
|
35
|
+
}>;
|
|
36
|
+
health?: {
|
|
23
37
|
score: number;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
entryPoints?: {
|
|
50
|
-
total: number;
|
|
51
|
-
types: Record<string, number>;
|
|
52
|
-
};
|
|
53
|
-
typecheck?: {
|
|
54
|
-
passed: boolean;
|
|
55
|
-
errorCount: number;
|
|
56
|
-
topErrors: string[];
|
|
57
|
-
};
|
|
58
|
-
lint?: {
|
|
59
|
-
passed: boolean;
|
|
60
|
-
errorCount: number;
|
|
61
|
-
topErrors: string[];
|
|
62
|
-
};
|
|
63
|
-
recommendations: AuditRecommendation[];
|
|
38
|
+
checks: number;
|
|
39
|
+
passed: number;
|
|
40
|
+
warned: number;
|
|
41
|
+
failed: number;
|
|
42
|
+
};
|
|
43
|
+
deadSymbols?: {
|
|
44
|
+
source: number;
|
|
45
|
+
docs: number;
|
|
46
|
+
};
|
|
47
|
+
entryPoints?: {
|
|
48
|
+
total: number;
|
|
49
|
+
types: Record<string, number>;
|
|
50
|
+
};
|
|
51
|
+
typecheck?: {
|
|
52
|
+
passed: boolean;
|
|
53
|
+
errorCount: number;
|
|
54
|
+
topErrors: string[];
|
|
55
|
+
};
|
|
56
|
+
lint?: {
|
|
57
|
+
passed: boolean;
|
|
58
|
+
errorCount: number;
|
|
59
|
+
topErrors: string[];
|
|
60
|
+
};
|
|
61
|
+
recommendations: AuditRecommendation[];
|
|
64
62
|
}
|
|
65
|
-
|
|
66
|
-
//#
|
|
63
|
+
declare function audit(store: IKnowledgeStore, embedder: IEmbedder, options?: AuditOptions): Promise<KBResponse<AuditData>>;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { AuditCheck, AuditData, AuditOptions, AuditRecommendation, audit };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`),e.structure&&n.push(`**Structure:** ${e.structure.files} files, ${e.structure.packages} packages, ${Object.keys(e.structure.languages).length} languages`),e.entryPoints){const o=Object.entries(e.entryPoints.types).map(([i,l])=>`${l} ${i}`).join(", ");n.push(`**Entry Points:** ${e.entryPoints.total} (${o||"none"})`)}if(e.dependencies&&n.push(`**Dependencies:** ${e.dependencies.external} external, ${e.dependencies.internal} internal`),e.health&&n.push(`**Health:** ${e.health.score}/100 (${e.health.passed}\u2713 ${e.health.warned}\u26A0 ${e.health.failed}\u2717)`),e.deadSymbols&&n.push(`**Dead Symbols:** ${e.deadSymbols.source} in source (actionable), ${e.deadSymbols.docs} in docs`),e.typecheck){const o=e.typecheck.passed?"\u2713 passed":`\u2717 ${e.typecheck.errorCount} errors`;n.push(`**Typecheck:** ${o}`)}if(e.lint){const o=e.lint.passed?"\u2713 passed":`\u2717 ${e.lint.errorCount} errors`;n.push(`**Lint:** ${o}`)}if(e.recommendations.length>0){n.push(`
|
|
1
|
+
import{check as e,summarizeCheckResult as t}from"./check.js";import{findDeadSymbols as n}from"./dead-symbols.js";import{health as r}from"./health.js";import{resolvePath as i}from"./path-resolver.js";import{errorResponse as a,okResponse as o}from"./response-envelope.js";import{DependencyAnalyzer as s,EntryPointAnalyzer as c,PatternAnalyzer as l,StructureAnalyzer as u}from"../../analyzers/dist/index.js";const d=[`structure`,`dependencies`,`patterns`,`health`,`dead_symbols`,`check`,`entry_points`];async function f(f,m,h={}){let g=Date.now(),_=i(h.path),v=h.checks??d,y=h.detail??`summary`,b=[],x={score:100,recommendations:b};try{let i=[];v.includes(`structure`)&&i.push((async()=>{let e=await new u().analyze(_,{format:`json`}),t=e.data;x.structure={files:t.stats?.totalFiles??e.meta.fileCount,packages:Array.isArray(t.packages)?t.packages.length:0,languages:t.stats?.languages??{}}})()),v.includes(`dependencies`)&&i.push((async()=>{let e=(await new s().analyze(_)).data,t=e.imports??[];x.dependencies={external:e.external?.length??t.filter(e=>e.isExternal).length,internal:e.internal?.length??t.filter(e=>!e.isExternal).length}})()),v.includes(`patterns`)&&i.push((async()=>{x.patterns=((await new l().analyze(_)).data.patterns??[]).map(e=>({name:e.pattern,confidence:e.confidence,count:e.locations.length}))})()),v.includes(`entry_points`)&&i.push((async()=>{let e=(await new c().analyze(_)).data,t=e.entryPoints??[],n={};for(let e of t)n[e.type]=(n[e.type]??0)+1;x.entryPoints={total:e.total??t.length,types:n}})()),v.includes(`health`)&&i.push((async()=>{let e=r(_);x.health={score:e.score,checks:e.checks.length,passed:e.checks.filter(e=>e.status===`pass`).length,warned:e.checks.filter(e=>e.status===`warn`).length,failed:e.checks.filter(e=>e.status===`fail`).length},e.score<70&&b.push({priority:`medium`,area:`health`,message:`Health score ${e.score}/100 — ${x.health.failed} failed checks`})})()),v.includes(`dead_symbols`)&&i.push((async()=>{let e=await n(m,f,{rootPath:_});x.deadSymbols={source:e.totalDeadSource,docs:e.totalDeadDocs},e.totalDeadSource>0&&b.push({priority:e.totalDeadSource>10?`high`:`medium`,area:`dead-code`,message:`${e.totalDeadSource} unused exports in source files`})})()),v.includes(`check`)&&i.push((async()=>{let n=t(await e({cwd:_}));x.typecheck={passed:n.tsc.passed,errorCount:n.tsc.errorCount,topErrors:n.tsc.topErrors},x.lint={passed:n.biome.passed,errorCount:n.biome.errorCount,topErrors:n.biome.topErrors},n.tsc.passed||b.push({priority:`high`,area:`type-safety`,message:`Fix ${n.tsc.errorCount} tsc error(s)`}),n.biome.passed||b.push({priority:`medium`,area:`lint`,message:`Fix ${n.biome.errorCount} lint error(s)`})})()),await Promise.all(i);let a=0;x.typecheck&&!x.typecheck.passed&&(a+=15),x.lint&&!x.lint.passed&&(a+=5),x.health&&x.health.score<80&&(a+=10),x.deadSymbols&&x.deadSymbols.source>10&&(a+=5),x.entryPoints&&x.entryPoints.total===0&&(a+=5),x.score=Math.max(0,100-a);let d={high:0,medium:1,low:2};b.sort((e,t)=>d[e.priority]-d[t.priority]);let h=p(x,y),S=[];return x.typecheck&&!x.typecheck.passed&&S.push({tool:`check`,reason:`Get full error details`,suggested_args:{detail:`errors`}}),x.deadSymbols&&x.deadSymbols.source>0&&S.push({tool:`dead_symbols`,reason:`See which exports are unused`,suggested_args:{root_path:_}}),o(`audit`,h,x,{durationMs:Date.now()-g,detail:y},S)}catch{return a(`audit`,{code:`ANALYSIS_FAILED`,category:`runtime`,retryable:!1,message:`Audit failed. Check server logs for details.`},Date.now()-g)}}function p(e,t){let n=[];if(n.push(`## Audit Report — Score: ${e.score}/100\n`),e.structure&&n.push(`**Structure:** ${e.structure.files} files, ${e.structure.packages} packages, ${Object.keys(e.structure.languages).length} languages`),e.entryPoints){let t=Object.entries(e.entryPoints.types).map(([e,t])=>`${t} ${e}`).join(`, `);n.push(`**Entry Points:** ${e.entryPoints.total} (${t||`none`})`)}if(e.dependencies&&n.push(`**Dependencies:** ${e.dependencies.external} external, ${e.dependencies.internal} internal`),e.health&&n.push(`**Health:** ${e.health.score}/100 (${e.health.passed}✓ ${e.health.warned}⚠ ${e.health.failed}✗)`),e.deadSymbols&&n.push(`**Dead Symbols:** ${e.deadSymbols.source} in source (actionable), ${e.deadSymbols.docs} in docs`),e.typecheck){let t=e.typecheck.passed?`✓ passed`:`✗ ${e.typecheck.errorCount} errors`;n.push(`**Typecheck:** ${t}`)}if(e.lint){let t=e.lint.passed?`✓ passed`:`✗ ${e.lint.errorCount} errors`;n.push(`**Lint:** ${t}`)}if(e.recommendations.length>0){n.push(`
|
|
3
2
|
### Recommendations
|
|
4
|
-
`);for(
|
|
3
|
+
`);for(let t of e.recommendations){let e=t.priority===`high`?`🔴`:t.priority===`medium`?`🟡`:`🟢`;n.push(`${e} **${t.area}:** ${t.message}`)}}if(t===`full`&&e.patterns&&e.patterns.length>0){n.push(`
|
|
5
4
|
### Patterns Detected
|
|
6
|
-
`),n.push(
|
|
7
|
-
`)}export{
|
|
5
|
+
`),n.push(`| Pattern | Confidence | Count |`),n.push(`|---------|-----------|-------|`);for(let t of e.patterns)n.push(`| ${t.name} | ${t.confidence} | ${t.count} |`)}return n.join(`
|
|
6
|
+
`)}export{f as audit};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region packages/tools/src/batch.d.ts
|
|
2
|
+
interface BatchOperation {
|
|
3
|
+
/** Unique ID for this operation */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Operation type */
|
|
6
|
+
type: string;
|
|
7
|
+
/** Arguments for the operation */
|
|
8
|
+
args: Record<string, unknown>;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
interface BatchResult {
|
|
11
|
+
id: string;
|
|
12
|
+
status: 'success' | 'error';
|
|
13
|
+
result?: unknown;
|
|
14
|
+
error?: string;
|
|
15
|
+
durationMs: number;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
interface BatchOptions {
|
|
18
|
+
/** Max concurrent operations (default: 4) */
|
|
19
|
+
concurrency?: number;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
//#
|
|
21
|
+
declare function batch(operations: BatchOperation[], executor: (op: BatchOperation) => Promise<unknown>, options?: BatchOptions): Promise<BatchResult[]>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { BatchOperation, BatchOptions, BatchResult, batch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function e(e,t,n={}){let r=Math.max(1,n.concurrency??4),i=[],a=[...e];async function o(e){let n=Date.now();try{let r=await t(e);return{id:e.id,status:`success`,result:r,durationMs:Date.now()-n}}catch(t){return{id:e.id,status:`error`,error:t instanceof Error?t.message:String(t),durationMs:Date.now()-n}}}for(;a.length>0;){let e=a.splice(0,r),t=await Promise.allSettled(e.map(e=>o(e)));for(let e of t){if(e.status===`fulfilled`){i.push(e.value);continue}i.push({id:`unknown`,status:`error`,error:e.reason instanceof Error?e.reason.message:`Promise rejected`,durationMs:0})}}return i}export{e as batch};
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
+
//#region packages/tools/src/changelog.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* kb_changelog — Generate a changelog from git history.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
type ChangelogFormat = 'grouped' | 'chronological' | 'per-scope';
|
|
6
|
+
interface ChangelogOptions {
|
|
7
|
+
from: string;
|
|
8
|
+
to?: string;
|
|
9
|
+
format?: ChangelogFormat;
|
|
10
|
+
includeBreaking?: boolean;
|
|
11
|
+
cwd?: string;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
interface ChangelogEntry {
|
|
14
|
+
hash: string;
|
|
15
|
+
type: string;
|
|
16
|
+
scope: string;
|
|
17
|
+
subject: string;
|
|
18
|
+
body: string;
|
|
19
|
+
author: string;
|
|
20
|
+
date: string;
|
|
21
|
+
breaking: boolean;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
interface ChangelogResult {
|
|
24
|
+
entries: ChangelogEntry[];
|
|
25
|
+
markdown: string;
|
|
26
|
+
stats: {
|
|
27
|
+
total: number;
|
|
28
|
+
breaking: number;
|
|
29
|
+
types: Record<string, number>;
|
|
30
|
+
};
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
declare function changelog(options: ChangelogOptions): ChangelogResult;
|
|
32
33
|
/** Exported for testing */
|
|
33
|
-
|
|
34
|
-
//#
|
|
34
|
+
declare function formatChangelog(entries: ChangelogEntry[], format: ChangelogFormat, includeBreaking: boolean): string;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ChangelogEntry, ChangelogFormat, ChangelogOptions, ChangelogResult, changelog, formatChangelog };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}export{
|
|
1
|
+
import{execFileSync as e}from"node:child_process";const t=/^[a-zA-Z0-9_./\-~^@{}]+$/;function n(n){let{from:i,to:a=`HEAD`,format:o=`grouped`,includeBreaking:s=!0,cwd:c=process.cwd()}=n;if(!t.test(i))throw Error(`Invalid git ref: ${i}`);if(!t.test(a))throw Error(`Invalid git ref: ${a}`);let l;try{l=e(`git`,[`log`,`${i}..${a}`,`--format=%H%s%b%an%ai`],{cwd:c,encoding:`utf8`,maxBuffer:10*1024*1024,timeout:3e4})}catch{throw Error(`Git log failed. Ensure "${i}" and "${a}" are valid refs.`)}let u=l.split(``).map(e=>e.trim()).filter(Boolean).map(e=>{let[t=``,n=``,r=``,i=``,a=``]=e.split(``),o=n.match(/^(\w+)(?:\(([^)]*)\))?(!)?:\s*(.+)/);return{hash:t.slice(0,8),type:o?.[1]??`other`,scope:o?.[2]??``,subject:o?.[4]??n,body:r.trim(),author:i.trim(),date:a.trim().split(` `)[0],breaking:!!(o?.[3]||/BREAKING[\s-]CHANGE/i.test(r))}}),d={},f=0;for(let e of u)d[e.type]=(d[e.type]??0)+1,e.breaking&&f++;return{entries:u,markdown:r(u,o,s),stats:{total:u.length,breaking:f,types:d}}}function r(e,t,n){let r=[`# Changelog`,``];if(n){let t=e.filter(e=>e.breaking);if(t.length>0){r.push(`## Breaking Changes`,``);for(let e of t)r.push(`- ${e.subject} (${e.hash})`);r.push(``)}}if(t===`grouped`){let t={};for(let n of e)t[n.type]||(t[n.type]=[]),t[n.type].push(n);let n=[`feat`,`fix`,`refactor`,`perf`,`test`,`docs`,`chore`],i={feat:`Features`,fix:`Bug Fixes`,refactor:`Refactoring`,perf:`Performance`,test:`Tests`,docs:`Documentation`,chore:`Chores`,other:`Other`};for(let e of[...n,...Object.keys(t).filter(e=>!n.includes(e))])if(t[e]?.length){r.push(`## ${i[e]??e}`,``);for(let n of t[e]){let e=n.scope?`**${n.scope}:** `:``;r.push(`- ${e}${n.subject} (${n.hash})`)}r.push(``)}}else if(t===`chronological`)for(let t of e){let e=t.scope?`(${t.scope}) `:``;r.push(`- \`${t.date}\` ${t.type}: ${e}${t.subject} (${t.hash})`)}else{let t={};for(let n of e){let e=n.scope||`general`;t[e]||(t[e]=[]),t[e].push(n)}for(let[e,n]of Object.entries(t)){r.push(`## ${e}`,``);for(let e of n)r.push(`- ${e.type}: ${e.subject} (${e.hash})`);r.push(``)}}return r.join(`
|
|
2
|
+
`)}export{n as changelog,r as formatChangelog};
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { ParsedError } from "./parse-output.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/tools/src/check.d.ts
|
|
4
|
+
interface CheckOptions {
|
|
5
|
+
/** Specific files to check (if empty, checks all) */
|
|
6
|
+
files?: string[];
|
|
7
|
+
/** Working directory */
|
|
8
|
+
cwd?: string;
|
|
9
|
+
/** Skip typecheck */
|
|
10
|
+
skipTypes?: boolean;
|
|
11
|
+
/** Skip lint */
|
|
12
|
+
skipLint?: boolean;
|
|
13
|
+
/** Detail level: summary (default, minimal), errors (parsed errors), full (includes raw) */
|
|
14
|
+
detail?: 'summary' | 'errors' | 'full';
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
interface CheckSummaryResult {
|
|
17
|
+
passed: boolean;
|
|
18
|
+
tsc: {
|
|
15
19
|
passed: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
topErrors: string[];
|
|
27
|
-
};
|
|
20
|
+
errorCount: number;
|
|
21
|
+
warningCount: number;
|
|
22
|
+
topErrors: string[];
|
|
23
|
+
};
|
|
24
|
+
biome: {
|
|
25
|
+
passed: boolean;
|
|
26
|
+
errorCount: number;
|
|
27
|
+
warningCount: number;
|
|
28
|
+
topErrors: string[];
|
|
29
|
+
};
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
passed: boolean;
|
|
38
|
-
raw?: string;
|
|
39
|
-
};
|
|
31
|
+
interface CheckResult {
|
|
32
|
+
tsc: {
|
|
33
|
+
errors: ParsedError[];
|
|
34
|
+
passed: boolean;
|
|
35
|
+
raw?: string;
|
|
36
|
+
};
|
|
37
|
+
biome: {
|
|
38
|
+
errors: ParsedError[];
|
|
40
39
|
passed: boolean;
|
|
40
|
+
raw?: string;
|
|
41
|
+
};
|
|
42
|
+
passed: boolean;
|
|
41
43
|
}
|
|
42
|
-
|
|
44
|
+
declare function check(options?: CheckOptions): Promise<CheckResult>;
|
|
43
45
|
/** Produce a minimal summary for LLM consumption (~300 tokens) */
|
|
44
|
-
|
|
45
|
-
//#
|
|
46
|
+
declare function summarizeCheckResult(result: CheckResult): CheckSummaryResult;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { CheckOptions, CheckResult, CheckSummaryResult, check, summarizeCheckResult };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`).trim()||
|
|
1
|
+
import{parseBiome as e,parseTsc as t}from"./parse-output.js";import{exec as n}from"node:child_process";import{readFile as r}from"node:fs/promises";import{join as i}from"node:path";import{promisify as a}from"node:util";const o=a(n);let s=0;function c(e){let t=e;return[t.stdout?.toString()??``,t.stderr?.toString()??``].filter(Boolean).join(`
|
|
2
|
+
`).trim()||t.message||`Command failed`}async function l(e={}){if(s>=2)throw Error(`Too many concurrent check runs (max 2). Try again later.`);s++;try{return await u(e)}finally{s--}}async function u(n){let a=n.cwd??process.cwd(),s={errors:[],passed:!0,raw:``},l={errors:[],passed:!0,raw:``};if(!n.skipTypes)try{let e=i(a,`package.json`),t=!1;try{t=!!JSON.parse(await r(e,`utf-8`)).scripts?.typecheck}catch{}if(t&&!n.files?.length)await o(`npx turbo run typecheck`,{cwd:a,timeout:12e4});else{let e=[`--noEmit`];n.files?.length&&e.push(...n.files),await o(`npx tsc ${e.join(` `)}`,{cwd:a,timeout:12e4})}}catch(e){s.raw=c(e),s.errors=t(s.raw),s.passed=s.errors.length===0}if(!n.skipLint)try{let e=[`check`];n.files?.length&&e.push(...n.files),await o(`npx biome ${e.join(` `)}`,{cwd:a,timeout:12e4})}catch(t){l.raw=c(t),l.errors=e(l.raw),l.passed=l.errors.length===0}let u=n.detail??`full`,d={tsc:s,biome:l,passed:s.passed&&l.passed};return u===`full`?d:u===`errors`?{tsc:{errors:s.errors,passed:s.passed},biome:{errors:l.errors,passed:l.passed},passed:d.passed}:d}function d(e){let t=e.tsc.errors.filter(e=>e.severity===`error`),n=e.tsc.errors.filter(e=>e.severity===`warning`),r=e.biome.errors.filter(e=>e.severity===`error`),i=e.biome.errors.filter(e=>e.severity===`warning`);return{passed:e.passed,tsc:{passed:e.tsc.passed,errorCount:t.length,warningCount:n.length,topErrors:t.slice(0,3).map(e=>`${e.file}:${e.line} — ${e.message}`)},biome:{passed:e.biome.passed,errorCount:r.length,warningCount:i.length,topErrors:r.slice(0,3).map(e=>`${e.file}:${e.line} — ${e.message}`)}}}export{l as check,d as summarizeCheckResult};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region packages/tools/src/checkpoint.d.ts
|
|
2
|
+
interface Checkpoint {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
files?: string[];
|
|
8
|
+
notes?: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare function checkpointSave(label: string, data: Record<string, unknown>, options?: {
|
|
11
|
+
files?: string[];
|
|
12
|
+
notes?: string;
|
|
13
|
+
cwd?: string;
|
|
13
14
|
}): Checkpoint;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//#
|
|
15
|
+
declare function checkpointLoad(id: string, cwd?: string): Checkpoint | undefined;
|
|
16
|
+
declare function checkpointList(cwd?: string): Checkpoint[];
|
|
17
|
+
declare function checkpointLatest(cwd?: string): Checkpoint | undefined;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Checkpoint, checkpointLatest, checkpointList, checkpointLoad, checkpointSave };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
`,"utf-8"),c}function S(n,e){const t=i(o(e),`${n}.json`);if(s(t))return JSON.parse(a(t,"utf-8"))}function k(n){const e=o(n);return f(e).filter(t=>t.endsWith(".json")).map(t=>JSON.parse(a(i(e,t),"utf-8"))).sort((t,r)=>r.createdAt.localeCompare(t.createdAt))}function w(n){return k(n)[0]}export{w as checkpointLatest,k as checkpointList,S as checkpointLoad,C as checkpointSave};
|
|
1
|
+
import{resolve as e}from"node:path";import{existsSync as t,mkdirSync as n,readFileSync as r,readdirSync as i,writeFileSync as a}from"node:fs";import{KB_PATHS as o}from"../../core/dist/index.js";const s=`${o.state}/checkpoints`;function c(r){let i=e(r??process.cwd(),s);return t(i)||n(i,{recursive:!0}),i}function l(t,n,r){let i=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`checkpoint`,o={id:`${Date.now()}-${i}`,label:t,createdAt:new Date().toISOString(),data:n,files:r?.files,notes:r?.notes};return a(e(c(r?.cwd),`${o.id}.json`),`${JSON.stringify(o,null,2)}\n`,`utf-8`),o}function u(n,i){let a=e(c(i),`${n}.json`);if(t(a))try{return JSON.parse(r(a,`utf-8`))}catch{return}}function d(t){let n=c(t);return i(n).filter(e=>e.endsWith(`.json`)).flatMap(t=>{try{return[JSON.parse(r(e(n,t),`utf-8`))]}catch{return[]}}).sort((e,t)=>t.createdAt.localeCompare(e.createdAt))}function f(e){return d(e)[0]}export{f as checkpointLatest,d as checkpointList,u as checkpointLoad,l as checkpointSave};
|