@documentation-robotics/cli 0.1.0 → 0.1.7
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 +466 -693
- package/dist/analysis/data-model-analyzer.js +189 -0
- package/dist/analysis/data-model-analyzer.js.map +7 -0
- package/dist/analysis/index.js +3 -0
- package/dist/analysis/index.js.map +7 -0
- package/dist/analysis/relationship-classifier.js +181 -0
- package/dist/analysis/relationship-classifier.js.map +7 -0
- package/dist/analyzers/base-analyzer.js +1 -0
- package/dist/analyzers/base-analyzer.js.map +7 -0
- package/dist/analyzers/call-graph-utils.js +39 -0
- package/dist/analyzers/call-graph-utils.js.map +7 -0
- package/dist/analyzers/cbm-analyzer.js +1205 -0
- package/dist/analyzers/cbm-analyzer.js.map +7 -0
- package/dist/analyzers/heuristic-utils.js +55 -0
- package/dist/analyzers/heuristic-utils.js.map +7 -0
- package/dist/analyzers/mapping-loader.js +146 -0
- package/dist/analyzers/mapping-loader.js.map +7 -0
- package/dist/analyzers/registry.js +124 -0
- package/dist/analyzers/registry.js.map +7 -0
- package/dist/analyzers/session-state.js +176 -0
- package/dist/analyzers/session-state.js.map +7 -0
- package/dist/analyzers/stdio-client.js +208 -0
- package/dist/analyzers/stdio-client.js.map +7 -0
- package/dist/analyzers/types.js +15 -0
- package/dist/analyzers/types.js.map +7 -0
- package/dist/analyzers/verify-engine.js +209 -0
- package/dist/analyzers/verify-engine.js.map +7 -0
- package/dist/analyzers/verify-ignore.js +130 -0
- package/dist/analyzers/verify-ignore.js.map +7 -0
- package/dist/analyzers/version.js +8 -0
- package/dist/analyzers/version.js.map +7 -0
- package/dist/audit/ai/runner.js +41 -0
- package/dist/audit/ai/runner.js.map +7 -0
- package/dist/audit/differential-analyzer.js +183 -0
- package/dist/audit/differential-analyzer.js.map +7 -0
- package/dist/audit/index.js +32 -0
- package/dist/audit/index.js.map +7 -0
- package/dist/audit/nodes/ai/evaluator.js +49 -0
- package/dist/audit/nodes/ai/evaluator.js.map +7 -0
- package/dist/audit/nodes/ai/parser.js +55 -0
- package/dist/audit/nodes/ai/parser.js.map +7 -0
- package/dist/audit/nodes/ai/prompts.js +103 -0
- package/dist/audit/nodes/ai/prompts.js.map +7 -0
- package/dist/audit/nodes/analysis/node-completeness-checker.js +32 -0
- package/dist/audit/nodes/analysis/node-completeness-checker.js.map +7 -0
- package/dist/audit/nodes/analysis/node-definition-analyzer.js +47 -0
- package/dist/audit/nodes/analysis/node-definition-analyzer.js.map +7 -0
- package/dist/audit/nodes/analysis/node-overlap-detector.js +79 -0
- package/dist/audit/nodes/analysis/node-overlap-detector.js.map +7 -0
- package/dist/audit/nodes/model/orchestrator.js +82 -0
- package/dist/audit/nodes/model/orchestrator.js.map +7 -0
- package/dist/audit/nodes/spec/loader.js +116 -0
- package/dist/audit/nodes/spec/loader.js.map +7 -0
- package/dist/audit/nodes/spec/orchestrator.js +68 -0
- package/dist/audit/nodes/spec/orchestrator.js.map +7 -0
- package/dist/audit/nodes/types.js +1 -0
- package/dist/audit/nodes/types.js.map +7 -0
- package/dist/audit/pipeline/index.js +5 -0
- package/dist/audit/pipeline/index.js.map +7 -0
- package/dist/audit/pipeline/pipeline-orchestrator.js +218 -0
- package/dist/audit/pipeline/pipeline-orchestrator.js.map +7 -0
- package/dist/audit/relationships/ai/evaluator.js +235 -0
- package/dist/audit/relationships/ai/evaluator.js.map +7 -0
- package/dist/audit/relationships/ai/parser.js +197 -0
- package/dist/audit/relationships/ai/parser.js.map +7 -0
- package/dist/audit/relationships/ai/prompts.js +274 -0
- package/dist/audit/relationships/ai/prompts.js.map +7 -0
- package/dist/audit/relationships/analysis/balance-assessor.js +115 -0
- package/dist/audit/relationships/analysis/balance-assessor.js.map +7 -0
- package/dist/audit/relationships/analysis/coverage-analyzer.js +99 -0
- package/dist/audit/relationships/analysis/coverage-analyzer.js.map +7 -0
- package/dist/audit/relationships/analysis/duplicate-detector.js +95 -0
- package/dist/audit/relationships/analysis/duplicate-detector.js.map +7 -0
- package/dist/audit/relationships/analysis/gap-analyzer.js +99 -0
- package/dist/audit/relationships/analysis/gap-analyzer.js.map +7 -0
- package/dist/audit/relationships/analysis/layer-templates.js +294 -0
- package/dist/audit/relationships/analysis/layer-templates.js.map +7 -0
- package/dist/audit/relationships/graph/connectivity.js +129 -0
- package/dist/audit/relationships/graph/connectivity.js.map +7 -0
- package/dist/audit/relationships/graph/relationship-graph.js +179 -0
- package/dist/audit/relationships/graph/relationship-graph.js.map +7 -0
- package/dist/audit/relationships/model/balance-assessor.js +49 -0
- package/dist/audit/relationships/model/balance-assessor.js.map +7 -0
- package/dist/audit/relationships/model/coverage-analyzer.js +34 -0
- package/dist/audit/relationships/model/coverage-analyzer.js.map +7 -0
- package/dist/audit/relationships/model/duplicate-detector.js +68 -0
- package/dist/audit/relationships/model/duplicate-detector.js.map +7 -0
- package/dist/audit/relationships/model/gap-analyzer.js +41 -0
- package/dist/audit/relationships/model/gap-analyzer.js.map +7 -0
- package/dist/audit/relationships/model/orchestrator.js +126 -0
- package/dist/audit/relationships/model/orchestrator.js.map +7 -0
- package/dist/audit/relationships/spec/orchestrator.js +157 -0
- package/dist/audit/relationships/spec/orchestrator.js.map +7 -0
- package/dist/audit/reports/index.js +5 -0
- package/dist/audit/reports/index.js.map +7 -0
- package/dist/audit/reports/report-generator.js +118 -0
- package/dist/audit/reports/report-generator.js.map +7 -0
- package/dist/audit/snapshot-storage.js +163 -0
- package/dist/audit/snapshot-storage.js.map +7 -0
- package/dist/audit/types.js +21 -0
- package/dist/audit/types.js.map +7 -0
- package/dist/cli.js +223 -92
- package/dist/cli.js.map +3 -3
- package/dist/coding-agents/agents/claude-code.js +147 -0
- package/dist/coding-agents/agents/claude-code.js.map +7 -0
- package/dist/coding-agents/agents/index.js +5 -0
- package/dist/coding-agents/agents/index.js.map +7 -0
- package/dist/coding-agents/agents/types.js +1 -0
- package/dist/coding-agents/agents/types.js.map +7 -0
- package/dist/coding-agents/base-chat-client.js +45 -0
- package/dist/coding-agents/base-chat-client.js.map +7 -0
- package/dist/coding-agents/chat-utils.js +23 -0
- package/dist/coding-agents/chat-utils.js.map +7 -0
- package/dist/coding-agents/claude-code-client.js +246 -0
- package/dist/coding-agents/claude-code-client.js.map +7 -0
- package/dist/coding-agents/copilot-client.js +209 -0
- package/dist/coding-agents/copilot-client.js.map +7 -0
- package/dist/commands/add.js +95 -33
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +511 -0
- package/dist/commands/analyzer.js.map +7 -0
- package/dist/commands/audit-diff.js +49 -0
- package/dist/commands/audit-diff.js.map +7 -0
- package/dist/commands/audit-snapshots.js +62 -0
- package/dist/commands/audit-snapshots.js.map +7 -0
- package/dist/commands/audit.js +81 -0
- package/dist/commands/audit.js.map +7 -0
- package/dist/commands/catalog.js +248 -0
- package/dist/commands/catalog.js.map +7 -0
- package/dist/commands/changeset.js +577 -66
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/chat.js +106 -83
- package/dist/commands/chat.js.map +2 -2
- package/dist/commands/claude.js +74 -0
- package/dist/commands/claude.js.map +7 -0
- package/dist/commands/conformance.js +71 -68
- package/dist/commands/conformance.js.map +2 -2
- package/dist/commands/copilot.js +75 -0
- package/dist/commands/copilot.js.map +7 -0
- package/dist/commands/delete.js +125 -11
- package/dist/commands/delete.js.map +3 -3
- package/dist/commands/discover-logic.js +44 -0
- package/dist/commands/discover-logic.js.map +7 -0
- package/dist/commands/docs.js +87 -0
- package/dist/commands/docs.js.map +7 -0
- package/dist/commands/element.js +14 -20
- package/dist/commands/element.js.map +2 -2
- package/dist/commands/export.js +13 -3
- package/dist/commands/export.js.map +2 -2
- package/dist/commands/import.js +51 -0
- package/dist/commands/import.js.map +7 -0
- package/dist/commands/info.js +30 -24
- package/dist/commands/info.js.map +2 -2
- package/dist/commands/init.js +27 -11
- package/dist/commands/init.js.map +2 -2
- package/dist/commands/list.js +63 -13
- package/dist/commands/list.js.map +3 -3
- package/dist/commands/relationship.js +225 -37
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/report.js +54 -0
- package/dist/commands/report.js.map +7 -0
- package/dist/commands/reports.js +45 -0
- package/dist/commands/reports.js.map +7 -0
- package/dist/commands/schema.js +135 -0
- package/dist/commands/schema.js.map +7 -0
- package/dist/commands/search.js +40 -12
- package/dist/commands/search.js.map +2 -2
- package/dist/commands/show.js +58 -27
- package/dist/commands/show.js.map +2 -2
- package/dist/commands/stats.js +35 -0
- package/dist/commands/stats.js.map +7 -0
- package/dist/commands/trace.js +39 -16
- package/dist/commands/trace.js.map +2 -2
- package/dist/commands/update.js +141 -14
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/upgrade.js +210 -46
- package/dist/commands/upgrade.js.map +3 -3
- package/dist/commands/validate.js +142 -23
- package/dist/commands/validate.js.map +3 -3
- package/dist/commands/version.js +8 -12
- package/dist/commands/version.js.map +2 -2
- package/dist/commands/visualize.js +162 -25
- package/dist/commands/visualize.js.map +2 -2
- package/dist/core/base-snapshot-manager.js +84 -0
- package/dist/core/base-snapshot-manager.js.map +7 -0
- package/dist/core/changeset-exporter.js +305 -0
- package/dist/core/changeset-exporter.js.map +7 -0
- package/dist/core/changeset-validator.js +41 -0
- package/dist/core/changeset-validator.js.map +7 -0
- package/dist/core/changeset.js +88 -173
- package/dist/core/changeset.js.map +2 -2
- package/dist/core/dependency-tracker.js +4 -2
- package/dist/core/dependency-tracker.js.map +2 -2
- package/dist/core/element.js +98 -27
- package/dist/core/element.js.map +2 -2
- package/dist/core/golden-copy-cache.js +290 -0
- package/dist/core/golden-copy-cache.js.map +7 -0
- package/dist/core/graph-model.js +266 -0
- package/dist/core/graph-model.js.map +7 -0
- package/dist/core/layer.js +159 -16
- package/dist/core/layer.js.map +2 -2
- package/dist/core/layers.js +32 -0
- package/dist/core/layers.js.map +7 -0
- package/dist/core/manifest.js +32 -11
- package/dist/core/manifest.js.map +2 -2
- package/dist/core/migration-registry.js +56 -1
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model.js +424 -217
- package/dist/core/model.js.map +3 -3
- package/dist/core/mutation-handler.js +179 -0
- package/dist/core/mutation-handler.js.map +7 -0
- package/dist/core/reference-registry.js +29 -21
- package/dist/core/reference-registry.js.map +2 -2
- package/dist/core/relationship-catalog.js +189 -0
- package/dist/core/relationship-catalog.js.map +7 -0
- package/dist/core/relationship-registry.js.map +2 -2
- package/dist/core/relationships.js.map +1 -1
- package/dist/core/report-data-model.js +285 -0
- package/dist/core/report-data-model.js.map +7 -0
- package/dist/core/spec-data-service.js +185 -0
- package/dist/core/spec-data-service.js.map +7 -0
- package/dist/core/spec-loader-types.js +1 -0
- package/dist/core/spec-loader-types.js.map +7 -0
- package/dist/core/spec-loader.js +234 -0
- package/dist/core/spec-loader.js.map +7 -0
- package/dist/core/staged-changeset-storage.js +282 -0
- package/dist/core/staged-changeset-storage.js.map +7 -0
- package/dist/core/staging-area.js +1002 -0
- package/dist/core/staging-area.js.map +7 -0
- package/dist/core/stats-collector.js +169 -0
- package/dist/core/stats-collector.js.map +7 -0
- package/dist/core/virtual-projection.js +443 -0
- package/dist/core/virtual-projection.js.map +7 -0
- package/dist/export/archimate-exporter.js +99 -60
- package/dist/export/archimate-exporter.js.map +2 -2
- package/dist/export/audit-formatters.js +479 -0
- package/dist/export/audit-formatters.js.map +7 -0
- package/dist/export/diff-formatters.js +99 -0
- package/dist/export/diff-formatters.js.map +7 -0
- package/dist/export/export-manager.js.map +2 -2
- package/dist/export/graphml-exporter.js +44 -27
- package/dist/export/graphml-exporter.js.map +2 -2
- package/dist/export/index.js +4 -0
- package/dist/export/index.js.map +2 -2
- package/dist/export/json-schema-exporter.js +55 -42
- package/dist/export/json-schema-exporter.js.map +2 -2
- package/dist/export/markdown-exporter.js +92 -70
- package/dist/export/markdown-exporter.js.map +2 -2
- package/dist/export/markdown-generator.js +248 -0
- package/dist/export/markdown-generator.js.map +7 -0
- package/dist/export/markdown-utils.js +30 -0
- package/dist/export/markdown-utils.js.map +7 -0
- package/dist/export/mermaid-markdown-exporter.js +37 -0
- package/dist/export/mermaid-markdown-exporter.js.map +7 -0
- package/dist/export/openapi-exporter.js +119 -71
- package/dist/export/openapi-exporter.js.map +2 -2
- package/dist/export/plantuml-exporter.js +104 -39
- package/dist/export/plantuml-exporter.js.map +2 -2
- package/dist/export/report-formatters.js +111 -0
- package/dist/export/report-formatters.js.map +7 -0
- package/dist/export/stats-formatters.js +98 -0
- package/dist/export/stats-formatters.js.map +7 -0
- package/dist/export/types.js +2 -14
- package/dist/export/types.js.map +2 -2
- package/dist/export/verify-formatters.js +153 -0
- package/dist/export/verify-formatters.js.map +7 -0
- package/dist/generated/compiled-validators.js +17 -0
- package/dist/generated/compiled-validators.js.map +7 -0
- package/dist/generated/index.js +31 -0
- package/dist/generated/index.js.map +7 -0
- package/dist/generated/layer-registry.js +190 -0
- package/dist/generated/layer-registry.js.map +7 -0
- package/dist/generated/layer-types.js +7 -0
- package/dist/generated/layer-types.js.map +7 -0
- package/dist/generated/node-types.js +1719 -0
- package/dist/generated/node-types.js.map +7 -0
- package/dist/generated/relationship-index.js +14552 -0
- package/dist/generated/relationship-index.js.map +7 -0
- package/dist/import/archimate-importer.js +166 -0
- package/dist/import/archimate-importer.js.map +7 -0
- package/dist/import/index.js +47 -0
- package/dist/import/index.js.map +7 -0
- package/dist/import/openapi-importer.js +143 -0
- package/dist/import/openapi-importer.js.map +7 -0
- package/dist/import/types.js +1 -0
- package/dist/import/types.js.map +7 -0
- package/dist/integrations/base-manager.js +311 -0
- package/dist/integrations/base-manager.js.map +7 -0
- package/dist/integrations/claude-manager.js +360 -0
- package/dist/integrations/claude-manager.js.map +7 -0
- package/dist/integrations/claude_code/agents/dr-advisor.md +253 -0
- package/dist/integrations/claude_code/agents/dr-architect.md +278 -0
- package/dist/integrations/claude_code/agents/dr-extractor.md +286 -0
- package/dist/integrations/claude_code/commands/dr-changeset.md +657 -0
- package/dist/integrations/claude_code/commands/dr-design.md +373 -0
- package/dist/integrations/claude_code/commands/dr-info.md +132 -0
- package/dist/integrations/claude_code/commands/dr-init.md +251 -0
- package/dist/integrations/claude_code/commands/dr-map.md +936 -0
- package/dist/integrations/claude_code/commands/dr-model.md +493 -0
- package/dist/integrations/claude_code/commands/dr-relate.md +814 -0
- package/dist/integrations/claude_code/commands/dr-sync.md +279 -0
- package/dist/integrations/claude_code/commands/dr-validate.md +654 -0
- package/dist/integrations/claude_code/commands/dr-verify.md +559 -0
- package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +903 -0
- package/dist/integrations/claude_code/docs/QUICK_START.md +271 -0
- package/dist/integrations/claude_code/docs/README.md +347 -0
- package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +550 -0
- package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +620 -0
- package/dist/integrations/claude_code/skills/dr_03_security_layer/SKILL.md +642 -0
- package/dist/integrations/claude_code/skills/dr_04_application_layer/SKILL.md +911 -0
- package/dist/integrations/claude_code/skills/dr_05_technology_layer/SKILL.md +836 -0
- package/dist/integrations/claude_code/skills/dr_06_api_layer/SKILL.md +933 -0
- package/dist/integrations/claude_code/skills/dr_07_data_model_layer/SKILL.md +210 -0
- package/dist/integrations/claude_code/skills/dr_08_dataset_layer/SKILL.md +319 -0
- package/dist/integrations/claude_code/skills/dr_09_ux_layer/SKILL.md +319 -0
- package/dist/integrations/claude_code/skills/dr_10_navigation_layer/SKILL.md +318 -0
- package/dist/integrations/claude_code/skills/dr_11_apm_layer/SKILL.md +273 -0
- package/dist/integrations/claude_code/skills/dr_12_testing_layer/SKILL.md +273 -0
- package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +187 -0
- package/dist/integrations/claude_code/skills/dr_codebase_memory/SKILL.md +590 -0
- package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +295 -0
- package/dist/integrations/copilot-manager.js +328 -0
- package/dist/integrations/copilot-manager.js.map +7 -0
- package/dist/integrations/github_copilot/agents/dr-advisor.md +243 -0
- package/dist/integrations/github_copilot/agents/dr-architect.md +1567 -0
- package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +491 -0
- package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +539 -0
- package/dist/integrations/github_copilot/skills/dr_03_security_layer/SKILL.md +667 -0
- package/dist/integrations/github_copilot/skills/dr_04_application_layer/SKILL.md +670 -0
- package/dist/integrations/github_copilot/skills/dr_05_technology_layer/SKILL.md +660 -0
- package/dist/integrations/github_copilot/skills/dr_06_api_layer/SKILL.md +855 -0
- package/dist/integrations/github_copilot/skills/dr_07_data_model_layer/SKILL.md +171 -0
- package/dist/integrations/github_copilot/skills/dr_08_dataset_layer/SKILL.md +216 -0
- package/dist/integrations/github_copilot/skills/dr_09_ux_layer/SKILL.md +230 -0
- package/dist/integrations/github_copilot/skills/dr_10_navigation_layer/SKILL.md +228 -0
- package/dist/integrations/github_copilot/skills/dr_11_apm_layer/SKILL.md +234 -0
- package/dist/integrations/github_copilot/skills/dr_12_testing_layer/SKILL.md +230 -0
- package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +187 -0
- package/dist/integrations/hash-utils.js +51 -0
- package/dist/integrations/hash-utils.js.map +7 -0
- package/dist/integrations/types.js +16 -0
- package/dist/integrations/types.js.map +7 -0
- package/dist/reports/model-layer-report-generator.js +278 -0
- package/dist/reports/model-layer-report-generator.js.map +7 -0
- package/dist/reports/model-report-data.js +57 -0
- package/dist/reports/model-report-data.js.map +7 -0
- package/dist/reports/model-report-orchestrator.js +103 -0
- package/dist/reports/model-report-orchestrator.js.map +7 -0
- package/dist/schemas/bundled/analyzers/cbm.json +595 -0
- package/dist/schemas/bundled/analyzers/manifest.json +9 -0
- package/dist/schemas/bundled/api.json +3411 -0
- package/dist/schemas/bundled/apm.json +2371 -0
- package/dist/schemas/bundled/application.json +1253 -0
- package/dist/schemas/bundled/base.json +1622 -0
- package/dist/schemas/bundled/business.json +1279 -0
- package/dist/schemas/bundled/data-model.json +1298 -0
- package/dist/schemas/bundled/data-store.json +2025 -0
- package/dist/schemas/bundled/manifest.json +93 -0
- package/dist/schemas/bundled/motivation.json +1360 -0
- package/dist/schemas/bundled/navigation.json +1874 -0
- package/dist/schemas/bundled/security.json +3488 -0
- package/dist/schemas/bundled/technology.json +2067 -0
- package/dist/schemas/bundled/testing.json +3120 -0
- package/dist/schemas/bundled/ux.json +3592 -0
- package/dist/server/schemas.js +202 -0
- package/dist/server/schemas.js.map +7 -0
- package/dist/server/server.js +1336 -252
- package/dist/server/server.js.map +3 -3
- package/dist/server/telemetry-middleware.js +22 -15
- package/dist/server/telemetry-middleware.js.map +2 -2
- package/dist/server-entry.js +65 -0
- package/dist/server-entry.js.map +7 -0
- package/dist/telemetry/config.js +89 -0
- package/dist/telemetry/config.js.map +7 -0
- package/dist/telemetry/console-interceptor.js.map +1 -1
- package/dist/telemetry/detect.js +24 -0
- package/dist/telemetry/detect.js.map +7 -0
- package/dist/telemetry/fetch-otlp-exporter.js +112 -0
- package/dist/telemetry/fetch-otlp-exporter.js.map +7 -0
- package/dist/telemetry/index.js +153 -3
- package/dist/telemetry/index.js.map +2 -2
- package/dist/telemetry/resilient-exporter.js +22 -8
- package/dist/telemetry/resilient-exporter.js.map +2 -2
- package/dist/telemetry/resilient-log-exporter.js +17 -8
- package/dist/telemetry/resilient-log-exporter.js.map +2 -2
- package/dist/telemetry/test-instrumentation.js.map +2 -2
- package/dist/types/index.js +84 -0
- package/dist/types/index.js.map +3 -3
- package/dist/types/source-reference.js +1 -0
- package/dist/types/source-reference.js.map +7 -0
- package/dist/utils/chat-logger.js +292 -0
- package/dist/utils/chat-logger.js.map +7 -0
- package/dist/utils/claude-stream.js +8 -0
- package/dist/utils/claude-stream.js.map +7 -0
- package/dist/utils/date-utils.js +7 -0
- package/dist/utils/date-utils.js.map +7 -0
- package/dist/utils/element-utils.js.map +1 -1
- package/dist/utils/errors.js +88 -15
- package/dist/utils/errors.js.map +3 -3
- package/dist/utils/export-python-annotations.js +82 -0
- package/dist/utils/export-python-annotations.js.map +7 -0
- package/dist/utils/file-io.js +7 -2
- package/dist/utils/file-io.js.map +2 -2
- package/dist/utils/file-lock.js +156 -0
- package/dist/utils/file-lock.js.map +7 -0
- package/dist/utils/id-generator.js +18 -0
- package/dist/utils/id-generator.js.map +7 -0
- package/dist/utils/layer-name-formatter.js +16 -0
- package/dist/utils/layer-name-formatter.js.map +7 -0
- package/dist/utils/markdown-anchor.js +7 -0
- package/dist/utils/markdown-anchor.js.map +7 -0
- package/dist/utils/markdown-link.js +12 -0
- package/dist/utils/markdown-link.js.map +7 -0
- package/dist/utils/markdown-table.js +17 -0
- package/dist/utils/markdown-table.js.map +7 -0
- package/dist/utils/mermaid-utils.js +11 -0
- package/dist/utils/mermaid-utils.js.map +7 -0
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/source-reference.js +52 -0
- package/dist/utils/source-reference.js.map +7 -0
- package/dist/utils/spec-installer.js +40 -53
- package/dist/utils/spec-installer.js.map +2 -2
- package/dist/utils/spec-version.js +5 -1
- package/dist/utils/spec-version.js.map +2 -2
- package/dist/utils/string-utils.js +12 -0
- package/dist/utils/string-utils.js.map +7 -0
- package/dist/utils/table-formatting.js +19 -0
- package/dist/utils/table-formatting.js.map +7 -0
- package/dist/validators/index.js +4 -0
- package/dist/validators/index.js.map +2 -2
- package/dist/validators/naming-validator.js +20 -23
- package/dist/validators/naming-validator.js.map +2 -2
- package/dist/validators/reference-validator.js +23 -38
- package/dist/validators/reference-validator.js.map +2 -2
- package/dist/validators/relationship-schema-validator.js +243 -0
- package/dist/validators/relationship-schema-validator.js.map +7 -0
- package/dist/validators/schema-validator.js +168 -68
- package/dist/validators/schema-validator.js.map +2 -2
- package/dist/validators/semantic-validator.js +36 -60
- package/dist/validators/semantic-validator.js.map +2 -2
- package/dist/validators/types.js.map +2 -2
- package/dist/validators/validation-formatter.js +159 -0
- package/dist/validators/validation-formatter.js.map +7 -0
- package/dist/validators/validator.js +24 -38
- package/dist/validators/validator.js.map +2 -2
- package/dist/viewer/README.md +139 -0
- package/dist/viewer/assets/main-CY0Xufuj.css +1 -0
- package/dist/viewer/assets/main-DtgErnwF.js +81 -0
- package/dist/viewer/assets/vendor-CxKvDp2x.js +17 -0
- package/dist/viewer/favicon.svg +11 -0
- package/dist/viewer/fonts/inter/Inter-Black.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Bold.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-ExtraBold.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Light.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Medium.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Regular.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-SemiBold.woff2 +0 -0
- package/dist/viewer/index.html +15 -0
- package/dist/viewer/manifest.json +99 -0
- package/dist/viewer/version.json +1 -0
- package/package.json +42 -16
- package/PYTHON_CLI_PARITY.md +0 -265
- package/PYTHON_CLI_STRUCTURE_UPDATE.md +0 -246
- package/biome.json +0 -42
- package/bunfig.toml +0 -3
- package/dist/ai/claude-client.js +0 -71
- package/dist/ai/claude-client.js.map +0 -7
- package/dist/ai/context-provider.js +0 -129
- package/dist/ai/context-provider.js.map +0 -7
- package/dist/ai/tools.js +0 -231
- package/dist/ai/tools.js.map +0 -7
- package/dist/commands/migrate.js +0 -36
- package/dist/commands/migrate.js.map +0 -7
- package/dist/commands/project.js +0 -74
- package/dist/commands/project.js.map +0 -7
- package/dist/core/active-changeset.js +0 -52
- package/dist/core/active-changeset.js.map +0 -7
- package/dist/core/projection-engine.js +0 -288
- package/dist/core/projection-engine.js.map +0 -7
- package/dist/schemas/bundled/01-motivation-layer.schema.json +0 -942
- package/dist/schemas/bundled/02-business-layer.schema.json +0 -1293
- package/dist/schemas/bundled/03-security-layer.schema.json +0 -2177
- package/dist/schemas/bundled/04-application-layer.schema.json +0 -1328
- package/dist/schemas/bundled/05-technology-layer.schema.json +0 -1465
- package/dist/schemas/bundled/06-api-layer.schema.json +0 -1743
- package/dist/schemas/bundled/07-data-model-layer.schema.json +0 -1253
- package/dist/schemas/bundled/08-datastore-layer.schema.json +0 -892
- package/dist/schemas/bundled/09-ux-layer.schema.json +0 -1506
- package/dist/schemas/bundled/10-navigation-layer.schema.json +0 -843
- package/dist/schemas/bundled/11-apm-observability-layer.schema.json +0 -1430
- package/dist/schemas/bundled/12-testing-layer.schema.json +0 -1091
- package/dist/schemas/bundled/common/layer-extensions.schema.json +0 -266
- package/dist/schemas/bundled/common/predicates.schema.json +0 -493
- package/dist/schemas/bundled/common/relationships.schema.json +0 -791
- package/dist/schemas/bundled/common/source-references.schema.json +0 -71
- package/dist/schemas/bundled/link-registry.json +0 -1839
- package/dist/schemas/bundled/link-registry.schema.json +0 -339
- package/dist/schemas/bundled/relationship-catalog.json +0 -1302
- package/dist/schemas/bundled/relationship-type.schema.json +0 -221
- package/dist/utils/model-path.js +0 -22
- package/dist/utils/model-path.js.map +0 -7
- package/docs/TEST-INSTRUMENTATION.md +0 -405
- package/docs/telemetry.md +0 -427
- package/test-debug.js +0 -33
- package/test-special.mjs +0 -46
- package/test_runner.ts +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/export/stats-formatters.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Output formatters for statistics\n * Supports text, JSON, and markdown output formats\n */\n\nimport ansis from \"ansis\";\nimport { ModelStats } from \"../core/stats-collector.js\";\nimport { getLayerById } from \"../generated/layer-registry.js\";\n\nexport type StatsFormat = \"text\" | \"json\" | \"markdown\" | \"compact\";\n\nexport interface FormatterOptions {\n format: StatsFormat;\n compact?: boolean;\n verbose?: boolean;\n}\n\n/**\n * Format statistics for output\n */\nexport function formatStats(stats: ModelStats, options: FormatterOptions): string {\n switch (options.format) {\n case \"json\":\n return formatJSON(stats);\n case \"markdown\":\n return formatMarkdown(stats);\n case \"compact\":\n return formatCompact(stats);\n case \"text\":\n default:\n return formatText(stats, options.verbose);\n }\n}\n\n/**\n * Format as plain text (default)\n */\nfunction formatText(stats: ModelStats, verbose?: boolean): string {\n const lines: string[] = [];\n\n // Header\n lines.push(\"\");\n lines.push(ansis.bold(`${ansis.cyan(stats.project.name)}`));\n lines.push(ansis.dim(\"=\".repeat(80)));\n lines.push(\"\");\n\n // Overview section\n lines.push(ansis.bold(\"Overview:\"));\n lines.push(` ${ansis.gray(\"Version:\")} ${stats.project.version}`);\n lines.push(` ${ansis.gray(\"Created:\")} ${formatDate(stats.project.created)}`);\n lines.push(` ${ansis.gray(\"Updated:\")} ${formatDate(stats.project.updated)}`);\n\n const statusIcon = stats.validation.isValid ? ansis.green(\"\u2713\") : ansis.red(\"\u2717\");\n const statusText = stats.validation.isValid ? \"Valid\" : \"Invalid\";\n lines.push(` ${ansis.gray(\"Status:\")} ${statusIcon} ${statusText}`);\n\n if (stats.validation.errors > 0) {\n lines.push(` ${ansis.gray(\"Errors:\")} ${ansis.red(stats.validation.errors)}`);\n }\n if (stats.validation.warnings > 0) {\n lines.push(` ${ansis.gray(\"Warnings:\")} ${ansis.yellow(stats.validation.warnings)}`);\n }\n\n // Elements by layer\n lines.push(\"\");\n lines.push(ansis.bold(\"Elements by Layer:\"));\n for (const layer of stats.layers) {\n const layerMetadata = getLayerById(layer.name);\n const layerNum = layerMetadata?.number ?? 0;\n const typeDetails = Object.entries(layer.elementsByType)\n .map(([type, count]) => `${count} ${type}${count > 1 ? \"s\" : \"\"}`)\n .join(\", \");\n\n const typeSummary = typeDetails ? ` (${typeDetails})` : \"\";\n lines.push(\n ` ${String(layerNum).padEnd(2)}. ${ansis.cyan(layer.name.padEnd(20))} ${String(layer.totalElements).padEnd(3)} elements${typeSummary}`\n );\n }\n\n // Summary stats\n lines.push(\"\");\n lines.push(\n ansis.bold(\n `Total: ${ansis.cyan(`${stats.statistics.totalElements} elements`)} across ${ansis.cyan(`${stats.statistics.totalLayers} layers`)}`\n )\n );\n\n // Relationships section\n if (stats.statistics.totalRelationships > 0) {\n lines.push(\"\");\n lines.push(ansis.bold(\"Cross-Layer Relationships:\"));\n\n const byPair = stats.relationships.byPair;\n const sortedPairs = Object.entries(byPair)\n .sort(([, a], [, b]) => b - a)\n .slice(0, 10);\n\n for (const [pair, count] of sortedPairs) {\n lines.push(` ${pair.padEnd(20)} ${String(count).padEnd(3)} relationships`);\n }\n\n lines.push(\"\");\n lines.push(\n ansis.bold(`Total Relationships: ${ansis.cyan(stats.statistics.totalRelationships)}`)\n );\n lines.push(` ${ansis.gray(\"Cross-layer:\")} ${stats.relationships.crossLayerCount}`);\n lines.push(` ${ansis.gray(\"Intra-layer:\")} ${stats.relationships.intraLayerCount}`);\n }\n\n // Completeness\n lines.push(\"\");\n lines.push(ansis.bold(\"Model Completeness:\"));\n const completenessBar = createCompletionBar(stats.completeness.overall);\n lines.push(` ${completenessBar} ${stats.completeness.overall}%`);\n\n // Layer coverage details\n lines.push(\"\");\n lines.push(ansis.bold(\"Layer Coverage:\"));\n for (const layer of stats.layers) {\n const icon =\n layer.coverage >= 75\n ? ansis.green(\"\u2713\")\n : layer.coverage >= 50\n ? ansis.yellow(\"\u25D0\")\n : ansis.red(\"\u2717\");\n lines.push(\n ` ${icon} ${ansis.cyan(layer.name.padEnd(18))} ${String(layer.coverage).padEnd(3)}% (${layer.totalElements} elements)`\n );\n }\n\n // Quality metrics\n if (verbose || stats.orphanedElements.length > 0) {\n lines.push(\"\");\n lines.push(ansis.bold(\"Quality Metrics:\"));\n\n if (stats.orphanedElements.length === 0) {\n lines.push(` ${ansis.green(\"\u2713\")} No orphaned elements`);\n } else {\n lines.push(\n ` ${ansis.yellow(`\u26A0`)} ${stats.orphanedElements.length} orphaned element${stats.orphanedElements.length > 1 ? \"s\" : \"\"}`\n );\n if (verbose) {\n for (const orphan of stats.orphanedElements.slice(0, 5)) {\n lines.push(` - ${orphan}`);\n }\n if (stats.orphanedElements.length > 5) {\n lines.push(` ... and ${stats.orphanedElements.length - 5} more`);\n }\n }\n }\n }\n\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Format as JSON\n */\nfunction formatJSON(stats: ModelStats): string {\n return JSON.stringify(stats, null, 2) + \"\\n\";\n}\n\n/**\n * Format as Markdown\n */\nfunction formatMarkdown(stats: ModelStats): string {\n const lines: string[] = [];\n\n // Header\n lines.push(`# ${stats.project.name} - Architecture Statistics`);\n lines.push(\"\");\n\n // Overview\n lines.push(\"## Overview\");\n lines.push(\"\");\n lines.push(`| Metric | Value |`);\n lines.push(`|--------|-------|`);\n lines.push(`| Version | ${stats.project.version} |`);\n lines.push(`| Created | ${formatDate(stats.project.created)} |`);\n lines.push(`| Updated | ${formatDate(stats.project.updated)} |`);\n lines.push(`| Status | ${stats.validation.isValid ? \"\u2713 Valid\" : \"\u2717 Invalid\"} |`);\n lines.push(`| Total Elements | ${stats.statistics.totalElements} |`);\n lines.push(`| Total Relationships | ${stats.statistics.totalRelationships} |`);\n lines.push(`| Completeness | ${stats.completeness.overall}% |`);\n lines.push(\"\");\n\n // Elements by layer\n lines.push(\"## Elements by Layer\");\n lines.push(\"\");\n lines.push(`| Layer | Elements | Types |`);\n lines.push(`|-------|----------|-------|`);\n\n for (const layer of stats.layers) {\n const typeList = Object.entries(layer.elementsByType)\n .map(([type, count]) => `${type}: ${count}`)\n .join(\", \");\n lines.push(`| ${layer.name} | ${layer.totalElements} | ${typeList} |`);\n }\n lines.push(\"\");\n\n // Relationships\n if (stats.statistics.totalRelationships > 0) {\n lines.push(\"## Relationships\");\n lines.push(\"\");\n lines.push(`| Type | Count |`);\n lines.push(`|------|-------|`);\n lines.push(`| Total | ${stats.statistics.totalRelationships} |`);\n lines.push(`| Cross-layer | ${stats.relationships.crossLayerCount} |`);\n lines.push(`| Intra-layer | ${stats.relationships.intraLayerCount} |`);\n lines.push(\"\");\n\n lines.push(\"### By Predicate\");\n lines.push(\"\");\n lines.push(`| Predicate | Count |`);\n lines.push(`|-----------|-------|`);\n for (const [predicate, count] of Object.entries(stats.relationships.byPredicate)) {\n lines.push(`| ${predicate} | ${count} |`);\n }\n lines.push(\"\");\n }\n\n // Completeness\n lines.push(\"## Completeness\");\n lines.push(\"\");\n lines.push(`Overall: **${stats.completeness.overall}%**`);\n lines.push(\"\");\n\n lines.push(\"### By Layer\");\n lines.push(\"\");\n lines.push(`| Layer | Coverage |`);\n lines.push(`|-------|----------|`);\n for (const [layer, coverage] of Object.entries(stats.completeness.byLayer)) {\n lines.push(`| ${layer} | ${coverage}% |`);\n }\n lines.push(\"\");\n\n // Quality\n lines.push(\"## Quality\");\n lines.push(\"\");\n if (stats.orphanedElements.length === 0) {\n lines.push(\"- \u2713 No orphaned elements\");\n } else {\n lines.push(\n `- \u26A0 ${stats.orphanedElements.length} orphaned element${stats.orphanedElements.length > 1 ? \"s\" : \"\"}`\n );\n }\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Format as compact single-line summary\n */\nfunction formatCompact(stats: ModelStats): string {\n const statusIcon = stats.validation.isValid ? \"\u2713\" : \"\u2717\";\n return `${stats.project.name}: ${stats.statistics.totalElements} elements, ${stats.statistics.totalRelationships} relationships, ${stats.statistics.totalLayers} layers | Status: ${statusIcon} ${stats.validation.isValid ? \"Valid\" : \"Invalid\"} | Completeness: ${stats.completeness.overall}% | Updated: ${formatDate(stats.project.updated)}`;\n}\n\n/**\n * Create a completion bar for display\n */\nfunction createCompletionBar(percentage: number, width: number = 40): string {\n const filled = Math.round((percentage / 100) * width);\n const empty = width - filled;\n const bar = \"\u2588\".repeat(filled) + \"\u2591\".repeat(empty);\n\n if (percentage >= 75) {\n return ansis.green(bar);\n } else if (percentage >= 50) {\n return ansis.yellow(bar);\n } else {\n return ansis.red(bar);\n }\n}\n\n/**\n * Format a date string nicely\n */\nfunction formatDate(dateString: string): string {\n try {\n const date = new Date(dateString);\n return date.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n } catch {\n return dateString;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,OAAO,WAAW;AAElB,SAAS,oBAAoB;AAavB,SAAU,YAAY,OAAmB,SAAyB;AACtE,UAAQ,QAAQ,QAAQ;IACtB,KAAK;AACH,aAAO,WAAW,KAAK;IACzB,KAAK;AACH,aAAO,eAAe,KAAK;IAC7B,KAAK;AACH,aAAO,cAAc,KAAK;IAC5B,KAAK;IACL;AACE,aAAO,WAAW,OAAO,QAAQ,OAAO;EAC5C;AACF;AAKA,SAAS,WAAW,OAAmB,SAAiB;AACtD,QAAM,QAAkB,CAAA;AAGxB,QAAM,KAAK,EAAE,GACb,MAAM,KAAK,MAAM,KAAK,GAAG,MAAM,KAAK,MAAM,QAAQ,IAAI,CAAC,EAAE,CAAC,GAC1D,MAAM,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC,GACpC,MAAM,KAAK,EAAE,GAGb,MAAM,KAAK,MAAM,KAAK,WAAW,CAAC,GAClC,MAAM,KAAK,KAAK,MAAM,KAAK,UAAU,CAAC,YAAY,MAAM,QAAQ,OAAO,EAAE,GACzE,MAAM,KAAK,KAAK,MAAM,KAAK,UAAU,CAAC,YAAY,WAAW,MAAM,QAAQ,OAAO,CAAC,EAAE,GACrF,MAAM,KAAK,KAAK,MAAM,KAAK,UAAU,CAAC,YAAY,WAAW,MAAM,QAAQ,OAAO,CAAC,EAAE;AAErF,QAAM,aAAa,MAAM,WAAW,UAAU,MAAM,MAAM,QAAG,IAAI,MAAM,IAAI,QAAG,GACxE,aAAa,MAAM,WAAW,UAAU,UAAU;AACxD,QAAM,KAAK,KAAK,MAAM,KAAK,SAAS,CAAC,a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AM,KAAK,+BAA0B,IAErC,MAAM,KACJ,YAAO,MAAM,iBAAiB,MAAM,oBAAoB,MAAM,iBAAiB,SAAS,IAAI,MAAM,EAAE,EAAE,GAG1G,MAAM,KAAK,EAAE,GAEN,MAAM,KAAK;CAAI;AACxB;AAKA,SAAS,cAAc,OAAiB;AACtC,QAAM,aAAa,MAAM,WAAW,UAAU,WAAM;AACpD,SAAO,GAAG,MAAM,QAAQ,IAAI,KAAK,MAAM,WAAW,aAAa,cAAc,MAAM,WAAW,kBAAkB,mBAAmB,MAAM,WAAW,WAAW,qBAAqB,UAAU,IAAI,MAAM,WAAW,UAAU,UAAU,SAAS,oBAAoB,MAAM,aAAa,OAAO,gBAAgB,WAAW,MAAM,QAAQ,OAAO,CAAC;AACjV;AAKA,SAAS,oBAAoB,YAAoB,QAAgB,IAAE;AACjE,QAAM,SAAS,KAAK,MAAO,aAAa,MAAO,KAAK,GAC9C,QAAQ,QAAQ,QAChB,MAAM,SAAI,OAAO,MAAM,IAAI,SAAI,OAAO,KAAK;AAEjD,SAAI,cAAc,KACT,MAAM,MAAM,GAAG,IACb,cAAc,KAChB,MAAM,OAAO,GAAG,IAEhB,MAAM,IAAI,GAAG;AAExB;AAKA,SAAS,WAAW,YAAkB;AACpC,MAAI;AAEF,WADa,IAAI,KAAK,UAAU,EACpB,mBAAmB,SAAS;MACtC,MAAM;MACN,OAAO;MACP,KAAK;MACL,MAAM;MACN,QAAQ;KACT;EACH,QAAQ;AACN,WAAO;EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/export/types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAllLayerIds } from "../generated/layer-registry.js";
|
|
1
2
|
const LAYER_COLORS = {
|
|
2
3
|
motivation: "FFE4E1",
|
|
3
4
|
business: "E6F3FF",
|
|
@@ -11,20 +12,7 @@ const LAYER_COLORS = {
|
|
|
11
12
|
navigation: "CCFFCC",
|
|
12
13
|
apm: "CCFFFF",
|
|
13
14
|
testing: "FFCCFF"
|
|
14
|
-
}, ALL_LAYERS =
|
|
15
|
-
"motivation",
|
|
16
|
-
"business",
|
|
17
|
-
"security",
|
|
18
|
-
"application",
|
|
19
|
-
"technology",
|
|
20
|
-
"api",
|
|
21
|
-
"data-model",
|
|
22
|
-
"data-store",
|
|
23
|
-
"ux",
|
|
24
|
-
"navigation",
|
|
25
|
-
"apm",
|
|
26
|
-
"testing"
|
|
27
|
-
];
|
|
15
|
+
}, ALL_LAYERS = getAllLayerIds();
|
|
28
16
|
function escapeXml(str) {
|
|
29
17
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
30
18
|
}
|
package/dist/export/types.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/export/types.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Model } from \"../core/model.js\";\n\n/**\n * Options for export operations\n */\nexport interface ExportOptions {\n layers?: string[];\n outputPath?: string;\n format?: string;\n}\n\n/**\n * Interface for format-specific exporters\n */\nexport interface Exporter {\n /** Display name of the exporter */\n name: string;\n\n /** Layers this exporter supports */\n supportedLayers: string[];\n\n /**\n * Export model or subset to the format\n */\n export(model: Model, options: ExportOptions): Promise<string>;\n}\n\n/**\n * Metadata about a registered export format\n */\nexport interface ExportFormatInfo {\n format: string;\n name: string;\n description: string;\n supportedLayers: string[];\n mimeType: string;\n}\n\n/**\n * Shared layer colors for consistent visualization across exporters\n * Note: Color values do NOT include '#' prefix - exporters add it as needed\n */\nexport const LAYER_COLORS: Record<string, string> = {\n motivation: \"FFE4E1\",\n business: \"E6F3FF\",\n security: \"FFE6E6\",\n application: \"E6FFE6\",\n technology: \"FFFFE6\",\n api: \"F0E6FF\",\n \"data-model\": \"E6F0FF\",\n \"data-store\": \"FFE6F0\",\n ux: \"FFCCCC\",\n navigation: \"CCFFCC\",\n apm: \"CCFFFF\",\n testing: \"FFCCFF\",\n};\n\n/**\n * All 12 supported layers\n */\nexport const ALL_LAYERS: string[] =
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Model } from \"../core/model.js\";\nimport { getAllLayerIds } from \"../generated/layer-registry.js\";\n\n/**\n * Options for export operations\n */\nexport interface ExportOptions {\n layers?: string[];\n outputPath?: string;\n format?: string;\n includeSources?: boolean; // For PlantUML: include source file paths as notes\n}\n\n/**\n * Interface for format-specific exporters\n */\nexport interface Exporter {\n /** Display name of the exporter */\n name: string;\n\n /** Layers this exporter supports */\n supportedLayers: string[];\n\n /**\n * Export model or subset to the format\n */\n export(model: Model, options: ExportOptions): Promise<string>;\n}\n\n/**\n * Metadata about a registered export format\n */\nexport interface ExportFormatInfo {\n format: string;\n name: string;\n description: string;\n supportedLayers: string[];\n mimeType: string;\n}\n\n/**\n * Shared layer colors for consistent visualization across exporters\n * Note: Color values do NOT include '#' prefix - exporters add it as needed\n */\nexport const LAYER_COLORS: Record<string, string> = {\n motivation: \"FFE4E1\",\n business: \"E6F3FF\",\n security: \"FFE6E6\",\n application: \"E6FFE6\",\n technology: \"FFFFE6\",\n api: \"F0E6FF\",\n \"data-model\": \"E6F0FF\",\n \"data-store\": \"FFE6F0\",\n ux: \"FFCCCC\",\n navigation: \"CCFFCC\",\n apm: \"CCFFFF\",\n testing: \"FFCCFF\",\n};\n\n/**\n * All 12 supported layers (from generated registry)\n */\nexport const ALL_LAYERS: string[] = getAllLayerIds();\n\n/**\n * Escape XML special characters\n */\nexport function escapeXml(str: string): string {\n return str\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,sBAAsB;AA2CxB,MAAM,eAAuC;EAClD,YAAY;EACZ,UAAU;EACV,UAAU;EACV,aAAa;EACb,YAAY;EACZ,KAAK;EACL,cAAc;EACd,cAAc;EACd,IAAI;EACJ,YAAY;EACZ,KAAK;EACL,SAAS;GAME,aAAuB,eAAc;AAK5C,SAAU,UAAU,KAAW;AACnC,SAAO,IACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,QAAQ;AAC3B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import ansis from "ansis";
|
|
2
|
+
import { formatDate } from "../utils/date-utils.js";
|
|
3
|
+
import { escapeMarkdown } from "./markdown-utils.js";
|
|
4
|
+
function formatVerifyReport(report, options) {
|
|
5
|
+
const format = options.format;
|
|
6
|
+
switch (format) {
|
|
7
|
+
case "json":
|
|
8
|
+
return formatVerifyJSON(report);
|
|
9
|
+
case "markdown":
|
|
10
|
+
return formatVerifyMarkdown(report);
|
|
11
|
+
case "text":
|
|
12
|
+
return formatVerifyText(report);
|
|
13
|
+
default:
|
|
14
|
+
return format;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function formatVerifyJSON(report) {
|
|
18
|
+
return JSON.stringify(report, null, 2) + `
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
function formatVerifyMarkdown(report) {
|
|
22
|
+
const lines = [];
|
|
23
|
+
return lines.push("# API Verification Report"), lines.push(""), lines.push(`**Project:** ${escapeMarkdown(report.project_root)}`), lines.push(`**Generated:** ${formatDate(report.generated_at)}`), lines.push(`**Analyzer:** ${escapeMarkdown(report.analyzer)} (indexed: ${formatDate(report.analyzer_indexed_at)})`), lines.push(""), lines.push("## Contents"), lines.push("- [Changeset Context](#changeset-context)"), lines.push("- [Summary](#summary)"), lines.push("- [Matched Entries](#matched-entries)"), lines.push("- [Graph-only Entries (Gaps)](#graph-only-entries-gaps)"), lines.push("- [Model-only Entries (Drift)](#model-only-entries-drift)"), lines.push("- [Ignored Entries](#ignored-entries)"), lines.push(""), formatChangesetContextMarkdown(lines, report), lines.push(""), formatSummaryMarkdown(lines, report), lines.push(""), formatMatchedMarkdown(lines, report.buckets.matched), lines.push(""), formatGraphOnlyMarkdown(lines, report.buckets.in_graph_only), lines.push(""), formatModelOnlyMarkdown(lines, report.buckets.in_model_only), lines.push(""), formatIgnoredMarkdown(lines, report.buckets.ignored), lines.push(""), lines.join(`
|
|
24
|
+
`);
|
|
25
|
+
}
|
|
26
|
+
function formatChangesetContextMarkdown(lines, report) {
|
|
27
|
+
const context = report.changeset_context;
|
|
28
|
+
lines.push("## Changeset Context"), context.active_changeset ? (lines.push(`- **Active Changeset:** ${escapeMarkdown(context.active_changeset)}`), lines.push("- **Verified Against:** changeset view")) : (lines.push("- **Active Changeset:** none"), lines.push("- **Verified Against:** base model"));
|
|
29
|
+
}
|
|
30
|
+
function formatSummaryMarkdown(lines, report) {
|
|
31
|
+
const summary = report.summary;
|
|
32
|
+
lines.push("## Summary"), lines.push(""), lines.push("| Metric | Count | Description |"), lines.push("|--------|-------|-------------|"), lines.push(`| Matched | ${summary.matched_count} | Operations found in both graph and model |`), lines.push(`| Graph-only | ${summary.gap_count} | Routes discovered but not in model (gaps) |`), lines.push(`| Model-only | ${summary.drift_count} | Operations defined but not discovered (drift) |`), lines.push(`| Ignored | ${summary.ignored_count} | Entries excluded by rules |`), lines.push(""), lines.push(`**Total Graph Entries Analyzed:** ${summary.total_graph_entries}`), lines.push(""), lines.push(`**Total Model Entries (API Layer):** ${summary.total_model_entries}`), summary.elements_without_source_ref > 0 && lines.push(`_(${summary.elements_without_source_ref} element(s) excluded from drift detection \u2014 no source attribution)_`);
|
|
33
|
+
}
|
|
34
|
+
function formatMatchedMarkdown(lines, matched) {
|
|
35
|
+
if (lines.push("## Matched Entries"), lines.push(""), matched.length === 0) {
|
|
36
|
+
lines.push("_No matched entries._");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
lines.push(`**Count:** ${matched.length}`), lines.push(""), lines.push("| ID | Type | Source |"), lines.push("|----|----|--------|");
|
|
40
|
+
for (const entry of matched.slice(0, 50)) {
|
|
41
|
+
const source = `${escapeMarkdown(entry.source_file)}:${escapeMarkdown(entry.source_symbol)}`;
|
|
42
|
+
lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(entry.type)} | ${source} |`);
|
|
43
|
+
}
|
|
44
|
+
matched.length > 50 && (lines.push(""), lines.push(`_... and ${matched.length - 50} more entries._`));
|
|
45
|
+
}
|
|
46
|
+
function formatGraphOnlyMarkdown(lines, graphOnly) {
|
|
47
|
+
if (lines.push("## Graph-only Entries (Gaps)"), lines.push(""), graphOnly.length === 0) {
|
|
48
|
+
lines.push("_No gaps detected \u2014 all discovered routes are in the model._");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
lines.push(`**Count:** ${graphOnly.length}`), lines.push(""), lines.push("Routes discovered in the codebase but missing from the model:"), lines.push(""), lines.push("> **Tip:** Use `/dr-map` or `dr analyzer endpoints` ingestion to close these gaps \u2014 manual `dr add` operations cannot be matched by the verifier."), lines.push(""), lines.push("| ID | Endpoint | Source |"), lines.push("|----|----|--------|");
|
|
52
|
+
for (const entry of graphOnly.slice(0, 50)) {
|
|
53
|
+
const endpoint = entry.http_method && entry.http_path ? `${entry.http_method} ${entry.http_path}` : "\u2014", source = `${escapeMarkdown(entry.source_file)}:${escapeMarkdown(entry.source_symbol)}`;
|
|
54
|
+
lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(endpoint)} | ${source} |`);
|
|
55
|
+
}
|
|
56
|
+
graphOnly.length > 50 && (lines.push(""), lines.push(`_... and ${graphOnly.length - 50} more entries._`));
|
|
57
|
+
}
|
|
58
|
+
function formatModelOnlyMarkdown(lines, modelOnly) {
|
|
59
|
+
if (lines.push("## Model-only Entries (Drift)"), lines.push(""), modelOnly.length === 0) {
|
|
60
|
+
lines.push("_No drift detected \u2014 all model operations were discovered._");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
lines.push(`**Count:** ${modelOnly.length}`), lines.push(""), lines.push("Operations defined in the model but not found in the codebase:"), lines.push(""), lines.push("| ID | Type | Source |"), lines.push("|----|----|--------|");
|
|
64
|
+
for (const entry of modelOnly.slice(0, 50)) {
|
|
65
|
+
const source = `${escapeMarkdown(entry.source_file)}:${escapeMarkdown(entry.source_symbol)}`;
|
|
66
|
+
lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(entry.type)} | ${source} |`);
|
|
67
|
+
}
|
|
68
|
+
modelOnly.length > 50 && (lines.push(""), lines.push(`_... and ${modelOnly.length - 50} more entries._`));
|
|
69
|
+
}
|
|
70
|
+
function formatIgnoredMarkdown(lines, ignored) {
|
|
71
|
+
if (lines.push("## Ignored Entries"), lines.push(""), ignored.length === 0) {
|
|
72
|
+
lines.push("_No ignored entries._");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
lines.push(`**Count:** ${ignored.length}`), lines.push("");
|
|
76
|
+
const byType = /* @__PURE__ */ new Map();
|
|
77
|
+
for (const entry of ignored) {
|
|
78
|
+
const group = byType.get(entry.entry_type) ?? [];
|
|
79
|
+
group.push(entry), byType.set(entry.entry_type, group);
|
|
80
|
+
}
|
|
81
|
+
for (const [type, entries] of byType) {
|
|
82
|
+
lines.push(`### ${escapeMarkdown(type)} (${entries.length})`), lines.push(""), lines.push("| ID | Reason |"), lines.push("|----|----|");
|
|
83
|
+
for (const entry of entries.slice(0, 20))
|
|
84
|
+
lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(entry.reason)} |`);
|
|
85
|
+
entries.length > 20 && lines.push(`| _... and ${entries.length - 20} more_ | |`), lines.push("");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function formatVerifyText(report) {
|
|
89
|
+
const lines = [];
|
|
90
|
+
return lines.push(""), lines.push(ansis.bold(`\u2713 API Verification Report: ${ansis.cyan(report.project_root)}`)), lines.push(ansis.dim("=".repeat(80))), lines.push(""), lines.push(`Generated: ${formatDate(report.generated_at)}`), lines.push(`Analyzer: ${report.analyzer} (indexed: ${formatDate(report.analyzer_indexed_at)})`), lines.push(""), formatChangesetContextText(lines, report), lines.push(""), formatSummaryText(lines, report), lines.push(""), formatMatchedText(lines, report.buckets.matched), lines.push(""), formatGraphOnlyText(lines, report.buckets.in_graph_only), lines.push(""), formatModelOnlyText(lines, report.buckets.in_model_only), lines.push(""), formatIgnoredText(lines, report.buckets.ignored), lines.push(""), lines.join(`
|
|
91
|
+
`);
|
|
92
|
+
}
|
|
93
|
+
function formatChangesetContextText(lines, report) {
|
|
94
|
+
const context = report.changeset_context;
|
|
95
|
+
lines.push(ansis.bold.blue("Changeset Context")), lines.push(ansis.dim("\u2500".repeat(60))), context.active_changeset ? (lines.push(`Active Changeset: ${ansis.cyan(context.active_changeset)}`), lines.push(`Verified Against: ${ansis.cyan("changeset view")}`)) : (lines.push("Active Changeset: none"), lines.push(`Verified Against: ${ansis.cyan("base model")}`));
|
|
96
|
+
}
|
|
97
|
+
function formatSummaryText(lines, report) {
|
|
98
|
+
const summary = report.summary;
|
|
99
|
+
lines.push(ansis.bold.yellow("SUMMARY")), lines.push(ansis.dim("\u2500".repeat(60))), lines.push(""), lines.push(ansis.bold("Verification Results:")), lines.push(` Matched: ${ansis.green(String(summary.matched_count).padStart(4))} operations found in both graph and model`), lines.push(` Graph-only: ${ansis.yellow(String(summary.gap_count).padStart(4))} routes discovered but not in model (gaps)`), lines.push(` Model-only: ${ansis.red(String(summary.drift_count).padStart(4))} operations defined but not discovered (drift)`), lines.push(` Ignored: ${ansis.dim(String(summary.ignored_count).padStart(4))} entries excluded by rules`), lines.push(""), lines.push(`Total Graph Entries Analyzed: ${summary.total_graph_entries}`), lines.push(`Total Model Entries (API Layer): ${summary.total_model_entries}`), summary.elements_without_source_ref > 0 && lines.push(ansis.dim(` (${summary.elements_without_source_ref} element(s) excluded from drift detection \u2014 no source attribution)`));
|
|
100
|
+
}
|
|
101
|
+
function formatMatchedText(lines, matched) {
|
|
102
|
+
if (lines.push(ansis.bold.green(`\u2713 Matched (${matched.length})`)), lines.push(ansis.dim("\u2500".repeat(60))), matched.length === 0) {
|
|
103
|
+
lines.push(ansis.dim(" No matched entries."));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
for (const entry of matched.slice(0, 20))
|
|
107
|
+
lines.push(` ${ansis.green("\u2713")} ${entry.id}`), lines.push(` Type: ${entry.type}`), lines.push(` Source: ${entry.source_file}:${entry.source_symbol}`), lines.push("");
|
|
108
|
+
matched.length > 20 && lines.push(ansis.dim(` ... and ${matched.length - 20} more`));
|
|
109
|
+
}
|
|
110
|
+
function formatGraphOnlyText(lines, graphOnly) {
|
|
111
|
+
if (lines.push(ansis.bold.yellow(`\u26A0 Graph-only / Gaps (${graphOnly.length})`)), lines.push(ansis.dim("\u2500".repeat(60))), graphOnly.length === 0) {
|
|
112
|
+
lines.push(ansis.dim(" No gaps detected \u2014 all discovered routes are in the model."));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
lines.push(ansis.dim("Routes discovered in the codebase but missing from the model:")), lines.push(ansis.dim(" Tip: Use /dr-map or `dr analyzer endpoints` ingestion to close these gaps \u2014")), lines.push(ansis.dim(" manual `dr add` operations cannot be matched by the verifier.")), lines.push("");
|
|
116
|
+
for (const entry of graphOnly.slice(0, 20))
|
|
117
|
+
lines.push(` ${ansis.yellow("!")} ${entry.id}`), entry.http_method && entry.http_path && lines.push(` Endpoint: ${entry.http_method} ${entry.http_path}`), lines.push(` Source: ${entry.source_file}:${entry.source_symbol}`), lines.push("");
|
|
118
|
+
graphOnly.length > 20 && lines.push(ansis.dim(` ... and ${graphOnly.length - 20} more`));
|
|
119
|
+
}
|
|
120
|
+
function formatModelOnlyText(lines, modelOnly) {
|
|
121
|
+
if (lines.push(ansis.bold.red(`\u2717 Model-only / Drift (${modelOnly.length})`)), lines.push(ansis.dim("\u2500".repeat(60))), modelOnly.length === 0) {
|
|
122
|
+
lines.push(ansis.dim(" No drift detected \u2014 all model operations were discovered."));
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
lines.push(ansis.dim("Operations defined in the model but not found in the codebase:")), lines.push("");
|
|
126
|
+
for (const entry of modelOnly.slice(0, 20))
|
|
127
|
+
lines.push(` ${ansis.red("\u2717")} ${entry.id}`), lines.push(` Type: ${entry.type}`), lines.push(` Source: ${entry.source_file}:${entry.source_symbol}`), lines.push("");
|
|
128
|
+
modelOnly.length > 20 && lines.push(ansis.dim(` ... and ${modelOnly.length - 20} more`));
|
|
129
|
+
}
|
|
130
|
+
function formatIgnoredText(lines, ignored) {
|
|
131
|
+
if (lines.push(ansis.bold.dim(`\u2298 Ignored (${ignored.length})`)), lines.push(ansis.dim("\u2500".repeat(60))), ignored.length === 0) {
|
|
132
|
+
lines.push(ansis.dim(" No ignored entries."));
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const byType = /* @__PURE__ */ new Map();
|
|
136
|
+
for (const entry of ignored) {
|
|
137
|
+
const group = byType.get(entry.entry_type) ?? [];
|
|
138
|
+
group.push(entry), byType.set(entry.entry_type, group);
|
|
139
|
+
}
|
|
140
|
+
for (const [type, entries] of byType) {
|
|
141
|
+
lines.push(` ${type}: ${entries.length} entries`);
|
|
142
|
+
for (const entry of entries.slice(0, 5))
|
|
143
|
+
lines.push(ansis.dim(` \u2022 ${entry.id}`)), lines.push(ansis.dim(` Reason: ${entry.reason}`));
|
|
144
|
+
entries.length > 5 && lines.push(ansis.dim(` ... and ${entries.length - 5} more`)), lines.push("");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
formatVerifyJSON,
|
|
149
|
+
formatVerifyMarkdown,
|
|
150
|
+
formatVerifyReport,
|
|
151
|
+
formatVerifyText
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=verify-formatters.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/export/verify-formatters.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Verify report formatters\n * Supports text (default), JSON, and markdown output formats for verification reports\n */\n\nimport ansis from \"ansis\";\nimport type { VerifyReport, MatchedEntry, GraphOnlyEntry, ModelOnlyEntry, IgnoredEntry } from \"../analyzers/types.js\";\nimport { formatDate } from \"../utils/date-utils.js\";\nimport { escapeMarkdown } from \"./markdown-utils.js\";\n\nexport type VerifyReportFormat = \"text\" | \"json\" | \"markdown\";\n\nexport interface VerifyFormatterOptions {\n format: VerifyReportFormat;\n}\n\n/**\n * Format verify report for output\n */\nexport function formatVerifyReport(report: VerifyReport, options: VerifyFormatterOptions): string {\n const format: VerifyReportFormat = options.format;\n switch (format) {\n case \"json\":\n return formatVerifyJSON(report);\n case \"markdown\":\n return formatVerifyMarkdown(report);\n case \"text\":\n return formatVerifyText(report);\n default:\n // Exhaustive check: if this line is reached, options.format is not a valid VerifyReportFormat\n const _exhaustive: never = format;\n return _exhaustive;\n }\n}\n\n/**\n * Format as JSON\n */\nexport function formatVerifyJSON(report: VerifyReport): string {\n return JSON.stringify(report, null, 2) + \"\\n\";\n}\n\n/**\n * Format as Markdown\n */\nexport function formatVerifyMarkdown(report: VerifyReport): string {\n const lines: string[] = [];\n\n // Header\n lines.push(`# API Verification Report`);\n lines.push(\"\");\n lines.push(`**Project:** ${escapeMarkdown(report.project_root)}`);\n lines.push(`**Generated:** ${formatDate(report.generated_at)}`);\n lines.push(`**Analyzer:** ${escapeMarkdown(report.analyzer)} (indexed: ${formatDate(report.analyzer_indexed_at)})`);\n lines.push(\"\");\n\n // Table of Contents\n lines.push(\"## Contents\");\n lines.push(\"- [Changeset Context](#changeset-context)\");\n lines.push(\"- [Summary](#summary)\");\n lines.push(\"- [Matched Entries](#matched-entries)\");\n lines.push(\"- [Graph-only Entries (Gaps)](#graph-only-entries-gaps)\");\n lines.push(\"- [Model-only Entries (Drift)](#model-only-entries-drift)\");\n lines.push(\"- [Ignored Entries](#ignored-entries)\");\n lines.push(\"\");\n\n // Changeset context\n formatChangesetContextMarkdown(lines, report);\n lines.push(\"\");\n\n // Summary section\n formatSummaryMarkdown(lines, report);\n lines.push(\"\");\n\n // Matched section\n formatMatchedMarkdown(lines, report.buckets.matched);\n lines.push(\"\");\n\n // Graph-only section (gaps)\n formatGraphOnlyMarkdown(lines, report.buckets.in_graph_only);\n lines.push(\"\");\n\n // Model-only section (drift)\n formatModelOnlyMarkdown(lines, report.buckets.in_model_only);\n lines.push(\"\");\n\n // Ignored section\n formatIgnoredMarkdown(lines, report.buckets.ignored);\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Format changeset context for markdown output\n */\nfunction formatChangesetContextMarkdown(lines: string[], report: VerifyReport): void {\n const context = report.changeset_context;\n\n lines.push(\"## Changeset Context\");\n\n if (context.active_changeset) {\n lines.push(`- **Active Changeset:** ${escapeMarkdown(context.active_changeset)}`);\n lines.push(`- **Verified Against:** changeset view`);\n } else {\n lines.push(`- **Active Changeset:** none`);\n lines.push(`- **Verified Against:** base model`);\n }\n}\n\n/**\n * Format summary statistics for markdown output\n */\nfunction formatSummaryMarkdown(lines: string[], report: VerifyReport): void {\n const summary = report.summary;\n\n lines.push(\"## Summary\");\n lines.push(\"\");\n lines.push(\"| Metric | Count | Description |\");\n lines.push(\"|--------|-------|-------------|\");\n lines.push(`| Matched | ${summary.matched_count} | Operations found in both graph and model |`);\n lines.push(`| Graph-only | ${summary.gap_count} | Routes discovered but not in model (gaps) |`);\n lines.push(`| Model-only | ${summary.drift_count} | Operations defined but not discovered (drift) |`);\n lines.push(`| Ignored | ${summary.ignored_count} | Entries excluded by rules |`);\n lines.push(\"\");\n lines.push(`**Total Graph Entries Analyzed:** ${summary.total_graph_entries}`);\n lines.push(\"\");\n lines.push(`**Total Model Entries (API Layer):** ${summary.total_model_entries}`);\n if (summary.elements_without_source_ref > 0) {\n lines.push(`_(${summary.elements_without_source_ref} element(s) excluded from drift detection \u2014 no source attribution)_`);\n }\n}\n\n/**\n * Format matched entries for markdown output\n */\nfunction formatMatchedMarkdown(lines: string[], matched: MatchedEntry[]): void {\n lines.push(`## Matched Entries`);\n lines.push(\"\");\n\n if (matched.length === 0) {\n lines.push(\"_No matched entries._\");\n return;\n }\n\n lines.push(`**Count:** ${matched.length}`);\n lines.push(\"\");\n lines.push(\"| ID | Type | Source |\");\n lines.push(\"|----|----|--------|\");\n\n for (const entry of matched.slice(0, 50)) {\n const source = `${escapeMarkdown(entry.source_file)}:${escapeMarkdown(entry.source_symbol)}`;\n lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(entry.type)} | ${source} |`);\n }\n\n if (matched.length > 50) {\n lines.push(\"\");\n lines.push(`_... and ${matched.length - 50} more entries._`);\n }\n}\n\n/**\n * Format graph-only entries for markdown output (gaps)\n */\nfunction formatGraphOnlyMarkdown(lines: string[], graphOnly: GraphOnlyEntry[]): void {\n lines.push(`## Graph-only Entries (Gaps)`);\n lines.push(\"\");\n\n if (graphOnly.length === 0) {\n lines.push(\"_No gaps detected \u2014 all discovered routes are in the model._\");\n return;\n }\n\n lines.push(`**Count:** ${graphOnly.length}`);\n lines.push(\"\");\n lines.push(\"Routes discovered in the codebase but missing from the model:\");\n lines.push(\"\");\n lines.push('> **Tip:** Use `/dr-map` or `dr analyzer endpoints` ingestion to close these gaps \u2014 manual `dr add` operations cannot be matched by the verifier.');\n lines.push(\"\");\n lines.push(\"| ID | Endpoint | Source |\");\n lines.push(\"|----|----|--------|\");\n\n for (const entry of graphOnly.slice(0, 50)) {\n const endpoint = entry.http_method && entry.http_path ? `${entry.http_method} ${entry.http_path}` : \"\u2014\";\n const source = `${escapeMarkdown(entry.source_file)}:${escapeMarkdown(entry.source_symbol)}`;\n lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(endpoint)} | ${source} |`);\n }\n\n if (graphOnly.length > 50) {\n lines.push(\"\");\n lines.push(`_... and ${graphOnly.length - 50} more entries._`);\n }\n}\n\n/**\n * Format model-only entries for markdown output (drift)\n */\nfunction formatModelOnlyMarkdown(lines: string[], modelOnly: ModelOnlyEntry[]): void {\n lines.push(`## Model-only Entries (Drift)`);\n lines.push(\"\");\n\n if (modelOnly.length === 0) {\n lines.push(\"_No drift detected \u2014 all model operations were discovered._\");\n return;\n }\n\n lines.push(`**Count:** ${modelOnly.length}`);\n lines.push(\"\");\n lines.push(\"Operations defined in the model but not found in the codebase:\");\n lines.push(\"\");\n lines.push(\"| ID | Type | Source |\");\n lines.push(\"|----|----|--------|\");\n\n for (const entry of modelOnly.slice(0, 50)) {\n const source = `${escapeMarkdown(entry.source_file)}:${escapeMarkdown(entry.source_symbol)}`;\n lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(entry.type)} | ${source} |`);\n }\n\n if (modelOnly.length > 50) {\n lines.push(\"\");\n lines.push(`_... and ${modelOnly.length - 50} more entries._`);\n }\n}\n\n/**\n * Format ignored entries for markdown output\n */\nfunction formatIgnoredMarkdown(lines: string[], ignored: IgnoredEntry[]): void {\n lines.push(`## Ignored Entries`);\n lines.push(\"\");\n\n if (ignored.length === 0) {\n lines.push(\"_No ignored entries._\");\n return;\n }\n\n lines.push(`**Count:** ${ignored.length}`);\n lines.push(\"\");\n\n // Group by entry type\n const byType = new Map<string, IgnoredEntry[]>();\n for (const entry of ignored) {\n const group = byType.get(entry.entry_type) ?? [];\n group.push(entry);\n byType.set(entry.entry_type, group);\n }\n\n for (const [type, entries] of byType) {\n lines.push(`### ${escapeMarkdown(type)} (${entries.length})`);\n lines.push(\"\");\n lines.push(\"| ID | Reason |\");\n lines.push(\"|----|----|\");\n\n for (const entry of entries.slice(0, 20)) {\n lines.push(`| ${escapeMarkdown(entry.id)} | ${escapeMarkdown(entry.reason)} |`);\n }\n\n if (entries.length > 20) {\n lines.push(`| _... and ${entries.length - 20} more_ | |`);\n }\n lines.push(\"\");\n }\n}\n\n/**\n * Format as plain text (default)\n */\nexport function formatVerifyText(report: VerifyReport): string {\n const lines: string[] = [];\n\n // Header\n lines.push(\"\");\n lines.push(ansis.bold(`\u2713 API Verification Report: ${ansis.cyan(report.project_root)}`));\n lines.push(ansis.dim(\"=\".repeat(80)));\n lines.push(\"\");\n lines.push(`Generated: ${formatDate(report.generated_at)}`);\n lines.push(`Analyzer: ${report.analyzer} (indexed: ${formatDate(report.analyzer_indexed_at)})`);\n lines.push(\"\");\n\n // Changeset context\n formatChangesetContextText(lines, report);\n lines.push(\"\");\n\n // Summary section\n formatSummaryText(lines, report);\n lines.push(\"\");\n\n // Matched section\n formatMatchedText(lines, report.buckets.matched);\n lines.push(\"\");\n\n // Graph-only section (gaps)\n formatGraphOnlyText(lines, report.buckets.in_graph_only);\n lines.push(\"\");\n\n // Model-only section (drift)\n formatModelOnlyText(lines, report.buckets.in_model_only);\n lines.push(\"\");\n\n // Ignored section\n formatIgnoredText(lines, report.buckets.ignored);\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Format changeset context for text output\n */\nfunction formatChangesetContextText(lines: string[], report: VerifyReport): void {\n const context = report.changeset_context;\n\n lines.push(ansis.bold.blue(\"Changeset Context\"));\n lines.push(ansis.dim(\"\u2500\".repeat(60)));\n\n if (context.active_changeset) {\n lines.push(`Active Changeset: ${ansis.cyan(context.active_changeset)}`);\n lines.push(`Verified Against: ${ansis.cyan(\"changeset view\")}`);\n } else {\n lines.push(\"Active Changeset: none\");\n lines.push(`Verified Against: ${ansis.cyan(\"base model\")}`);\n }\n}\n\n/**\n * Format summary statistics for text output\n */\nfunction formatSummaryText(lines: string[], report: VerifyReport): void {\n const summary = report.summary;\n\n lines.push(ansis.bold.yellow(\"SUMMARY\"));\n lines.push(ansis.dim(\"\u2500\".repeat(60)));\n lines.push(\"\");\n\n lines.push(ansis.bold(\"Verification Results:\"));\n lines.push(` Matched: ${ansis.green(String(summary.matched_count).padStart(4))} operations found in both graph and model`);\n lines.push(` Graph-only: ${ansis.yellow(String(summary.gap_count).padStart(4))} routes discovered but not in model (gaps)`);\n lines.push(` Model-only: ${ansis.red(String(summary.drift_count).padStart(4))} operations defined but not discovered (drift)`);\n lines.push(` Ignored: ${ansis.dim(String(summary.ignored_count).padStart(4))} entries excluded by rules`);\n lines.push(\"\");\n lines.push(`Total Graph Entries Analyzed: ${summary.total_graph_entries}`);\n lines.push(`Total Model Entries (API Layer): ${summary.total_model_entries}`);\n if (summary.elements_without_source_ref > 0) {\n lines.push(ansis.dim(` (${summary.elements_without_source_ref} element(s) excluded from drift detection \u2014 no source attribution)`));\n }\n}\n\n/**\n * Format matched entries for text output\n */\nfunction formatMatchedText(lines: string[], matched: MatchedEntry[]): void {\n lines.push(ansis.bold.green(`\u2713 Matched (${matched.length})`));\n lines.push(ansis.dim(\"\u2500\".repeat(60)));\n\n if (matched.length === 0) {\n lines.push(ansis.dim(\" No matched entries.\"));\n return;\n }\n\n for (const entry of matched.slice(0, 20)) {\n lines.push(` ${ansis.green(\"\u2713\")} ${entry.id}`);\n lines.push(` Type: ${entry.type}`);\n lines.push(` Source: ${entry.source_file}:${entry.source_symbol}`);\n lines.push(\"\");\n }\n\n if (matched.length > 20) {\n lines.push(ansis.dim(` ... and ${matched.length - 20} more`));\n }\n}\n\n/**\n * Format graph-only entries for text output (gaps)\n */\nfunction formatGraphOnlyText(lines: string[], graphOnly: GraphOnlyEntry[]): void {\n lines.push(ansis.bold.yellow(`\u26A0 Graph-only / Gaps (${graphOnly.length})`));\n lines.push(ansis.dim(\"\u2500\".repeat(60)));\n\n if (graphOnly.length === 0) {\n lines.push(ansis.dim(\" No gaps detected \u2014 all discovered routes are in the model.\"));\n return;\n }\n\n lines.push(ansis.dim(\"Routes discovered in the codebase but missing from the model:\"));\n lines.push(ansis.dim(\" Tip: Use /dr-map or `dr analyzer endpoints` ingestion to close these gaps \u2014\"));\n lines.push(ansis.dim(\" manual `dr add` operations cannot be matched by the verifier.\"));\n lines.push(\"\");\n\n for (const entry of graphOnly.slice(0, 20)) {\n lines.push(` ${ansis.yellow(\"!\")} ${entry.id}`);\n if (entry.http_method && entry.http_path) {\n lines.push(` Endpoint: ${entry.http_method} ${entry.http_path}`);\n }\n lines.push(` Source: ${entry.source_file}:${entry.source_symbol}`);\n lines.push(\"\");\n }\n\n if (graphOnly.length > 20) {\n lines.push(ansis.dim(` ... and ${graphOnly.length - 20} more`));\n }\n}\n\n/**\n * Format model-only entries for text output (drift)\n */\nfunction formatModelOnlyText(lines: string[], modelOnly: ModelOnlyEntry[]): void {\n lines.push(ansis.bold.red(`\u2717 Model-only / Drift (${modelOnly.length})`));\n lines.push(ansis.dim(\"\u2500\".repeat(60)));\n\n if (modelOnly.length === 0) {\n lines.push(ansis.dim(\" No drift detected \u2014 all model operations were discovered.\"));\n return;\n }\n\n lines.push(ansis.dim(\"Operations defined in the model but not found in the codebase:\"));\n lines.push(\"\");\n\n for (const entry of modelOnly.slice(0, 20)) {\n lines.push(` ${ansis.red(\"\u2717\")} ${entry.id}`);\n lines.push(` Type: ${entry.type}`);\n lines.push(` Source: ${entry.source_file}:${entry.source_symbol}`);\n lines.push(\"\");\n }\n\n if (modelOnly.length > 20) {\n lines.push(ansis.dim(` ... and ${modelOnly.length - 20} more`));\n }\n}\n\n/**\n * Format ignored entries for text output\n */\nfunction formatIgnoredText(lines: string[], ignored: IgnoredEntry[]): void {\n lines.push(ansis.bold.dim(`\u2298 Ignored (${ignored.length})`));\n lines.push(ansis.dim(\"\u2500\".repeat(60)));\n\n if (ignored.length === 0) {\n lines.push(ansis.dim(\" No ignored entries.\"));\n return;\n }\n\n // Group by entry type\n const byType = new Map<string, IgnoredEntry[]>();\n for (const entry of ignored) {\n const group = byType.get(entry.entry_type) ?? [];\n group.push(entry);\n byType.set(entry.entry_type, group);\n }\n\n for (const [type, entries] of byType) {\n lines.push(` ${type}: ${entries.length} entries`);\n for (const entry of entries.slice(0, 5)) {\n lines.push(ansis.dim(` \u2022 ${entry.id}`));\n lines.push(ansis.dim(` Reason: ${entry.reason}`));\n }\n if (entries.length > 5) {\n lines.push(ansis.dim(` ... and ${entries.length -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C;AAEvD,IAAI,QAAQ,SAAS,KACnB,MAAM,KAAK,MAAM,IAAI,eAAe,QAAQ,SAAS,CAAC,OAAO,CAAC,GAEhE,MAAM,KAAK,EAAE;EACf;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
import addFormats from "ajv-formats";
|
|
3
|
+
const sharedAjv = (() => {
|
|
4
|
+
const ajv = new Ajv({
|
|
5
|
+
allErrors: !0,
|
|
6
|
+
strict: !1,
|
|
7
|
+
validateFormats: !0
|
|
8
|
+
});
|
|
9
|
+
return addFormats(ajv), ajv.addSchema({ $schema: "http://json-schema.org/draft-07/schema#", title: "SpecNode", description: "Base schema for all spec node types. Each node type schema extends this with type-specific attribute constraints via allOf.", type: "object", required: ["id", "path", "spec_node_id", "type", "name"], additionalProperties: !1, properties: { id: { type: "string", format: "uuid", description: "Unique node instance identifier (UUIDv4). Globally unique across the entire model.", examples: ["550e8400-e29b-41d4-a716-446655440000"] }, path: { type: "string", pattern: "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*$", description: "Human-readable element path in format {layer}.{type}.{name} (e.g., 'motivation.goal.increase-revenue')" }, spec_node_id: { type: "string", pattern: "^[a-z-]+\\.[a-z][a-z0-9-]*$", description: "Reference to the spec node type that this node conforms to (e.g., 'motivation.goal')" }, type: { type: "string", description: "Denormalized node type for efficient filtering and queries. Extracted from spec_node_id (the part after the dot).", examples: ["goal", "requirement", "endpoint", "table"] }, layer_id: { type: "string", pattern: "^[a-z][a-z0-9-]*$", description: "Denormalized layer ID for efficient layer-scoped queries. Extracted from spec_node_id (the part before the dot)." }, name: { type: "string", description: "Human-readable instance name", examples: ["Improve Customer Satisfaction", "User Login API", "Customer Table"] }, description: { type: "string", description: "Optional detailed description of this specific node instance" }, attributes: { type: "object", description: "Attribute values for this node instance. Keys must correspond to attributes defined in the per-type schema, and values must conform to the type constraints." }, source_reference: { $ref: "urn:dr:spec:base:source-references#/definitions/SourceReference", description: "Optional provenance tracking linking this node to source code locations" }, metadata: { type: "object", description: "Optional metadata about the lifecycle and version of this node instance", additionalProperties: !1, properties: { created_at: { type: "string", format: "date-time", description: "ISO 8601 timestamp when this node was created" }, updated_at: { type: "string", format: "date-time", description: "ISO 8601 timestamp of the last modification" }, created_by: { type: "string", description: "User or system that created this node" }, version: { type: "integer", minimum: 1, description: "Version number of this node (incremented on updates)" } } } } }, "urn:dr:spec:base:spec-node"), ajv.addSchema({ $schema: "http://json-schema.org/draft-07/schema#", title: "SpecNodeRelationship", description: "Base type for relationship type definitions in the specification. Defines valid relationships between node types, including cardinality, strength, and semantic properties.", type: "object", required: ["id", "source_spec_node_id", "destination_spec_node_id", "predicate"], additionalProperties: !1, properties: { id: { type: "string", pattern: "^[a-z-]+\\.[a-z-]+\\.[a-z-]+$", description: "Unique relationship ID in format: {source-layer}.{predicate}.{dest-layer}. All components use lowercase with hyphens.", examples: ["motivation.supports.motivation", "motivation.realizes.business", "api.exposes.data-model"] }, source_spec_node_id: { type: "string", pattern: "^[a-z-]+\\.[a-z][a-z0-9-]*$", description: "SpecNode ID that can serve as the source of this relationship type" }, source_layer: { type: "string", pattern: "^[a-z][a-z0-9-]*$", description: "Denormalized layer ID extracted from source_spec_node_id for efficient queries" }, destination_spec_node_id: { type: "string", pattern: "^[a-z-]+\\.[a-z][a-z0-9-]*$", description: "SpecNode ID that can serve as the destination of this relationship type" }, destination_layer: { type: "string", pattern: "^[a-z][a-z0-9-]*$", description: "Denormalized layer ID extracted from destination_spec_node_id for efficient queries" }, predicate: { type: "string", description: "Semantic predicate from PredicateCatalog describing the relationship type. Must be a valid predicate name.", examples: ["supports", "realizes", "fulfills", "implements", "uses", "consumes"] }, cardinality: { type: "string", enum: ["one-to-one", "one-to-many", "many-to-one", "many-to-many"], description: "Multiplicity constraint on this relationship type. Defines how many source nodes can relate to how many destination nodes.", default: "many-to-many" }, strength: { type: "string", enum: ["critical", "high", "medium", "low"], description: "Typical importance or strength of this relationship type", default: "medium" }, required: { type: "boolean", description: "Whether instances of the source node type must have at least one relationship of this type", default: !1 }, attributes: { type: "object", description: "Optional schema defining attributes that can appear on relationship instances of this type", additionalProperties: { $ref: "urn:dr:spec:base:attribute-spec#/definitions/AttributeSpec" }, minProperties: 0, examples: [{ reason: { type: "string", description: "Explanation for why this relationship exists" }, strength_override: { type: "enum", enum_values: ["critical", "high", "medium", "low"], description: "Instance-specific strength override" } }] } } }, "urn:dr:spec:base:spec-node-relationship"), ajv.addSchema({ $schema: "http://json-schema.org/draft-07/schema#", title: "Source Code Reference Definitions", description: "Reusable JSON Schema definitions for linking architecture elements to source code locations", version: "1.0.0", definitions: { ProvenanceType: { type: "string", enum: ["extracted", "manual", "inferred", "generated"], description: "How this reference was created: extracted (automated ingestion), manual (human added), inferred (pattern matching), generated (code generated from model)" }, SourceLocation: { type: "object", description: "A specific location in source code, identified by file path and optional symbol", required: ["file"], properties: { file: { type: "string", minLength: 1, description: "File path relative to repository root" }, symbol: { type: "string", description: "Named code element (e.g., ClassName.methodName, function_name)" } } }, RepositoryContext: { type: "object", description: "Repository context for the source reference", properties: { url: { type: "string", format: "uri", description: "Git remote URL (HTTPS or SSH format)" }, commit: { type: "string", pattern: "^[0-9a-f]{40}$", description: "Full 40-character Git commit SHA" } } }, SourceReference: { type: "object", description: "Links entity to source code location(s) with provenance tracking. For inferred or generated elements, locations may be omitted when no source file exists yet.", required: ["provenance"], properties: { provenance: { $ref: "#/definitions/ProvenanceType" }, locations: { type: "array", minItems: 1, items: { $ref: "#/definitions/SourceLocation" }, description: "One or more source code locations. Required for extracted and manual provenance; optional for inferred and generated." }, repository: { $ref: "#/definitions/RepositoryContext" } } } } }, "urn:dr:spec:base:source-references"), ajv.addSchema({ $schema: "http://json-schema.org/draft-07/schema#", title: "AttributeSpec Definitions", description: "Reusable definition for attribute specifications used in spec-level schemas (e.g., spec-node-relationship attributes)", definitions: { AttributeSpec: { type: "object", title: "AttributeSpec", description: "Specification for a single attribute that can appear on node or relationship instances", required: ["type", "description"], additionalProperties: !1, properties: { type: { type: "string", enum: ["string", "integer", "number", "boolean", "array", "object", "enum"], description: "The JSON type of this attribute" }, description: { type: "string", description: "Human-readable description of this attribute's purpose" }, enum_values: { type: "array", items: { type: "string" }, description: "Required when type is 'enum'. Lists the valid string values for this attribute.", examples: [["high", "medium", "low"], ["active", "inactive", "archived"]] }, format: { type: "string", description: "Optional format constraint for string types (e.g., 'email', 'uri', 'date-time')", examples: ["email", "uri", "date-time", "uuid"] }, default: { description: "Default value for this attribute when not provided on a node instance. Can be any JSON value." } }, if: { properties: { type: { const: "enum" } }, required: ["type"] }, then: { required: ["type", "description", "enum_values"] } } } }, "urn:dr:spec:base:attribute-spec"), ajv;
|
|
10
|
+
})(), validateSpecNode = sharedAjv.compile({ $schema: "http://json-schema.org/draft-07/schema#", title: "SpecNode", description: "Base schema for all spec node types. Each node type schema extends this with type-specific attribute constraints via allOf.", type: "object", required: ["id", "path", "spec_node_id", "type", "name"], additionalProperties: !1, properties: { id: { type: "string", format: "uuid", description: "Unique node instance identifier (UUIDv4). Globally unique across the entire model.", examples: ["550e8400-e29b-41d4-a716-446655440000"] }, path: { type: "string", pattern: "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*$", description: "Human-readable element path in format {layer}.{type}.{name} (e.g., 'motivation.goal.increase-revenue')" }, spec_node_id: { type: "string", pattern: "^[a-z-]+\\.[a-z][a-z0-9-]*$", description: "Reference to the spec node type that this node conforms to (e.g., 'motivation.goal')" }, type: { type: "string", description: "Denormalized node type for efficient filtering and queries. Extracted from spec_node_id (the part after the dot).", examples: ["goal", "requirement", "endpoint", "table"] }, layer_id: { type: "string", pattern: "^[a-z][a-z0-9-]*$", description: "Denormalized layer ID for efficient layer-scoped queries. Extracted from spec_node_id (the part before the dot)." }, name: { type: "string", description: "Human-readable instance name", examples: ["Improve Customer Satisfaction", "User Login API", "Customer Table"] }, description: { type: "string", description: "Optional detailed description of this specific node instance" }, attributes: { type: "object", description: "Attribute values for this node instance. Keys must correspond to attributes defined in the per-type schema, and values must conform to the type constraints." }, source_reference: { $ref: "urn:dr:spec:base:source-references#/definitions/SourceReference", description: "Optional provenance tracking linking this node to source code locations" }, metadata: { type: "object", description: "Optional metadata about the lifecycle and version of this node instance", additionalProperties: !1, properties: { created_at: { type: "string", format: "date-time", description: "ISO 8601 timestamp when this node was created" }, updated_at: { type: "string", format: "date-time", description: "ISO 8601 timestamp of the last modification" }, created_by: { type: "string", description: "User or system that created this node" }, version: { type: "integer", minimum: 1, description: "Version number of this node (incremented on updates)" } } } } }), validateSpecNodeRelationship = sharedAjv.compile({ $schema: "http://json-schema.org/draft-07/schema#", title: "SpecNodeRelationship", description: "Base type for relationship type definitions in the specification. Defines valid relationships between node types, including cardinality, strength, and semantic properties.", type: "object", required: ["id", "source_spec_node_id", "destination_spec_node_id", "predicate"], additionalProperties: !1, properties: { id: { type: "string", pattern: "^[a-z-]+\\.[a-z-]+\\.[a-z-]+$", description: "Unique relationship ID in format: {source-layer}.{predicate}.{dest-layer}. All components use lowercase with hyphens.", examples: ["motivation.supports.motivation", "motivation.realizes.business", "api.exposes.data-model"] }, source_spec_node_id: { type: "string", pattern: "^[a-z-]+\\.[a-z][a-z0-9-]*$", description: "SpecNode ID that can serve as the source of this relationship type" }, source_layer: { type: "string", pattern: "^[a-z][a-z0-9-]*$", description: "Denormalized layer ID extracted from source_spec_node_id for efficient queries" }, destination_spec_node_id: { type: "string", pattern: "^[a-z-]+\\.[a-z][a-z0-9-]*$", description: "SpecNode ID that can serve as the destination of this relationship type" }, destination_layer: { type: "string", pattern: "^[a-z][a-z0-9-]*$", description: "Denormalized layer ID extracted from destination_spec_node_id for efficient queries" }, predicate: { type: "string", description: "Semantic predicate from PredicateCatalog describing the relationship type. Must be a valid predicate name.", examples: ["supports", "realizes", "fulfills", "implements", "uses", "consumes"] }, cardinality: { type: "string", enum: ["one-to-one", "one-to-many", "many-to-one", "many-to-many"], description: "Multiplicity constraint on this relationship type. Defines how many source nodes can relate to how many destination nodes.", default: "many-to-many" }, strength: { type: "string", enum: ["critical", "high", "medium", "low"], description: "Typical importance or strength of this relationship type", default: "medium" }, required: { type: "boolean", description: "Whether instances of the source node type must have at least one relationship of this type", default: !1 }, attributes: { type: "object", description: "Optional schema defining attributes that can appear on relationship instances of this type", additionalProperties: { $ref: "urn:dr:spec:base:attribute-spec#/definitions/AttributeSpec" }, minProperties: 0, examples: [{ reason: { type: "string", description: "Explanation for why this relationship exists" }, strength_override: { type: "enum", enum_values: ["critical", "high", "medium", "low"], description: "Instance-specific strength override" } }] } } }), validateSourceReference = sharedAjv.compile({ $schema: "http://json-schema.org/draft-07/schema#", title: "Source Code Reference Definitions", description: "Reusable JSON Schema definitions for linking architecture elements to source code locations", version: "1.0.0", definitions: { ProvenanceType: { type: "string", enum: ["extracted", "manual", "inferred", "generated"], description: "How this reference was created: extracted (automated ingestion), manual (human added), inferred (pattern matching), generated (code generated from model)" }, SourceLocation: { type: "object", description: "A specific location in source code, identified by file path and optional symbol", required: ["file"], properties: { file: { type: "string", minLength: 1, description: "File path relative to repository root" }, symbol: { type: "string", description: "Named code element (e.g., ClassName.methodName, function_name)" } } }, RepositoryContext: { type: "object", description: "Repository context for the source reference", properties: { url: { type: "string", format: "uri", description: "Git remote URL (HTTPS or SSH format)" }, commit: { type: "string", pattern: "^[0-9a-f]{40}$", description: "Full 40-character Git commit SHA" } } }, SourceReference: { type: "object", description: "Links entity to source code location(s) with provenance tracking. For inferred or generated elements, locations may be omitted when no source file exists yet.", required: ["provenance"], properties: { provenance: { $ref: "#/definitions/ProvenanceType" }, locations: { type: "array", minItems: 1, items: { $ref: "#/definitions/SourceLocation" }, description: "One or more source code locations. Required for extracted and manual provenance; optional for inferred and generated." }, repository: { $ref: "#/definitions/RepositoryContext" } } } } }), validateAttributeSpec = sharedAjv.compile({ $schema: "http://json-schema.org/draft-07/schema#", title: "AttributeSpec Definitions", description: "Reusable definition for attribute specifications used in spec-level schemas (e.g., spec-node-relationship attributes)", definitions: { AttributeSpec: { type: "object", title: "AttributeSpec", description: "Specification for a single attribute that can appear on node or relationship instances", required: ["type", "description"], additionalProperties: !1, properties: { type: { type: "string", enum: ["string", "integer", "number", "boolean", "array", "object", "enum"], description: "The JSON type of this attribute" }, description: { type: "string", description: "Human-readable description of this attribute's purpose" }, enum_values: { type: "array", items: { type: "string" }, description: "Required when type is 'enum'. Lists the valid string values for this attribute.", examples: [["high", "medium", "low"], ["active", "inactive", "archived"]] }, format: { type: "string", description: "Optional format constraint for string types (e.g., 'email', 'uri', 'date-time')", examples: ["email", "uri", "date-time", "uuid"] }, default: { description: "Default value for this attribute when not provided on a node instance. Can be any JSON value." } }, if: { properties: { type: { const: "enum" } }, required: ["type"] }, then: { required: ["type", "description", "enum_values"] } } } });
|
|
11
|
+
export {
|
|
12
|
+
validateAttributeSpec,
|
|
13
|
+
validateSourceReference,
|
|
14
|
+
validateSpecNode,
|
|
15
|
+
validateSpecNodeRelationship
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=compiled-validators.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/generated/compiled-validators.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * GENERATED FILE - DO NOT EDIT\n * This file is automatically generated by scripts/generate-validators.ts\n * during the build process. Changes will be overwritten.\n *\n * Pre-compiled AJV validators for base schemas\n * Eliminates runtime schema loading overhead by baking validators into the bundle\n *\n * Source: cli/src/schemas/bundled/base/\n * Build-time generation prevents runtime file I/O and schema compilation\n */\n\nimport Ajv from \"ajv\";\nimport { ValidateFunction } from \"ajv\";\nimport addFormats from \"ajv-formats\";\n\n\n// Shared AJV instance for all validators to handle schema references\nconst sharedAjv = (() => {\n const ajv = new Ajv({\n allErrors: true,\n strict: false,\n validateFormats: true,\n });\n addFormats(ajv);\n\n // Register all base schemas for reference resolution\n ajv.addSchema({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"SpecNode\",\"description\":\"Base schema for all spec node types. Each node type schema extends this with type-specific attribute constraints via allOf.\",\"type\":\"object\",\"required\":[\"id\",\"path\",\"spec_node_id\",\"type\",\"name\"],\"additionalProperties\":false,\"properties\":{\"id\":{\"type\":\"string\",\"format\":\"uuid\",\"description\":\"Unique node instance identifier (UUIDv4). Globally unique across the entire model.\",\"examples\":[\"550e8400-e29b-41d4-a716-446655440000\"]},\"path\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*\\\\.[a-z][a-z0-9-]*\\\\.[a-z][a-z0-9-]*$\",\"description\":\"Human-readable element path in format {layer}.{type}.{name} (e.g., 'motivation.goal.increase-revenue')\"},\"spec_node_id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z][a-z0-9-]*$\",\"description\":\"Reference to the spec node type that this node conforms to (e.g., 'motivation.goal')\"},\"type\":{\"type\":\"string\",\"description\":\"Denormalized node type for efficient filtering and queries. Extracted from spec_node_id (the part after the dot).\",\"examples\":[\"goal\",\"requirement\",\"endpoint\",\"table\"]},\"layer_id\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*$\",\"description\":\"Denormalized layer ID for efficient layer-scoped queries. Extracted from spec_node_id (the part before the dot).\"},\"name\":{\"type\":\"string\",\"description\":\"Human-readable instance name\",\"examples\":[\"Improve Customer Satisfaction\",\"User Login API\",\"Customer Table\"]},\"description\":{\"type\":\"string\",\"description\":\"Optional detailed description of this specific node instance\"},\"attributes\":{\"type\":\"object\",\"description\":\"Attribute values for this node instance. Keys must correspond to attributes defined in the per-type schema, and values must conform to the type constraints.\"},\"source_reference\":{\"$ref\":\"urn:dr:spec:base:source-references#/definitions/SourceReference\",\"description\":\"Optional provenance tracking linking this node to source code locations\"},\"metadata\":{\"type\":\"object\",\"description\":\"Optional metadata about the lifecycle and version of this node instance\",\"additionalProperties\":false,\"properties\":{\"created_at\":{\"type\":\"string\",\"format\":\"date-time\",\"description\":\"ISO 8601 timestamp when this node was created\"},\"updated_at\":{\"type\":\"string\",\"format\":\"date-time\",\"description\":\"ISO 8601 timestamp of the last modification\"},\"created_by\":{\"type\":\"string\",\"description\":\"User or system that created this node\"},\"version\":{\"type\":\"integer\",\"minimum\":1,\"description\":\"Version number of this node (incremented on updates)\"}}}}}, \"urn:dr:spec:base:spec-node\");\n ajv.addSchema({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"SpecNodeRelationship\",\"description\":\"Base type for relationship type definitions in the specification. Defines valid relationships between node types, including cardinality, strength, and semantic properties.\",\"type\":\"object\",\"required\":[\"id\",\"source_spec_node_id\",\"destination_spec_node_id\",\"predicate\"],\"additionalProperties\":false,\"properties\":{\"id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z-]+\\\\.[a-z-]+$\",\"description\":\"Unique relationship ID in format: {source-layer}.{predicate}.{dest-layer}. All components use lowercase with hyphens.\",\"examples\":[\"motivation.supports.motivation\",\"motivation.realizes.business\",\"api.exposes.data-model\"]},\"source_spec_node_id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z][a-z0-9-]*$\",\"description\":\"SpecNode ID that can serve as the source of this relationship type\"},\"source_layer\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*$\",\"description\":\"Denormalized layer ID extracted from source_spec_node_id for efficient queries\"},\"destination_spec_node_id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z][a-z0-9-]*$\",\"description\":\"SpecNode ID that can serve as the destination of this relationship type\"},\"destination_layer\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*$\",\"description\":\"Denormalized layer ID extracted from destination_spec_node_id for efficient queries\"},\"predicate\":{\"type\":\"string\",\"description\":\"Semantic predicate from PredicateCatalog describing the relationship type. Must be a valid predicate name.\",\"examples\":[\"supports\",\"realizes\",\"fulfills\",\"implements\",\"uses\",\"consumes\"]},\"cardinality\":{\"type\":\"string\",\"enum\":[\"one-to-one\",\"one-to-many\",\"many-to-one\",\"many-to-many\"],\"description\":\"Multiplicity constraint on this relationship type. Defines how many source nodes can relate to how many destination nodes.\",\"default\":\"many-to-many\"},\"strength\":{\"type\":\"string\",\"enum\":[\"critical\",\"high\",\"medium\",\"low\"],\"description\":\"Typical importance or strength of this relationship type\",\"default\":\"medium\"},\"required\":{\"type\":\"boolean\",\"description\":\"Whether instances of the source node type must have at least one relationship of this type\",\"default\":false},\"attributes\":{\"type\":\"object\",\"description\":\"Optional schema defining attributes that can appear on relationship instances of this type\",\"additionalProperties\":{\"$ref\":\"urn:dr:spec:base:attribute-spec#/definitions/AttributeSpec\"},\"minProperties\":0,\"examples\":[{\"reason\":{\"type\":\"string\",\"description\":\"Explanation for why this relationship exists\"},\"strength_override\":{\"type\":\"enum\",\"enum_values\":[\"critical\",\"high\",\"medium\",\"low\"],\"description\":\"Instance-specific strength override\"}}]}}}, \"urn:dr:spec:base:spec-node-relationship\");\n ajv.addSchema({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"Source Code Reference Definitions\",\"description\":\"Reusable JSON Schema definitions for linking architecture elements to source code locations\",\"version\":\"1.0.0\",\"definitions\":{\"ProvenanceType\":{\"type\":\"string\",\"enum\":[\"extracted\",\"manual\",\"inferred\",\"generated\"],\"description\":\"How this reference was created: extracted (automated ingestion), manual (human added), inferred (pattern matching), generated (code generated from model)\"},\"SourceLocation\":{\"type\":\"object\",\"description\":\"A specific location in source code, identified by file path and optional symbol\",\"required\":[\"file\"],\"properties\":{\"file\":{\"type\":\"string\",\"minLength\":1,\"description\":\"File path relative to repository root\"},\"symbol\":{\"type\":\"string\",\"description\":\"Named code element (e.g., ClassName.methodName, function_name)\"}}},\"RepositoryContext\":{\"type\":\"object\",\"description\":\"Repository context for the source reference\",\"properties\":{\"url\":{\"type\":\"string\",\"format\":\"uri\",\"description\":\"Git remote URL (HTTPS or SSH format)\"},\"commit\":{\"type\":\"string\",\"pattern\":\"^[0-9a-f]{40}$\",\"description\":\"Full 40-character Git commit SHA\"}}},\"SourceReference\":{\"type\":\"object\",\"description\":\"Links entity to source code location(s) with provenance tracking. For inferred or generated elements, locations may be omitted when no source file exists yet.\",\"required\":[\"provenance\"],\"properties\":{\"provenance\":{\"$ref\":\"#/definitions/ProvenanceType\"},\"locations\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/SourceLocation\"},\"description\":\"One or more source code locations. Required for extracted and manual provenance; optional for inferred and generated.\"},\"repository\":{\"$ref\":\"#/definitions/RepositoryContext\"}}}}}, \"urn:dr:spec:base:source-references\");\n ajv.addSchema({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"AttributeSpec Definitions\",\"description\":\"Reusable definition for attribute specifications used in spec-level schemas (e.g., spec-node-relationship attributes)\",\"definitions\":{\"AttributeSpec\":{\"type\":\"object\",\"title\":\"AttributeSpec\",\"description\":\"Specification for a single attribute that can appear on node or relationship instances\",\"required\":[\"type\",\"description\"],\"additionalProperties\":false,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"string\",\"integer\",\"number\",\"boolean\",\"array\",\"object\",\"enum\"],\"description\":\"The JSON type of this attribute\"},\"description\":{\"type\":\"string\",\"description\":\"Human-readable description of this attribute's purpose\"},\"enum_values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"description\":\"Required when type is 'enum'. Lists the valid string values for this attribute.\",\"examples\":[[\"high\",\"medium\",\"low\"],[\"active\",\"inactive\",\"archived\"]]},\"format\":{\"type\":\"string\",\"description\":\"Optional format constraint for string types (e.g., 'email', 'uri', 'date-time')\",\"examples\":[\"email\",\"uri\",\"date-time\",\"uuid\"]},\"default\":{\"description\":\"Default value for this attribute when not provided on a node instance. Can be any JSON value.\"}},\"if\":{\"properties\":{\"type\":{\"const\":\"enum\"}},\"required\":[\"type\"]},\"then\":{\"required\":[\"type\",\"description\",\"enum_values\"]}}}}, \"urn:dr:spec:base:attribute-spec\");\n\n return ajv;\n})();\n\n/**\n * Pre-compiled validator for SpecNode\n * Compiled once at module load, pre-cached for use throughout runtime\n */\nexport const validateSpecNode: ValidateFunction = sharedAjv.compile({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"SpecNode\",\"description\":\"Base schema for all spec node types. Each node type schema extends this with type-specific attribute constraints via allOf.\",\"type\":\"object\",\"required\":[\"id\",\"path\",\"spec_node_id\",\"type\",\"name\"],\"additionalProperties\":false,\"properties\":{\"id\":{\"type\":\"string\",\"format\":\"uuid\",\"description\":\"Unique node instance identifier (UUIDv4). Globally unique across the entire model.\",\"examples\":[\"550e8400-e29b-41d4-a716-446655440000\"]},\"path\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*\\\\.[a-z][a-z0-9-]*\\\\.[a-z][a-z0-9-]*$\",\"description\":\"Human-readable element path in format {layer}.{type}.{name} (e.g., 'motivation.goal.increase-revenue')\"},\"spec_node_id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z][a-z0-9-]*$\",\"description\":\"Reference to the spec node type that this node conforms to (e.g., 'motivation.goal')\"},\"type\":{\"type\":\"string\",\"description\":\"Denormalized node type for efficient filtering and queries. Extracted from spec_node_id (the part after the dot).\",\"examples\":[\"goal\",\"requirement\",\"endpoint\",\"table\"]},\"layer_id\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*$\",\"description\":\"Denormalized layer ID for efficient layer-scoped queries. Extracted from spec_node_id (the part before the dot).\"},\"name\":{\"type\":\"string\",\"description\":\"Human-readable instance name\",\"examples\":[\"Improve Customer Satisfaction\",\"User Login API\",\"Customer Table\"]},\"description\":{\"type\":\"string\",\"description\":\"Optional detailed description of this specific node instance\"},\"attributes\":{\"type\":\"object\",\"description\":\"Attribute values for this node instance. Keys must correspond to attributes defined in the per-type schema, and values must conform to the type constraints.\"},\"source_reference\":{\"$ref\":\"urn:dr:spec:base:source-references#/definitions/SourceReference\",\"description\":\"Optional provenance tracking linking this node to source code locations\"},\"metadata\":{\"type\":\"object\",\"description\":\"Optional metadata about the lifecycle and version of this node instance\",\"additionalProperties\":false,\"properties\":{\"created_at\":{\"type\":\"string\",\"format\":\"date-time\",\"description\":\"ISO 8601 timestamp when this node was created\"},\"updated_at\":{\"type\":\"string\",\"format\":\"date-time\",\"description\":\"ISO 8601 timestamp of the last modification\"},\"created_by\":{\"type\":\"string\",\"description\":\"User or system that created this node\"},\"version\":{\"type\":\"integer\",\"minimum\":1,\"description\":\"Version number of this node (incremented on updates)\"}}}}});\n/**\n * Pre-compiled validator for SpecNodeRelationship\n * Compiled once at module load, pre-cached for use throughout runtime\n */\nexport const validateSpecNodeRelationship: ValidateFunction = sharedAjv.compile({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"SpecNodeRelationship\",\"description\":\"Base type for relationship type definitions in the specification. Defines valid relationships between node types, including cardinality, strength, and semantic properties.\",\"type\":\"object\",\"required\":[\"id\",\"source_spec_node_id\",\"destination_spec_node_id\",\"predicate\"],\"additionalProperties\":false,\"properties\":{\"id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z-]+\\\\.[a-z-]+$\",\"description\":\"Unique relationship ID in format: {source-layer}.{predicate}.{dest-layer}. All components use lowercase with hyphens.\",\"examples\":[\"motivation.supports.motivation\",\"motivation.realizes.business\",\"api.exposes.data-model\"]},\"source_spec_node_id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z][a-z0-9-]*$\",\"description\":\"SpecNode ID that can serve as the source of this relationship type\"},\"source_layer\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*$\",\"description\":\"Denormalized layer ID extracted from source_spec_node_id for efficient queries\"},\"destination_spec_node_id\":{\"type\":\"string\",\"pattern\":\"^[a-z-]+\\\\.[a-z][a-z0-9-]*$\",\"description\":\"SpecNode ID that can serve as the destination of this relationship type\"},\"destination_layer\":{\"type\":\"string\",\"pattern\":\"^[a-z][a-z0-9-]*$\",\"description\":\"Denormalized layer ID extracted from destination_spec_node_id for efficient queries\"},\"predicate\":{\"type\":\"string\",\"description\":\"Semantic predicate from PredicateCatalog describing the relationship type. Must be a valid predicate name.\",\"examples\":[\"supports\",\"realizes\",\"fulfills\",\"implements\",\"uses\",\"consumes\"]},\"cardinality\":{\"type\":\"string\",\"enum\":[\"one-to-one\",\"one-to-many\",\"many-to-one\",\"many-to-many\"],\"description\":\"Multiplicity constraint on this relationship type. Defines how many source nodes can relate to how many destination nodes.\",\"default\":\"many-to-many\"},\"strength\":{\"type\":\"string\",\"enum\":[\"critical\",\"high\",\"medium\",\"low\"],\"description\":\"Typical importance or strength of this relationship type\",\"default\":\"medium\"},\"required\":{\"type\":\"boolean\",\"description\":\"Whether instances of the source node type must have at least one relationship of this type\",\"default\":false},\"attributes\":{\"type\":\"object\",\"description\":\"Optional schema defining attributes that can appear on relationship instances of this type\",\"additionalProperties\":{\"$ref\":\"urn:dr:spec:base:attribute-spec#/definitions/AttributeSpec\"},\"minProperties\":0,\"examples\":[{\"reason\":{\"type\":\"string\",\"description\":\"Explanation for why this relationship exists\"},\"strength_override\":{\"type\":\"enum\",\"enum_values\":[\"critical\",\"high\",\"medium\",\"low\"],\"description\":\"Instance-specific strength override\"}}]}}});\n/**\n * Pre-compiled validator for Source Code Reference Definitions\n * Compiled once at module load, pre-cached for use throughout runtime\n */\nexport const validateSourceReference: ValidateFunction = sharedAjv.compile({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"Source Code Reference Definitions\",\"description\":\"Reusable JSON Schema definitions for linking architecture elements to source code locations\",\"version\":\"1.0.0\",\"definitions\":{\"ProvenanceType\":{\"type\":\"string\",\"enum\":[\"extracted\",\"manual\",\"inferred\",\"generated\"],\"description\":\"How this reference was created: extracted (automated ingestion), manual (human added), inferred (pattern matching), generated (code generated from model)\"},\"SourceLocation\":{\"type\":\"object\",\"description\":\"A specific location in source code, identified by file path and optional symbol\",\"required\":[\"file\"],\"properties\":{\"file\":{\"type\":\"string\",\"minLength\":1,\"description\":\"File path relative to repository root\"},\"symbol\":{\"type\":\"string\",\"description\":\"Named code element (e.g., ClassName.methodName, function_name)\"}}},\"RepositoryContext\":{\"type\":\"object\",\"description\":\"Repository context for the source reference\",\"properties\":{\"url\":{\"type\":\"string\",\"format\":\"uri\",\"description\":\"Git remote URL (HTTPS or SSH format)\"},\"commit\":{\"type\":\"string\",\"pattern\":\"^[0-9a-f]{40}$\",\"description\":\"Full 40-character Git commit SHA\"}}},\"SourceReference\":{\"type\":\"object\",\"description\":\"Links entity to source code location(s) with provenance tracking. For inferred or generated elements, locations may be omitted when no source file exists yet.\",\"required\":[\"provenance\"],\"properties\":{\"provenance\":{\"$ref\":\"#/definitions/ProvenanceType\"},\"locations\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/SourceLocation\"},\"description\":\"One or more source code locations. Required for extracted and manual provenance; optional for inferred and generated.\"},\"repository\":{\"$ref\":\"#/definitions/RepositoryContext\"}}}}});\n/**\n * Pre-compiled validator for AttributeSpec Definitions\n * Compiled once at module load, pre-cached for use throughout runtime\n */\nexport const validateAttributeSpec: ValidateFunction = sharedAjv.compile({\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"AttributeSpec Definitions\",\"description\":\"Reusable definition for attribute specifications used in spec-level schemas (e.g., spec-node-relationship attributes)\",\"definitions\":{\"AttributeSpec\":{\"type\":\"object\",\"title\":\"AttributeSpec\",\"description\":\"Specification for a single attribute that can appear on node or relationship instances\",\"required\":[\"type\",\"description\"],\"additionalProperties\":false,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"string\",\"integer\",\"number\",\"boolean\",\"array\",\"object\",\"enum\"],\"description\":\"The JSON type of this attribute\"},\"description\":{\"type\":\"string\",\"description\":\"Human-readable description of this attribute's purpose\"},\"enum_values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"description\":\"Required when type is 'enum'. Lists the valid string values for this attribute.\",\"examples\":[[\"high\",\"medium\",\"low\"],[\"active\",\"inactive\",\"archived\"]]},\"format\":{\"type\":\"string\",\"description\":\"Optional format constraint for string types (e.g., 'email', 'uri', 'date-time')\",\"examples\":[\"email\",\"uri\",\"date-time\",\"uuid\"]},\"default\":{\"description\":\"Default value for this attribute when not provided on a node instance. Can be any JSON value.\"}},\"if\":{\"properties\":{\"type\":{\"const\":\"enum\"}},\"required\":[\"type\"]},\"then\":{\"required\":[\"type\",\"description\",\"enum_values\"]}}}});\n"],
|
|
5
|
+
"mappings": "AAYA,OAAO,SAAS;AAEhB,OAAO,gBAAgB;AAIvB,MAAM,aAAa,MAAK;AACtB,QAAM,MAAM,IAAI,IAAI;IAClB,WAAW;IACX,QAAQ;IACR,iBAAiB;GAClB;AACD,oBAAW,GAAG,GAGd,IAAI,UAAU,EAAC,SAAU,2CAA0C,OAAQ,YAAW,aAAc,+HAA8H,MAAO,UAAS,UAAW,CAAC,MAAK,QAAO,gBAAe,QAAO,MAAM,GAAE,sBAAuB,IAAM,YAAa,EAAC,IAAK,EAAC,MAAO,UAAS,QAAS,QAAO,aAAc,sFAAqF,UAAW,CAAC,sCAAsC,EAAC,GAAE,MAAO,EAAC,MAAO,UAAS,SAAU,yDAAwD,aAAc,yGAAwG,GAAE,cAAe,EAAC,MAAO,UAAS,SAAU,+BAA8B,aAAc,uFAAsF,GAAE,MAAO,EAAC,MAAO,UAAS,aAAc,qHAAoH,UAAW,CAAC,QAAO,eAAc,YAAW,OAAO,EAAC,GAAE,UAAW,EAAC,MAAO,UAAS,SAAU,qBAAoB,aAAc,mHAAkH,GAAE,MAAO,EAAC,MAAO,UAAS,aAAc,gCAA+B,UAAW,CAAC,iCAAgC,kBAAiB,gBAAgB,EAAC,GAAE,aAAc,EAAC,MAAO,UAAS,aAAc,+DAA8D,GAAE,YAAa,EAAC,MAAO,UAAS,aAAc,+JAA8J,GAAE,kBAAmB,EAAC,MAAO,mEAAkE,aAAc,0EAAyE,GAAE,UAAW,EAAC,MAAO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EAAC,MAAO,UAAS,OAAQ,iBAAgB,aAAc,0FAAyF,UAAW,CAAC,QAAO,aAAa,GAAE,sBAAuB,IAAM,YAAa,EAAC,MAAO,EAAC,MAAO,UAAS,MAAO,CAAC,UAAS,WAAU,UAAS,WAAU,SAAQ,UAAS,MAAM,GAAE,aAAc,kCAAiC,GAAE,aAAc,EAAC,MAAO,UAAS,aAAc,yDAAwD,GAAE,aAAc,EAAC,MAAO,SAAQ,OAAQ,EAAC,MAAO,SAAQ,GAAE,aAAc,mFAAkF,UAAW,CAAC,CAAC,QAAO,UAAS,KAAK,GAAE,CAAC,UAAS,YAAW,UAAU,CAAC,EAAC,GAAE,QAAS,EAAC,MAAO,UAAS,aAAc,mFAAkF,UAAW,CAAC,SAAQ,OAAM,aAAY,MAAM,EAAC,GAAE,SAAU,EAAC,aAAc,gGAA+F,EAAC,GAAE,IAAK,EAAC,YAAa,EAAC,MAAO,EAAC,OAAQ,OAAM,EAAC,GAAE,UAAW,CAAC,MAAM,EAAC,GAAE,MAAO,EAAC,UAAW,CAAC,QAAO,eAAc,aAAa,EAAC,EAAC,EAAC,EAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LAYERS, LAYERS_BY_NUMBER, LAYER_HIERARCHY, getLayerByNumber, getLayerById, isValidLayer, getNodeTypesForLayer, getAllLayerIds, getAllLayers } from "./layer-registry.js";
|
|
2
|
+
import { isLayerId } from "./layer-types.js";
|
|
3
|
+
import { NODE_TYPES, getNodeType, getNodeTypesForLayer as getNodeTypesForLayer2, isValidNodeType, getRequiredAttributes, isValidSpecNodeId } from "./node-types.js";
|
|
4
|
+
import { RELATIONSHIPS, RELATIONSHIPS_BY_SOURCE, RELATIONSHIPS_BY_PREDICATE, RELATIONSHIPS_BY_DESTINATION, getValidRelationships, isValidRelationship, getValidPredicatesForSource, getValidDestinationsForSourceAndPredicate } from "./relationship-index.js";
|
|
5
|
+
export {
|
|
6
|
+
LAYERS,
|
|
7
|
+
LAYERS_BY_NUMBER,
|
|
8
|
+
LAYER_HIERARCHY,
|
|
9
|
+
NODE_TYPES,
|
|
10
|
+
RELATIONSHIPS,
|
|
11
|
+
RELATIONSHIPS_BY_DESTINATION,
|
|
12
|
+
RELATIONSHIPS_BY_PREDICATE,
|
|
13
|
+
RELATIONSHIPS_BY_SOURCE,
|
|
14
|
+
getAllLayerIds,
|
|
15
|
+
getAllLayers,
|
|
16
|
+
getLayerById,
|
|
17
|
+
getLayerByNumber,
|
|
18
|
+
getNodeType,
|
|
19
|
+
getNodeTypesForLayer2 as getNodeTypesForLayer,
|
|
20
|
+
getRequiredAttributes,
|
|
21
|
+
getNodeTypesForLayer as getSpecNodeTypesForLayer,
|
|
22
|
+
getValidDestinationsForSourceAndPredicate,
|
|
23
|
+
getValidPredicatesForSource,
|
|
24
|
+
getValidRelationships,
|
|
25
|
+
isLayerId,
|
|
26
|
+
isValidLayer,
|
|
27
|
+
isValidNodeType,
|
|
28
|
+
isValidRelationship,
|
|
29
|
+
isValidSpecNodeId
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/generated/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * GENERATED FILE - DO NOT EDIT\n * This file is automatically generated by scripts/generate-registry.ts\n * during the build process. Changes will be overwritten.\n *\n * Central exports for all generated code\n */\n\n// Layer registry exports (legacy spec node IDs)\nexport {\n LayerMetadata,\n LAYERS,\n LAYERS_BY_NUMBER,\n LAYER_HIERARCHY,\n getLayerByNumber,\n getLayerById,\n isValidLayer,\n getNodeTypesForLayer as getSpecNodeTypesForLayer,\n getAllLayerIds,\n getAllLayers,\n} from \"./layer-registry.js\";\n\n// Layer types exports\nexport type { LayerId } from \"./layer-types.js\";\nexport { isLayerId } from \"./layer-types.js\";\n\n// Node types exports (new detailed type information)\nexport type { SpecNodeId, NodeType, NodeTypeInfo } from \"./node-types.js\";\nexport {\n NODE_TYPES,\n getNodeType,\n getNodeTypesForLayer,\n isValidNodeType,\n getRequiredAttributes,\n isValidSpecNodeId,\n} from \"./node-types.js\";\n\n// Relationship index exports (schema-based relationship validation)\nexport type { RelationshipSpec } from \"./relationship-index.js\";\nexport {\n RELATIONSHIPS,\n RELATIONSHIPS_BY_SOURCE,\n RELATIONSHIPS_BY_PREDICATE,\n RELATIONSHIPS_BY_DESTINATION,\n getValidRelationships,\n isValidRelationship,\n getValidPredicatesForSource,\n getValidDestinationsForSourceAndPredicate,\n} from \"./relationship-index.js\";\n"],
|
|
5
|
+
"mappings": "AASA,SAEE,QACA,kBACA,iBACA,kBACA,cACA,cACwB,sBACxB,gBACA,oBACK;AAIP,SAAS,iBAAiB;AAI1B,SACE,YACA,aACA,wBAAAA,uBACA,iBACA,uBACA,yBACK;AAIP,SACE,eACA,yBACA,4BACA,8BACA,uBACA,qBACA,6BACA,iDACK;",
|
|
6
|
+
"names": ["getNodeTypesForLayer"]
|
|
7
|
+
}
|