kibi-cli 0.14.0 → 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.
Files changed (432) hide show
  1. package/bin/kibi +3 -1
  2. package/dist/cli-command.d.ts +5 -0
  3. package/dist/cli-command.d.ts.map +1 -0
  4. package/dist/cli-command.js +9 -0
  5. package/dist/cli-errors.d.ts +13 -0
  6. package/dist/cli-errors.d.ts.map +1 -0
  7. package/dist/cli-errors.js +26 -0
  8. package/dist/cli-input.d.ts +6 -0
  9. package/dist/cli-input.d.ts.map +1 -0
  10. package/dist/cli-input.js +54 -0
  11. package/dist/cli-json-command.d.ts +14 -0
  12. package/dist/cli-json-command.d.ts.map +1 -0
  13. package/dist/cli-json-command.js +96 -0
  14. package/dist/cli-protocol.d.ts +12 -0
  15. package/dist/cli-protocol.d.ts.map +1 -0
  16. package/dist/cli-protocol.js +37 -0
  17. package/dist/cli-register-foundation.d.ts +3 -0
  18. package/dist/cli-register-foundation.d.ts.map +1 -0
  19. package/dist/cli-register-foundation.js +90 -0
  20. package/dist/cli-register-maintenance.d.ts +3 -0
  21. package/dist/cli-register-maintenance.d.ts.map +1 -0
  22. package/dist/cli-register-maintenance.js +36 -0
  23. package/dist/cli-register-reporting.d.ts +3 -0
  24. package/dist/cli-register-reporting.d.ts.map +1 -0
  25. package/dist/cli-register-reporting.js +101 -0
  26. package/dist/cli-register-skills.d.ts +3 -0
  27. package/dist/cli-register-skills.d.ts.map +1 -0
  28. package/dist/cli-register-skills.js +71 -0
  29. package/dist/cli-validate.d.ts +18 -0
  30. package/dist/cli-validate.d.ts.map +1 -0
  31. package/dist/cli-validate.js +45 -0
  32. package/dist/cli.d.ts +4 -4
  33. package/dist/cli.d.ts.map +1 -1
  34. package/dist/cli.js +48 -211
  35. package/dist/commands/aggregated-checks.d.ts +1 -1
  36. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  37. package/dist/commands/aggregated-checks.js +28 -34
  38. package/dist/commands/check.d.ts +1 -1
  39. package/dist/commands/check.d.ts.map +1 -1
  40. package/dist/commands/check.js +52 -94
  41. package/dist/commands/coverage.d.ts.map +1 -1
  42. package/dist/commands/coverage.js +12 -17
  43. package/dist/commands/discovery-shared.d.ts +2 -1
  44. package/dist/commands/discovery-shared.d.ts.map +1 -1
  45. package/dist/commands/discovery-shared.js +6 -18
  46. package/dist/commands/gaps.d.ts.map +1 -1
  47. package/dist/commands/gaps.js +15 -19
  48. package/dist/commands/graph.d.ts.map +1 -1
  49. package/dist/commands/graph.js +15 -21
  50. package/dist/commands/query.d.ts +7 -7
  51. package/dist/commands/query.d.ts.map +1 -1
  52. package/dist/commands/query.js +98 -204
  53. package/dist/commands/search.d.ts +4 -4
  54. package/dist/commands/search.d.ts.map +1 -1
  55. package/dist/commands/search.js +14 -27
  56. package/dist/commands/status.d.ts +1 -1
  57. package/dist/commands/status.d.ts.map +1 -1
  58. package/dist/commands/status.js +6 -7
  59. package/dist/commands/sync/manifest.d.ts +1 -1
  60. package/dist/commands/sync/manifest.d.ts.map +1 -1
  61. package/dist/commands/sync/manifest.js +9 -17
  62. package/dist/commands/sync/persistence.d.ts.map +1 -1
  63. package/dist/commands/sync/persistence.js +22 -1
  64. package/dist/extractors/markdown.d.ts +14 -2
  65. package/dist/extractors/markdown.d.ts.map +1 -1
  66. package/dist/extractors/markdown.js +38 -1
  67. package/dist/extractors/symbols-ts.d.ts.map +1 -1
  68. package/dist/extractors/symbols-ts.js +11 -1
  69. package/dist/operations/autopilot/activation.d.ts +4 -0
  70. package/dist/operations/autopilot/activation.d.ts.map +1 -0
  71. package/dist/operations/autopilot/activation.js +130 -0
  72. package/dist/operations/autopilot/candidate-helpers.d.ts +13 -0
  73. package/dist/operations/autopilot/candidate-helpers.d.ts.map +1 -0
  74. package/dist/operations/autopilot/candidate-helpers.js +55 -0
  75. package/dist/operations/autopilot/candidates.d.ts +4 -0
  76. package/dist/operations/autopilot/candidates.d.ts.map +1 -0
  77. package/dist/operations/autopilot/candidates.js +114 -0
  78. package/dist/operations/autopilot/discovery-evidence.d.ts +10 -0
  79. package/dist/operations/autopilot/discovery-evidence.d.ts.map +1 -0
  80. package/dist/operations/autopilot/discovery-evidence.js +158 -0
  81. package/dist/operations/autopilot/discovery.d.ts +4 -0
  82. package/dist/operations/autopilot/discovery.d.ts.map +1 -0
  83. package/dist/operations/autopilot/discovery.js +100 -0
  84. package/dist/operations/autopilot/generate.d.ts +8 -0
  85. package/dist/operations/autopilot/generate.d.ts.map +1 -0
  86. package/dist/operations/autopilot/generate.js +112 -0
  87. package/dist/operations/autopilot/guidance-actions.d.ts +3 -0
  88. package/dist/operations/autopilot/guidance-actions.d.ts.map +1 -0
  89. package/dist/operations/autopilot/guidance-actions.js +79 -0
  90. package/dist/operations/autopilot/guidance.d.ts +14 -0
  91. package/dist/operations/autopilot/guidance.d.ts.map +1 -0
  92. package/dist/operations/autopilot/guidance.js +124 -0
  93. package/dist/operations/autopilot/markdown-candidates.d.ts +7 -0
  94. package/dist/operations/autopilot/markdown-candidates.d.ts.map +1 -0
  95. package/dist/operations/autopilot/markdown-candidates.js +134 -0
  96. package/dist/operations/autopilot/presentation.d.ts +13 -0
  97. package/dist/operations/autopilot/presentation.d.ts.map +1 -0
  98. package/dist/operations/autopilot/presentation.js +91 -0
  99. package/dist/operations/autopilot/requirement-claims.d.ts +3 -0
  100. package/dist/operations/autopilot/requirement-claims.d.ts.map +1 -0
  101. package/dist/operations/autopilot/requirement-claims.js +48 -0
  102. package/dist/operations/autopilot/types.d.ts +117 -0
  103. package/dist/operations/autopilot/types.d.ts.map +1 -0
  104. package/dist/operations/autopilot/types.js +8 -0
  105. package/dist/operations/modeling/model-requirement.d.ts +10 -0
  106. package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
  107. package/dist/operations/modeling/model-requirement.js +108 -0
  108. package/dist/operations/modeling/predicate-applyplan.d.ts +6 -0
  109. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -0
  110. package/dist/operations/modeling/predicate-applyplan.js +104 -0
  111. package/dist/operations/modeling/predicate-catalog-1.d.ts +3 -0
  112. package/dist/operations/modeling/predicate-catalog-1.d.ts.map +1 -0
  113. package/dist/operations/modeling/predicate-catalog-1.js +200 -0
  114. package/dist/operations/modeling/predicate-catalog-2.d.ts +3 -0
  115. package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -0
  116. package/dist/operations/modeling/predicate-catalog-2.js +197 -0
  117. package/dist/operations/modeling/predicate-catalog-3.d.ts +3 -0
  118. package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -0
  119. package/dist/operations/modeling/predicate-catalog-3.js +193 -0
  120. package/dist/operations/modeling/predicate-catalog-4.d.ts +3 -0
  121. package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -0
  122. package/dist/operations/modeling/predicate-catalog-4.js +149 -0
  123. package/dist/operations/modeling/predicate-catalog.d.ts +5 -0
  124. package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -0
  125. package/dist/operations/modeling/predicate-catalog.js +29 -0
  126. package/dist/operations/modeling/predicate-inference-1.d.ts +16 -0
  127. package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -0
  128. package/dist/operations/modeling/predicate-inference-1.js +161 -0
  129. package/dist/operations/modeling/predicate-inference-2.d.ts +19 -0
  130. package/dist/operations/modeling/predicate-inference-2.d.ts.map +1 -0
  131. package/dist/operations/modeling/predicate-inference-2.js +169 -0
  132. package/dist/operations/modeling/predicate-inference-3.d.ts +15 -0
  133. package/dist/operations/modeling/predicate-inference-3.d.ts.map +1 -0
  134. package/dist/operations/modeling/predicate-inference-3.js +163 -0
  135. package/dist/operations/modeling/predicate-inference.d.ts +5 -0
  136. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -0
  137. package/dist/operations/modeling/predicate-inference.js +148 -0
  138. package/dist/operations/modeling/predicate-loader.d.ts +10 -0
  139. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -0
  140. package/dist/operations/modeling/predicate-loader.js +88 -0
  141. package/dist/operations/modeling/predicate-ranker.d.ts +3 -0
  142. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -0
  143. package/dist/operations/modeling/predicate-ranker.js +24 -0
  144. package/dist/operations/modeling/predicate-score-1.d.ts +3 -0
  145. package/dist/operations/modeling/predicate-score-1.d.ts.map +1 -0
  146. package/dist/operations/modeling/predicate-score-1.js +121 -0
  147. package/dist/operations/modeling/predicate-score-2.d.ts +3 -0
  148. package/dist/operations/modeling/predicate-score-2.d.ts.map +1 -0
  149. package/dist/operations/modeling/predicate-score-2.js +122 -0
  150. package/dist/operations/modeling/predicate-score-3.d.ts +3 -0
  151. package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -0
  152. package/dist/operations/modeling/predicate-score-3.js +54 -0
  153. package/dist/operations/modeling/predicate-types.d.ts +61 -0
  154. package/dist/operations/modeling/predicate-types.d.ts.map +1 -0
  155. package/dist/operations/modeling/predicate-types.js +1 -0
  156. package/dist/operations/modeling/predicate-usage-hints-1.d.ts +3 -0
  157. package/dist/operations/modeling/predicate-usage-hints-1.d.ts.map +1 -0
  158. package/dist/operations/modeling/predicate-usage-hints-1.js +211 -0
  159. package/dist/operations/modeling/predicate-usage-hints-2.d.ts +3 -0
  160. package/dist/operations/modeling/predicate-usage-hints-2.d.ts.map +1 -0
  161. package/dist/operations/modeling/predicate-usage-hints-2.js +209 -0
  162. package/dist/operations/modeling/predicate-usage-hints-3.d.ts +3 -0
  163. package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -0
  164. package/dist/operations/modeling/predicate-usage-hints-3.js +45 -0
  165. package/dist/operations/modeling/predicate-utils.d.ts +23 -0
  166. package/dist/operations/modeling/predicate-utils.d.ts.map +1 -0
  167. package/dist/operations/modeling/predicate-utils.js +187 -0
  168. package/dist/operations/modeling/requirement-applyplan.d.ts +4 -0
  169. package/dist/operations/modeling/requirement-applyplan.d.ts.map +1 -0
  170. package/dist/operations/modeling/requirement-applyplan.js +44 -0
  171. package/dist/operations/modeling/requirement-heuristics.d.ts +4 -0
  172. package/dist/operations/modeling/requirement-heuristics.d.ts.map +1 -0
  173. package/dist/operations/modeling/requirement-heuristics.js +114 -0
  174. package/dist/operations/modeling/requirement-modeler.d.ts +8 -0
  175. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -0
  176. package/dist/operations/modeling/requirement-modeler.js +70 -0
  177. package/dist/operations/modeling/requirement-types.d.ts +49 -0
  178. package/dist/operations/modeling/requirement-types.d.ts.map +1 -0
  179. package/dist/operations/modeling/requirement-types.js +1 -0
  180. package/dist/operations/modeling/requirement-utils.d.ts +10 -0
  181. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -0
  182. package/dist/operations/modeling/requirement-utils.js +65 -0
  183. package/dist/operations/modeling/suggest-predicates.d.ts +6 -0
  184. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -0
  185. package/dist/operations/modeling/suggest-predicates.js +64 -0
  186. package/dist/operations/mutation/audit.d.ts +6 -0
  187. package/dist/operations/mutation/audit.d.ts.map +1 -0
  188. package/dist/operations/mutation/audit.js +22 -0
  189. package/dist/operations/mutation/contradictions.d.ts +10 -0
  190. package/dist/operations/mutation/contradictions.d.ts.map +1 -0
  191. package/dist/operations/mutation/contradictions.js +40 -0
  192. package/dist/operations/mutation/delete.d.ts +5 -0
  193. package/dist/operations/mutation/delete.d.ts.map +1 -0
  194. package/dist/operations/mutation/delete.js +67 -0
  195. package/dist/operations/mutation/relationships.d.ts +17 -0
  196. package/dist/operations/mutation/relationships.d.ts.map +1 -0
  197. package/dist/operations/mutation/relationships.js +134 -0
  198. package/dist/operations/mutation/save.d.ts +4 -0
  199. package/dist/operations/mutation/save.d.ts.map +1 -0
  200. package/dist/operations/mutation/save.js +14 -0
  201. package/dist/operations/mutation/serialization.d.ts +5 -0
  202. package/dist/operations/mutation/serialization.d.ts.map +1 -0
  203. package/dist/operations/mutation/serialization.js +85 -0
  204. package/dist/operations/mutation/strict-fact.d.ts +4 -0
  205. package/dist/operations/mutation/strict-fact.d.ts.map +1 -0
  206. package/dist/operations/mutation/strict-fact.js +67 -0
  207. package/dist/operations/mutation/symbol-granularity.d.ts +4 -0
  208. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -0
  209. package/dist/operations/mutation/symbol-granularity.js +109 -0
  210. package/dist/operations/mutation/symbol-refresh.d.ts +10 -0
  211. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -0
  212. package/dist/operations/mutation/symbol-refresh.js +105 -0
  213. package/dist/operations/mutation/types.d.ts +43 -0
  214. package/dist/operations/mutation/types.d.ts.map +1 -0
  215. package/dist/operations/mutation/types.js +1 -0
  216. package/dist/operations/mutation/upsert.d.ts +5 -0
  217. package/dist/operations/mutation/upsert.d.ts.map +1 -0
  218. package/dist/operations/mutation/upsert.js +103 -0
  219. package/dist/operations/mutation/validate-upsert.d.ts +5 -0
  220. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -0
  221. package/dist/operations/mutation/validate-upsert.js +50 -0
  222. package/dist/operations/mutation/validation.d.ts +5 -0
  223. package/dist/operations/mutation/validation.d.ts.map +1 -0
  224. package/dist/operations/mutation/validation.js +107 -0
  225. package/dist/operations/mutation/warnings.d.ts +4 -0
  226. package/dist/operations/mutation/warnings.d.ts.map +1 -0
  227. package/dist/operations/mutation/warnings.js +17 -0
  228. package/dist/operations/semantic-advisor/analysis-receipt.d.ts +5 -0
  229. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -0
  230. package/dist/operations/semantic-advisor/analysis-receipt.js +112 -0
  231. package/dist/operations/semantic-advisor/analyze-prose.d.ts +5 -0
  232. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -0
  233. package/dist/operations/semantic-advisor/analyze-prose.js +271 -0
  234. package/dist/operations/semantic-advisor/clauses.d.ts +10 -0
  235. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -0
  236. package/dist/operations/semantic-advisor/clauses.js +43 -0
  237. package/dist/operations/semantic-advisor/observation-plan.d.ts +3 -0
  238. package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -0
  239. package/dist/operations/semantic-advisor/observation-plan.js +19 -0
  240. package/dist/operations/semantic-advisor/predicate-rule.d.ts +14 -0
  241. package/dist/operations/semantic-advisor/predicate-rule.d.ts.map +1 -0
  242. package/dist/operations/semantic-advisor/predicate-rule.js +22 -0
  243. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +79 -0
  244. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -0
  245. package/dist/operations/semantic-advisor/predicate-rules-core.js +140 -0
  246. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +83 -0
  247. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -0
  248. package/dist/operations/semantic-advisor/predicate-rules-policy.js +150 -0
  249. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +48 -0
  250. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -0
  251. package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +102 -0
  252. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +71 -0
  253. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -0
  254. package/dist/operations/semantic-advisor/predicate-rules-product.js +133 -0
  255. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts +29 -0
  256. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts.map +1 -0
  257. package/dist/operations/semantic-advisor/prose-coverage-evaluator.js +54 -0
  258. package/dist/operations/semantic-advisor/shared.d.ts +18 -0
  259. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -0
  260. package/dist/operations/semantic-advisor/shared.js +209 -0
  261. package/dist/operations/semantic-advisor/strict-count-rules.d.ts +4 -0
  262. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -0
  263. package/dist/operations/semantic-advisor/strict-count-rules.js +62 -0
  264. package/dist/operations/semantic-advisor/strict-rules.d.ts +4 -0
  265. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -0
  266. package/dist/operations/semantic-advisor/strict-rules.js +106 -0
  267. package/dist/operations/semantic-advisor/types.d.ts +135 -0
  268. package/dist/operations/semantic-advisor/types.d.ts.map +1 -0
  269. package/dist/operations/semantic-advisor/types.js +1 -0
  270. package/dist/prolog/codec.d.ts.map +1 -1
  271. package/dist/prolog/codec.js +9 -2
  272. package/dist/prolog.d.ts +5 -0
  273. package/dist/prolog.d.ts.map +1 -1
  274. package/dist/prolog.js +82 -30
  275. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  276. package/dist/public/impact/diagnostics.js +8 -4
  277. package/dist/public/impact/full-kb-quality.d.ts +1 -1
  278. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  279. package/dist/public/impact/full-kb-quality.js +34 -1
  280. package/dist/public/impact/requirement-quality.d.ts.map +1 -1
  281. package/dist/public/impact/requirement-quality.js +6 -23
  282. package/dist/public/operations/catalog.d.ts +907 -0
  283. package/dist/public/operations/catalog.d.ts.map +1 -0
  284. package/dist/public/operations/catalog.js +42 -0
  285. package/dist/public/operations/check-executor.d.ts +21 -0
  286. package/dist/public/operations/check-executor.d.ts.map +1 -0
  287. package/dist/public/operations/check-executor.js +111 -0
  288. package/dist/public/operations/check-format-shared.d.ts +36 -0
  289. package/dist/public/operations/check-format-shared.d.ts.map +1 -0
  290. package/dist/public/operations/check-format-shared.js +107 -0
  291. package/dist/public/operations/check-helpers.d.ts +10 -0
  292. package/dist/public/operations/check-helpers.d.ts.map +1 -0
  293. package/dist/public/operations/check-helpers.js +107 -0
  294. package/dist/public/operations/discovery-entities.d.ts +14 -0
  295. package/dist/public/operations/discovery-entities.d.ts.map +1 -0
  296. package/dist/public/operations/discovery-entities.js +91 -0
  297. package/dist/public/operations/discovery-executors.d.ts +39 -0
  298. package/dist/public/operations/discovery-executors.d.ts.map +1 -0
  299. package/dist/public/operations/discovery-executors.js +101 -0
  300. package/dist/public/operations/index.d.ts +20 -0
  301. package/dist/public/operations/index.d.ts.map +1 -0
  302. package/dist/public/operations/index.js +18 -0
  303. package/dist/public/operations/node-ports.d.ts +15 -0
  304. package/dist/public/operations/node-ports.d.ts.map +1 -0
  305. package/dist/public/operations/node-ports.js +57 -0
  306. package/dist/public/operations/prolog-json.d.ts +5 -0
  307. package/dist/public/operations/prolog-json.d.ts.map +1 -0
  308. package/dist/public/operations/prolog-json.js +44 -0
  309. package/dist/public/operations/runtime-types.d.ts +69 -0
  310. package/dist/public/operations/runtime-types.d.ts.map +1 -0
  311. package/dist/public/operations/runtime-types.js +17 -0
  312. package/dist/public/operations/specs/autopilot.d.ts +82 -0
  313. package/dist/public/operations/specs/autopilot.d.ts.map +1 -0
  314. package/dist/public/operations/specs/autopilot.js +72 -0
  315. package/dist/public/operations/specs/check.d.ts +51 -0
  316. package/dist/public/operations/specs/check.d.ts.map +1 -0
  317. package/dist/public/operations/specs/check.js +62 -0
  318. package/dist/public/operations/specs/discovery.d.ts +94 -0
  319. package/dist/public/operations/specs/discovery.d.ts.map +1 -0
  320. package/dist/public/operations/specs/discovery.js +98 -0
  321. package/dist/public/operations/specs/modeling.d.ts +126 -0
  322. package/dist/public/operations/specs/modeling.d.ts.map +1 -0
  323. package/dist/public/operations/specs/modeling.js +117 -0
  324. package/dist/public/operations/specs/mutation-schemas.d.ts +233 -0
  325. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
  326. package/dist/public/operations/specs/mutation-schemas.js +267 -0
  327. package/dist/public/operations/specs/mutation.d.ts +56 -0
  328. package/dist/public/operations/specs/mutation.d.ts.map +1 -0
  329. package/dist/public/operations/specs/mutation.js +44 -0
  330. package/dist/public/operations/specs/reporting.d.ts +185 -0
  331. package/dist/public/operations/specs/reporting.d.ts.map +1 -0
  332. package/dist/public/operations/specs/reporting.js +158 -0
  333. package/dist/public/operations/specs/semantic.d.ts +53 -0
  334. package/dist/public/operations/specs/semantic.d.ts.map +1 -0
  335. package/dist/public/operations/specs/semantic.js +105 -0
  336. package/dist/public/operations/specs/skills.d.ts +70 -0
  337. package/dist/public/operations/specs/skills.d.ts.map +1 -0
  338. package/dist/public/operations/specs/skills.js +107 -0
  339. package/dist/public/operations/specs/sparql.d.ts +39 -0
  340. package/dist/public/operations/specs/sparql.d.ts.map +1 -0
  341. package/dist/public/operations/specs/sparql.js +121 -0
  342. package/dist/public/operations/specs/upsert.d.ts +256 -0
  343. package/dist/public/operations/specs/upsert.d.ts.map +1 -0
  344. package/dist/public/operations/specs/upsert.js +27 -0
  345. package/dist/public/operations/types.d.ts +24 -0
  346. package/dist/public/operations/types.d.ts.map +1 -0
  347. package/dist/public/operations/types.js +1 -0
  348. package/dist/public/schemas/entity.d.ts.map +1 -1
  349. package/dist/public/schemas/entity.js +27 -0
  350. package/dist/public/skill-system/errors.d.ts +19 -0
  351. package/dist/public/skill-system/errors.d.ts.map +1 -0
  352. package/dist/public/skill-system/errors.js +36 -0
  353. package/dist/public/skill-system/loader.d.ts +9 -0
  354. package/dist/public/skill-system/loader.d.ts.map +1 -0
  355. package/dist/public/skill-system/loader.js +76 -0
  356. package/dist/public/skill-system/paths.d.ts +6 -0
  357. package/dist/public/skill-system/paths.d.ts.map +1 -0
  358. package/dist/public/skill-system/paths.js +25 -0
  359. package/dist/public/skill-system/types.d.ts +15 -0
  360. package/dist/public/skill-system/types.d.ts.map +1 -0
  361. package/dist/public/skill-system/types.js +1 -0
  362. package/dist/public/skill-system/validation.d.ts +10 -0
  363. package/dist/public/skill-system/validation.d.ts.map +1 -0
  364. package/dist/public/skill-system/validation.js +119 -0
  365. package/dist/public/skills/init-kibi/SKILL.md +62 -0
  366. package/dist/public/skills/kibi-freshness/SKILL.md +44 -0
  367. package/dist/public/skills/kibi-traceability/SKILL.md +54 -0
  368. package/dist/public/skills/kibi-usage/SKILL.md +119 -99
  369. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +102 -0
  370. package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
  371. package/dist/public/skills/kibi-usage/resources/workflows.md +26 -3
  372. package/dist/public/skills.d.ts +4 -41
  373. package/dist/public/skills.d.ts.map +1 -1
  374. package/dist/public/skills.js +3 -270
  375. package/dist/runtime/cli-runtime.d.ts +3 -0
  376. package/dist/runtime/cli-runtime.d.ts.map +1 -0
  377. package/dist/runtime/cli-runtime.js +96 -0
  378. package/dist/schemas/entity.schema.json +23 -0
  379. package/dist/traceability/staged-diagnostics.d.ts +1 -1
  380. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  381. package/dist/traceability/staged-symbols-manifest.d.ts +1 -0
  382. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  383. package/dist/traceability/staged-symbols-manifest.js +38 -27
  384. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  385. package/dist/traceability/symbol-extract.js +17 -1
  386. package/dist/traceability/temp-kb.d.ts.map +1 -1
  387. package/dist/traceability/temp-kb.js +34 -1
  388. package/dist/types/entities.d.ts +3 -0
  389. package/dist/types/entities.d.ts.map +1 -1
  390. package/dist/utils/rule-registry.d.ts.map +1 -1
  391. package/dist/utils/rule-registry.js +6 -0
  392. package/package.json +56 -2
  393. package/src/public/impact/diagnostics.ts +18 -11
  394. package/src/public/impact/full-kb-quality.ts +30 -3
  395. package/src/public/impact/requirement-quality.ts +6 -26
  396. package/src/public/operations/catalog.ts +60 -0
  397. package/src/public/operations/check-executor.ts +185 -0
  398. package/src/public/operations/check-format-shared.ts +178 -0
  399. package/src/public/operations/check-helpers.ts +141 -0
  400. package/src/public/operations/discovery-entities.ts +122 -0
  401. package/src/public/operations/discovery-executors.ts +176 -0
  402. package/src/public/operations/index.ts +19 -0
  403. package/src/public/operations/node-ports.ts +78 -0
  404. package/src/public/operations/prolog-json.ts +71 -0
  405. package/src/public/operations/runtime-types.ts +106 -0
  406. package/src/public/operations/specs/autopilot.ts +98 -0
  407. package/src/public/operations/specs/check.ts +72 -0
  408. package/src/public/operations/specs/discovery.ts +126 -0
  409. package/src/public/operations/specs/modeling.ts +154 -0
  410. package/src/public/operations/specs/mutation-schemas.ts +296 -0
  411. package/src/public/operations/specs/mutation.ts +58 -0
  412. package/src/public/operations/specs/reporting.ts +249 -0
  413. package/src/public/operations/specs/semantic.ts +135 -0
  414. package/src/public/operations/specs/skills.ts +142 -0
  415. package/src/public/operations/specs/sparql.ts +149 -0
  416. package/src/public/operations/specs/upsert.ts +40 -0
  417. package/src/public/operations/types.ts +57 -0
  418. package/src/public/schemas/entity.ts +27 -0
  419. package/src/public/skill-system/errors.ts +38 -0
  420. package/src/public/skill-system/loader.ts +108 -0
  421. package/src/public/skill-system/paths.ts +27 -0
  422. package/src/public/skill-system/types.ts +14 -0
  423. package/src/public/skill-system/validation.ts +175 -0
  424. package/src/public/skills/init-kibi/SKILL.md +62 -0
  425. package/src/public/skills/kibi-freshness/SKILL.md +44 -0
  426. package/src/public/skills/kibi-traceability/SKILL.md +54 -0
  427. package/src/public/skills/kibi-usage/SKILL.md +119 -99
  428. package/src/public/skills/kibi-usage/resources/fact-lanes.md +102 -0
  429. package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
  430. package/src/public/skills/kibi-usage/resources/workflows.md +26 -3
  431. package/src/public/skills.ts +18 -427
  432. package/src/schemas/entity.schema.json +23 -0
