kibi-mcp 0.11.0 → 0.12.0
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.
|
@@ -6,6 +6,7 @@ import { runJsonModuleQuery, toPrologList } from "./core-module.js";
|
|
|
6
6
|
import { loadEntities } from "./entity-query.js";
|
|
7
7
|
import { handleKbStatus } from "./status.js";
|
|
8
8
|
import { resolveWorkspaceRoot } from "../workspace.js";
|
|
9
|
+
import { isOperationalArtifactPath } from "kibi-cli/operational-artifacts";
|
|
9
10
|
const ALLOWED_TYPES = [
|
|
10
11
|
"req",
|
|
11
12
|
"adr",
|
|
@@ -122,7 +123,7 @@ function normalizeSourceFiles(workspaceRoot, sourceFiles) {
|
|
|
122
123
|
.join("/")
|
|
123
124
|
.replace(/^\.\//, "")
|
|
124
125
|
.replace(/^\//, "");
|
|
125
|
-
if (!normalizedPath || seen.has(normalizedPath))
|
|
126
|
+
if (!normalizedPath || seen.has(normalizedPath) || isOperationalArtifactPath(normalizedPath))
|
|
126
127
|
continue;
|
|
127
128
|
seen.add(normalizedPath);
|
|
128
129
|
normalized.push(normalizedPath);
|
|
@@ -144,13 +145,16 @@ function normalizeEntity(entity) {
|
|
|
144
145
|
const type = stripOuterSingleQuotes(String(entity.type ?? "").trim());
|
|
145
146
|
if (!isAllowedType(type))
|
|
146
147
|
return null;
|
|
148
|
+
const source = entity.source ? String(entity.source).trim().split(path.sep).join("/") : undefined;
|
|
149
|
+
if (source && isOperationalArtifactPath(source))
|
|
150
|
+
return null;
|
|
147
151
|
return {
|
|
148
152
|
...entity,
|
|
149
153
|
id: String(entity.id ?? "").trim(),
|
|
150
154
|
type,
|
|
151
155
|
title: String(entity.title ?? "").trim(),
|
|
152
156
|
status: String(entity.status ?? "").trim(),
|
|
153
|
-
source
|
|
157
|
+
source,
|
|
154
158
|
textRef: entity.textRef
|
|
155
159
|
? String(entity.textRef).trim()
|
|
156
160
|
: entity.text_ref
|
|
@@ -347,7 +351,15 @@ function buildPromptBlock(entities) {
|
|
|
347
351
|
return promptBlock;
|
|
348
352
|
}
|
|
349
353
|
function buildCitations(entities) {
|
|
350
|
-
return entities
|
|
354
|
+
return entities
|
|
355
|
+
.filter((entity) => {
|
|
356
|
+
if (entity.source && isOperationalArtifactPath(entity.source))
|
|
357
|
+
return false;
|
|
358
|
+
if (entity.textRef && isOperationalArtifactPath(entity.textRef))
|
|
359
|
+
return false;
|
|
360
|
+
return true;
|
|
361
|
+
})
|
|
362
|
+
.map((entity) => ({
|
|
351
363
|
id: entity.id,
|
|
352
364
|
type: entity.type,
|
|
353
365
|
title: entity.title,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
6
6
|
"ajv": "^8.18.0",
|
|
@@ -9,7 +9,7 @@
|
|
|
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
|
+
"kibi-cli": "^0.8.0",
|
|
13
13
|
"kibi-core": "^0.5.2",
|
|
14
14
|
"mcpcat": "^0.1.12",
|
|
15
15
|
"ts-morph": "^23.0.0",
|