kanban-lite 1.0.33 → 1.0.36

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 (54) hide show
  1. package/.vscode/mcp.json +20 -0
  2. package/AGENTS.md +16 -0
  3. package/CHANGELOG.md +9 -0
  4. package/README.md +29 -8
  5. package/SKILL.md +3 -0
  6. package/dist/cli.js +567 -40
  7. package/dist/extension.js +392 -27
  8. package/dist/mcp-server.js +340 -20
  9. package/dist/sdk/index.cjs +212 -836
  10. package/dist/sdk/index.mjs +214 -858
  11. package/dist/sdk/sdk/KanbanSDK.d.ts +91 -1
  12. package/dist/sdk/sdk/index.d.ts +1 -1
  13. package/dist/sdk/sdk/types.d.ts +1 -1
  14. package/dist/sdk/shared/config.d.ts +11 -0
  15. package/dist/sdk/shared/types.d.ts +51 -5
  16. package/dist/{webview/icons-DqI3jXv3.js → standalone-webview/icons-r7GgGAg-.js} +56 -46
  17. package/dist/standalone-webview/icons-r7GgGAg-.js.map +1 -0
  18. package/dist/standalone-webview/index.js +77 -58
  19. package/dist/standalone-webview/index.js.map +1 -1
  20. package/dist/standalone-webview/{react-vendor-K4aqks7O.js → react-vendor-DAFGO9PR.js} +2 -2
  21. package/dist/standalone-webview/{react-vendor-K4aqks7O.js.map → react-vendor-DAFGO9PR.js.map} +1 -1
  22. package/dist/standalone-webview/style.css +1 -1
  23. package/dist/standalone.js +7299 -5324
  24. package/dist/{standalone-webview/icons-DqI3jXv3.js → webview/icons-r7GgGAg-.js} +56 -46
  25. package/dist/webview/icons-r7GgGAg-.js.map +1 -0
  26. package/dist/webview/index.js +84 -65
  27. package/dist/webview/index.js.map +1 -1
  28. package/dist/webview/{react-vendor-K4aqks7O.js → react-vendor-DAFGO9PR.js} +2 -2
  29. package/dist/webview/{react-vendor-K4aqks7O.js.map → react-vendor-DAFGO9PR.js.map} +1 -1
  30. package/dist/webview/style.css +1 -1
  31. package/docs/api.md +50 -1
  32. package/docs/sdk.md +165 -0
  33. package/package.json +5 -2
  34. package/scripts/generate-api-docs.ts +33 -1
  35. package/src/cli/index.ts +101 -0
  36. package/src/extension/KanbanPanel.ts +52 -1
  37. package/src/mcp-server/index.ts +126 -0
  38. package/src/sdk/KanbanSDK.ts +209 -2
  39. package/src/sdk/__tests__/KanbanSDK.test.ts +95 -0
  40. package/src/sdk/index.ts +1 -1
  41. package/src/sdk/parser.ts +12 -3
  42. package/src/sdk/storage/sqlite.ts +2 -2
  43. package/src/sdk/types.ts +2 -0
  44. package/src/shared/config.ts +11 -2
  45. package/src/shared/types.ts +35 -6
  46. package/src/standalone/server.ts +120 -2
  47. package/src/webview/App.tsx +24 -4
  48. package/src/webview/components/CardEditor.tsx +22 -10
  49. package/src/webview/components/LogsSection.tsx +396 -0
  50. package/src/webview/components/MarkdownEditor.tsx +47 -4
  51. package/dist/standalone-webview/icons-DqI3jXv3.js.map +0 -1
  52. package/dist/webview/icons-DqI3jXv3.js.map +0 -1
  53. /package/.github/{workflows → workflows_}/ci.yml +0 -0
  54. /package/.github/{workflows → workflows_}/release.yml +0 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "servers": {
3
+ "playwriter": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "playwriter@latest"],
7
+ "env": {
8
+ "PLAYWRITER_AUTO_ENABLE": "1"
9
+ }
10
+ },
11
+ "kanban": {
12
+ "type": "stdio",
13
+ "command": "npm",
14
+ "args": ["run", "mcp"],
15
+ "env": {
16
+ "KANBAN_DIR": ".kanban"
17
+ }
18
+ }
19
+ }
20
+ }
package/AGENTS.md CHANGED
@@ -62,6 +62,7 @@ Never implement a feature directly in an interface layer without the SDK method
62
62
  - Cards (sqlite engine): `.kanban/kanban.db` (configurable via `sqlitePath` in `.kanban.json`)
63
63
  - Config: `.kanban.json` (boards, columns, display settings, label definitions)
64
64
  - Webhooks: `.kanban-webhooks.json`
65
+ - Logs: `.kanban/boards/<boardId>/<status>/attachments/<cardId>.log` (auto-attached text file)
65
66
 
