kibi-mcp 1.0.0 → 2.1.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.
- package/dist/diagnostics.js +8 -8
- package/dist/env.js +21 -30
- package/dist/runtime/mcp-runtime.js +25 -3
- package/dist/server/jobs.js +107 -0
- package/dist/server/json-schema-to-zod.js +31 -10
- package/dist/server/session.js +104 -82
- package/dist/server/tool-registration.js +22 -9
- package/dist/server/tools-runtime.js +28 -21
- package/dist/server/tools.js +128 -28
- package/dist/startup-resolution.js +15 -17
- package/dist/tools/check-impact.js +1 -1
- package/dist/tools/core-module.js +8 -5
- package/dist/tools/discovery-adapter.js +30 -7
- package/dist/tools/model-requirement.js +3 -3
- package/dist/tools/semantic-advisor.js +2 -2
- package/dist/tools/suggest-predicates.js +10 -9
- package/dist/tools-config.js +3 -3
- package/dist/workspace.js +10 -35
- package/package.json +6 -9
package/dist/workspace.js
CHANGED
|
@@ -13,32 +13,17 @@
|
|
|
13
13
|
GNU Affero General Public License for more details.
|
|
14
14
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
along with this program.
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import fs from "node:fs";
|
|
19
18
|
import path from "node:path";
|
|
20
|
-
import { branchStorePath } from "kibi-runtime";
|
|
21
|
-
const WORKSPACE_ENV_KEYS = [
|
|
22
|
-
"KIBI_WORKSPACE",
|
|
23
|
-
"KIBI_PROJECT_ROOT",
|
|
24
|
-
"KIBI_ROOT",
|
|
25
|
-
];
|
|
19
|
+
import { branchStorePath, resolveKibiWorkspaceRoot } from "kibi-runtime";
|
|
26
20
|
const KB_PATH_ENV_KEYS = ["KIBI_KB_PATH", "KB_PATH"];
|
|
27
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Canonical workspace root — delegates to shared resolveKibiWorkspaceRoot.
|
|
23
|
+
*/
|
|
24
|
+
// implements REQ-002, REQ-012, REQ-kibi-env-bootstrap
|
|
28
25
|
export function resolveWorkspaceRoot(startDir = process.cwd()) {
|
|
29
|
-
|
|
30
|
-
if (envRoot) {
|
|
31
|
-
return path.resolve(envRoot);
|
|
32
|
-
}
|
|
33
|
-
const kbRoot = findUpwards(startDir, ".kb");
|
|
34
|
-
if (kbRoot) {
|
|
35
|
-
return kbRoot;
|
|
36
|
-
}
|
|
37
|
-
const gitRoot = findUpwards(startDir, ".git");
|
|
38
|
-
if (gitRoot) {
|
|
39
|
-
return gitRoot;
|
|
40
|
-
}
|
|
41
|
-
return path.resolve(startDir);
|
|
26
|
+
return resolveKibiWorkspaceRoot(startDir);
|
|
42
27
|
}
|
|
43
28
|
// implements REQ-002, REQ-012
|
|
44
29
|
export function resolveKbPath(workspaceRoot, branch) {
|
|
@@ -68,19 +53,9 @@ function readFirstEnv(keys) {
|
|
|
68
53
|
}
|
|
69
54
|
return null;
|
|
70
55
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const candidate = path.join(current, marker);
|
|
75
|
-
if (fs.existsSync(candidate)) {
|
|
76
|
-
return current;
|
|
77
|
-
}
|
|
78
|
-
const parent = path.dirname(current);
|
|
79
|
-
if (parent === current) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
current = parent;
|
|
83
|
-
}
|
|
56
|
+
export function nextAncestorDirectory(current) {
|
|
57
|
+
const parent = path.dirname(current);
|
|
58
|
+
return parent === current ? undefined : parent;
|
|
84
59
|
}
|
|
85
60
|
function isBranchPath(p) {
|
|
86
61
|
const parent = path.basename(path.dirname(p));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-mcp",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
6
6
|
"ajv": "^8.18.0",
|
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
"fast-glob": "^3.2.12",
|
|
10
10
|
"gray-matter": "^4.0.3",
|
|
11
11
|
"js-yaml": "^4.1.0",
|
|
12
|
-
"kibi-runtime": "^
|
|
13
|
-
"kibi-core": "^0.
|
|
12
|
+
"kibi-runtime": "^2.0.1",
|
|
13
|
+
"kibi-core": "^0.13.0",
|
|
14
14
|
"mcpcat": "^0.1.12",
|
|
15
|
-
"ts-morph": "^23.0.0",
|
|
16
15
|
"zod": "^4.3.6"
|
|
17
16
|
},
|
|
18
17
|
"type": "module",
|
|
@@ -24,14 +23,12 @@
|
|
|
24
23
|
"scripts": {
|
|
25
24
|
"test": "bun test",
|
|
26
25
|
"dev": "bun run bin/kibi-mcp",
|
|
27
|
-
"
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"build": "npm run clean && tsc -p tsconfig.json",
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
29
29
|
"prepack": "npm run build && node ../../scripts/verify-package-contract.mjs kibi-mcp"
|
|
30
30
|
},
|
|
31
|
-
"files": [
|
|
32
|
-
"dist",
|
|
33
|
-
"bin"
|
|
34
|
-
],
|
|
31
|
+
"files": ["dist", "bin"],
|
|
35
32
|
"engines": {
|
|
36
33
|
"node": ">=22"
|
|
37
34
|
},
|