sqlew 3.1.2 → 3.2.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +12 -2
  3. package/assets/schema.sql +28 -1
  4. package/dist/database.d.ts +65 -0
  5. package/dist/database.d.ts.map +1 -1
  6. package/dist/database.js +190 -0
  7. package/dist/database.js.map +1 -1
  8. package/dist/index.js +30 -6
  9. package/dist/index.js.map +1 -1
  10. package/dist/migrations/add-decision-context.d.ts +28 -0
  11. package/dist/migrations/add-decision-context.d.ts.map +1 -0
  12. package/dist/migrations/add-decision-context.js +125 -0
  13. package/dist/migrations/add-decision-context.js.map +1 -0
  14. package/dist/migrations/add-task-dependencies.d.ts +26 -0
  15. package/dist/migrations/add-task-dependencies.d.ts.map +1 -0
  16. package/dist/migrations/add-task-dependencies.js +94 -0
  17. package/dist/migrations/add-task-dependencies.js.map +1 -0
  18. package/dist/migrations/index.d.ts +3 -1
  19. package/dist/migrations/index.d.ts.map +1 -1
  20. package/dist/migrations/index.js +32 -2
  21. package/dist/migrations/index.js.map +1 -1
  22. package/dist/schema.js +2 -2
  23. package/dist/schema.js.map +1 -1
  24. package/dist/tests/migrations/test-v3.2-migration.d.ts +6 -0
  25. package/dist/tests/migrations/test-v3.2-migration.d.ts.map +1 -0
  26. package/dist/tests/migrations/test-v3.2-migration.js +191 -0
  27. package/dist/tests/migrations/test-v3.2-migration.js.map +1 -0
  28. package/dist/tests/tasks.dependencies.test.d.ts +7 -0
  29. package/dist/tests/tasks.dependencies.test.d.ts.map +1 -0
  30. package/dist/tests/tasks.dependencies.test.js +613 -0
  31. package/dist/tests/tasks.dependencies.test.js.map +1 -0
  32. package/dist/tools/context.d.ts +21 -2
  33. package/dist/tools/context.d.ts.map +1 -1
  34. package/dist/tools/context.js +110 -3
  35. package/dist/tools/context.js.map +1 -1
  36. package/dist/tools/tasks.d.ts +23 -0
  37. package/dist/tools/tasks.d.ts.map +1 -1
  38. package/dist/tools/tasks.js +297 -8
  39. package/dist/tools/tasks.js.map +1 -1
  40. package/dist/tools/utils.d.ts.map +1 -1
  41. package/dist/tools/utils.js +44 -21
  42. package/dist/tools/utils.js.map +1 -1
  43. package/dist/types.d.ts +26 -0
  44. package/dist/types.d.ts.map +1 -1
  45. package/docs/AI_AGENT_GUIDE.md +25 -3
  46. package/docs/DECISION_CONTEXT.md +474 -0
  47. package/docs/TASK_ACTIONS.md +311 -10
  48. package/docs/TASK_DEPENDENCIES.md +748 -0
  49. package/docs/TASK_LINKING.md +188 -8
  50. package/docs/WORKFLOWS.md +25 -3
  51. package/package.json +4 -2
@@ -1,7 +1,7 @@
1
1
  # Task Actions Reference
2
2
 
3
- **Version:** 3.0.0
4
- **Last Updated:** 2025-10-17
3
+ **Version:** 3.2.0
4
+ **Last Updated:** 2025-10-18
5
5
 
6
6
  ## Table of Contents
7
7
 
