kibi-cli 0.12.8 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/kibi +3 -1
- package/dist/cli-command.d.ts +5 -0
- package/dist/cli-command.d.ts.map +1 -0
- package/dist/cli-command.js +9 -0
- package/dist/cli-errors.d.ts +13 -0
- package/dist/cli-errors.d.ts.map +1 -0
- package/dist/cli-errors.js +26 -0
- package/dist/cli-input.d.ts +6 -0
- package/dist/cli-input.d.ts.map +1 -0
- package/dist/cli-input.js +54 -0
- package/dist/cli-json-command.d.ts +14 -0
- package/dist/cli-json-command.d.ts.map +1 -0
- package/dist/cli-json-command.js +96 -0
- package/dist/cli-protocol.d.ts +12 -0
- package/dist/cli-protocol.d.ts.map +1 -0
- package/dist/cli-protocol.js +37 -0
- package/dist/cli-register-foundation.d.ts +3 -0
- package/dist/cli-register-foundation.d.ts.map +1 -0
- package/dist/cli-register-foundation.js +90 -0
- package/dist/cli-register-maintenance.d.ts +3 -0
- package/dist/cli-register-maintenance.d.ts.map +1 -0
- package/dist/cli-register-maintenance.js +36 -0
- package/dist/cli-register-reporting.d.ts +3 -0
- package/dist/cli-register-reporting.d.ts.map +1 -0
- package/dist/cli-register-reporting.js +101 -0
- package/dist/cli-register-skills.d.ts +3 -0
- package/dist/cli-register-skills.d.ts.map +1 -0
- package/dist/cli-register-skills.js +71 -0
- package/dist/cli-validate.d.ts +18 -0
- package/dist/cli-validate.d.ts.map +1 -0
- package/dist/cli-validate.js +45 -0
- package/dist/cli.d.ts +4 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +48 -210
- package/dist/commands/aggregated-checks.d.ts +1 -1
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +28 -34
- package/dist/commands/check.d.ts +2 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +145 -152
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +12 -17
- package/dist/commands/discovery-shared.d.ts +3 -1
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +8 -209
- package/dist/commands/discovery-table.d.ts +3 -0
- package/dist/commands/discovery-table.d.ts.map +1 -0
- package/dist/commands/discovery-table.js +204 -0
- package/dist/commands/gaps.d.ts.map +1 -1
- package/dist/commands/gaps.js +15 -19
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/graph.js +15 -21
- package/dist/commands/query.d.ts +7 -7
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +98 -204
- package/dist/commands/search.d.ts +4 -4
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +14 -27
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +6 -7
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +8 -1
- package/dist/commands/sync/extraction.d.ts +6 -1
- package/dist/commands/sync/extraction.d.ts.map +1 -1
- package/dist/commands/sync/extraction.js +7 -3
- package/dist/commands/sync/manifest.d.ts +1 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +9 -17
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +51 -2
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +18 -0
- package/dist/extractors/markdown.d.ts +20 -2
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +38 -1
- package/dist/extractors/symbols-coordinator.d.ts +1 -1
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +73 -1
- package/dist/operations/autopilot/activation.d.ts +4 -0
- package/dist/operations/autopilot/activation.d.ts.map +1 -0
- package/dist/operations/autopilot/activation.js +130 -0
- package/dist/operations/autopilot/candidate-helpers.d.ts +13 -0
- package/dist/operations/autopilot/candidate-helpers.d.ts.map +1 -0
- package/dist/operations/autopilot/candidate-helpers.js +55 -0
- package/dist/operations/autopilot/candidates.d.ts +4 -0
- package/dist/operations/autopilot/candidates.d.ts.map +1 -0
- package/dist/operations/autopilot/candidates.js +114 -0
- package/dist/operations/autopilot/discovery-evidence.d.ts +10 -0
- package/dist/operations/autopilot/discovery-evidence.d.ts.map +1 -0
- package/dist/operations/autopilot/discovery-evidence.js +158 -0
- package/dist/operations/autopilot/discovery.d.ts +4 -0
- package/dist/operations/autopilot/discovery.d.ts.map +1 -0
- package/dist/operations/autopilot/discovery.js +100 -0
- package/dist/operations/autopilot/generate.d.ts +8 -0
- package/dist/operations/autopilot/generate.d.ts.map +1 -0
- package/dist/operations/autopilot/generate.js +112 -0
- package/dist/operations/autopilot/guidance-actions.d.ts +3 -0
- package/dist/operations/autopilot/guidance-actions.d.ts.map +1 -0
- package/dist/operations/autopilot/guidance-actions.js +79 -0
- package/dist/operations/autopilot/guidance.d.ts +14 -0
- package/dist/operations/autopilot/guidance.d.ts.map +1 -0
- package/dist/operations/autopilot/guidance.js +124 -0
- package/dist/operations/autopilot/markdown-candidates.d.ts +7 -0
- package/dist/operations/autopilot/markdown-candidates.d.ts.map +1 -0
- package/dist/operations/autopilot/markdown-candidates.js +134 -0
- package/dist/operations/autopilot/presentation.d.ts +13 -0
- package/dist/operations/autopilot/presentation.d.ts.map +1 -0
- package/dist/operations/autopilot/presentation.js +91 -0
- package/dist/operations/autopilot/requirement-claims.d.ts +3 -0
- package/dist/operations/autopilot/requirement-claims.d.ts.map +1 -0
- package/dist/operations/autopilot/requirement-claims.js +48 -0
- package/dist/operations/autopilot/types.d.ts +117 -0
- package/dist/operations/autopilot/types.d.ts.map +1 -0
- package/dist/operations/autopilot/types.js +8 -0
- package/dist/operations/modeling/model-requirement.d.ts +10 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
- package/dist/operations/modeling/model-requirement.js +108 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts +6 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-applyplan.js +104 -0
- package/dist/operations/modeling/predicate-catalog-1.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-1.js +200 -0
- package/dist/operations/modeling/predicate-catalog-2.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-2.js +197 -0
- package/dist/operations/modeling/predicate-catalog-3.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-3.js +193 -0
- package/dist/operations/modeling/predicate-catalog-4.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-4.js +149 -0
- package/dist/operations/modeling/predicate-catalog.d.ts +5 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog.js +29 -0
- package/dist/operations/modeling/predicate-inference-1.d.ts +16 -0
- package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-1.js +161 -0
- package/dist/operations/modeling/predicate-inference-2.d.ts +19 -0
- package/dist/operations/modeling/predicate-inference-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-2.js +169 -0
- package/dist/operations/modeling/predicate-inference-3.d.ts +15 -0
- package/dist/operations/modeling/predicate-inference-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-3.js +163 -0
- package/dist/operations/modeling/predicate-inference.d.ts +5 -0
- package/dist/operations/modeling/predicate-inference.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference.js +148 -0
- package/dist/operations/modeling/predicate-loader.d.ts +10 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-loader.js +88 -0
- package/dist/operations/modeling/predicate-ranker.d.ts +3 -0
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-ranker.js +24 -0
- package/dist/operations/modeling/predicate-score-1.d.ts +3 -0
- package/dist/operations/modeling/predicate-score-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-score-1.js +121 -0
- package/dist/operations/modeling/predicate-score-2.d.ts +3 -0
- package/dist/operations/modeling/predicate-score-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-score-2.js +122 -0
- package/dist/operations/modeling/predicate-score-3.d.ts +3 -0
- package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-score-3.js +54 -0
- package/dist/operations/modeling/predicate-types.d.ts +61 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-types.js +1 -0
- package/dist/operations/modeling/predicate-usage-hints-1.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-1.js +211 -0
- package/dist/operations/modeling/predicate-usage-hints-2.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-2.js +209 -0
- package/dist/operations/modeling/predicate-usage-hints-3.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-3.js +45 -0
- package/dist/operations/modeling/predicate-utils.d.ts +23 -0
- package/dist/operations/modeling/predicate-utils.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-utils.js +187 -0
- package/dist/operations/modeling/requirement-applyplan.d.ts +4 -0
- package/dist/operations/modeling/requirement-applyplan.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-applyplan.js +44 -0
- package/dist/operations/modeling/requirement-heuristics.d.ts +4 -0
- package/dist/operations/modeling/requirement-heuristics.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-heuristics.js +114 -0
- package/dist/operations/modeling/requirement-modeler.d.ts +8 -0
- package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-modeler.js +70 -0
- package/dist/operations/modeling/requirement-types.d.ts +49 -0
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-types.js +1 -0
- package/dist/operations/modeling/requirement-utils.d.ts +10 -0
- package/dist/operations/modeling/requirement-utils.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-utils.js +65 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +6 -0
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -0
- package/dist/operations/modeling/suggest-predicates.js +64 -0
- package/dist/operations/mutation/audit.d.ts +6 -0
- package/dist/operations/mutation/audit.d.ts.map +1 -0
- package/dist/operations/mutation/audit.js +22 -0
- package/dist/operations/mutation/contradictions.d.ts +10 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -0
- package/dist/operations/mutation/contradictions.js +40 -0
- package/dist/operations/mutation/delete.d.ts +5 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -0
- package/dist/operations/mutation/delete.js +67 -0
- package/dist/operations/mutation/relationships.d.ts +17 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -0
- package/dist/operations/mutation/relationships.js +134 -0
- package/dist/operations/mutation/save.d.ts +4 -0
- package/dist/operations/mutation/save.d.ts.map +1 -0
- package/dist/operations/mutation/save.js +14 -0
- package/dist/operations/mutation/serialization.d.ts +5 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -0
- package/dist/operations/mutation/serialization.js +85 -0
- package/dist/operations/mutation/strict-fact.d.ts +4 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -0
- package/dist/operations/mutation/strict-fact.js +67 -0
- package/dist/operations/mutation/symbol-granularity.d.ts +4 -0
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -0
- package/dist/operations/mutation/symbol-granularity.js +109 -0
- package/dist/operations/mutation/symbol-refresh.d.ts +10 -0
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -0
- package/dist/operations/mutation/symbol-refresh.js +105 -0
- package/dist/operations/mutation/types.d.ts +43 -0
- package/dist/operations/mutation/types.d.ts.map +1 -0
- package/dist/operations/mutation/types.js +1 -0
- package/dist/operations/mutation/upsert.d.ts +5 -0
- package/dist/operations/mutation/upsert.d.ts.map +1 -0
- package/dist/operations/mutation/upsert.js +103 -0
- package/dist/operations/mutation/validate-upsert.d.ts +5 -0
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -0
- package/dist/operations/mutation/validate-upsert.js +50 -0
- package/dist/operations/mutation/validation.d.ts +5 -0
- package/dist/operations/mutation/validation.d.ts.map +1 -0
- package/dist/operations/mutation/validation.js +107 -0
- package/dist/operations/mutation/warnings.d.ts +4 -0
- package/dist/operations/mutation/warnings.d.ts.map +1 -0
- package/dist/operations/mutation/warnings.js +17 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts +5 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/analysis-receipt.js +112 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +5 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/analyze-prose.js +271 -0
- package/dist/operations/semantic-advisor/clauses.d.ts +10 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/clauses.js +43 -0
- package/dist/operations/semantic-advisor/observation-plan.d.ts +3 -0
- package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/observation-plan.js +19 -0
- package/dist/operations/semantic-advisor/predicate-rule.d.ts +14 -0
- package/dist/operations/semantic-advisor/predicate-rule.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rule.js +22 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +79 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.js +140 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +83 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.js +150 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +48 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +102 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +71 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.js +133 -0
- package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts +29 -0
- package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/prose-coverage-evaluator.js +54 -0
- package/dist/operations/semantic-advisor/shared.d.ts +18 -0
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/shared.js +209 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts +4 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/strict-count-rules.js +62 -0
- package/dist/operations/semantic-advisor/strict-rules.d.ts +4 -0
- package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/strict-rules.js +106 -0
- package/dist/operations/semantic-advisor/types.d.ts +135 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/types.js +1 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +9 -2
- package/dist/prolog.d.ts +5 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +82 -30
- package/dist/public/impact/analyzer.d.ts +3 -0
- package/dist/public/impact/analyzer.d.ts.map +1 -0
- package/dist/public/impact/analyzer.js +54 -0
- package/dist/public/impact/coverage-depth-quality.d.ts +4 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -0
- package/dist/public/impact/coverage-depth-quality.js +179 -0
- package/dist/public/impact/diagnostics.d.ts +7 -0
- package/dist/public/impact/diagnostics.d.ts.map +1 -0
- package/dist/public/impact/diagnostics.js +126 -0
- package/dist/public/impact/diff-meaning.d.ts +2 -0
- package/dist/public/impact/diff-meaning.d.ts.map +1 -0
- package/dist/public/impact/diff-meaning.js +101 -0
- package/dist/public/impact/full-kb-quality.d.ts +10 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -0
- package/dist/public/impact/full-kb-quality.js +191 -0
- package/dist/public/impact/manifest.d.ts +5 -0
- package/dist/public/impact/manifest.d.ts.map +1 -0
- package/dist/public/impact/manifest.js +43 -0
- package/dist/public/impact/requirement-quality.d.ts +4 -0
- package/dist/public/impact/requirement-quality.d.ts.map +1 -0
- package/dist/public/impact/requirement-quality.js +199 -0
- package/dist/public/impact/source-changes.d.ts +5 -0
- package/dist/public/impact/source-changes.d.ts.map +1 -0
- package/dist/public/impact/source-changes.js +129 -0
- package/dist/public/impact/summaries.d.ts +6 -0
- package/dist/public/impact/summaries.d.ts.map +1 -0
- package/dist/public/impact/summaries.js +68 -0
- package/dist/public/impact/symbol-quality-model.d.ts +21 -0
- package/dist/public/impact/symbol-quality-model.d.ts.map +1 -0
- package/dist/public/impact/symbol-quality-model.js +116 -0
- package/dist/public/impact/symbol-quality.d.ts +4 -0
- package/dist/public/impact/symbol-quality.d.ts.map +1 -0
- package/dist/public/impact/symbol-quality.js +159 -0
- package/dist/public/impact/types.d.ts +79 -0
- package/dist/public/impact/types.d.ts.map +1 -0
- package/dist/public/impact/types.js +1 -0
- package/dist/public/impact-diagnostics.d.ts +7 -0
- package/dist/public/impact-diagnostics.d.ts.map +1 -0
- package/dist/public/impact-diagnostics.js +5 -0
- package/dist/public/operations/catalog.d.ts +907 -0
- package/dist/public/operations/catalog.d.ts.map +1 -0
- package/dist/public/operations/catalog.js +42 -0
- package/dist/public/operations/check-executor.d.ts +21 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -0
- package/dist/public/operations/check-executor.js +111 -0
- package/dist/public/operations/check-format-shared.d.ts +36 -0
- package/dist/public/operations/check-format-shared.d.ts.map +1 -0
- package/dist/public/operations/check-format-shared.js +107 -0
- package/dist/public/operations/check-helpers.d.ts +10 -0
- package/dist/public/operations/check-helpers.d.ts.map +1 -0
- package/dist/public/operations/check-helpers.js +107 -0
- package/dist/public/operations/discovery-entities.d.ts +14 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -0
- package/dist/public/operations/discovery-entities.js +91 -0
- package/dist/public/operations/discovery-executors.d.ts +39 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -0
- package/dist/public/operations/discovery-executors.js +101 -0
- package/dist/public/operations/index.d.ts +20 -0
- package/dist/public/operations/index.d.ts.map +1 -0
- package/dist/public/operations/index.js +18 -0
- package/dist/public/operations/node-ports.d.ts +15 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -0
- package/dist/public/operations/node-ports.js +57 -0
- package/dist/public/operations/prolog-json.d.ts +5 -0
- package/dist/public/operations/prolog-json.d.ts.map +1 -0
- package/dist/public/operations/prolog-json.js +44 -0
- package/dist/public/operations/runtime-types.d.ts +69 -0
- package/dist/public/operations/runtime-types.d.ts.map +1 -0
- package/dist/public/operations/runtime-types.js +17 -0
- package/dist/public/operations/specs/autopilot.d.ts +82 -0
- package/dist/public/operations/specs/autopilot.d.ts.map +1 -0
- package/dist/public/operations/specs/autopilot.js +72 -0
- package/dist/public/operations/specs/check.d.ts +51 -0
- package/dist/public/operations/specs/check.d.ts.map +1 -0
- package/dist/public/operations/specs/check.js +62 -0
- package/dist/public/operations/specs/discovery.d.ts +94 -0
- package/dist/public/operations/specs/discovery.d.ts.map +1 -0
- package/dist/public/operations/specs/discovery.js +98 -0
- package/dist/public/operations/specs/modeling.d.ts +126 -0
- package/dist/public/operations/specs/modeling.d.ts.map +1 -0
- package/dist/public/operations/specs/modeling.js +117 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +233 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
- package/dist/public/operations/specs/mutation-schemas.js +267 -0
- package/dist/public/operations/specs/mutation.d.ts +56 -0
- package/dist/public/operations/specs/mutation.d.ts.map +1 -0
- package/dist/public/operations/specs/mutation.js +44 -0
- package/dist/public/operations/specs/reporting.d.ts +185 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -0
- package/dist/public/operations/specs/reporting.js +158 -0
- package/dist/public/operations/specs/semantic.d.ts +53 -0
- package/dist/public/operations/specs/semantic.d.ts.map +1 -0
- package/dist/public/operations/specs/semantic.js +105 -0
- package/dist/public/operations/specs/skills.d.ts +70 -0
- package/dist/public/operations/specs/skills.d.ts.map +1 -0
- package/dist/public/operations/specs/skills.js +107 -0
- package/dist/public/operations/specs/sparql.d.ts +39 -0
- package/dist/public/operations/specs/sparql.d.ts.map +1 -0
- package/dist/public/operations/specs/sparql.js +121 -0
- package/dist/public/operations/specs/upsert.d.ts +256 -0
- package/dist/public/operations/specs/upsert.d.ts.map +1 -0
- package/dist/public/operations/specs/upsert.js +27 -0
- package/dist/public/operations/types.d.ts +24 -0
- package/dist/public/operations/types.d.ts.map +1 -0
- package/dist/public/operations/types.js +1 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +48 -0
- package/dist/public/skill-system/errors.d.ts +19 -0
- package/dist/public/skill-system/errors.d.ts.map +1 -0
- package/dist/public/skill-system/errors.js +36 -0
- package/dist/public/skill-system/loader.d.ts +9 -0
- package/dist/public/skill-system/loader.d.ts.map +1 -0
- package/dist/public/skill-system/loader.js +76 -0
- package/dist/public/skill-system/paths.d.ts +6 -0
- package/dist/public/skill-system/paths.d.ts.map +1 -0
- package/dist/public/skill-system/paths.js +25 -0
- package/dist/public/skill-system/types.d.ts +15 -0
- package/dist/public/skill-system/types.d.ts.map +1 -0
- package/dist/public/skill-system/types.js +1 -0
- package/dist/public/skill-system/validation.d.ts +10 -0
- package/dist/public/skill-system/validation.d.ts.map +1 -0
- package/dist/public/skill-system/validation.js +119 -0
- package/dist/public/skills/init-kibi/SKILL.md +62 -0
- package/dist/public/skills/kibi-freshness/SKILL.md +44 -0
- package/dist/public/skills/kibi-traceability/SKILL.md +54 -0
- package/dist/public/skills/kibi-usage/SKILL.md +123 -95
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +107 -5
- package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +30 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +40 -3
- package/dist/public/skills.d.ts +4 -41
- package/dist/public/skills.d.ts.map +1 -1
- package/dist/public/skills.js +3 -270
- package/dist/public/symbol-granularity.d.ts +1 -1
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +2 -0
- package/dist/runtime/cli-runtime.d.ts +3 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -0
- package/dist/runtime/cli-runtime.js +96 -0
- package/dist/schemas/entity.schema.json +23 -0
- package/dist/traceability/evidence-model.d.ts +1 -1
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/evidence-model.js +1 -1
- package/dist/traceability/staged-diagnostics.d.ts +6 -6
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +12 -6
- package/dist/traceability/staged-impact-contract.js +1 -1
- package/dist/traceability/staged-symbols-manifest.d.ts +1 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +60 -27
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +58 -1
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +34 -1
- package/dist/types/entities.d.ts +8 -1
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/prolog-query-plan-safety.d.ts +8 -0
- package/dist/utils/prolog-query-plan-safety.d.ts.map +1 -0
- package/dist/utils/prolog-query-plan-safety.js +47 -0
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +18 -0
- package/package.json +60 -2
- package/schema/entities.pl +4 -0
- package/src/public/impact/analyzer.ts +90 -0
- package/src/public/impact/coverage-depth-quality.ts +268 -0
- package/src/public/impact/diagnostics.ts +199 -0
- package/src/public/impact/diff-meaning.ts +121 -0
- package/src/public/impact/full-kb-quality.ts +230 -0
- package/src/public/impact/manifest.ts +57 -0
- package/src/public/impact/requirement-quality.ts +262 -0
- package/src/public/impact/source-changes.ts +180 -0
- package/src/public/impact/summaries.ts +100 -0
- package/src/public/impact/symbol-quality-model.ts +171 -0
- package/src/public/impact/symbol-quality.ts +207 -0
- package/src/public/impact/types.ts +99 -0
- package/src/public/impact-diagnostics.ts +22 -0
- package/src/public/operations/catalog.ts +60 -0
- package/src/public/operations/check-executor.ts +185 -0
- package/src/public/operations/check-format-shared.ts +178 -0
- package/src/public/operations/check-helpers.ts +141 -0
- package/src/public/operations/discovery-entities.ts +122 -0
- package/src/public/operations/discovery-executors.ts +176 -0
- package/src/public/operations/index.ts +19 -0
- package/src/public/operations/node-ports.ts +78 -0
- package/src/public/operations/prolog-json.ts +71 -0
- package/src/public/operations/runtime-types.ts +106 -0
- package/src/public/operations/specs/autopilot.ts +98 -0
- package/src/public/operations/specs/check.ts +72 -0
- package/src/public/operations/specs/discovery.ts +126 -0
- package/src/public/operations/specs/modeling.ts +154 -0
- package/src/public/operations/specs/mutation-schemas.ts +296 -0
- package/src/public/operations/specs/mutation.ts +58 -0
- package/src/public/operations/specs/reporting.ts +249 -0
- package/src/public/operations/specs/semantic.ts +135 -0
- package/src/public/operations/specs/skills.ts +142 -0
- package/src/public/operations/specs/sparql.ts +149 -0
- package/src/public/operations/specs/upsert.ts +40 -0
- package/src/public/operations/types.ts +57 -0
- package/src/public/schemas/entity.ts +50 -0
- package/src/public/skill-system/errors.ts +38 -0
- package/src/public/skill-system/loader.ts +108 -0
- package/src/public/skill-system/paths.ts +27 -0
- package/src/public/skill-system/types.ts +14 -0
- package/src/public/skill-system/validation.ts +175 -0
- package/src/public/skills/init-kibi/SKILL.md +62 -0
- package/src/public/skills/kibi-freshness/SKILL.md +44 -0
- package/src/public/skills/kibi-traceability/SKILL.md +54 -0
- package/src/public/skills/kibi-usage/SKILL.md +123 -95
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +107 -5
- package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +30 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +40 -3
- package/src/public/skills.ts +18 -427
- package/src/public/symbol-granularity.ts +4 -0
- package/src/schemas/entity.schema.json +23 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { normalizePredicateToken, slug } from "./predicate-utils.js";
|
|
2
|
+
// implements REQ-mcp-suggest-predicates
|
|
3
|
+
export function inferConflictResolutionRuleArgs(text) {
|
|
4
|
+
const conflict = text.match(/^when\s+(?<subject>.+?)\s+conflicts?,\s+(?:the\s+)?(?<strategy>.+?)\.?$/i);
|
|
5
|
+
return [
|
|
6
|
+
slug(conflict?.groups?.subject ?? "subject"),
|
|
7
|
+
normalizePredicateToken(conflict?.groups?.strategy ?? "strategy"),
|
|
8
|
+
];
|
|
9
|
+
}
|
|
10
|
+
// implements REQ-mcp-suggest-predicates
|
|
11
|
+
export function inferFallbackRuleArgs(text) {
|
|
12
|
+
const fallback = text.match(/^if\s+(?<condition>.+?),\s+(?<subject>.+?)\s+(?:must|shall|should)\s+fall\s+back\s+to\s+(?<target>.+?)\.?$/i);
|
|
13
|
+
return [
|
|
14
|
+
normalizePredicateToken(fallback?.groups?.condition ?? "condition"),
|
|
15
|
+
slug(fallback?.groups?.subject ?? "subject"),
|
|
16
|
+
normalizePredicateToken(fallback?.groups?.target ?? "fallback"),
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
// implements REQ-mcp-suggest-predicates
|
|
20
|
+
export function inferBatchOperationRuleArgs(text) {
|
|
21
|
+
const batch = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+process\s+(?<resource>.+?)\s+in\s+batches\s+of\s+(?<size>\d+)\.?$/i);
|
|
22
|
+
return [
|
|
23
|
+
slug(batch?.groups?.subject ?? "subject"),
|
|
24
|
+
slug(batch?.groups?.resource ?? "resource"),
|
|
25
|
+
batch?.groups?.size ?? "0",
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
// implements REQ-mcp-suggest-predicates
|
|
29
|
+
export function inferConsistencyRuleArgs(text) {
|
|
30
|
+
const consistency = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+reference\s+(?<target>an?\s+existing\s+.+?)\.?$/i);
|
|
31
|
+
return [
|
|
32
|
+
slug(consistency?.groups?.subject ?? "subject"),
|
|
33
|
+
normalizePredicateToken(consistency?.groups?.target ?? "target"),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
// implements REQ-mcp-suggest-predicates
|
|
37
|
+
export function inferBuildConstraintArgs(text) {
|
|
38
|
+
const build = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<property>deterministic)\s+at\s+(?<scope>build\s+time)\.?$/i);
|
|
39
|
+
return [
|
|
40
|
+
slug(build?.groups?.subject ?? "subject"),
|
|
41
|
+
normalizePredicateToken(build?.groups?.property ?? "property"),
|
|
42
|
+
normalizePredicateToken(build?.groups?.scope ?? "build_time"),
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
// implements REQ-mcp-suggest-predicates
|
|
46
|
+
export function inferEnvironmentSafetyRuleArgs(text) {
|
|
47
|
+
const safety = text.match(/^(?<action>.+?)\s+(?:must|shall|should)\s+be\s+(?<decision>forbidden|read-only|allowed)\s+in\s+(?<environment>production|staging|development)\.?$/i);
|
|
48
|
+
return [
|
|
49
|
+
slug(safety?.groups?.action ?? "action"),
|
|
50
|
+
normalizePredicateToken(safety?.groups?.decision ?? "decision"),
|
|
51
|
+
slug(safety?.groups?.environment ?? "environment"),
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
// implements REQ-mcp-suggest-predicates
|
|
55
|
+
export function inferSchemaInvariantRuleArgs(text) {
|
|
56
|
+
const invariant = text.match(/^(?<field>.+?)\s+(?:must|shall|should)\s+be\s+(?<kind>immutable)\s+after\s+(?<scope>.+?)\.?$/i);
|
|
57
|
+
return [
|
|
58
|
+
slug(invariant?.groups?.field ?? "field"),
|
|
59
|
+
normalizePredicateToken(invariant?.groups?.kind ?? "invariant"),
|
|
60
|
+
normalizePredicateToken(invariant?.groups?.scope ? `after ${invariant.groups.scope}` : "scope"),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
// implements REQ-mcp-suggest-predicates
|
|
64
|
+
export function inferCodingStandardRuleArgs(text) {
|
|
65
|
+
const standard = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+(?<action>use|avoid)\s+(?<target>.+?)\.?$/i);
|
|
66
|
+
return [
|
|
67
|
+
slug(standard?.groups?.subject ?? "subject"),
|
|
68
|
+
normalizePredicateToken(standard?.groups?.action ?? "action"),
|
|
69
|
+
normalizePredicateToken(standard?.groups?.target ?? "target"),
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
// implements REQ-mcp-suggest-predicates
|
|
73
|
+
export function inferMigrationBoundaryRuleArgs(text) {
|
|
74
|
+
const migration = text.match(/^(?<subject>.+?)\s+may\s+only\s+be\s+(?<action>read)\s+as\s+(?<scope>migration\s+input)(?:\s+by\s+.+?)?\.?$/i);
|
|
75
|
+
return [
|
|
76
|
+
slug(migration?.groups?.subject ?? "legacy_input"),
|
|
77
|
+
normalizePredicateToken(migration?.groups?.action ?? "action"),
|
|
78
|
+
normalizePredicateToken(migration?.groups?.scope ?? "migration_input"),
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
// implements REQ-mcp-suggest-predicates
|
|
82
|
+
export function inferAbsenceRequirementArgs(text) {
|
|
83
|
+
const absence = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<state>absent|removed)\.?$/i);
|
|
84
|
+
const declarativeAbsence = text.match(/^no\s+(?<subject>.+?)\.?$/i);
|
|
85
|
+
return [
|
|
86
|
+
normalizePredicateToken(absence?.groups?.subject ??
|
|
87
|
+
declarativeAbsence?.groups?.subject ??
|
|
88
|
+
"subject"),
|
|
89
|
+
normalizePredicateToken(absence?.groups?.state ?? "absent"),
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
// implements REQ-mcp-suggest-predicates
|
|
93
|
+
export function inferOfflineBehaviorRuleArgs(text) {
|
|
94
|
+
const offline = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<behavior>non-blocking|resilient)\s+during\s+(?<condition>offline\s+conditions)\.?$/i);
|
|
95
|
+
return [
|
|
96
|
+
slug(offline?.groups?.subject ?? "subject"),
|
|
97
|
+
normalizePredicateToken(offline?.groups?.behavior ?? "behavior"),
|
|
98
|
+
normalizePredicateToken(offline?.groups?.condition ?? "offline_conditions"),
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
// implements REQ-mcp-suggest-predicates
|
|
102
|
+
export function inferReleaseGateRuleArgs(text) {
|
|
103
|
+
const release = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+pass\s+(?<gate>.+?)\s+before\s+(?<target>.+?)\.?$/i);
|
|
104
|
+
return [
|
|
105
|
+
slug(release?.groups?.subject ?? "builds"),
|
|
106
|
+
normalizePredicateToken(release?.groups?.gate ?? "gate"),
|
|
107
|
+
slug(release?.groups?.target ?? "target"),
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
// implements REQ-mcp-suggest-predicates
|
|
111
|
+
export function inferPlatformConsistencyRuleArgs(text) {
|
|
112
|
+
const platform = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+synchronize\s+across\s+(?<platforms>.+?)\.?$/i);
|
|
113
|
+
const platforms = (platform?.groups?.platforms ?? "platform")
|
|
114
|
+
.split(/,|\band\b/i)
|
|
115
|
+
.map((part) => slug(part.trim()))
|
|
116
|
+
.filter((part) => part.length > 0)
|
|
117
|
+
.join(",");
|
|
118
|
+
return [slug(platform?.groups?.subject ?? "subject"), platforms];
|
|
119
|
+
}
|
|
120
|
+
// implements REQ-mcp-suggest-predicates
|
|
121
|
+
export function inferPreservationRuleArgs(text) {
|
|
122
|
+
const preservation = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+preserve\s+(?<preserved>.+?)\s+when\s+(?:the\s+)?(?<condition>.+?)\.?$/i);
|
|
123
|
+
return [
|
|
124
|
+
slug(preservation?.groups?.subject ?? "subject"),
|
|
125
|
+
slug(preservation?.groups?.preserved ?? "preserved"),
|
|
126
|
+
normalizePredicateToken(preservation?.groups?.condition ?? "condition"),
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
// implements REQ-mcp-suggest-predicates
|
|
130
|
+
export function inferAbstractionBoundaryRuleArgs(text) {
|
|
131
|
+
const boundary = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+persisted\s+as\s+(?<contract>.+?)\.?$/i);
|
|
132
|
+
return [
|
|
133
|
+
slug(boundary?.groups?.subject ?? "subject"),
|
|
134
|
+
"persisted_as",
|
|
135
|
+
normalizePredicateToken(boundary?.groups?.contract ?? "contract"),
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
// implements REQ-mcp-suggest-predicates
|
|
139
|
+
export function inferSecurityConfigurationRuleArgs(text) {
|
|
140
|
+
const config = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+have\s+explicit\s+(?<setting>[A-Za-z0-9_.-]+)\s+(?<value>[A-Za-z0-9_.-]+)\.?$/i);
|
|
141
|
+
return [
|
|
142
|
+
slug(config?.groups?.subject ?? "subject"),
|
|
143
|
+
slug(config?.groups?.setting ?? "setting"),
|
|
144
|
+
slug(config?.groups?.value ?? "value"),
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
// implements REQ-mcp-suggest-predicates
|
|
148
|
+
export function inferOrderedStrategyRuleArgs(text) {
|
|
149
|
+
const ordered = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+use\s+(?<kind>.+?)\s+in\s+priority\s+order\s+(?<values>.+?)\.?$/i);
|
|
150
|
+
const values = (ordered?.groups?.values ?? "")
|
|
151
|
+
.split(/,|>/)
|
|
152
|
+
.map((value) => normalizePredicateToken(value))
|
|
153
|
+
.filter((value) => value.length > 0)
|
|
154
|
+
.join(",");
|
|
155
|
+
return [
|
|
156
|
+
slug(ordered?.groups?.subject ?? "subject"),
|
|
157
|
+
slug(ordered?.groups?.kind ?? "strategy"),
|
|
158
|
+
values || "ordered_values",
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
// implements REQ-mcp-suggest-predicates
|
|
162
|
+
export function inferRefreshPolicyRuleArgs(text) {
|
|
163
|
+
const refresh = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+automatically\s+refresh\s+(?<target>.+?)\s+without\s+requiring\s+manual\s+page\s+reload\.?$/i);
|
|
164
|
+
return [
|
|
165
|
+
slug(refresh?.groups?.subject ?? "subject"),
|
|
166
|
+
slug(refresh?.groups?.target ?? "target"),
|
|
167
|
+
"automatic",
|
|
168
|
+
];
|
|
169
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function inferScopedAuthorizationRuleArgs(text: string): string[];
|
|
2
|
+
export declare function inferDocumentationStandardRuleArgs(text: string): string[];
|
|
3
|
+
export declare function inferWarmupPolicyRuleArgs(text: string): string[];
|
|
4
|
+
export declare function inferVisualLayoutRuleArgs(text: string): string[];
|
|
5
|
+
export declare function inferEnforcementLocationRuleArgs(text: string): string[];
|
|
6
|
+
export declare function inferReconciliationRuleArgs(text: string): string[];
|
|
7
|
+
export declare function inferThrottlePolicyRuleArgs(text: string): string[];
|
|
8
|
+
export declare function inferDefaultValueArgs(text: string, subject: string): string[];
|
|
9
|
+
export declare function inferUniquenessArgs(text: string): string[];
|
|
10
|
+
export declare function inferStateMembershipArgs(text: string, subject: string): string[];
|
|
11
|
+
export declare function inferTemporalOrderArgs(text: string, subject: string): string[];
|
|
12
|
+
export declare function inferConditionalBehaviorArgs(text: string, subject: string): string[];
|
|
13
|
+
export declare function inferStateTransitionArgs(text: string, subject: string): string[];
|
|
14
|
+
export declare function inferRateLimitArgs(text: string): string[];
|
|
15
|
+
//# sourceMappingURL=predicate-inference-3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predicate-inference-3.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-inference-3.ts"],"names":[],"mappings":"AASA,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CASvE;AAGD,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CASzE;AAGD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQhE;AAGD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAShE;AAGD,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQvE;AAGD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAUlE;AAGD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQlE;AAGD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAW7E;AAGD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAW1D;AAGD,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAgBV;AAGD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAsBV;AAGD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAsBV;AAGD,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAYV;AAGD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAazD"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { inferTrigger, normalizePredicateToken, normalizeSubjectKey, singularize, slug, } from "./predicate-utils.js";
|
|
2
|
+
// implements REQ-mcp-suggest-predicates
|
|
3
|
+
export function inferScopedAuthorizationRuleArgs(text) {
|
|
4
|
+
const scoped = text.match(/^(?<actor>.+?)\s+(?:must|shall|should)\s+be\s+denied\s+(?<action>.+?)\.?$/i);
|
|
5
|
+
return [
|
|
6
|
+
slug(scoped?.groups?.actor ?? "actor"),
|
|
7
|
+
slug(scoped?.groups?.action ?? "action"),
|
|
8
|
+
"deny",
|
|
9
|
+
];
|
|
10
|
+
}
|
|
11
|
+
// implements REQ-mcp-suggest-predicates
|
|
12
|
+
export function inferDocumentationStandardRuleArgs(text) {
|
|
13
|
+
const docs = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+documented\s+in\s+(?<artifact>.+?)\.?$/i);
|
|
14
|
+
return [
|
|
15
|
+
slug(docs?.groups?.subject ?? "subject"),
|
|
16
|
+
"documented_in",
|
|
17
|
+
slug(docs?.groups?.artifact ?? "documentation"),
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
// implements REQ-mcp-suggest-predicates
|
|
21
|
+
export function inferWarmupPolicyRuleArgs(text) {
|
|
22
|
+
const warmup = text.match(/^(?:the\s+)?(?<subject>.+?)\s+(?:must|shall|should)\s+warm\s+up\s+on\s+(?<trigger>.+?)\.?$/i);
|
|
23
|
+
return [
|
|
24
|
+
slug(warmup?.groups?.subject ?? "subject"),
|
|
25
|
+
slug(warmup?.groups?.trigger ?? "trigger"),
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
// implements REQ-mcp-suggest-predicates
|
|
29
|
+
export function inferVisualLayoutRuleArgs(text) {
|
|
30
|
+
const layout = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+remain\s+visually\s+aligned\s+with\s+(?<target>.+?)\.?$/i);
|
|
31
|
+
return [
|
|
32
|
+
slug(layout?.groups?.subject ?? "subject"),
|
|
33
|
+
"aligned_with",
|
|
34
|
+
slug(layout?.groups?.target ?? "target"),
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
// implements REQ-mcp-suggest-predicates
|
|
38
|
+
export function inferEnforcementLocationRuleArgs(text) {
|
|
39
|
+
const enforcement = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+enforced\s+at\s+(?<location>.+?)\.?$/i);
|
|
40
|
+
return [
|
|
41
|
+
slug(enforcement?.groups?.subject ?? "subject"),
|
|
42
|
+
slug(enforcement?.groups?.location ?? "location"),
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
// implements REQ-mcp-suggest-predicates
|
|
46
|
+
export function inferReconciliationRuleArgs(text) {
|
|
47
|
+
const reconciliation = text.match(/^on\s+(?<trigger>.+?),\s*(?<subject>.+?)\s+(?:must|shall|should)\s+reconcile\s+(?<target>.+?)\s+and\s+(?<action>clear\s+stale\s+.+?)\.?$/i);
|
|
48
|
+
return [
|
|
49
|
+
slug(reconciliation?.groups?.subject ?? "subject"),
|
|
50
|
+
slug(reconciliation?.groups?.trigger ?? "trigger"),
|
|
51
|
+
slug(reconciliation?.groups?.target ?? "target"),
|
|
52
|
+
slug(reconciliation?.groups?.action ?? "action"),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
// implements REQ-mcp-suggest-predicates
|
|
56
|
+
export function inferThrottlePolicyRuleArgs(text) {
|
|
57
|
+
const throttle = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+throttled\s+for\s+(?<condition>.+?)\.?$/i);
|
|
58
|
+
return [
|
|
59
|
+
slug(throttle?.groups?.subject ?? "subject"),
|
|
60
|
+
normalizePredicateToken(throttle?.groups?.condition ?? "condition"),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
// implements REQ-mcp-suggest-predicates
|
|
64
|
+
export function inferDefaultValueArgs(text, subject) {
|
|
65
|
+
const defaultValue = text.match(/^(?:the\s+)?(?<subject>[a-z][a-z\s_-]*?)\s+defaults?\s+to\s+(?<value>[a-z][a-z0-9\s_-]*?)(?:\s+(?<property>mode|state|status))?\.?$/i);
|
|
66
|
+
return [
|
|
67
|
+
defaultValue?.groups?.subject
|
|
68
|
+
? normalizeSubjectKey(defaultValue.groups.subject)
|
|
69
|
+
: subject,
|
|
70
|
+
slug(defaultValue?.groups?.property ?? "value"),
|
|
71
|
+
slug(defaultValue?.groups?.value ?? "value"),
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
// implements REQ-mcp-suggest-predicates
|
|
75
|
+
export function inferUniquenessArgs(text) {
|
|
76
|
+
const uniqueness = text.match(/^(?:there\s+)?(?:must|shall|should)\s+be\s+at\s+most\s+one\s+(?<subject>[a-z][a-z\s_-]*?)\s+per\s+(?<scope>.+?)\.?$/i);
|
|
77
|
+
const scope = (uniqueness?.groups?.scope ?? "scope")
|
|
78
|
+
.split(/\s+per\s+/i)
|
|
79
|
+
.map((part) => part.trim())
|
|
80
|
+
.filter((part) => part.length > 0)
|
|
81
|
+
.map(normalizePredicateToken)
|
|
82
|
+
.join(",");
|
|
83
|
+
return [slug(uniqueness?.groups?.subject ?? "subject"), scope];
|
|
84
|
+
}
|
|
85
|
+
// implements REQ-mcp-suggest-predicates
|
|
86
|
+
export function inferStateMembershipArgs(text, subject) {
|
|
87
|
+
const stateMembership = text.match(/^(?<subject>.+?)\s+(?:terminal\s+)?states\s+are\s+(?<states>.+?)\.?$/i);
|
|
88
|
+
const states = (stateMembership?.groups?.states ?? "state")
|
|
89
|
+
.split(/,|\band\b|\bor\b/i)
|
|
90
|
+
.map((state) => state.trim())
|
|
91
|
+
.filter((state) => state.length > 0)
|
|
92
|
+
.map(normalizePredicateToken)
|
|
93
|
+
.join(",");
|
|
94
|
+
return [
|
|
95
|
+
stateMembership?.groups?.subject
|
|
96
|
+
? normalizeSubjectKey(stateMembership.groups.subject)
|
|
97
|
+
: subject,
|
|
98
|
+
states,
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
// implements REQ-mcp-suggest-predicates
|
|
102
|
+
export function inferTemporalOrderArgs(text, subject) {
|
|
103
|
+
const initializesAfter = text.match(/^(?:the\s+)?(?<subject>.+?)\s+initializes\s+after\s+(?:the\s+)?(?<ready>.+?)\s+is\s+ready\.?$/i);
|
|
104
|
+
if (initializesAfter?.groups?.subject && initializesAfter.groups.ready) {
|
|
105
|
+
return [
|
|
106
|
+
slug(initializesAfter.groups.subject),
|
|
107
|
+
`${slug(initializesAfter.groups.ready)}_ready`,
|
|
108
|
+
"initializes",
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
const temporal = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<before>[a-z][a-z\s_-]*?)\s+before\s+(?<after>.+?)\.?$/i);
|
|
112
|
+
return [
|
|
113
|
+
temporal?.groups?.subject
|
|
114
|
+
? slug(temporal.groups.subject).replace(/_/g, ".")
|
|
115
|
+
: subject,
|
|
116
|
+
normalizePredicateToken(temporal?.groups?.before ?? "before_event"),
|
|
117
|
+
normalizePredicateToken(temporal?.groups?.after ?? "after_event"),
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
// implements REQ-mcp-suggest-predicates
|
|
121
|
+
export function inferConditionalBehaviorArgs(text, subject) {
|
|
122
|
+
const whenMust = text.match(/^when\s+(?<condition>.+?),\s*(?:the\s+)?(?<subject>.+?)\s+(?:must|shall|should)\s+(?<behavior>.+?)\.?$/i);
|
|
123
|
+
if (whenMust?.groups?.condition && whenMust.groups.subject) {
|
|
124
|
+
return [
|
|
125
|
+
slug(whenMust.groups.subject),
|
|
126
|
+
normalizePredicateToken(whenMust.groups.condition),
|
|
127
|
+
normalizePredicateToken(whenMust.groups.behavior ?? "behavior"),
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
const conditional = text.match(/^if\s+(?:(?:a|an|the)\s+)?(?<conditionSubject>[a-z][a-z_-]*)\s+(?<condition>.+?),\s*(?:it|they|the\s+[a-z][a-z\s_-]*?)\s+(?<behavior>.+?)\.?$/i);
|
|
131
|
+
return [
|
|
132
|
+
conditional?.groups?.conditionSubject
|
|
133
|
+
? singularize(slug(conditional.groups.conditionSubject))
|
|
134
|
+
: subject,
|
|
135
|
+
normalizePredicateToken(conditional?.groups?.condition ?? "condition"),
|
|
136
|
+
normalizePredicateToken(conditional?.groups?.behavior ?? "behavior"),
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
// implements REQ-mcp-suggest-predicates
|
|
140
|
+
export function inferStateTransitionArgs(text, subject) {
|
|
141
|
+
const transition = text.match(/^when\s+(?<trigger>.+?),\s*(?:the\s+)?(?<subject>[a-z][a-z\s_-]*?)\s+transitions?\s+from\s+(?<from>[a-z][a-z0-9_-]*)\s+to\s+(?<to>[a-z][a-z0-9_-]*)\.?$/i);
|
|
142
|
+
return [
|
|
143
|
+
transition?.groups?.subject
|
|
144
|
+
? normalizeSubjectKey(transition.groups.subject)
|
|
145
|
+
: subject,
|
|
146
|
+
normalizePredicateToken(transition?.groups?.from ?? "from_state"),
|
|
147
|
+
normalizePredicateToken(transition?.groups?.to ?? "to_state"),
|
|
148
|
+
normalizePredicateToken(transition?.groups?.trigger ?? inferTrigger(text)),
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
// implements REQ-mcp-suggest-predicates
|
|
152
|
+
export function inferRateLimitArgs(text) {
|
|
153
|
+
const rateLimit = text.match(/^(?<subject>.+?)\s+must\s+be\s+rate\s+limited\s+to\s+(?<count>\d+)\s+(?<action>[a-z][a-z\s_-]*?)\s+per\s+(?<window>[a-z]+)\.?$/i);
|
|
154
|
+
const subject = rateLimit?.groups?.subject
|
|
155
|
+
? slug(rateLimit.groups.subject).replace(/_requests?$/, ".request")
|
|
156
|
+
: "requirement.subject";
|
|
157
|
+
return [
|
|
158
|
+
subject,
|
|
159
|
+
normalizePredicateToken(rateLimit?.groups?.action ?? "action"),
|
|
160
|
+
normalizePredicateToken(rateLimit?.groups?.window ?? "window"),
|
|
161
|
+
rateLimit?.groups?.count ?? "0",
|
|
162
|
+
];
|
|
163
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PredicateSchemaCandidate } from "./predicate-types.js";
|
|
2
|
+
import { inferSubject } from "./predicate-utils.js";
|
|
3
|
+
export declare function inferArgs(schema: PredicateSchemaCandidate, text: string, subject: string): string[];
|
|
4
|
+
export { inferSubject };
|
|
5
|
+
//# sourceMappingURL=predicate-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predicate-inference.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-inference.ts"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EASL,YAAY,EAIb,MAAM,sBAAsB,CAAC;AAG9B,wBAAgB,SAAS,CACvB,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CA8IV;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { inferAuditEventRuleArgs, inferAvailabilitySlaArgs, inferConsentRuleArgs, inferDataResidencyRuleArgs, inferDependencyRuleArgs, inferEscalationRuleArgs, inferExceptionRuleArgs, inferGuardArgs, inferIdempotencyRuleArgs, inferLifecycleRuleArgs, inferMutualExclusionArgs, inferNotificationRouteArgs, inferOwnershipRuleArgs, inferPermissionRuleArgs, inferRetryPolicyArgs, } from "./predicate-inference-1.js";
|
|
2
|
+
import { inferAbsenceRequirementArgs, inferAbstractionBoundaryRuleArgs, inferBatchOperationRuleArgs, inferBuildConstraintArgs, inferCodingStandardRuleArgs, inferConflictResolutionRuleArgs, inferConsistencyRuleArgs, inferEnvironmentSafetyRuleArgs, inferFallbackRuleArgs, inferMigrationBoundaryRuleArgs, inferOfflineBehaviorRuleArgs, inferOrderedStrategyRuleArgs, inferPlatformConsistencyRuleArgs, inferPreservationRuleArgs, inferRefreshPolicyRuleArgs, inferReleaseGateRuleArgs, inferSchemaInvariantRuleArgs, inferSecurityConfigurationRuleArgs, } from "./predicate-inference-2.js";
|
|
3
|
+
import { inferConditionalBehaviorArgs, inferDefaultValueArgs, inferDocumentationStandardRuleArgs, inferEnforcementLocationRuleArgs, inferRateLimitArgs, inferReconciliationRuleArgs, inferScopedAuthorizationRuleArgs, inferStateMembershipArgs, inferStateTransitionArgs, inferTemporalOrderArgs, inferThrottlePolicyRuleArgs, inferUniquenessArgs, inferVisualLayoutRuleArgs, inferWarmupPolicyRuleArgs, } from "./predicate-inference-3.js";
|
|
4
|
+
import { inferDuration, inferDurationUnit, inferEvent, inferGate, inferNumber, inferOperator, inferResource, inferScope, inferSubject, inferTrigger, inferUnit, slug, } from "./predicate-utils.js";
|
|
5
|
+
// implements REQ-mcp-suggest-predicates
|
|
6
|
+
export function inferArgs(schema, text, subject) {
|
|
7
|
+
const lower = text.toLowerCase();
|
|
8
|
+
switch (schema.predicate_name) {
|
|
9
|
+
case "state":
|
|
10
|
+
return [subject, lower.includes("idle") ? "idle" : "active"];
|
|
11
|
+
case "transition":
|
|
12
|
+
return [
|
|
13
|
+
subject,
|
|
14
|
+
lower.includes("edit") ? "edit" : "draft",
|
|
15
|
+
lower.includes("idle") ? "idle" : "active",
|
|
16
|
+
inferTrigger(text),
|
|
17
|
+
];
|
|
18
|
+
case "guard":
|
|
19
|
+
return inferGuardArgs(text, subject);
|
|
20
|
+
case "exception_rule":
|
|
21
|
+
return inferExceptionRuleArgs(text, subject);
|
|
22
|
+
case "mutual_exclusion":
|
|
23
|
+
return inferMutualExclusionArgs(text);
|
|
24
|
+
case "dependency_rule":
|
|
25
|
+
return inferDependencyRuleArgs(text);
|
|
26
|
+
case "ownership_rule":
|
|
27
|
+
return inferOwnershipRuleArgs(text);
|
|
28
|
+
case "retry_policy":
|
|
29
|
+
return inferRetryPolicyArgs(text);
|
|
30
|
+
case "escalation_rule":
|
|
31
|
+
return inferEscalationRuleArgs(text);
|
|
32
|
+
case "availability_sla":
|
|
33
|
+
return inferAvailabilitySlaArgs(text);
|
|
34
|
+
case "notification_route":
|
|
35
|
+
return inferNotificationRouteArgs(text);
|
|
36
|
+
case "idempotency_rule":
|
|
37
|
+
return inferIdempotencyRuleArgs(text);
|
|
38
|
+
case "data_residency_rule":
|
|
39
|
+
return inferDataResidencyRuleArgs(text);
|
|
40
|
+
case "audit_event_rule":
|
|
41
|
+
return inferAuditEventRuleArgs(text);
|
|
42
|
+
case "consent_rule":
|
|
43
|
+
return inferConsentRuleArgs(text);
|
|
44
|
+
case "lifecycle_rule":
|
|
45
|
+
return inferLifecycleRuleArgs(text);
|
|
46
|
+
case "conflict_resolution_rule":
|
|
47
|
+
return inferConflictResolutionRuleArgs(text);
|
|
48
|
+
case "fallback_rule":
|
|
49
|
+
return inferFallbackRuleArgs(text);
|
|
50
|
+
case "batch_operation_rule":
|
|
51
|
+
return inferBatchOperationRuleArgs(text);
|
|
52
|
+
case "consistency_rule":
|
|
53
|
+
return inferConsistencyRuleArgs(text);
|
|
54
|
+
case "build_constraint":
|
|
55
|
+
return inferBuildConstraintArgs(text);
|
|
56
|
+
case "environment_safety_rule":
|
|
57
|
+
return inferEnvironmentSafetyRuleArgs(text);
|
|
58
|
+
case "schema_invariant_rule":
|
|
59
|
+
return inferSchemaInvariantRuleArgs(text);
|
|
60
|
+
case "coding_standard_rule":
|
|
61
|
+
return inferCodingStandardRuleArgs(text);
|
|
62
|
+
case "migration_boundary_rule":
|
|
63
|
+
return inferMigrationBoundaryRuleArgs(text);
|
|
64
|
+
case "absence_requirement":
|
|
65
|
+
return inferAbsenceRequirementArgs(text);
|
|
66
|
+
case "offline_behavior_rule":
|
|
67
|
+
return inferOfflineBehaviorRuleArgs(text);
|
|
68
|
+
case "release_gate_rule":
|
|
69
|
+
return inferReleaseGateRuleArgs(text);
|
|
70
|
+
case "platform_consistency_rule":
|
|
71
|
+
return inferPlatformConsistencyRuleArgs(text);
|
|
72
|
+
case "preservation_rule":
|
|
73
|
+
return inferPreservationRuleArgs(text);
|
|
74
|
+
case "abstraction_boundary_rule":
|
|
75
|
+
return inferAbstractionBoundaryRuleArgs(text);
|
|
76
|
+
case "security_configuration_rule":
|
|
77
|
+
return inferSecurityConfigurationRuleArgs(text);
|
|
78
|
+
case "ordered_strategy_rule":
|
|
79
|
+
return inferOrderedStrategyRuleArgs(text);
|
|
80
|
+
case "refresh_policy_rule":
|
|
81
|
+
return inferRefreshPolicyRuleArgs(text);
|
|
82
|
+
case "scoped_authorization_rule":
|
|
83
|
+
return inferScopedAuthorizationRuleArgs(text);
|
|
84
|
+
case "documentation_standard_rule":
|
|
85
|
+
return inferDocumentationStandardRuleArgs(text);
|
|
86
|
+
case "warmup_policy_rule":
|
|
87
|
+
return inferWarmupPolicyRuleArgs(text);
|
|
88
|
+
case "visual_layout_rule":
|
|
89
|
+
return inferVisualLayoutRuleArgs(text);
|
|
90
|
+
case "enforcement_location_rule":
|
|
91
|
+
return inferEnforcementLocationRuleArgs(text);
|
|
92
|
+
case "reconciliation_rule":
|
|
93
|
+
return inferReconciliationRuleArgs(text);
|
|
94
|
+
case "throttle_policy_rule":
|
|
95
|
+
return inferThrottlePolicyRuleArgs(text);
|
|
96
|
+
case "has_unsaved_changes":
|
|
97
|
+
return [subject, lower.includes("no unsaved") ? "false" : "true"];
|
|
98
|
+
case "commit_action":
|
|
99
|
+
case "discard_action":
|
|
100
|
+
return [subject, inferTrigger(text), inferScope(text)];
|
|
101
|
+
case "accessibility_requirement":
|
|
102
|
+
return [
|
|
103
|
+
subject,
|
|
104
|
+
lower.includes("wcag") ? "WCAG" : "accessibility",
|
|
105
|
+
"required",
|
|
106
|
+
];
|
|
107
|
+
case "retention_policy":
|
|
108
|
+
return [subject, inferDuration(text), inferDurationUnit(text)];
|
|
109
|
+
case "resource_constraint":
|
|
110
|
+
return [
|
|
111
|
+
subject,
|
|
112
|
+
inferResource(text),
|
|
113
|
+
inferOperator(text),
|
|
114
|
+
inferNumber(text),
|
|
115
|
+
inferUnit(text),
|
|
116
|
+
];
|
|
117
|
+
case "feature_gate":
|
|
118
|
+
return [
|
|
119
|
+
subject,
|
|
120
|
+
inferGate(text),
|
|
121
|
+
lower.includes("disabled") ? "false" : "true",
|
|
122
|
+
];
|
|
123
|
+
case "publishes_event":
|
|
124
|
+
return [subject, inferEvent(text)];
|
|
125
|
+
case "acceptance_rule":
|
|
126
|
+
return [subject, slug(text).slice(0, 64) || "observable_outcome"];
|
|
127
|
+
case "permission_rule":
|
|
128
|
+
return inferPermissionRuleArgs(text);
|
|
129
|
+
case "default_value":
|
|
130
|
+
return inferDefaultValueArgs(text, subject);
|
|
131
|
+
case "uniqueness_constraint":
|
|
132
|
+
return inferUniquenessArgs(text);
|
|
133
|
+
case "state_membership":
|
|
134
|
+
return inferStateMembershipArgs(text, subject);
|
|
135
|
+
case "temporal_order":
|
|
136
|
+
return inferTemporalOrderArgs(text, subject);
|
|
137
|
+
case "conditional_behavior":
|
|
138
|
+
return inferConditionalBehaviorArgs(text, subject);
|
|
139
|
+
case "state_transition":
|
|
140
|
+
return inferStateTransitionArgs(text, subject);
|
|
141
|
+
case "rate_limit":
|
|
142
|
+
return inferRateLimitArgs(text);
|
|
143
|
+
default:
|
|
144
|
+
return schema.argument_names.map((name) => name === "subject" ? subject : "unknown");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// implements REQ-mcp-suggest-predicates
|
|
148
|
+
export { inferSubject };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PrologPort } from "../../public/operations/runtime-types.js";
|
|
2
|
+
import type { PredicateSchemaCandidate, PredicateUsageHints } from "./predicate-types.js";
|
|
3
|
+
export declare function schemaForCandidate(schema: PredicateSchemaCandidate): Omit<PredicateSchemaCandidate, "keywords"> & {
|
|
4
|
+
usage_hints: PredicateUsageHints;
|
|
5
|
+
};
|
|
6
|
+
export declare function loadExistingPredicateSchemas(prolog: PrologPort | null, includeExistingSchemas: boolean, warnings: string[]): Promise<PredicateSchemaCandidate[]>;
|
|
7
|
+
export declare function predicateSchemaFromEntity(entity: Record<string, unknown>): PredicateSchemaCandidate[];
|
|
8
|
+
export declare function usageHintsFromEntity(entity: Record<string, unknown>): PredicateUsageHints | undefined;
|
|
9
|
+
export declare function stringArray(value: unknown): string[];
|
|
10
|
+
//# sourceMappingURL=predicate-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predicate-loader.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAK3E,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CACxE,wBAAwB,EACxB,UAAU,CACX,GAAG;IACF,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAeA;AAGD,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,sBAAsB,EAAE,OAAO,EAC/B,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAwBrC;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,wBAAwB,EAAE,CA+B5B;AAGD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,mBAAmB,GAAG,SAAS,CAOjC;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQpD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { parseEntityFromList, parseListOfLists } from "../../prolog/codec.js";
|
|
2
|
+
import { DEFAULT_USAGE_HINTS, USAGE_HINTS_BY_PREDICATE, } from "./predicate-catalog.js";
|
|
3
|
+
import { hashId, normalizeOptionalString } from "./predicate-utils.js";
|
|
4
|
+
// implements REQ-mcp-suggest-predicates
|
|
5
|
+
export function schemaForCandidate(schema) {
|
|
6
|
+
return {
|
|
7
|
+
id: schema.id,
|
|
8
|
+
predicate_name: schema.predicate_name,
|
|
9
|
+
title: schema.title,
|
|
10
|
+
description: schema.description,
|
|
11
|
+
argument_names: schema.argument_names,
|
|
12
|
+
argument_types: schema.argument_types,
|
|
13
|
+
examples: schema.examples,
|
|
14
|
+
tags: schema.tags,
|
|
15
|
+
usage_hints: schema.usage_hints ??
|
|
16
|
+
USAGE_HINTS_BY_PREDICATE[schema.predicate_name] ??
|
|
17
|
+
DEFAULT_USAGE_HINTS,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
// implements REQ-mcp-suggest-predicates
|
|
21
|
+
export async function loadExistingPredicateSchemas(prolog, includeExistingSchemas, warnings) {
|
|
22
|
+
if (!includeExistingSchemas || prolog === null) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const queryResult = await prolog.query("findall([Id,'fact',Props], (kb_entity(Id, 'fact', Props), member(fact_kind=predicate_schema, Props)), Results)");
|
|
27
|
+
if (!queryResult.success) {
|
|
28
|
+
throw new Error(queryResult.error || "Query failed with unknown error");
|
|
29
|
+
}
|
|
30
|
+
const facts = queryResult.bindings.Results
|
|
31
|
+
? parseListOfLists(queryResult.bindings.Results).map(parseEntityFromList)
|
|
32
|
+
: [];
|
|
33
|
+
return facts.flatMap((fact) => predicateSchemaFromEntity(fact));
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
37
|
+
warnings.push(`Existing predicate_schema facts could not be loaded: ${message}`);
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// implements REQ-mcp-suggest-predicates
|
|
42
|
+
export function predicateSchemaFromEntity(entity) {
|
|
43
|
+
if (entity.fact_kind !== "predicate_schema")
|
|
44
|
+
return [];
|
|
45
|
+
const predicateName = normalizeOptionalString(typeof entity.predicate_name === "string"
|
|
46
|
+
? entity.predicate_name
|
|
47
|
+
: undefined);
|
|
48
|
+
if (!predicateName)
|
|
49
|
+
return [];
|
|
50
|
+
const usageHints = usageHintsFromEntity(entity);
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
id: String(entity.id ?? hashId("FACT-SCHEMA", [predicateName])),
|
|
54
|
+
predicate_name: predicateName,
|
|
55
|
+
title: String(entity.title ?? predicateName),
|
|
56
|
+
description: String(entity.description ??
|
|
57
|
+
`Project-local ${predicateName} predicate schema.`),
|
|
58
|
+
argument_names: stringArray(entity.argument_names),
|
|
59
|
+
argument_types: stringArray(entity.argument_types),
|
|
60
|
+
keywords: [
|
|
61
|
+
predicateName,
|
|
62
|
+
...stringArray(entity.aliases),
|
|
63
|
+
...stringArray(entity.tags),
|
|
64
|
+
],
|
|
65
|
+
examples: stringArray(entity.examples),
|
|
66
|
+
tags: stringArray(entity.tags),
|
|
67
|
+
...(usageHints ? { usage_hints: usageHints } : {}),
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
// implements REQ-mcp-suggest-predicates
|
|
72
|
+
export function usageHintsFromEntity(entity) {
|
|
73
|
+
const useWhen = stringArray(entity.use_when);
|
|
74
|
+
const doNotUseWhen = stringArray(entity.do_not_use_when);
|
|
75
|
+
if (useWhen.length === 0 || doNotUseWhen.length === 0) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return { use_when: useWhen, do_not_use_when: doNotUseWhen };
|
|
79
|
+
}
|
|
80
|
+
// implements REQ-mcp-suggest-predicates
|
|
81
|
+
export function stringArray(value) {
|
|
82
|
+
if (!Array.isArray(value))
|
|
83
|
+
return [];
|
|
84
|
+
return value.flatMap((item) => {
|
|
85
|
+
const normalized = normalizeOptionalString(typeof item === "string" ? item : undefined);
|
|
86
|
+
return normalized ? [normalized] : [];
|
|
87
|
+
});
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predicate-ranker.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-ranker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAUrE,wBAAgB,WAAW,CACzB,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,CAcR"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { scoreExactPredicates1 } from "./predicate-score-1.js";
|
|
2
|
+
import { scoreExactPredicates2 } from "./predicate-score-2.js";
|
|
3
|
+
import { scoreExactPredicates3 } from "./predicate-score-3.js";
|
|
4
|
+
import { matchesKeyword } from "./predicate-utils.js";
|
|
5
|
+
const EXACT_SCORERS = [
|
|
6
|
+
scoreExactPredicates1,
|
|
7
|
+
scoreExactPredicates2,
|
|
8
|
+
scoreExactPredicates3,
|
|
9
|
+
];
|
|
10
|
+
// implements REQ-mcp-suggest-predicates
|
|
11
|
+
export function scoreSchema(schema, text) {
|
|
12
|
+
for (const scorer of EXACT_SCORERS) {
|
|
13
|
+
const score = scorer(schema, text);
|
|
14
|
+
if (score !== null)
|
|
15
|
+
return score;
|
|
16
|
+
}
|
|
17
|
+
const lower = text.toLowerCase();
|
|
18
|
+
const keywordHits = schema.keywords.filter((keyword) => matchesKeyword(text, lower, keyword)).length;
|
|
19
|
+
if (keywordHits === 0)
|
|
20
|
+
return 0;
|
|
21
|
+
const normalized = keywordHits / Math.max(3, schema.keywords.length / 2);
|
|
22
|
+
const score = Math.min(0.98, 0.24 + normalized * 0.5 + keywordHits * 0.06);
|
|
23
|
+
return Math.round(score * 100) / 100;
|
|
24
|
+
}
|