@wrongstack/kanban-mcp 1.0.7 → 1.0.9

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/adapter.d.ts CHANGED
@@ -22,6 +22,14 @@ export interface KanbanMcpToolHostOptions extends KanbanMcpPolicyOptions {
22
22
  sessionId?: string | undefined;
23
23
  dependencies?: KanbanMcpDependencies | undefined;
24
24
  }
25
+ /**
26
+ * The kanban tool throws `KanbanToolError` / `KanbanInputError` carrying a
27
+ * stable `kanbanCode`, `retryable` and (for lifecycle refusals) structured
28
+ * `issues`. Keep that structure in the MCP content so an external client can
29
+ * branch on the code instead of parsing prose. Duck-typed so this package does
30
+ * not depend on the tool's error classes. Anything else stays a plain message.
31
+ */
32
+ export declare function mcpErrorContent(error: unknown): unknown;
25
33
  export declare function createKanbanMcpToolHost(projectRoot: string, opts?: KanbanMcpToolHostOptions): MCPServerToolHost;
26
34
  export declare function createKanbanMcpServer(projectRoot: string, opts?: KanbanMcpToolHostOptions): MCPServer;
27
35
  export {};
package/dist/cli.js CHANGED
@@ -183,6 +183,21 @@ function createContext(projectRoot, actor, sessionId) {
183
183
  eventSessionId: () => sessionId
184
184
  };
185
185
  }
186
+ function mcpErrorContent(error) {
187
+ if (!(error instanceof Error)) return String(error);
188
+ const kanbanCode = error.kanbanCode;
189
+ if (typeof kanbanCode !== "string") return error.message;
190
+ const issues = error.issues;
191
+ return {
192
+ ok: false,
193
+ error: {
194
+ code: kanbanCode,
195
+ message: error.message,
196
+ retryable: error.retryable === true,
197
+ ...Array.isArray(issues) && issues.length > 0 ? { issues } : {}
198
+ }
199
+ };
200
+ }
186
201
  function normalizeTimeout(value) {
187
202
  if (typeof value !== "number" || !Number.isFinite(value)) return WATCH_DEFAULT_TIMEOUT_MS;
188
203
  return Math.min(WATCH_MAX_TIMEOUT_MS, Math.max(100, Math.trunc(value)));
@@ -270,10 +285,7 @@ function createKanbanMcpToolHost(projectRoot, opts = {}) {
270
285
  const failed = !!result && typeof result === "object" && !Array.isArray(result) && result["ok"] === false;
271
286
  return { content: result, isError: failed };
272
287
  } catch (error) {
273
- return {
274
- content: error instanceof Error ? error.message : String(error),
275
- isError: true
276
- };
288
+ return { content: mcpErrorContent(error), isError: true };
277
289
  }
278
290
  }
279
291
  };
package/dist/index.js CHANGED
@@ -173,6 +173,21 @@ function createContext(projectRoot, actor, sessionId) {
173
173
  eventSessionId: () => sessionId
174
174
  };
175
175
  }
176
+ function mcpErrorContent(error) {
177
+ if (!(error instanceof Error)) return String(error);
178
+ const kanbanCode = error.kanbanCode;
179
+ if (typeof kanbanCode !== "string") return error.message;
180
+ const issues = error.issues;
181
+ return {
182
+ ok: false,
183
+ error: {
184
+ code: kanbanCode,
185
+ message: error.message,
186
+ retryable: error.retryable === true,
187
+ ...Array.isArray(issues) && issues.length > 0 ? { issues } : {}
188
+ }
189
+ };
190
+ }
176
191
  function normalizeTimeout(value) {
177
192
  if (typeof value !== "number" || !Number.isFinite(value)) return WATCH_DEFAULT_TIMEOUT_MS;
178
193
  return Math.min(WATCH_MAX_TIMEOUT_MS, Math.max(100, Math.trunc(value)));
@@ -260,10 +275,7 @@ function createKanbanMcpToolHost(projectRoot, opts = {}) {
260
275
  const failed = !!result && typeof result === "object" && !Array.isArray(result) && result["ok"] === false;
261
276
  return { content: result, isError: failed };
262
277
  } catch (error) {
263
- return {
264
- content: error instanceof Error ? error.message : String(error),
265
- isError: true
266
- };
278
+ return { content: mcpErrorContent(error), isError: true };
267
279
  }
268
280
  }
269
281
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/kanban-mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack Kanban as a project-scoped MCP server with read-only, writable, destructive, and live-watch capability tiers.",
6
6
  "repository": {
@@ -32,16 +32,16 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "@wrongstack/core": "1.0.7",
36
- "@wrongstack/kanban": "1.0.7",
37
- "@wrongstack/primitives": "1.0.7",
38
- "@wrongstack/mcp": "1.0.7",
39
- "@wrongstack/tools": "1.0.7"
35
+ "@wrongstack/core": "1.0.9",
36
+ "@wrongstack/kanban": "1.0.9",
37
+ "@wrongstack/mcp": "1.0.9",
38
+ "@wrongstack/primitives": "1.0.9",
39
+ "@wrongstack/tools": "1.0.9"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/node": "^26.2.0",
42
+ "@types/node": "^26.5.1",
43
43
  "typescript": "^7.0.2",
44
- "vitest": "^4.1.11"
44
+ "vitest": "^5.0.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"