@@ -14,14 +14,19 @@
14
14
  7. [Action: link](#action-link)
15
15
  8. [Action: archive](#action-archive)
16
16
  9. [Action: batch_create](#action-batch_create)
17
- 10. [Action: help](#action-help)
18
- 11. [Best Practices](#best-practices)
19
- 12. [Common Errors](#common-errors)
20
- 13. [Related Documentation](#related-documentation)
17
+ 10. [Action: add_dependency](#action-add_dependency) (NEW in 3.2.0)
18
+ 11. [Action: remove_dependency](#action-remove_dependency) (NEW in 3.2.0)
19
+ 12. [Action: get_dependencies](#action-get_dependencies) (NEW in 3.2.0)
20
+ 13. [Action: help](#action-help)
21
+ 14. [Best Practices](#best-practices)
22
+ 15. [Common Errors](#common-errors)
23
+ 16. [Related Documentation](#related-documentation)
21
24
 
22
25
  ## Overview
23
26
 
24
- The `task` MCP tool provides 9 actions for managing tasks in the Kanban Task Watcher system. All actions require the `action` parameter.
27
+ The `task` MCP tool provides 12 actions for managing tasks in the Kanban Task Watcher system. All actions require the `action` parameter.
28
+
29
+ **NEW in v3.2.0:** Task Dependencies - Manage blocking relationships between tasks with circular dependency detection.
25
30
 
26
31
  **Action-Based API Pattern:**
27
32
  ```javascript
@@ -179,8 +184,12 @@ Get single task with full details.
179
184
  - `action`: "get"
180
185
  - `task_id`: Task ID (number)
181
186
 
182
- ### Example
187
+ **Optional (NEW in 3.2.0):**
188
+ - `include_dependencies`: Include dependency arrays (boolean) - default: false
189
+
190
+ ### Examples
183
191
 
192
+ **Basic Get:**
184
193
  ```javascript
185
194
  {
186
195
  action: "get",
@@ -188,8 +197,18 @@ Get single task with full details.
188
197
  }
189
198
  ```
190
199
 
200
+ **Get with Dependencies:**
201
+ ```javascript
202
+ {
203
+ action: "get",
204
+ task_id: 1,
205
+ include_dependencies: true
206
+ }
207
+ ```
208
+
191
209
  ### Response
192
210
 
211
+ **Without Dependencies:**
193
212
  ```javascript
194
213
  {
195
214
  task_id: 1,
@@ -208,6 +227,23 @@ Get single task with full details.
208
227
  }
209
228
  ```
210
229
 
230
+ **With Dependencies (NEW in 3.2.0):**
231
+ ```javascript
232
+ {
233
+ task_id: 1,
234
+ title: "Implement JWT authentication",
235
+ description: "Add JWT-based authentication with refresh tokens",
236
+ // ... other fields ...
237
+ dependencies: {
238
+ blockers: [3, 5], // Tasks blocking this task
239
+ blocking: [2, 7] // Tasks this task blocks
240
+ },
241
+ decision_links: ["auth_method", "jwt_secret"],
242
+ constraint_links: [5],
243
+ file_links: ["/src/auth/jwt.ts", "/src/auth/middleware.ts"]
244
+ }
245
+ ```
246
+
211
247
  ### Token Efficiency
212
248
 
213
249
  - **~332 bytes/task** (includes description and links)
@@ -229,6 +265,7 @@ List tasks with filtering (metadata only, no descriptions).
229
265
  - `tags`: Filter by tags (string[])
230
266
  - `layer`: Filter by layer (string)
231
267
  - `limit`: Maximum results (number) - default: 100
268
+ - `include_dependency_counts`: Include dependency counts (boolean) - default: false (NEW in 3.2.0)
232
269
 
233
270
  ### Examples
234
271
 
@@ -275,8 +312,18 @@ List tasks with filtering (metadata only, no descriptions).
275
312
  }
276
313
  ```
277
314
 
315
+ **With Dependency Counts (NEW in 3.2.0):**
316
+ ```javascript
317
+ {
318
+ action: "list",
319
+ status: "in_progress",
320
+ include_dependency_counts: true
321
+ }
322
+ ```
323
+
278
324
  ### Response
279
325
 
326
+ **Without Dependency Counts:**
280
327
  ```javascript
281
328
  {
282
329
  tasks: [
@@ -308,6 +355,42 @@ List tasks with filtering (metadata only, no descriptions).
308
355
  }
309
356
  ```
310
357
 
358
+ **With Dependency Counts (NEW in 3.2.0):**
359
+ ```javascript
360
+ {
361
+ tasks: [
362
+ {
363
+ task_id: 1,
364
+ title: "Implement JWT authentication",
365
+ status_name: "in_progress",
366
+ priority_name: "high",
367
+ assignee: "auth-agent",
368
+ layer_name: "business",
369
+ tags: "security,authentication",
370
+ created_ts: 1697545200,
371
+ updated_ts: 1697545800,
372
+ blocked_by_count: 0, // Nothing blocks this task
373
+ blocking_count: 2 // This blocks 2 tasks
374
+ },
375
+ {
376
+ task_id: 2,
377
+ title: "Setup OAuth2 provider",
378
+ status_name: "in_progress",
379
+ priority_name: "high",
380
+ assignee: "auth-agent",
381
+ layer_name: "business",
382
+ tags: "security,oauth2",
383
+ created_ts: 1697545300,
384
+ updated_ts: 1697545900,
385
+ blocked_by_count: 1, // 1 task blocks this
386
+ blocking_count: 0 // This doesn't block anything
387
+ }
388
+ ],
389
+ count: 2,
390
+ stale_tasks_transitioned: 0
391
+ }
392
+ ```
393
+
311
394
  ### Token Efficiency
312
395
 
313
396
  - **~100 bytes/task** (metadata only)
@@ -623,6 +706,223 @@ Create multiple tasks atomically or best-effort.
623
706
  - **Best-effort mode (false):** Partial success allowed (recommended for AI)
624
707
  - Each task follows same schema as `create` action
625
708
 
709
+ ## Action: add_dependency
710
+
711
+ Add a blocking relationship between two tasks (NEW in 3.2.0).
712
+
713
+ ### Parameters
714
+
715
+ **Required:**
716
+ - `action`: "add_dependency"
717
+ - `blocker_task_id`: Task ID that blocks (number)
718
+ - `blocked_task_id`: Task ID that is blocked (number)
719
+
720
+ ### Validations
721
+
722
+ - No self-dependencies (task cannot block itself)
723
+ - No circular dependencies (direct or transitive)
724
+ - Both tasks must exist
725
+ - Neither task can be archived
726
+
727
+ ### Examples
728
+
729
+ **Basic Dependency:**
730
+ ```javascript
731
+ {
732
+ action: "add_dependency",
733
+ blocker_task_id: 1,
734
+ blocked_task_id: 2
735
+ }
736
+ ```
737
+
738
+ **Sequential Workflow:**
739
+ ```javascript
740
+ // Task #1: Implement auth (must complete first)
741
+ // Task #2: Add profile page (depends on auth)
742
+
743
+ {
744
+ action: "add_dependency",
745
+ blocker_task_id: 1,
746
+ blocked_task_id: 2
747
+ }
748
+ ```
749
+
750
+ ### Response
751
+
752
+ ```javascript
753
+ {
754
+ success: true,
755
+ message: "Dependency added: Task #1 blocks Task #2"
756
+ }
757
+ ```
758
+
759
+ ### Error Examples
760
+
761
+ **Self-Dependency:**
762
+ ```javascript
763
+ {
764
+ action: "add_dependency",
765
+ blocker_task_id: 1,
766
+ blocked_task_id: 1
767
+ }
768
+ // Error: "Self-dependency not allowed"
769
+ ```
770
+
771
+ **Circular Dependency:**
772
+ ```javascript
773
+ // Existing: Task #1 blocks Task #2
774
+
775
+ {
776
+ action: "add_dependency",
777
+ blocker_task_id: 2,
778
+ blocked_task_id: 1
779
+ }
780
+ // Error: "Circular dependency detected: Task #2 already blocks Task #1"
781
+ ```
782
+
783
+ **Archived Task:**
784
+ ```javascript
785
+ {
786
+ action: "add_dependency",
787
+ blocker_task_id: 10, // archived
788
+ blocked_task_id: 2
789
+ }
790
+ // Error: "Cannot add dependency: Task #10 is archived"
791
+ ```
792
+
793
+ ### Notes
794
+
795
+ - Uses recursive CTE for transitive cycle detection
796
+ - Depth limit: 100 levels
797
+ - CASCADE deletion: Dependencies auto-delete when tasks are deleted
798
+
799
+ ## Action: remove_dependency
800
+
801
+ Remove a blocking relationship between two tasks (NEW in 3.2.0).
802
+
803
+ ### Parameters
804
+
805
+ **Required:**
806
+ - `action`: "remove_dependency"
807
+ - `blocker_task_id`: Task ID that blocks (number)
808
+ - `blocked_task_id`: Task ID that is blocked (number)
809
+
810
+ ### Example
811
+
812
+ ```javascript
813
+ {
814
+ action: "remove_dependency",
815
+ blocker_task_id: 1,
816
+ blocked_task_id: 2
817
+ }
818
+ ```
819
+
820
+ ### Response
821
+
822
+ ```javascript
823
+ {
824
+ success: true,
825
+ message: "Dependency removed: Task #1 no longer blocks Task #2"
826
+ }
827
+ ```
828
+
829
+ ### Notes
830
+
831
+ - Idempotent: Succeeds silently if dependency doesn't exist
832
+ - Use when task completed early or requirements changed
833
+ - Unblocks dependent tasks
834
+
835
+ ## Action: get_dependencies
836
+
837
+ Query dependencies for a task bidirectionally (NEW in 3.2.0).
838
+
839
+ ### Parameters
840
+
841
+ **Required:**
842
+ - `action`: "get_dependencies"
843
+ - `task_id`: Task to query dependencies for (number)
844
+
845
+ **Optional:**
846
+ - `include_details`: Include full task metadata (boolean) - default: false
847
+
848
+ ### Examples
849
+
850
+ **Metadata-Only (Recommended):**
851
+ ```javascript
852
+ {
853
+ action: "get_dependencies",
854
+ task_id: 2
855
+ }
856
+ ```
857
+
858
+ **With Full Details:**
859
+ ```javascript
860
+ {
861
+ action: "get_dependencies",
862
+ task_id: 2,
863
+ include_details: true
864
+ }
865
+ ```
866
+
867
+ ### Response
868
+
869
+ **Metadata-Only:**
870
+ ```javascript
871
+ {
872
+ task_id: 2,
873
+ blockers: [1, 3], // Task IDs only (~30 bytes)
874
+ blocking: [5, 7]
875
+ }
876
+ ```
877
+
878
+ **With Details:**
879
+ ```javascript
880
+ {
881
+ task_id: 2,
882
+ blockers: [
883
+ {
884
+ task_id: 1,
885
+ title: "Implement JWT authentication",
886
+ status: "in_progress",
887
+ priority: "high"
888
+ },
889
+ {
890
+ task_id: 3,
891
+ title: "Design user schema",
892
+ status: "done",
893
+ priority: "medium"
894
+ }
895
+ ],
896
+ blocking: [
897
+ {
898
+ task_id: 5,
899
+ title: "Add profile page",
900
+ status: "todo",
901
+ priority: "medium"
902
+ },
903
+ {
904
+ task_id: 7,
905
+ title: "Add settings page",
906
+ status: "todo",
907
+ priority: "low"
908
+ }
909
+ ]
910
+ }
911
+ ```
912
+
913
+ ### Token Efficiency
914
+
915
+ - **Metadata-only:** ~30 bytes (IDs only)
916
+ - **With details:** ~250 bytes per task
917
+ - **Savings:** ~88% token reduction with metadata approach
918
+
919
+ ### Use Cases
920
+
921
+ - Find what's blocking a task (`blockers`)
922
+ - Find what's waiting for a task (`blocking`)
923
+ - Identify bottlenecks (high `blocking` count)
924
+ - Plan work order
925
+
626
926
  ## Action: help
627
927
 
628
928
  Get comprehensive on-demand documentation.
@@ -843,12 +1143,13 @@ link({
843
1143
 
844
1144
  - **[TASK_OVERVIEW.md](TASK_OVERVIEW.md)** - Task system overview and core concepts
845
1145
  - **[TASK_LINKING.md](TASK_LINKING.md)** - Linking tasks to decisions/constraints/files
1146
+ - **[TASK_DEPENDENCIES.md](TASK_DEPENDENCIES.md)** - Dependency management (NEW in 3.2.0)
846
1147
  - **[TASK_MIGRATION.md](TASK_MIGRATION.md)** - Migrating from decision-based task tracking
847
1148
  - **[TASK_SYSTEM.md](TASK_SYSTEM.md)** - Complete documentation (original)
848
1149
  - **[AI_AGENT_GUIDE.md](AI_AGENT_GUIDE.md)** - Comprehensive AI agent guide
849
1150
 
850
1151
  ---
851
1152
 
852
- **Version:** 3.0.0
853
- **Last Updated:** 2025-10-17
1153
+ **Version:** 3.2.0
1154
+ **Last Updated:** 2025-10-18
854
1155
  **Author:** sin5ddd