@cleocode/core 2026.3.45 → 2026.3.46

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 (137) hide show
  1. package/dist/bootstrap.d.ts.map +1 -1
  2. package/dist/index.js +1475 -372
  3. package/dist/index.js.map +4 -4
  4. package/dist/init.d.ts.map +1 -1
  5. package/dist/injection.d.ts +1 -1
  6. package/dist/injection.d.ts.map +1 -1
  7. package/dist/routing/capability-matrix.d.ts +6 -4
  8. package/dist/routing/capability-matrix.d.ts.map +1 -1
  9. package/dist/scaffold.d.ts +16 -9
  10. package/dist/scaffold.d.ts.map +1 -1
  11. package/dist/skills/agents/install.d.ts.map +1 -1
  12. package/dist/skills/routing-table.d.ts +17 -16
  13. package/dist/skills/routing-table.d.ts.map +1 -1
  14. package/dist/skills/skill-paths.d.ts.map +1 -1
  15. package/dist/system/health.d.ts.map +1 -1
  16. package/dist/ui/index.d.ts +0 -1
  17. package/dist/ui/index.d.ts.map +1 -1
  18. package/package.json +9 -4
  19. package/schemas/adr-frontmatter.schema.json +72 -0
  20. package/schemas/agent-configs.schema.json +120 -0
  21. package/schemas/agent-registry.json +243 -0
  22. package/schemas/agent-registry.schema.json +132 -0
  23. package/schemas/archive/research-manifest.schema.json +257 -0
  24. package/schemas/archive.schema.json +450 -0
  25. package/schemas/brain-decision.schema.json +69 -0
  26. package/schemas/brain-learning.schema.json +57 -0
  27. package/schemas/brain-pattern.schema.json +72 -0
  28. package/schemas/config.schema.json +2606 -0
  29. package/schemas/context-state.schema.json +137 -0
  30. package/schemas/contribution.schema.json +722 -0
  31. package/schemas/critical-path.schema.json +246 -0
  32. package/schemas/deps-cache.schema.json +97 -0
  33. package/schemas/doctor-output.schema.json +283 -0
  34. package/schemas/error.schema.json +161 -0
  35. package/schemas/export-package.schema.json +375 -0
  36. package/schemas/global-config.schema.json +219 -0
  37. package/schemas/grade.schema.json +49 -0
  38. package/schemas/log.schema.json +250 -0
  39. package/schemas/metrics.schema.json +328 -0
  40. package/schemas/migrations.schema.json +150 -0
  41. package/schemas/nexus-registry.schema.json +90 -0
  42. package/schemas/operation-constitution.schema.json +438 -0
  43. package/schemas/output.schema.json +164 -0
  44. package/schemas/project-context.schema.json +164 -0
  45. package/schemas/project-info.schema.json +180 -0
  46. package/schemas/projects-registry.schema.json +107 -0
  47. package/schemas/protocol-frontmatter.schema.json +72 -0
  48. package/schemas/rcasd-consensus-report.schema.json +10 -0
  49. package/schemas/rcasd-evidence.schema.json +42 -0
  50. package/schemas/rcasd-gate-result.schema.json +46 -0
  51. package/schemas/rcasd-hitl-resolution.schema.json +10 -0
  52. package/schemas/rcasd-index.schema.json +10 -0
  53. package/schemas/rcasd-manifest.schema.json +10 -0
  54. package/schemas/rcasd-research-output.schema.json +10 -0
  55. package/schemas/rcasd-spec-frontmatter.schema.json +10 -0
  56. package/schemas/rcasd-stage-transition.schema.json +38 -0
  57. package/schemas/releases.schema.json +267 -0
  58. package/schemas/skills-manifest.schema.json +91 -0
  59. package/schemas/skillsmp.schema.json +208 -0
  60. package/schemas/spec-index.schema.json +196 -0
  61. package/schemas/system-flow-atlas.schema.json +125 -0
  62. package/src/__tests__/injection-chain.test.ts +11 -10
  63. package/src/__tests__/injection-mvi-tiers.test.ts +4 -2
  64. package/src/agents/__tests__/capacity.test.d.ts +7 -0
  65. package/src/agents/__tests__/capacity.test.d.ts.map +1 -0
  66. package/src/agents/__tests__/capacity.test.js +173 -0
  67. package/src/agents/__tests__/capacity.test.js.map +1 -0
  68. package/src/agents/__tests__/registry.test.d.ts +8 -0
  69. package/src/agents/__tests__/registry.test.d.ts.map +1 -0
  70. package/src/agents/__tests__/registry.test.js +348 -0
  71. package/src/agents/__tests__/registry.test.js.map +1 -0
  72. package/src/agents/__tests__/retry.test.d.ts +7 -0
  73. package/src/agents/__tests__/retry.test.d.ts.map +1 -0
  74. package/src/agents/__tests__/retry.test.js +225 -0
  75. package/src/agents/__tests__/retry.test.js.map +1 -0
  76. package/src/bootstrap.ts +3 -1
  77. package/src/init.ts +63 -18
  78. package/src/injection.ts +11 -5
  79. package/src/intelligence/__tests__/impact.test.d.ts +15 -0
  80. package/src/intelligence/__tests__/impact.test.d.ts.map +1 -0
  81. package/src/intelligence/__tests__/impact.test.js +384 -0
  82. package/src/intelligence/__tests__/impact.test.js.map +1 -0
  83. package/src/intelligence/__tests__/patterns.test.d.ts +8 -0
  84. package/src/intelligence/__tests__/patterns.test.d.ts.map +1 -0
  85. package/src/intelligence/__tests__/patterns.test.js +370 -0
  86. package/src/intelligence/__tests__/patterns.test.js.map +1 -0
  87. package/src/intelligence/__tests__/prediction.test.d.ts +8 -0
  88. package/src/intelligence/__tests__/prediction.test.d.ts.map +1 -0
  89. package/src/intelligence/__tests__/prediction.test.js +314 -0
  90. package/src/intelligence/__tests__/prediction.test.js.map +1 -0
  91. package/src/nexus/__tests__/nexus-e2e.test.d.ts +12 -0
  92. package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +1 -0
  93. package/src/nexus/__tests__/nexus-e2e.test.js +1220 -0
  94. package/src/nexus/__tests__/nexus-e2e.test.js.map +1 -0
  95. package/src/nexus/__tests__/transfer.test.d.ts +8 -0
  96. package/src/nexus/__tests__/transfer.test.d.ts.map +1 -0
  97. package/src/nexus/__tests__/transfer.test.js +372 -0
  98. package/src/nexus/__tests__/transfer.test.js.map +1 -0
  99. package/src/nexus/__tests__/transfer.test.ts +1 -1
  100. package/src/routing/capability-matrix.ts +1435 -205
  101. package/src/scaffold.ts +18 -11
  102. package/src/skills/__tests__/routing-table.test.ts +53 -33
  103. package/src/skills/agents/install.ts +9 -1
  104. package/src/skills/routing-table.ts +39 -253
  105. package/src/skills/skill-paths.ts +3 -2
  106. package/src/store/__tests__/project-detect.test.ts +1 -1
  107. package/src/system/health.ts +18 -7
  108. package/src/ui/index.ts +0 -6
  109. package/src/validation/operation-gate-validators.ts +2 -2
  110. package/templates/CLEO-INJECTION.md +120 -0
  111. package/templates/README.md +29 -0
  112. package/templates/agent-registry.json +305 -0
  113. package/templates/cleo-gitignore +74 -0
  114. package/templates/config.template.json +187 -0
  115. package/templates/git-hooks/commit-msg +149 -0
  116. package/templates/git-hooks/pre-commit +40 -0
  117. package/templates/git-hooks/pre-push +79 -0
  118. package/templates/github/ISSUE_TEMPLATE/bug_report.yml +143 -0
  119. package/templates/github/ISSUE_TEMPLATE/config.yml +8 -0
  120. package/templates/github/ISSUE_TEMPLATE/feature_request.yml +125 -0
  121. package/templates/github/ISSUE_TEMPLATE/help_question.yml +99 -0
  122. package/templates/global-config.template.json +56 -0
  123. package/templates/hooks/precompact-safestop.sh +89 -0
  124. package/templates/issue-templates/bug_report.yml +143 -0
  125. package/templates/issue-templates/config.yml +8 -0
  126. package/templates/issue-templates/feature_request.yml +125 -0
  127. package/templates/issue-templates/help_question.yml +99 -0
  128. package/templates/skillsmp.json.example +28 -0
  129. package/templates/skillsmp.json.example.md +214 -0
  130. package/dist/ui/injection-legacy.d.ts +0 -26
  131. package/dist/ui/injection-legacy.d.ts.map +0 -1
  132. package/src/ui/__tests__/injection-registry.test.d.ts +0 -11
  133. package/src/ui/__tests__/injection-registry.test.d.ts.map +0 -1
  134. package/src/ui/__tests__/injection-registry.test.js +0 -46
  135. package/src/ui/__tests__/injection-registry.test.js.map +0 -1
  136. package/src/ui/__tests__/injection-registry.test.ts +0 -57
  137. package/src/ui/injection-legacy.ts +0 -44
