@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,47 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
contentType?: string;
|
|
20
|
-
/** Working directory for glob resolution (default: cwd) */
|
|
21
|
-
cwd?: string;
|
|
1
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
2
|
+
import { IKnowledgeStore } from "@kb/store";
|
|
3
|
+
import { ContentType } from "@kb/core";
|
|
4
|
+
|
|
5
|
+
//#region packages/tools/src/find.d.ts
|
|
6
|
+
interface FindOptions {
|
|
7
|
+
/** Semantic search query (optional) */
|
|
8
|
+
query?: string;
|
|
9
|
+
/** File glob pattern (optional) */
|
|
10
|
+
glob?: string;
|
|
11
|
+
/** Keyword/regex pattern for text search (optional) */
|
|
12
|
+
pattern?: string;
|
|
13
|
+
/** Max results per strategy (default: 10) */
|
|
14
|
+
limit?: number;
|
|
15
|
+
/** Filter by content type */
|
|
16
|
+
contentType?: ContentType;
|
|
17
|
+
/** Working directory for glob resolution (default: cwd) */
|
|
18
|
+
cwd?: string;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
interface FindResult {
|
|
21
|
+
/** File path (relative to cwd) */
|
|
22
|
+
path: string;
|
|
23
|
+
/** How this result was found */
|
|
24
|
+
source: 'vector' | 'keyword' | 'glob' | 'pattern';
|
|
25
|
+
/** Relevance score (0-1 for vector/keyword, 1 for glob/pattern matches) */
|
|
26
|
+
score: number;
|
|
27
|
+
/** Line range if from KB search */
|
|
28
|
+
lineRange?: {
|
|
29
|
+
start: number;
|
|
30
|
+
end: number;
|
|
31
|
+
};
|
|
32
|
+
/** Content preview */
|
|
33
|
+
preview?: string;
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
interface FindResults {
|
|
36
|
+
results: FindResult[];
|
|
37
|
+
strategies: string[];
|
|
38
|
+
totalFound: number;
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
44
41
|
* Run federated search across multiple strategies.
|
|
45
42
|
*/
|
|
46
|
-
|
|
47
|
-
//#
|
|
43
|
+
declare function find(embedder: IEmbedder, store: IKnowledgeStore, options: FindOptions): Promise<FindResults>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { FindOptions, FindResult, FindResults, find };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function
|
|
1
|
+
import{KB_PATHS as e}from"../../core/dist/index.js";async function t(t,n,r){let{query:i,glob:a,pattern:o,limit:s=10,contentType:c,cwd:l=process.cwd()}=r,u=[],d=[],f=new Set;if(i){u.push(`vector`);let e=await t.embed(i),r={limit:s,contentType:c},a=await n.search(e,r);for(let e of a){let t=`${e.record.sourcePath}:${e.record.startLine}`;f.has(t)||(f.add(t),d.push({path:e.record.sourcePath,source:`vector`,score:e.score,lineRange:{start:e.record.startLine,end:e.record.endLine},preview:e.record.content.slice(0,200)}))}}if(i){u.push(`keyword`);try{let e=await n.ftsSearch(i,{limit:s,contentType:c});for(let t of e){let e=`${t.record.sourcePath}:${t.record.startLine}`;f.has(e)||(f.add(e),d.push({path:t.record.sourcePath,source:`keyword`,score:t.score,lineRange:{start:t.record.startLine,end:t.record.endLine},preview:t.record.content.slice(0,200)}))}}catch{}}if(a){u.push(`glob`);try{let{globSync:t}=await import(`node:fs`),n=t(a,{cwd:l,withFileTypes:!1}),r=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,e.state,e.data]),i=n.filter(e=>!e.replace(/\\/g,`/`).split(`/`).some(e=>r.has(e)));for(let e of i.slice(0,s)){let t=`glob:${e}`;f.has(t)||(f.add(t),d.push({path:e,source:`glob`,score:1}))}}catch{}}if(o){u.push(`pattern`);try{let e=new RegExp(o,`i`),t=await n.ftsSearch(o,{limit:s*2,contentType:c});for(let n of t)if(e.test(n.record.content)){let e=`${n.record.sourcePath}:${n.record.startLine}`;f.has(e)||(f.add(e),d.push({path:n.record.sourcePath,source:`pattern`,score:n.score,lineRange:{start:n.record.startLine,end:n.record.endLine},preview:n.record.content.slice(0,200)}))}}catch{}}return d.sort((e,t)=>t.score-e.score),{results:d.slice(0,s),strategies:u,totalFound:d.length}}export{t as find};
|
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
files: string[];
|
|
12
|
-
/** Task description for keyword detection */
|
|
13
|
-
task: string;
|
|
14
|
-
/** Root path for package boundary detection */
|
|
15
|
-
rootPath: string;
|
|
1
|
+
import { ForgeTier } from "./evidence-map.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/tools/src/forge-classify.d.ts
|
|
4
|
+
interface ForgeClassifyOptions {
|
|
5
|
+
/** Files being modified (absolute or relative paths) */
|
|
6
|
+
files: string[];
|
|
7
|
+
/** Task description for keyword detection */
|
|
8
|
+
task: string;
|
|
9
|
+
/** Root path for package boundary detection */
|
|
10
|
+
rootPath: string;
|
|
16
11
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
interface ClassifyTrigger {
|
|
13
|
+
rule: string;
|
|
14
|
+
detail: string;
|
|
15
|
+
source: 'blast_radius' | 'cross_package' | 'schema_contract' | 'security_auth' | 'task_hint' | 'default';
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
interface TypedUnknownSeed {
|
|
18
|
+
description: string;
|
|
19
|
+
type: 'contract' | 'convention' | 'freshness' | 'runtime' | 'data-flow' | 'impact';
|
|
20
|
+
suggestedTool: string;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
interface ForgeClassifyCeremony {
|
|
23
|
+
ground: string;
|
|
24
|
+
build: string;
|
|
25
|
+
break: string;
|
|
26
|
+
evidenceMap: string;
|
|
27
|
+
gate: string;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
interface ForgeClassifyResult {
|
|
30
|
+
tier: ForgeTier;
|
|
31
|
+
triggers: ClassifyTrigger[];
|
|
32
|
+
packagesCrossed: string[];
|
|
33
|
+
hasSchemaChange: boolean;
|
|
34
|
+
hasSecurityPath: boolean;
|
|
35
|
+
typedUnknownSeeds: TypedUnknownSeed[];
|
|
36
|
+
ceremony: ForgeClassifyCeremony;
|
|
42
37
|
}
|
|
43
|
-
|
|
44
|
-
//#
|
|
38
|
+
declare function forgeClassify(options: ForgeClassifyOptions): Promise<ForgeClassifyResult>;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ClassifyTrigger, ForgeClassifyCeremony, ForgeClassifyOptions, ForgeClassifyResult, TypedUnknownSeed, forgeClassify };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}catch{return
|
|
1
|
+
import{fileSummary as e}from"./file-summary.js";import{dirname as t,extname as n,relative as r,resolve as i}from"node:path";import{existsSync as a,readFileSync as o,readdirSync as s,statSync as c}from"node:fs";import{KB_PATHS as l}from"../../core/dist/index.js";const u=new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.mts`,`.cts`,`.mjs`,`.cjs`]),d=new Set([`.git`,l.data,l.state,`.turbo`,`.yarn`,`build`,`coverage`,`dist`,`node_modules`]),f=/auth|token|permission|acl|encrypt|secret|credential|jwt|oauth|password/i,p=/\b(hash|sign|verify|bcrypt|jwt|decrypt|secret|password)\b/i,m=/auth|security|permission|encrypt|secret|credential/i,h=/types\.ts$|schema\.ts$|contract\.ts$|\.proto$|openapi|swagger|\.graphql$/i,g=/(?:^|\/)(events|contracts|shared)(?:\/|$)/i,_=/export\s+interface\b|export\s+type\b|export\s+const\s+\w*Schema\w*\s*=\s*z\./i,v=/schema|contract|migration|breaking.change|api.change/i,y=/migration|data.?model|multi.?service|breaking|backward.?compat/i,b={floor:{ground:`Parasitic — read target file only`,build:`Implement directly`,break:`Skip`,evidenceMap:`Not required`,gate:`Self-certify`},standard:{ground:`Scope map + blast radius + constraint seed`,build:`TDD — test first, then implement`,break:`Error paths + edge cases`,evidenceMap:`3-8 critical-path entries`,gate:`YIELD/HOLD evaluation`},critical:{ground:`Full scope map + blast radius + trace + patterns + constraint pack`,build:`TDD + contract verification + cross-service validation`,break:`Error paths + edge cases + security dimensions + data-flow verification`,evidenceMap:`Comprehensive — all critical-path claims with receipts`,gate:`Strict YIELD/HOLD/HARD_BLOCK evaluation`}};async function x(e){let t=i(e.rootPath),n=e.task.trim(),r=e.files.map(e=>i(t,e)),a=[],o=!1,s=!1;for(let e of r){let r=C(e,t),i=T(e);(f.test(r)||p.test(i)||m.test(n))&&(o=!0),(h.test(r)||g.test(r)||v.test(n)||_.test(i)||await E(e))&&(s=!0)}o&&S(a,{rule:`security-path`,detail:`Security/auth path, task, or content matched security heuristics`,source:`security_auth`}),s&&S(a,{rule:`schema-contract`,detail:`Schema or contract path, task, or export shape matched contract heuristics`,source:`schema_contract`});let c=D(r,t);c.affectedFiles>5&&S(a,{rule:`blast-radius-importers`,detail:`${c.affectedFiles} affected files via direct import scanning`,source:`blast_radius`});let l=[...new Set(r.map(e=>M(e,t)).filter(e=>!!e))].sort();l.length>=2&&S(a,{rule:`cross-package-boundary`,detail:`Files span ${l.length} packages: ${l.join(`, `)}`,source:`cross_package`}),y.test(n)&&S(a,{rule:`task-hint-critical`,detail:`Task description matched migration or compatibility criticality hints`,source:`task_hint`});let u=a.length>0?`critical`:r.length===1?`floor`:`standard`;return{tier:u,triggers:a,packagesCrossed:l,hasSchemaChange:s,hasSecurityPath:o,typedUnknownSeeds:j(a),ceremony:b[u]}}function S(e,t){e.some(e=>e.rule===t.rule&&e.source===t.source)||e.push(t)}function C(e,t){let n=i(t,e),a=r(t,n);return(a&&!a.startsWith(`..`)?a:n).replace(/\\/g,`/`)}function w(e){if(!a(e))return!1;try{return c(e).size<=1e5}catch{return!1}}function T(e){if(!w(e))return``;try{return o(e,`utf-8`).split(/\r?\n/).slice(0,200).join(`
|
|
2
|
+
`)}catch{return``}}async function E(t){if(!w(t))return!1;try{let n=await e({path:t}),r=new Set(n.exports);return n.interfaces.some(e=>r.has(e.name))||n.types.some(e=>r.has(e.name))}catch{return!1}}function D(e,t){let n=new Set(e.filter(e=>a(e)));if(n.size===0)return{affectedFiles:e.length,importers:[]};let i=new Set;for(let e of O(t)){if(n.has(e)||!w(e))continue;let t=T(e);t&&k(t).some(t=>A(t,e,n))&&i.add(e)}return{affectedFiles:e.length+i.size,importers:[...i].map(e=>r(t,e).replace(/\\/g,`/`))}}function O(e){let t=[];function r(e){let a=[];try{a=s(e)}catch{return}for(let o of a){if(d.has(o))continue;let a=i(e,o),s;try{s=c(a)}catch{continue}if(s.isDirectory()){r(a);continue}u.has(n(o).toLowerCase())&&t.push(a)}}return r(e),t}function k(e){let t=new Set;for(let n of e.matchAll(/(?:from\s+['"]([^'"]+)['"]|import\s+['"]([^'"]+)['"]|require\(\s*['"]([^'"]+)['"]\s*\))/g)){let e=n[1]??n[2]??n[3];e&&t.add(e)}return[...t]}function A(e,n,r){if(!e.startsWith(`.`))return!1;let a=i(t(n),e);return[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.jsx`,`${a}.mts`,`${a}.cts`,`${a}.mjs`,`${a}.cjs`,i(a,`index.ts`),i(a,`index.tsx`),i(a,`index.js`),i(a,`index.jsx`)].some(e=>r.has(e))}function j(e){return e.map(e=>{switch(e.source){case`security_auth`:return{description:`Verify auth and security assumptions before yielding`,type:`contract`,suggestedTool:`kb_search`};case`schema_contract`:return{description:`Confirm schema and contract compatibility`,type:`contract`,suggestedTool:`kb_schema_validate`};case`blast_radius`:return{description:`Inspect affected importers before delivery`,type:`impact`,suggestedTool:`kb_blast_radius`};case`cross_package`:return{description:`Assess downstream package impact across boundaries`,type:`impact`,suggestedTool:`kb_blast_radius`};case`task_hint`:return{description:`Check established conventions for migrations or compatibility work`,type:`convention`,suggestedTool:`kb_find`};default:return{description:`No explicit unknown routing required`,type:`freshness`,suggestedTool:`kb_lookup`}}})}function M(e,n){let s=t(i(n,e)),c=i(n);for(;s.length>=c.length;){let e=i(s,`package.json`);if(a(e))try{return JSON.parse(o(e,`utf-8`)).name??r(c,s).replace(/\\/g,`/`)}catch{return r(c,s).replace(/\\/g,`/`)}let n=t(s);if(n===s)break;s=n}}export{x as forgeClassify};
|
|
@@ -1,64 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/** Force a specific tier (skip auto-classify) */
|
|
22
|
-
forceTier?: ForgeTier;
|
|
23
|
-
/** Task ID for evidence map creation (default: auto-generated from task) */
|
|
24
|
-
taskId?: string;
|
|
1
|
+
import { ForgeTier } from "./evidence-map.js";
|
|
2
|
+
import { ClassifyTrigger, TypedUnknownSeed } from "./forge-classify.js";
|
|
3
|
+
import { ScopeMapResult } from "./scope-map.js";
|
|
4
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
5
|
+
import { IKnowledgeStore } from "@kb/store";
|
|
6
|
+
|
|
7
|
+
//#region packages/tools/src/forge-ground.d.ts
|
|
8
|
+
interface ForgeGroundOptions {
|
|
9
|
+
/** Task description */
|
|
10
|
+
task: string;
|
|
11
|
+
/** Target files being modified (absolute paths) */
|
|
12
|
+
files: string[];
|
|
13
|
+
/** Root path of the codebase */
|
|
14
|
+
rootPath: string;
|
|
15
|
+
/** Max constraint entries to load (default: 3) */
|
|
16
|
+
maxConstraints?: number;
|
|
17
|
+
/** Force a specific tier (skip auto-classify) */
|
|
18
|
+
forceTier?: ForgeTier;
|
|
19
|
+
/** Task ID for evidence map creation (default: auto-generated from task) */
|
|
20
|
+
taskId?: string;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
interface ConstraintRef {
|
|
23
|
+
source: string;
|
|
24
|
+
snippet: string;
|
|
25
|
+
relevance: number;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
27
|
+
interface ForgeGroundResult {
|
|
28
|
+
/** Computed or forced tier */
|
|
29
|
+
tier: ForgeTier;
|
|
30
|
+
/** Classification triggers (empty if tier was forced) */
|
|
31
|
+
classifyTriggers: ClassifyTrigger[];
|
|
32
|
+
/** Scope map (relevant files with focus ranges) — null for Floor tier */
|
|
33
|
+
scopeMap: ScopeMapResult | null;
|
|
34
|
+
/** Typed Unknown Queue seeds */
|
|
35
|
+
typedUnknownSeeds: TypedUnknownSeed[];
|
|
36
|
+
/** Constraint seed — relevant KB entries from decisions/patterns */
|
|
37
|
+
constraints: ConstraintRef[];
|
|
38
|
+
/** File summaries for target files */
|
|
39
|
+
fileSummaries: Array<{
|
|
40
|
+
path: string;
|
|
41
|
+
exports: string[];
|
|
42
|
+
functions: string[];
|
|
43
|
+
lines: number;
|
|
44
|
+
error?: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Evidence map task ID (created if Standard or Critical) */
|
|
47
|
+
evidenceMapTaskId: string | null;
|
|
48
|
+
/** Total estimated tokens for this Ground output */
|
|
49
|
+
estimatedTokens: number;
|
|
50
|
+
/** Ceremony recommendations for this tier */
|
|
51
|
+
ceremony: {
|
|
52
|
+
ground: string;
|
|
53
|
+
build: string;
|
|
54
|
+
break: string;
|
|
55
|
+
evidenceMap: string;
|
|
56
|
+
gate: string;
|
|
57
|
+
};
|
|
62
58
|
}
|
|
63
|
-
|
|
64
|
-
//#
|
|
59
|
+
declare function forgeGround(embedder: IEmbedder, store: IKnowledgeStore, options: ForgeGroundOptions): Promise<ForgeGroundResult>;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ConstraintRef, ForgeGroundOptions, ForgeGroundResult, forgeGround };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{estimateTokens as e}from"./text-utils.js";import{evidenceMap as t}from"./evidence-map.js";import{fileSummary as n}from"./file-summary.js";import{forgeClassify as r}from"./forge-classify.js";import{scopeMap as i}from"./scope-map.js";const a={floor:{ground:`Parasitic — read target file only`,build:`Implement directly`,break:`Skip`,evidenceMap:`Not required`,gate:`Self-certify`},standard:{ground:`Scope map + blast radius + constraint seed`,build:`TDD — test first, then implement`,break:`Error paths + edge cases`,evidenceMap:`3-8 critical-path entries`,gate:`YIELD/HOLD evaluation`},critical:{ground:`Full scope map + blast radius + trace + patterns + constraint pack`,build:`TDD + contract verification + cross-service validation`,break:`Error paths + edge cases + security dimensions + data-flow verification`,evidenceMap:`Comprehensive — all critical-path claims with receipts`,gate:`Strict YIELD/HOLD/HARD_BLOCK evaluation`}};async function o(e,t,n){let r=n.maxConstraints??3,i=await s(n),a=await u(n.files);if(i.tier===`floor`)return _({tier:i.tier,classifyTriggers:i.classifyTriggers,scopeMap:null,typedUnknownSeeds:i.typedUnknownSeeds,constraints:[],fileSummaries:a,evidenceMapTaskId:null,ceremony:i.ceremony});let[o,d,p]=await Promise.all([c(e,t,n.task,i.tier),l(e,t,n.task,r),f(n.rootPath,n.taskId??v(n.task),i.tier)]);return _({tier:i.tier,classifyTriggers:i.classifyTriggers,scopeMap:o,typedUnknownSeeds:i.typedUnknownSeeds,constraints:d,fileSummaries:a,evidenceMapTaskId:p,ceremony:i.ceremony})}async function s(e){if(e.forceTier)return{tier:e.forceTier,classifyTriggers:[],typedUnknownSeeds:[],ceremony:g(e.forceTier)};try{let t=await r({files:e.files,task:e.task,rootPath:e.rootPath});return{tier:t.tier,classifyTriggers:t.triggers,typedUnknownSeeds:t.typedUnknownSeeds,ceremony:t.ceremony}}catch{return{tier:`standard`,classifyTriggers:[],typedUnknownSeeds:[],ceremony:g(`standard`)}}}async function c(e,t,n,r){try{return await i(e,t,{task:n,maxFiles:r===`critical`?20:10})}catch{return null}}async function l(e,t,n,r){try{let i=`decision pattern convention ${n}`,a=typeof e.embedQuery==`function`?await e.embedQuery(i):await e.embed(i);return(await t.search(a,{limit:r,origin:`curated`})).slice(0,r).map(e=>p(e))}catch{return[]}}async function u(e){return Promise.all(e.map(async e=>d(e)))}async function d(e){try{return h(await n({path:e}))}catch(t){return{path:e,exports:[],functions:[],lines:0,error:t instanceof Error?t.message:`Unable to summarize file`}}}async function f(e,n,r){try{return t({action:`create`,taskId:n,tier:r},e),n}catch{return null}}function p(e){return{source:e.record.sourcePath,snippet:m(e.record.content),relevance:e.score}}function m(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=200?t:`${t.slice(0,197).trimEnd()}...`}function h(e){return{path:e.path,exports:e.exports,functions:e.functions.map(e=>e.name),lines:e.lines}}function g(e){return{...a[e]}}function _(t){return{...t,estimatedTokens:e(JSON.stringify(t))}}function v(e){let t=e.toLowerCase().replace(/[^a-z0-9\s]/g,` `).split(/\s+/).filter(Boolean).slice(0,5).join(`-`),n=Date.now().toString(36);return`${t||`task`}-${n}`}export{o as forgeGround};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region packages/tools/src/git-context.d.ts
|
|
2
|
+
interface GitContextOptions {
|
|
3
|
+
cwd?: string;
|
|
4
|
+
commitCount?: number;
|
|
5
|
+
includeDiff?: boolean;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
interface GitContextResult {
|
|
8
|
+
branch: string;
|
|
9
|
+
status: {
|
|
10
|
+
staged: string[];
|
|
11
|
+
modified: string[];
|
|
12
|
+
untracked: string[];
|
|
13
|
+
};
|
|
14
|
+
recentCommits: Array<{
|
|
15
|
+
hash: string;
|
|
16
|
+
message: string;
|
|
17
|
+
author: string;
|
|
18
|
+
date: string;
|
|
19
|
+
}>;
|
|
20
|
+
diff?: string;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
//#
|
|
22
|
+
declare function gitContext(options?: GitContextOptions): Promise<GitContextResult>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { GitContextOptions, GitContextResult, gitContext };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{execFile as
|
|
2
|
-
`).filter(Boolean)){
|
|
3
|
-
`).filter(Boolean).map(
|
|
1
|
+
import{execFile as e}from"node:child_process";import{promisify as t}from"node:util";const n=t(e);async function r(e,t){try{let{stdout:r}=await n(`git`,e,{cwd:t,timeout:15e3});return r.toString().trim()}catch{return``}}async function i(e={}){let t=e.cwd??process.cwd(),n=e.commitCount??5,[i,a,o,s]=await Promise.all([r([`rev-parse`,`--abbrev-ref`,`HEAD`],t),r([`status`,`--porcelain`],t),r([`log`,`--max-count=${n}`,`--format=%h|%s|%an|%ai`],t),e.includeDiff?r([`diff`,`--stat`,`--no-color`],t):Promise.resolve(``)]),c=[],l=[],u=[];for(let e of a.split(`
|
|
2
|
+
`).filter(Boolean)){let t=e[0],n=e[1],r=e.slice(3).trim();t!==` `&&t!==`?`&&c.push(r),(n===`M`||n===`D`)&&l.push(r),t===`?`&&u.push(r)}let d=o.split(`
|
|
3
|
+
`).filter(Boolean).map(e=>{let[t,n,r,i]=e.split(`|`);return{hash:t,message:n,author:r,date:i}});return{branch:i||`unknown`,status:{staged:c,modified:l,untracked:u},recentCommits:d,diff:s||void 0}}export{i as gitContext};
|
|
@@ -1,89 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { GraphEdge, GraphNode, GraphStats, GraphTraversalResult, IGraphStore } from "@kb/store";
|
|
2
|
+
|
|
3
|
+
//#region packages/tools/src/graph-query.d.ts
|
|
4
|
+
interface GraphQueryOptions {
|
|
5
|
+
/** Action: query nodes, traverse from a node, get stats, or add data */
|
|
6
|
+
action: 'find_nodes' | 'find_edges' | 'neighbors' | 'traverse' | 'stats' | 'add' | 'delete' | 'clear';
|
|
7
|
+
/** Node type filter (for find_nodes) */
|
|
8
|
+
nodeType?: string;
|
|
9
|
+
/** Name pattern (LIKE %pattern%) for find_nodes */
|
|
10
|
+
namePattern?: string;
|
|
11
|
+
/** Source path filter */
|
|
12
|
+
sourcePath?: string;
|
|
13
|
+
/** Node ID for neighbors/traverse/delete */
|
|
14
|
+
nodeId?: string;
|
|
15
|
+
/** Edge type filter */
|
|
16
|
+
edgeType?: string;
|
|
17
|
+
/** From node ID (for find_edges) */
|
|
18
|
+
fromId?: string;
|
|
19
|
+
/** To node ID (for find_edges) */
|
|
20
|
+
toId?: string;
|
|
21
|
+
/** Traversal direction */
|
|
22
|
+
direction?: 'outgoing' | 'incoming' | 'both';
|
|
23
|
+
/** Max traversal depth (default: 2) */
|
|
24
|
+
maxDepth?: number;
|
|
25
|
+
/** Max results (default: 50) */
|
|
26
|
+
limit?: number;
|
|
27
|
+
/** Nodes to add (for action=add) */
|
|
28
|
+
nodes?: Array<{
|
|
29
|
+
id?: string;
|
|
30
|
+
type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
properties?: Record<string, unknown>;
|
|
33
|
+
sourceRecordId?: string;
|
|
17
34
|
sourcePath?: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/** Max traversal depth (default: 2) */
|
|
29
|
-
maxDepth?: number;
|
|
30
|
-
/** Max results (default: 50) */
|
|
31
|
-
limit?: number;
|
|
32
|
-
/** Nodes to add (for action=add) */
|
|
33
|
-
nodes?: Array<{
|
|
34
|
-
id?: string;
|
|
35
|
-
type: string;
|
|
36
|
-
name: string;
|
|
37
|
-
properties?: Record<string, unknown>;
|
|
38
|
-
sourceRecordId?: string;
|
|
39
|
-
sourcePath?: string;
|
|
40
|
-
}>;
|
|
41
|
-
/** Edges to add (for action=add) */
|
|
42
|
-
edges?: Array<{
|
|
43
|
-
id?: string;
|
|
44
|
-
fromId: string;
|
|
45
|
-
toId: string;
|
|
46
|
-
type: string;
|
|
47
|
-
weight?: number;
|
|
48
|
-
properties?: Record<string, unknown>;
|
|
49
|
-
}>;
|
|
35
|
+
}>;
|
|
36
|
+
/** Edges to add (for action=add) */
|
|
37
|
+
edges?: Array<{
|
|
38
|
+
id?: string;
|
|
39
|
+
fromId: string;
|
|
40
|
+
toId: string;
|
|
41
|
+
type: string;
|
|
42
|
+
weight?: number;
|
|
43
|
+
properties?: Record<string, unknown>;
|
|
44
|
+
}>;
|
|
50
45
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
interface GraphQueryResult {
|
|
47
|
+
action: string;
|
|
48
|
+
nodes?: GraphNode[];
|
|
49
|
+
edges?: GraphEdge[];
|
|
50
|
+
stats?: GraphStats;
|
|
51
|
+
nodesAdded?: number;
|
|
52
|
+
edgesAdded?: number;
|
|
53
|
+
deleted?: number;
|
|
54
|
+
summary: string;
|
|
60
55
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
declare function graphQuery(graphStore: IGraphStore, options: GraphQueryOptions): Promise<GraphQueryResult>;
|
|
57
|
+
interface GraphAugmentOptions {
|
|
58
|
+
/** Max graph hops from each vector hit (default: 1) */
|
|
59
|
+
hops?: number;
|
|
60
|
+
/** Edge type filter for graph expansion */
|
|
61
|
+
edgeType?: string;
|
|
62
|
+
/** Max graph nodes per vector hit (default: 5) */
|
|
63
|
+
maxPerHit?: number;
|
|
69
64
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
interface GraphAugmentedResult {
|
|
66
|
+
/** Original search result record ID */
|
|
67
|
+
recordId: string;
|
|
68
|
+
/** Original similarity score */
|
|
69
|
+
score: number;
|
|
70
|
+
/** Source path of the matched record */
|
|
71
|
+
sourcePath: string;
|
|
72
|
+
/** Graph nodes connected to this record (via sourceRecordId) */
|
|
73
|
+
graphContext: GraphTraversalResult;
|
|
79
74
|
}
|
|
80
75
|
/**
|
|
81
76
|
* Augment vector search results with graph context.
|
|
82
77
|
* For each search hit, finds linked graph nodes and traverses their connections.
|
|
83
78
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
declare function graphAugmentSearch(graphStore: IGraphStore, hits: Array<{
|
|
80
|
+
recordId: string;
|
|
81
|
+
score: number;
|
|
82
|
+
sourcePath: string;
|
|
88
83
|
}>, options?: GraphAugmentOptions): Promise<GraphAugmentedResult[]>;
|
|
89
|
-
//#
|
|
84
|
+
//#endregion
|
|
85
|
+
export { GraphAugmentOptions, GraphAugmentedResult, GraphQueryOptions, GraphQueryResult, graphAugmentSearch, graphQuery };
|