66
67
  ## Storage Engines
67
68
 
@@ -111,3 +112,18 @@ metadata:
111
112
  - `completedAt` is auto-managed when status changes to/from `done`
112
113
  - `modified` timestamp is auto-updated on any change
113
114
  - The standalone server uses synchronous `fs` operations; the SDK uses async `fs/promises`
115
+
116
+ ## Agent execution rules (cost control):
117
+
118
+ 1. Do NOT scan or summarize the entire repository.
119
+ 2. Only open and modify the specific file(s) listed in the task plan.
120
+ 3. Do NOT rewrite large files from scratch.
121
+ 4. Make minimal surgical edits only where required.
122
+ 5. Do NOT refactor unrelated code.
123
+ 6. Do NOT change formatting, imports, or structure unless strictly necessary.
124
+ 7. Do NOT add new dependencies.
125
+ 8. Do NOT generate placeholder code or duplicate existing logic.
126
+ 9. Keep reasoning concise and implementation focused.
127
+ 10. If a task can be implemented by editing constants or inserting small functions, do that instead of restructuring the file.
128
+
129
+ Goal: complete the tasks with the smallest possible code changes and minimal token usage.
package/CHANGELOG.md CHANGED
@@ -7,7 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+ - **Card actions**: `actions` field now accepts either an array of action keys (`string[]`) or an object mapping action keys to display titles (`Record<string, string>`). The "Run Action" dropdown shows the title when the object form is used; the action key is always what's sent to the webhook. Fully backward-compatible — existing array-form cards are unchanged.
12
+
10
13
  ### Added
14
+ - **Card logs**: Append timestamped log entries to any card, stored as a `<cardId>.log` text file auto-added as an attachment. Each entry has timestamp (auto-generated), source label (defaults to `"default"`), markdown text, and optional structured data object (stored as compact JSON). Supports markdown formatting (bold, italic, emoji) in log text.
15
+ - **SDK**: `listLogs(cardId, boardId?)`, `addLog(cardId, text, options?, boardId?)`, `clearLogs(cardId, boardId?)` methods on `KanbanSDK`
16
+ - **REST API**: `GET /api/tasks/:id/logs`, `POST /api/tasks/:id/logs`, `DELETE /api/tasks/:id/logs`
17
+ - **CLI**: `kl log list <id>`, `kl log add <id> --text <msg> [--source <src>] [--object <json>]`, `kl log clear <id>`
18
+ - **MCP**: `list_logs`, `add_log`, `clear_logs` tools
19
+ - **UI**: Logs tab in card editor with toolbar (clear, limit, order, source filter, show/hide toggles for timestamp/source/objects), YAML-rendered objects
11
20
  - **Attachments subfolder**: attachments for the markdown storage engine are now stored in an `attachments/` subdirectory inside each column folder (e.g. `.kanban/boards/default/backlog/attachments/`) instead of alongside the card `.md` files
12
21
  - **Browser-viewable attachments**: PDFs and other binary attachments now open with the OS/browser default viewer in the VS Code extension; the standalone server now serves PDF, JPEG, GIF, WebP, CSV, plain-text, and XML attachments with correct `Content-Type` headers so browsers render them inline in a new tab
13
22
  - **KanbanSDK.getAttachmentDir(cardId, boardId?)**: new public SDK method that returns the absolute path to the attachment directory for a card (delegates to the active storage engine)
package/README.md CHANGED
@@ -65,6 +65,7 @@ kl add --title "My first task" --priority high
65
65
  - **Labels**: Tag cards with multiple labels
66
66
  - **Attachments**: Attach files to cards
67
67
  - **Comments**: Add discussion threads to cards (stored in the same markdown file)
68
+ - **Logs**: Append timestamped log entries to cards (stored as `<cardId>.log` text file, supports markdown, optional source labels and structured data objects)
68
69
  - **Actions**: Attach named triggers to a card (e.g. `retry`, `deploy`, `notify`) and fire them from the UI, CLI, API, or MCP server — calls a configured webhook with the card's full context
69
70
  - **Auto-generated IDs**: Based on title and timestamp (e.g., `implement-dark-mode-2026-01-29`)
70
71
  - **Timestamps**: Created and modified dates tracked automatically
@@ -134,6 +135,13 @@ kl comment add implement-search --author alice \
134
135
  kl comment edit implement-search c1 --body "Updated" # Edit a comment
135
136
  kl comment remove implement-search c1 # Remove a comment
136
137
 
138
+ # Logs
139
+ kl log list implement-search # List log entries
140
+ kl log add implement-search --text "Build passed" # Add a log entry
141
+ kl log add implement-search --text "Deployed" \
142
+ --source ci --object '{"version":"1.0"}' # With source and data
143
+ kl log clear implement-search # Clear all logs
144
+
137
145
  # Boards
