@cleocode/lafs 2026.4.10 → 2026.4.12
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/dist/src/discovery.d.ts +169 -0
- package/dist/src/discovery.d.ts.map +1 -1
- package/dist/src/discovery.js +137 -0
- package/dist/src/discovery.js.map +1 -1
- package/dist/src/envelope.d.ts +94 -0
- package/dist/src/envelope.d.ts.map +1 -1
- package/dist/src/operation-gates.d.ts +79 -0
- package/dist/src/operation-gates.d.ts.map +1 -0
- package/dist/src/operation-gates.js +227 -0
- package/dist/src/operation-gates.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static gate table for CLEO CLI operations.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Gates are preconditions that an operation enforces at runtime — typically
|
|
6
|
+
* encoded as `new CleoError(...)` throws inside core task-engine handlers.
|
|
7
|
+
* Until a dynamic gate-registry lands (future work), this file provides a
|
|
8
|
+
* curated static table for the 3 most-called operations so that
|
|
9
|
+
* `describeOperation()` can surface them to agents without a trial-and-error
|
|
10
|
+
* call.
|
|
11
|
+
*
|
|
12
|
+
* **Limitation**: only `tasks.add`, `tasks.complete`, and `tasks.show` are
|
|
13
|
+
* seeded here. Every other operation returns `gates: []`. When gate-registry
|
|
14
|
+
* work lands, replace this table with a registry walk and remove this note.
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Mapping from `"<domain>.<operation>"` to extended parameter descriptors.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Used by `describeOperation()` to supplement registry operations whose
|
|
23
|
+
* `params` array is absent or incomplete. Only the 3 most-used operations
|
|
24
|
+
* are seeded here.
|
|
25
|
+
*/
|
|
26
|
+
export const STATIC_PARAMS_TABLE = {
|
|
27
|
+
'tasks.add': [
|
|
28
|
+
{
|
|
29
|
+
name: 'title',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true,
|
|
32
|
+
description: 'Task title (3–500 characters)',
|
|
33
|
+
cli: { positional: true },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'parent',
|
|
37
|
+
type: 'string',
|
|
38
|
+
required: false,
|
|
39
|
+
description: 'Parent task ID (makes this task a subtask)',
|
|
40
|
+
cli: { flag: 'parent' },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'priority',
|
|
44
|
+
type: 'string',
|
|
45
|
+
required: false,
|
|
46
|
+
description: 'Task priority',
|
|
47
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
48
|
+
cli: { short: '-p', flag: 'priority' },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'type',
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: false,
|
|
54
|
+
description: 'Task type',
|
|
55
|
+
enum: ['epic', 'task', 'subtask', 'bug'],
|
|
56
|
+
cli: { short: '-t', flag: 'type' },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'size',
|
|
60
|
+
type: 'string',
|
|
61
|
+
required: false,
|
|
62
|
+
description: 'Scope size estimate',
|
|
63
|
+
enum: ['small', 'medium', 'large'],
|
|
64
|
+
cli: { flag: 'size' },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'description',
|
|
68
|
+
type: 'string',
|
|
69
|
+
required: false,
|
|
70
|
+
description: 'Detailed task description (must differ meaningfully from title)',
|
|
71
|
+
cli: { short: '-d', flag: 'description' },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'acceptance',
|
|
75
|
+
type: 'array',
|
|
76
|
+
required: false,
|
|
77
|
+
description: 'Pipe-separated acceptance criteria (e.g. "AC1|AC2|AC3")',
|
|
78
|
+
cli: { flag: 'acceptance' },
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'labels',
|
|
82
|
+
type: 'array',
|
|
83
|
+
required: false,
|
|
84
|
+
description: 'Comma-separated labels',
|
|
85
|
+
cli: { short: '-l', flag: 'labels' },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'depends',
|
|
89
|
+
type: 'array',
|
|
90
|
+
required: false,
|
|
91
|
+
description: 'Comma-separated dependency task IDs',
|
|
92
|
+
cli: { short: '-D', flag: 'depends' },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'phase',
|
|
96
|
+
type: 'string',
|
|
97
|
+
required: false,
|
|
98
|
+
description: 'Phase slug to assign the task to',
|
|
99
|
+
cli: { short: '-P', flag: 'phase' },
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'notes',
|
|
103
|
+
type: 'string',
|
|
104
|
+
required: false,
|
|
105
|
+
description: 'Initial note entry for the task',
|
|
106
|
+
cli: { flag: 'notes' },
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
'tasks.complete': [
|
|
110
|
+
{
|
|
111
|
+
name: 'taskId',
|
|
112
|
+
type: 'string',
|
|
113
|
+
required: true,
|
|
114
|
+
description: 'ID of the task to complete',
|
|
115
|
+
cli: { positional: true },
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'force',
|
|
119
|
+
type: 'boolean',
|
|
120
|
+
required: false,
|
|
121
|
+
description: 'Force completion even when children are not done or dependencies unresolved',
|
|
122
|
+
cli: { flag: 'force' },
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'verificationNote',
|
|
126
|
+
type: 'string',
|
|
127
|
+
required: false,
|
|
128
|
+
description: 'Evidence that acceptance criteria were met',
|
|
129
|
+
cli: { flag: 'verification-note' },
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
'tasks.show': [
|
|
133
|
+
{
|
|
134
|
+
name: 'taskId',
|
|
135
|
+
type: 'string',
|
|
136
|
+
required: true,
|
|
137
|
+
description: 'ID of the task to retrieve',
|
|
138
|
+
cli: { positional: true },
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
};
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
// Static gate table (operation key = "<domain>.<operation>")
|
|
144
|
+
// ---------------------------------------------------------------------------
|
|
145
|
+
/**
|
|
146
|
+
* Mapping from `"<domain>.<operation>"` to its declared gates.
|
|
147
|
+
*
|
|
148
|
+
* @remarks
|
|
149
|
+
* Only the 3 most-used operations are seeded. All other operations should
|
|
150
|
+
* return an empty array. See module-level note on the static-table limitation.
|
|
151
|
+
*/
|
|
152
|
+
export const STATIC_GATE_TABLE = {
|
|
153
|
+
'tasks.add': [
|
|
154
|
+
{
|
|
155
|
+
name: 'anti-hallucination',
|
|
156
|
+
errorCode: 'E_VALIDATION_FAILED',
|
|
157
|
+
description: 'Title and description must be meaningfully different',
|
|
158
|
+
triggers: [
|
|
159
|
+
'title and description are identical strings',
|
|
160
|
+
'description is a substring of the title',
|
|
161
|
+
'title is a substring of the description',
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'acceptance-criteria-format',
|
|
166
|
+
errorCode: 'E_VALIDATION_FAILED',
|
|
167
|
+
description: 'Acceptance criteria must be pipe-separated checklist items',
|
|
168
|
+
triggers: [
|
|
169
|
+
'acceptance criteria contains fewer than 1 non-empty item after splitting on pipe (|)',
|
|
170
|
+
'individual acceptance item exceeds 500 characters',
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'parent-exists',
|
|
175
|
+
errorCode: 'E_NOT_FOUND',
|
|
176
|
+
description: 'Parent task must exist if --parent is specified',
|
|
177
|
+
triggers: ['--parent <id> is specified but no task with that ID exists in the database'],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'title-length',
|
|
181
|
+
errorCode: 'E_VALIDATION_FAILED',
|
|
182
|
+
description: 'Title must be between 3 and 500 characters',
|
|
183
|
+
triggers: ['title is shorter than 3 characters', 'title is longer than 500 characters'],
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
'tasks.complete': [
|
|
187
|
+
{
|
|
188
|
+
name: 'task-exists',
|
|
189
|
+
errorCode: 'E_NOT_FOUND',
|
|
190
|
+
description: 'Task must exist before it can be completed',
|
|
191
|
+
triggers: ['no task with the given taskId exists in the database'],
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'children-completion',
|
|
195
|
+
errorCode: 'E_INCOMPLETE_CHILDREN',
|
|
196
|
+
description: 'All direct children must be done/cancelled before parent can be completed',
|
|
197
|
+
triggers: [
|
|
198
|
+
'task has at least one child with status pending, active, or blocked',
|
|
199
|
+
'--force flag is absent',
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'dependency-check',
|
|
204
|
+
errorCode: 'E_BLOCKED',
|
|
205
|
+
description: 'All blocking dependencies must be resolved before completion',
|
|
206
|
+
triggers: ['task has at least one unresolved blocking dependency', '--force flag is absent'],
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'verification-required',
|
|
210
|
+
errorCode: 'E_VERIFICATION_REQUIRED',
|
|
211
|
+
description: 'Task completion requires verification evidence when acceptance criteria exist',
|
|
212
|
+
triggers: [
|
|
213
|
+
'task has acceptance criteria defined',
|
|
214
|
+
'no --verification-note or --verify flag was supplied',
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
'tasks.show': [
|
|
219
|
+
{
|
|
220
|
+
name: 'task-exists',
|
|
221
|
+
errorCode: 'E_NOT_FOUND',
|
|
222
|
+
description: 'Task must exist to be shown',
|
|
223
|
+
triggers: ['no task with the given taskId exists in the database'],
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
};
|
|
227
|
+
//# sourceMappingURL=operation-gates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-gates.js","sourceRoot":"","sources":["../../src/operation-g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