@@ -0,0 +1,438 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "CLEO Operation Constitution",
4
+ "description": "Validates the complete CLEO Operation Constitution document including the full registry, gateway matrices, and domain tables",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "metadata", "registry", "gateways", "domains"],
7
+ "additionalProperties": false,
8
+ "definitions": {
9
+ "Gateway": {
10
+ "type": "string",
11
+ "enum": ["query", "mutate"],
12
+ "description": "CQRS gateway: read-only queries or state-changing mutations"
13
+ },
14
+ "CanonicalDomain": {
15
+ "type": "string",
16
+ "enum": ["tasks", "session", "memory", "check", "pipeline", "orchestrate", "tools", "admin", "nexus", "sticky"],
17
+ "description": "One of 10 canonical CLEO domains"
18
+ },
19
+ "Tier": {
20
+ "type": "integer",
21
+ "enum": [0, 1, 2],
22
+ "description": "Progressive disclosure tier: 0=basic, 1=extended, 2=full"
23
+ },
24
+ "ParamDef": {
25
+ "type": "object",
26
+ "required": ["name", "type", "required", "description"],
27
+ "properties": {
28
+ "name": {
29
+ "type": "string",
30
+ "pattern": "^[a-zA-Z][a-zA-Z0-9]*$",
31
+ "description": "Canonical camelCase parameter name"
32
+ },
33
+ "type": {
34
+ "type": "string",
35
+ "enum": ["string", "number", "boolean", "array"],
36
+ "description": "Runtime value type"
37
+ },
38
+ "required": {
39
+ "type": "boolean",
40
+ "description": "Whether parameter is required"
41
+ },
42
+ "description": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "description": "Human-readable description"
46
+ },
47
+ "cli": {
48
+ "type": "object",
49
+ "properties": {
50
+ "positional": { "type": "boolean" },
51
+ "short": { "type": "string", "pattern": "^-[a-zA-Z]$" },
52
+ "flag": { "type": "string" },
53
+ "variadic": { "type": "boolean" }
54
+ },
55
+ "additionalProperties": false
56
+ },
57
+ "mcp": {
58
+ "type": "object",
59
+ "properties": {
60
+ "hidden": { "type": "boolean" },
61
+ "enum": {
62
+ "type": "array",
63
+ "items": { "type": "string" }
64
+ }
65
+ },
66
+ "additionalProperties": false
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ },
71
+ "OperationDef": {
72
+ "type": "object",
73
+ "required": ["gateway", "domain", "operation", "description", "tier", "idempotent", "sessionRequired", "requiredParams"],
74
+ "properties": {
75
+ "gateway": { "$ref": "#/definitions/Gateway" },
76
+ "domain": { "$ref": "#/definitions/CanonicalDomain" },
77
+ "operation": {
78
+ "type": "string",
79
+ "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$",
80
+ "description": "Dot-notation operation name (e.g. 'show', 'stage.validate')"
81
+ },
82
+ "description": {
83
+ "type": "string",
84
+ "minLength": 1,
85
+ "description": "Brief human-readable description of the operation"
86
+ },
87
+ "tier": { "$ref": "#/definitions/Tier" },
88
+ "idempotent": {
89
+ "type": "boolean",
90
+ "description": "Whether the operation is safe to retry without side effects"
91
+ },
92
+ "sessionRequired": {
93
+ "type": "boolean",
94
+ "description": "Whether the operation requires an active session"
95
+ },
96
+ "requiredParams": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "string",
100
+ "pattern": "^[a-zA-Z][a-zA-Z0-9]*$"
101
+ },
102
+ "description": "Parameter keys that MUST be present in the request"
103
+ },
104
+ "params": {
105
+ "type": "array",
106
+ "items": { "$ref": "#/definitions/ParamDef" },
107
+ "description": "Full parameter descriptors (optional, replaces requiredParams when populated)"
108
+ },
109
+ "aliases": {
110
+ "type": "array",
111
+ "items": {
112
+ "type": "string",
113
+ "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
114
+ },
115
+ "description": "Backward-compatible operation name aliases"
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ }
120
+ },
121
+ "properties": {
122
+ "schemaVersion": {
123
+ "type": "string",
124
+ "pattern": "^\\d{4}\\.\\d+\\.\\d+$",
125
+ "description": "Constitution schema version (e.g. '2026.3.3')"
126
+ },
127
+ "metadata": {
128
+ "type": "object",
129
+ "required": ["version", "status", "date", "totalOperations", "gateways", "domains"],
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "version": {
133
+ "type": "string",
134
+ "description": "Constitution document version"
135
+ },
136
+ "status": {
137
+ "type": "string",
138
+ "enum": ["DRAFT", "APPROVED", "DEPRECATED"],
139
+ "description": "Constitution approval status"
140
+ },
141
+ "date": {
142
+ "type": "string",
143
+ "format": "date",
144
+ "description": "Constitution approval date (ISO 8601)"
145
+ },
146
+ "task": {
147
+ "type": "string",
148
+ "pattern": "^T\\d+$",
149
+ "description": "Associated task ID (e.g. 'T5241')"
150
+ },
151
+ "supersedes": {
152
+ "type": "string",
153
+ "description": "Document this constitution supersedes"
154
+ },
155
+ "totalOperations": {
156
+ "type": "integer",
157
+ "minimum": 1,
158
+ "description": "Total number of operations in registry"
159
+ },
160
+ "gateways": {
161
+ "type": "object",
162
+ "required": ["query", "mutate"],
163
+ "additionalProperties": false,
164
+ "properties": {
165
+ "query": {
166
+ "type": "integer",
167
+ "minimum": 0,
168
+ "description": "Number of query operations"
169
+ },
170
+ "mutate": {
171
+ "type": "integer",
172
+ "minimum": 0,
173
+ "description": "Number of mutate operations"
174
+ }
175
+ }
176
+ },
177
+ "domains": {
178
+ "type": "object",
179
+ "required": ["count", "names"],
180
+ "additionalProperties": false,
181
+ "properties": {
182
+ "count": {
183
+ "type": "integer",
184
+ "minimum": 1,
185
+ "maximum": 10,
186
+ "description": "Number of canonical domains"
187
+ },
188
+ "names": {
189
+ "type": "array",
190
+ "items": { "$ref": "#/definitions/CanonicalDomain" },
191
+ "minItems": 10,
192
+ "maxItems": 10,
193
+ "description": "List of all canonical domain names"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "registry": {
200
+ "type": "object",
201
+ "required": ["operations"],
202
+ "additionalProperties": false,
203
+ "properties": {
204
+ "operations": {
205
+ "type": "array",
206
+ "items": { "$ref": "#/definitions/OperationDef" },
207
+ "minItems": 1,
208
+ "description": "All 207 operations in the registry"
209
+ }
210
+ }
211
+ },
212
+ "gateways": {
213
+ "type": "object",
214
+ "required": ["query", "mutate"],
215
+ "additionalProperties": false,
216
+ "properties": {
217
+ "query": {
218
+ "type": "object",
219
+ "required": ["matrix", "operations"],
220
+ "additionalProperties": false,
221
+ "properties": {
222
+ "matrix": {
223
+ "type": "object",
224
+ "description": "Query gateway matrix: domain -> operations[]",
225
+ "patternProperties": {
226
+ "^(tasks|session|memory|check|pipeline|orchestrate|tools|admin|nexus|sticky)$": {
227
+ "type": "array",
228
+ "items": {
229
+ "type": "string",
230
+ "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
231
+ }
232
+ }
233
+ },
234
+ "additionalProperties": false
235
+ },
236
+ "operations": {
237
+ "type": "array",
238
+ "items": { "$ref": "#/definitions/OperationDef" },
239
+ "description": "All query operations"
240
+ }
241
+ }
242
+ },
243
+ "mutate": {
244
+ "type": "object",
245
+ "required": ["matrix", "operations"],
246
+ "additionalProperties": false,
247
+ "properties": {
248
+ "matrix": {
249
+ "type": "object",
250
+ "description": "Mutate gateway matrix: domain -> operations[]",
251
+ "patternProperties": {
252
+ "^(tasks|session|memory|check|pipeline|orchestrate|tools|admin|nexus|sticky)$": {
253
+ "type": "array",
254
+ "items": {
255
+ "type": "string",
256
+ "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
257
+ }
258
+ }
259
+ },
260
+ "additionalProperties": false
261
+ },
262
+ "operations": {
263
+ "type": "array",
264
+ "items": { "$ref": "#/definitions/OperationDef" },
265
+ "description": "All mutate operations"
266
+ }
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "domains": {
272
+ "type": "object",
273
+ "description": "Domain tables: operations grouped by domain",
274
+ "required": ["tasks", "session", "memory", "check", "pipeline", "orchestrate", "tools", "admin", "nexus", "sticky"],
275
+ "additionalProperties": false,
276
+ "properties": {
277
+ "tasks": {
278
+ "type": "object",
279
+ "required": ["name", "purpose", "operations"],
280
+ "properties": {
281
+ "name": { "const": "tasks" },
282
+ "purpose": { "type": "string" },
283
+ "primaryStore": { "type": "string" },
284
+ "operations": {
285
+ "type": "array",
286
+ "items": { "$ref": "#/definitions/OperationDef" }
287
+ }
288
+ }
289
+ },
290
+ "session": {
291
+ "type": "object",
292
+ "required": ["name", "purpose", "operations"],
293
+ "properties": {
294
+ "name": { "const": "session" },
295
+ "purpose": { "type": "string" },
296
+ "primaryStore": { "type": "string" },
297
+ "operations": {
298
+ "type": "array",
299
+ "items": { "$ref": "#/definitions/OperationDef" }
300
+ }
301
+ }
302
+ },
303
+ "memory": {
304
+ "type": "object",
305
+ "required": ["name", "purpose", "operations"],
306
+ "properties": {
307
+ "name": { "const": "memory" },
308
+ "purpose": { "type": "string" },
309
+ "primaryStore": { "type": "string" },
310
+ "operations": {
311
+ "type": "array",
312
+ "items": { "$ref": "#/definitions/OperationDef" }
313
+ }
314
+ }
315
+ },
316
+ "check": {
317
+ "type": "object",
318
+ "required": ["name", "purpose", "operations"],
319
+ "properties": {
320
+ "name": { "const": "check" },
321
+ "purpose": { "type": "string" },
322
+ "primaryStore": { "type": "string" },
323
+ "operations": {
324
+ "type": "array",
325
+ "items": { "$ref": "#/definitions/OperationDef" }
326
+ }
327
+ }
328
+ },
329
+ "pipeline": {
330
+ "type": "object",
331
+ "required": ["name", "purpose", "operations"],
332
+ "properties": {
333
+ "name": { "const": "pipeline" },
334
+ "purpose": { "type": "string" },
335
+ "primaryStore": { "type": "string" },
336
+ "operations": {
337
+ "type": "array",
338
+ "items": { "$ref": "#/definitions/OperationDef" }
339
+ }
340
+ }
341
+ },
342
+ "orchestrate": {
343
+ "type": "object",
344
+ "required": ["name", "purpose", "operations"],
345
+ "properties": {
346
+ "name": { "const": "orchestrate" },
347
+ "purpose": { "type": "string" },
348
+ "primaryStore": { "type": "string" },
349
+ "operations": {
350
+ "type": "array",
351
+ "items": { "$ref": "#/definitions/OperationDef" }
352
+ }
353
+ }
354
+ },
355
+ "tools": {
356
+ "type": "object",
357
+ "required": ["name", "purpose", "operations"],
358
+ "properties": {
359
+ "name": { "const": "tools" },
360
+ "purpose": { "type": "string" },
361
+ "primaryStore": { "type": "string" },
362
+ "operations": {
363
+ "type": "array",
364
+ "items": { "$ref": "#/definitions/OperationDef" }
365
+ }
366
+ }
367
+ },
368
+ "admin": {
369
+ "type": "object",
370
+ "required": ["name", "purpose", "operations"],
371
+ "properties": {
372
+ "name": { "const": "admin" },
373
+ "purpose": { "type": "string" },
374
+ "primaryStore": { "type": "string" },
375
+ "operations": {
376
+ "type": "array",
377
+ "items": { "$ref": "#/definitions/OperationDef" }
378
+ }
379
+ }
380
+ },
381
+ "nexus": {
382
+ "type": "object",
383
+ "required": ["name", "purpose", "operations"],
384
+ "properties": {
385
+ "name": { "const": "nexus" },
386
+ "purpose": { "type": "string" },
387
+ "primaryStore": { "type": "string" },
388
+ "operations": {
389
+ "type": "array",
390
+ "items": { "$ref": "#/definitions/OperationDef" }
391
+ }
392
+ }
393
+ },
394
+ "sticky": {
395
+ "type": "object",
396
+ "required": ["name", "purpose", "operations"],
397
+ "properties": {
398
+ "name": { "const": "sticky" },
399
+ "purpose": { "type": "string" },
400
+ "primaryStore": { "type": "string" },
401
+ "operations": {
402
+ "type": "array",
403
+ "items": { "$ref": "#/definitions/OperationDef" }
404
+ }
405
+ }
406
+ }
407
+ }
408
+ },
409
+ "progressiveDisclosure": {
410
+ "type": "object",
411
+ "description": "Progressive disclosure contract by tier",
412
+ "properties": {
413
+ "tiers": {
414
+ "type": "array",
415
+ "minItems": 3,
416
+ "maxItems": 3,
417
+ "items": {
418
+ "type": "object",
419
+ "required": ["tier", "name", "description", "operationCount", "domains"],
420
+ "properties": {
421
+ "tier": { "$ref": "#/definitions/Tier" },
422
+ "name": {
423
+ "type": "string",
424
+ "enum": ["Core", "Extended", "Full System"]
425
+ },
426
+ "description": { "type": "string" },
427
+ "operationCount": { "type": "integer", "minimum": 0 },
428
+ "domains": {
429
+ "type": "array",
430
+ "items": { "$ref": "#/definitions/CanonicalDomain" }
431
+ }
432
+ }
433
+ }
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
@@ -0,0 +1,164 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "schemaVersion": "1.0.0",
4
+ "$id": "https://cleo-dev.com/schemas/v1/output.schema.json",
5
+ "title": "CLEO Response Envelope",
6
+ "description": "Standard JSON envelope for all successful cleo command responses",
7
+ "type": "object",
8
+ "required": ["_meta", "success"],
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string",
12
+ "description": "Schema URL for validation",
13
+ "const": "https://cleo-dev.com/schemas/v1/output.schema.json"
14
+ },
15
+ "_meta": {
16
+ "type": "object",
17
+ "description": "Response metadata",
18
+ "required": ["command", "timestamp", "version"],
19
+ "properties": {
20
+ "format": {
21
+ "type": "string",
22
+ "const": "json",
23
+ "description": "Output format identifier"
24
+ },
25
+ "version": {
26
+ "type": "string",
27
+ "pattern": "^\\d+\\.\\d+\\.\\d+",
28
+ "description": "cleo version (semver)"
29
+ },
30
+ "command": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "description": "Command name that generated this response"
34
+ },
35
+ "timestamp": {
36
+ "type": "string",
37
+ "format": "date-time",
38
+ "description": "ISO-8601 UTC timestamp of response generation"
39
+ },
40
+ "checksum": {
41
+ "type": "string",
42
+ "pattern": "^[a-f0-9]{64}$",
43
+ "description": "SHA256 checksum of source file (optional)"
44
+ },
45
+ "execution_ms": {
46
+ "type": "integer",
47
+ "minimum": 0,
48
+ "description": "Execution time in milliseconds (optional)"
49
+ },
50
+ "resultsField": {
51
+ "type": "string",
52
+ "description": "Name of the field containing primary results (e.g., 'tasks', 'matches', 'data', 'blockedTasks', 'items'). Enables self-documenting JSON for LLM agents. If omitted, defaults to 'tasks' for list commands or 'task' for single-task commands."
53
+ }
54
+ },
55
+ "additionalProperties": false
56
+ },
57
+ "success": {
58
+ "type": "boolean",
59
+ "const": true,
60
+ "description": "Indicates successful operation"
61
+ },
62
+ "summary": {
63
+ "type": "object",
64
+ "description": "Aggregated statistics or summary data (optional)",
65
+ "additionalProperties": true
66
+ },
67
+ "data": {
68
+ "description": "Generic data payload (type depends on command)"
69
+ },
70
+ "task": {
71
+ "type": "object",
72
+ "description": "Single task object (for add, update, show commands)",
73
+ "properties": {
74
+ "id": {
75
+ "type": "string",
76
+ "pattern": "^T\\d{3,}$",
77
+ "description": "Task identifier (T001+, expandable)"
78
+ },
79
+ "type": {
80
+ "type": "string",
81
+ "enum": ["epic", "task", "subtask"],
82
+ "description": "Hierarchy type"
83
+ },
84
+ "parentId": {
85
+ "type": ["string", "null"],
86
+ "pattern": "^T\\d{3,}$",
87
+ "description": "Parent task ID or null for root tasks"
88
+ },
89
+ "size": {
90
+ "type": ["string", "null"],
91
+ "enum": ["small", "medium", "large", null],
92
+ "description": "Task size estimate"
93
+ },
94
+ "title": {
95
+ "type": "string",
96
+ "minLength": 1
97
+ },
98
+ "description": {
99
+ "type": "string"
100
+ },
101
+ "status": {
102
+ "type": "string",
103
+ "enum": ["pending", "active", "blocked", "done"]
104
+ },
105
+ "priority": {
106
+ "type": "string",
107
+ "enum": ["critical", "high", "medium", "low"]
108
+ },
109
+ "createdAt": {
110
+ "type": "string",
111
+ "format": "date-time"
112
+ },
113
+ "completedAt": {
114
+ "type": ["string", "null"],
115
+ "format": "date-time"
116
+ }
117
+ },
118
+ "additionalProperties": true
119
+ },
120
+ "tasks": {
121
+ "type": "array",
122
+ "description": "Array of task objects (for list commands)",
123
+ "items": {
124
+ "type": "object"
125
+ }
126
+ },
127
+ "taskId": {
128
+ "type": "string",
129
+ "pattern": "^T\\d{3,}$",
130
+ "description": "Task ID affected by operation"
131
+ },
132
+ "changes": {
133
+ "type": "object",
134
+ "description": "Change tracking for update operations",
135
+ "additionalProperties": {
136
+ "type": "object",
137
+ "properties": {
138
+ "before": {},
139
+ "after": {}
140
+ }
141
+ }
142
+ },
143
+ "warnings": {
144
+ "type": "array",
145
+ "description": "Non-fatal warnings",
146
+ "items": {
147
+ "type": "object",
148
+ "properties": {
149
+ "code": {
150
+ "type": "string",
151
+ "pattern": "^W_[A-Z_]+$"
152
+ },
153
+ "message": {
154
+ "type": "string"
155
+ },
156
+ "suggestion": {
157
+ "type": ["string", "null"]
158
+ }
159
+ }
160
+ }
161
+ }
162
+ },
163
+ "additionalProperties": true
164
+ }