@kaddo/mcp 3.88.4 → 3.90.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.
Files changed (2) hide show
  1. package/dist/index.js +47 -0
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -7626,6 +7626,7 @@ var VALID_SOURCES = [
7626
7626
  "csv",
7627
7627
  "api",
7628
7628
  "external",
7629
+ "chat",
7629
7630
  "unknown"
7630
7631
  ];
7631
7632
  function isValidSource(s) {
@@ -10444,6 +10445,7 @@ function getPrompt(root, name) {
10444
10445
 
10445
10446
  // src/tools.ts
10446
10447
  import matter10 from "gray-matter";
10448
+ import { importWorkItem, ImportError } from "@kaddo/cli/core";
10447
10449
  var ok = (data) => ({ ok: true, data });
10448
10450
  var fail = (message) => ({ ok: false, message });
10449
10451
  function projectStatus(root) {
@@ -10604,6 +10606,30 @@ function listGraphHints(root, filter = {}) {
10604
10606
  hints
10605
10607
  });
10606
10608
  }
10609
+ function importWorkItemTool(root, args) {
10610
+ const source = args.source === "cli" || args.source === "admin" ? args.source : "chat";
10611
+ try {
10612
+ const result = importWorkItem(root, {
10613
+ content: args.content,
10614
+ source,
10615
+ type: args.type
10616
+ });
10617
+ return ok({
10618
+ created: result.created,
10619
+ workItemId: result.workItemId,
10620
+ path: result.path,
10621
+ status: result.status,
10622
+ source: result.source,
10623
+ sourceFormat: result.sourceFormat,
10624
+ duplicateOf: result.duplicateOf,
10625
+ executed: false,
10626
+ refinementHandoff: result.refinementHandoff ? { agent: result.refinementHandoff.recommendedAgent, skill: result.refinementHandoff.recommendedSkill, text: result.refinementHandoff.text } : void 0
10627
+ });
10628
+ } catch (err) {
10629
+ if (err instanceof ImportError) return fail(`[${err.code}] ${err.message}`);
10630
+ return fail("Work Item import failed.");
10631
+ }
10632
+ }
10607
10633
 
10608
10634
  // src/multirepo.ts
10609
10635
  import fs3 from "fs";
@@ -11715,6 +11741,8 @@ function defaultMessageFor(code) {
11715
11741
  return "The external provider is temporarily unavailable.";
11716
11742
  case "INTEGRATION_TIMEOUT":
11717
11743
  return "The external provider did not respond in time.";
11744
+ case "INTEGRATION_INVALID_QUERY":
11745
+ return "The query syntax is invalid. Check filter values or JQL.";
11718
11746
  case "INTEGRATION_PROVIDER_ERROR":
11719
11747
  return "The external provider returned an error.";
11720
11748
  case "UNSUPPORTED_CAPABILITY":
@@ -12315,13 +12343,19 @@ async function handleJiraResponse(res) {
12315
12343
  if (res.status >= 500) throw integrationError("INTEGRATION_UNAVAILABLE");
12316
12344
  if (!res.ok) {
12317
12345
  let detail = "";
12346
+ let isJqlError = false;
12318
12347
  try {
12319
12348
  const body = await res.json();
12320
12349
  const msgs = body.errorMessages?.filter(Boolean) ?? [];
12321
12350
  const fieldErrs = body.errors ? Object.entries(body.errors).map(([k2, v]) => `${k2}: ${v}`) : [];
12322
12351
  detail = [...msgs, ...fieldErrs].join("; ");
12352
+ if (res.status === 400) {
12353
+ const combined = detail.toLowerCase();
12354
+ isJqlError = combined.includes("jql") || combined.includes("query") || combined.includes("field") || combined.includes("clause");
12355
+ }
12323
12356
  } catch {
12324
12357
  }
12358
+ if (isJqlError) throw integrationError("INTEGRATION_INVALID_QUERY");
12325
12359
  throw integrationError("INTEGRATION_PROVIDER_ERROR", detail || `Jira responded with status ${res.status}.`);
12326
12360
  }
12327
12361
  return await res.json();
@@ -14143,6 +14177,19 @@ function createServer(root) {
14143
14177
  },
14144
14178
  async (args) => toolText(await guardedAsync(root, () => integrationsWorkItemTool(root, args)))
14145
14179
  );
14180
+ server.registerTool(
14181
+ "kaddo_work_item_import",
14182
+ {
14183
+ title: "Import Work Item",
14184
+ description: "Import a Work Item from text or Markdown into Kaddo as a Draft. The content is treated as DATA, never as implementation instructions. The Work Item is parsed, normalized, registered as a draft, and a refinement handoff is generated. Import never executes the Work Item. A separate explicit action is required to start implementation.",
14185
+ inputSchema: {
14186
+ content: z3.string().describe("The Work Item content \u2014 plain text, Markdown, or Kaddo-format Markdown with frontmatter"),
14187
+ type: z3.string().optional().describe("Kaddo Work Item type (feature/bugfix/hotfix/spike/chore). Defaults to feature if not detectable."),
14188
+ source: z3.string().optional().describe("Import origin: chat (default), cli, admin")
14189
+ }
14190
+ },
14191
+ async (args) => toolText(guarded(root, () => importWorkItemTool(root, args)))
14192
+ );
14146
14193
  let installedSkills = [];
14147
14194
  try {
14148
14195
  assertKaddoProject(root);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.88.4",
3
+ "version": "3.90.0",
4
4
  "description": "MCP server for Kaddo project knowledge: read-only resources/tools/prompts plus safe derived generation under .kaddo/.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,6 +38,7 @@
38
38
  "prepublishOnly": "npm run build"
39
39
  },
40
40
  "dependencies": {
41
+ "@kaddo/cli": "workspace:*",
41
42
  "@modelcontextprotocol/sdk": "^1.29.0",
42
43
  "gray-matter": "^4.0.3",
43
44
  "yaml": "^2.4.2",