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,149 @@
|
|
|
1
|
+
import type { OperationContext } from "../runtime-types.js";
|
|
2
|
+
import type { OperationResult, OperationSpec } from "../types.js";
|
|
3
|
+
|
|
4
|
+
// implements REQ-kibi-operation-interface-parity
|
|
5
|
+
export type SparqlRemoteInput = {
|
|
6
|
+
readonly endpoint: string;
|
|
7
|
+
readonly query: string;
|
|
8
|
+
readonly timeoutMs?: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// implements REQ-kibi-operation-interface-parity
|
|
12
|
+
export type SparqlRemoteOutput = {
|
|
13
|
+
readonly rows: readonly Readonly<Record<string, unknown>>[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function validateInput(input: SparqlRemoteInput): URL {
|
|
17
|
+
if (typeof input.endpoint !== "string" || input.endpoint.trim() === "") {
|
|
18
|
+
throw new Error("SPARQL endpoint is required");
|
|
19
|
+
}
|
|
20
|
+
if (typeof input.query !== "string" || input.query.trim() === "") {
|
|
21
|
+
throw new Error("SPARQL query is required");
|
|
22
|
+
}
|
|
23
|
+
let endpoint: URL;
|
|
24
|
+
try {
|
|
25
|
+
endpoint = new URL(input.endpoint);
|
|
26
|
+
} catch {
|
|
27
|
+
throw new Error("SPARQL endpoint must be an http:// or https:// URL");
|
|
28
|
+
}
|
|
29
|
+
if (endpoint.protocol !== "http:" && endpoint.protocol !== "https:") {
|
|
30
|
+
throw new Error("SPARQL endpoint must be an http:// or https:// URL");
|
|
31
|
+
}
|
|
32
|
+
if (!/^\s*select\b/i.test(input.query)) {
|
|
33
|
+
throw new Error("SPARQL query must be a SELECT query");
|
|
34
|
+
}
|
|
35
|
+
if (
|
|
36
|
+
input.timeoutMs !== undefined &&
|
|
37
|
+
(!Number.isFinite(input.timeoutMs) || input.timeoutMs <= 0)
|
|
38
|
+
) {
|
|
39
|
+
throw new Error("SPARQL timeoutMs must be a positive number when provided");
|
|
40
|
+
}
|
|
41
|
+
return endpoint;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
45
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function decodeRows(payload: unknown): SparqlRemoteOutput {
|
|
49
|
+
if (!isRecord(payload) || !isRecord(payload.results)) {
|
|
50
|
+
throw new Error("SPARQL endpoint returned an invalid result document");
|
|
51
|
+
}
|
|
52
|
+
const bindings = payload.results.bindings;
|
|
53
|
+
if (!Array.isArray(bindings)) {
|
|
54
|
+
throw new Error("SPARQL endpoint returned an invalid bindings array");
|
|
55
|
+
}
|
|
56
|
+
const rows = bindings.map((binding) => {
|
|
57
|
+
if (!isRecord(binding)) {
|
|
58
|
+
throw new Error("SPARQL endpoint returned an invalid binding");
|
|
59
|
+
}
|
|
60
|
+
const row: Record<string, unknown> = {};
|
|
61
|
+
for (const [variable, term] of Object.entries(binding)) {
|
|
62
|
+
if (!isRecord(term) || typeof term.value !== "string") {
|
|
63
|
+
throw new Error(`SPARQL endpoint returned an invalid ${variable} term`);
|
|
64
|
+
}
|
|
65
|
+
row[variable] = term.value;
|
|
66
|
+
}
|
|
67
|
+
return row;
|
|
68
|
+
});
|
|
69
|
+
return { rows };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// implements REQ-kibi-operation-interface-parity, REQ-002, REQ-013
|
|
73
|
+
async function executeSparqlRemote(
|
|
74
|
+
input: SparqlRemoteInput,
|
|
75
|
+
context: OperationContext,
|
|
76
|
+
): Promise<OperationResult<SparqlRemoteOutput>> {
|
|
77
|
+
const endpoint = validateInput(input);
|
|
78
|
+
if (context.net === undefined) {
|
|
79
|
+
throw new Error("SPARQL remote query requires a network port");
|
|
80
|
+
}
|
|
81
|
+
const signal =
|
|
82
|
+
input.timeoutMs === undefined
|
|
83
|
+
? context.signal
|
|
84
|
+
: AbortSignal.any([
|
|
85
|
+
context.signal,
|
|
86
|
+
AbortSignal.timeout(
|
|
87
|
+
Math.max(1, Math.ceil(input.timeoutMs / 1_000)) * 1_000,
|
|
88
|
+
),
|
|
89
|
+
]);
|
|
90
|
+
try {
|
|
91
|
+
const response = await context.net.fetch(endpoint, {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: {
|
|
94
|
+
accept: "application/sparql-results+json",
|
|
95
|
+
"content-type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
96
|
+
},
|
|
97
|
+
body: new URLSearchParams({ query: input.query }),
|
|
98
|
+
signal,
|
|
99
|
+
});
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
throw new Error(`SPARQL endpoint returned HTTP ${response.status}`);
|
|
102
|
+
}
|
|
103
|
+
const payload: unknown = await response.json();
|
|
104
|
+
const structuredContent = decodeRows(payload);
|
|
105
|
+
const rowCount = structuredContent.rows.length;
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: "text",
|
|
110
|
+
text: `Remote SPARQL query returned ${rowCount} row${rowCount === 1 ? "" : "s"}.`,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
structuredContent,
|
|
114
|
+
};
|
|
115
|
+
} catch (error) {
|
|
116
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
117
|
+
throw new Error(`SPARQL remote query failed: ${message}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export const sparqlRemoteSpec = {
|
|
122
|
+
name: "kb_sparql_remote",
|
|
123
|
+
cliName: "sparql-remote",
|
|
124
|
+
description:
|
|
125
|
+
"Opt-in remote SPARQL query tool for external HTTP(S) RDF endpoints. This does not query Kibi's local RDF store directly, stores no credentials, and depends on network availability.",
|
|
126
|
+
businessInputSchema: {
|
|
127
|
+
type: "object",
|
|
128
|
+
required: ["endpoint", "query"],
|
|
129
|
+
properties: {
|
|
130
|
+
endpoint: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description:
|
|
133
|
+
"Remote SPARQL endpoint URL. Must start with http:// or https://.",
|
|
134
|
+
},
|
|
135
|
+
query: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "SPARQL SELECT query to send to the remote endpoint.",
|
|
138
|
+
},
|
|
139
|
+
timeoutMs: {
|
|
140
|
+
type: "number",
|
|
141
|
+
description:
|
|
142
|
+
"Optional positive timeout in milliseconds for the remote query.",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
requiresProlog: false,
|
|
147
|
+
effects: ["network-read"],
|
|
148
|
+
execute: executeSparqlRemote,
|
|
149
|
+
} as const satisfies OperationSpec<SparqlRemoteInput, SparqlRemoteOutput>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UpsertInput,
|
|
3
|
+
UpsertPayload,
|
|
4
|
+
} from "../../../operations/mutation/types.js";
|
|
5
|
+
import { executeUpsert } from "../../../operations/mutation/upsert.js";
|
|
6
|
+
import type { OperationSpec } from "../types.js";
|
|
7
|
+
import {
|
|
8
|
+
ENTITY_PROPERTIES_SCHEMA,
|
|
9
|
+
ENTITY_TYPES,
|
|
10
|
+
RELATIONSHIPS_SCHEMA,
|
|
11
|
+
} from "./mutation-schemas.js";
|
|
12
|
+
|
|
13
|
+
export const upsertSpec = {
|
|
14
|
+
name: "kb_upsert",
|
|
15
|
+
cliName: "upsert",
|
|
16
|
+
description:
|
|
17
|
+
"Create or update one entity and optional relationships. Use for KB mutations after validating intent; prefer kb_validate_upsert first because it returns semantic advisor receipts for prose-heavy requirements. Use kb_model_requirement before hand-writing strict property facts from prose, and kb_suggest_predicates before hand-writing ontology predicate facts. Use the `relationships` array for batch creation of multiple links in a single call (e.g., linking a requirement to multiple tests or facts). Prefer modeling requirements as reusable fact links (`constrains`, `requires_property`, or `requires_predicate`) so consistency and contradiction checks remain queryable. Relationship endpoints must already exist in KB. For requirements, the write will be rejected if it contradicts existing current requirements that constrain the same subject with incompatible properties. To replace a conflicting requirement, include a `supersedes` relationship from the new requirement to the old one in the same request. Successful writes may return non-blocking semantic advisor warnings; inspect and repair those warnings before treating prose as contradiction-checkable. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates.",
|
|
18
|
+
businessInputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
required: ["type", "id", "properties"],
|
|
21
|
+
properties: {
|
|
22
|
+
type: {
|
|
23
|
+
type: "string",
|
|
24
|
+
enum: ENTITY_TYPES,
|
|
25
|
+
description:
|
|
26
|
+
"Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'.",
|
|
27
|
+
},
|
|
28
|
+
id: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description:
|
|
31
|
+
"Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.",
|
|
32
|
+
},
|
|
33
|
+
properties: ENTITY_PROPERTIES_SCHEMA,
|
|
34
|
+
relationships: RELATIONSHIPS_SCHEMA,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
requiresProlog: true,
|
|
38
|
+
effects: ["kb-write", "workspace-write"],
|
|
39
|
+
execute: executeUpsert,
|
|
40
|
+
} as const satisfies OperationSpec<UpsertInput, UpsertPayload>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { OperationContext } from "./runtime-types.js";
|
|
2
|
+
export type { OperationContext };
|
|
3
|
+
export type OperationName =
|
|
4
|
+
| "kb_query"
|
|
5
|
+
| "kb_search"
|
|
6
|
+
| "kb_status"
|
|
7
|
+
| "kb_skills_list"
|
|
8
|
+
| "kb_skills_load"
|
|
9
|
+
| "kb_skills_read"
|
|
10
|
+
| "kb_find_gaps"
|
|
11
|
+
| "kb_coverage"
|
|
12
|
+
| "kb_graph"
|
|
13
|
+
| "kb_sparql_remote"
|
|
14
|
+
| "kb_semantic_advisor"
|
|
15
|
+
| "kb_upsert"
|
|
16
|
+
| "kb_validate_upsert"
|
|
17
|
+
| "kb_delete"
|
|
18
|
+
| "kb_check"
|
|
19
|
+
| "kb_model_requirement"
|
|
20
|
+
| "kb_suggest_predicates"
|
|
21
|
+
| "kb_autopilot_generate";
|
|
22
|
+
|
|
23
|
+
export type OperationEffect =
|
|
24
|
+
| "local-read"
|
|
25
|
+
| "kb-read"
|
|
26
|
+
| "workspace-read"
|
|
27
|
+
| "network-read"
|
|
28
|
+
| "kb-write"
|
|
29
|
+
| "workspace-write";
|
|
30
|
+
|
|
31
|
+
export interface OperationContent {
|
|
32
|
+
readonly type: string;
|
|
33
|
+
readonly text?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface OperationResult<O = unknown> {
|
|
37
|
+
readonly content: readonly OperationContent[];
|
|
38
|
+
readonly structuredContent?: O;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface OperationSpec<
|
|
42
|
+
I = Readonly<Record<string, unknown>>,
|
|
43
|
+
O = unknown,
|
|
44
|
+
> {
|
|
45
|
+
readonly name: OperationName;
|
|
46
|
+
readonly cliName: string;
|
|
47
|
+
readonly description: string;
|
|
48
|
+
readonly businessInputSchema: Readonly<Record<string, unknown>>;
|
|
49
|
+
readonly requiresProlog: boolean;
|
|
50
|
+
readonly effects: readonly OperationEffect[];
|
|
51
|
+
readonly execute: {
|
|
52
|
+
bivarianceHack(
|
|
53
|
+
input: I,
|
|
54
|
+
context: OperationContext,
|
|
55
|
+
): Promise<OperationResult<O>>;
|
|
56
|
+
}["bivarianceHack"];
|
|
57
|
+
}
|
|
@@ -29,8 +29,19 @@ type FactKind =
|
|
|
29
29
|
type Operator = "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
|
|
30
30
|
type ValueType = "string" | "int" | "number" | "bool";
|
|
31
31
|
type Polarity = "require" | "forbid" | "assert" | "deny";
|
|
32
|
+
type VerificationScope = "unit" | "integration" | "end_to_end";
|
|
33
|
+
type VerificationPerspective = "internal" | "consumer";
|
|
32
34
|
|
|
33
35
|
const factConditionals = JSON.parse(`[
|
|
36
|
+
{
|
|
37
|
+
"if": {
|
|
38
|
+
"anyOf": [
|
|
39
|
+
{ "required": ["claim_key"] },
|
|
40
|
+
{ "required": ["claim_text"] }
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"then": { "required": ["claim_key", "claim_text"] }
|
|
44
|
+
},
|
|
34
45
|
{
|
|
35
46
|
"if": {
|
|
36
47
|
"properties": {
|
|
@@ -119,6 +130,12 @@ const entitySchema: Record<string, unknown> = {
|
|
|
119
130
|
severity: { type: "string" },
|
|
120
131
|
links: { type: "array", items: { type: "string" } },
|
|
121
132
|
text_ref: { type: "string" },
|
|
133
|
+
logic_claims: {
|
|
134
|
+
type: "array",
|
|
135
|
+
minItems: 1,
|
|
136
|
+
uniqueItems: true,
|
|
137
|
+
items: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
|
|
138
|
+
},
|
|
122
139
|
sourceFile: { type: "string" },
|
|
123
140
|
granularity_reason: {
|
|
124
141
|
type: "string",
|
|
@@ -133,6 +150,14 @@ const entitySchema: Record<string, unknown> = {
|
|
|
133
150
|
type: "string",
|
|
134
151
|
enum: [...SYMBOL_ROLES] satisfies SymbolRole[],
|
|
135
152
|
},
|
|
153
|
+
verification_scope: {
|
|
154
|
+
type: "string",
|
|
155
|
+
enum: ["unit", "integration", "end_to_end"] satisfies VerificationScope[],
|
|
156
|
+
},
|
|
157
|
+
verification_perspective: {
|
|
158
|
+
type: "string",
|
|
159
|
+
enum: ["internal", "consumer"] satisfies VerificationPerspective[],
|
|
160
|
+
},
|
|
136
161
|
type: {
|
|
137
162
|
type: "string",
|
|
138
163
|
enum: [
|
|
@@ -176,6 +201,8 @@ const entitySchema: Record<string, unknown> = {
|
|
|
176
201
|
valid_from: { type: "string" },
|
|
177
202
|
valid_to: { type: "string" },
|
|
178
203
|
canonical_key: { type: "string" },
|
|
204
|
+
claim_key: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
|
|
205
|
+
claim_text: { type: "string" },
|
|
179
206
|
predicate_name: { type: "string" },
|
|
180
207
|
predicate_namespace: { type: "string" },
|
|
181
208
|
predicate_arity: { type: "integer", minimum: 1 },
|
|
@@ -196,6 +223,14 @@ const entitySchema: Record<string, unknown> = {
|
|
|
196
223
|
"type",
|
|
197
224
|
],
|
|
198
225
|
allOf: [
|
|
226
|
+
{
|
|
227
|
+
if: {
|
|
228
|
+
properties: { type: { const: "req" } },
|
|
229
|
+
},
|
|
230
|
+
else: {
|
|
231
|
+
not: { required: ["logic_claims"] },
|
|
232
|
+
},
|
|
233
|
+
},
|
|
199
234
|
// Forbid fact-only fields on non-fact entities
|
|
200
235
|
{
|
|
201
236
|
if: {
|
|
@@ -222,6 +257,8 @@ const entitySchema: Record<string, unknown> = {
|
|
|
222
257
|
{ required: ["valid_from"] },
|
|
223
258
|
{ required: ["valid_to"] },
|
|
224
259
|
{ required: ["canonical_key"] },
|
|
260
|
+
{ required: ["claim_key"] },
|
|
261
|
+
{ required: ["claim_text"] },
|
|
225
262
|
{ required: ["predicate_name"] },
|
|
226
263
|
{ required: ["predicate_namespace"] },
|
|
227
264
|
{ required: ["predicate_arity"] },
|
|
@@ -235,6 +272,19 @@ const entitySchema: Record<string, unknown> = {
|
|
|
235
272
|
},
|
|
236
273
|
},
|
|
237
274
|
},
|
|
275
|
+
{
|
|
276
|
+
if: {
|
|
277
|
+
properties: { type: { const: "test" } },
|
|
278
|
+
},
|
|
279
|
+
else: {
|
|
280
|
+
not: {
|
|
281
|
+
anyOf: [
|
|
282
|
+
{ required: ["verification_scope"] },
|
|
283
|
+
{ required: ["verification_perspective"] },
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
238
288
|
...factConditionals,
|
|
239
289
|
],
|
|
240
290
|
additionalProperties: false,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export class SkillNotFoundError extends Error {
|
|
2
|
+
constructor(id: string) {
|
|
3
|
+
super(`Skill not found: ${id}`);
|
|
4
|
+
this.name = "SkillNotFoundError";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class SkillResourceNotFoundError extends Error {
|
|
8
|
+
constructor(id: string, resourcePath: string) {
|
|
9
|
+
super(`Skill resource not found: ${id}/${resourcePath}`);
|
|
10
|
+
this.name = "SkillResourceNotFoundError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class SkillResourceOutOfBoundsError extends Error {
|
|
14
|
+
constructor(id: string, resourcePath: string) {
|
|
15
|
+
super(`Skill resource escapes bundle root: ${id}/${resourcePath}`);
|
|
16
|
+
this.name = "SkillResourceOutOfBoundsError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class SkillValidationError extends Error {
|
|
20
|
+
readonly field: string;
|
|
21
|
+
constructor(field: string, message: string) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "SkillValidationError";
|
|
24
|
+
this.field = field;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class SkillOversizeError extends Error {
|
|
28
|
+
readonly maxBytes: number;
|
|
29
|
+
readonly actualBytes: number;
|
|
30
|
+
constructor(pathLike: string, maxBytes: number, actualBytes: number) {
|
|
31
|
+
super(
|
|
32
|
+
`Skill file exceeds ${maxBytes} bytes: ${pathLike} (${actualBytes} bytes)`,
|
|
33
|
+
);
|
|
34
|
+
this.name = "SkillOversizeError";
|
|
35
|
+
this.maxBytes = maxBytes;
|
|
36
|
+
this.actualBytes = actualBytes;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import {
|
|
5
|
+
SkillNotFoundError,
|
|
6
|
+
SkillResourceNotFoundError,
|
|
7
|
+
SkillResourceOutOfBoundsError,
|
|
8
|
+
} from "./errors.js";
|
|
9
|
+
import {
|
|
10
|
+
SKILL_FILE_NAME,
|
|
11
|
+
isPathOutOfBounds,
|
|
12
|
+
isWithinRoot,
|
|
13
|
+
normalizeResourcePath,
|
|
14
|
+
} from "./paths.js";
|
|
15
|
+
import type { SkillBundle, SkillManifest } from "./types.js";
|
|
16
|
+
import {
|
|
17
|
+
RESOURCE_MAX_BYTES,
|
|
18
|
+
assertMaxBytes,
|
|
19
|
+
parseSkillBundle,
|
|
20
|
+
} from "./validation.js";
|
|
21
|
+
const defaultBundledSkillsDir = resolve(
|
|
22
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
23
|
+
"../skills",
|
|
24
|
+
);
|
|
25
|
+
let bundledSkillsDir = defaultBundledSkillsDir;
|
|
26
|
+
export function setBundledSkillsDir(dir: string): void {
|
|
27
|
+
bundledSkillsDir = dir;
|
|
28
|
+
}
|
|
29
|
+
export function resetBundledSkillsDir(): void {
|
|
30
|
+
bundledSkillsDir = defaultBundledSkillsDir;
|
|
31
|
+
}
|
|
32
|
+
export function listBundledSkills(): SkillManifest[] {
|
|
33
|
+
return listFrom(bundledSkillsDir);
|
|
34
|
+
}
|
|
35
|
+
export function loadBundledSkill(id: string): SkillBundle {
|
|
36
|
+
return loadBundledSkillFrom(bundledSkillsDir, id);
|
|
37
|
+
}
|
|
38
|
+
// implements REQ-reusable-skill-subsystem
|
|
39
|
+
// covered_by TEST-skill-cli-load-validate
|
|
40
|
+
export function loadBundledSkillFrom(
|
|
41
|
+
skillsDir: string,
|
|
42
|
+
id: string,
|
|
43
|
+
): SkillBundle {
|
|
44
|
+
const root = findRoot(resolve(skillsDir), id);
|
|
45
|
+
if (!root) throw new SkillNotFoundError(id);
|
|
46
|
+
return parseSkillBundle(root);
|
|
47
|
+
}
|
|
48
|
+
export function readBundledSkillResource(
|
|
49
|
+
id: string,
|
|
50
|
+
resourcePath: string,
|
|
51
|
+
): string {
|
|
52
|
+
return readBundle(loadBundledSkill(id), id, resourcePath);
|
|
53
|
+
}
|
|
54
|
+
// implements REQ-reusable-skill-subsystem
|
|
55
|
+
// covered_by TEST-skill-cli-load-validate
|
|
56
|
+
export function readBundledSkillResourceFrom(
|
|
57
|
+
skillsDir: string,
|
|
58
|
+
id: string,
|
|
59
|
+
resourcePath: string,
|
|
60
|
+
): string {
|
|
61
|
+
return readBundle(loadBundledSkillFrom(skillsDir, id), id, resourcePath);
|
|
62
|
+
}
|
|
63
|
+
function listFrom(dir: string): SkillManifest[] {
|
|
64
|
+
if (!existsSync(dir)) return [];
|
|
65
|
+
return readdirSync(dir, { withFileTypes: true })
|
|
66
|
+
.filter((entry) => entry.isDirectory())
|
|
67
|
+
.map((entry) => join(dir, entry.name))
|
|
68
|
+
.filter((root) => existsSync(join(root, SKILL_FILE_NAME)))
|
|
69
|
+
.map((root) => parseSkillBundle(root).manifest)
|
|
70
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
71
|
+
}
|
|
72
|
+
function findRoot(dir: string, id: string): string | undefined {
|
|
73
|
+
return listRoots(dir).find(
|
|
74
|
+
(root) => parseSkillBundle(root).manifest.id === id,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function listRoots(dir: string): string[] {
|
|
78
|
+
if (!existsSync(dir)) return [];
|
|
79
|
+
return readdirSync(dir, { withFileTypes: true })
|
|
80
|
+
.filter((entry) => entry.isDirectory())
|
|
81
|
+
.map((entry) => join(dir, entry.name))
|
|
82
|
+
.filter((root) => existsSync(join(root, SKILL_FILE_NAME)));
|
|
83
|
+
}
|
|
84
|
+
function readBundle(
|
|
85
|
+
bundle: SkillBundle,
|
|
86
|
+
id: string,
|
|
87
|
+
resourcePath: string,
|
|
88
|
+
): string {
|
|
89
|
+
const resource = normalizeResourcePath(resourcePath);
|
|
90
|
+
if (!resource || isPathOutOfBounds(resourcePath))
|
|
91
|
+
throw new SkillResourceOutOfBoundsError(id, resourcePath);
|
|
92
|
+
if (
|
|
93
|
+
!(bundle.manifest.resources ?? []).some(
|
|
94
|
+
(declared) => normalizeResourcePath(declared) === resource,
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
throw new SkillResourceNotFoundError(id, resourcePath);
|
|
98
|
+
const candidate = resolve(bundle.rootDir, resource);
|
|
99
|
+
try {
|
|
100
|
+
if (!isWithinRoot(realpathSync(bundle.rootDir), realpathSync(candidate)))
|
|
101
|
+
throw new SkillResourceOutOfBoundsError(id, resourcePath);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (error instanceof SkillResourceOutOfBoundsError) throw error;
|
|
104
|
+
throw new SkillResourceNotFoundError(id, resourcePath);
|
|
105
|
+
}
|
|
106
|
+
assertMaxBytes(candidate, RESOURCE_MAX_BYTES);
|
|
107
|
+
return readFileSync(candidate, "utf8");
|
|
108
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { existsSync, statSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, join, normalize, relative, resolve } from "node:path";
|
|
3
|
+
export const SKILL_FILE_NAME = "SKILL.md";
|
|
4
|
+
export function normalizeResourcePath(pathLike: string): string {
|
|
5
|
+
return normalize(pathLike).replaceAll("\\", "/");
|
|
6
|
+
}
|
|
7
|
+
export function isPathOutOfBounds(pathLike: string): boolean {
|
|
8
|
+
const normalized = normalizeResourcePath(pathLike);
|
|
9
|
+
return (
|
|
10
|
+
isAbsolute(pathLike) ||
|
|
11
|
+
normalized === ".." ||
|
|
12
|
+
normalized.startsWith("../") ||
|
|
13
|
+
normalized.includes("/../")
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
export function isWithinRoot(rootDir: string, candidatePath: string): boolean {
|
|
17
|
+
const rel = relative(rootDir, candidatePath);
|
|
18
|
+
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
19
|
+
}
|
|
20
|
+
export function resolveSkillFilePath(pathLike: string): string {
|
|
21
|
+
const resolved = resolve(pathLike);
|
|
22
|
+
if (existsSync(resolved) && statSync(resolved).isDirectory())
|
|
23
|
+
return join(resolved, SKILL_FILE_NAME);
|
|
24
|
+
return resolved.endsWith(SKILL_FILE_NAME)
|
|
25
|
+
? resolved
|
|
26
|
+
: join(resolved, SKILL_FILE_NAME);
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SkillManifest {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
version: string;
|
|
6
|
+
kibiCompatibility: string;
|
|
7
|
+
tags?: string[];
|
|
8
|
+
resources?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface SkillBundle {
|
|
11
|
+
manifest: SkillManifest;
|
|
12
|
+
body: string;
|
|
13
|
+
rootDir: string;
|
|
14
|
+
}
|