kibi-mcp 0.19.0 → 0.20.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 (38) hide show
  1. package/bin/kibi-mcp +1 -1
  2. package/dist/diagnostics.js +8 -1
  3. package/dist/runtime/mcp-runtime.js +43 -0
  4. package/dist/server/docs.js +5 -4
  5. package/dist/server/json-schema-to-zod.js +73 -2
  6. package/dist/server/session.js +33 -15
  7. package/dist/server/tool-registration.js +35 -62
  8. package/dist/server/tools-runtime.js +52 -2
  9. package/dist/server/tools.js +19 -5
  10. package/dist/server/transport.js +9 -5
  11. package/dist/startup-resolution.js +26 -9
  12. package/dist/tools/autopilot-generate.js +37 -646
  13. package/dist/tools/autopilot-test-compat.js +88 -0
  14. package/dist/tools/autopilot-test-parsers.js +120 -0
  15. package/dist/tools/check.js +13 -106
  16. package/dist/tools/coverage.js +11 -25
  17. package/dist/tools/delete.js +5 -112
  18. package/dist/tools/discovery-adapter.js +23 -0
  19. package/dist/tools/entity-query.js +1 -111
  20. package/dist/tools/find-gaps.js +11 -26
  21. package/dist/tools/graph.js +11 -24
  22. package/dist/tools/model-requirement.js +8 -347
  23. package/dist/tools/mutation-context.js +28 -0
  24. package/dist/tools/query.js +5 -50
  25. package/dist/tools/relationship-validation.js +9 -116
  26. package/dist/tools/search.js +4 -37
  27. package/dist/tools/semantic-advisor.js +2 -40
  28. package/dist/tools/skills.js +17 -57
  29. package/dist/tools/sparql.js +12 -93
  30. package/dist/tools/status.js +9 -19
  31. package/dist/tools/suggest-predicates.js +11 -2448
  32. package/dist/tools/upsert.js +21 -816
  33. package/dist/tools/validate-upsert.js +12 -48
  34. package/dist/tools-config.js +75 -802
  35. package/package.json +4 -3
  36. package/dist/semantic-advisor/analyze-prose.js +0 -1392
  37. package/dist/semantic-advisor/prose-coverage-evaluator.js +0 -66
  38. package/dist/semantic-advisor/types.js +0 -1
@@ -44,6 +44,20 @@ function nearestPackageJson(startPath) {
44
44
  current = parent;
45
45
  }
46
46
  }
47
+ function nearestPackageJsonFromDirectory(startPath) {
48
+ let current = path.resolve(startPath);
49
+ while (true) {
50
+ const candidate = path.join(current, "package.json");
51
+ if (existsSync(candidate)) {
52
+ return candidate;
53
+ }
54
+ const parent = path.dirname(current);
55
+ if (parent === current) {
56
+ return null;
57
+ }
58
+ current = parent;
59
+ }
60
+ }
47
61
  function packageInfoFromEntrypoint(entrypoint) {
48
62
  const normalizedEntrypoint = path.resolve(entrypoint);
49
63
  const packageJsonPath = nearestPackageJson(normalizedEntrypoint);
@@ -62,7 +76,11 @@ export function readRunningPackageInfo(entrypointUrl) {
62
76
  }
63
77
  export function resolveProjectLocalMcp(cwd) {
64
78
  try {
65
- const projectRequire = createRequire(path.join(path.resolve(cwd), "package.json"));
79
+ const projectPackageJson = nearestPackageJsonFromDirectory(cwd);
80
+ if (!projectPackageJson) {
81
+ return null;
82
+ }
83
+ const projectRequire = createRequire(projectPackageJson);
66
84
  const resolved = projectRequire.resolve(PACKAGE_NAME);
67
85
  const entrypoint = realpathSync.native?.(resolved) ?? realpathSync(resolved);
68
86
  return packageInfoFromEntrypoint(entrypoint);
@@ -76,6 +94,7 @@ export function resolveProjectLocalMcp(cwd) {
76
94
  }
77
95
  }
78
96
  export function compareMcpResolution(running, projectLocal) {
97
+ // implements REQ-cursor-agent-plugin-standard-v1
79
98
  const diagnosticText = JSON.stringify({ running, projectLocal });
80
99
  const forbiddenVersionObserved = diagnosticText.includes(FORBIDDEN_VERSION);
81
100
  if (!projectLocal) {
@@ -92,16 +111,14 @@ export function compareMcpResolution(running, projectLocal) {
92
111
  forbiddenVersionObserved,
93
112
  };
94
113
  }
95
- if (path.resolve(running.packageRoot) !== path.resolve(projectLocal.packageRoot)) {
96
- return {
97
- stale: true,
98
- reason: `package root mismatch: running ${running.packageRoot}, project-local ${projectLocal.packageRoot}`,
99
- forbiddenVersionObserved,
100
- };
101
- }
114
+ // Same version: the running build is the version the project pins. Re-entering
115
+ // a same-version copy (e.g. a bun-store published install) abandons the local
116
+ // dev build for an identical-version store copy, which defeats local
117
+ // dogfooding and can silently drop unreleased local fixes. Only re-enter on a
118
+ // genuine version mismatch.
102
119
  return {
103
120
  stale: false,
104
- reason: "running kibi-mcp matches project-local kibi-mcp",
121
+ reason: "running kibi-mcp matches the project-local version",
105
122
  forbiddenVersionObserved,
106
123
  };
107
124
  }