kibi-mcp 0.19.0 → 0.19.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/bin/kibi-mcp +1 -1
- package/dist/runtime/mcp-runtime.js +43 -0
- package/dist/server/docs.js +4 -4
- package/dist/server/json-schema-to-zod.js +73 -2
- package/dist/server/session.js +33 -15
- package/dist/server/tool-registration.js +35 -62
- package/dist/server/tools-runtime.js +52 -2
- package/dist/server/tools.js +19 -5
- package/dist/server/transport.js +9 -5
- package/dist/tools/autopilot-generate.js +37 -646
- package/dist/tools/autopilot-test-compat.js +88 -0
- package/dist/tools/autopilot-test-parsers.js +120 -0
- package/dist/tools/check.js +13 -106
- package/dist/tools/coverage.js +11 -25
- package/dist/tools/delete.js +5 -112
- package/dist/tools/discovery-adapter.js +23 -0
- package/dist/tools/entity-query.js +1 -111
- package/dist/tools/find-gaps.js +11 -26
- package/dist/tools/graph.js +11 -24
- package/dist/tools/model-requirement.js +8 -347
- package/dist/tools/mutation-context.js +28 -0
- package/dist/tools/query.js +5 -50
- package/dist/tools/relationship-validation.js +9 -116
- package/dist/tools/search.js +4 -37
- package/dist/tools/semantic-advisor.js +2 -40
- package/dist/tools/skills.js +17 -57
- package/dist/tools/sparql.js +12 -93
- package/dist/tools/status.js +5 -19
- package/dist/tools/suggest-predicates.js +11 -2448
- package/dist/tools/upsert.js +21 -816
- package/dist/tools/validate-upsert.js +12 -48
- package/dist/tools-config.js +75 -802
- package/package.json +4 -3
- package/dist/semantic-advisor/analyze-prose.js +0 -1392
- package/dist/semantic-advisor/prose-coverage-evaluator.js +0 -66
- package/dist/semantic-advisor/types.js +0 -1
|
@@ -1,55 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { validateKbUpsertArgs } from "./upsert.js";
|
|
1
|
+
import { validateUpsertSpec } from "kibi-cli/operations";
|
|
2
|
+
import { createMutationContext } from "./mutation-context.js";
|
|
4
3
|
function isUpsertArgs(value) {
|
|
5
4
|
return "type" in value && "id" in value && "properties" in value;
|
|
6
5
|
}
|
|
7
6
|
export async function handleKbValidateUpsert(prologOrArgs, maybeArgs) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
throw new Error("kb_validate_upsert requires an upsert payload");
|
|
12
|
-
}
|
|
13
|
-
const prolog = maybeArgs === undefined ? null : prologOrArgs;
|
|
14
|
-
const { entity } = validateKbUpsertArgs(args);
|
|
15
|
-
if (prolog !== null && !isUpsertArgs(prolog)) {
|
|
16
|
-
await validateLiveRelationshipTargets(prolog, entity, args.relationships ?? []);
|
|
17
|
-
}
|
|
18
|
-
const semanticAdvisor = analyzeSemanticAdvisorInput({
|
|
19
|
-
payload: { ...args },
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
content: [
|
|
23
|
-
{
|
|
24
|
-
type: "text",
|
|
25
|
-
text: "kb_validate_upsert: payload is valid for kb_upsert preflight checks. No mutation was performed.",
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
structuredContent: {
|
|
29
|
-
valid: true,
|
|
30
|
-
errors: [],
|
|
31
|
-
warnings: semanticAdvisor.warnings,
|
|
32
|
-
semanticAdvisor: semanticAdvisor.receipt,
|
|
33
|
-
normalizedPreview: entity,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
7
|
+
const args = maybeArgs ?? (isUpsertArgs(prologOrArgs) ? prologOrArgs : null);
|
|
8
|
+
if (args === null) {
|
|
9
|
+
throw new Error("kb_validate_upsert requires an upsert payload");
|
|
36
10
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
text: `kb_validate_upsert: payload is invalid. ${message}`,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
structuredContent: {
|
|
47
|
-
valid: false,
|
|
48
|
-
errors: [message],
|
|
49
|
-
warnings: [],
|
|
50
|
-
semanticAdvisor: null,
|
|
51
|
-
normalizedPreview: null,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
11
|
+
const prolog = maybeArgs === undefined || isUpsertArgs(prologOrArgs)
|
|
12
|
+
? undefined
|
|
13
|
+
: prologOrArgs;
|
|
14
|
+
const result = await validateUpsertSpec.execute(args, createMutationContext(prolog));
|
|
15
|
+
if (result.structuredContent === undefined) {
|
|
16
|
+
throw new Error("kb_validate_upsert returned no structured content");
|
|
54
17
|
}
|
|
18
|
+
return { ...result, structuredContent: result.structuredContent };
|
|
55
19
|
}
|