@vpxa/aikit 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1207 -0
- package/bin/aikit.mjs +10 -0
- package/package.json +92 -0
- package/packages/aikit-client/dist/direct-client.d.ts +37 -0
- package/packages/aikit-client/dist/direct-client.js +1 -0
- package/packages/aikit-client/dist/index.d.ts +5 -0
- package/packages/aikit-client/dist/index.js +1 -0
- package/packages/aikit-client/dist/mcp-client.d.ts +19 -0
- package/packages/aikit-client/dist/mcp-client.js +4 -0
- package/packages/aikit-client/dist/parsers.d.ts +35 -0
- package/packages/aikit-client/dist/parsers.js +2 -0
- package/packages/aikit-client/dist/types.d.ts +62 -0
- package/packages/aikit-client/dist/types.js +1 -0
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +19 -0
- package/packages/analyzers/dist/blast-radius-analyzer.js +6 -0
- package/packages/analyzers/dist/dependency-analyzer.d.ts +32 -0
- package/packages/analyzers/dist/dependency-analyzer.js +8 -0
- package/packages/analyzers/dist/diagram-generator.d.ts +16 -0
- package/packages/analyzers/dist/diagram-generator.js +2 -0
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +40 -0
- package/packages/analyzers/dist/entry-point-analyzer.js +4 -0
- package/packages/analyzers/dist/index.d.ts +12 -0
- package/packages/analyzers/dist/index.js +1 -0
- package/packages/analyzers/dist/knowledge-producer.d.ts +40 -0
- package/packages/analyzers/dist/knowledge-producer.js +26 -0
- package/packages/analyzers/dist/pattern-analyzer.d.ts +15 -0
- package/packages/analyzers/dist/pattern-analyzer.js +2 -0
- package/packages/analyzers/dist/regex-call-graph.d.ts +10 -0
- package/packages/analyzers/dist/regex-call-graph.js +1 -0
- package/packages/analyzers/dist/structure-analyzer.d.ts +19 -0
- package/packages/analyzers/dist/structure-analyzer.js +4 -0
- package/packages/analyzers/dist/symbol-analyzer.d.ts +14 -0
- package/packages/analyzers/dist/symbol-analyzer.js +9 -0
- package/packages/analyzers/dist/ts-call-graph.d.ts +29 -0
- package/packages/analyzers/dist/ts-call-graph.js +1 -0
- package/packages/analyzers/dist/types.d.ts +110 -0
- package/packages/analyzers/dist/types.js +1 -0
- package/packages/chunker/dist/call-graph-extractor.d.ts +25 -0
- package/packages/chunker/dist/call-graph-extractor.js +1 -0
- package/packages/chunker/dist/chunker-factory.d.ts +19 -0
- package/packages/chunker/dist/chunker-factory.js +1 -0
- package/packages/chunker/dist/chunker.interface.d.ts +13 -0
- package/packages/chunker/dist/chunker.interface.js +1 -0
- package/packages/chunker/dist/code-chunker.d.ts +17 -0
- package/packages/chunker/dist/code-chunker.js +11 -0
- 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 +3 -0
- package/packages/chunker/dist/extractors/types.d.ts +44 -0
- package/packages/chunker/dist/extractors/types.js +1 -0
- package/packages/chunker/dist/generic-chunker.d.ts +15 -0
- package/packages/chunker/dist/generic-chunker.js +5 -0
- package/packages/chunker/dist/index.d.ts +19 -0
- package/packages/chunker/dist/index.js +1 -0
- package/packages/chunker/dist/markdown-chunker.d.ts +17 -0
- package/packages/chunker/dist/markdown-chunker.js +3 -0
- 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-c.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-cpp.wasm +0 -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-kotlin.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-php.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-python.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-ruby.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-rust.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-scala.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-swift.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/aikit-init.d.ts +54 -0
- package/packages/cli/dist/aikit-init.js +1 -0
- package/packages/cli/dist/commands/analyze.d.ts +6 -0
- package/packages/cli/dist/commands/analyze.js +2 -0
- package/packages/cli/dist/commands/context-cmds.d.ts +6 -0
- package/packages/cli/dist/commands/context-cmds.js +1 -0
- package/packages/cli/dist/commands/environment.d.ts +6 -0
- package/packages/cli/dist/commands/environment.js +1 -0
- package/packages/cli/dist/commands/execution.d.ts +6 -0
- package/packages/cli/dist/commands/execution.js +1 -0
- package/packages/cli/dist/commands/flow.d.ts +6 -0
- package/packages/cli/dist/commands/flow.js +1 -0
- package/packages/cli/dist/commands/graph.d.ts +6 -0
- package/packages/cli/dist/commands/graph.js +6 -0
- 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 +41 -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/frontmatter.d.ts +54 -0
- package/packages/cli/dist/commands/init/frontmatter.js +2 -0
- package/packages/cli/dist/commands/init/index.d.ts +36 -0
- package/packages/cli/dist/commands/init/index.js +5 -0
- package/packages/cli/dist/commands/init/manifest.d.ts +71 -0
- package/packages/cli/dist/commands/init/manifest.js +1 -0
- package/packages/cli/dist/commands/init/scaffold.d.ts +46 -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 +194 -0
- package/packages/cli/dist/commands/init/user.d.ts +61 -0
- package/packages/cli/dist/commands/init/user.js +5 -0
- package/packages/cli/dist/commands/knowledge.d.ts +6 -0
- package/packages/cli/dist/commands/knowledge.js +1 -0
- package/packages/cli/dist/commands/search.d.ts +6 -0
- package/packages/cli/dist/commands/search.js +1 -0
- package/packages/cli/dist/commands/system.d.ts +6 -0
- package/packages/cli/dist/commands/system.js +4 -0
- package/packages/cli/dist/commands/upgrade.d.ts +6 -0
- package/packages/cli/dist/commands/upgrade.js +1 -0
- package/packages/cli/dist/commands/workspace.d.ts +6 -0
- package/packages/cli/dist/commands/workspace.js +1 -0
- package/packages/cli/dist/context.d.ts +7 -0
- package/packages/cli/dist/context.js +1 -0
- package/packages/cli/dist/helpers.d.ts +55 -0
- package/packages/cli/dist/helpers.js +5 -0
- package/packages/cli/dist/index.d.ts +10 -0
- package/packages/cli/dist/index.js +3 -0
- package/packages/cli/dist/types.d.ts +9 -0
- package/packages/cli/dist/types.js +1 -0
- package/packages/core/dist/constants.d.ts +74 -0
- package/packages/core/dist/constants.js +1 -0
- package/packages/core/dist/content-detector.d.ts +13 -0
- package/packages/core/dist/content-detector.js +1 -0
- package/packages/core/dist/errors.d.ts +20 -0
- package/packages/core/dist/errors.js +1 -0
- package/packages/core/dist/global-registry.d.ts +63 -0
- package/packages/core/dist/global-registry.js +1 -0
- package/packages/core/dist/index.d.ts +7 -0
- package/packages/core/dist/index.js +1 -0
- package/packages/core/dist/logger.d.ts +32 -0
- package/packages/core/dist/logger.js +1 -0
- package/packages/core/dist/types.d.ts +133 -0
- package/packages/core/dist/types.js +1 -0
- package/packages/dashboard/dist/assets/index-BjA4YODs.js +21 -0
- package/packages/dashboard/dist/assets/index-BjA4YODs.js.map +1 -0
- package/packages/dashboard/dist/assets/index-CHpVij2M.css +1 -0
- package/packages/dashboard/dist/index.html +18 -0
- package/packages/elicitation/dist/build.d.ts +14 -0
- package/packages/elicitation/dist/build.js +1 -0
- package/packages/elicitation/dist/fields.d.ts +32 -0
- package/packages/elicitation/dist/fields.js +1 -0
- package/packages/elicitation/dist/index.d.ts +5 -0
- package/packages/elicitation/dist/index.js +1 -0
- package/packages/elicitation/dist/normalize.d.ts +15 -0
- package/packages/elicitation/dist/normalize.js +1 -0
- package/packages/elicitation/dist/types.d.ts +88 -0
- package/packages/elicitation/dist/types.js +1 -0
- package/packages/embeddings/dist/embedder.interface.d.ts +26 -0
- package/packages/embeddings/dist/embedder.interface.js +1 -0
- package/packages/embeddings/dist/index.d.ts +3 -0
- package/packages/embeddings/dist/index.js +1 -0
- package/packages/embeddings/dist/onnx-embedder.d.ts +22 -0
- package/packages/embeddings/dist/onnx-embedder.js +1 -0
- 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/flows/dist/adapters/claude-plugin.d.ts +12 -0
- package/packages/flows/dist/adapters/claude-plugin.js +1 -0
- package/packages/flows/dist/adapters/copilot.d.ts +10 -0
- package/packages/flows/dist/adapters/copilot.js +1 -0
- package/packages/flows/dist/adapters/index.d.ts +11 -0
- package/packages/flows/dist/adapters/index.js +1 -0
- package/packages/flows/dist/adapters/native.d.ts +10 -0
- package/packages/flows/dist/adapters/native.js +1 -0
- package/packages/flows/dist/builtins.d.ts +16 -0
- package/packages/flows/dist/builtins.js +1 -0
- package/packages/flows/dist/foundation.d.ts +20 -0
- package/packages/flows/dist/foundation.js +11 -0
- package/packages/flows/dist/git.d.ts +34 -0
- package/packages/flows/dist/git.js +1 -0
- package/packages/flows/dist/index.d.ts +12 -0
- package/packages/flows/dist/index.js +1 -0
- package/packages/flows/dist/loader.d.ts +13 -0
- package/packages/flows/dist/loader.js +2 -0
- package/packages/flows/dist/registry.d.ts +23 -0
- package/packages/flows/dist/registry.js +1 -0
- package/packages/flows/dist/state-machine.d.ts +23 -0
- package/packages/flows/dist/state-machine.js +1 -0
- package/packages/flows/dist/symlinks.d.ts +17 -0
- package/packages/flows/dist/symlinks.js +1 -0
- package/packages/flows/dist/types.d.ts +112 -0
- package/packages/flows/dist/types.js +1 -0
- package/packages/indexer/dist/file-hasher.d.ts +13 -0
- package/packages/indexer/dist/file-hasher.js +1 -0
- package/packages/indexer/dist/filesystem-crawler.d.ts +29 -0
- package/packages/indexer/dist/filesystem-crawler.js +1 -0
- package/packages/indexer/dist/graph-extractor.d.ts +18 -0
- package/packages/indexer/dist/graph-extractor.js +1 -0
- package/packages/indexer/dist/hash-cache.d.ts +24 -0
- package/packages/indexer/dist/hash-cache.js +1 -0
- package/packages/indexer/dist/incremental-indexer.d.ts +56 -0
- package/packages/indexer/dist/incremental-indexer.js +1 -0
- package/packages/indexer/dist/index.d.ts +6 -0
- package/packages/indexer/dist/index.js +1 -0
- package/packages/present/dist/index.html +709 -0
- package/packages/server/dist/api.d.ts +3 -0
- package/packages/server/dist/api.js +1 -0
- package/packages/server/dist/auto-gc.d.ts +30 -0
- package/packages/server/dist/auto-gc.js +1 -0
- package/packages/server/dist/completions.d.ts +14 -0
- package/packages/server/dist/completions.js +1 -0
- package/packages/server/dist/config.d.ts +14 -0
- package/packages/server/dist/config.js +1 -0
- 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 +92 -0
- package/packages/server/dist/curated-manager.js +5 -0
- package/packages/server/dist/dashboard-static.d.ts +27 -0
- package/packages/server/dist/dashboard-static.js +1 -0
- package/packages/server/dist/elicitor.d.ts +18 -0
- package/packages/server/dist/elicitor.js +1 -0
- package/packages/server/dist/index.d.ts +1 -0
- package/packages/server/dist/index.js +1 -0
- package/packages/server/dist/mcp-logging.d.ts +11 -0
- package/packages/server/dist/mcp-logging.js +1 -0
- package/packages/server/dist/output-schemas.d.ts +242 -0
- package/packages/server/dist/output-schemas.js +1 -0
- package/packages/server/dist/prompts.d.ts +13 -0
- package/packages/server/dist/prompts.js +13 -0
- package/packages/server/dist/replay-interceptor.d.ts +23 -0
- package/packages/server/dist/replay-interceptor.js +1 -0
- package/packages/server/dist/resource-links.d.ts +34 -0
- package/packages/server/dist/resource-links.js +1 -0
- package/packages/server/dist/resources/curated-resources.d.ts +13 -0
- package/packages/server/dist/resources/curated-resources.js +2 -0
- package/packages/server/dist/resources/resource-notifier.d.ts +45 -0
- package/packages/server/dist/resources/resource-notifier.js +1 -0
- package/packages/server/dist/resources/resources.d.ts +8 -0
- package/packages/server/dist/resources/resources.js +2 -0
- package/packages/server/dist/sampling.d.ts +41 -0
- package/packages/server/dist/sampling.js +2 -0
- package/packages/server/dist/server.d.ts +47 -0
- package/packages/server/dist/server.js +3 -0
- package/packages/server/dist/structured-content-guard.d.ts +26 -0
- package/packages/server/dist/structured-content-guard.js +1 -0
- package/packages/server/dist/task-manager.d.ts +40 -0
- package/packages/server/dist/task-manager.js +1 -0
- package/packages/server/dist/tool-metadata.d.ts +38 -0
- package/packages/server/dist/tool-metadata.js +1 -0
- package/packages/server/dist/tool-prefix.d.ts +12 -0
- package/packages/server/dist/tool-prefix.js +1 -0
- package/packages/server/dist/tools/analyze.tools.d.ts +14 -0
- package/packages/server/dist/tools/analyze.tools.js +8 -0
- package/packages/server/dist/tools/audit.tool.d.ts +8 -0
- package/packages/server/dist/tools/audit.tool.js +1 -0
- package/packages/server/dist/tools/brainstorm.tool.d.ts +7 -0
- package/packages/server/dist/tools/brainstorm.tool.js +9 -0
- 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/context.tools.d.ts +15 -0
- package/packages/server/dist/tools/context.tools.js +10 -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/execution.tools.d.ts +14 -0
- package/packages/server/dist/tools/execution.tools.js +4 -0
- package/packages/server/dist/tools/flow.tools.d.ts +7 -0
- package/packages/server/dist/tools/flow.tools.js +1 -0
- package/packages/server/dist/tools/forge.tools.d.ts +13 -0
- package/packages/server/dist/tools/forge.tools.js +10 -0
- package/packages/server/dist/tools/forget.tool.d.ts +8 -0
- package/packages/server/dist/tools/forget.tool.js +1 -0
- package/packages/server/dist/tools/graph.tool.d.ts +7 -0
- package/packages/server/dist/tools/graph.tool.js +5 -0
- package/packages/server/dist/tools/infra.tools.d.ts +10 -0
- package/packages/server/dist/tools/infra.tools.js +5 -0
- package/packages/server/dist/tools/list.tool.d.ts +7 -0
- package/packages/server/dist/tools/list.tool.js +2 -0
- package/packages/server/dist/tools/lookup.tool.d.ts +7 -0
- package/packages/server/dist/tools/lookup.tool.js +3 -0
- package/packages/server/dist/tools/manipulation.tools.d.ts +10 -0
- package/packages/server/dist/tools/manipulation.tools.js +4 -0
- package/packages/server/dist/tools/onboard.tool.d.ts +9 -0
- package/packages/server/dist/tools/onboard.tool.js +2 -0
- package/packages/server/dist/tools/persistence.tools.d.ts +10 -0
- package/packages/server/dist/tools/persistence.tools.js +5 -0
- package/packages/server/dist/tools/policy.tools.d.ts +7 -0
- package/packages/server/dist/tools/policy.tools.js +3 -0
- package/packages/server/dist/tools/present/browser.d.ts +4 -0
- package/packages/server/dist/tools/present/browser.js +93 -0
- package/packages/server/dist/tools/present/helpers.d.ts +18 -0
- package/packages/server/dist/tools/present/helpers.js +1 -0
- package/packages/server/dist/tools/present/html.d.ts +18 -0
- package/packages/server/dist/tools/present/html.js +5 -0
- package/packages/server/dist/tools/present/index.d.ts +2 -0
- package/packages/server/dist/tools/present/index.js +1 -0
- package/packages/server/dist/tools/present/markdown.d.ts +17 -0
- package/packages/server/dist/tools/present/markdown.js +8 -0
- package/packages/server/dist/tools/present/templates.d.ts +14 -0
- package/packages/server/dist/tools/present/templates.js +472 -0
- package/packages/server/dist/tools/present/tool.d.ts +27 -0
- package/packages/server/dist/tools/present/tool.js +19 -0
- package/packages/server/dist/tools/present-blocks.d.ts +46 -0
- package/packages/server/dist/tools/present-blocks.js +27 -0
- package/packages/server/dist/tools/present-charts.d.ts +31 -0
- package/packages/server/dist/tools/present-charts.js +34 -0
- package/packages/server/dist/tools/present-theme.d.ts +14 -0
- package/packages/server/dist/tools/present-theme.js +395 -0
- package/packages/server/dist/tools/present-utils.d.ts +11 -0
- package/packages/server/dist/tools/present-utils.js +1 -0
- package/packages/server/dist/tools/present.tool.d.ts +2 -0
- package/packages/server/dist/tools/present.tool.js +1 -0
- package/packages/server/dist/tools/produce.tool.d.ts +7 -0
- package/packages/server/dist/tools/produce.tool.js +4 -0
- package/packages/server/dist/tools/read.tool.d.ts +7 -0
- package/packages/server/dist/tools/read.tool.js +2 -0
- package/packages/server/dist/tools/reindex.tool.d.ts +11 -0
- package/packages/server/dist/tools/reindex.tool.js +3 -0
- package/packages/server/dist/tools/remember.tool.d.ts +9 -0
- package/packages/server/dist/tools/remember.tool.js +4 -0
- package/packages/server/dist/tools/replay.tool.d.ts +6 -0
- package/packages/server/dist/tools/replay.tool.js +3 -0
- package/packages/server/dist/tools/restore.tool.d.ts +6 -0
- package/packages/server/dist/tools/restore.tool.js +3 -0
- package/packages/server/dist/tools/search.tool.d.ts +11 -0
- package/packages/server/dist/tools/search.tool.js +10 -0
- package/packages/server/dist/tools/status.tool.d.ts +20 -0
- package/packages/server/dist/tools/status.tool.js +3 -0
- package/packages/server/dist/tools/update.tool.d.ts +8 -0
- package/packages/server/dist/tools/update.tool.js +1 -0
- package/packages/server/dist/tools/utility.tools.d.ts +15 -0
- package/packages/server/dist/tools/utility.tools.js +13 -0
- package/packages/server/dist/version-check.d.ts +32 -0
- package/packages/server/dist/version-check.js +1 -0
- package/packages/store/dist/graph-store.interface.d.ts +118 -0
- package/packages/store/dist/graph-store.interface.js +1 -0
- package/packages/store/dist/index.d.ts +6 -0
- package/packages/store/dist/index.js +1 -0
- package/packages/store/dist/lance-store.d.ts +44 -0
- package/packages/store/dist/lance-store.js +1 -0
- package/packages/store/dist/sqlite-graph-store.d.ts +45 -0
- package/packages/store/dist/sqlite-graph-store.js +58 -0
- package/packages/store/dist/store-factory.d.ts +12 -0
- package/packages/store/dist/store-factory.js +1 -0
- package/packages/store/dist/store.interface.d.ts +54 -0
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +65 -0
- package/packages/tools/dist/audit.js +6 -0
- package/packages/tools/dist/batch.d.ts +23 -0
- package/packages/tools/dist/batch.js +1 -0
- package/packages/tools/dist/changelog.d.ts +36 -0
- package/packages/tools/dist/changelog.js +2 -0
- package/packages/tools/dist/check.d.ts +48 -0
- package/packages/tools/dist/check.js +2 -0
- package/packages/tools/dist/checkpoint.d.ts +19 -0
- package/packages/tools/dist/checkpoint.js +1 -0
- package/packages/tools/dist/codemod.d.ts +39 -0
- package/packages/tools/dist/codemod.js +2 -0
- package/packages/tools/dist/compact.d.ts +41 -0
- package/packages/tools/dist/compact.js +3 -0
- package/packages/tools/dist/config-extractor.d.ts +9 -0
- package/packages/tools/dist/config-extractor.js +7 -0
- package/packages/tools/dist/data-transform.d.ts +12 -0
- package/packages/tools/dist/data-transform.js +1 -0
- package/packages/tools/dist/dead-symbols.d.ts +28 -0
- package/packages/tools/dist/dead-symbols.js +2 -0
- package/packages/tools/dist/delegate.d.ts +36 -0
- package/packages/tools/dist/delegate.js +1 -0
- package/packages/tools/dist/diagram-builder.d.ts +9 -0
- package/packages/tools/dist/diagram-builder.js +9 -0
- package/packages/tools/dist/diff-parse.d.ts +28 -0
- package/packages/tools/dist/diff-parse.js +3 -0
- package/packages/tools/dist/digest.d.ts +50 -0
- package/packages/tools/dist/digest.js +6 -0
- 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 +16 -0
- package/packages/tools/dist/encode.js +1 -0
- package/packages/tools/dist/env-info.d.ts +30 -0
- package/packages/tools/dist/env-info.js +1 -0
- package/packages/tools/dist/eval.d.ts +15 -0
- package/packages/tools/dist/eval.js +2 -0
- package/packages/tools/dist/evidence-map.d.ts +92 -0
- package/packages/tools/dist/evidence-map.js +2 -0
- 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 +52 -0
- package/packages/tools/dist/file-summary.js +2 -0
- package/packages/tools/dist/file-walk.d.ts +6 -0
- package/packages/tools/dist/file-walk.js +1 -0
- package/packages/tools/dist/find-examples.d.ts +29 -0
- package/packages/tools/dist/find-examples.js +3 -0
- package/packages/tools/dist/find.d.ts +49 -0
- package/packages/tools/dist/find.js +1 -0
- package/packages/tools/dist/forge-classify.d.ts +44 -0
- package/packages/tools/dist/forge-classify.js +2 -0
- package/packages/tools/dist/forge-ground.d.ts +61 -0
- package/packages/tools/dist/forge-ground.js +1 -0
- package/packages/tools/dist/git-context.d.ts +25 -0
- package/packages/tools/dist/git-context.js +3 -0
- package/packages/tools/dist/graph-query.d.ts +86 -0
- package/packages/tools/dist/graph-query.js +1 -0
- package/packages/tools/dist/guide.d.ts +25 -0
- package/packages/tools/dist/guide.js +1 -0
- package/packages/tools/dist/health.d.ts +16 -0
- package/packages/tools/dist/health.js +2 -0
- package/packages/tools/dist/http-request.d.ts +25 -0
- package/packages/tools/dist/http-request.js +1 -0
- package/packages/tools/dist/index.d.ts +57 -0
- package/packages/tools/dist/index.js +1 -0
- package/packages/tools/dist/lane.d.ts +41 -0
- package/packages/tools/dist/lane.js +6 -0
- package/packages/tools/dist/measure.d.ts +42 -0
- package/packages/tools/dist/measure.js +2 -0
- package/packages/tools/dist/onboard-utils.d.ts +12 -0
- package/packages/tools/dist/onboard-utils.js +1 -0
- package/packages/tools/dist/onboard.d.ts +50 -0
- package/packages/tools/dist/onboard.js +18 -0
- package/packages/tools/dist/parse-output.d.ts +82 -0
- package/packages/tools/dist/parse-output.js +2 -0
- package/packages/tools/dist/path-resolver.d.ts +14 -0
- package/packages/tools/dist/path-resolver.js +1 -0
- package/packages/tools/dist/process-manager.d.ts +20 -0
- package/packages/tools/dist/process-manager.js +1 -0
- package/packages/tools/dist/queue.d.ts +40 -0
- package/packages/tools/dist/queue.js +1 -0
- package/packages/tools/dist/regex-test.d.ts +33 -0
- package/packages/tools/dist/regex-test.js +1 -0
- package/packages/tools/dist/regex-utils.d.ts +8 -0
- package/packages/tools/dist/regex-utils.js +1 -0
- package/packages/tools/dist/rename.d.ts +31 -0
- package/packages/tools/dist/rename.js +2 -0
- package/packages/tools/dist/replay.d.ts +59 -0
- package/packages/tools/dist/replay.js +4 -0
- package/packages/tools/dist/response-envelope.d.ts +43 -0
- package/packages/tools/dist/response-envelope.js +1 -0
- package/packages/tools/dist/restore-points.d.ts +22 -0
- package/packages/tools/dist/restore-points.js +1 -0
- package/packages/tools/dist/schema-validate.d.ts +25 -0
- package/packages/tools/dist/schema-validate.js +1 -0
- package/packages/tools/dist/scope-map.d.ts +51 -0
- package/packages/tools/dist/scope-map.js +1 -0
- package/packages/tools/dist/snippet.d.ts +35 -0
- package/packages/tools/dist/snippet.js +1 -0
- package/packages/tools/dist/stash.d.ts +14 -0
- package/packages/tools/dist/stash.js +1 -0
- package/packages/tools/dist/stratum-card.d.ts +30 -0
- package/packages/tools/dist/stratum-card.js +4 -0
- package/packages/tools/dist/symbol.d.ts +45 -0
- package/packages/tools/dist/symbol.js +3 -0
- package/packages/tools/dist/synthesis-engine.d.ts +13 -0
- package/packages/tools/dist/synthesis-engine.js +6 -0
- package/packages/tools/dist/test-run.d.ts +28 -0
- package/packages/tools/dist/test-run.js +2 -0
- package/packages/tools/dist/text-utils.d.ts +24 -0
- package/packages/tools/dist/text-utils.js +2 -0
- package/packages/tools/dist/time-utils.d.ts +20 -0
- package/packages/tools/dist/time-utils.js +1 -0
- package/packages/tools/dist/trace.d.ts +29 -0
- package/packages/tools/dist/trace.js +2 -0
- package/packages/tools/dist/truncation.d.ts +33 -0
- package/packages/tools/dist/truncation.js +7 -0
- package/packages/tools/dist/watch.d.ts +32 -0
- package/packages/tools/dist/watch.js +1 -0
- package/packages/tools/dist/web-fetch.d.ts +47 -0
- package/packages/tools/dist/web-fetch.js +8 -0
- package/packages/tools/dist/web-search.d.ts +25 -0
- package/packages/tools/dist/web-search.js +1 -0
- package/packages/tools/dist/workset.d.ts +47 -0
- package/packages/tools/dist/workset.js +1 -0
- package/packages/tui/dist/App-DU2KEylW.js +2 -0
- package/packages/tui/dist/App.d.ts +13 -0
- package/packages/tui/dist/App.js +2 -0
- package/packages/tui/dist/CuratedPanel-BIamXLNy.js +2 -0
- package/packages/tui/dist/LogPanel-Bo8a8QXB.js +3 -0
- package/packages/tui/dist/SearchPanel-CpJGczAc.js +2 -0
- package/packages/tui/dist/StatusPanel-BAbUxyqQ.js +2 -0
- package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
- package/packages/tui/dist/devtools-DMOZMn70.js +7 -0
- package/packages/tui/dist/hooks/useKBClient.d.ts +9 -0
- package/packages/tui/dist/hooks/useKBClient.js +2 -0
- package/packages/tui/dist/hooks/usePolling.d.ts +8 -0
- package/packages/tui/dist/hooks/usePolling.js +2 -0
- package/packages/tui/dist/index-BXafekwr.d.ts +64 -0
- package/packages/tui/dist/index.d.ts +7 -0
- package/packages/tui/dist/index.js +2 -0
- package/packages/tui/dist/jsx-runtime-y6Gdq5PZ.js +294 -0
- package/packages/tui/dist/panels/CuratedPanel.d.ts +7 -0
- package/packages/tui/dist/panels/CuratedPanel.js +2 -0
- package/packages/tui/dist/panels/LogPanel.d.ts +7 -0
- package/packages/tui/dist/panels/LogPanel.js +2 -0
- package/packages/tui/dist/panels/SearchPanel.d.ts +7 -0
- package/packages/tui/dist/panels/SearchPanel.js +2 -0
- package/packages/tui/dist/panels/StatusPanel.d.ts +7 -0
- package/packages/tui/dist/panels/StatusPanel.js +2 -0
- package/packages/tui/dist/react-D__J1GQe.js +24 -0
- package/packages/tui/dist/useKBClient-C35iA4uG.js +2 -0
- package/packages/tui/dist/usePolling-BbjnRWgx.js +2 -0
- package/scaffold/README.md +192 -0
- package/scaffold/adapters/claude-code.mjs +56 -0
- package/scaffold/adapters/copilot.mjs +270 -0
- package/scaffold/definitions/agents.mjs +189 -0
- package/scaffold/definitions/bodies.mjs +487 -0
- package/scaffold/definitions/hooks.mjs +43 -0
- package/scaffold/definitions/models.mjs +56 -0
- package/scaffold/definitions/plugins.mjs +38 -0
- package/scaffold/definitions/prompts.mjs +145 -0
- package/scaffold/definitions/protocols.mjs +679 -0
- package/scaffold/definitions/tools.mjs +229 -0
- package/scaffold/flows/aikit-advanced/flow.json +60 -0
- package/scaffold/flows/aikit-advanced/skills/execute/SKILL.md +124 -0
- package/scaffold/flows/aikit-advanced/skills/plan/SKILL.md +100 -0
- package/scaffold/flows/aikit-advanced/skills/spec/SKILL.md +100 -0
- package/scaffold/flows/aikit-advanced/skills/task/SKILL.md +99 -0
- package/scaffold/flows/aikit-advanced/skills/verify/SKILL.md +122 -0
- package/scaffold/flows/aikit-basic/flow.json +36 -0
- package/scaffold/flows/aikit-basic/skills/assess/SKILL.md +82 -0
- package/scaffold/flows/aikit-basic/skills/implement/SKILL.md +105 -0
- package/scaffold/flows/aikit-basic/skills/verify/SKILL.md +96 -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 +34 -0
- package/scaffold/general/agents/Documenter.agent.md +53 -0
- package/scaffold/general/agents/Explorer.agent.md +63 -0
- package/scaffold/general/agents/Frontend.agent.md +29 -0
- package/scaffold/general/agents/Implementer.agent.md +33 -0
- package/scaffold/general/agents/Orchestrator.agent.md +149 -0
- package/scaffold/general/agents/Planner.agent.md +79 -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 +55 -0
- package/scaffold/general/agents/_shared/architect-reviewer-base.md +60 -0
- package/scaffold/general/agents/_shared/code-agent-base.md +262 -0
- package/scaffold/general/agents/_shared/code-reviewer-base.md +64 -0
- package/scaffold/general/agents/_shared/decision-protocol.md +27 -0
- package/scaffold/general/agents/_shared/forge-protocol.md +90 -0
- package/scaffold/general/agents/_shared/researcher-base.md +101 -0
- package/scaffold/general/agents/templates/adr-template.md +28 -0
- package/scaffold/general/agents/templates/execution-state.md +26 -0
- package/scaffold/general/prompts/ask.prompt.md +21 -0
- package/scaffold/general/prompts/debug.prompt.md +25 -0
- package/scaffold/general/prompts/design.prompt.md +23 -0
- package/scaffold/general/prompts/implement.prompt.md +26 -0
- package/scaffold/general/prompts/plan.prompt.md +25 -0
- package/scaffold/general/prompts/review.prompt.md +32 -0
- package/scaffold/general/skills/adr-skill/SKILL.md +329 -0
- package/scaffold/general/skills/adr-skill/assets/templates/adr-madr.md +89 -0
- package/scaffold/general/skills/adr-skill/assets/templates/adr-readme.md +20 -0
- package/scaffold/general/skills/adr-skill/assets/templates/adr-simple.md +46 -0
- package/scaffold/general/skills/adr-skill/references/adr-conventions.md +95 -0
- package/scaffold/general/skills/adr-skill/references/examples.md +193 -0
- package/scaffold/general/skills/adr-skill/references/review-checklist.md +77 -0
- package/scaffold/general/skills/adr-skill/references/template-variants.md +52 -0
- package/scaffold/general/skills/adr-skill/scripts/bootstrap_adr.js +259 -0
- package/scaffold/general/skills/adr-skill/scripts/new_adr.js +391 -0
- package/scaffold/general/skills/adr-skill/scripts/set_adr_status.js +169 -0
- package/scaffold/general/skills/aikit/SKILL.md +521 -0
- package/scaffold/general/skills/brainstorming/SKILL.md +259 -0
- package/scaffold/general/skills/brainstorming/scripts/frame-template.html +365 -0
- package/scaffold/general/skills/brainstorming/scripts/helper.js +216 -0
- package/scaffold/general/skills/brainstorming/scripts/server.cjs +9 -0
- package/scaffold/general/skills/brainstorming/scripts/server.src.cjs +249 -0
- package/scaffold/general/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/scaffold/general/skills/brainstorming/visual-companion.md +430 -0
- package/scaffold/general/skills/c4-architecture/SKILL.md +295 -0
- package/scaffold/general/skills/c4-architecture/references/advanced-patterns.md +552 -0
- package/scaffold/general/skills/c4-architecture/references/c4-syntax.md +492 -0
- package/scaffold/general/skills/c4-architecture/references/common-mistakes.md +437 -0
- package/scaffold/general/skills/lesson-learned/SKILL.md +105 -0
- package/scaffold/general/skills/lesson-learned/references/anti-patterns.md +55 -0
- package/scaffold/general/skills/lesson-learned/references/se-principles.md +109 -0
- package/scaffold/general/skills/multi-agents-development/SKILL.md +435 -0
- package/scaffold/general/skills/multi-agents-development/architecture-review-prompt.md +81 -0
- package/scaffold/general/skills/multi-agents-development/code-quality-review-prompt.md +91 -0
- package/scaffold/general/skills/multi-agents-development/implementer-prompt.md +93 -0
- package/scaffold/general/skills/multi-agents-development/parallel-dispatch-example.md +167 -0
- package/scaffold/general/skills/multi-agents-development/spec-review-prompt.md +81 -0
- package/scaffold/general/skills/present/SKILL.md +424 -0
- package/scaffold/general/skills/requirements-clarity/SKILL.md +324 -0
- package/scaffold/general/skills/session-handoff/SKILL.md +189 -0
- package/scaffold/general/skills/session-handoff/references/handoff-template.md +139 -0
- package/scaffold/general/skills/session-handoff/references/resume-checklist.md +80 -0
- package/scaffold/general/skills/session-handoff/scripts/check_staleness.js +269 -0
- package/scaffold/general/skills/session-handoff/scripts/create_handoff.js +299 -0
- package/scaffold/general/skills/session-handoff/scripts/list_handoffs.js +113 -0
- package/scaffold/general/skills/session-handoff/scripts/validate_handoff.js +241 -0
- package/scaffold/generate.mjs +82 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-color-default:inherit;--xy-node-border-default:1px solid #1a192b;--xy-node-background-color-default:#fff;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--xy-node-boxshadow-selected-default:0 0 0 .5px #1a192b;--xy-node-border-radius-default:3px;--xy-handle-background-color-default:#1a192b;--xy-handle-border-color-default:#fff;--xy-selection-background-color-default:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--xy-controls-button-background-color-default:#fefefe;--xy-controls-button-background-color-hover-default:#f4f4f4;--xy-controls-button-color-default:inherit;--xy-controls-button-color-hover-default:inherit;--xy-controls-button-border-color-default:#eee;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#777;--xy-background-pattern-lines-color-default:#777;--xy-background-pattern-cross-color-default:#777;--xy-node-color-default:#f8f8f8;--xy-node-border-default:1px solid #3c3c3c;--xy-node-background-color-default:#1e1e1e;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--xy-node-boxshadow-selected-default:0 0 0 .5px #999;--xy-handle-background-color-default:#bebebe;--xy-handle-border-color-default:#1e1e1e;--xy-selection-background-color-default:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--xy-controls-button-background-color-default:#2b2b2b;--xy-controls-button-background-color-hover-default:#3e3e3e;--xy-controls-button-color-default:#f8f8f8;--xy-controls-button-color-hover-default:#fff;--xy-controls-button-border-color-default:#5b5b5b;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#141414;--xy-edge-label-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color,var(--xy-handle-border-color-default));border-radius:100%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;color:var(--xy-node-color,var(--xy-node-color-default));text-align:center;border:var(--xy-node-border,var(--xy-node-border-default));background-color:var(--xy-node-background-color,var(--xy-node-background-color-default));padding:10px;font-size:12px}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover,var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected,var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color,var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var(--xy-controls-button-background-color-hover-props,var(--xy-controls-button-background-color-hover,var(--xy-controls-button-background-color-hover-default)));color:var(--xy-controls-button-color-hover-props,var(--xy-controls-button-color-hover,var(--xy-controls-button-color-hover-default)))}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)))}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color,var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color,var(--xy-edge-label-color-default))}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>KB Dashboard</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
+
html, body, #root { width: 100%; height: 100%; overflow: hidden; }
|
|
10
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1117; color: #c9d1d9; }
|
|
11
|
+
</style>
|
|
12
|
+
<script type="module" crossorigin src="/_dashboard/assets/index-BjA4YODs.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/_dashboard/assets/index-CHpVij2M.css">
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="root"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ElicitFormSchema, ElicitOptions, FieldSchema } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/elicitation/src/build.d.ts
|
|
4
|
+
/** Build a form schema from a record of named fields. */
|
|
5
|
+
declare function buildFormSchema(fields: Record<string, FieldSchema>, required?: string[]): ElicitFormSchema;
|
|
6
|
+
/**
|
|
7
|
+
* Build the full elicitation request options.
|
|
8
|
+
* `message` — prompt text shown above the form.
|
|
9
|
+
* `fields` — record of field-id → FieldSchema.
|
|
10
|
+
* `required` — field ids that must be filled.
|
|
11
|
+
*/
|
|
12
|
+
declare function buildElicitRequest(message: string, fields: Record<string, FieldSchema>, required?: string[]): ElicitOptions;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { buildElicitRequest, buildFormSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){return{type:`object`,properties:e,...t&&t.length>0?{required:t}:{}}}function t(t,n,r){return{message:t,schema:e(n,r)}}export{t as buildElicitRequest,e as buildFormSchema};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ArrayFieldSchema, BooleanFieldSchema, EnumFieldSchema, NumberFieldSchema, TextFieldSchema } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/elicitation/src/fields.d.ts
|
|
4
|
+
declare const field: {
|
|
5
|
+
/** Free text input. */readonly text: (title: string, opts?: {
|
|
6
|
+
description?: string;
|
|
7
|
+
minLength?: number;
|
|
8
|
+
maxLength?: number;
|
|
9
|
+
default?: string;
|
|
10
|
+
}) => TextFieldSchema; /** Single-select dropdown/radio. */
|
|
11
|
+
readonly select: (title: string, options: string[], opts?: {
|
|
12
|
+
description?: string;
|
|
13
|
+
enumNames?: string[];
|
|
14
|
+
default?: string;
|
|
15
|
+
}) => EnumFieldSchema; /** Multi-select checkboxes. */
|
|
16
|
+
readonly multi: (title: string, options: string[], opts?: {
|
|
17
|
+
description?: string;
|
|
18
|
+
}) => ArrayFieldSchema; /** Boolean checkbox / confirmation. */
|
|
19
|
+
readonly confirm: (title: string, opts?: {
|
|
20
|
+
description?: string;
|
|
21
|
+
default?: boolean;
|
|
22
|
+
}) => BooleanFieldSchema; /** Numeric input. */
|
|
23
|
+
readonly number: (title: string, opts?: {
|
|
24
|
+
description?: string;
|
|
25
|
+
minimum?: number;
|
|
26
|
+
maximum?: number;
|
|
27
|
+
integer?: boolean;
|
|
28
|
+
default?: number;
|
|
29
|
+
}) => NumberFieldSchema;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { field };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={text(e,t){return{type:`string`,title:e,...t?.description!==void 0&&{description:t.description},...t?.minLength!==void 0&&{minLength:t.minLength},...t?.maxLength!==void 0&&{maxLength:t.maxLength},...t?.default!==void 0&&{default:t.default}}},select(e,t,n){return{type:`string`,title:e,enum:t,...n?.description!==void 0&&{description:n.description},...n?.enumNames!==void 0&&{enumNames:n.enumNames},...n?.default!==void 0&&{default:n.default}}},multi(e,t,n){return{type:`array`,title:e,items:{type:`string`,enum:t},uniqueItems:!0,...n?.description!==void 0&&{description:n.description}}},confirm(e,t){return{type:`boolean`,title:e,...t?.description!==void 0&&{description:t.description},...t?.default!==void 0&&{default:t.default}}},number(e,t){return{type:t?.integer?`integer`:`number`,title:e,...t?.description!==void 0&&{description:t.description},...t?.minimum!==void 0&&{minimum:t.minimum},...t?.maximum!==void 0&&{maximum:t.maximum},...t?.default!==void 0&&{default:t.default}}}};export{e as field};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArrayFieldSchema, BooleanFieldSchema, ElicitAction, ElicitContent, ElicitFormSchema, ElicitOptions, ElicitResponse, Elicitor, EnumFieldSchema, FieldSchema, NumberFieldSchema, TextFieldSchema } from "./types.js";
|
|
2
|
+
import { buildElicitRequest, buildFormSchema } from "./build.js";
|
|
3
|
+
import { field } from "./fields.js";
|
|
4
|
+
import { normalizeResponse } from "./normalize.js";
|
|
5
|
+
export { type ArrayFieldSchema, type BooleanFieldSchema, type ElicitAction, type ElicitContent, type ElicitFormSchema, type ElicitOptions, type ElicitResponse, type Elicitor, type EnumFieldSchema, type FieldSchema, type NumberFieldSchema, type TextFieldSchema, buildElicitRequest, buildFormSchema, field, normalizeResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildElicitRequest as e,buildFormSchema as t}from"./build.js";import{field as n}from"./fields.js";import{normalizeResponse as r}from"./normalize.js";export{e as buildElicitRequest,t as buildFormSchema,n as field,r as normalizeResponse};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ElicitContent, ElicitResponse } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/elicitation/src/normalize.d.ts
|
|
4
|
+
/** Raw elicitation result from the MCP SDK. */
|
|
5
|
+
interface RawElicitResult {
|
|
6
|
+
action: string;
|
|
7
|
+
content?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Normalize a raw MCP elicitation result into a typed response.
|
|
11
|
+
* Handles missing fields, unknown actions, and type coercion.
|
|
12
|
+
*/
|
|
13
|
+
declare function normalizeResponse<T extends ElicitContent = ElicitContent>(raw: RawElicitResult | undefined | null): ElicitResponse<T>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { normalizeResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Set([`accept`,`decline`,`cancel`]);function t(t){if(!t)return{action:`cancel`};let n=e.has(t.action)?t.action:`cancel`;if(n!==`accept`||!t.content)return{action:n};let r={};for(let[e,n]of Object.entries(t.content))(typeof n==`string`||typeof n==`number`||typeof n==`boolean`||Array.isArray(n)&&n.every(e=>typeof e==`string`))&&(r[e]=n);return{action:n,content:r}}export{t as normalizeResponse};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//#region packages/elicitation/src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* MCP elicitation types.
|
|
4
|
+
*
|
|
5
|
+
* Elicitation allows tools to request structured input from the user via
|
|
6
|
+
* the MCP client. The schema follows JSON Schema constraints:
|
|
7
|
+
* only flat primitives and string arrays are supported.
|
|
8
|
+
*/
|
|
9
|
+
/** User action on the elicitation dialog. */
|
|
10
|
+
type ElicitAction = 'accept' | 'decline' | 'cancel';
|
|
11
|
+
/** Flat content map — MCP only supports primitives + string arrays. */
|
|
12
|
+
type ElicitContent = Record<string, string | number | boolean | string[]>;
|
|
13
|
+
/** Normalized elicitation response. */
|
|
14
|
+
interface ElicitResponse<T extends ElicitContent = ElicitContent> {
|
|
15
|
+
action: ElicitAction;
|
|
16
|
+
content?: T;
|
|
17
|
+
}
|
|
18
|
+
interface TextFieldSchema {
|
|
19
|
+
type: 'string';
|
|
20
|
+
title: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
minLength?: number;
|
|
23
|
+
maxLength?: number;
|
|
24
|
+
default?: string;
|
|
25
|
+
}
|
|
26
|
+
interface EnumFieldSchema {
|
|
27
|
+
type: 'string';
|
|
28
|
+
title: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
enum: string[];
|
|
31
|
+
enumNames?: string[];
|
|
32
|
+
default?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ArrayFieldSchema {
|
|
35
|
+
type: 'array';
|
|
36
|
+
title: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
items: {
|
|
39
|
+
type: 'string';
|
|
40
|
+
enum: string[];
|
|
41
|
+
};
|
|
42
|
+
uniqueItems: true;
|
|
43
|
+
}
|
|
44
|
+
interface BooleanFieldSchema {
|
|
45
|
+
type: 'boolean';
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
default?: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface NumberFieldSchema {
|
|
51
|
+
type: 'number' | 'integer';
|
|
52
|
+
title: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
minimum?: number;
|
|
55
|
+
maximum?: number;
|
|
56
|
+
default?: number;
|
|
57
|
+
}
|
|
58
|
+
type FieldSchema = TextFieldSchema | EnumFieldSchema | ArrayFieldSchema | BooleanFieldSchema | NumberFieldSchema;
|
|
59
|
+
/** JSON Schema object for the elicitation form. */
|
|
60
|
+
interface ElicitFormSchema {
|
|
61
|
+
type: 'object';
|
|
62
|
+
properties: Record<string, FieldSchema>;
|
|
63
|
+
required?: string[];
|
|
64
|
+
}
|
|
65
|
+
interface ElicitOptions {
|
|
66
|
+
message: string;
|
|
67
|
+
schema: ElicitFormSchema;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* High-level elicitation interface exposed to tools.
|
|
71
|
+
* Wraps `server.createElicitation()` with convenience methods.
|
|
72
|
+
*/
|
|
73
|
+
interface Elicitor {
|
|
74
|
+
/** Whether the connected client supports elicitation. */
|
|
75
|
+
readonly available: boolean;
|
|
76
|
+
/** Ask a structured form question. */
|
|
77
|
+
ask<T extends ElicitContent = ElicitContent>(opts: ElicitOptions): Promise<ElicitResponse<T>>;
|
|
78
|
+
/** Yes/no confirmation. */
|
|
79
|
+
confirm(message: string): Promise<boolean>;
|
|
80
|
+
/** Pick one from a list. Returns null if declined/cancelled. */
|
|
81
|
+
selectOne(message: string, options: string[]): Promise<string | null>;
|
|
82
|
+
/** Pick many from a list. Returns empty array if declined/cancelled. */
|
|
83
|
+
selectMany(message: string, options: string[]): Promise<string[]>;
|
|
84
|
+
/** Free text prompt. Returns null if declined/cancelled. */
|
|
85
|
+
promptText(message: string, description?: string): Promise<string | null>;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { ArrayFieldSchema, BooleanFieldSchema, ElicitAction, ElicitContent, ElicitFormSchema, ElicitOptions, ElicitResponse, Elicitor, EnumFieldSchema, FieldSchema, NumberFieldSchema, TextFieldSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/embeddings/src/embedder.interface.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Embedding abstraction — allows swapping embedding models.
|
|
4
|
+
*/
|
|
5
|
+
interface IEmbedder {
|
|
6
|
+
/** Generate an embedding vector for a single text string (used for documents/passages) */
|
|
7
|
+
embed(text: string): Promise<Float32Array>;
|
|
8
|
+
/**
|
|
9
|
+
* Generate an embedding vector for a search query.
|
|
10
|
+
* Some models (e.g., BGE) use a query prefix for asymmetric retrieval.
|
|
11
|
+
* Falls back to embed() if the model doesn't need query prefixing.
|
|
12
|
+
*/
|
|
13
|
+
embedQuery(query: string): Promise<Float32Array>;
|
|
14
|
+
/** Generate embeddings for multiple text strings (batched, for documents/passages) */
|
|
15
|
+
embedBatch(texts: string[], batchSize?: number): Promise<Float32Array[]>;
|
|
16
|
+
/** The dimensionality of the embedding vectors */
|
|
17
|
+
readonly dimensions: number;
|
|
18
|
+
/** The model identifier */
|
|
19
|
+
readonly modelId: string;
|
|
20
|
+
/** Initialize the model (download if needed, load into memory) */
|
|
21
|
+
initialize(): Promise<void>;
|
|
22
|
+
/** Release model resources */
|
|
23
|
+
shutdown?(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { IEmbedder };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OnnxEmbedder as e}from"./onnx-embedder.js";export{e as OnnxEmbedder};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IEmbedder } from "./embedder.interface.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/embeddings/src/onnx-embedder.d.ts
|
|
4
|
+
declare class OnnxEmbedder implements IEmbedder {
|
|
5
|
+
private pipe;
|
|
6
|
+
readonly dimensions: number;
|
|
7
|
+
readonly modelId: string;
|
|
8
|
+
private readonly queryPrefix;
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
model?: string;
|
|
11
|
+
dimensions?: number;
|
|
12
|
+
queryPrefix?: string;
|
|
13
|
+
});
|
|
14
|
+
private detectQueryPrefix;
|
|
15
|
+
initialize(): Promise<void>;
|
|
16
|
+
shutdown(): Promise<void>;
|
|
17
|
+
embed(text: string): Promise<Float32Array>;
|
|
18
|
+
embedQuery(query: string): Promise<Float32Array>;
|
|
19
|
+
embedBatch(texts: string[], batchSize?: number): Promise<Float32Array[]>;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { OnnxEmbedder };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{homedir as e}from"node:os";import{join as t}from"node:path";import{EMBEDDING_DEFAULTS as n}from"../../core/dist/index.js";import{env as r,pipeline as i}from"@huggingface/transformers";r.cacheDir=t(e(),`.cache`,`huggingface`,`transformers-js`);var a=class{pipe=null;dimensions;modelId;queryPrefix;constructor(e){this.modelId=e?.model??n.model,this.dimensions=e?.dimensions??n.dimensions,this.queryPrefix=e?.queryPrefix??this.detectQueryPrefix(this.modelId)}detectQueryPrefix(e){let t=e.toLowerCase();return t.includes(`bge`)||t.includes(`mxbai-embed`)?`Represent this sentence for searching relevant passages: `:t.includes(`/e5-`)||t.includes(`multilingual-e5`)?`query: `:``}async initialize(){if(!this.pipe)try{this.pipe=await i(`feature-extraction`,this.modelId,{dtype:`fp32`})}catch(e){throw Error(`Failed to initialize embedding model "${this.modelId}": ${e.message}`)}}async shutdown(){this.pipe=null}async embed(e){this.pipe||await this.initialize();let t=await this.pipe?.(e,{pooling:`mean`,normalize:!0});if(!t)throw Error(`Embedding pipeline returned no output`);return new Float32Array(t.data)}async embedQuery(e){return this.embed(this.queryPrefix+e)}async embedBatch(e,t=64){if(e.length===0)return[];this.pipe||await this.initialize();let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t),a=await this.pipe?.(i,{pooling:`mean`,normalize:!0});if(!a)throw Error(`Embedding pipeline returned no output`);if(i.length===1)n.push(new Float32Array(a.data));else for(let e=0;e<i.length;e++){let t=e*this.dimensions,r=a.data.slice(t,t+this.dimensions);n.push(new Float32Array(r))}}return n}};export{a as OnnxEmbedder};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ERSearchResult } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/enterprise-bridge/src/cache.d.ts
|
|
4
|
+
declare class ERCache {
|
|
5
|
+
private readonly cache;
|
|
6
|
+
private readonly maxEntries;
|
|
7
|
+
private readonly defaultTtl;
|
|
8
|
+
constructor(options?: {
|
|
9
|
+
maxEntries?: number;
|
|
10
|
+
defaultTtl?: number;
|
|
11
|
+
});
|
|
12
|
+
/** Normalize query for cache key: lowercase, trim, collapse whitespace */
|
|
13
|
+
static normalizeKey(query: string): string;
|
|
14
|
+
get(query: string): ERSearchResult[] | undefined;
|
|
15
|
+
set(query: string, results: ERSearchResult[], ttl?: number): void;
|
|
16
|
+
/** Invalidate entries matching a topic (exact normalized key match) */
|
|
17
|
+
invalidate(query: string): boolean;
|
|
18
|
+
clear(): void;
|
|
19
|
+
get size(): number;
|
|
20
|
+
/** Get cache stats */
|
|
21
|
+
stats(): {
|
|
22
|
+
size: number;
|
|
23
|
+
maxEntries: number;
|
|
24
|
+
defaultTtlMs: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ERCache };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class e{cache=new Map;maxEntries;defaultTtl;constructor(e){this.maxEntries=e?.maxEntries??100,this.defaultTtl=e?.defaultTtl??216e5}static normalizeKey(e){return e.toLowerCase().trim().replace(/\s+/g,` `)}get(t){let n=e.normalizeKey(t),r=this.cache.get(n);if(r){if(Date.now()-r.cachedAt>r.ttl){this.cache.delete(n);return}return this.cache.delete(n),this.cache.set(n,r),r.results}}set(t,n,r){let i=e.normalizeKey(t);if(this.cache.size>=this.maxEntries&&!this.cache.has(i)){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(i,{results:n,query:i,cachedAt:Date.now(),ttl:r??this.defaultTtl})}invalidate(t){let n=e.normalizeKey(t);return this.cache.delete(n)}clear(){this.cache.clear()}get size(){return this.cache.size}stats(){return{size:this.cache.size,maxEntries:this.maxEntries,defaultTtlMs:this.defaultTtl}}};export{e as ERCache};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ERBridgeConfig, ERPushRequest, ERPushResponse, ERSearchResult } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/enterprise-bridge/src/er-client.d.ts
|
|
4
|
+
declare class ERClient {
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
private readonly apiKey;
|
|
7
|
+
private readonly timeoutMs;
|
|
8
|
+
private circuitState;
|
|
9
|
+
private consecutiveFailures;
|
|
10
|
+
private openUntil;
|
|
11
|
+
private halfOpenProbeInFlight;
|
|
12
|
+
private static readonly FAILURE_THRESHOLD;
|
|
13
|
+
private static readonly RESET_TIMEOUT_MS;
|
|
14
|
+
constructor(config: ERBridgeConfig);
|
|
15
|
+
/** Search ER knowledge base */
|
|
16
|
+
search(query: string, maxResults?: number): Promise<ERSearchResult[]>;
|
|
17
|
+
/** Push curated knowledge to ER via MCP tools endpoint */
|
|
18
|
+
push(request: ERPushRequest): Promise<ERPushResponse>;
|
|
19
|
+
/** Explicit pull from ER (bypasses local search, for cross-repo context) */
|
|
20
|
+
pull(query: string, maxResults?: number): Promise<ERSearchResult[]>;
|
|
21
|
+
/** Check ER health */
|
|
22
|
+
health(): Promise<{
|
|
23
|
+
healthy: boolean;
|
|
24
|
+
status?: number;
|
|
25
|
+
}>;
|
|
26
|
+
/** Check available MCP tools (verify curated_remember exists) */
|
|
27
|
+
listTools(): Promise<string[]>;
|
|
28
|
+
private fetch;
|
|
29
|
+
private checkCircuit;
|
|
30
|
+
private recordSuccess;
|
|
31
|
+
private recordFailure;
|
|
32
|
+
private backoffMs;
|
|
33
|
+
private parseRetryAfter;
|
|
34
|
+
private sleep;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ERClient };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ERTransientError as e}from"./types.js";var t=class t{baseUrl;apiKey;timeoutMs;circuitState=`closed`;consecutiveFailures=0;openUntil=0;halfOpenProbeInFlight=!1;static FAILURE_THRESHOLD=3;static RESET_TIMEOUT_MS=6e4;constructor(e){let t=new URL(e.baseUrl);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`Unsupported protocol: ${t.protocol} — only http/https allowed`);let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`::1`;if(t.protocol===`http:`&&!n)throw Error(`Non-TLS (http://) ER endpoints are only allowed for localhost. Use https:// to avoid leaking API keys.`);this.baseUrl=e.baseUrl.replace(/\/+$/,``),this.apiKey=e.apiKey,this.timeoutMs=e.timeoutMs}async search(e,t=5){let n=await this.fetch(`/api/v1/search`,{method:`POST`,body:JSON.stringify({query:e,maxResults:t,generateResponse:!1})});if(!n.ok)throw Error(`ER search failed: ${n.status} ${n.statusText}`);return((await n.json()).sources??[]).map(e=>{let t=typeof e.score==`number`?e.score:void 0,n=typeof e.confidence==`number`?e.confidence:void 0;return{content:e.content,sourcePath:e.metadata?.sourceUri??`unknown`,score:t??n??0,metadata:e.metadata}})}async push(e){let t=await this.fetch(`/mcp/tools`,{method:`POST`,body:JSON.stringify({name:`curated_remember`,arguments:{title:e.title,content:e.content,category:e.category??`conventions`,tags:[...e.tags??[],`pushed-from-kb`]}})});if(!t.ok)return{pushed:!1,status:`failed`,timestamp:new Date().toISOString(),error:`ER push failed: ${t.status} ${t.statusText}`};let n=await t.json();return{pushed:!0,status:`stored`,remotePath:typeof n.path==`string`?n.path:void 0,timestamp:new Date().toISOString()}}async pull(e,t=10){return this.search(e,t)}async health(){try{let e=await this.fetch(`/api/v1/health`,{method:`GET`});return{healthy:e.ok,status:e.status}}catch{return{healthy:!1}}}async listTools(){try{let e=await this.fetch(`/mcp/tools`,{method:`GET`});return e.ok?((await e.json()).tools??[]).map(e=>e.name):[]}catch{return[]}}async fetch(e,t){this.checkCircuit();let n;for(let r=0;r<=2;r++){let i=new AbortController,a=setTimeout(()=>i.abort(),this.timeoutMs);try{let n=await fetch(`${this.baseUrl}${e}`,{...t,headers:{"Content-Type":`application/json`,"X-Api-Key":this.apiKey,"User-Agent":`aikit-enterprise-bridge/1.0`,...t.headers},signal:i.signal});if(n.ok||n.status>=400&&n.status<500&&n.status!==429)return this.recordSuccess(),n;if(r<2){let e=this.parseRetryAfter(n)??this.backoffMs(r);await this.sleep(e);continue}return this.recordFailure(),n}catch(e){n=e,r<2&&await this.sleep(this.backoffMs(r))}finally{clearTimeout(a)}}throw this.recordFailure(),n??Error(`Fetch failed after retries`)}checkCircuit(){if(this.circuitState===`open`)if(Date.now()>=this.openUntil){if(this.halfOpenProbeInFlight)throw new e(`ER circuit breaker is half-open — probe in progress`);this.circuitState=`half-open`,this.halfOpenProbeInFlight=!0}else throw new e(`ER circuit breaker is open — skipping request`)}recordSuccess(){this.consecutiveFailures=0,this.circuitState=`closed`,this.halfOpenProbeInFlight=!1}recordFailure(){this.consecutiveFailures++,this.halfOpenProbeInFlight=!1,this.consecutiveFailures>=t.FAILURE_THRESHOLD&&(this.circuitState=`open`,this.openUntil=Date.now()+t.RESET_TIMEOUT_MS)}backoffMs(e){let t=500*3**e,n=t*.25*(Math.random()*2-1);return Math.round(t+n)}parseRetryAfter(e){let t=e.headers.get(`Retry-After`);if(!t)return;let n=Number(t);if(!Number.isNaN(n)&&n>=0)return Math.min(n*1e3,3e4)}sleep(e){return new Promise(t=>setTimeout(t,e))}};export{t as ERClient};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region packages/enterprise-bridge/src/evolution-collector.d.ts
|
|
2
|
+
/** Evolution data collector — tracks usage metrics for LLM review */
|
|
3
|
+
interface EvolutionMetrics {
|
|
4
|
+
/** Search metrics */
|
|
5
|
+
search: {
|
|
6
|
+
totalSearches: number;
|
|
7
|
+
erFallbackCount: number;
|
|
8
|
+
erFallbackRate: number;
|
|
9
|
+
erCacheHitCount: number;
|
|
10
|
+
erCacheHitRate: number;
|
|
11
|
+
topMissedQueries: Array<{
|
|
12
|
+
query: string;
|
|
13
|
+
count: number;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
/** Push metrics */
|
|
17
|
+
push: {
|
|
18
|
+
totalPushes: number;
|
|
19
|
+
successCount: number;
|
|
20
|
+
failCount: number;
|
|
21
|
+
pushRate: number; /** Classification match rate — how often rules fired vs knowledge stored */
|
|
22
|
+
classificationMatchRate: number; /** Push acceptance rate — how often LLM decided to push after recommendation */
|
|
23
|
+
pushAcceptanceRate: number;
|
|
24
|
+
};
|
|
25
|
+
/** Rule effectiveness */
|
|
26
|
+
rules: {
|
|
27
|
+
matchCounts: Record<string, number>;
|
|
28
|
+
pushCounts: Record<string, number>; /** Rules that fire often but rarely lead to pushes (potential false positives) */
|
|
29
|
+
lowConversionRules: Array<{
|
|
30
|
+
ruleId: string;
|
|
31
|
+
matchCount: number;
|
|
32
|
+
pushCount: number;
|
|
33
|
+
conversionRate: number;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
/** Summary period */
|
|
37
|
+
period: {
|
|
38
|
+
startedAt: string;
|
|
39
|
+
queriedAt: string;
|
|
40
|
+
totalEvents: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
declare class EvolutionCollector {
|
|
44
|
+
private searchEvents;
|
|
45
|
+
private classificationEvents;
|
|
46
|
+
private pushEvents;
|
|
47
|
+
private readonly startedAt;
|
|
48
|
+
constructor();
|
|
49
|
+
/** Record a search event */
|
|
50
|
+
recordSearch(query: string, erFallbackTriggered: boolean, erCacheHit: boolean): void;
|
|
51
|
+
/** Record a classification event (when remember returns classification signals) */
|
|
52
|
+
recordClassification(entryTitle: string, matchingRuleIds: string[], pushRecommended: boolean): void;
|
|
53
|
+
/** Record a push event */
|
|
54
|
+
recordPush(entryId: string, success: boolean, ruleId?: string): void;
|
|
55
|
+
/** Get aggregated metrics for LLM review */
|
|
56
|
+
getMetrics(): EvolutionMetrics;
|
|
57
|
+
/** Reset all collected data */
|
|
58
|
+
reset(): void;
|
|
59
|
+
private trimEvents;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { EvolutionCollector, EvolutionMetrics };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class{searchEvents=[];classificationEvents=[];pushEvents=[];startedAt;constructor(){this.startedAt=new Date().toISOString()}recordSearch(e,t,n){this.searchEvents.push({query:e.toLowerCase().trim(),erFallbackTriggered:t,erCacheHit:n,timestamp:Date.now()}),this.trimEvents()}recordClassification(e,t,n){this.classificationEvents.push({entryTitle:e,matchingRuleIds:t,pushRecommended:n,timestamp:Date.now()}),this.trimEvents()}recordPush(e,t,n){this.pushEvents.push({entryId:e,ruleId:n,success:t,timestamp:Date.now()}),this.trimEvents()}getMetrics(){let e=this.searchEvents.length,t=this.searchEvents.filter(e=>e.erFallbackTriggered).length,n=this.searchEvents.filter(e=>e.erCacheHit).length,r=new Map;for(let e of this.searchEvents)e.erFallbackTriggered&&r.set(e.query,(r.get(e.query)??0)+1);let i=[...r.entries()].sort((e,t)=>t[1]-e[1]).slice(0,20).map(([e,t])=>({query:e,count:t})),a=this.pushEvents.length,o=this.pushEvents.filter(e=>e.success).length,s=this.classificationEvents.length,c=this.classificationEvents.filter(e=>e.pushRecommended).length,l={},u={};for(let e of this.classificationEvents)for(let t of e.matchingRuleIds)l[t]=(l[t]??0)+1;for(let e of this.pushEvents)e.ruleId&&(u[e.ruleId]=(u[e.ruleId]??0)+1);let d=Object.entries(l).map(([e,t])=>{let n=u[e]??0;return{ruleId:e,matchCount:t,pushCount:n,conversionRate:t>0?n/t:0}}).filter(e=>e.matchCount>=3&&e.conversionRate<.3).sort((e,t)=>e.conversionRate-t.conversionRate);return{search:{totalSearches:e,erFallbackCount:t,erFallbackRate:e>0?t/e:0,erCacheHitCount:n,erCacheHitRate:t>0?n/t:0,topMissedQueries:i},push:{totalPushes:a,successCount:o,failCount:a-o,pushRate:s>0?a/s:0,classificationMatchRate:s>0?c/s:0,pushAcceptanceRate:c>0?a/c:0},rules:{matchCounts:l,pushCounts:u,lowConversionRules:d},period:{startedAt:this.startedAt,queriedAt:new Date().toISOString(),totalEvents:this.searchEvents.length+this.classificationEvents.length+this.pushEvents.length}}}reset(){this.searchEvents=[],this.classificationEvents=[],this.pushEvents=[]}trimEvents(){this.searchEvents.length>500&&(this.searchEvents=this.searchEvents.slice(-500)),this.classificationEvents.length>500&&(this.classificationEvents=this.classificationEvents.slice(-500)),this.pushEvents.length>500&&(this.pushEvents=this.pushEvents.slice(-500))}};export{e as EvolutionCollector};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ERBridgeConfig, ERCacheEntry, ERPushRequest, ERPushResponse, ERSearchResponse, ERSearchResult, ERSyncEntry, ERTransientError, MergedSearchResult } from "./types.js";
|
|
2
|
+
import { ERCache } from "./cache.js";
|
|
3
|
+
import { ERClient } from "./er-client.js";
|
|
4
|
+
import { EvolutionCollector, EvolutionMetrics } from "./evolution-collector.js";
|
|
5
|
+
import { ClassificationResult, ClassificationRule, PolicyStore } from "./policy-store.js";
|
|
6
|
+
import { PushAdapter } from "./push-adapter.js";
|
|
7
|
+
import { mergeResults } from "./result-merger.js";
|
|
8
|
+
export { type ClassificationResult, type ClassificationRule, type ERBridgeConfig, ERCache, type ERCacheEntry, ERClient, type ERPushRequest, type ERPushResponse, type ERSearchResponse, type ERSearchResult, type ERSyncEntry, ERTransientError, EvolutionCollector, type EvolutionMetrics, type MergedSearchResult, PolicyStore, PushAdapter, mergeResults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ERCache as e}from"./cache.js";import{ERTransientError as t}from"./types.js";import{ERClient as n}from"./er-client.js";import{EvolutionCollector as r}from"./evolution-collector.js";import{PolicyStore as i}from"./policy-store.js";import{PushAdapter as a}from"./push-adapter.js";import{mergeResults as o}from"./result-merger.js";export{e as ERCache,n as ERClient,t as ERTransientError,r as EvolutionCollector,i as PolicyStore,a as PushAdapter,o as mergeResults};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region packages/enterprise-bridge/src/policy-store.d.ts
|
|
2
|
+
/** A single classification rule */
|
|
3
|
+
interface ClassificationRule {
|
|
4
|
+
id: string;
|
|
5
|
+
patterns: string[];
|
|
6
|
+
category: string;
|
|
7
|
+
pushWeight: number;
|
|
8
|
+
description: string;
|
|
9
|
+
examples: string[];
|
|
10
|
+
autoPush: false;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
/** Classification result for a knowledge entry */
|
|
16
|
+
interface ClassificationResult {
|
|
17
|
+
matchingRules: Array<{
|
|
18
|
+
ruleId: string;
|
|
19
|
+
category: string;
|
|
20
|
+
pushWeight: number;
|
|
21
|
+
matchedPatterns: string[];
|
|
22
|
+
}>;
|
|
23
|
+
pushRecommended: boolean;
|
|
24
|
+
maxPushWeight: number;
|
|
25
|
+
}
|
|
26
|
+
declare class PolicyStore {
|
|
27
|
+
private rules;
|
|
28
|
+
private readonly rulesPath;
|
|
29
|
+
constructor(curatedPath: string);
|
|
30
|
+
/** Classify a knowledge entry against all enabled rules */
|
|
31
|
+
classify(title: string, content: string, tags: string[]): ClassificationResult;
|
|
32
|
+
/** Get all rules */
|
|
33
|
+
getRules(): ClassificationRule[];
|
|
34
|
+
/** Get a single rule by ID */
|
|
35
|
+
getRule(ruleId: string): ClassificationRule | undefined;
|
|
36
|
+
/** Update an existing rule */
|
|
37
|
+
updateRule(ruleId: string, changes: Partial<Omit<ClassificationRule, 'id' | 'createdAt' | 'autoPush'>>): ClassificationRule | undefined;
|
|
38
|
+
/** Add a new rule */
|
|
39
|
+
addRule(rule: Omit<ClassificationRule, 'createdAt' | 'updatedAt' | 'autoPush'>): ClassificationRule;
|
|
40
|
+
/** Delete a rule */
|
|
41
|
+
deleteRule(ruleId: string): boolean;
|
|
42
|
+
private save;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ClassificationResult, ClassificationRule, PolicyStore };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as e,mkdirSync as t,readFileSync as n,writeFileSync as r}from"node:fs";import{join as i}from"node:path";import{createLogger as a}from"../../core/dist/index.js";const o=a(`bridge`),s=()=>new Date().toISOString(),c=[{id:`cross-repo-contract`,patterns:[`contract`,`interface`,`api`,`event schema`,`publishes`,`subscribes`],category:`contract`,pushWeight:.8,description:`Knowledge describing cross-service interfaces`,examples:[`Service X publishes OrderCreated event with fields...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`architecture-decision`,patterns:[`decided`,`chose`,`tradeoff`,`adr`,`because we need`],category:`decision`,pushWeight:.7,description:`Architecture decisions that affect the ecosystem`,examples:[`We decided to use event sourcing because...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`shared-pattern`,patterns:[`pattern`,`convention`,`standard`,`guideline`,`always use`],category:`pattern`,pushWeight:.6,description:`Patterns and conventions that maintain consistency across repos`,examples:[`Always use the Result type for error handling...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`company-term`,patterns:[`means`,`defined as`,`acronym`,`refers to`],category:`glossary`,pushWeight:.7,description:`Shared vocabulary and terminology definitions`,examples:[`DDD means Domain-Driven Design in our context...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`implementation-detail`,patterns:[`private`,`internal`,`helper`,`todo`,`hack`,`workaround`],category:`local-only`,pushWeight:0,description:`Local-only implementation details — never push`,examples:[`TODO: refactor this helper`,`Internal workaround for...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()}];var l=class{rules=[];rulesPath;constructor(r){let a=i(r,`_policy`);if(this.rulesPath=i(a,`rules.json`),e(a)||t(a,{recursive:!0}),e(this.rulesPath))try{let e=n(this.rulesPath,`utf-8`),t=JSON.parse(e);if(!Array.isArray(t))throw Error(`rules.json must be an array`);for(let e of t)if(typeof e!=`object`||!e||typeof e.id!=`string`||!Array.isArray(e.patterns)||typeof e.category!=`string`||typeof e.pushWeight!=`number`)throw Error(`Invalid rule: ${JSON.stringify(e).slice(0,100)}`);this.rules=t}catch{o.warn(`Failed to parse policy rules, resetting to starter set`),this.rules=[...c],this.save()}else this.rules=[...c],this.save()}classify(e,t,n){let r=`${e} ${t} ${n.join(` `)}`.toLowerCase(),i=[];for(let e of this.rules){if(!e.enabled)continue;let t=e.patterns.filter(e=>r.includes(e.toLowerCase()));t.length>0&&i.push({ruleId:e.id,category:e.category,pushWeight:e.pushWeight,matchedPatterns:t})}let a=i.length>0?Math.max(...i.map(e=>e.pushWeight)):0;return{matchingRules:i,pushRecommended:a>=.5,maxPushWeight:a}}getRules(){return[...this.rules]}getRule(e){return this.rules.find(t=>t.id===e)}updateRule(e,t){let n=this.rules.find(t=>t.id===e);if(n)return Object.assign(n,t,{updatedAt:new Date().toISOString(),autoPush:!1}),this.save(),n}addRule(e){if(this.rules.find(t=>t.id===e.id))throw Error(`Rule with id '${e.id}' already exists`);let t=new Date().toISOString(),n={...e,autoPush:!1,createdAt:t,updatedAt:t};return this.rules.push(n),this.save(),n}deleteRule(e){let t=this.rules.findIndex(t=>t.id===e);return t===-1?!1:(this.rules.splice(t,1),this.save(),!0)}save(){r(this.rulesPath,JSON.stringify(this.rules,null,2),`utf-8`)}};export{l as PolicyStore};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ERPushRequest, ERPushResponse, ERSyncEntry } from "./types.js";
|
|
2
|
+
import { ERClient } from "./er-client.js";
|
|
3
|
+
|
|
4
|
+
//#region packages/enterprise-bridge/src/push-adapter.d.ts
|
|
5
|
+
declare class PushAdapter {
|
|
6
|
+
private readonly client;
|
|
7
|
+
private readonly syncHistory;
|
|
8
|
+
private static readonly MAX_HISTORY;
|
|
9
|
+
constructor(client: ERClient);
|
|
10
|
+
/** Push a knowledge entry to ER */
|
|
11
|
+
push(entryId: string, request: ERPushRequest): Promise<ERPushResponse>;
|
|
12
|
+
/** Get sync history */
|
|
13
|
+
getHistory(): ERSyncEntry[];
|
|
14
|
+
/** Get sync status summary */
|
|
15
|
+
getStatus(): {
|
|
16
|
+
totalPushed: number;
|
|
17
|
+
successCount: number;
|
|
18
|
+
failCount: number;
|
|
19
|
+
lastPush?: ERSyncEntry;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { PushAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class e{client;syncHistory=[];static MAX_HISTORY=100;constructor(e){this.client=e}async push(t,n){let r=await this.client.push(n);for(this.syncHistory.push({entryId:t,title:n.title,pushedAt:r.timestamp,status:r.status,remotePath:r.remotePath});this.syncHistory.length>e.MAX_HISTORY;)this.syncHistory.shift();return r}getHistory(){return[...this.syncHistory]}getStatus(){let e=this.syncHistory.filter(e=>e.status===`stored`).length;return{totalPushed:this.syncHistory.length,successCount:e,failCount:this.syncHistory.length-e,lastPush:this.syncHistory.at(-1)}}};export{e as PushAdapter};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ERSearchResult, MergedSearchResult } from "./types.js";
|
|
2
|
+
import { SearchResult } from "../../core/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region packages/enterprise-bridge/src/result-merger.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Merge local and ER results using local-first interleaving.
|
|
7
|
+
*
|
|
8
|
+
* Local RRF scores (~0.01-0.05) and ER raw similarity scores (~0.3-0.9) are on
|
|
9
|
+
* incomparable scales. Instead of sorting both together (which would always rank
|
|
10
|
+
* ER above local), we preserve local ordering, deduplicate, then append ER results.
|
|
11
|
+
*/
|
|
12
|
+
declare function mergeResults(localResults: SearchResult[], erResults: ERSearchResult[], limit: number): MergedSearchResult[];
|
|
13
|
+
//#endregion
|
|
14
|
+
export { mergeResults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return{content:e.record.content,sourcePath:e.record.sourcePath,score:e.score,source:`local`,startLine:e.record.startLine,endLine:e.record.endLine,contentType:e.record.contentType,headingPath:e.record.headingPath,origin:e.record.origin,category:e.record.category,tags:e.record.tags}}function t(e){return{content:e.content,sourcePath:e.sourcePath,score:e.score,source:`er`,metadata:e.metadata}}function n(e){return`${e.slice(0,200).replace(/\s+/g,` `)}:${e.length}`}function r(r,i,a){let o=new Set,s=[];for(let t of r){let r=n(t.record.content);o.has(r)||(o.add(r),s.push(e(t)))}let c=[...i].sort((e,t)=>t.score-e.score);for(let e of c){let r=n(e.content);o.has(r)||(o.add(r),s.push(t(e)))}return s.slice(0,a)}export{r as mergeResults};
|