sqlew 5.1.0 → 5.2.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +2140 -2081
  2. package/LICENSE +190 -190
  3. package/NOTICE +24 -24
  4. package/README.md +204 -190
  5. package/dist/adapters/mysql-adapter.js +3 -3
  6. package/dist/adapters/postgresql-adapter.js +3 -3
  7. package/dist/cli/db-export.js +32 -32
  8. package/dist/cli/db-import.js +30 -30
  9. package/dist/cli/hooks/codex-transcript.d.ts +23 -0
  10. package/dist/cli/hooks/codex-transcript.d.ts.map +1 -0
  11. package/dist/cli/hooks/codex-transcript.js +134 -0
  12. package/dist/cli/hooks/codex-transcript.js.map +1 -0
  13. package/dist/cli/hooks/on-exit-plan.d.ts.map +1 -1
  14. package/dist/cli/hooks/on-exit-plan.js +72 -4
  15. package/dist/cli/hooks/on-exit-plan.js.map +1 -1
  16. package/dist/cli/hooks/on-prompt.d.ts.map +1 -1
  17. package/dist/cli/hooks/on-prompt.js +38 -16
  18. package/dist/cli/hooks/on-prompt.js.map +1 -1
  19. package/dist/cli/hooks/plan-processor.d.ts.map +1 -1
  20. package/dist/cli/hooks/plan-processor.js +16 -2
  21. package/dist/cli/hooks/plan-processor.js.map +1 -1
  22. package/dist/cli/hooks/pr-adr.js +5 -5
  23. package/dist/cli/hooks/stdin-parser.d.ts +43 -0
  24. package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
  25. package/dist/cli/hooks/stdin-parser.js +212 -6
  26. package/dist/cli/hooks/stdin-parser.js.map +1 -1
  27. package/dist/cli/hooks/track-plan.d.ts +13 -0
  28. package/dist/cli/hooks/track-plan.d.ts.map +1 -1
  29. package/dist/cli/hooks/track-plan.js +73 -18
  30. package/dist/cli/hooks/track-plan.js.map +1 -1
  31. package/dist/cli.js +48 -48
  32. package/dist/config/global-config.d.ts +7 -1
  33. package/dist/config/global-config.d.ts.map +1 -1
  34. package/dist/config/global-config.js +5 -26
  35. package/dist/config/global-config.js.map +1 -1
  36. package/dist/database/migrations/v4/20251126000000_v4_bootstrap.js +32 -32
  37. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.d.ts.map +1 -1
  38. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js +2 -1
  39. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js.map +1 -1
  40. package/dist/database/migrations/v4/20260102204000_v4_fix_decision_set_example.js +3 -3
  41. package/dist/help-data/constraint.toml +259 -259
  42. package/dist/help-data/decision.toml +845 -845
  43. package/dist/help-data/queue.toml +134 -134
  44. package/dist/server/tool-schemas.js +30 -30
  45. package/dist/tests/docker/native/db-init.js +9 -9
  46. package/dist/tests/unit/hooks/codex-hook-normalization.test.d.ts +7 -0
  47. package/dist/tests/unit/hooks/codex-hook-normalization.test.d.ts.map +1 -0
  48. package/dist/tests/unit/hooks/codex-hook-normalization.test.js +112 -0
  49. package/dist/tests/unit/hooks/codex-hook-normalization.test.js.map +1 -0
  50. package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts +9 -0
  51. package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts.map +1 -0
  52. package/dist/tests/unit/hooks/grok-hook-normalization.test.js +136 -0
  53. package/dist/tests/unit/hooks/grok-hook-normalization.test.js.map +1 -0
  54. package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts +7 -0
  55. package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts.map +1 -0
  56. package/dist/tests/unit/hooks/grok-plan-template-injection.test.js +55 -0
  57. package/dist/tests/unit/hooks/grok-plan-template-injection.test.js.map +1 -0
  58. package/dist/tests/utils/db-schema.js +48 -48
  59. package/dist/tests/utils/test-helpers.js +48 -48
  60. package/dist/tools/constraints/actions/get.js +5 -5
  61. package/dist/utils/path-normalize.d.ts +23 -0
  62. package/dist/utils/path-normalize.d.ts.map +1 -0
  63. package/dist/utils/path-normalize.js +38 -0
  64. package/dist/utils/path-normalize.js.map +1 -0
  65. package/dist/utils/project-root.d.ts +7 -3
  66. package/dist/utils/project-root.d.ts.map +1 -1
  67. package/dist/utils/project-root.js +17 -3
  68. package/dist/utils/project-root.js.map +1 -1
  69. package/dist/watcher/base-watcher.d.ts +0 -4
  70. package/dist/watcher/base-watcher.d.ts.map +1 -1
  71. package/dist/watcher/base-watcher.js +11 -22
  72. package/dist/watcher/base-watcher.js.map +1 -1
  73. package/docs/ADR_CONCEPTS.md +152 -152
  74. package/docs/CLI_USAGE.md +392 -392
  75. package/docs/CONFIGURATION.md +157 -157
  76. package/docs/CROSS_DATABASE.md +66 -66
  77. package/docs/DATABASE_AUTH.md +135 -135
  78. package/docs/HOOKS_GUIDE.md +116 -67
  79. package/docs/MIGRATION_TO_SAAS.md +176 -176
  80. package/docs/SHARED_DATABASE.md +108 -108
  81. package/package.json +88 -88
  82. package/scripts/copy-help-data.js +19 -19
  83. package/scripts/filter-test-output.js +78 -78