@@ -0,0 +1,101 @@
1
+ import { rankEntities } from "../../search-ranking.js";
2
+ import { loadEntities, paginateResults, validateEntityType, } from "./discovery-entities.js";
3
+ import { runOperationJsonQuery } from "./prolog-json.js";
4
+ function requireProlog(context) {
5
+ if (!context.prolog) {
6
+ throw new Error("Discovery operation requires a Prolog context");
7
+ }
8
+ return context.prolog;
9
+ }
10
+ function isStatusPayload(value) {
11
+ if (value === null || typeof value !== "object")
12
+ return false;
13
+ const record = Object.fromEntries(Object.entries(value));
14
+ return (typeof record.branch === "string" &&
15
+ typeof record.snapshotId === "string" &&
16
+ (typeof record.syncedAt === "string" || record.syncedAt === null) &&
17
+ typeof record.dirty === "boolean" &&
18
+ typeof record.syncState === "string");
19
+ }
20
+ export async function executeQuery(input, context) {
21
+ // implements REQ-kibi-operation-interface-parity
22
+ const { type, id, tags, sourceFile, limit = 100, offset = 0 } = input;
23
+ try {
24
+ const entities = await loadEntities(requireProlog(context), {
25
+ ...(type !== undefined ? { type } : {}),
26
+ ...(id !== undefined ? { id } : {}),
27
+ ...(tags !== undefined ? { tags } : {}),
28
+ ...(sourceFile !== undefined ? { sourceFile } : {}),
29
+ });
30
+ const paginated = paginateResults(entities, limit, offset);
31
+ const text = entities.length === 0
32
+ ? `No entities found${type ? ` of type '${type}'` : ""}.`
33
+ : `Found ${entities.length} entities${type ? ` of type '${type}'` : ""}. Showing ${paginated.length} (offset ${offset}, limit ${limit}): ${paginated
34
+ .map((entity) => {
35
+ const entityId = String(entity.id ?? "").replace(/^file:\/\/.*\//, "");
36
+ return `${entityId} (${String(entity.title ?? "")}, status=${String(entity.status ?? "")})`;
37
+ })
38
+ .join(", ")}`;
39
+ return {
40
+ content: [{ type: "text", text }],
41
+ structuredContent: { entities: paginated, count: entities.length },
42
+ };
43
+ }
44
+ catch (error) {
45
+ const message = error instanceof Error ? error.message : String(error);
46
+ throw new Error(`Query execution failed: ${message}`);
47
+ }
48
+ }
49
+ export async function executeSearch(input, context) {
50
+ // implements REQ-kibi-operation-interface-parity, REQ-mcp-search-discovery
51
+ const { query, type, limit = 20, offset = 0 } = input;
52
+ const trimmedQuery = query.trim();
53
+ if (!trimmedQuery) {
54
+ throw new Error("Search execution failed: query must be a non-empty string");
55
+ }
56
+ validateEntityType(type);
57
+ try {
58
+ const entities = await loadEntities(requireProlog(context), {
59
+ ...(type !== undefined ? { type } : {}),
60
+ });
61
+ const matches = await rankEntities(entities, trimmedQuery, context.workspaceRoot);
62
+ const paginated = paginateResults(matches, limit, offset);
63
+ const text = matches.length === 0
64
+ ? `No search results for '${trimmedQuery}'.`
65
+ : `Found ${matches.length} search results for '${trimmedQuery}'. Showing ${paginated.length} (offset ${offset}, limit ${limit}): ${paginated
66
+ .map((match) => `${String(match.entity.id ?? "")} [${match.reasons.join(", ")}]`)
67
+ .join(", ")}`;
68
+ return {
69
+ content: [{ type: "text", text }],
70
+ structuredContent: { results: paginated, count: matches.length },
71
+ };
72
+ }
73
+ catch (error) {
74
+ const message = error instanceof Error ? error.message : String(error);
75
+ if (message.startsWith("Search execution failed:"))
76
+ throw error;
77
+ throw new Error(`Search execution failed: ${message}`);
78
+ }
79
+ }
80
+ export async function executeStatus(_input, context) {
81
+ // implements REQ-kibi-operation-interface-parity, REQ-cli-status-pre-first-sync
82
+ try {
83
+ const payload = await runOperationJsonQuery(requireProlog(context), "status.pl", "status:kb_status_json(JsonString)", "Status execution");
84
+ if (!isStatusPayload(payload)) {
85
+ throw new Error("Status execution query returned an invalid payload");
86
+ }
87
+ return {
88
+ content: [
89
+ {
90
+ type: "text",
91
+ text: `Branch ${payload.branch} is ${payload.syncState} (snapshot ${payload.snapshotId}, dirty=${payload.dirty})`,
92
+ },
93
+ ],
94
+ structuredContent: payload,
95
+ };
96
+ }
97
+ catch (error) {
98
+ const message = error instanceof Error ? error.message : String(error);
99
+ throw new Error(`Status execution failed: ${message}`);
100
+ }
101
+ }
@@ -0,0 +1,20 @@
1
+ export * from "./catalog.js";
2
+ export * from "./check-executor.js";
3
+ export * from "./discovery-entities.js";
4
+ export * from "./discovery-executors.js";
5
+ export * from "./runtime-types.js";
6
+ export * from "./node-ports.js";
7
+ export * from "./specs/autopilot.js";
8
+ export * from "./specs/check.js";
9
+ export * from "./specs/discovery.js";
10
+ export * from "./specs/modeling.js";
11
+ export * from "./specs/mutation.js";
12
+ export * from "./specs/reporting.js";
13
+ export * from "./specs/semantic.js";
14
+ export * from "./specs/skills.js";
15
+ export * from "./specs/sparql.js";
16
+ export * from "./types.js";
17
+ export * from "../../operations/autopilot/generate.js";
18
+ export * from "../../operations/autopilot/presentation.js";
19
+ export type * from "../../operations/autopilot/types.js";
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/operations/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,mBAAmB,qCAAqC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export * from "./catalog.js";
2
+ export * from "./check-executor.js";
3
+ export * from "./discovery-entities.js";
4
+ export * from "./discovery-executors.js";
5
+ export * from "./runtime-types.js";
6
+ export * from "./node-ports.js";
7
+ export * from "./specs/autopilot.js";
8
+ export * from "./specs/check.js";
9
+ export * from "./specs/discovery.js";
10
+ export * from "./specs/modeling.js";
11
+ export * from "./specs/mutation.js";
12
+ export * from "./specs/reporting.js";
13
+ export * from "./specs/semantic.js";
14
+ export * from "./specs/skills.js";
15
+ export * from "./specs/sparql.js";
16
+ export * from "./types.js";
17
+ export * from "../../operations/autopilot/generate.js";
18
+ export * from "../../operations/autopilot/presentation.js";
@@ -0,0 +1,15 @@
1
+ import type { FilesystemPort, GitPort, NetworkPort } from "./runtime-types.js";
2
+ type NodeFilesystemPort = FilesystemPort & {
3
+ readonly glob: (patterns: readonly string[], options: {
4
+ readonly cwd: string;
5
+ readonly includeIgnored?: boolean;
6
+ }) => Promise<readonly string[]>;
7
+ };
8
+ type NodeGitPort = GitPort & {
9
+ readonly ignoredPaths: (workspaceRoot: string, paths: readonly string[]) => Promise<readonly string[]>;
10
+ };
11
+ export declare const nodeFilesystem: NodeFilesystemPort;
12
+ export declare const nodeGit: NodeGitPort;
13
+ export declare const nodeNetwork: NetworkPort;
14
+ export {};
15
+ //# sourceMappingURL=node-ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-ports.d.ts","sourceRoot":"","sources":["../../../src/public/operations/node-ports.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/E,KAAK,kBAAkB,GAAG,cAAc,GAAG;IACzC,QAAQ,CAAC,IAAI,EAAE,CACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KACjE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,GAAG;IAC3B,QAAQ,CAAC,YAAY,EAAE,CACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAiBF,eAAO,MAAM,cAAc,EAAE,kBAkB5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAgBrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAEzB,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { execFile } from "node:child_process";
2
+ import * as fs from "node:fs/promises";
3
+ import { promisify } from "node:util";
4
+ import fg from "fast-glob";
5
+ import { createRepoIgnorePolicy } from "../ignore-policy.js";
6
+ const execFileAsync = promisify(execFile);
7
+ const ALWAYS_IGNORED_GLOBS = [
8
+ "**/.git/**",
9
+ "**/.kb/**",
10
+ "**/node_modules/**",
11
+ "**/vendor/**",
12
+ "**/vendors/**",
13
+ "**/third_party/**",
14
+ "**/third-party/**",
15
+ "**/dist/**",
16
+ "**/build/**",
17
+ "**/coverage/**",
18
+ "**/target/**",
19
+ ];
20
+ export const nodeFilesystem = {
21
+ readFile: (filePath) => fs.readFile(filePath, "utf8"),
22
+ writeFile: async (filePath, data) => {
23
+ await fs.writeFile(filePath, data, "utf8");
24
+ },
25
+ mkdir: async (directoryPath) => {
26
+ await fs.mkdir(directoryPath, { recursive: true });
27
+ },
28
+ stat: (filePath) => fs.stat(filePath),
29
+ glob: (patterns, options) => fg([...patterns], {
30
+ cwd: options.cwd,
31
+ onlyFiles: true,
32
+ unique: true,
33
+ dot: true,
34
+ suppressErrors: true,
35
+ ignore: [...ALWAYS_IGNORED_GLOBS],
36
+ }),
37
+ };
38
+ export const nodeGit = {
39
+ revParse: async (...args) => {
40
+ const { stdout } = await execFileAsync("git", ["rev-parse", ...args]);
41
+ return stdout.trim();
42
+ },
43
+ showToplevel: async () => {
44
+ const { stdout } = await execFileAsync("git", [
45
+ "rev-parse",
46
+ "--show-toplevel",
47
+ ]);
48
+ return stdout.trim();
49
+ },
50
+ ignoredPaths: async (workspaceRoot, paths) => {
51
+ const policy = createRepoIgnorePolicy(workspaceRoot);
52
+ return paths.filter((candidate) => policy.isIgnored(candidate));
53
+ },
54
+ };
55
+ export const nodeNetwork = {
56
+ fetch: (input, init) => globalThis.fetch(input, init),
57
+ };
@@ -0,0 +1,5 @@
1
+ import type { PrologPort } from "./runtime-types.js";
2
+ export declare function runOperationJsonQuery<T>(prolog: PrologPort, fileName: string, goal: string, errorLabel: string): Promise<T>;
3
+ export declare function toPrologAtom(value?: string): string;
4
+ export declare function toPrologList(values?: readonly string[]): string;
5
+ //# sourceMappingURL=prolog-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prolog-json.d.ts","sourceRoot":"","sources":["../../../src/public/operations/prolog-json.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAUrD,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,CAAC,CAuBZ;AAiBD,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAI/D"}
@@ -0,0 +1,44 @@
1
+ import path from "node:path";
2
+ import { getKbPlPathOverride } from "../../env.js";
3
+ import { resolveKbPlPath } from "../../prolog.js";
4
+ import { escapeAtom } from "../../prolog/codec.js";
5
+ function resolveCoreModulePath(fileName) {
6
+ const genericOverride = getKbPlPathOverride();
7
+ return path.join(path.dirname(genericOverride ?? resolveKbPlPath()), fileName);
8
+ }
9
+ export async function runOperationJsonQuery(prolog, fileName, goal, errorLabel) {
10
+ const modulePath = escapeAtom(resolveCoreModulePath(fileName).replaceAll("\\", "/"));
11
+ const oneShotMode = typeof globalThis.Bun !== "undefined";
12
+ const result = oneShotMode
13
+ ? await prolog.query(`(use_module('${modulePath}'), ${goal})`)
14
+ : await runInteractiveModuleQuery(prolog, modulePath, goal, errorLabel);
15
+ if (!result.success) {
16
+ throw new Error(`${errorLabel} query failed: ${result.error ?? "Unknown error"}`);
17
+ }
18
+ const rawJson = result.bindings.JsonString;
19
+ if (rawJson === undefined) {
20
+ throw new Error(`${errorLabel} query returned no JsonString binding`);
21
+ }
22
+ let parsed = JSON.parse(rawJson);
23
+ if (typeof parsed === "string") {
24
+ parsed = JSON.parse(parsed);
25
+ }
26
+ return parsed;
27
+ }
28
+ async function runInteractiveModuleQuery(prolog, modulePath, goal, errorLabel) {
29
+ const loadResult = await prolog.query(`use_module('${modulePath}')`);
30
+ if (!loadResult.success) {
31
+ throw new Error(`${errorLabel} module load failed: ${loadResult.error ?? "Unknown error"}`);
32
+ }
33
+ return prolog.query(goal);
34
+ }
35
+ export function toPrologAtom(value) {
36
+ return value === undefined || value === ""
37
+ ? "none"
38
+ : `'${escapeAtom(value)}'`;
39
+ }
40
+ export function toPrologList(values) {
41
+ return values === undefined || values.length === 0
42
+ ? "[]"
43
+ : `[${values.map((value) => `'${escapeAtom(value)}'`).join(",")}]`;
44
+ }
@@ -0,0 +1,69 @@
1
+ import type { OperationEffect } from "./types.js";
2
+ export type { OperationEffect } from "./types.js";
3
+ export type PrologQueryResult = {
4
+ readonly success: boolean;
5
+ readonly bindings: Readonly<Record<string, string>>;
6
+ readonly error?: string;
7
+ };
8
+ export interface PrologPort {
9
+ query(goal: string): Promise<PrologQueryResult>;
10
+ nextSolution(): Promise<PrologQueryResult | null>;
11
+ invalidateCache?(): void;
12
+ save(): Promise<PrologQueryResult>;
13
+ }
14
+ export type FilesystemStat = {
15
+ readonly isFile: () => boolean;
16
+ readonly isDirectory: () => boolean;
17
+ };
18
+ export interface FilesystemPort {
19
+ readFile(path: string): Promise<string>;
20
+ writeFile(path: string, data: string): Promise<void>;
21
+ mkdir(path: string): Promise<void>;
22
+ stat(path: string): Promise<FilesystemStat>;
23
+ }
24
+ export interface GitPort {
25
+ revParse(...args: readonly string[]): Promise<string>;
26
+ showToplevel(): Promise<string>;
27
+ }
28
+ export interface NetworkPort {
29
+ fetch(input: string | URL, init?: RequestInit): Promise<Response>;
30
+ }
31
+ export type Clock = () => Date;
32
+ export type RuntimeOptions = {
33
+ readonly workspaceRoot?: string;
34
+ readonly signal?: AbortSignal;
35
+ readonly clock?: Clock;
36
+ readonly prolog?: PrologPort;
37
+ readonly fs?: FilesystemPort;
38
+ readonly git?: GitPort;
39
+ readonly net?: NetworkPort;
40
+ };
41
+ export type OperationContext = {
42
+ readonly workspaceRoot: string;
43
+ readonly signal: AbortSignal;
44
+ readonly clock: Clock;
45
+ readonly prolog?: PrologPort;
46
+ readonly fs?: FilesystemPort;
47
+ readonly git?: GitPort;
48
+ readonly net?: NetworkPort;
49
+ };
50
+ export interface RuntimeOperationSpec<TInput = unknown, TResult = unknown> {
51
+ readonly name: string;
52
+ readonly effects: readonly OperationEffect[];
53
+ readonly requiresProlog: boolean;
54
+ execute(input: TInput, context: OperationContext): Promise<TResult>;
55
+ }
56
+ export type OperationOutcome = {
57
+ readonly status: "success";
58
+ readonly result: unknown;
59
+ } | {
60
+ readonly status: "error";
61
+ readonly error: unknown;
62
+ };
63
+ export interface OperationRuntime {
64
+ open(spec: RuntimeOperationSpec<unknown, unknown>, opts?: RuntimeOptions): Promise<OperationContext>;
65
+ afterSuccess(spec: RuntimeOperationSpec<unknown, unknown>, context: OperationContext): Promise<void>;
66
+ close(context: OperationContext, outcome: OperationOutcome): Promise<void>;
67
+ }
68
+ export declare function executeOperation<TInput, TResult>(runtime: OperationRuntime, spec: RuntimeOperationSpec<TInput, TResult>, input: TInput, opts?: RuntimeOptions): Promise<TResult>;
69
+ //# sourceMappingURL=runtime-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-types.d.ts","sourceRoot":"","sources":["../../../src/public/operations/runtime-types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ // implements REQ-kibi-operation-interface-parity
2
+ export async function executeOperation(runtime, spec, input, opts) {
3
+ const context = await runtime.open(spec, opts);
4
+ let result;
5
+ try {
6
+ result = await spec.execute(input, context);
7
+ if (spec.effects.includes("kb-write")) {
8
+ await runtime.afterSuccess(spec, context);
9
+ }
10
+ }
11
+ catch (error) {
12
+ await runtime.close(context, { status: "error", error });
13
+ throw error;
14
+ }
15
+ await runtime.close(context, { status: "success", result });
16
+ return result;
17
+ }
@@ -0,0 +1,82 @@
1
+ import { executeAutopilotGenerate } from "../../../operations/autopilot/generate.js";
2
+ export type { AutopilotBootstrapContext, AutopilotGenerateArgs, AutopilotGenerateResult, } from "../../../operations/autopilot/types.js";
3
+ export { executeAutopilotGenerate } from "../../../operations/autopilot/generate.js";
4
+ export declare const autopilotGenerateSpec: {
5
+ readonly name: "kb_autopilot_generate";
6
+ readonly cliName: "autopilot-generate";
7
+ readonly description: "Generate agent-centric bootstrap output for KB population. Read-only analysis that returns activation state, bootstrap guidance, candidate entities with evidence, payoff summary, and exact applyPlan payloads for later kb_upsert calls. No mutation side effects.";
8
+ readonly businessInputSchema: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly includeGenericMarkdown: {
12
+ readonly type: "boolean";
13
+ readonly default: true;
14
+ readonly description: "Whether to include generic markdown file content as candidate facts. Default: true.";
15
+ };
16
+ readonly minConfidence: {
17
+ readonly type: "number";
18
+ readonly default: 0.8;
19
+ readonly minimum: 0.6;
20
+ readonly maximum: 0.95;
21
+ readonly description: "Minimum confidence threshold for candidates. Clamped to [0.60, 0.95]. Default: 0.80.";
22
+ };
23
+ readonly maxCandidates: {
24
+ readonly type: "integer";
25
+ readonly default: 50;
26
+ readonly minimum: 1;
27
+ readonly maximum: 200;
28
+ readonly description: "Maximum number of candidates to return. Clamped to [1, 200]. Default: 50.";
29
+ };
30
+ readonly entityTypes: {
31
+ readonly type: "array";
32
+ readonly items: {
33
+ readonly type: "string";
34
+ readonly enum: readonly ["req", "scenario", "test", "adr", "fact", "symbol"];
35
+ };
36
+ readonly description: "Optional filter to limit candidate generation to specific entity types.";
37
+ };
38
+ readonly bootstrapContext: {
39
+ readonly type: "object";
40
+ readonly description: "Optional declared bootstrap context supplied by the agent to ground the read-only synthesis output.";
41
+ readonly properties: {
42
+ readonly projectSummary: {
43
+ readonly type: "string";
44
+ readonly description: "Optional short summary of the project or bootstrap goal.";
45
+ };
46
+ readonly sourceOfTruthPaths: {
47
+ readonly type: "array";
48
+ readonly items: {
49
+ readonly type: "string";
50
+ };
51
+ readonly description: "Optional repo-relative paths that should be treated as declared sources of truth.";
52
+ };
53
+ readonly sourceOfTruthNotes: {
54
+ readonly type: "array";
55
+ readonly items: {
56
+ readonly type: "string";
57
+ };
58
+ readonly description: "Optional notes about how to interpret the declared sources of truth.";
59
+ };
60
+ readonly priorityRoots: {
61
+ readonly type: "array";
62
+ readonly items: {
63
+ readonly type: "string";
64
+ };
65
+ readonly description: "Optional repo roots the bootstrap flow should prioritize when authoring entities.";
66
+ };
67
+ readonly verificationAnchors: {
68
+ readonly type: "array";
69
+ readonly items: {
70
+ readonly type: "string";
71
+ };
72
+ readonly description: "Optional verification commands, documents, or checkpoints to reference in the output.";
73
+ };
74
+ };
75
+ };
76
+ };
77
+ };
78
+ readonly requiresProlog: false;
79
+ readonly effects: readonly ["workspace-read"];
80
+ readonly execute: typeof executeAutopilotGenerate;
81
+ };
82
+ //# sourceMappingURL=autopilot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autopilot.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/autopilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAOrF,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAErF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFjC,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { executeAutopilotGenerate } from "../../../operations/autopilot/generate.js";
2
+ export { executeAutopilotGenerate } from "../../../operations/autopilot/generate.js";
3
+ export const autopilotGenerateSpec = {
4
+ name: "kb_autopilot_generate",
5
+ cliName: "autopilot-generate",
6
+ description: "Generate agent-centric bootstrap output for KB population. Read-only analysis that returns activation state, bootstrap guidance, candidate entities with evidence, payoff summary, and exact applyPlan payloads for later kb_upsert calls. No mutation side effects.",
7
+ businessInputSchema: {
8
+ type: "object",
9
+ properties: {
10
+ includeGenericMarkdown: {
11
+ type: "boolean",
12
+ default: true,
13
+ description: "Whether to include generic markdown file content as candidate facts. Default: true.",
14
+ },
15
+ minConfidence: {
16
+ type: "number",
17
+ default: 0.8,
18
+ minimum: 0.6,
19
+ maximum: 0.95,
20
+ description: "Minimum confidence threshold for candidates. Clamped to [0.60, 0.95]. Default: 0.80.",
21
+ },
22
+ maxCandidates: {
23
+ type: "integer",
24
+ default: 50,
25
+ minimum: 1,
26
+ maximum: 200,
27
+ description: "Maximum number of candidates to return. Clamped to [1, 200]. Default: 50.",
28
+ },
29
+ entityTypes: {
30
+ type: "array",
31
+ items: {
32
+ type: "string",
33
+ enum: ["req", "scenario", "test", "adr", "fact", "symbol"],
34
+ },
35
+ description: "Optional filter to limit candidate generation to specific entity types.",
36
+ },
37
+ bootstrapContext: {
38
+ type: "object",
39
+ description: "Optional declared bootstrap context supplied by the agent to ground the read-only synthesis output.",
40
+ properties: {
41
+ projectSummary: {
42
+ type: "string",
43
+ description: "Optional short summary of the project or bootstrap goal.",
44
+ },
45
+ sourceOfTruthPaths: {
46
+ type: "array",
47
+ items: { type: "string" },
48
+ description: "Optional repo-relative paths that should be treated as declared sources of truth.",
49
+ },
50
+ sourceOfTruthNotes: {
51
+ type: "array",
52
+ items: { type: "string" },
53
+ description: "Optional notes about how to interpret the declared sources of truth.",
54
+ },
55
+ priorityRoots: {
56
+ type: "array",
57
+ items: { type: "string" },
58
+ description: "Optional repo roots the bootstrap flow should prioritize when authoring entities.",
59
+ },
60
+ verificationAnchors: {
61
+ type: "array",
62
+ items: { type: "string" },
63
+ description: "Optional verification commands, documents, or checkpoints to reference in the output.",
64
+ },
65
+ },
66
+ },
67
+ },
68
+ },
69
+ requiresProlog: false,
70
+ effects: ["workspace-read"],
71
+ execute: executeAutopilotGenerate,
72
+ };
@@ -0,0 +1,51 @@
1
+ import { executeCheck } from "../check-executor.js";
2
+ export declare const checkSpec: {
3
+ readonly name: "kb_check";
4
+ readonly cliName: "check";
5
+ readonly description: "Run KB validation rules and return violations. Use before or after mutations, and after meaningful source edits with impact options to surface symbol granularity and semantic-review diagnostics. Do not use for point lookups. No write side effects. Prefer explicit rules for faster iteration; omit rules for final full validation plus full-KB qualityDiagnostics review.";
6
+ readonly businessInputSchema: {
7
+ readonly type: "object";
8
+ readonly properties: {
9
+ readonly rules: {
10
+ readonly type: "array";
11
+ readonly items: {
12
+ readonly type: "string";
13
+ readonly enum: readonly ["must-priority-coverage", "symbol-coverage", "symbol-traceability", "no-dangling-refs", "no-cycles", "required-fields", "deprecated-adr-no-successor", "domain-contradictions", "strict-fact-shape", "strict-req-fact-pairing", "predicate-verifiability", "logic-coverage", "query-plan-safety"];
14
+ };
15
+ readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, logic-coverage, query-plan-safety. If omitted, server runs all rules plus the full-KB qualityDiagnostics audit scan; if supplied, server preserves scoped validation and skips the full-KB advisory scan.";
16
+ };
17
+ readonly sourceFiles: {
18
+ readonly type: "array";
19
+ readonly items: {
20
+ readonly type: "string";
21
+ };
22
+ readonly description: "Optional repo-relative source files to inspect for early impact diagnostics. Use with includeImpactDiagnostics after meaningful source edits.";
23
+ };
24
+ readonly staged: {
25
+ readonly type: "boolean";
26
+ readonly description: "When true, inspect staged source changes for impact diagnostics using the shared CLI impact analyzer without shelling out to kibi check.";
27
+ };
28
+ readonly includeWorkingTreeDiff: {
29
+ readonly type: "boolean";
30
+ readonly description: "When true, inspect current unstaged working-tree diffs for impact diagnostics. Pair with sourceFiles to scope the analysis.";
31
+ };
32
+ readonly includeImpactDiagnostics: {
33
+ readonly type: "boolean";
34
+ readonly description: "When true, include changed-file impact diagnostics such as symbol_granularity_violation and symbol_semantic_review_needed in structured output.";
35
+ };
36
+ readonly maxDiagnostics: {
37
+ readonly type: "integer";
38
+ readonly minimum: 0;
39
+ readonly description: "Optional maximum number of impact diagnostics to return. Graph validation violations are not capped by this value.";
40
+ };
41
+ readonly workspaceRoot: {
42
+ readonly type: "string";
43
+ readonly description: "Optional workspace root for impact diagnostics and .kb/config.json lookup. Defaults to the MCP server workspace.";
44
+ };
45
+ };
46
+ };
47
+ readonly requiresProlog: true;
48
+ readonly effects: readonly ["kb-read", "workspace-read"];
49
+ readonly execute: typeof executeCheck;
50
+ };
51
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEY,CAAC"}