sqlew 3.5.3 → 3.6.1
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/CHANGELOG.md +247 -1772
- package/README.md +70 -304
- package/assets/config.example.toml +106 -0
- package/dist/adapters/index.d.ts +11 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +21 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/mysql-adapter.d.ts +31 -0
- package/dist/adapters/mysql-adapter.d.ts.map +1 -0
- package/dist/adapters/mysql-adapter.js +63 -0
- package/dist/adapters/mysql-adapter.js.map +1 -0
- package/dist/adapters/postgresql-adapter.d.ts +31 -0
- package/dist/adapters/postgresql-adapter.d.ts.map +1 -0
- package/dist/adapters/postgresql-adapter.js +63 -0
- package/dist/adapters/postgresql-adapter.js.map +1 -0
- package/dist/adapters/sqlite-adapter.d.ts +37 -0
- package/dist/adapters/sqlite-adapter.d.ts.map +1 -0
- package/dist/adapters/sqlite-adapter.js +129 -0
- package/dist/adapters/sqlite-adapter.js.map +1 -0
- package/dist/adapters/types.d.ts +33 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/cli.js +55 -54
- package/dist/cli.js.map +1 -1
- package/dist/config/example-generator.d.ts +11 -0
- package/dist/config/example-generator.d.ts.map +1 -0
- package/dist/config/example-generator.js +48 -0
- package/dist/config/example-generator.js.map +1 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +4 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/types.d.ts +11 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/database.d.ts +56 -121
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +266 -414
- package/dist/database.js.map +1 -1
- package/dist/index.js +329 -245
- package/dist/index.js.map +1 -1
- package/dist/knexfile.d.ts +6 -0
- package/dist/knexfile.d.ts.map +1 -0
- package/dist/knexfile.js +85 -0
- package/dist/knexfile.js.map +1 -0
- package/dist/migrations/add-help-system-tables.d.ts +35 -0
- package/dist/migrations/add-help-system-tables.d.ts.map +1 -0
- package/dist/migrations/add-help-system-tables.js +206 -0
- package/dist/migrations/add-help-system-tables.js.map +1 -0
- package/dist/migrations/add-token-tracking.d.ts +28 -0
- package/dist/migrations/add-token-tracking.d.ts.map +1 -0
- package/dist/migrations/add-token-tracking.js +108 -0
- package/dist/migrations/add-token-tracking.js.map +1 -0
- package/dist/migrations/index.d.ts +25 -12
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +147 -20
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/knex/20251025020452_create_master_tables.d.ts +4 -0
- package/dist/migrations/knex/20251025020452_create_master_tables.d.ts.map +1 -0
- package/dist/migrations/knex/20251025020452_create_master_tables.js +65 -0
- package/dist/migrations/knex/20251025020452_create_master_tables.js.map +1 -0
- package/dist/migrations/knex/20251025021152_create_transaction_tables.d.ts +4 -0
- package/dist/migrations/knex/20251025021152_create_transaction_tables.d.ts.map +1 -0
- package/dist/migrations/knex/20251025021152_create_transaction_tables.js +235 -0
- package/dist/migrations/knex/20251025021152_create_transaction_tables.js.map +1 -0
- package/dist/migrations/knex/20251025021351_create_indexes.d.ts +4 -0
- package/dist/migrations/knex/20251025021351_create_indexes.d.ts.map +1 -0
- package/dist/migrations/knex/20251025021351_create_indexes.js +62 -0
- package/dist/migrations/knex/20251025021351_create_indexes.js.map +1 -0
- package/dist/migrations/knex/20251025021416_seed_master_data.d.ts +4 -0
- package/dist/migrations/knex/20251025021416_seed_master_data.d.ts.map +1 -0
- package/dist/migrations/knex/20251025021416_seed_master_data.js +58 -0
- package/dist/migrations/knex/20251025021416_seed_master_data.js.map +1 -0
- package/dist/migrations/knex/20251025070349_create_views.d.ts +4 -0
- package/dist/migrations/knex/20251025070349_create_views.d.ts.map +1 -0
- package/dist/migrations/knex/20251025070349_create_views.js +143 -0
- package/dist/migrations/knex/20251025070349_create_views.js.map +1 -0
- package/dist/migrations/knex/20251025081221_add_link_type_to_task_decision_links.d.ts +4 -0
- package/dist/migrations/knex/20251025081221_add_link_type_to_task_decision_links.d.ts.map +1 -0
- package/dist/migrations/knex/20251025081221_add_link_type_to_task_decision_links.js +15 -0
- package/dist/migrations/knex/20251025081221_add_link_type_to_task_decision_links.js.map +1 -0
- package/dist/migrations/knex/20251025082220_fix_task_dependencies_columns.d.ts +8 -0
- package/dist/migrations/knex/20251025082220_fix_task_dependencies_columns.d.ts.map +1 -0
- package/dist/migrations/knex/20251025082220_fix_task_dependencies_columns.js +12 -0
- package/dist/migrations/knex/20251025082220_fix_task_dependencies_columns.js.map +1 -0
- package/dist/migrations/knex/20251025090000_create_help_system_tables.d.ts +19 -0
- package/dist/migrations/knex/20251025090000_create_help_system_tables.d.ts.map +1 -0
- package/dist/migrations/knex/20251025090000_create_help_system_tables.js +115 -0
- package/dist/migrations/knex/20251025090000_create_help_system_tables.js.map +1 -0
- package/dist/migrations/knex/20251025090100_seed_help_categories_and_use_cases.d.ts +13 -0
- package/dist/migrations/knex/20251025090100_seed_help_categories_and_use_cases.d.ts.map +1 -0
- package/dist/migrations/knex/20251025090100_seed_help_categories_and_use_cases.js +377 -0
- package/dist/migrations/knex/20251025090100_seed_help_categories_and_use_cases.js.map +1 -0
- package/dist/migrations/knex/20251025100000_seed_help_metadata.d.ts +15 -0
- package/dist/migrations/knex/20251025100000_seed_help_metadata.d.ts.map +1 -0
- package/dist/migrations/knex/20251025100000_seed_help_metadata.js +253 -0
- package/dist/migrations/knex/20251025100000_seed_help_metadata.js.map +1 -0
- package/dist/migrations/knex/20251025100100_seed_remaining_use_cases.d.ts +16 -0
- package/dist/migrations/knex/20251025100100_seed_remaining_use_cases.d.ts.map +1 -0
- package/dist/migrations/knex/20251025100100_seed_remaining_use_cases.js +276 -0
- package/dist/migrations/knex/20251025100100_seed_remaining_use_cases.js.map +1 -0
- package/dist/migrations/knex/20251025120000_add_cascade_to_task_dependencies.d.ts +8 -0
- package/dist/migrations/knex/20251025120000_add_cascade_to_task_dependencies.d.ts.map +1 -0
- package/dist/migrations/knex/20251025120000_add_cascade_to_task_dependencies.js +64 -0
- package/dist/migrations/knex/20251025120000_add_cascade_to_task_dependencies.js.map +1 -0
- package/dist/migrations/knex/20251027000000_add_agent_reuse_system.d.ts +14 -0
- package/dist/migrations/knex/20251027000000_add_agent_reuse_system.d.ts.map +1 -0
- package/dist/migrations/knex/20251027000000_add_agent_reuse_system.js +34 -0
- package/dist/migrations/knex/20251027000000_add_agent_reuse_system.js.map +1 -0
- package/dist/migrations/knex/20251027010000_add_task_constraint_to_decision_context.d.ts +4 -0
- package/dist/migrations/knex/20251027010000_add_task_constraint_to_decision_context.d.ts.map +1 -0
- package/dist/migrations/knex/20251027010000_add_task_constraint_to_decision_context.js +24 -0
- package/dist/migrations/knex/20251027010000_add_task_constraint_to_decision_context.js.map +1 -0
- package/dist/migrations/knex/20251027020000_update_agent_reusability.d.ts +16 -0
- package/dist/migrations/knex/20251027020000_update_agent_reusability.d.ts.map +1 -0
- package/dist/migrations/knex/20251027020000_update_agent_reusability.js +27 -0
- package/dist/migrations/knex/20251027020000_update_agent_reusability.js.map +1 -0
- package/dist/migrations/seed-help-data.d.ts +48 -0
- package/dist/migrations/seed-help-data.d.ts.map +1 -0
- package/dist/migrations/seed-help-data.js +1466 -0
- package/dist/migrations/seed-help-data.js.map +1 -0
- package/dist/migrations/seed-tool-metadata.d.ts +24 -0
- package/dist/migrations/seed-tool-metadata.d.ts.map +1 -0
- package/dist/migrations/seed-tool-metadata.js +392 -0
- package/dist/migrations/seed-tool-metadata.js.map +1 -0
- package/dist/migrations/v3.6.0-help-system-refactor.d.ts +46 -0
- package/dist/migrations/v3.6.0-help-system-refactor.d.ts.map +1 -0
- package/dist/migrations/v3.6.0-help-system-refactor.js +223 -0
- package/dist/migrations/v3.6.0-help-system-refactor.js.map +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -1
- package/dist/tests/agent-reuse.test.d.ts +6 -0
- package/dist/tests/agent-reuse.test.d.ts.map +1 -0
- package/dist/tests/agent-reuse.test.js +242 -0
- package/dist/tests/agent-reuse.test.js.map +1 -0
- package/dist/tests/all-features.test.d.ts +7 -0
- package/dist/tests/all-features.test.d.ts.map +1 -0
- package/dist/tests/all-features.test.js +514 -0
- package/dist/tests/all-features.test.js.map +1 -0
- package/dist/tests/git-aware-completion.test.js +89 -70
- package/dist/tests/git-aware-completion.test.js.map +1 -1
- package/dist/tests/help-system.test.d.ts +23 -0
- package/dist/tests/help-system.test.d.ts.map +1 -0
- package/dist/tests/help-system.test.js +374 -0
- package/dist/tests/help-system.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.js +92 -78
- package/dist/tests/tasks.auto-pruning-decision-link.test.js.map +1 -1
- package/dist/tests/tasks.auto-pruning-partial.test.js +106 -95
- package/dist/tests/tasks.auto-pruning-partial.test.js.map +1 -1
- package/dist/tests/tasks.auto-pruning-persistence.test.js +115 -97
- package/dist/tests/tasks.auto-pruning-persistence.test.js.map +1 -1
- package/dist/tests/tasks.auto-pruning-safety.test.js +124 -103
- package/dist/tests/tasks.auto-pruning-safety.test.js.map +1 -1
- package/dist/tests/tasks.dependencies.test.js +338 -307
- package/dist/tests/tasks.dependencies.test.js.map +1 -1
- package/dist/tests/tasks.link-file-backward-compat.test.js +116 -104
- package/dist/tests/tasks.link-file-backward-compat.test.js.map +1 -1
- package/dist/tests/tasks.watch-files-action.test.js +122 -101
- package/dist/tests/tasks.watch-files-action.test.js.map +1 -1
- package/dist/tests/tasks.watch-files-parameter.test.js +105 -94
- package/dist/tests/tasks.watch-files-parameter.test.js.map +1 -1
- package/dist/tests/two-step-git-completion.test.js +176 -133
- package/dist/tests/two-step-git-completion.test.js.map +1 -1
- package/dist/tests/vcs-staging.test.js +1 -1
- package/dist/tests/vcs-staging.test.js.map +1 -1
- package/dist/tools/config.d.ts +9 -6
- package/dist/tools/config.d.ts.map +1 -1
- package/dist/tools/config.js +16 -14
- package/dist/tools/config.js.map +1 -1
- package/dist/tools/constraints.d.ts +10 -7
- package/dist/tools/constraints.d.ts.map +1 -1
- package/dist/tools/constraints.js +73 -51
- package/dist/tools/constraints.js.map +1 -1
- package/dist/tools/context.d.ts +36 -33
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +441 -340
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/files.d.ts +12 -9
- package/dist/tools/files.d.ts.map +1 -1
- package/dist/tools/files.js +173 -95
- package/dist/tools/files.js.map +1 -1
- package/dist/tools/help-queries.d.ts +130 -0
- package/dist/tools/help-queries.d.ts.map +1 -0
- package/dist/tools/help-queries.js +393 -0
- package/dist/tools/help-queries.js.map +1 -0
- package/dist/tools/messaging.d.ts +14 -11
- package/dist/tools/messaging.d.ts.map +1 -1
- package/dist/tools/messaging.js +239 -133
- package/dist/tools/messaging.js.map +1 -1
- package/dist/tools/tasks.d.ts +18 -16
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +519 -442
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/utils.d.ts +14 -11
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +90 -122
- package/dist/tools/utils.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/activity-logging.d.ts +114 -0
- package/dist/utils/activity-logging.d.ts.map +1 -0
- package/dist/utils/activity-logging.js +162 -0
- package/dist/utils/activity-logging.js.map +1 -0
- package/dist/utils/batch.d.ts +2 -2
- package/dist/utils/batch.d.ts.map +1 -1
- package/dist/utils/batch.js +8 -8
- package/dist/utils/batch.js.map +1 -1
- package/dist/utils/cleanup.d.ts +24 -14
- package/dist/utils/cleanup.d.ts.map +1 -1
- package/dist/utils/cleanup.js +37 -27
- package/dist/utils/cleanup.js.map +1 -1
- package/dist/utils/debug-logger.d.ts +99 -0
- package/dist/utils/debug-logger.d.ts.map +1 -0
- package/dist/utils/debug-logger.js +267 -0
- package/dist/utils/debug-logger.js.map +1 -0
- package/dist/utils/error-handler.d.ts +28 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +121 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/help-tracking.d.ts +55 -0
- package/dist/utils/help-tracking.d.ts.map +1 -0
- package/dist/utils/help-tracking.js +88 -0
- package/dist/utils/help-tracking.js.map +1 -0
- package/dist/utils/param-parser.d.ts +23 -0
- package/dist/utils/param-parser.d.ts.map +1 -0
- package/dist/utils/param-parser.js +52 -0
- package/dist/utils/param-parser.js.map +1 -0
- package/dist/utils/retention.d.ts +17 -7
- package/dist/utils/retention.d.ts.map +1 -1
- package/dist/utils/retention.js +31 -12
- package/dist/utils/retention.js.map +1 -1
- package/dist/utils/task-stale-detection.d.ts +15 -13
- package/dist/utils/task-stale-detection.d.ts.map +1 -1
- package/dist/utils/task-stale-detection.js +100 -302
- package/dist/utils/task-stale-detection.js.map +1 -1
- package/dist/utils/token-estimation.d.ts +72 -0
- package/dist/utils/token-estimation.d.ts.map +1 -0
- package/dist/utils/token-estimation.js +71 -0
- package/dist/utils/token-estimation.js.map +1 -0
- package/dist/utils/token-logging.d.ts +48 -0
- package/dist/utils/token-logging.d.ts.map +1 -0
- package/dist/utils/token-logging.js +112 -0
- package/dist/utils/token-logging.js.map +1 -0
- package/dist/utils/view-queries.d.ts +34 -0
- package/dist/utils/view-queries.d.ts.map +1 -0
- package/dist/utils/view-queries.js +192 -0
- package/dist/utils/view-queries.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts.map +1 -1
- package/dist/watcher/file-watcher.js +25 -11
- package/dist/watcher/file-watcher.js.map +1 -1
- package/docs/BEST_PRACTICES.md +56 -448
- package/docs/MIGRATION_v3.6.0.md +170 -0
- package/docs/SHARED_CONCEPTS.md +63 -208
- package/docs/TASK_OVERVIEW.md +2 -2
- package/docs/TOOL_SELECTION.md +41 -248
- package/package.json +17 -4
package/docs/TOOL_SELECTION.md
CHANGED
|
@@ -1,51 +1,6 @@
|
|
|
1
1
|
# Tool Selection Guide
|
|
2
2
|
|
|
3
|
-
**Quick reference for choosing the right
|
|
4
|
-
|
|
5
|
-
## Understanding Tool Purposes
|
|
6
|
-
|
|
7
|
-
Each tool serves a distinct purpose in the MCP sqlew ecosystem:
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌──────────────────────────────────────────────────────────┐
|
|
11
|
-
│ What do you need to do? │
|
|
12
|
-
└────────────────┬─────────────────────────────────────────┘
|
|
13
|
-
│
|
|
14
|
-
├─ Record a CHOICE that was made?
|
|
15
|
-
│ └─> Use `decision` tool
|
|
16
|
-
│ • Examples: "We chose JWT auth", "Selected PostgreSQL"
|
|
17
|
-
│ • Key: Captures PAST decisions
|
|
18
|
-
│ • Supports: versioning, tags, layers, scopes
|
|
19
|
-
│
|
|
20
|
-
├─ Communicate with other agents?
|
|
21
|
-
│ └─> Use `message` tool
|
|
22
|
-
│ • Examples: Task updates, warnings, requests
|
|
23
|
-
│ • Key: Real-time communication
|
|
24
|
-
│ • Supports: priority, broadcast, read tracking
|
|
25
|
-
│
|
|
26
|
-
├─ Define a REQUIREMENT that must be followed?
|
|
27
|
-
│ └─> Use `constraint` tool
|
|
28
|
-
│ • Examples: "API must be <100ms", "Code coverage >80%"
|
|
29
|
-
│ • Key: Enforces RULES
|
|
30
|
-
│ • Supports: priority, categories, layers
|
|
31
|
-
│
|
|
32
|
-
├─ Track WORK to be done?
|
|
33
|
-
│ └─> Use `task` tool
|
|
34
|
-
│ • Examples: "Implement feature X", "Fix bug Y"
|
|
35
|
-
│ • Key: Tracks TODO items and progress
|
|
36
|
-
│ • Supports: status transitions, auto-stale, linking
|
|
37
|
-
│
|
|
38
|
-
├─ Record file modifications?
|
|
39
|
-
│ └─> Use `file` tool
|
|
40
|
-
│ • Examples: Track changes, check locks
|
|
41
|
-
│ • Key: File change history
|
|
42
|
-
│ • Supports: layers, change types, lock detection
|
|
43
|
-
│
|
|
44
|
-
└─ Get statistics or manage data?
|
|
45
|
-
└─> Use `stats` or `config` tools
|
|
46
|
-
• stats: Database metrics, cleanup, activity logs
|
|
47
|
-
• config: Retention settings, auto-deletion
|
|
48
|
-
```
|
|
3
|
+
**Quick reference for choosing the right tool**
|
|
49
4
|
|
|
50
5
|
## Tool Comparison Table
|
|
51
6
|
|
|
@@ -61,219 +16,57 @@ Each tool serves a distinct purpose in the MCP sqlew ecosystem:
|
|
|
61
16
|
|
|
62
17
|
## Decision vs Constraint vs Task
|
|
63
18
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
|
67
|
-
|
|
68
|
-
| **
|
|
69
|
-
| **Constraint** | A requirement that MUST be followed | "Response time must be <100ms" | `constraint` |
|
|
70
|
-
| **Task** | Work that NEEDS to be done | "Implement JWT authentication" | `task` |
|
|
71
|
-
|
|
72
|
-
## ⚠️ Decision vs Task: WHY vs WHAT
|
|
73
|
-
|
|
74
|
-
**Critical distinction**: `decision` stores WHY (reasoning), `task` stores WHAT (work status).
|
|
75
|
-
|
|
76
|
-
| Question | Answer | Tool |
|
|
77
|
-
|----------|--------|------|
|
|
78
|
-
| **WHY** did we choose this approach? | "Chose JWT because stateless auth scales horizontally" | **decision** |
|
|
79
|
-
| **WHAT** needs to be done? | "Implement JWT authentication (status: in_progress)" | **task** |
|
|
80
|
-
| **WHY** was this bug introduced? | "Nested transaction bug: setDecision wraps in transaction, batch also wraps" | **decision** |
|
|
81
|
-
| **WHAT** is the completion status? | "Fixed nested transaction bug (status: done)" | **task** |
|
|
82
|
-
|
|
83
|
-
### Common Mistakes
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
// ❌ WRONG - Using decision for task completion
|
|
87
|
-
{
|
|
88
|
-
action: "set",
|
|
89
|
-
key: "jwt-implementation-complete",
|
|
90
|
-
value: "JWT authentication implemented. All tests passing."
|
|
91
|
-
}
|
|
92
|
-
// This is WHAT was done (completion status), not WHY decisions were made.
|
|
93
|
-
// FIX: Use task tool for tracking implementation progress.
|
|
94
|
-
|
|
95
|
-
// ✅ CORRECT - Using decision for architectural reasoning
|
|
96
|
-
{
|
|
97
|
-
action: "set",
|
|
98
|
-
key: "api/auth/jwt-choice",
|
|
99
|
-
value: "Chose JWT over sessions because: (1) Stateless design scales, (2) Mobile clients cache tokens, (3) Microservice auth requires distributed validation."
|
|
100
|
-
}
|
|
101
|
-
// This explains WHY JWT was chosen with architectural reasoning.
|
|
102
|
-
|
|
103
|
-
// ✅ CORRECT - Using task for work tracking
|
|
104
|
-
{
|
|
105
|
-
action: "create",
|
|
106
|
-
title: "Implement JWT authentication with refresh tokens",
|
|
107
|
-
status: "in_progress",
|
|
108
|
-
assigned_agent: "backend-agent"
|
|
109
|
-
}
|
|
110
|
-
// This tracks WHAT work is being done and its current status.
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
💡 **See [BEST_PRACTICES.md](BEST_PRACTICES.md#critical-what-to-store-in-decisions) for detailed examples of WHY vs WHAT.**
|
|
114
|
-
|
|
115
|
-
## Scenario-Based Tool Selection
|
|
116
|
-
|
|
117
|
-
### Scenario 1: Breaking API Change
|
|
118
|
-
|
|
119
|
-
```javascript
|
|
120
|
-
// 1. Record the decision (WHY the change was necessary)
|
|
121
|
-
{
|
|
122
|
-
action: "set",
|
|
123
|
-
key: "api/v2/versioning-decision",
|
|
124
|
-
value: "Moved /users to /v2/users because: (1) Enables backward compatibility via versioning, (2) Allows gradual client migration without breaking production apps, (3) Future API changes won't force all clients to update simultaneously. Trade-off: More complex routing layer, but necessary for production stability with 50+ client apps.",
|
|
125
|
-
layer: "presentation",
|
|
126
|
-
tags: ["api", "versioning", "architecture-decision"]
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// 2. Add a constraint (requirement going forward)
|
|
130
|
-
{
|
|
131
|
-
action: "add",
|
|
132
|
-
category: "architecture",
|
|
133
|
-
constraint_text: "All API endpoints must include version prefix",
|
|
134
|
-
layer: "presentation",
|
|
135
|
-
tags: ["api", "versioning"]
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 3. Create migration task
|
|
139
|
-
{
|
|
140
|
-
action: "create",
|
|
141
|
-
title: "Migrate clients to /v2/users endpoint",
|
|
142
|
-
status: "todo",
|
|
143
|
-
layer: "presentation",
|
|
144
|
-
tags: ["migration", "v2.0.0"]
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// 4. Notify other agents
|
|
148
|
-
{
|
|
149
|
-
action: "send",
|
|
150
|
-
from_agent: "api-agent",
|
|
151
|
-
msg_type: "warning",
|
|
152
|
-
message: "Breaking change: /users moved to /v2/users",
|
|
153
|
-
priority: "critical"
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Scenario 2: Performance Issue
|
|
158
|
-
|
|
159
|
-
```javascript
|
|
160
|
-
// 1. Record the analysis and solution decision (WHY this approach)
|
|
161
|
-
{
|
|
162
|
-
action: "set",
|
|
163
|
-
key: "db/user_sessions/index-strategy",
|
|
164
|
-
value: "Adding composite index (user_id, created_at DESC) to user_sessions table because: (1) Query analysis shows 300% latency increase from full table scans on 10M+ rows, (2) 95% of queries filter by user_id + sort by timestamp, (3) Index reduces query time from 850ms to <50ms in staging tests. Trade-off: 15% slower inserts and 200MB additional storage, but read performance critical for user experience.",
|
|
165
|
-
layer: "data",
|
|
166
|
-
tags: ["performance", "database", "indexing-strategy"]
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// 2. Add performance constraint
|
|
170
|
-
{
|
|
171
|
-
action: "add",
|
|
172
|
-
category: "performance",
|
|
173
|
-
constraint_text: "Database queries must complete within 50ms",
|
|
174
|
-
priority: "high",
|
|
175
|
-
layer: "data"
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// 3. Create optimization task
|
|
179
|
-
{
|
|
180
|
-
action: "create",
|
|
181
|
-
title: "Add indexes to user_sessions table",
|
|
182
|
-
status: "in_progress",
|
|
183
|
-
priority: 4,
|
|
184
|
-
layer: "data",
|
|
185
|
-
tags: ["performance", "database"]
|
|
186
|
-
}
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Scenario 3: Security Vulnerability
|
|
19
|
+
| Concept | Definition | Example |
|
|
20
|
+
|---------|------------|---------|
|
|
21
|
+
| **Decision** | A choice that WAS made | "We chose JWT authentication" |
|
|
22
|
+
| **Constraint** | A requirement that MUST be followed | "Response time must be <100ms" |
|
|
23
|
+
| **Task** | Work that NEEDS to be done | "Implement JWT authentication" |
|
|
190
24
|
|
|
191
|
-
|
|
192
|
-
// 1. Record the solution decision (WHY this mitigation approach)
|
|
193
|
-
{
|
|
194
|
-
action: "set",
|
|
195
|
-
key: "security/jwt/timing-attack-mitigation",
|
|
196
|
-
value: "Upgrading JWT library to v9.2.0+ and implementing constant-time comparison because: (1) CVE-2025-1234 timing attack allows token forgery via timing analysis, (2) Library v9.2.0+ includes constant-time string comparison preventing timing leaks, (3) Alternative approach (rewriting auth layer) would take 3 weeks vs 2-day upgrade. Trade-off: Breaking change requires updating all microservices, but security risk is critical and affects all user sessions.",
|
|
197
|
-
layer: "business",
|
|
198
|
-
tags: ["security", "authentication", "mitigation-strategy"]
|
|
199
|
-
}
|
|
25
|
+
## Decision vs Task: WHY vs WHAT
|
|
200
26
|
|
|
201
|
-
|
|
202
|
-
{
|
|
203
|
-
action: "add",
|
|
204
|
-
category: "security",
|
|
205
|
-
constraint_text: "All auth tokens must use constant-time comparison",
|
|
206
|
-
priority: "critical",
|
|
207
|
-
layer: "business"
|
|
208
|
-
}
|
|
27
|
+
**Critical**: `decision` = WHY (reasoning), `task` = WHAT (work status)
|
|
209
28
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
assigned_agent: "security-agent",
|
|
217
|
-
layer: "business"
|
|
218
|
-
}
|
|
29
|
+
| Question | Tool |
|
|
30
|
+
|----------|------|
|
|
31
|
+
| WHY did we choose this? | **decision** |
|
|
32
|
+
| WHAT needs to be done? | **task** |
|
|
33
|
+
| WHY was this bug introduced? | **decision** |
|
|
34
|
+
| WHAT is the completion status? | **task** |
|
|
219
35
|
|
|
220
|
-
|
|
221
|
-
{
|
|
222
|
-
action: "send",
|
|
223
|
-
from_agent: "security-agent",
|
|
224
|
-
to_agent: null, // Broadcast
|
|
225
|
-
msg_type: "warning",
|
|
226
|
-
message: "URGENT: Auth vulnerability found, fix in progress",
|
|
227
|
-
priority: "critical"
|
|
228
|
-
}
|
|
229
|
-
```
|
|
36
|
+
## Common Scenarios
|
|
230
37
|
|
|
231
|
-
|
|
38
|
+
**Breaking API Change:**
|
|
39
|
+
1. `decision` - Record WHY change was necessary with reasoning
|
|
40
|
+
2. `constraint` - Add requirement for version prefixes going forward
|
|
41
|
+
3. `task` - Create migration work item
|
|
42
|
+
4. `message` - Alert other agents
|
|
232
43
|
|
|
233
|
-
|
|
44
|
+
**Performance Issue:**
|
|
45
|
+
1. `decision` - Record analysis and WHY this solution
|
|
46
|
+
2. `constraint` - Add performance requirement
|
|
47
|
+
3. `task` - Create optimization work item
|
|
234
48
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
├─ Simple filters (status, layer, tags)?
|
|
241
|
-
│ └─> Use action: "list"
|
|
242
|
-
│
|
|
243
|
-
├─ Primarily by tags?
|
|
244
|
-
│ └─> Use action: "search_tags"
|
|
245
|
-
│ • match_mode: "AND" (all tags) or "OR" (any tag)
|
|
246
|
-
│
|
|
247
|
-
├─ Primarily by layer?
|
|
248
|
-
│ └─> Use action: "search_layer"
|
|
249
|
-
│
|
|
250
|
-
├─ Complex multi-filter query?
|
|
251
|
-
│ └─> Use action: "search_advanced"
|
|
252
|
-
│ • Multiple layers (OR)
|
|
253
|
-
│ • Tag combinations (AND/OR)
|
|
254
|
-
│ • Temporal filtering
|
|
255
|
-
│ • Full-text search
|
|
256
|
-
│ • Pagination
|
|
257
|
-
│
|
|
258
|
-
└─ Need version history?
|
|
259
|
-
└─> Use action: "versions"
|
|
260
|
-
```
|
|
49
|
+
**Security Vulnerability:**
|
|
50
|
+
1. `decision` - Record WHY this mitigation approach
|
|
51
|
+
2. `constraint` - Add security requirement
|
|
52
|
+
3. `task` - Create fix work item
|
|
53
|
+
4. `message` - Alert all agents
|
|
261
54
|
|
|
262
|
-
|
|
55
|
+
## Search Action Selection
|
|
263
56
|
|
|
264
|
-
| Action | Use
|
|
265
|
-
|
|
266
|
-
| **list** |
|
|
267
|
-
| **search_tags** | Tag-focused
|
|
268
|
-
| **search_layer** | Layer-focused
|
|
269
|
-
| **search_advanced** | Complex
|
|
270
|
-
| **versions** |
|
|
57
|
+
| Action | Use For |
|
|
58
|
+
|--------|---------|
|
|
59
|
+
| **list** | Simple status/layer/tag filters |
|
|
60
|
+
| **search_tags** | Tag-focused with AND/OR logic |
|
|
61
|
+
| **search_layer** | Layer-focused queries |
|
|
62
|
+
| **search_advanced** | Complex multi-filter, pagination, full-text |
|
|
63
|
+
| **versions** | Version history of specific decision |
|
|
271
64
|
|
|
272
65
|
---
|
|
273
66
|
|
|
274
67
|
## Related Documentation
|
|
275
68
|
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
69
|
+
- [TOOL_REFERENCE.md](TOOL_REFERENCE.md) - Parameter reference
|
|
70
|
+
- [WORKFLOWS.md](WORKFLOWS.md) - Multi-step workflows
|
|
71
|
+
- [BEST_PRACTICES.md](BEST_PRACTICES.md) - Common errors
|
|
72
|
+
- [SHARED_CONCEPTS.md](SHARED_CONCEPTS.md) - Layers, enums, concepts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sqlew",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "MCP server for efficient context sharing between Claude Code sub-agents with
|
|
3
|
+
"version": "3.6.1",
|
|
4
|
+
"description": "MCP server for efficient context sharing between Claude Code sub-agents with database-driven help system (60-70% token reduction), Kanban Task Watcher, Git-aware auto-complete, Decision Context, and streamlined documentation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -27,8 +27,17 @@
|
|
|
27
27
|
"clean": "rm -rf dist",
|
|
28
28
|
"rebuild": "npm run clean && npm run build",
|
|
29
29
|
"test": "npm run build && node --test dist/tests/tasks.dependencies.test.js",
|
|
30
|
+
"test:all-features": "npm run build && node dist/tests/all-features.test.js",
|
|
30
31
|
"test:migrations": "npm run build && node dist/tests/migrations/test-v3.2-migration.js",
|
|
31
|
-
"prepublishOnly": "npm run rebuild"
|
|
32
|
+
"prepublishOnly": "npm run rebuild",
|
|
33
|
+
"knex": "tsx node_modules/.bin/knex --knexfile src/knexfile.ts",
|
|
34
|
+
"migrate:make": "npm run knex migrate:make",
|
|
35
|
+
"migrate:latest": "npm run knex migrate:latest",
|
|
36
|
+
"migrate:rollback": "npm run knex migrate:rollback",
|
|
37
|
+
"migrate:rollback:all": "npm run knex migrate:rollback --all",
|
|
38
|
+
"migrate:status": "npm run knex migrate:status",
|
|
39
|
+
"seed:make": "npm run knex seed:make",
|
|
40
|
+
"seed:run": "npm run knex seed:run"
|
|
32
41
|
},
|
|
33
42
|
"engines": {
|
|
34
43
|
"node": ">=18.0.0"
|
|
@@ -59,11 +68,15 @@
|
|
|
59
68
|
"better-sqlite3": "^11.0.0",
|
|
60
69
|
"chokidar": "^4.0.3",
|
|
61
70
|
"ignore": "^7.0.5",
|
|
62
|
-
"
|
|
71
|
+
"knex": "^3.1.0",
|
|
72
|
+
"smol-toml": "^1.4.2",
|
|
73
|
+
"sqlite3": "^5.1.7"
|
|
63
74
|
},
|
|
64
75
|
"devDependencies": {
|
|
65
76
|
"@types/better-sqlite3": "^7.6.0",
|
|
77
|
+
"@types/knex": "^0.15.2",
|
|
66
78
|
"@types/node": "^20.0.0",
|
|
79
|
+
"tsx": "^4.20.6",
|
|
67
80
|
"typescript": "^5.0.0"
|
|
68
81
|
}
|
|
69
82
|
}
|