@@ -1,259 +1,259 @@
1
- # Constraint Tool - Architectural Rules
2
- # Define and manage project constraints with priorities
3
-
4
- [tool]
5
- name = "constraint"
6
- description = "Architectural Rules - Define and manage project constraints with priorities. Supports categories, layer associations, and tag filtering."
7
-
8
- # =============================================================================
9
- # ACTIONS
10
- # =============================================================================
11
-
12
- [[actions]]
13
- name = "add"
14
- description = "Add a new constraint with priority"
15
-
16
- [[actions.params]]
17
- name = "action"
18
- type = "string"
19
- required = true
20
- description = "Must be \"add\""
21
-
22
- [[actions.params]]
23
- name = "constraint_text"
24
- type = "string"
25
- required = true
26
- description = "Constraint rule text"
27
-
28
- [[actions.params]]
29
- name = "category"
30
- type = "string"
31
- required = true
32
- description = "Constraint category: architecture, security, code-style, performance"
33
-
34
- [[actions.params]]
35
- name = "priority"
36
- type = "string"
37
- required = false
38
- description = "Priority: low, medium, high, critical (or 1-4)"
39
- default = "medium"
40
-
41
- [[actions.params]]
42
- name = "layer"
43
- type = "string"
44
- required = false
45
- description = "Architecture layer this constraint applies to"
46
-
47
- [[actions.params]]
48
- name = "tags"
49
- type = "string[]"
50
- required = false
51
- description = "Tags for categorization"
52
- default = "[]"
53
-
54
- [[actions.examples]]
55
- title = "Add security constraint"
56
- code = '''
57
- {
58
- "action": "add",
59
- "constraint_text": "All API endpoints must require authentication",
60
- "category": "security",
61
- "priority": "critical",
62
- "layer": "presentation"
63
- }
64
- '''
65
- explanation = "Add a critical security constraint for API endpoints"
66
-
67
- [[actions.examples]]
68
- title = "Add code style constraint"
69
- code = '''
70
- {
71
- "action": "add",
72
- "constraint_text": "Use functional components with hooks instead of class components",
73
- "category": "code-style",
74
- "priority": "medium",
75
- "tags": ["react", "frontend"]
76
- }
77
- '''
78
- explanation = "Add a medium-priority coding style constraint"
79
-
80
- # -----------------------------------------------------------------------------
81
-
82
- [[actions]]
83
- name = "get"
84
- description = "Retrieve constraints with filtering"
85
-
86
- [[actions.params]]
87
- name = "action"
88
- type = "string"
89
- required = true
90
- description = "Must be \"get\""
91
-
92
- [[actions.params]]
93
- name = "category"
94
- type = "string"
95
- required = false
96
- description = "Filter by category"
97
-
98
- [[actions.params]]
99
- name = "layer"
100
- type = "string"
101
- required = false
102
- description = "Filter by layer"
103
-
104
- [[actions.params]]
105
- name = "priority"
106
- type = "string"
107
- required = false
108
- description = "Filter by priority: low, medium, high, critical (or 1-4)"
109
-
110
- [[actions.params]]
111
- name = "active_only"
112
- type = "boolean"
113
- required = false
114
- description = "Only return active constraints"
115
- default = "true"
116
-
117
- [[actions.examples]]
118
- title = "Get all security constraints"
119
- code = '''
120
- {
121
- "action": "get",
122
- "category": "security"
123
- }
124
- '''
125
- explanation = "Retrieve all security-related constraints"
126
-
127
- [[actions.examples]]
128
- title = "Get critical constraints"
129
- code = '''
130
- {
131
- "action": "get",
132
- "priority": "critical"
133
- }
134
- '''
135
- explanation = "Retrieve all critical constraints"
136
-
137
- # -----------------------------------------------------------------------------
138
-
139
- [[actions]]
140
- name = "deactivate"
141
- description = "Deactivate a constraint (soft delete)"
142
-
143
- [[actions.params]]
144
- name = "action"
145
- type = "string"
146
- required = true
147
- description = "Must be \"deactivate\""
148
-
149
- [[actions.params]]
150
- name = "id"
151
- type = "number | string"
152
- required = true
153
- description = "ID of the constraint (number for SQLite, UUID string for SaaS). constraint_id also accepted for backward compatibility"
154
-
155
- [[actions.examples]]
156
- title = "Deactivate constraint"
157
- target_type = "sqlite"
158
- code = '''
159
- {
160
- "action": "deactivate",
161
- "id": 5
162
- }
163
- '''
164
- explanation = "Soft-delete a constraint by ID (SQLite uses numeric IDs)"
165
-
166
- [[actions.examples]]
167
- title = "Deactivate constraint"
168
- target_type = "cloud"
169
- code = '''
170
- {
171
- "action": "deactivate",
172
- "id": "fbb982cc-764f-4427-b34a-7e758e31c457"
173
- }
174
- '''
175
- explanation = "Soft-delete a constraint by UUID (SaaS uses UUID strings)"
176
-
177
- # -----------------------------------------------------------------------------
178
-
179
- [[actions]]
180
- name = "suggest_pending"
181
- description = "Get AI-suggested constraints based on codebase analysis"
182
-
183
- [[actions.params]]
184
- name = "action"
185
- type = "string"
186
- required = true
187
- description = "Must be \"suggest_pending\""
188
-
189
- [[actions.examples]]
190
- title = "Get suggestions"
191
- code = '''
192
- {
193
- "action": "suggest_pending"
194
- }
195
- '''
196
- explanation = "View AI-suggested constraints that haven't been reviewed yet"
197
-
198
- # -----------------------------------------------------------------------------
199
-
200
- [[actions]]
201
- name = "help"
202
- description = "Get constraint tool documentation"
203
-
204
- [[actions.params]]
205
- name = "action"
206
- type = "string"
207
- required = true
208
- description = "Must be \"help\""
209
-
210
- [[actions.examples]]
211
- title = "Get help"
212
- code = '''
213
- {
214
- "action": "help"
215
- }
216
- '''
217
- explanation = "Display constraint tool documentation"
218
-
219
- # -----------------------------------------------------------------------------
220
-
221
- [[actions]]
222
- name = "example"
223
- description = "Get constraint tool examples"
224
-
225
- [[actions.params]]
226
- name = "action"
227
- type = "string"
228
- required = true
229
- description = "Must be \"example\""
230
-
231
- [[actions.examples]]
232
- title = "Get examples"
233
- code = '''
234
- {
235
- "action": "example"
236
- }
237
- '''
238
- explanation = "Display constraint tool usage examples"
239
-
240
- # -----------------------------------------------------------------------------
241
-
242
- [[actions]]
243
- name = "use_case"
244
- description = "Get constraint tool use cases"
245
-
246
- [[actions.params]]
247
- name = "action"
248
- type = "string"
249
- required = true
250
- description = "Must be \"use_case\""
251
-
252
- [[actions.examples]]
253
- title = "Get use cases"
254
- code = '''
255
- {
256
- "action": "use_case"
257
- }
258
- '''
259
- explanation = "Display constraint tool use case workflows"
1
+ # Constraint Tool - Architectural Rules
2
+ # Define and manage project constraints with priorities
3
+
4
+ [tool]
5
+ name = "constraint"
6
+ description = "Architectural Rules - Define and manage project constraints with priorities. Supports categories, layer associations, and tag filtering."
7
+
8
+ # =============================================================================
9
+ # ACTIONS
10
+ # =============================================================================
11
+
12
+ [[actions]]
13
+ name = "add"
14
+ description = "Add a new constraint with priority"
15
+
16
+ [[actions.params]]
17
+ name = "action"
18
+ type = "string"
19
+ required = true
20
+ description = "Must be \"add\""
21
+
22
+ [[actions.params]]
23
+ name = "constraint_text"
24
+ type = "string"
25
+ required = true
26
+ description = "Constraint rule text"
27
+
28
+ [[actions.params]]
29
+ name = "category"
30
+ type = "string"
31
+ required = true
32
+ description = "Constraint category: architecture, security, code-style, performance"
33
+
34
+ [[actions.params]]
35
+ name = "priority"
36
+ type = "string"
37
+ required = false
38
+ description = "Priority: low, medium, high, critical (or 1-4)"
39
+ default = "medium"
40
+
41
+ [[actions.params]]
42
+ name = "layer"
43
+ type = "string"
44
+ required = false
45
+ description = "Architecture layer this constraint applies to"
46
+
47
+ [[actions.params]]
48
+ name = "tags"
49
+ type = "string[]"
50
+ required = false
51
+ description = "Tags for categorization"
52
+ default = "[]"
53
+
54
+ [[actions.examples]]
55
+ title = "Add security constraint"
56
+ code = '''
57
+ {
58
+ "action": "add",
59
+ "constraint_text": "All API endpoints must require authentication",
60
+ "category": "security",
61
+ "priority": "critical",
62
+ "layer": "presentation"
63
+ }
64
+ '''
65
+ explanation = "Add a critical security constraint for API endpoints"
66
+
67
+ [[actions.examples]]
68
+ title = "Add code style constraint"
69
+ code = '''
70
+ {
71
+ "action": "add",
72
+ "constraint_text": "Use functional components with hooks instead of class components",
73
+ "category": "code-style",
74
+ "priority": "medium",
75
+ "tags": ["react", "frontend"]
76
+ }
77
+ '''
78
+ explanation = "Add a medium-priority coding style constraint"
79
+
80
+ # -----------------------------------------------------------------------------
81
+
82
+ [[actions]]
83
+ name = "get"
84
+ description = "Retrieve constraints with filtering"
85
+
86
+ [[actions.params]]
87
+ name = "action"
88
+ type = "string"
89
+ required = true
90
+ description = "Must be \"get\""
91
+
92
+ [[actions.params]]
93
+ name = "category"
94
+ type = "string"
95
+ required = false
96
+ description = "Filter by category"
97
+
98
+ [[actions.params]]
99
+ name = "layer"
100
+ type = "string"
101
+ required = false
102
+ description = "Filter by layer"
103
+
104
+ [[actions.params]]
105
+ name = "priority"
106
+ type = "string"
107
+ required = false
108
+ description = "Filter by priority: low, medium, high, critical (or 1-4)"
109
+
110
+ [[actions.params]]
111
+ name = "active_only"
112
+ type = "boolean"
113
+ required = false
114
+ description = "Only return active constraints"
115
+ default = "true"
116
+
117
+ [[actions.examples]]
118
+ title = "Get all security constraints"
119
+ code = '''
120
+ {
121
+ "action": "get",
122
+ "category": "security"
123
+ }
124
+ '''
125
+ explanation = "Retrieve all security-related constraints"
126
+
127
+ [[actions.examples]]
128
+ title = "Get critical constraints"
129
+ code = '''
130
+ {
131
+ "action": "get",
132
+ "priority": "critical"
133
+ }
134
+ '''
135
+ explanation = "Retrieve all critical constraints"
136
+
137
+ # -----------------------------------------------------------------------------
138
+
139
+ [[actions]]
140
+ name = "deactivate"
141
+ description = "Deactivate a constraint (soft delete)"
142
+
143
+ [[actions.params]]
144
+ name = "action"
145
+ type = "string"
146
+ required = true
147
+ description = "Must be \"deactivate\""
148
+
149
+ [[actions.params]]
150
+ name = "id"
151
+ type = "number | string"
152
+ required = true
153
+ description = "ID of the constraint (number for SQLite, UUID string for SaaS). constraint_id also accepted for backward compatibility"
154
+
155
+ [[actions.examples]]
156
+ title = "Deactivate constraint"
157
+ target_type = "sqlite"
158
+ code = '''
159
+ {
160
+ "action": "deactivate",
161
+ "id": 5
162
+ }
163
+ '''
164
+ explanation = "Soft-delete a constraint by ID (SQLite uses numeric IDs)"
165
+
166
+ [[actions.examples]]
167
+ title = "Deactivate constraint"
168
+ target_type = "cloud"
169
+ code = '''
170
+ {
171
+ "action": "deactivate",
172
+ "id": "fbb982cc-764f-4427-b34a-7e758e31c457"
173
+ }
174
+ '''
175
+ explanation = "Soft-delete a constraint by UUID (SaaS uses UUID strings)"
176
+
177
+ # -----------------------------------------------------------------------------
178
+
179
+ [[actions]]
180
+ name = "suggest_pending"
181
+ description = "Get AI-suggested constraints based on codebase analysis"
182
+
183
+ [[actions.params]]
184
+ name = "action"
185
+ type = "string"
186
+ required = true
187
+ description = "Must be \"suggest_pending\""
188
+
189
+ [[actions.examples]]
190
+ title = "Get suggestions"
191
+ code = '''
192
+ {
193
+ "action": "suggest_pending"
194
+ }
195
+ '''
196
+ explanation = "View AI-suggested constraints that haven't been reviewed yet"
197
+
198
+ # -----------------------------------------------------------------------------
199
+
200
+ [[actions]]
201
+ name = "help"
202
+ description = "Get constraint tool documentation"
203
+
204
+ [[actions.params]]
205
+ name = "action"
206
+ type = "string"
207
+ required = true
208
+ description = "Must be \"help\""
209
+
210
+ [[actions.examples]]
211
+ title = "Get help"
212
+ code = '''
213
+ {
214
+ "action": "help"
215
+ }
216
+ '''
217
+ explanation = "Display constraint tool documentation"
218
+
219
+ # -----------------------------------------------------------------------------
220
+
221
+ [[actions]]
222
+ name = "example"
223
+ description = "Get constraint tool examples"
224
+
225
+ [[actions.params]]
226
+ name = "action"
227
+ type = "string"
228
+ required = true
229
+ description = "Must be \"example\""
230
+
231
+ [[actions.examples]]
232
+ title = "Get examples"
233
+ code = '''
234
+ {
235
+ "action": "example"
236
+ }
237
+ '''
238
+ explanation = "Display constraint tool usage examples"
239
+
240
+ # -----------------------------------------------------------------------------
241
+
242
+ [[actions]]
243
+ name = "use_case"
244
+ description = "Get constraint tool use cases"
245
+
246
+ [[actions.params]]
247
+ name = "action"
248
+ type = "string"
249
+ required = true
250
+ description = "Must be \"use_case\""
251
+
252
+ [[actions.examples]]
253
+ title = "Get use cases"
254
+ code = '''
255
+ {
256
+ "action": "use_case"
257
+ }
258
+ '''
259
+ explanation = "Display constraint tool use case workflows"