@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 +1 @@
|
|
|
1
|
-
import{createHash as
|
|
1
|
+
import{createHash as e}from"node:crypto";function t(t,...n){return`${t}_${e(`sha256`).update(n.join(`|`)).digest(`hex`).slice(0,12)}`}async function n(e,n){let{action:r}=n;switch(r){case`find_nodes`:{let t=await e.findNodes({type:n.nodeType,namePattern:n.namePattern,sourcePath:n.sourcePath,limit:n.limit});return{action:r,nodes:t,summary:`Found ${t.length} node(s)${n.nodeType?` of type "${n.nodeType}"`:``}${n.namePattern?` matching "${n.namePattern}"`:``}`}}case`find_edges`:{let t=await e.findEdges({type:n.edgeType,fromId:n.fromId,toId:n.toId,limit:n.limit});return{action:r,edges:t,summary:`Found ${t.length} edge(s)${n.edgeType?` of type "${n.edgeType}"`:``}`}}case`neighbors`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for neighbors action`};let t=await e.getNeighbors(n.nodeId,{edgeType:n.edgeType,direction:n.direction,limit:n.limit});return{action:r,nodes:t.nodes,edges:t.edges,summary:`Found ${t.nodes.length} neighbor(s) and ${t.edges.length} edge(s) for node "${n.nodeId}"`}}case`traverse`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for traverse action`};let t=await e.traverse(n.nodeId,{edgeType:n.edgeType,maxDepth:n.maxDepth,direction:n.direction,limit:n.limit});return{action:r,nodes:t.nodes,edges:t.edges,summary:`Traversed ${t.nodes.length} node(s) and ${t.edges.length} edge(s) from "${n.nodeId}" (depth=${n.maxDepth??2})`}}case`stats`:{let t=await e.getStats();return{action:r,stats:t,summary:`Graph: ${t.nodeCount} nodes, ${t.edgeCount} edges. Types: ${Object.entries(t.nodeTypes).map(([e,t])=>`${e}(${t})`).join(`, `)||`none`}`}}case`add`:{let i=0,a=0;if(n.nodes&&n.nodes.length>0){let r=n.nodes.map(e=>({id:e.id??t(`node`,e.type,e.name),type:e.type,name:e.name,properties:e.properties??{},sourceRecordId:e.sourceRecordId,sourcePath:e.sourcePath,createdAt:new Date().toISOString()}));await e.upsertNodes(r),i=r.length}if(n.edges&&n.edges.length>0){let r=n.edges.map(e=>({id:e.id??t(`edge`,e.fromId,e.toId,e.type),fromId:e.fromId,toId:e.toId,type:e.type,weight:e.weight,properties:e.properties}));await e.upsertEdges(r),a=r.length}return{action:r,nodesAdded:i,edgesAdded:a,summary:`Added ${i} node(s) and ${a} edge(s) to the graph`}}case`delete`:if(n.nodeId)return await e.deleteNode(n.nodeId),{action:r,deleted:1,summary:`Deleted node "${n.nodeId}" and its edges`};if(n.sourcePath){let t=await e.deleteBySourcePath(n.sourcePath);return{action:r,deleted:t,summary:`Deleted ${t} node(s) from source "${n.sourcePath}"`}}return{action:r,summary:`Error: nodeId or sourcePath required for delete action`};case`clear`:{let t=await e.getStats();return await e.clear(),{action:r,deleted:t.nodeCount,summary:`Cleared graph: removed ${t.nodeCount} node(s) and ${t.edgeCount} edge(s)`}}default:return{action:r,summary:`Unknown action: ${r}`}}}async function r(e,t,n){let r=n?.hops??1,i=n?.maxPerHit??5,a=[];for(let o of t)try{let t=await e.findNodes({sourcePath:o.sourcePath}),s=[],c=[],l=new Set,u=new Set;for(let a of t.slice(0,i))if(!l.has(a.id)&&(l.add(a.id),s.push(a),r>0)){let t=await e.traverse(a.id,{maxDepth:r,edgeType:n?.edgeType,limit:i});for(let e of t.nodes)l.has(e.id)||(l.add(e.id),s.push(e));for(let e of t.edges)u.has(e.id)||(u.add(e.id),c.push(e))}a.push({recordId:o.recordId,score:o.score,sourcePath:o.sourcePath,graphContext:{nodes:s,edges:c}})}catch{a.push({recordId:o.recordId,score:o.score,sourcePath:o.sourcePath,graphContext:{nodes:[],edges:[]}})}return a}export{r as graphAugmentSearch,n as graphQuery};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
+
//#region packages/tools/src/guide.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Tool discovery — recommends MCP tools and workflows for a given goal.
|
|
3
4
|
*
|
|
4
5
|
* Uses keyword matching against predefined workflow templates.
|
|
5
6
|
* No embeddings required — pure string matching for instant results.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
interface GuideRecommendation {
|
|
9
|
+
tool: string;
|
|
10
|
+
reason: string;
|
|
11
|
+
order: number;
|
|
12
|
+
suggestedArgs?: Record<string, unknown>;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
interface GuideResult {
|
|
15
|
+
workflow: string;
|
|
16
|
+
description: string;
|
|
17
|
+
tools: GuideRecommendation[];
|
|
18
|
+
alternativeWorkflows: string[];
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Match a goal description to the best workflow and return tool recommendations.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
-
//#
|
|
23
|
+
declare function guide(goal: string, maxRecommendations?: number): GuideResult;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { GuideRecommendation, GuideResult, guide };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=[{name:`onboard`,description:`First-time codebase exploration and understanding`,keywords:[`onboard`,`new project`,`understand`,`explore`,`first time`,`getting started`,`learn`,`overview`],tools:[{tool:`status`,reason:`Check index health and record count`,order:1},{tool:`onboard`,reason:`Run all analysis tools in one command`,order:2,suggestedArgs:{path:`.`}},{tool:`search`,reason:`Find specific topics of interest`,order:3},{tool:`graph`,reason:`Explore module relationships`,order:4,suggestedArgs:{action:`stats`}}]},{name:`audit`,description:`Assess project health, quality, and structure`,keywords:[`audit`,`health`,`quality`,`assess`,`review project`,`check quality`,`code quality`,`tech debt`],tools:[{tool:`status`,reason:`Check index freshness`,order:1},{tool:`audit`,reason:`Unified audit report with score and recommendations`,order:2,suggestedArgs:{detail:`summary`}},{tool:`check`,reason:`Typecheck + lint validation`,order:3},{tool:`health`,reason:`Detailed health checks on package.json, tsconfig, etc.`,order:4}]},{name:`bugfix`,description:`Diagnose and fix a bug or failing test`,keywords:[`bug`,`fix`,`debug`,`error`,`failing`,`broken`,`crash`,`wrong`,`issue`,`problem`,`not working`],tools:[{tool:`parse_output`,reason:`Parse error output from build tools (tsc, vitest, biome)`,order:1},{tool:`symbol`,reason:`Find definition and all references of the failing symbol`,order:2},{tool:`trace`,reason:`Trace call chain backward from the failure point`,order:3,suggestedArgs:{direction:`backward`}},{tool:`search`,reason:`Search for related patterns or similar fixes`,order:4},{tool:`test_run`,reason:`Re-run tests after fix`,order:5}]},{name:`implement`,description:`Add a new feature or implement a change`,keywords:[`implement`,`add feature`,`new feature`,`build`,`create`,`add`,`develop`,`write code`],tools:[{tool:`scope_map`,reason:`Generate a reading plan for affected files`,order:1},{tool:`search`,reason:`Find related patterns and prior art`,order:2},{tool:`find`,reason:`Find usage examples of similar patterns`,order:3,suggestedArgs:{mode:`examples`}},{tool:`check`,reason:`Validate after implementation`,order:4},{tool:`test_run`,reason:`Run tests to verify`,order:5},{tool:`blast_radius`,reason:`Check impact of changes`,order:6}]},{name:`refactor`,description:`Restructure or clean up existing code`,keywords:[`refactor`,`restructure`,`clean up`,`reorganize`,`rename`,`move`,`extract`,`DRY`,`dead code`],tools:[{tool:`dead_symbols`,reason:`Find unused exports to remove`,order:1},{tool:`symbol`,reason:`Find all references before renaming`,order:2},{tool:`blast_radius`,reason:`Assess impact before making changes`,order:3},{tool:`rename`,reason:`Safe cross-file rename`,order:4},{tool:`check`,reason:`Validate after refactoring`,order:5},{tool:`test_run`,reason:`Ensure no regressions`,order:6}]},{name:`search`,description:`Find specific code, patterns, or information`,keywords:[`find`,`search`,`where`,`locate`,`look for`,`grep`,`which file`,`how does`],tools:[{tool:`search`,reason:`Hybrid semantic + keyword search`,order:1},{tool:`find`,reason:`Federated search with glob and regex`,order:2},{tool:`symbol`,reason:`Resolve a specific symbol definition and references`,order:3},{tool:`graph`,reason:`Explore entity relationships`,order:4,suggestedArgs:{action:`neighbors`}}]},{name:`context`,description:`Compress or manage context for efficient LLM interaction`,keywords:[`context`,`compress`,`summarize`,`too long`,`token`,`budget`,`reduce`,`compact`],tools:[{tool:`file_summary`,reason:`Quick structural overview without reading full file`,order:1},{tool:`compact`,reason:`Compress file to relevant sections`,order:2,suggestedArgs:{segmentation:`paragraph`}},{tool:`digest`,reason:`Compress multiple sources into budgeted summary`,order:3},{tool:`stratum_card`,reason:`Generate reusable context cards`,order:4}]},{name:`memory`,description:`Manage persistent knowledge across sessions`,keywords:[`memory`,`remember`,`persist`,`save`,`recall`,`decision`,`convention`,`session`,`checkpoint`],tools:[{tool:`list`,reason:`See all stored knowledge entries`,order:1},{tool:`search`,reason:`Search curated knowledge`,order:2,suggestedArgs:{origin:`curated`}},{tool:`remember`,reason:`Store a new decision or pattern`,order:3},{tool:`checkpoint`,reason:`Save/restore session progress`,order:4},{tool:`stash`,reason:`Temporary key-value storage within session`,order:5}]},{name:`validate`,description:`Run checks, tests, and validation`,keywords:[`validate`,`check`,`test`,`lint`,`typecheck`,`verify`,`CI`,`pass`,`run tests`],tools:[{tool:`check`,reason:`Typecheck + lint in one call`,order:1,suggestedArgs:{detail:`errors`}},{tool:`test_run`,reason:`Run tests with structured output`,order:2},{tool:`health`,reason:`Project health assessment`,order:3}]},{name:`analyze`,description:`Deep analysis of codebase structure, dependencies, or patterns`,keywords:[`analyze`,`dependency`,`structure`,`pattern`,`architecture`,`diagram`,`entry point`,`import`],tools:[{tool:`analyze_structure`,reason:`Project structure overview`,order:1},{tool:`analyze_dependencies`,reason:`Dependency graph and analysis`,order:2},{tool:`analyze_patterns`,reason:`Detect code patterns and conventions`,order:3},{tool:`analyze_entry_points`,reason:`Find handlers, exports, and entry points`,order:4},{tool:`analyze_diagram`,reason:`Generate Mermaid diagrams`,order:5}]}];function t(t,n=5){let r=t.toLowerCase(),i=e.map(e=>{let t=0;for(let n of e.keywords)r.includes(n)&&(t+=n.includes(` `)?2:1);return{workflow:e,score:t}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score),a=e.find(e=>e.name===`search`)??e[0],o=i[0]?.workflow??a,s=i.slice(1,4).map(e=>e.workflow.name).filter(e=>e!==o.name);return{workflow:o.name,description:o.description,tools:o.tools.slice(0,n),alternativeWorkflows:s}}export{t as guide};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region packages/tools/src/health.d.ts
|
|
2
|
+
interface HealthCheck {
|
|
3
|
+
name: string;
|
|
4
|
+
status: 'pass' | 'warn' | 'fail';
|
|
5
|
+
message: string;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
interface HealthResult {
|
|
8
|
+
path: string;
|
|
9
|
+
checks: HealthCheck[];
|
|
10
|
+
score: number;
|
|
11
|
+
summary: string;
|
|
11
12
|
}
|
|
12
13
|
/** Run project health checks on a directory. */
|
|
13
|
-
|
|
14
|
-
//#
|
|
14
|
+
declare function health(rootPath?: string): HealthResult;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { HealthCheck, HealthResult, health };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)){
|
|
1
|
+
import{extname as e,join as t,relative as n,resolve as r}from"node:path";import{existsSync as i,readFileSync as a,readdirSync as o,statSync as s}from"node:fs";function c(e){let n=r(e??process.cwd()),o=[],c=t(n,`package.json`);if(i(c)){o.push({name:`package.json`,status:`pass`,message:`Found`});try{let e=JSON.parse(a(c,`utf-8`));e.name?o.push({name:`package.name`,status:`pass`,message:e.name}):o.push({name:`package.name`,status:`warn`,message:`Missing package name`});let t=e.scripts??{};for(let e of[`build`,`test`,`lint`])t[e]?o.push({name:`script:${e}`,status:`pass`,message:t[e]}):o.push({name:`script:${e}`,status:`warn`,message:`No "${e}" script defined`});e.type===`module`?o.push({name:`esm`,status:`pass`,message:`ESM ("type": "module")`}):e.type===`commonjs`?o.push({name:`esm`,status:`pass`,message:`CJS ("type": "commonjs")`}):o.push({name:`esm`,status:`warn`,message:`No "type" field — defaults to CJS`}),e.engines?.node?o.push({name:`engines.node`,status:`pass`,message:e.engines.node}):o.push({name:`engines.node`,status:`warn`,message:`No Node.js engine constraint`})}catch{o.push({name:`package.json`,status:`fail`,message:`Failed to parse package.json`})}}else o.push({name:`package.json`,status:`fail`,message:`Missing — not a Node.js project`});let f=t(n,`tsconfig.json`);i(f)?o.push({name:`tsconfig.json`,status:`pass`,message:`Found`}):o.push({name:`tsconfig.json`,status:`warn`,message:`Missing`});let p=t(n,`.gitignore`);if(i(p)){let e=a(p,`utf-8`),t=e.includes(`node_modules`),n=e.includes(`dist`);t&&n?o.push({name:`.gitignore`,status:`pass`,message:`Includes node_modules and dist`}):o.push({name:`.gitignore`,status:`warn`,message:`Missing: ${t?``:`node_modules `}${n?``:`dist`}`.trim()})}else o.push({name:`.gitignore`,status:`warn`,message:`Missing`});let h=[`pnpm-lock.yaml`,`package-lock.json`,`yarn.lock`,`bun.lock`].find(e=>i(t(n,e)));h?o.push({name:`lockfile`,status:`pass`,message:h}):o.push({name:`lockfile`,status:`warn`,message:`No lock file found`});let g=t(n,`README.md`);if(i(g)){let e=a(g,`utf-8`).length;o.push({name:`README.md`,status:e>100?`pass`:`warn`,message:e>100?`Found (${e} chars)`:`Found but very short`})}else o.push({name:`README.md`,status:`warn`,message:`Missing`});if(i(t(n,`LICENSE`))||i(t(n,`LICENSE.md`))?o.push({name:`LICENSE`,status:`pass`,message:`Found`}):o.push({name:`LICENSE`,status:`warn`,message:`Missing`}),i(f))try{let e=a(f,`utf-8`).replace(/\/\/.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``);JSON.parse(e).compilerOptions?.strict===!0?o.push({name:`typescript.strict`,status:`pass`,message:`strict: true`}):o.push({name:`typescript.strict`,status:`warn`,message:`strict mode not enabled in tsconfig.json`})}catch{}if(i(c))try{let e=JSON.parse(a(c,`utf-8`));e.exports?o.push({name:`package.exports`,status:`pass`,message:`Has exports field`}):e.workspaces||i(t(n,`pnpm-workspace.yaml`))||o.push({name:`package.exports`,status:`warn`,message:`Missing — consider adding exports field for explicit public API`});let r=l(n,e);r.length>0&&u(n,r,o)}catch{}let _=t(n,`dist`),v=t(n,`src`);if(i(_)&&i(v))try{let e=s(_).mtimeMs;d(v)>e?o.push({name:`build.freshness`,status:`warn`,message:`Source files are newer than dist/ — rebuild may be needed`}):o.push({name:`build.freshness`,status:`pass`,message:`Build output is fresh`})}catch{}if(i(v)){let e=m(v);if(e.length===0)o.push({name:`circular_deps`,status:`pass`,message:`No circular imports detected`});else{let t=e.slice(0,3).map(e=>e.join(` → `));o.push({name:`circular_deps`,status:`warn`,message:`${e.length} circular import(s): ${t.join(`; `)}${e.length>3?` (+${e.length-3} more)`:``}`})}}let y=o.length,b=o.filter(e=>e.status===`pass`).length,x=o.filter(e=>e.status===`fail`).length;return{path:n,checks:o,score:y>0?Math.round(b/y*100):0,summary:x>0?`${x} critical issue(s), ${y-b-x} warning(s)`:y-b>0?`${y-b} warning(s)`:`All checks passed`}}function l(e,n){let r=[];Array.isArray(n.workspaces)?r.push(...n.workspaces):n.workspaces&&typeof n.workspaces==`object`&&Array.isArray(n.workspaces.packages)&&r.push(...n.workspaces.packages);let s=t(e,`pnpm-workspace.yaml`);if(i(s)){let e=a(s,`utf-8`);for(let t of e.split(`
|
|
2
|
+
`)){let e=t.match(/^\s*-\s+['"]?([^'"#\s]+)['"]?\s*$/);e&&r.push(e[1])}}let c=[];for(let n of r)if(n.endsWith(`/*`)||n.endsWith(`/**`)){let r=t(e,n.replace(/\/\*+$/,``));if(i(r))try{for(let e of o(r,{withFileTypes:!0}))e.isDirectory()&&i(t(r,e.name,`package.json`))&&c.push(t(r,e.name))}catch{}}else{let r=t(e,n);i(t(r,`package.json`))&&c.push(r)}return c}function u(e,n,r){let i=0,o=0,s=new Map;for(let e of n)try{let n=JSON.parse(a(t(e,`package.json`),`utf-8`));n.scripts?.test||i++,!n.exports&&!n.main&&o++;let r={...n.dependencies,...n.devDependencies};for(let e of Object.values(r))if(typeof e==`string`&&e.startsWith(`workspace:`)){let t=e.startsWith(`workspace:*`)?`workspace:*`:e.startsWith(`workspace:^`)?`workspace:^`:`workspace:~`;s.set(t,(s.get(t)??0)+1)}}catch{}if(i>0?r.push({name:`workspace.test-scripts`,status:`warn`,message:`${i}/${n.length} workspace packages missing test script`}):r.push({name:`workspace.test-scripts`,status:`pass`,message:`All ${n.length} workspace packages have test scripts`}),o>0?r.push({name:`workspace.exports`,status:`warn`,message:`${o}/${n.length} packages missing exports field`}):n.length>0&&r.push({name:`workspace.exports`,status:`pass`,message:`All ${n.length} packages have exports or main field`}),s.size>1){let e=[...s.entries()].map(([e,t])=>`${e} (${t})`).join(`, `);r.push({name:`workspace.protocol`,status:`warn`,message:`Mixed workspace protocols: ${e} — consider standardizing`})}else if(s.size===1){let[e]=s.keys();r.push({name:`workspace.protocol`,status:`pass`,message:`Consistent workspace protocol: ${e}`})}}function d(e){let n=0;try{for(let r of o(e,{withFileTypes:!0})){if(r.name.startsWith(`.`)||r.name===`node_modules`)continue;let i=t(e,r.name);n=r.isDirectory()?Math.max(n,d(i)):Math.max(n,s(i).mtimeMs)}}catch{}return n}const f=/(?:import|export)\s+.*?from\s+['"](\.[^'"]+)['"]/g,p=new Set([`.ts`,`.tsx`,`.mts`]);function m(e){let t=new Map;h(e,e,t);let n=[],r=new Set,i=new Set;function a(e,o){if(i.has(e)){let t=o.indexOf(e);t>=0&&n.push(o.slice(t).concat(e));return}if(!r.has(e)){r.add(e),i.add(e),o.push(e);for(let n of t.get(e)??[])a(n,o);o.pop(),i.delete(e)}}for(let e of t.keys())a(e,[]);return n}function h(r,i,c){let l;try{l=o(r)}catch{return}for(let o of l){if(o.startsWith(`.`)||o===`node_modules`||o===`__tests__`)continue;let l=t(r,o);try{if(s(l).isDirectory())h(l,i,c);else if(p.has(e(o))){let e=n(i,l).replace(/\\/g,`/`),t=a(l,`utf-8`),o=[];for(let e of t.matchAll(f)){let t=e[1],n=g(r,t,i);n&&o.push(n)}c.set(e,o)}}catch{}}}function g(e,t,i){let a=r(e,t);for(let e of[`.ts`,`.tsx`,`.mts`,`.js`,`.mjs`,``])return n(i,e?a.replace(/\.[^.]+$/,``)+e:a).replace(/\\/g,`/`).replace(/\.js$/,`.ts`).replace(/\.mjs$/,`.mts`);return null}export{c as health};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
+
//#region packages/tools/src/http-request.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* kb_http — Make HTTP requests for API testing and debugging.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
|
6
|
+
interface HttpRequestOptions {
|
|
7
|
+
url: string;
|
|
8
|
+
method?: HttpMethod;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body?: string;
|
|
11
|
+
timeout?: number;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
interface HttpRequestResult {
|
|
14
|
+
status: number;
|
|
15
|
+
statusText: string;
|
|
16
|
+
headers: Record<string, string>;
|
|
17
|
+
body: string;
|
|
18
|
+
durationMs: number;
|
|
19
|
+
contentType: string;
|
|
20
|
+
sizeBytes: number;
|
|
21
|
+
truncated: boolean;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
//#
|
|
23
|
+
declare function httpRequest(options: HttpRequestOptions): Promise<HttpRequestResult>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { HttpMethod, HttpRequestOptions, HttpRequestResult, httpRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headTailTruncate as
|
|
1
|
+
import{headTailTruncate as e}from"./truncation.js";const t=5e4;async function n(n){let{url:r,method:i=`GET`,headers:a={},body:o,timeout:s=15e3}=n,c=new URL(r);if(c.protocol!==`http:`&&c.protocol!==`https:`)throw Error(`Unsupported protocol: ${c.protocol} — only http/https allowed`);let l=c.hostname;if(l===`169.254.169.254`||l===`metadata.google.internal`||l.startsWith(`fd`)||/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(l)||l===`0.0.0.0`||l===`[::]`)throw Error(`Blocked request to private/metadata address: ${l}`);let u=new AbortController,d=setTimeout(()=>u.abort(),s),f=Date.now(),p;try{p=await fetch(r,{method:i,headers:{"User-Agent":`kb-http/1.0`,...a},body:i!==`GET`&&i!==`HEAD`?o:void 0,signal:u.signal,redirect:`follow`})}finally{clearTimeout(d)}let m=Date.now()-f,h=await p.text(),g=p.headers.get(`content-type`)??``,_=h;if(g.includes(`json`))try{_=JSON.stringify(JSON.parse(h),null,2)}catch{}let v=!1;_.length>t&&(_=e(_,t),v=!0);let y={};return p.headers.forEach((e,t)=>{y[t]=e}),{status:p.status,statusText:p.statusText,headers:y,body:_,durationMs:m,contentType:g,sizeBytes:h.length,truncated:v}}export{n as httpRequest};
|
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { KBError, KBErrorCode, KBNextHint, KBResponse, KBResponseMeta, errorResponse, okResponse } from "./response-envelope.js";
|
|
2
|
+
import { AuditCheck, AuditData, AuditOptions, AuditRecommendation, audit } from "./audit.js";
|
|
3
|
+
import { BatchOperation, BatchOptions, BatchResult, batch } from "./batch.js";
|
|
4
|
+
import { ChangelogEntry, ChangelogFormat, ChangelogOptions, ChangelogResult, changelog, formatChangelog } from "./changelog.js";
|
|
5
|
+
import { ParsedError, ParsedGitStatus, ParsedOutput, ParsedTestResult, ParsedTestSummary, parseBiome, parseGitStatus, parseOutput, parseTsc, parseVitest } from "./parse-output.js";
|
|
6
|
+
import { CheckOptions, CheckResult, CheckSummaryResult, check, summarizeCheckResult } from "./check.js";
|
|
7
|
+
import { Checkpoint, checkpointLatest, checkpointList, checkpointLoad, checkpointSave } from "./checkpoint.js";
|
|
8
|
+
import { CodemodChange, CodemodOptions, CodemodResult, CodemodRule, codemod } from "./codemod.js";
|
|
9
|
+
import { FileCache, FileCacheEntry, FileCacheStats } from "./file-cache.js";
|
|
10
|
+
import { CompactOptions, CompactResult, compact } from "./compact.js";
|
|
11
|
+
import { TransformOptions, TransformResult, dataTransform } from "./data-transform.js";
|
|
12
|
+
import { DeadSymbol, DeadSymbolOptions, DeadSymbolResult, findDeadSymbols } from "./dead-symbols.js";
|
|
13
|
+
import { DelegateOptions, DelegateResult, delegate, delegateListModels } from "./delegate.js";
|
|
14
|
+
import { DiffChange, DiffFile, DiffHunk, DiffParseOptions, diffParse } from "./diff-parse.js";
|
|
15
|
+
import { DigestFieldEntry, DigestOptions, DigestResult, DigestSource, digest } from "./digest.js";
|
|
16
|
+
import { DogfoodLogEntry, DogfoodLogGroupedEntry, DogfoodLogOptions, DogfoodLogResult, dogfoodLog } from "./dogfood-log.js";
|
|
17
|
+
import { EncodeOperation, EncodeOptions, EncodeResult, encode } from "./encode.js";
|
|
18
|
+
import { EnvInfoOptions, EnvInfoResult, envInfo } from "./env-info.js";
|
|
19
|
+
import { EvalOptions, EvalResult, evaluate } from "./eval.js";
|
|
20
|
+
import { EvidenceEntry, EvidenceMapAction, EvidenceMapResult, EvidenceMapState, EvidenceStatus, ForgeTier, GateDecision, GateResult, UnknownType, evidenceMap } from "./evidence-map.js";
|
|
21
|
+
import { FileSummaryOptions, FileSummaryResult, fileSummary } from "./file-summary.js";
|
|
22
|
+
import { Example, FindExamplesOptions, FindExamplesResult, findExamples } from "./find-examples.js";
|
|
23
|
+
import { FindOptions, FindResult, FindResults, find } from "./find.js";
|
|
24
|
+
import { ClassifyTrigger, ForgeClassifyCeremony, ForgeClassifyOptions, ForgeClassifyResult, TypedUnknownSeed, forgeClassify } from "./forge-classify.js";
|
|
25
|
+
import { ScopeMapEntry, ScopeMapOptions, ScopeMapResult, scopeMap } from "./scope-map.js";
|
|
26
|
+
import { ConstraintRef, ForgeGroundOptions, ForgeGroundResult, forgeGround } from "./forge-ground.js";
|
|
27
|
+
import { GitContextOptions, GitContextResult, gitContext } from "./git-context.js";
|
|
28
|
+
import { GraphAugmentOptions, GraphAugmentedResult, GraphQueryOptions, GraphQueryResult, graphAugmentSearch, graphQuery } from "./graph-query.js";
|
|
29
|
+
import { GuideRecommendation, GuideResult, guide } from "./guide.js";
|
|
30
|
+
import { HealthCheck, HealthResult, health } from "./health.js";
|
|
31
|
+
import { HttpMethod, HttpRequestOptions, HttpRequestResult, httpRequest } from "./http-request.js";
|
|
32
|
+
import { LaneDiffEntry, LaneDiffResult, LaneMergeResult, LaneMeta, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus } from "./lane.js";
|
|
33
|
+
import { FileMetrics, MeasureOptions, MeasureResult, analyzeFile, measure } from "./measure.js";
|
|
34
|
+
import { OnboardMode, OnboardOptions, OnboardResult, OnboardStepResult, onboard } from "./onboard.js";
|
|
35
|
+
import { resolvePath } from "./path-resolver.js";
|
|
36
|
+
import { ManagedProcess, processList, processLogs, processStart, processStatus, processStop } from "./process-manager.js";
|
|
37
|
+
import { QueueItem, QueueState, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush } from "./queue.js";
|
|
38
|
+
import { RegexTestOptions, RegexTestResult, regexTest } from "./regex-test.js";
|
|
39
|
+
import { RenameChange, RenameOptions, RenameResult, rename } from "./rename.js";
|
|
40
|
+
import { ReplayEntry, ReplayOptions, replayAppend, replayCapture, replayClear, replayList, replayTrim } from "./replay.js";
|
|
41
|
+
import { SchemaValidateOptions, SchemaValidateResult, ValidationError, schemaValidate } from "./schema-validate.js";
|
|
42
|
+
import { Snippet, SnippetAction, SnippetOptions, SnippetResult, snippet } from "./snippet.js";
|
|
43
|
+
import { StashEntry, stashClear, stashDelete, stashGet, stashList, stashSet } from "./stash.js";
|
|
44
|
+
import { StratumCard, StratumCardOptions, StratumCardResult, stratumCard } from "./stratum-card.js";
|
|
45
|
+
import { SymbolInfo, SymbolOptions, symbol } from "./symbol.js";
|
|
46
|
+
import { TestRunOptions, TestRunResult, classifyExitCode, testRun } from "./test-run.js";
|
|
47
|
+
import { cosineSimilarity, estimateTokens, segment } from "./text-utils.js";
|
|
48
|
+
import { TimeOptions, TimeResult, timeUtils } from "./time-utils.js";
|
|
49
|
+
import { TraceNode, TraceOptions, TraceResult, trace } from "./trace.js";
|
|
50
|
+
import { headTailTruncate, paragraphTruncate, truncateToTokenBudget } from "./truncation.js";
|
|
51
|
+
import { WatchEvent, WatchHandle, WatchOptions, watchList, watchStart, watchStop } from "./watch.js";
|
|
52
|
+
import { WebFetchMode, WebFetchOptions, WebFetchResult, webFetch } from "./web-fetch.js";
|
|
53
|
+
import { WebSearchOptions, WebSearchResult, WebSearchResultItem, parseSearchResults, webSearch } from "./web-search.js";
|
|
54
|
+
import { Workset, addToWorkset, deleteWorkset, getWorkset, listWorksets, removeFromWorkset, saveWorkset } from "./workset.js";
|
|
55
|
+
export { type AuditCheck, type AuditData, type AuditOptions, type AuditRecommendation, type BatchOperation, type BatchOptions, type BatchResult, type ChangelogEntry, type ChangelogFormat, type ChangelogOptions, type ChangelogResult, type CheckOptions, type CheckResult, type CheckSummaryResult, type Checkpoint, type ClassifyTrigger, type CodemodChange, type CodemodOptions, type CodemodResult, type CodemodRule, type CompactOptions, type CompactResult, type ConstraintRef, type DeadSymbol, type DeadSymbolOptions, type DeadSymbolResult, type DelegateOptions, type DelegateResult, type DiffChange, type DiffFile, type DiffHunk, type DiffParseOptions, type DigestFieldEntry, type DigestOptions, type DigestResult, type DigestSource, type DogfoodLogEntry, type DogfoodLogGroupedEntry, type DogfoodLogOptions, type DogfoodLogResult, type EncodeOperation, type EncodeOptions, type EncodeResult, type EnvInfoOptions, type EnvInfoResult, type EvalOptions, type EvalResult, type EvidenceEntry, type EvidenceMapAction, type EvidenceMapResult, type EvidenceMapState, type EvidenceStatus, type Example, FileCache, type FileCacheEntry, type FileCacheStats, type FileMetrics, type FileSummaryOptions, type FileSummaryResult, type FindExamplesOptions, type FindExamplesResult, type FindOptions, type FindResult, type FindResults, type ForgeClassifyCeremony, type ForgeClassifyOptions, type ForgeClassifyResult, type ForgeGroundOptions, type ForgeGroundResult, type ForgeTier, type GateDecision, type GateResult, type GitContextOptions, type GitContextResult, type GraphAugmentOptions, type GraphAugmentedResult, type GraphQueryOptions, type GraphQueryResult, type GuideRecommendation, type GuideResult, type HealthCheck, type HealthResult, type HttpMethod, type HttpRequestOptions, type HttpRequestResult, type KBError, type KBErrorCode, type KBNextHint, type KBResponse, type KBResponseMeta, type LaneDiffEntry, type LaneDiffResult, type LaneMergeResult, type LaneMeta, type ManagedProcess, type MeasureOptions, type MeasureResult, type OnboardMode, type OnboardOptions, type OnboardResult, type OnboardStepResult, type ParsedError, type ParsedGitStatus, type ParsedOutput, type ParsedTestResult, type ParsedTestSummary, type QueueItem, type QueueState, type RegexTestOptions, type RegexTestResult, type RenameChange, type RenameOptions, type RenameResult, type ReplayEntry, type ReplayOptions, type SchemaValidateOptions, type SchemaValidateResult, type ScopeMapEntry, type ScopeMapOptions, type ScopeMapResult, type Snippet, type SnippetAction, type SnippetOptions, type SnippetResult, type StashEntry, type StratumCard, type StratumCardOptions, type StratumCardResult, type SymbolInfo, type SymbolOptions, type TestRunOptions, type TestRunResult, type TimeOptions, type TimeResult, type TraceNode, type TraceOptions, type TraceResult, type TransformOptions, type TransformResult, type TypedUnknownSeed, type UnknownType, type ValidationError, type WatchEvent, type WatchHandle, type WatchOptions, type WebFetchMode, type WebFetchOptions, type WebFetchResult, type WebSearchOptions, type WebSearchResult, type WebSearchResultItem, type Workset, addToWorkset, analyzeFile, audit, batch, changelog, check, checkpointLatest, checkpointList, checkpointLoad, checkpointSave, classifyExitCode, codemod, compact, cosineSimilarity, dataTransform, delegate, delegateListModels, deleteWorkset, diffParse, digest, dogfoodLog, encode, envInfo, errorResponse, estimateTokens, evaluate, evidenceMap, fileSummary, find, findDeadSymbols, findExamples, forgeClassify, forgeGround, formatChangelog, getWorkset, gitContext, graphAugmentSearch, graphQuery, guide, headTailTruncate, health, httpRequest, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus, listWorksets, measure, okResponse, onboard, paragraphTruncate, parseBiome, parseGitStatus, parseOutput, parseSearchResults, parseTsc, parseVitest, processList, processLogs, processStart, processStatus, processStop, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush, regexTest, removeFromWorkset, rename, replayAppend, replayCapture, replayClear, replayList, replayTrim, resolvePath, saveWorkset, schemaValidate, scopeMap, segment, snippet, stashClear, stashDelete, stashGet, stashList, stashSet, stratumCard, summarizeCheckResult, symbol, testRun, timeUtils, trace, truncateToTokenBudget, watchList, watchStart, watchStop, webFetch, webSearch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{parseBiome as e,parseGitStatus as t,parseOutput as n,parseTsc as r,parseVitest as i}from"./parse-output.js";import{check as a,summarizeCheckResult as o}from"./check.js";import{findDeadSymbols as s}from"./dead-symbols.js";import{health as c}from"./health.js";import{resolvePath as l}from"./path-resolver.js";import{cosineSimilarity as u,estimateTokens as d,segment as f}from"./text-utils.js";import{errorResponse as p,okResponse as m}from"./response-envelope.js";import{audit as h}from"./audit.js";import{batch as g}from"./batch.js";import{changelog as _,formatChangelog as v}from"./changelog.js";import{checkpointLatest as y,checkpointList as b,checkpointLoad as x,checkpointSave as S}from"./checkpoint.js";import{codemod as C}from"./codemod.js";import{compact as w}from"./compact.js";import{dataTransform as T}from"./data-transform.js";import{delegate as E,delegateListModels as D}from"./delegate.js";import{diffParse as O}from"./diff-parse.js";import{digest as k}from"./digest.js";import{dogfoodLog as A}from"./dogfood-log.js";import{encode as j}from"./encode.js";import{envInfo as M}from"./env-info.js";import{evaluate as N}from"./eval.js";import{evidenceMap as P}from"./evidence-map.js";import{FileCache as F}from"./file-cache.js";import{fileSummary as I}from"./file-summary.js";import{findExamples as L}from"./find-examples.js";import{find as R}from"./find.js";import{forgeClassify as z}from"./forge-classify.js";import{scopeMap as B}from"./scope-map.js";import{forgeGround as V}from"./forge-ground.js";import{gitContext as H}from"./git-context.js";import{graphAugmentSearch as U,graphQuery as W}from"./graph-query.js";import{guide as G}from"./guide.js";import{headTailTruncate as K,paragraphTruncate as q,truncateToTokenBudget as J}from"./truncation.js";import{httpRequest as Y}from"./http-request.js";import{laneCreate as X,laneDiff as Z,laneDiscard as Q,laneList as $,laneMerge as ee,laneStatus as te}from"./lane.js";import{analyzeFile as ne,measure as re}from"./measure.js";import{onboard as ie}from"./onboard.js";import{processList as ae,processLogs as oe,processStart as se,processStatus as ce,processStop as le}from"./process-manager.js";import{queueClear as ue,queueCreate as de,queueDelete as fe,queueDone as pe,queueFail as me,queueGet as he,queueList as ge,queueNext as _e,queuePush as ve}from"./queue.js";import{regexTest as ye}from"./regex-test.js";import{rename as be}from"./rename.js";import{replayAppend as xe,replayCapture as Se,replayClear as Ce,replayList as we,replayTrim as Te}from"./replay.js";import{schemaValidate as Ee}from"./schema-validate.js";import{snippet as De}from"./snippet.js";import{stashClear as Oe,stashDelete as ke,stashGet as Ae,stashList as je,stashSet as Me}from"./stash.js";import{stratumCard as Ne}from"./stratum-card.js";import{symbol as Pe}from"./symbol.js";import{classifyExitCode as Fe,testRun as Ie}from"./test-run.js";import{timeUtils as Le}from"./time-utils.js";import{trace as Re}from"./trace.js";import{watchList as ze,watchStart as Be,watchStop as Ve}from"./watch.js";import{webFetch as He}from"./web-fetch.js";import{parseSearchResults as Ue,webSearch as We}from"./web-search.js";import{addToWorkset as Ge,deleteWorkset as Ke,getWorkset as qe,listWorksets as Je,removeFromWorkset as Ye,saveWorkset as Xe}from"./workset.js";export{F as FileCache,Ge as addToWorkset,ne as analyzeFile,h as audit,g as batch,_ as changelog,a as check,y as checkpointLatest,b as checkpointList,x as checkpointLoad,S as checkpointSave,Fe as classifyExitCode,C as codemod,w as compact,u as cosineSimilarity,T as dataTransform,E as delegate,D as delegateListModels,Ke as deleteWorkset,O as diffParse,k as digest,A as dogfoodLog,j as encode,M as envInfo,p as errorResponse,d as estimateTokens,N as evaluate,P as evidenceMap,I as fileSummary,R as find,s as findDeadSymbols,L as findExamples,z as forgeClassify,V as forgeGround,v as formatChangelog,qe as getWorkset,H as gitContext,U as graphAugmentSearch,W as graphQuery,G as guide,K as headTailTruncate,c as health,Y as httpRequest,X as laneCreate,Z as laneDiff,Q as laneDiscard,$ as laneList,ee as laneMerge,te as laneStatus,Je as listWorksets,re as measure,m as okResponse,ie as onboard,q as paragraphTruncate,e as parseBiome,t as parseGitStatus,n as parseOutput,Ue as parseSearchResults,r as parseTsc,i as parseVitest,ae as processList,oe as processLogs,se as processStart,ce as processStatus,le as processStop,ue as queueClear,de as queueCreate,fe as queueDelete,pe as queueDone,me as queueFail,he as queueGet,ge as queueList,_e as queueNext,ve as queuePush,ye as regexTest,Ye as removeFromWorkset,be as rename,xe as replayAppend,Se as replayCapture,Ce as replayClear,we as replayList,Te as replayTrim,l as resolvePath,Xe as saveWorkset,Ee as schemaValidate,B as scopeMap,f as segment,De as snippet,Oe as stashClear,ke as stashDelete,Ae as stashGet,je as stashList,Me as stashSet,Ne as stratumCard,o as summarizeCheckResult,Pe as symbol,Ie as testRun,Le as timeUtils,Re as trace,J as truncateToTokenBudget,ze as watchList,Be as watchStart,Ve as watchStop,He as webFetch,We as webSearch};
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region packages/tools/src/lane.d.ts
|
|
2
|
+
interface LaneMeta {
|
|
3
|
+
name: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
sourceFiles: string[];
|
|
6
|
+
rootPath: string;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
interface LaneDiffEntry {
|
|
9
|
+
file: string;
|
|
10
|
+
status: 'modified' | 'added' | 'deleted' | 'unchanged';
|
|
11
|
+
diff?: string;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
interface LaneDiffResult {
|
|
14
|
+
name: string;
|
|
15
|
+
entries: LaneDiffEntry[];
|
|
16
|
+
modified: number;
|
|
17
|
+
added: number;
|
|
18
|
+
deleted: number;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
interface LaneMergeResult {
|
|
21
|
+
name: string;
|
|
22
|
+
filesMerged: number;
|
|
23
|
+
files: string[];
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Create an isolated lane by copying specified files into `.kb-state/lanes/<name>/`.
|
|
26
27
|
* Files are stored with their relative paths preserved.
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
declare function laneCreate(name: string, files: string[], cwd?: string): LaneMeta;
|
|
29
30
|
/** List all active lanes. */
|
|
30
|
-
|
|
31
|
+
declare function laneList(cwd?: string): LaneMeta[];
|
|
31
32
|
/** Get the status of a lane — which files are modified, added, deleted. */
|
|
32
|
-
|
|
33
|
+
declare function laneStatus(name: string, cwd?: string): LaneDiffResult;
|
|
33
34
|
/** Generate a unified diff for modified files in a lane. */
|
|
34
|
-
|
|
35
|
+
declare function laneDiff(name: string, cwd?: string): LaneDiffResult;
|
|
35
36
|
/** Merge lane files back to the original locations. */
|
|
36
|
-
|
|
37
|
+
declare function laneMerge(name: string, cwd?: string): LaneMergeResult;
|
|
37
38
|
/** Discard a lane entirely. */
|
|
38
|
-
|
|
39
|
-
//#
|
|
39
|
+
declare function laneDiscard(name: string, cwd?: string): boolean;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { LaneDiffEntry, LaneDiffResult, LaneMergeResult, LaneMeta, laneCreate, laneDiff, laneDiscard, laneList, laneMerge, laneStatus };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{cpSync as
|
|
2
|
-
|
|
3
|
-
`).
|
|
4
|
-
`)
|
|
5
|
-
`),i=r.
|
|
6
|
-
`),
|
|
7
|
-
`)}export{I as laneCreate,_ as laneDiff,W as laneDiscard,J as laneList,T as laneMerge,k as laneStatus};
|
|
1
|
+
import{join as e,relative as t,resolve as n}from"node:path";import{cpSync as r,existsSync as i,mkdirSync as a,readFileSync as o,readdirSync as s,rmSync as c,statSync as l,writeFileSync as u}from"node:fs";import{KB_PATHS as d}from"../../core/dist/index.js";const f=`${d.state}/lanes`,p=`.lane-meta.json`;function m(e){return n(e??process.cwd(),f)}function h(e,t){let r=m(t),i=n(r,e);if(!i.startsWith(n(r)))throw Error(`Invalid lane name: "${e}"`);return i}function g(t,n){let r=e(h(t,n),p);if(!i(r))throw Error(`Lane "${t}" does not exist`);try{return JSON.parse(o(r,`utf-8`))}catch{throw Error(`Lane "${t}" has corrupted metadata`)}}function _(o,s,c){let l=c??process.cwd(),d=h(o,c);if(i(d))throw Error(`Lane "${o}" already exists`);a(d,{recursive:!0});let f=[];for(let o of s){let s=n(l,o);if(!i(s))throw Error(`Source file does not exist: ${o}`);let c=t(l,s).replace(/\\/g,`/`),u=e(d,c);a(e(u,`..`),{recursive:!0}),r(s,u),f.push(c)}let m={name:o,createdAt:new Date().toISOString(),sourceFiles:f,rootPath:l};return u(e(d,p),`${JSON.stringify(m,null,2)}\n`,`utf-8`),m}function v(t){let n=m(t);if(!i(n))return[];let r=s(n),a=[];for(let t of r){let r=e(n,t,p);if(i(r))try{a.push(JSON.parse(o(r,`utf-8`)))}catch{}}return a}function y(t,r){let a=g(t,r),s=h(t,r),c=a.rootPath,l=[];for(let t of a.sourceFiles){let r=n(c,t),a=e(s,t);if(!i(a)){l.push({file:t,status:`deleted`});continue}if(!i(r)){l.push({file:t,status:`added`});continue}o(r,`utf-8`)===o(a,`utf-8`)?l.push({file:t,status:`unchanged`}):l.push({file:t,status:`modified`})}let u=C(s);for(let e of u)a.sourceFiles.includes(e)||l.push({file:e,status:`added`});return{name:t,entries:l,modified:l.filter(e=>e.status===`modified`).length,added:l.filter(e=>e.status===`added`).length,deleted:l.filter(e=>e.status===`deleted`).length}}function b(t,r){let a=g(t,r),s=h(t,r),c=a.rootPath,l=[],u=new Set(a.sourceFiles);for(let e of C(s))u.add(e);for(let t of u){let r=n(c,t),a=e(s,t),u=i(r),d=i(a);if(!d&&u){l.push({file:t,status:`deleted`});continue}if(d&&!u){let e=o(a,`utf-8`);l.push({file:t,status:`added`,diff:e.split(`
|
|
2
|
+
`).map(e=>`+${e}`).join(`
|
|
3
|
+
`)});continue}if(!d||!u)continue;let f=o(r,`utf-8`),p=o(a,`utf-8`);f===p?l.push({file:t,status:`unchanged`}):l.push({file:t,status:`modified`,diff:w(f,p)})}return{name:t,entries:l,modified:l.filter(e=>e.status===`modified`).length,added:l.filter(e=>e.status===`added`).length,deleted:l.filter(e=>e.status===`deleted`).length}}function x(t,o){let s=g(t,o),l=h(t,o),u=s.rootPath,d=[],f=new Set(s.sourceFiles);for(let e of C(l))f.add(e);for(let t of f){let o=e(l,t);if(!i(o))continue;let s=n(u,t);a(e(s,`..`),{recursive:!0}),r(o,s),d.push(t)}return c(l,{recursive:!0,force:!0}),{name:t,filesMerged:d.length,files:d}}function S(e,t){let n=h(e,t);return i(n)?(c(n,{recursive:!0,force:!0}),!0):!1}function C(n){let r=[];function a(i){for(let o of s(i)){if(o===p)continue;let s=e(i,o);l(s).isDirectory()?a(s):r.push(t(n,s).replace(/\\/g,`/`))}}return i(n)&&a(n),r.sort()}function w(e,t){let n=e.split(`
|
|
4
|
+
`),r=t.split(`
|
|
5
|
+
`),i=[],a=Math.max(n.length,r.length);for(let e=0;e<a;e++){let t=n[e],a=r[e];t===a?i.push(` ${t??``}`):(t!==void 0&&i.push(`-${t}`),a!==void 0&&i.push(`+${a}`))}return i.join(`
|
|
6
|
+
`)}export{_ as laneCreate,b as laneDiff,S as laneDiscard,v as laneList,x as laneMerge,y as laneStatus};
|