kibi-mcp 0.16.0 → 0.17.2
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/dist/semantic-advisor/analyze-prose.js +1367 -0
- package/dist/semantic-advisor/prose-coverage-evaluator.js +66 -0
- package/dist/semantic-advisor/types.js +1 -0
- package/dist/server/kb-freshness.js +88 -0
- package/dist/server/session.js +65 -4
- package/dist/server/tools.js +16 -0
- package/dist/tools/check.js +2 -0
- package/dist/tools/model-requirement.js +10 -0
- package/dist/tools/semantic-advisor.js +42 -0
- package/dist/tools/sparql.js +96 -0
- package/dist/tools/suggest-predicates.js +1905 -9
- package/dist/tools/upsert.js +354 -85
- package/dist/tools/validate-upsert.js +43 -0
- package/dist/tools-config.js +109 -7
- package/package.json +7 -4
package/dist/tools-config.js
CHANGED
|
@@ -270,9 +270,67 @@ const BASE_TOOLS = [
|
|
|
270
270
|
},
|
|
271
271
|
},
|
|
272
272
|
},
|
|
273
|
+
{
|
|
274
|
+
name: "kb_sparql_remote",
|
|
275
|
+
description: "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.",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
type: "object",
|
|
278
|
+
required: ["endpoint", "query"],
|
|
279
|
+
properties: {
|
|
280
|
+
endpoint: {
|
|
281
|
+
type: "string",
|
|
282
|
+
description: "Remote SPARQL endpoint URL. Must start with http:// or https://.",
|
|
283
|
+
},
|
|
284
|
+
query: {
|
|
285
|
+
type: "string",
|
|
286
|
+
description: "SPARQL SELECT query to send to the remote endpoint.",
|
|
287
|
+
},
|
|
288
|
+
timeoutMs: {
|
|
289
|
+
type: "number",
|
|
290
|
+
description: "Optional positive timeout in milliseconds for the remote query.",
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: "kb_semantic_advisor",
|
|
297
|
+
description: "Analyze requirement prose without mutating the KB and return semantic advisor receipts with modeling suggestions. Use before constructing kb_upsert payloads when prose may contain machine-checkable logic. Suggestions can include strict-property facts, predicate facts, ambiguity observations, or ontology-gap observations; all suggestions are advisory and reviewable.",
|
|
298
|
+
inputSchema: {
|
|
299
|
+
type: "object",
|
|
300
|
+
required: ["text"],
|
|
301
|
+
properties: {
|
|
302
|
+
text: {
|
|
303
|
+
type: "string",
|
|
304
|
+
description: "Requirement prose to inspect for machine-checkable modeling suggestions.",
|
|
305
|
+
},
|
|
306
|
+
type: {
|
|
307
|
+
type: "string",
|
|
308
|
+
enum: ["req"],
|
|
309
|
+
default: "req",
|
|
310
|
+
description: "Entity type context for analysis. Currently requirement prose is supported.",
|
|
311
|
+
},
|
|
312
|
+
id: {
|
|
313
|
+
type: "string",
|
|
314
|
+
description: "Optional requirement ID used for deterministic draft relationship guidance.",
|
|
315
|
+
},
|
|
316
|
+
title: {
|
|
317
|
+
type: "string",
|
|
318
|
+
description: "Optional requirement title for draft apply plans.",
|
|
319
|
+
},
|
|
320
|
+
source: {
|
|
321
|
+
type: "string",
|
|
322
|
+
description: "Optional provenance for draft suggestions.",
|
|
323
|
+
},
|
|
324
|
+
status: {
|
|
325
|
+
type: "string",
|
|
326
|
+
description: "Optional requirement status for draft suggestions.",
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
},
|
|
273
331
|
{
|
|
274
332
|
name: "kb_upsert",
|
|
275
|
-
description: "Create or update one entity and optional relationships. Use for KB mutations after validating intent. 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. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates.",
|
|
333
|
+
description: "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.",
|
|
276
334
|
inputSchema: {
|
|
277
335
|
type: "object",
|
|
278
336
|
required: ["type", "id", "properties"],
|
|
@@ -351,6 +409,18 @@ const BASE_TOOLS = [
|
|
|
351
409
|
],
|
|
352
410
|
description: "Optional justification for a coarse file/module-level symbol traceability relationship when narrower function/class/type symbols exist.",
|
|
353
411
|
},
|
|
412
|
+
symbol_role: {
|
|
413
|
+
type: "string",
|
|
414
|
+
enum: [
|
|
415
|
+
"behavioral",
|
|
416
|
+
"structural",
|
|
417
|
+
"type-shape",
|
|
418
|
+
"config",
|
|
419
|
+
"module",
|
|
420
|
+
"unknown",
|
|
421
|
+
],
|
|
422
|
+
description: "Optional role classification for symbol entities. Example: 'behavioral'.",
|
|
423
|
+
},
|
|
354
424
|
fact_kind: {
|
|
355
425
|
type: "string",
|
|
356
426
|
enum: [
|
|
@@ -361,15 +431,15 @@ const BASE_TOOLS = [
|
|
|
361
431
|
"predicate_schema",
|
|
362
432
|
"predicate",
|
|
363
433
|
],
|
|
364
|
-
description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'.",
|
|
434
|
+
description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model_requirement or kb_suggest_predicates when starting from prose.",
|
|
365
435
|
},
|
|
366
436
|
subject_key: {
|
|
367
437
|
type: "string",
|
|
368
|
-
description: "Optional canonical subject key for strict fact entities. Example: 'user.session'.",
|
|
438
|
+
description: "Snake_case only. Optional canonical subject key for strict fact entities. Example: 'user.session'. Do not use subjectKey in kb_upsert.properties.",
|
|
369
439
|
},
|
|
370
440
|
property_key: {
|
|
371
441
|
type: "string",
|
|
372
|
-
description: "Optional canonical property key for property_value facts. Example: 'session.timeout_minutes'.",
|
|
442
|
+
description: "Snake_case only. Optional canonical property key for property_value facts. Example: 'session.timeout_minutes'. Do not use propertyKey in kb_upsert.properties.",
|
|
373
443
|
},
|
|
374
444
|
operator: {
|
|
375
445
|
type: "string",
|
|
@@ -379,7 +449,7 @@ const BASE_TOOLS = [
|
|
|
379
449
|
value_type: {
|
|
380
450
|
type: "string",
|
|
381
451
|
enum: ["string", "int", "number", "bool"],
|
|
382
|
-
description: "Optional typed value discriminator for property_value facts.",
|
|
452
|
+
description: "Optional typed value discriminator for property_value facts. Pair with exactly one value_string, value_int, value_number, or value_bool; do not use generic value.",
|
|
383
453
|
},
|
|
384
454
|
value_string: {
|
|
385
455
|
type: "string",
|
|
@@ -420,12 +490,12 @@ const BASE_TOOLS = [
|
|
|
420
490
|
},
|
|
421
491
|
predicate_name: {
|
|
422
492
|
type: "string",
|
|
423
|
-
description: "Optional predicate name for ontology predicate facts.",
|
|
493
|
+
description: "Optional predicate name for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_name.",
|
|
424
494
|
},
|
|
425
495
|
predicate_args: {
|
|
426
496
|
type: "array",
|
|
427
497
|
items: { type: "string" },
|
|
428
|
-
description: "Optional ordered predicate arguments for ontology predicate facts.",
|
|
498
|
+
description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_args.",
|
|
429
499
|
},
|
|
430
500
|
},
|
|
431
501
|
required: ["title", "status"],
|
|
@@ -473,6 +543,38 @@ const BASE_TOOLS = [
|
|
|
473
543
|
},
|
|
474
544
|
},
|
|
475
545
|
},
|
|
546
|
+
{
|
|
547
|
+
name: "kb_validate_upsert",
|
|
548
|
+
description: "Validate a kb_upsert payload without mutating the KB. Use this read-only preflight before kb_upsert, especially for requirements, because it returns schema/modeling errors plus semantic advisor receipts that identify prose likely needing kb_model_requirement, kb_suggest_predicates, ambiguity review, or an ontology-gap observation.",
|
|
549
|
+
inputSchema: {
|
|
550
|
+
type: "object",
|
|
551
|
+
required: ["type", "id", "properties"],
|
|
552
|
+
properties: {
|
|
553
|
+
type: {
|
|
554
|
+
type: "string",
|
|
555
|
+
enum: [
|
|
556
|
+
"req",
|
|
557
|
+
"scenario",
|
|
558
|
+
"test",
|
|
559
|
+
"adr",
|
|
560
|
+
"flag",
|
|
561
|
+
"event",
|
|
562
|
+
"symbol",
|
|
563
|
+
"fact",
|
|
564
|
+
],
|
|
565
|
+
},
|
|
566
|
+
id: { type: "string" },
|
|
567
|
+
properties: {
|
|
568
|
+
type: "object",
|
|
569
|
+
description: "Entity properties to validate using the same snake_case field names accepted by kb_upsert.",
|
|
570
|
+
},
|
|
571
|
+
relationships: {
|
|
572
|
+
type: "array",
|
|
573
|
+
items: { type: "object" },
|
|
574
|
+
},
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
},
|
|
476
578
|
{
|
|
477
579
|
name: "kb_delete",
|
|
478
580
|
description: "Delete entities by ID. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. Side effects: mutates and saves KB; skips entities with dependents.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
6
6
|
"ajv": "^8.18.0",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"fast-glob": "^3.2.12",
|
|
10
10
|
"gray-matter": "^4.0.3",
|
|
11
11
|
"js-yaml": "^4.1.0",
|
|
12
|
-
"kibi-cli": "^0.12.
|
|
13
|
-
"kibi-core": "^0.6.
|
|
12
|
+
"kibi-cli": "^0.12.7",
|
|
13
|
+
"kibi-core": "^0.6.2",
|
|
14
14
|
"mcpcat": "^0.1.12",
|
|
15
15
|
"ts-morph": "^23.0.0",
|
|
16
16
|
"zod": "^4.3.6"
|
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
"build": "tsc -p tsconfig.json",
|
|
28
28
|
"prepack": "npm run build"
|
|
29
29
|
},
|
|
30
|
-
"files": [
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"bin"
|
|
33
|
+
],
|
|
31
34
|
"engines": {
|
|
32
35
|
"node": ">=18",
|
|
33
36
|
"bun": ">=1.0"
|