kibi-mcp 0.14.1 → 0.14.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.
@@ -33,6 +33,7 @@ function renderToolsDoc() {
33
33
  const required = Array.isArray(tool.inputSchema?.required)
34
34
  ? tool.inputSchema.required.join(", ")
35
35
  : "none";
36
+ lines.push(`| \`${tool.name}\` | ${tool.description} | ${required || "none"} |`);
36
37
  }
37
38
  lines.push("");
38
39
  lines.push("Modeling note: Kibi has eight core entity types grouped into common authoring (req, scenario, test, fact) and supporting/system (adr, flag, event, symbol).");
@@ -10,6 +10,7 @@ import { handleKbGraph } from "../tools/graph.js";
10
10
  import { handleKbQuery } from "../tools/query.js";
11
11
  import { handleKbSearch } from "../tools/search.js";
12
12
  import { handleKbStatus } from "../tools/status.js";
13
+ import { handleKbSkillsList, handleKbSkillsLoad, handleKbSkillsRead, } from "../tools/skills.js";
13
14
  import { handleKbUpsert } from "../tools/upsert.js";
14
15
  import { handleKbModelRequirement, } from "../tools/model-requirement.js";
15
16
  import { handleKbAutopilotGenerate, } from "../tools/autopilot-generate.js";
@@ -59,6 +60,9 @@ const DEFAULT_TOOLS_RUNTIME = {
59
60
  handleKbQuery,
60
61
  handleKbSearch,
61
62
  handleKbStatus,
63
+ handleKbSkillsList,
64
+ handleKbSkillsLoad,
65
+ handleKbSkillsRead,
62
66
  handleKbUpsert,
63
67
  handleKbModelRequirement,
64
68
  handleKbAutopilotGenerate,
@@ -299,6 +303,9 @@ runtime = DEFAULT_TOOLS_RUNTIME) {
299
303
  const prolog = await runtime.ensureProlog();
300
304
  return runtime.handleKbStatus(prolog, args);
301
305
  }, runtime);
