@weavelogic/knowledge-graph-agent 0.1.0 → 0.3.0
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 +733 -152
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/additionalItems.js +5 -0
- package/dist/_virtual/additionalItems.js.map +1 -0
- package/dist/_virtual/additionalProperties.js +5 -0
- package/dist/_virtual/additionalProperties.js.map +1 -0
- package/dist/_virtual/ajv.js +6 -0
- package/dist/_virtual/ajv.js.map +1 -0
- package/dist/_virtual/ajv2.js +5 -0
- package/dist/_virtual/ajv2.js.map +1 -0
- package/dist/_virtual/allOf.js +5 -0
- package/dist/_virtual/allOf.js.map +1 -0
- package/dist/_virtual/anyOf.js +5 -0
- package/dist/_virtual/anyOf.js.map +1 -0
- package/dist/_virtual/applicability.js +5 -0
- package/dist/_virtual/applicability.js.map +1 -0
- package/dist/_virtual/boolSchema.js +5 -0
- package/dist/_virtual/boolSchema.js.map +1 -0
- package/dist/_virtual/code.js +5 -0
- package/dist/_virtual/code.js.map +1 -0
- package/dist/_virtual/code2.js +5 -0
- package/dist/_virtual/code2.js.map +1 -0
- package/dist/_virtual/const.js +5 -0
- package/dist/_virtual/const.js.map +1 -0
- package/dist/_virtual/contains.js +5 -0
- package/dist/_virtual/contains.js.map +1 -0
- package/dist/_virtual/core.js +5 -0
- package/dist/_virtual/core.js.map +1 -0
- package/dist/_virtual/dataType.js +5 -0
- package/dist/_virtual/dataType.js.map +1 -0
- package/dist/_virtual/defaults.js +5 -0
- package/dist/_virtual/defaults.js.map +1 -0
- package/dist/_virtual/dependencies.js +5 -0
- package/dist/_virtual/dependencies.js.map +1 -0
- package/dist/_virtual/draft7.js +5 -0
- package/dist/_virtual/draft7.js.map +1 -0
- package/dist/_virtual/enum.js +5 -0
- package/dist/_virtual/enum.js.map +1 -0
- package/dist/_virtual/equal.js +5 -0
- package/dist/_virtual/equal.js.map +1 -0
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/format.js +5 -0
- package/dist/_virtual/format.js.map +1 -0
- package/dist/_virtual/formats.js +5 -0
- package/dist/_virtual/formats.js.map +1 -0
- package/dist/_virtual/id.js +5 -0
- package/dist/_virtual/id.js.map +1 -0
- package/dist/_virtual/if.js +5 -0
- package/dist/_virtual/if.js.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index12.js +5 -0
- package/dist/_virtual/index12.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +5 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +5 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/items.js +5 -0
- package/dist/_virtual/items.js.map +1 -0
- package/dist/_virtual/items2020.js +5 -0
- package/dist/_virtual/items2020.js.map +1 -0
- package/dist/_virtual/keyword.js +5 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/limit.js +5 -0
- package/dist/_virtual/limit.js.map +1 -0
- package/dist/_virtual/limitItems.js +5 -0
- package/dist/_virtual/limitItems.js.map +1 -0
- package/dist/_virtual/limitLength.js +5 -0
- package/dist/_virtual/limitLength.js.map +1 -0
- package/dist/_virtual/limitNumber.js +5 -0
- package/dist/_virtual/limitNumber.js.map +1 -0
- package/dist/_virtual/limitProperties.js +5 -0
- package/dist/_virtual/limitProperties.js.map +1 -0
- package/dist/_virtual/metadata.js +5 -0
- package/dist/_virtual/metadata.js.map +1 -0
- package/dist/_virtual/multipleOf.js +5 -0
- package/dist/_virtual/multipleOf.js.map +1 -0
- package/dist/_virtual/names.js +5 -0
- package/dist/_virtual/names.js.map +1 -0
- package/dist/_virtual/not.js +5 -0
- package/dist/_virtual/not.js.map +1 -0
- package/dist/_virtual/oneOf.js +5 -0
- package/dist/_virtual/oneOf.js.map +1 -0
- package/dist/_virtual/pattern.js +5 -0
- package/dist/_virtual/pattern.js.map +1 -0
- package/dist/_virtual/patternProperties.js +5 -0
- package/dist/_virtual/patternProperties.js.map +1 -0
- package/dist/_virtual/prefixItems.js +5 -0
- package/dist/_virtual/prefixItems.js.map +1 -0
- package/dist/_virtual/properties.js +5 -0
- package/dist/_virtual/properties.js.map +1 -0
- package/dist/_virtual/propertyNames.js +5 -0
- package/dist/_virtual/propertyNames.js.map +1 -0
- package/dist/_virtual/ref.js +5 -0
- package/dist/_virtual/ref.js.map +1 -0
- package/dist/_virtual/ref_error.js +5 -0
- package/dist/_virtual/ref_error.js.map +1 -0
- package/dist/_virtual/required.js +5 -0
- package/dist/_virtual/required.js.map +1 -0
- package/dist/_virtual/resolve.js +5 -0
- package/dist/_virtual/resolve.js.map +1 -0
- package/dist/_virtual/rules.js +5 -0
- package/dist/_virtual/rules.js.map +1 -0
- package/dist/_virtual/scope.js +5 -0
- package/dist/_virtual/scope.js.map +1 -0
- package/dist/_virtual/subschema.js +5 -0
- package/dist/_virtual/subschema.js.map +1 -0
- package/dist/_virtual/thenElse.js +5 -0
- package/dist/_virtual/thenElse.js.map +1 -0
- package/dist/_virtual/types.js +5 -0
- package/dist/_virtual/types.js.map +1 -0
- package/dist/_virtual/ucs2length.js +5 -0
- package/dist/_virtual/ucs2length.js.map +1 -0
- package/dist/_virtual/uniqueItems.js +5 -0
- package/dist/_virtual/uniqueItems.js.map +1 -0
- package/dist/_virtual/uri.js +5 -0
- package/dist/_virtual/uri.js.map +1 -0
- package/dist/_virtual/util.js +5 -0
- package/dist/_virtual/util.js.map +1 -0
- package/dist/_virtual/validation_error.js +5 -0
- package/dist/_virtual/validation_error.js.map +1 -0
- package/dist/agents/analyst-agent.d.ts +230 -0
- package/dist/agents/analyst-agent.d.ts.map +1 -0
- package/dist/agents/analyst-agent.js +793 -0
- package/dist/agents/analyst-agent.js.map +1 -0
- package/dist/agents/architect-agent.d.ts +248 -0
- package/dist/agents/architect-agent.d.ts.map +1 -0
- package/dist/agents/architect-agent.js +685 -0
- package/dist/agents/architect-agent.js.map +1 -0
- package/dist/agents/base-agent.d.ts +169 -0
- package/dist/agents/base-agent.d.ts.map +1 -0
- package/dist/agents/base-agent.js +441 -0
- package/dist/agents/base-agent.js.map +1 -0
- package/dist/agents/coder-agent.d.ts +191 -0
- package/dist/agents/coder-agent.d.ts.map +1 -0
- package/dist/agents/coder-agent.js +1008 -0
- package/dist/agents/coder-agent.js.map +1 -0
- package/dist/agents/index.d.ts +18 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +40 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/registry.d.ts +213 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +419 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/researcher-agent.d.ts +226 -0
- package/dist/agents/researcher-agent.d.ts.map +1 -0
- package/dist/agents/researcher-agent.js +572 -0
- package/dist/agents/researcher-agent.js.map +1 -0
- package/dist/agents/rules-engine.d.ts +320 -0
- package/dist/agents/rules-engine.d.ts.map +1 -0
- package/dist/agents/rules-engine.js +552 -0
- package/dist/agents/rules-engine.js.map +1 -0
- package/dist/agents/tester-agent.d.ts +219 -0
- package/dist/agents/tester-agent.d.ts.map +1 -0
- package/dist/agents/tester-agent.js +683 -0
- package/dist/agents/tester-agent.js.map +1 -0
- package/dist/agents/types.d.ts +425 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +57 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/caching/index.d.ts +55 -0
- package/dist/caching/index.d.ts.map +1 -0
- package/dist/caching/index.js +206 -0
- package/dist/caching/index.js.map +1 -0
- package/dist/caching/lru-cache.d.ts +254 -0
- package/dist/caching/lru-cache.d.ts.map +1 -0
- package/dist/caching/types.d.ts +95 -0
- package/dist/caching/types.d.ts.map +1 -0
- package/dist/chunking/chunker.d.ts +94 -0
- package/dist/chunking/chunker.d.ts.map +1 -0
- package/dist/chunking/index.d.ts +125 -0
- package/dist/chunking/index.d.ts.map +1 -0
- package/dist/chunking/index.js +283 -0
- package/dist/chunking/index.js.map +1 -0
- package/dist/chunking/types.d.ts +92 -0
- package/dist/chunking/types.d.ts.map +1 -0
- package/dist/cli/commands/analyze.d.ts +12 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +269 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/commit.d.ts +11 -0
- package/dist/cli/commands/commit.d.ts.map +1 -0
- package/dist/cli/commands/commit.js +379 -0
- package/dist/cli/commands/commit.js.map +1 -0
- package/dist/cli/commands/config.d.ts +8 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +107 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/convert.d.ts +15 -0
- package/dist/cli/commands/convert.d.ts.map +1 -0
- package/dist/cli/commands/convert.js +203 -0
- package/dist/cli/commands/convert.js.map +1 -0
- package/dist/cli/commands/cultivate.d.ts +16 -0
- package/dist/cli/commands/cultivate.d.ts.map +1 -0
- package/dist/cli/commands/cultivate.js +254 -0
- package/dist/cli/commands/cultivate.js.map +1 -0
- package/dist/cli/commands/diagnostics.d.ts +8 -0
- package/dist/cli/commands/diagnostics.d.ts.map +1 -0
- package/dist/cli/commands/diagnostics.js +140 -0
- package/dist/cli/commands/diagnostics.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +13 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/init-primitives.d.ts +19 -0
- package/dist/cli/commands/init-primitives.d.ts.map +1 -0
- package/dist/cli/commands/init-primitives.js +208 -0
- package/dist/cli/commands/init-primitives.js.map +1 -0
- package/dist/cli/commands/sop.d.ts +14 -0
- package/dist/cli/commands/sop.d.ts.map +1 -0
- package/dist/cli/commands/sop.js +598 -0
- package/dist/cli/commands/sop.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +52 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +153 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +141 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/manager.d.ts +136 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/types.d.ts +127 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/core/cache.d.ts +185 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +435 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/cultivation/deep-analyzer.d.ts +129 -0
- package/dist/cultivation/deep-analyzer.d.ts.map +1 -0
- package/dist/cultivation/deep-analyzer.js +322 -0
- package/dist/cultivation/deep-analyzer.js.map +1 -0
- package/dist/cultivation/index.d.ts +13 -0
- package/dist/cultivation/index.d.ts.map +1 -0
- package/dist/cultivation/seed-generator.d.ts +92 -0
- package/dist/cultivation/seed-generator.d.ts.map +1 -0
- package/dist/cultivation/seed-generator.js +1033 -0
- package/dist/cultivation/seed-generator.js.map +1 -0
- package/dist/cultivation/types.d.ts +230 -0
- package/dist/cultivation/types.d.ts.map +1 -0
- package/dist/generators/claude-md.d.ts +7 -0
- package/dist/generators/claude-md.d.ts.map +1 -1
- package/dist/generators/claude-md.js.map +1 -1
- package/dist/generators/docs-analyzer.d.ts +75 -0
- package/dist/generators/docs-analyzer.d.ts.map +1 -0
- package/dist/generators/docs-analyzer.js +567 -0
- package/dist/generators/docs-analyzer.js.map +1 -0
- package/dist/generators/docs-convert.d.ts +91 -0
- package/dist/generators/docs-convert.d.ts.map +1 -0
- package/dist/generators/docs-convert.js +474 -0
- package/dist/generators/docs-convert.js.map +1 -0
- package/dist/generators/docs-init.d.ts +6 -0
- package/dist/generators/docs-init.d.ts.map +1 -1
- package/dist/generators/docs-init.js.map +1 -1
- package/dist/health/checks.d.ts +135 -0
- package/dist/health/checks.d.ts.map +1 -0
- package/dist/health/index.d.ts +119 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/health/index.js +191 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/monitor.d.ts +146 -0
- package/dist/health/monitor.d.ts.map +1 -0
- package/dist/health/types.d.ts +135 -0
- package/dist/health/types.d.ts.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +179 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/auto-commit.d.ts +175 -0
- package/dist/integrations/auto-commit.d.ts.map +1 -0
- package/dist/integrations/auto-commit.js +399 -0
- package/dist/integrations/auto-commit.js.map +1 -0
- package/dist/integrations/git.d.ts +299 -0
- package/dist/integrations/git.d.ts.map +1 -0
- package/dist/integrations/git.js +465 -0
- package/dist/integrations/git.js.map +1 -0
- package/dist/mcp-server/bin.d.ts +11 -0
- package/dist/mcp-server/bin.d.ts.map +1 -0
- package/dist/mcp-server/handlers/index.d.ts +57 -0
- package/dist/mcp-server/handlers/index.d.ts.map +1 -0
- package/dist/mcp-server/handlers/index.js +235 -0
- package/dist/mcp-server/handlers/index.js.map +1 -0
- package/dist/mcp-server/index.d.ts +28 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/server.d.ts +133 -0
- package/dist/mcp-server/server.d.ts.map +1 -0
- package/dist/mcp-server/server.js +280 -0
- package/dist/mcp-server/server.js.map +1 -0
- package/dist/mcp-server/tools/agents/index.d.ts +10 -0
- package/dist/mcp-server/tools/agents/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/agents/list.d.ts +19 -0
- package/dist/mcp-server/tools/agents/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/agents/spawn.d.ts +19 -0
- package/dist/mcp-server/tools/agents/spawn.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/generate.d.ts +21 -0
- package/dist/mcp-server/tools/graph/generate.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/index.d.ts +11 -0
- package/dist/mcp-server/tools/graph/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/query.d.ts +22 -0
- package/dist/mcp-server/tools/graph/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/stats.d.ts +22 -0
- package/dist/mcp-server/tools/graph/stats.d.ts.map +1 -0
- package/dist/mcp-server/tools/health.d.ts +21 -0
- package/dist/mcp-server/tools/health.d.ts.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +13 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/registry.d.ts +90 -0
- package/dist/mcp-server/tools/registry.d.ts.map +1 -0
- package/dist/mcp-server/tools/registry.js +663 -0
- package/dist/mcp-server/tools/registry.js.map +1 -0
- package/dist/mcp-server/tools/search/index.d.ts +10 -0
- package/dist/mcp-server/tools/search/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/search/nodes.d.ts +22 -0
- package/dist/mcp-server/tools/search/nodes.d.ts.map +1 -0
- package/dist/mcp-server/tools/search/tags.d.ts +22 -0
- package/dist/mcp-server/tools/search/tags.d.ts.map +1 -0
- package/dist/mcp-server/types/index.d.ts +286 -0
- package/dist/mcp-server/types/index.d.ts.map +1 -0
- package/dist/memory/index.d.ts +10 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/vault-sync.d.ts +212 -0
- package/dist/memory/vault-sync.d.ts.map +1 -0
- package/dist/memory/vault-sync.js +463 -0
- package/dist/memory/vault-sync.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +296 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +26 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +407 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1332 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/ajv/dist/ajv.js +84 -0
- package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js +160 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js +728 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js +152 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/errors.js +131 -0
- package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/index.js +234 -0
- package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/names.js +44 -0
- package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js +22 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js +163 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/rules.js +35 -0
- package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/util.js +173 -0
- package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js +27 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +58 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js +193 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js +43 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js +522 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js +126 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js +89 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/ajv/dist/core.js +628 -0
- package/dist/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js +24 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +25 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js +16 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js +30 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js +16 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js +20 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +59 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +114 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +32 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +22 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +100 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +103 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +75 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +68 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +43 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +36 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +81 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +22 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +66 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +49 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +23 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js +140 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js +19 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +132 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +114 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +18 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js +31 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js +95 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +16 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +36 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +56 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +52 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +39 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +37 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +33 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +89 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +75 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/formats.js +209 -0
- package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/index.js +51 -0
- package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/limit.js +80 -0
- package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/fast-deep-equal/index.js +39 -0
- package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/node_modules/fast-uri/index.js +261 -0
- package/dist/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +215 -0
- package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/utils.js +261 -0
- package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/json-schema-traverse/index.js +92 -0
- package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/errors.js +37 -0
- package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/iso.js +43 -0
- package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/parse.js +13 -0
- package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/schemas.js +688 -0
- package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/api.js +492 -0
- package/dist/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/zod/v4/core/checks.js +405 -0
- package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/zod/v4/core/core.js +58 -0
- package/dist/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/zod/v4/core/doc.js +38 -0
- package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/zod/v4/core/errors.js +82 -0
- package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/core/parse.js +60 -0
- package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/core/regexes.js +87 -0
- package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/zod/v4/core/registries.js +52 -0
- package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/zod/v4/core/schemas.js +1283 -0
- package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/util.js +341 -0
- package/dist/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/zod/v4/core/versions.js +9 -0
- package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +2 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/reasoning/index.d.ts +74 -0
- package/dist/reasoning/index.d.ts.map +1 -0
- package/dist/reasoning/index.js +124 -0
- package/dist/reasoning/index.js.map +1 -0
- package/dist/reasoning/tracker.d.ts +210 -0
- package/dist/reasoning/tracker.d.ts.map +1 -0
- package/dist/reasoning/types.d.ts +146 -0
- package/dist/reasoning/types.d.ts.map +1 -0
- package/dist/recovery/backup.d.ts +110 -0
- package/dist/recovery/backup.d.ts.map +1 -0
- package/dist/recovery/index.d.ts +70 -0
- package/dist/recovery/index.d.ts.map +1 -0
- package/dist/recovery/index.js +186 -0
- package/dist/recovery/index.js.map +1 -0
- package/dist/recovery/integrity.d.ts +74 -0
- package/dist/recovery/integrity.d.ts.map +1 -0
- package/dist/recovery/types.d.ts +94 -0
- package/dist/recovery/types.d.ts.map +1 -0
- package/dist/services/index.d.ts +130 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +134 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/manager.d.ts +140 -0
- package/dist/services/manager.d.ts.map +1 -0
- package/dist/services/types.d.ts +106 -0
- package/dist/services/types.d.ts.map +1 -0
- package/dist/services/watchers.d.ts +95 -0
- package/dist/services/watchers.d.ts.map +1 -0
- package/dist/sops/compliance-checker.d.ts +83 -0
- package/dist/sops/compliance-checker.d.ts.map +1 -0
- package/dist/sops/compliance-checker.js +399 -0
- package/dist/sops/compliance-checker.js.map +1 -0
- package/dist/sops/gap-analyzer.d.ts +124 -0
- package/dist/sops/gap-analyzer.d.ts.map +1 -0
- package/dist/sops/gap-analyzer.js +313 -0
- package/dist/sops/gap-analyzer.js.map +1 -0
- package/dist/sops/index.d.ts +14 -0
- package/dist/sops/index.d.ts.map +1 -0
- package/dist/sops/overlay-manager.d.ts +115 -0
- package/dist/sops/overlay-manager.d.ts.map +1 -0
- package/dist/sops/overlay-manager.js +394 -0
- package/dist/sops/overlay-manager.js.map +1 -0
- package/dist/sops/registry.d.ts +73 -0
- package/dist/sops/registry.d.ts.map +1 -0
- package/dist/sops/registry.js +919 -0
- package/dist/sops/registry.js.map +1 -0
- package/dist/sops/types.d.ts +377 -0
- package/dist/sops/types.d.ts.map +1 -0
- package/dist/sops/types.js +46 -0
- package/dist/sops/types.js.map +1 -0
- package/dist/utils/error-recovery.d.ts +230 -0
- package/dist/utils/error-recovery.d.ts.map +1 -0
- package/dist/utils/error-recovery.js +228 -0
- package/dist/utils/error-recovery.js.map +1 -0
- package/dist/utils/error-taxonomy.d.ts +149 -0
- package/dist/utils/error-taxonomy.d.ts.map +1 -0
- package/dist/utils/error-taxonomy.js +260 -0
- package/dist/utils/error-taxonomy.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +139 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +311 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/workflows/index.d.ts +11 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/registry.d.ts +118 -0
- package/dist/workflows/registry.d.ts.map +1 -0
- package/dist/workflows/registry.js +575 -0
- package/dist/workflows/registry.js.map +1 -0
- package/dist/workflows/types.d.ts +322 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +16 -0
- package/dist/workflows/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
3
|
+
import { resolve, join } from "path";
|
|
4
|
+
import { ComplianceStatus, SOPPriority } from "../../sops/types.js";
|
|
5
|
+
import { getSopCount, getCategories, getSOPsByCategory, getSOPById, getAllSOPs } from "../../sops/registry.js";
|
|
6
|
+
import { checkCompliance } from "../../sops/compliance-checker.js";
|
|
7
|
+
import { analyzeGaps } from "../../sops/gap-analyzer.js";
|
|
8
|
+
import { createMultiLayerGraph, addComplianceOverlay, getComplianceSummary } from "../../sops/overlay-manager.js";
|
|
9
|
+
function createSOPCommands() {
|
|
10
|
+
const sop = new Command("sop").description("AI-SDLC SOP compliance commands");
|
|
11
|
+
sop.command("init").description("Initialize AI-SDLC SOP standards layer").option("-p, --path <path>", "Project root path", process.cwd()).option("-d, --docs <path>", "Documentation path", "docs").option("-c, --categories <categories>", "SOP categories to include (comma-separated)").option("-v, --verbose", "Verbose output").action(async (options) => {
|
|
12
|
+
const projectRoot = resolve(options.path);
|
|
13
|
+
const docsPath = options.docs;
|
|
14
|
+
const verbose = options.verbose;
|
|
15
|
+
console.log("\n🏛️ Initializing AI-SDLC SOP Standards Layer\n");
|
|
16
|
+
try {
|
|
17
|
+
let categories;
|
|
18
|
+
if (options.categories) {
|
|
19
|
+
categories = options.categories.split(",").map((c) => c.trim());
|
|
20
|
+
}
|
|
21
|
+
const graph = createMultiLayerGraph({
|
|
22
|
+
graphId: `sop-${Date.now()}`,
|
|
23
|
+
graphName: "AI-SDLC Compliance Graph",
|
|
24
|
+
includeAllSOPs: !categories,
|
|
25
|
+
categories
|
|
26
|
+
});
|
|
27
|
+
const sopDir = join(projectRoot, docsPath, "sop");
|
|
28
|
+
if (!existsSync(sopDir)) {
|
|
29
|
+
mkdirSync(sopDir, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
const graphPath = join(sopDir, "standards-graph.json");
|
|
32
|
+
writeFileSync(graphPath, JSON.stringify(graph, null, 2));
|
|
33
|
+
console.log(` ✓ Created standards layer with ${getSopCount()} SOPs`);
|
|
34
|
+
console.log(` ✓ Saved graph to ${graphPath}`);
|
|
35
|
+
if (verbose) {
|
|
36
|
+
console.log("\n Categories included:");
|
|
37
|
+
for (const category of getCategories()) {
|
|
38
|
+
const count = getSOPsByCategory(category).length;
|
|
39
|
+
console.log(` - ${category}: ${count} SOPs`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const indexPath = join(sopDir, "SOP-INDEX.md");
|
|
43
|
+
const indexContent = generateSOPIndex(categories);
|
|
44
|
+
writeFileSync(indexPath, indexContent);
|
|
45
|
+
console.log(` ✓ Created SOP index at ${indexPath}`);
|
|
46
|
+
console.log("\n✨ SOP standards layer initialized!\n");
|
|
47
|
+
console.log("Next steps:");
|
|
48
|
+
console.log(' - Run "kg sop check" to assess compliance');
|
|
49
|
+
console.log(' - Run "kg sop gaps" to identify gaps');
|
|
50
|
+
console.log(' - Run "kg sop report" to generate compliance report');
|
|
51
|
+
console.log("");
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error("\n❌ SOP initialization failed:", error);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
sop.command("check").description("Check project compliance against AI-SDLC SOPs").option("-p, --path <path>", "Project root path", process.cwd()).option("-d, --docs <path>", "Documentation path", "docs").option("-s, --sop <id>", "Check specific SOP by ID").option("-c, --category <category>", "Check SOPs in specific category").option("--deep", "Perform deep analysis of file contents").option("--threshold <number>", "Minimum compliance threshold (0-100)", "50").option("-v, --verbose", "Verbose output").option("--json", "Output as JSON").action(async (options) => {
|
|
58
|
+
const projectRoot = resolve(options.path);
|
|
59
|
+
const docsPath = options.docs;
|
|
60
|
+
const verbose = options.verbose;
|
|
61
|
+
const threshold = parseInt(options.threshold, 10);
|
|
62
|
+
if (!options.json) {
|
|
63
|
+
console.log("\n🔍 Checking AI-SDLC SOP Compliance\n");
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
const checkOptions = {
|
|
67
|
+
projectRoot,
|
|
68
|
+
docsPath,
|
|
69
|
+
deepAnalysis: options.deep,
|
|
70
|
+
assessor: "cli-automated"
|
|
71
|
+
};
|
|
72
|
+
if (options.sop) {
|
|
73
|
+
checkOptions.sopIds = [options.sop];
|
|
74
|
+
}
|
|
75
|
+
if (options.category) {
|
|
76
|
+
checkOptions.categories = [options.category];
|
|
77
|
+
}
|
|
78
|
+
const result = await checkCompliance(checkOptions);
|
|
79
|
+
if (options.json) {
|
|
80
|
+
console.log(JSON.stringify(result, null, 2));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
console.log(` Project: ${result.projectName}`);
|
|
84
|
+
console.log(` Overall Score: ${getScoreEmoji(result.overallScore)} ${result.overallScore}%
|
|
85
|
+
`);
|
|
86
|
+
console.log(" Category Scores:");
|
|
87
|
+
for (const [category, score] of Object.entries(result.categoryScores)) {
|
|
88
|
+
if (score > 0) {
|
|
89
|
+
console.log(` ${getScoreEmoji(score)} ${formatCategory(category)}: ${score}%`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
console.log("");
|
|
93
|
+
const compliant = result.assessments.filter((a) => a.status === ComplianceStatus.COMPLIANT).length;
|
|
94
|
+
const partial = result.assessments.filter((a) => a.status === ComplianceStatus.PARTIAL).length;
|
|
95
|
+
const nonCompliant = result.assessments.filter((a) => a.status === ComplianceStatus.NON_COMPLIANT).length;
|
|
96
|
+
console.log(" Assessment Summary:");
|
|
97
|
+
console.log(` ✅ Compliant: ${compliant}`);
|
|
98
|
+
console.log(` 🟡 Partial: ${partial}`);
|
|
99
|
+
console.log(` ❌ Non-compliant: ${nonCompliant}`);
|
|
100
|
+
console.log("");
|
|
101
|
+
if (verbose) {
|
|
102
|
+
console.log(" Detailed Assessments:");
|
|
103
|
+
for (const assessment of result.assessments) {
|
|
104
|
+
const sop2 = getSOPById(assessment.sopId);
|
|
105
|
+
if (sop2) {
|
|
106
|
+
console.log(`
|
|
107
|
+
${getStatusIcon(assessment.status)} ${sop2.title}`);
|
|
108
|
+
console.log(` Score: ${assessment.score}%`);
|
|
109
|
+
console.log(` Met: ${assessment.requirementsMet.length}/${assessment.requirementsMet.length + assessment.requirementsGaps.length}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
console.log("");
|
|
113
|
+
}
|
|
114
|
+
if (result.overallScore < threshold) {
|
|
115
|
+
console.log(` ⚠️ Below compliance threshold of ${threshold}%`);
|
|
116
|
+
console.log(' Run "kg sop gaps" to see remediation recommendations\n');
|
|
117
|
+
} else {
|
|
118
|
+
console.log(` ✨ Meets compliance threshold of ${threshold}%
|
|
119
|
+
`);
|
|
120
|
+
}
|
|
121
|
+
if (result.evidence.length > 0 && verbose) {
|
|
122
|
+
console.log(` Evidence Found: ${result.evidence.length} items`);
|
|
123
|
+
}
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error("\n❌ Compliance check failed:", error);
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
sop.command("gaps").description("Analyze compliance gaps and generate remediation recommendations").option("-p, --path <path>", "Project root path", process.cwd()).option("-d, --docs <path>", "Documentation path", "docs").option("--priority <priority>", "Minimum gap priority (critical, high, medium, low)").option("--category <category>", "Filter by category").option("--roadmap", "Include remediation roadmap").option("-v, --verbose", "Verbose output").option("--json", "Output as JSON").action(async (options) => {
|
|
130
|
+
const projectRoot = resolve(options.path);
|
|
131
|
+
const docsPath = options.docs;
|
|
132
|
+
const verbose = options.verbose;
|
|
133
|
+
if (!options.json) {
|
|
134
|
+
console.log("\n📋 Analyzing Compliance Gaps\n");
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const checkResult = await checkCompliance({
|
|
138
|
+
projectRoot,
|
|
139
|
+
docsPath,
|
|
140
|
+
deepAnalysis: true
|
|
141
|
+
});
|
|
142
|
+
let minPriority;
|
|
143
|
+
if (options.priority) {
|
|
144
|
+
minPriority = options.priority;
|
|
145
|
+
}
|
|
146
|
+
let categories;
|
|
147
|
+
if (options.category) {
|
|
148
|
+
categories = [options.category];
|
|
149
|
+
}
|
|
150
|
+
const gapResult = analyzeGaps(checkResult, {
|
|
151
|
+
minPriority,
|
|
152
|
+
categories,
|
|
153
|
+
generateRemediation: true
|
|
154
|
+
});
|
|
155
|
+
if (options.json) {
|
|
156
|
+
console.log(JSON.stringify(gapResult, null, 2));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
console.log(` Total Gaps: ${gapResult.totalGaps}`);
|
|
160
|
+
console.log(` Compliance: ${gapResult.summary.compliancePercentage}%`);
|
|
161
|
+
console.log(` Complexity: ${gapResult.summary.overallComplexity}
|
|
162
|
+
`);
|
|
163
|
+
console.log(" Gaps by Priority:");
|
|
164
|
+
console.log(` 🔴 Critical: ${gapResult.byPriority[SOPPriority.CRITICAL].length}`);
|
|
165
|
+
console.log(` 🟠 High: ${gapResult.byPriority[SOPPriority.HIGH].length}`);
|
|
166
|
+
console.log(` 🟡 Medium: ${gapResult.byPriority[SOPPriority.MEDIUM].length}`);
|
|
167
|
+
console.log(` 🟢 Low: ${gapResult.byPriority[SOPPriority.LOW].length}`);
|
|
168
|
+
console.log("");
|
|
169
|
+
console.log(" Gaps by Category:");
|
|
170
|
+
for (const [category, gaps] of Object.entries(gapResult.byCategory)) {
|
|
171
|
+
if (gaps.length > 0) {
|
|
172
|
+
console.log(` ${formatCategory(category)}: ${gaps.length}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
console.log("");
|
|
176
|
+
if (gapResult.criticalGaps.length > 0) {
|
|
177
|
+
console.log(" 🚨 Critical Gaps (Immediate Action Required):");
|
|
178
|
+
for (const gap of gapResult.criticalGaps) {
|
|
179
|
+
const sop2 = getSOPById(gap.sopId);
|
|
180
|
+
console.log(`
|
|
181
|
+
• ${sop2?.title || gap.sopId}`);
|
|
182
|
+
console.log(` ${gap.description.substring(0, 80)}...`);
|
|
183
|
+
console.log(` Effort: ${gap.effort}`);
|
|
184
|
+
}
|
|
185
|
+
console.log("");
|
|
186
|
+
}
|
|
187
|
+
if (gapResult.roadmap?.quickWins && gapResult.roadmap.quickWins.length > 0) {
|
|
188
|
+
console.log(" 💡 Quick Wins (High Impact, Low Effort):");
|
|
189
|
+
for (const gap of gapResult.roadmap.quickWins.slice(0, 5)) {
|
|
190
|
+
const sop2 = getSOPById(gap.sopId);
|
|
191
|
+
console.log(` • ${sop2?.title || gap.sopId}`);
|
|
192
|
+
}
|
|
193
|
+
console.log("");
|
|
194
|
+
}
|
|
195
|
+
if (options.roadmap && gapResult.roadmap) {
|
|
196
|
+
console.log(" 📍 Remediation Roadmap:");
|
|
197
|
+
for (const phase of gapResult.roadmap.phases) {
|
|
198
|
+
console.log(`
|
|
199
|
+
Phase ${phase.phase}: ${phase.name}`);
|
|
200
|
+
console.log(` Focus: ${phase.focus}`);
|
|
201
|
+
console.log(` Gaps: ${phase.gaps.length}`);
|
|
202
|
+
console.log(` Effort: ${phase.effort}`);
|
|
203
|
+
}
|
|
204
|
+
console.log("");
|
|
205
|
+
}
|
|
206
|
+
if (verbose) {
|
|
207
|
+
console.log(" All Gaps:");
|
|
208
|
+
for (const gap of gapResult.gaps) {
|
|
209
|
+
console.log(`
|
|
210
|
+
[${gap.priority.toUpperCase()}] ${gap.id}`);
|
|
211
|
+
console.log(` SOP: ${gap.sopId}`);
|
|
212
|
+
console.log(` Description: ${gap.description.substring(0, 100)}...`);
|
|
213
|
+
console.log(` Remediation: ${gap.remediation.substring(0, 100)}...`);
|
|
214
|
+
}
|
|
215
|
+
console.log("");
|
|
216
|
+
}
|
|
217
|
+
} catch (error) {
|
|
218
|
+
console.error("\n❌ Gap analysis failed:", error);
|
|
219
|
+
process.exit(1);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
sop.command("report").description("Generate comprehensive compliance report").option("-p, --path <path>", "Project root path", process.cwd()).option("-d, --docs <path>", "Documentation path", "docs").option("-o, --output <file>", "Output file path").option("-f, --format <format>", "Output format (md, json, html)", "md").option("--include-evidence", "Include evidence details").option("--include-roadmap", "Include remediation roadmap").action(async (options) => {
|
|
223
|
+
const projectRoot = resolve(options.path);
|
|
224
|
+
const docsPath = options.docs;
|
|
225
|
+
const format = options.format;
|
|
226
|
+
console.log("\n📝 Generating Compliance Report\n");
|
|
227
|
+
try {
|
|
228
|
+
const checkResult = await checkCompliance({
|
|
229
|
+
projectRoot,
|
|
230
|
+
docsPath,
|
|
231
|
+
deepAnalysis: true
|
|
232
|
+
});
|
|
233
|
+
const gapResult = analyzeGaps(checkResult, {
|
|
234
|
+
generateRemediation: true
|
|
235
|
+
});
|
|
236
|
+
const graph = createMultiLayerGraph();
|
|
237
|
+
addComplianceOverlay(graph, checkResult, gapResult);
|
|
238
|
+
const summary = getComplianceSummary(graph);
|
|
239
|
+
let report;
|
|
240
|
+
if (format === "json") {
|
|
241
|
+
report = JSON.stringify({
|
|
242
|
+
checkResult,
|
|
243
|
+
gapResult,
|
|
244
|
+
summary,
|
|
245
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
246
|
+
}, null, 2);
|
|
247
|
+
} else if (format === "html") {
|
|
248
|
+
report = generateHTMLReport(checkResult, gapResult, summary, options);
|
|
249
|
+
} else {
|
|
250
|
+
report = generateMarkdownReport(checkResult, gapResult, summary, options);
|
|
251
|
+
}
|
|
252
|
+
if (options.output) {
|
|
253
|
+
const outputPath = resolve(options.output);
|
|
254
|
+
writeFileSync(outputPath, report);
|
|
255
|
+
console.log(` ✓ Report saved to ${outputPath}`);
|
|
256
|
+
} else {
|
|
257
|
+
const sopDir = join(projectRoot, docsPath, "sop");
|
|
258
|
+
if (!existsSync(sopDir)) {
|
|
259
|
+
mkdirSync(sopDir, { recursive: true });
|
|
260
|
+
}
|
|
261
|
+
const outputPath = join(sopDir, `COMPLIANCE-REPORT.${format}`);
|
|
262
|
+
writeFileSync(outputPath, report);
|
|
263
|
+
console.log(` ✓ Report saved to ${outputPath}`);
|
|
264
|
+
}
|
|
265
|
+
console.log("\n✨ Report generated successfully!\n");
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.error("\n❌ Report generation failed:", error);
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
sop.command("list").description("List available AI-SDLC SOPs").option("-c, --category <category>", "Filter by category").option("--irb", "Show only SOPs requiring AI-IRB review").option("--json", "Output as JSON").action((options) => {
|
|
272
|
+
let sops = getAllSOPs();
|
|
273
|
+
if (options.category) {
|
|
274
|
+
sops = getSOPsByCategory(options.category);
|
|
275
|
+
}
|
|
276
|
+
if (options.irb) {
|
|
277
|
+
sops = sops.filter((s) => s.irbTypicallyRequired);
|
|
278
|
+
}
|
|
279
|
+
if (options.json) {
|
|
280
|
+
console.log(JSON.stringify(sops, null, 2));
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
console.log("\n📚 AI-SDLC Standard Operating Procedures\n");
|
|
284
|
+
console.log(` Total: ${sops.length} SOPs
|
|
285
|
+
`);
|
|
286
|
+
const byCategory = /* @__PURE__ */ new Map();
|
|
287
|
+
for (const sop2 of sops) {
|
|
288
|
+
if (!byCategory.has(sop2.category)) {
|
|
289
|
+
byCategory.set(sop2.category, []);
|
|
290
|
+
}
|
|
291
|
+
byCategory.get(sop2.category).push(sop2);
|
|
292
|
+
}
|
|
293
|
+
for (const [category, categorySops] of byCategory) {
|
|
294
|
+
console.log(` ${formatCategory(category)} (${categorySops.length}):`);
|
|
295
|
+
for (const sop2 of categorySops) {
|
|
296
|
+
const irb = sop2.irbTypicallyRequired ? " 🔬" : "";
|
|
297
|
+
console.log(` • ${sop2.id}: ${sop2.title}${irb}`);
|
|
298
|
+
}
|
|
299
|
+
console.log("");
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
return sop;
|
|
303
|
+
}
|
|
304
|
+
function getScoreEmoji(score) {
|
|
305
|
+
if (score >= 90) return "✅";
|
|
306
|
+
if (score >= 70) return "🟡";
|
|
307
|
+
if (score >= 50) return "🟠";
|
|
308
|
+
return "🔴";
|
|
309
|
+
}
|
|
310
|
+
function getStatusIcon(status) {
|
|
311
|
+
switch (status) {
|
|
312
|
+
case ComplianceStatus.COMPLIANT:
|
|
313
|
+
return "✅";
|
|
314
|
+
case ComplianceStatus.PARTIAL:
|
|
315
|
+
return "🟡";
|
|
316
|
+
case ComplianceStatus.NON_COMPLIANT:
|
|
317
|
+
return "❌";
|
|
318
|
+
case ComplianceStatus.NOT_APPLICABLE:
|
|
319
|
+
return "⚪";
|
|
320
|
+
case ComplianceStatus.PENDING:
|
|
321
|
+
return "⏳";
|
|
322
|
+
default:
|
|
323
|
+
return "❓";
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function formatCategory(category) {
|
|
327
|
+
return category.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
328
|
+
}
|
|
329
|
+
function generateSOPIndex(categories) {
|
|
330
|
+
const sops = categories ? categories.flatMap((c) => getSOPsByCategory(c)) : getAllSOPs();
|
|
331
|
+
let content = `---
|
|
332
|
+
title: AI-SDLC SOP Index
|
|
333
|
+
type: standards
|
|
334
|
+
created: ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}
|
|
335
|
+
tags: [sop, ai-sdlc, compliance, standards]
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
# AI-SDLC Standard Operating Procedures
|
|
339
|
+
|
|
340
|
+
This document provides an index of AI-SDLC SOPs applicable to this project.
|
|
341
|
+
|
|
342
|
+
## Overview
|
|
343
|
+
|
|
344
|
+
- **Total SOPs**: ${sops.length}
|
|
345
|
+
- **Source**: [AI-SDLC-SOPs](https://github.com/AISDLC/AI-SDLC-SOPs)
|
|
346
|
+
- **Generated**: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
347
|
+
|
|
348
|
+
## SOPs by Category
|
|
349
|
+
|
|
350
|
+
`;
|
|
351
|
+
const byCategory = /* @__PURE__ */ new Map();
|
|
352
|
+
for (const sop of sops) {
|
|
353
|
+
if (!byCategory.has(sop.category)) {
|
|
354
|
+
byCategory.set(sop.category, []);
|
|
355
|
+
}
|
|
356
|
+
byCategory.get(sop.category).push(sop);
|
|
357
|
+
}
|
|
358
|
+
for (const [category, categorySops] of byCategory) {
|
|
359
|
+
content += `### ${formatCategory(category)}
|
|
360
|
+
|
|
361
|
+
`;
|
|
362
|
+
for (const sop of categorySops) {
|
|
363
|
+
const irb = sop.irbTypicallyRequired ? " 🔬" : "";
|
|
364
|
+
content += `- **${sop.id}**: ${sop.title}${irb}
|
|
365
|
+
`;
|
|
366
|
+
content += ` - Priority: ${sop.priority}
|
|
367
|
+
`;
|
|
368
|
+
content += ` - Requirements: ${sop.requirements.length}
|
|
369
|
+
`;
|
|
370
|
+
}
|
|
371
|
+
content += "\n";
|
|
372
|
+
}
|
|
373
|
+
content += `## Legend
|
|
374
|
+
|
|
375
|
+
- 🔬 Requires AI-IRB review
|
|
376
|
+
- Requirements count indicates number of checkable items
|
|
377
|
+
|
|
378
|
+
## Next Steps
|
|
379
|
+
|
|
380
|
+
1. Run \`kg sop check\` to assess current compliance
|
|
381
|
+
2. Run \`kg sop gaps\` to identify remediation needs
|
|
382
|
+
3. Run \`kg sop report\` to generate detailed report
|
|
383
|
+
`;
|
|
384
|
+
return content;
|
|
385
|
+
}
|
|
386
|
+
function generateMarkdownReport(checkResult, gapResult, summary, options) {
|
|
387
|
+
let report = `---
|
|
388
|
+
title: AI-SDLC Compliance Report
|
|
389
|
+
type: report
|
|
390
|
+
generated: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
391
|
+
tags: [compliance, sop, report]
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
# AI-SDLC Compliance Report
|
|
395
|
+
|
|
396
|
+
**Project**: ${checkResult.projectName}
|
|
397
|
+
**Generated**: ${checkResult.checkedAt.toISOString()}
|
|
398
|
+
|
|
399
|
+
## Executive Summary
|
|
400
|
+
|
|
401
|
+
| Metric | Value |
|
|
402
|
+
|--------|-------|
|
|
403
|
+
| Overall Score | ${checkResult.overallScore}% |
|
|
404
|
+
| Compliant SOPs | ${summary.compliant} |
|
|
405
|
+
| Partial Compliance | ${summary.partial} |
|
|
406
|
+
| Non-Compliant | ${summary.nonCompliant} |
|
|
407
|
+
| Pending Assessment | ${summary.pending} |
|
|
408
|
+
| Total Gaps | ${gapResult.totalGaps} |
|
|
409
|
+
|
|
410
|
+
## Category Scores
|
|
411
|
+
|
|
412
|
+
`;
|
|
413
|
+
for (const [category, score] of Object.entries(checkResult.categoryScores)) {
|
|
414
|
+
if (score > 0) {
|
|
415
|
+
report += `- **${formatCategory(category)}**: ${score}%
|
|
416
|
+
`;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
report += `
|
|
420
|
+
## Gap Analysis
|
|
421
|
+
|
|
422
|
+
### By Priority
|
|
423
|
+
|
|
424
|
+
| Priority | Count |
|
|
425
|
+
|----------|-------|
|
|
426
|
+
| Critical | ${gapResult.byPriority[SOPPriority.CRITICAL].length} |
|
|
427
|
+
| High | ${gapResult.byPriority[SOPPriority.HIGH].length} |
|
|
428
|
+
| Medium | ${gapResult.byPriority[SOPPriority.MEDIUM].length} |
|
|
429
|
+
| Low | ${gapResult.byPriority[SOPPriority.LOW].length} |
|
|
430
|
+
|
|
431
|
+
### Effort Breakdown
|
|
432
|
+
|
|
433
|
+
- Low effort: ${gapResult.summary.totalEffort.low}
|
|
434
|
+
- Medium effort: ${gapResult.summary.totalEffort.medium}
|
|
435
|
+
- High effort: ${gapResult.summary.totalEffort.high}
|
|
436
|
+
|
|
437
|
+
## Critical Gaps
|
|
438
|
+
|
|
439
|
+
`;
|
|
440
|
+
if (gapResult.criticalGaps.length > 0) {
|
|
441
|
+
for (const gap of gapResult.criticalGaps) {
|
|
442
|
+
const sop = getSOPById(gap.sopId);
|
|
443
|
+
report += `### ${sop?.title || gap.sopId}
|
|
444
|
+
|
|
445
|
+
- **Gap ID**: ${gap.id}
|
|
446
|
+
- **Requirement**: ${gap.requirementId}
|
|
447
|
+
- **Priority**: ${gap.priority}
|
|
448
|
+
- **Effort**: ${gap.effort}
|
|
449
|
+
- **Impact**: ${gap.impact}
|
|
450
|
+
|
|
451
|
+
**Remediation**: ${gap.remediation}
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
`;
|
|
456
|
+
}
|
|
457
|
+
} else {
|
|
458
|
+
report += "No critical gaps identified.\n\n";
|
|
459
|
+
}
|
|
460
|
+
if (options.includeRoadmap && gapResult.roadmap) {
|
|
461
|
+
report += `## Remediation Roadmap
|
|
462
|
+
|
|
463
|
+
`;
|
|
464
|
+
for (const phase of gapResult.roadmap.phases) {
|
|
465
|
+
report += `### Phase ${phase.phase}: ${phase.name}
|
|
466
|
+
|
|
467
|
+
- **Focus**: ${phase.focus}
|
|
468
|
+
- **Effort**: ${phase.effort}
|
|
469
|
+
- **Gaps**: ${phase.gaps.length}
|
|
470
|
+
|
|
471
|
+
`;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
if (options.includeEvidence && checkResult.evidence.length > 0) {
|
|
475
|
+
report += `## Evidence Found
|
|
476
|
+
|
|
477
|
+
`;
|
|
478
|
+
for (const evidence of checkResult.evidence) {
|
|
479
|
+
report += `- **${evidence.requirementId}**: ${evidence.description}
|
|
480
|
+
- File: \`${evidence.filePath}\`
|
|
481
|
+
- Confidence: ${Math.round(evidence.confidence * 100)}%
|
|
482
|
+
`;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
report += `
|
|
486
|
+
## Recommendations
|
|
487
|
+
|
|
488
|
+
`;
|
|
489
|
+
if (gapResult.criticalGaps.length > 0) {
|
|
490
|
+
report += `1. **Address Critical Gaps Immediately**: ${gapResult.criticalGaps.length} critical gaps require immediate attention.
|
|
491
|
+
`;
|
|
492
|
+
}
|
|
493
|
+
if (gapResult.roadmap?.quickWins && gapResult.roadmap.quickWins.length > 0) {
|
|
494
|
+
report += `2. **Quick Wins**: ${gapResult.roadmap.quickWins.length} high-impact, low-effort improvements available.
|
|
495
|
+
`;
|
|
496
|
+
}
|
|
497
|
+
if (checkResult.overallScore < 50) {
|
|
498
|
+
report += `3. **Compliance Baseline**: Current score of ${checkResult.overallScore}% is below recommended baseline. Focus on foundational SOPs.
|
|
499
|
+
`;
|
|
500
|
+
}
|
|
501
|
+
report += `
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
*Report generated by Knowledge Graph Agent - AI-SDLC SOP Compliance Module*
|
|
505
|
+
`;
|
|
506
|
+
return report;
|
|
507
|
+
}
|
|
508
|
+
function generateHTMLReport(checkResult, gapResult, summary, options) {
|
|
509
|
+
return `<!DOCTYPE html>
|
|
510
|
+
<html lang="en">
|
|
511
|
+
<head>
|
|
512
|
+
<meta charset="UTF-8">
|
|
513
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
514
|
+
<title>AI-SDLC Compliance Report</title>
|
|
515
|
+
<style>
|
|
516
|
+
body { font-family: system-ui, sans-serif; max-width: 1200px; margin: 0 auto; padding: 2rem; }
|
|
517
|
+
.score { font-size: 3rem; font-weight: bold; }
|
|
518
|
+
.score.high { color: #22c55e; }
|
|
519
|
+
.score.medium { color: #f59e0b; }
|
|
520
|
+
.score.low { color: #ef4444; }
|
|
521
|
+
.card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 1rem; margin: 1rem 0; }
|
|
522
|
+
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
|
|
523
|
+
table { width: 100%; border-collapse: collapse; }
|
|
524
|
+
th, td { border: 1px solid #e5e7eb; padding: 0.5rem; text-align: left; }
|
|
525
|
+
th { background: #f9fafb; }
|
|
526
|
+
.badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.875rem; }
|
|
527
|
+
.badge.critical { background: #fef2f2; color: #b91c1c; }
|
|
528
|
+
.badge.high { background: #fff7ed; color: #c2410c; }
|
|
529
|
+
.badge.medium { background: #fefce8; color: #a16207; }
|
|
530
|
+
.badge.low { background: #f0fdf4; color: #15803d; }
|
|
531
|
+
</style>
|
|
532
|
+
</head>
|
|
533
|
+
<body>
|
|
534
|
+
<h1>AI-SDLC Compliance Report</h1>
|
|
535
|
+
<p><strong>Project:</strong> ${checkResult.projectName}</p>
|
|
536
|
+
<p><strong>Generated:</strong> ${checkResult.checkedAt.toISOString()}</p>
|
|
537
|
+
|
|
538
|
+
<div class="grid">
|
|
539
|
+
<div class="card">
|
|
540
|
+
<h3>Overall Score</h3>
|
|
541
|
+
<div class="score ${checkResult.overallScore >= 70 ? "high" : checkResult.overallScore >= 50 ? "medium" : "low"}">
|
|
542
|
+
${checkResult.overallScore}%
|
|
543
|
+
</div>
|
|
544
|
+
</div>
|
|
545
|
+
<div class="card">
|
|
546
|
+
<h3>Compliance Status</h3>
|
|
547
|
+
<p>✅ Compliant: ${summary.compliant}</p>
|
|
548
|
+
<p>🟡 Partial: ${summary.partial}</p>
|
|
549
|
+
<p>❌ Non-compliant: ${summary.nonCompliant}</p>
|
|
550
|
+
</div>
|
|
551
|
+
<div class="card">
|
|
552
|
+
<h3>Gap Summary</h3>
|
|
553
|
+
<p>Total Gaps: ${gapResult.totalGaps}</p>
|
|
554
|
+
<p>Critical: ${gapResult.criticalGaps.length}</p>
|
|
555
|
+
<p>Complexity: ${gapResult.summary.overallComplexity}</p>
|
|
556
|
+
</div>
|
|
557
|
+
</div>
|
|
558
|
+
|
|
559
|
+
<h2>Category Scores</h2>
|
|
560
|
+
<table>
|
|
561
|
+
<tr><th>Category</th><th>Score</th></tr>
|
|
562
|
+
${Object.entries(checkResult.categoryScores).filter(([, score]) => score > 0).map(([cat, score]) => `<tr><td>${formatCategory(cat)}</td><td>${score}%</td></tr>`).join("")}
|
|
563
|
+
</table>
|
|
564
|
+
|
|
565
|
+
<h2>Gaps by Priority</h2>
|
|
566
|
+
<table>
|
|
567
|
+
<tr><th>Priority</th><th>Count</th></tr>
|
|
568
|
+
<tr><td><span class="badge critical">Critical</span></td><td>${gapResult.byPriority[SOPPriority.CRITICAL].length}</td></tr>
|
|
569
|
+
<tr><td><span class="badge high">High</span></td><td>${gapResult.byPriority[SOPPriority.HIGH].length}</td></tr>
|
|
570
|
+
<tr><td><span class="badge medium">Medium</span></td><td>${gapResult.byPriority[SOPPriority.MEDIUM].length}</td></tr>
|
|
571
|
+
<tr><td><span class="badge low">Low</span></td><td>${gapResult.byPriority[SOPPriority.LOW].length}</td></tr>
|
|
572
|
+
</table>
|
|
573
|
+
|
|
574
|
+
${gapResult.criticalGaps.length > 0 ? `
|
|
575
|
+
<h2>Critical Gaps</h2>
|
|
576
|
+
${gapResult.criticalGaps.map((gap) => {
|
|
577
|
+
const sop = getSOPById(gap.sopId);
|
|
578
|
+
return `
|
|
579
|
+
<div class="card">
|
|
580
|
+
<h3>${sop?.title || gap.sopId}</h3>
|
|
581
|
+
<p><strong>Gap ID:</strong> ${gap.id}</p>
|
|
582
|
+
<p><strong>Impact:</strong> ${gap.impact}</p>
|
|
583
|
+
<p><strong>Remediation:</strong> ${gap.remediation}</p>
|
|
584
|
+
</div>
|
|
585
|
+
`;
|
|
586
|
+
}).join("")}
|
|
587
|
+
` : ""}
|
|
588
|
+
|
|
589
|
+
<footer style="margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; color: #6b7280;">
|
|
590
|
+
<p>Generated by Knowledge Graph Agent - AI-SDLC SOP Compliance Module</p>
|
|
591
|
+
</footer>
|
|
592
|
+
</body>
|
|
593
|
+
</html>`;
|
|
594
|
+
}
|
|
595
|
+
export {
|
|
596
|
+
createSOPCommands
|
|
597
|
+
};
|
|
598
|
+
//# sourceMappingURL=sop.js.map
|