sqlew 5.2.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 (57) hide show
  1. package/CHANGELOG.md +2140 -2110
  2. package/LICENSE +190 -190
  3. package/NOTICE +24 -24
  4. package/README.md +204 -199
  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 +30 -3
  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 +33 -16
  18. package/dist/cli/hooks/on-prompt.js.map +1 -1
  19. package/dist/cli/hooks/pr-adr.js +5 -5
  20. package/dist/cli/hooks/stdin-parser.d.ts +4 -2
  21. package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
  22. package/dist/cli/hooks/stdin-parser.js +79 -9
  23. package/dist/cli/hooks/stdin-parser.js.map +1 -1
  24. package/dist/cli/hooks/track-plan.js +15 -15
  25. package/dist/cli.js +48 -48
  26. package/dist/config/global-config.js +19 -19
  27. package/dist/database/migrations/v4/20251126000000_v4_bootstrap.js +32 -32
  28. package/dist/database/migrations/v4/20260102204000_v4_fix_decision_set_example.js +3 -3
  29. package/dist/help-data/constraint.toml +259 -259
  30. package/dist/help-data/decision.toml +845 -845
  31. package/dist/help-data/queue.toml +134 -134
  32. package/dist/server/tool-schemas.js +30 -30
  33. package/dist/tests/docker/native/db-init.js +9 -9
  34. package/dist/tests/unit/hooks/codex-hook-normalization.test.d.ts +7 -0
  35. package/dist/tests/unit/hooks/codex-hook-normalization.test.d.ts.map +1 -0
  36. package/dist/tests/unit/hooks/codex-hook-normalization.test.js +112 -0
  37. package/dist/tests/unit/hooks/codex-hook-normalization.test.js.map +1 -0
  38. package/dist/tests/unit/hooks/grok-hook-normalization.test.js +45 -7
  39. package/dist/tests/unit/hooks/grok-hook-normalization.test.js.map +1 -1
  40. package/dist/tests/utils/db-schema.js +48 -48
  41. package/dist/tests/utils/test-helpers.js +48 -48
  42. package/dist/tools/constraints/actions/get.js +5 -5
  43. package/dist/utils/project-root.d.ts +1 -0
  44. package/dist/utils/project-root.d.ts.map +1 -1
  45. package/dist/utils/project-root.js +6 -0
  46. package/dist/utils/project-root.js.map +1 -1
  47. package/docs/ADR_CONCEPTS.md +152 -152
  48. package/docs/CLI_USAGE.md +392 -392
  49. package/docs/CONFIGURATION.md +157 -157
  50. package/docs/CROSS_DATABASE.md +66 -66
  51. package/docs/DATABASE_AUTH.md +135 -135
  52. package/docs/HOOKS_GUIDE.md +116 -101
  53. package/docs/MIGRATION_TO_SAAS.md +176 -176
  54. package/docs/SHARED_DATABASE.md +108 -108
  55. package/package.json +88 -88
  56. package/scripts/copy-help-data.js +19 -19
  57. 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"