306
+ addTool(server, "kb_skills_list", toolDef("kb_skills_list").description, toolDef("kb_skills_list").inputSchema, async (args) => runtime.handleKbSkillsList(args), runtime);
307
+ addTool(server, "kb_skills_load", toolDef("kb_skills_load").description, toolDef("kb_skills_load").inputSchema, async (args) => runtime.handleKbSkillsLoad(args), runtime);
308
+ addTool(server, "kb_skills_read", toolDef("kb_skills_read").description, toolDef("kb_skills_read").inputSchema, async (args) => runtime.handleKbSkillsRead(args), runtime);
302
309
  addTool(server, "kb_find_gaps", toolDef("kb_find_gaps").description, toolDef("kb_find_gaps").inputSchema, async (args) => {
303
310
  const prolog = await runtime.ensureProlog();
304
311
  return runtime.handleKbFindGaps(prolog, args);
@@ -0,0 +1,71 @@
1
+ import { createHash } from "node:crypto";
2
+ import { listBundledSkills, loadBundledSkill, readBundledSkillResource, } from "kibi-cli/skills";
3
+ // implements REQ-001
4
+ export async function handleKbSkillsList(_args) {
5
+ try {
6
+ const skills = listBundledSkills();
7
+ const ids = skills.map((skill) => skill.id).join(", ") || "none";
8
+ return {
9
+ content: [{ type: "text", text: `Found ${skills.length} bundled skills: ${ids}` }],
10
+ structuredContent: { skills },
11
+ };
12
+ }
13
+ catch (error) {
14
+ const message = error instanceof Error ? error.message : String(error);
15
+ throw new Error(`Skills list failed: ${message}`);
16
+ }
17
+ }
18
+ // implements REQ-001
19
+ export async function handleKbSkillsLoad(args) {
20
+ try {
21
+ assertNonEmptyString(args.id, "id");
22
+ const bundle = loadBundledSkill(args.id);
23
+ const resources = bundle.manifest.resources ?? [];
24
+ const payload = {
25
+ metadata: bundle.manifest,
26
+ body: bundle.body,
27
+ resources,
28
+ contentHash: createHash("sha256").update(bundle.body, "utf8").digest("hex"),
29
+ sourceType: "bundled",
30
+ };
31
+ return {
32
+ content: [
33
+ {
34
+ type: "text",
35
+ text: `Loaded bundled skill ${bundle.manifest.id} with ${resources.length} resources`,
36
+ },
37
+ ],
38
+ structuredContent: payload,
39
+ };
40
+ }
41
+ catch (error) {
42
+ const message = error instanceof Error ? error.message : String(error);
43
+ throw new Error(`Skills load failed: ${message}`);
44
+ }
45
+ }
46
+ // implements REQ-001
47
+ export async function handleKbSkillsRead(args) {
48
+ try {
49
+ assertNonEmptyString(args.id, "id");
50
+ assertNonEmptyString(args.resource, "resource");
51
+ const resourceContent = readBundledSkillResource(args.id, args.resource);
52
+ return {
53
+ content: [
54
+ {
55
+ type: "text",
56
+ text: `Read bundled skill resource ${args.id}/${args.resource}`,
57
+ },
58
+ ],
59
+ structuredContent: { content: resourceContent },
60
+ };
61
+ }
62
+ catch (error) {
63
+ const message = error instanceof Error ? error.message : String(error);
64
+ throw new Error(`Skills read failed: ${message}`);
65
+ }
66
+ }
67
+ function assertNonEmptyString(value, field) {
68
+ if (typeof value !== "string" || value.trim() === "") {
69
+ throw new Error(`${field} must be a non-empty string`);
70
+ }
71
+ }
@@ -110,6 +110,46 @@ const BASE_TOOLS = [
110
110
  properties: {},
111
111
  },
112
112
  },
113
+ {
114
+ name: "kb_skills_list",
115
+ description: "List bundled Kibi agent skills available for progressive disclosure. Read-only; does not mutate the KB or require Prolog.",
116
+ inputSchema: {
117
+ type: "object",
118
+ properties: {},
119
+ },
120
+ },
121
+ {
122
+ name: "kb_skills_load",
123
+ description: "Load a bundled Kibi agent skill by ID, returning its manifest metadata, Markdown body, declared resources, content hash, and source type. Read-only; does not execute scripts or require Prolog.",
124
+ inputSchema: {
125
+ type: "object",
126
+ required: ["id"],
127
+ properties: {
128
+ id: {
129
+ type: "string",
130
+ description: "Bundled skill ID to load. Example: 'kibi-usage'.",
131
+ },
132
+ },
133
+ },
134
+ },
135
+ {
136
+ name: "kb_skills_read",
137
+ description: "Read a declared resource from a bundled Kibi agent skill. Resource paths are restricted to the skill manifest; arbitrary file paths are not exposed. Read-only; does not require Prolog.",
138
+ inputSchema: {
139
+ type: "object",
140
+ required: ["id", "resource"],
141
+ properties: {
142
+ id: {
143
+ type: "string",
144
+ description: "Bundled skill ID. Example: 'kibi-usage'.",
145
+ },
146
+ resource: {
147
+ type: "string",
148
+ description: "Manifest-declared resource path to read. Example: 'resources/workflows.md'.",
149
+ },
150
+ },
151
+ },
152
+ },
113
153
  {
114
154
  name: "kb_find_gaps",
115
155
  description: "Run bulk missing/present relationship analysis over KB entities. Use for questions like which requirements lack scenarios or tests. No mutation side effects.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-mcp",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
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.11.0",
12
+ "kibi-cli": "^0.11.1",
13
13
  "kibi-core": "^0.5.3",
14
14
  "mcpcat": "^0.1.12",
15
15
  "ts-morph": "^23.0.0",