planko-mcp-server 0.4.1 → 0.4.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.
package/index.js CHANGED
@@ -20,7 +20,7 @@ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
20
20
  import { join } from 'node:path';
21
21
 
22
22
  import { createApiClient } from './src/api.js';
23
- import { isBlankValue } from './src/sanitize.js';
23
+ import { isBlankValue, applyDueDateFallback } from './src/sanitize.js';
24
24
  import {
25
25
  blockNoteToMarkdown,
26
26
  markdownToBlockNote,
@@ -637,6 +637,7 @@ function buildTaskBody(params) {
637
637
  if (isBlankValue(value)) continue;
638
638
  body[key] = value;
639
639
  }
640
+ applyDueDateFallback(body);
640
641
  if ('description' in body) {
641
642
  body.description = markdownToDescription(body.description);
642
643
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "planko-mcp-server",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "MCP server for syncing Planko tasks with local Markdown files",
5
5
  "type": "module",
6
6
  "bin": {
package/src/sanitize.js CHANGED
@@ -21,3 +21,17 @@ export function isBlankValue(value) {
21
21
  if (Array.isArray(value)) return value.length === 0;
22
22
  return false;
23
23
  }
24
+
25
+ /**
26
+ * LLM callers often put the date in `datePlain` and leave `dueDate` empty.
27
+ * The backend derives datePlain FROM dueDate but not the reverse, so a
28
+ * datePlain-only task ends up with dueDate=null and never appears on day/agenda
29
+ * views (it looks "not created"). Mirror datePlain -> dueDate in that case.
30
+ * Mutates and returns `body`.
31
+ */
32
+ export function applyDueDateFallback(body) {
33
+ if (isBlankValue(body.dueDate) && !isBlankValue(body.datePlain)) {
34
+ body.dueDate = body.datePlain;
35
+ }
36
+ return body;
37
+ }