138
146
  kl boards # List boards
139
147
  kl boards add --id bugs --name "Bug Tracker" # Create a board
@@ -291,6 +299,14 @@ Board-scoped equivalents are available at `/api/boards/:boardId/tasks/...`.
291
299
  | `PUT` | `/api/tasks/:id/comments/:commentId` | Update a comment (`{ content }`) |
292
300
  | `DELETE` | `/api/tasks/:id/comments/:commentId` | Delete a comment |
293
301
 
302
+ #### Logs
303
+
304
+ | Method | Endpoint | Description |
305
+ |--------|----------|-------------|
306
+ | `GET` | `/api/tasks/:id/logs` | List log entries on a card |
307
+ | `POST` | `/api/tasks/:id/logs` | Add a log entry (`{ text, source?, object?, timestamp? }`) |
308
+ | `DELETE` | `/api/tasks/:id/logs` | Clear all log entries |
309
+
294
310
  #### Attachments
295
311
 
296
312
  | Method | Endpoint | Description |
@@ -382,15 +398,17 @@ Actions let you attach named triggers to a card — things like `retry`, `deploy
382
398
  }
383
399
  ```
384
400
 
385
- 2. **Add actions to a card** — as a list of simple strings stored in the card's frontmatter:
401
+ 2. **Add actions to a card** — either as an array of action keys, or an object mapping action keys to display titles:
386
402
 
387
403
  ```yaml
388
- ---
389
- id: "42-deploy-v2"
390
- status: "in-progress"
404
+ # Array form — action key is used as the button label
391
405
  actions: ["retry", "rollback", "notify-slack"]
392
- ---
393
- # Deploy v2.0
406
+
407
+ # Object form — keys are the action names sent to the webhook, values are the UI labels
408
+ actions:
409
+ retry: "Retry deployment"
410
+ rollback: "Roll back to v1"
411
+ notify-slack: "Notify Slack"
394
412
  ```
395
413
 
396
414
  3. **Trigger an action** from any interface:
@@ -415,7 +433,7 @@ actions: ["retry", "rollback", "notify-slack"]
415
433
  "assignee": "alice",
416
434
  "labels": ["deploy"],
417
435
  "content": "# Deploy v2.0\n...",
418
- "actions": ["retry", "rollback", "notify-slack"]
436
+ "actions": ["retry", "rollback", "notify-slack"] // or {"retry": "Retry deployment", ...}
419
437
  }
420
438
  }
421
439
  ```
@@ -424,7 +442,7 @@ The webhook receives the full card object (same shape as the SDK `Card` type, mi
424
442
 
425
443
  ### Managing actions
426
444
 
427
- Actions are plain strings in the `actions` array of the card's YAML frontmatter. Edit them directly in the markdown file, or use any interface:
445
+ Actions are stored in the `actions` field of the card's YAML frontmatter — either as a plain string array or as a key→title object. Edit them directly in the markdown file, or use any interface:
428
446
 
429
447
  ```bash
430
448
  # Add actions when creating a card
@@ -508,6 +526,9 @@ kanban-mcp --dir .kanban # Via dedicated binary
508
526
  | `add_comment` | Add a comment to a card |
509
527
  | `update_comment` | Edit a comment's content |
510
528
  | `delete_comment` | Remove a comment from a card |
529
+ | `list_logs` | List log entries on a card |
530
+ | `add_log` | Add a log entry to a card |
531
+ | `clear_logs` | Clear all log entries from a card |
511
532
  | `list_columns` | List all board columns |
512
533
  | `add_column` | Add a new column to the board |
513
534
  | `update_column` | Update a column's name or color |
package/SKILL.md CHANGED
@@ -42,6 +42,9 @@ Use **MCP tools** when available (native LLM integration). Fall back to **CLI**
42
42
  | List attachments | `list_attachments` | `kl attach <id>` | via card object |
43
43
  | Add attachment | `add_attachment` | `kl attach add <id> <path>` | `POST /api/tasks/:id/attachments` |
44
44
  | Remove attachment | `remove_attachment` | `kl attach remove <id> <name>` | `DELETE /api/tasks/:id/attachments/:name` |
45
+ | List logs | `list_logs` | `kl log list <id>` | `GET /api/tasks/:id/logs` |
46
+ | Add log | `add_log` | `kl log add <id> --text "..."` | `POST /api/tasks/:id/logs` |
47
+ | Clear logs | `clear_logs` | `kl log clear <id>` | `DELETE /api/tasks/:id/logs` |
45
48
  | Get settings | `get_settings` | `kl settings` | `GET /api/settings` |
46
49
  | Update settings | `update_settings` | `kl settings update` | `PUT /api/settings` |
47
50
  | List webhooks | `list_webhooks` | `kl webhooks` | `GET /api/webhooks` |