@lumenflow/mcp 2.21.0 → 3.0.0
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/LICENSE +661 -190
- package/dist/mcp-constants.d.ts +173 -0
- package/dist/mcp-constants.d.ts.map +1 -0
- package/dist/mcp-constants.js +191 -0
- package/dist/mcp-constants.js.map +1 -0
- package/dist/runtime-cache.d.ts +7 -0
- package/dist/runtime-cache.d.ts.map +1 -0
- package/dist/runtime-cache.js +26 -0
- package/dist/runtime-cache.js.map +1 -0
- package/dist/runtime-tool-resolver.constants.d.ts +33 -0
- package/dist/runtime-tool-resolver.constants.d.ts.map +1 -0
- package/dist/runtime-tool-resolver.constants.js +33 -0
- package/dist/runtime-tool-resolver.constants.js.map +1 -0
- package/dist/runtime-tool-resolver.d.ts +5 -0
- package/dist/runtime-tool-resolver.d.ts.map +1 -0
- package/dist/runtime-tool-resolver.js +2028 -0
- package/dist/runtime-tool-resolver.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +30 -4
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-tools.d.ts +1 -0
- package/dist/tools/agent-tools.d.ts.map +1 -1
- package/dist/tools/agent-tools.js +113 -41
- package/dist/tools/agent-tools.js.map +1 -1
- package/dist/tools/context-tools.d.ts +2 -1
- package/dist/tools/context-tools.d.ts.map +1 -1
- package/dist/tools/context-tools.js +23 -40
- package/dist/tools/context-tools.js.map +1 -1
- package/dist/tools/flow-tools.d.ts +1 -0
- package/dist/tools/flow-tools.d.ts.map +1 -1
- package/dist/tools/flow-tools.js +51 -64
- package/dist/tools/flow-tools.js.map +1 -1
- package/dist/tools/initiative-tools.d.ts.map +1 -1
- package/dist/tools/initiative-tools.js +198 -84
- package/dist/tools/initiative-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +2 -0
- package/dist/tools/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory-tools.js +268 -166
- package/dist/tools/memory-tools.js.map +1 -1
- package/dist/tools/orchestration-tools.d.ts.map +1 -1
- package/dist/tools/orchestration-tools.js +99 -57
- package/dist/tools/orchestration-tools.js.map +1 -1
- package/dist/tools/parity-tools.d.ts +12 -0
- package/dist/tools/parity-tools.d.ts.map +1 -1
- package/dist/tools/parity-tools.js +776 -193
- package/dist/tools/parity-tools.js.map +1 -1
- package/dist/tools/runtime-task-constants.d.ts +19 -0
- package/dist/tools/runtime-task-constants.d.ts.map +1 -0
- package/dist/tools/runtime-task-constants.js +19 -0
- package/dist/tools/runtime-task-constants.js.map +1 -0
- package/dist/tools/runtime-task-tools.d.ts +10 -0
- package/dist/tools/runtime-task-tools.d.ts.map +1 -0
- package/dist/tools/runtime-task-tools.js +114 -0
- package/dist/tools/runtime-task-tools.js.map +1 -0
- package/dist/tools/setup-tools.d.ts +1 -0
- package/dist/tools/setup-tools.d.ts.map +1 -1
- package/dist/tools/setup-tools.js +150 -65
- package/dist/tools/setup-tools.js.map +1 -1
- package/dist/tools/validation-tools.d.ts +2 -0
- package/dist/tools/validation-tools.d.ts.map +1 -1
- package/dist/tools/validation-tools.js +98 -54
- package/dist/tools/validation-tools.js.map +1 -1
- package/dist/tools/wu-tools.d.ts +1 -1
- package/dist/tools/wu-tools.d.ts.map +1 -1
- package/dist/tools/wu-tools.js +444 -250
- package/dist/tools/wu-tools.js.map +1 -1
- package/dist/tools-shared.d.ts +81 -1
- package/dist/tools-shared.d.ts.map +1 -1
- package/dist/tools-shared.js +199 -1
- package/dist/tools-shared.js.map +1 -1
- package/dist/tools.d.ts +28 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +59 -3
- package/dist/tools.js.map +1 -1
- package/dist/worktree-enforcement.d.ts +47 -0
- package/dist/worktree-enforcement.d.ts.map +1 -0
- package/dist/worktree-enforcement.js +152 -0
- package/dist/worktree-enforcement.js.map +1 -0
- package/package.json +5 -2
package/dist/tools/wu-tools.js
CHANGED
|
@@ -12,12 +12,74 @@ import { z } from 'zod';
|
|
|
12
12
|
import { wuCreateSchema, wuClaimSchema, wuStatusSchema, wuDoneSchema, gatesSchema,
|
|
13
13
|
// WU-1454: Lifecycle command schemas
|
|
14
14
|
wuBlockSchema, wuUnblockSchema, wuEditSchema, wuReleaseSchema, wuRecoverSchema, wuRepairSchema, wuDepsSchema, wuPrepSchema, wuPreflightSchema, wuPruneSchema, wuDeleteSchema, wuCleanupSchema, wuSpawnSchema, wuValidateSchema, wuInferLaneSchema, wuUnlockLaneSchema, } from '@lumenflow/core';
|
|
15
|
-
import { ErrorCodes, ErrorMessages, CliArgs, SuccessMessages, getCore, success, error, buildWuPromptArgs,
|
|
15
|
+
import { ErrorCodes, ErrorMessages, CliArgs, SuccessMessages, getCore, success, error, buildWuPromptArgs, executeViaPack, } from '../tools-shared.js';
|
|
16
|
+
import { CliCommands, MetadataKeys } from '../mcp-constants.js';
|
|
17
|
+
/**
|
|
18
|
+
* WU-1805: Fallback messages for WU query tools when executeViaPack
|
|
19
|
+
* returns no structured data.
|
|
20
|
+
*/
|
|
21
|
+
const WuQueryMessages = {
|
|
22
|
+
STATUS_FAILED: 'wu:status failed',
|
|
23
|
+
CREATE_PASSED: 'WU created successfully',
|
|
24
|
+
CREATE_FAILED: 'wu:create failed',
|
|
25
|
+
CLAIM_PASSED: 'WU claimed successfully',
|
|
26
|
+
CLAIM_FAILED: 'wu:claim failed',
|
|
27
|
+
DEPS_FAILED: 'wu:deps failed',
|
|
28
|
+
PREFLIGHT_PASSED: 'Preflight checks passed',
|
|
29
|
+
PREFLIGHT_FAILED: 'wu:preflight failed',
|
|
30
|
+
VALIDATE_PASSED: 'WU is valid',
|
|
31
|
+
VALIDATE_FAILED: 'wu:validate failed',
|
|
32
|
+
INFER_LANE_FAILED: 'wu:infer-lane failed',
|
|
33
|
+
};
|
|
34
|
+
const WuStateTransitionMessages = {
|
|
35
|
+
BLOCK_PASSED: 'WU blocked successfully',
|
|
36
|
+
BLOCK_FAILED: 'wu:block failed',
|
|
37
|
+
UNBLOCK_PASSED: 'WU unblocked successfully',
|
|
38
|
+
UNBLOCK_FAILED: 'wu:unblock failed',
|
|
39
|
+
EDIT_PASSED: 'WU edited successfully',
|
|
40
|
+
EDIT_FAILED: 'wu:edit failed',
|
|
41
|
+
RELEASE_PASSED: 'WU released successfully',
|
|
42
|
+
RELEASE_FAILED: 'wu:release failed',
|
|
43
|
+
};
|
|
44
|
+
const WuCompletionLifecycleMessages = {
|
|
45
|
+
SANDBOX_PASSED: 'WU sandbox command completed successfully',
|
|
46
|
+
SANDBOX_FAILED: 'wu:sandbox failed',
|
|
47
|
+
DONE_PASSED: 'WU completed successfully',
|
|
48
|
+
DONE_FAILED: 'wu:done failed',
|
|
49
|
+
PREP_PASSED: 'WU prep completed',
|
|
50
|
+
PREP_FAILED: 'wu:prep failed',
|
|
51
|
+
PRUNE_PASSED: 'Prune completed',
|
|
52
|
+
PRUNE_FAILED: 'wu:prune failed',
|
|
53
|
+
DELETE_PASSED: 'WU deleted',
|
|
54
|
+
DELETE_FAILED: 'wu:delete failed',
|
|
55
|
+
CLEANUP_PASSED: 'Cleanup complete',
|
|
56
|
+
CLEANUP_FAILED: 'wu:cleanup failed',
|
|
57
|
+
};
|
|
58
|
+
const WuDelegationAndGatesMessages = {
|
|
59
|
+
GATES_FAILED: 'Gates failed',
|
|
60
|
+
BRIEF_PASSED: 'Brief prompt generated',
|
|
61
|
+
BRIEF_FAILED: 'wu:brief failed',
|
|
62
|
+
DELEGATE_PASSED: 'Delegation prompt generated',
|
|
63
|
+
DELEGATE_FAILED: 'wu:delegate failed',
|
|
64
|
+
UNLOCK_PASSED: 'Lane unlocked',
|
|
65
|
+
UNLOCK_FAILED: 'wu:unlock-lane failed',
|
|
66
|
+
};
|
|
67
|
+
const GatesRuntimeConstants = {
|
|
68
|
+
FALLBACK_TIMEOUT_MS: 600000,
|
|
69
|
+
};
|
|
70
|
+
const WuQueryFlags = {
|
|
71
|
+
NO_STRICT: '--no-strict',
|
|
72
|
+
WORKTREE: '--worktree',
|
|
73
|
+
DEPTH: '--depth',
|
|
74
|
+
DIRECTION: '--direction',
|
|
75
|
+
PATHS: '--paths',
|
|
76
|
+
DESC: '--desc',
|
|
77
|
+
};
|
|
16
78
|
/**
|
|
17
79
|
* wu_status - Get status of a specific WU
|
|
18
|
-
* Uses CLI shell-out for consistency
|
|
19
80
|
*
|
|
20
81
|
* WU-1431: Uses shared wuStatusSchema for parity with CLI
|
|
82
|
+
* WU-1805: Migrated from CLI shell-out to executeViaPack (runtime-first)
|
|
21
83
|
* Note: CLI allows id to be optional (auto-detect from worktree), but MCP requires it
|
|
22
84
|
* since there's no "current directory" concept for MCP clients
|
|
23
85
|
*/
|
|
@@ -32,21 +94,18 @@ export const wuStatusTool = {
|
|
|
32
94
|
if (!input.id) {
|
|
33
95
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
34
96
|
}
|
|
35
|
-
const args = [
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
else {
|
|
48
|
-
return error(result.stderr || result.error?.message || 'wu:status failed', ErrorCodes.WU_STATUS_ERROR);
|
|
49
|
-
}
|
|
97
|
+
const args = [CliArgs.ID, input.id, CliArgs.JSON];
|
|
98
|
+
const result = await executeViaPack(CliCommands.WU_STATUS, input, {
|
|
99
|
+
projectRoot: options?.projectRoot,
|
|
100
|
+
fallback: {
|
|
101
|
+
command: CliCommands.WU_STATUS,
|
|
102
|
+
args,
|
|
103
|
+
errorCode: ErrorCodes.WU_STATUS_ERROR,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
return result.success
|
|
107
|
+
? success(result.data ?? { message: result.data })
|
|
108
|
+
: error(result.error?.message ?? WuQueryMessages.STATUS_FAILED, ErrorCodes.WU_STATUS_ERROR);
|
|
50
109
|
},
|
|
51
110
|
};
|
|
52
111
|
/**
|
|
@@ -66,9 +125,9 @@ export const wuCreateTool = {
|
|
|
66
125
|
if (!input.title) {
|
|
67
126
|
return error(ErrorMessages.TITLE_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
68
127
|
}
|
|
69
|
-
const args = [
|
|
128
|
+
const args = [CliArgs.LANE, input.lane, '--title', input.title];
|
|
70
129
|
if (input.id)
|
|
71
|
-
args.push(
|
|
130
|
+
args.push(CliArgs.ID, input.id);
|
|
72
131
|
if (input.description)
|
|
73
132
|
args.push(CliArgs.DESCRIPTION, input.description);
|
|
74
133
|
if (input.acceptance) {
|
|
@@ -83,14 +142,22 @@ export const wuCreateTool = {
|
|
|
83
142
|
}
|
|
84
143
|
if (input.exposure)
|
|
85
144
|
args.push('--exposure', input.exposure);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
145
|
+
const result = await executeViaPack(CliCommands.WU_CREATE, input, {
|
|
146
|
+
projectRoot: options?.projectRoot,
|
|
147
|
+
contextInput: {
|
|
148
|
+
metadata: {
|
|
149
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
fallback: {
|
|
153
|
+
command: CliCommands.WU_CREATE,
|
|
154
|
+
args,
|
|
155
|
+
errorCode: ErrorCodes.WU_CREATE_ERROR,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
return result.success
|
|
159
|
+
? success(result.data ?? { message: WuQueryMessages.CREATE_PASSED })
|
|
160
|
+
: error(result.error?.message ?? WuQueryMessages.CREATE_FAILED, ErrorCodes.WU_CREATE_ERROR);
|
|
94
161
|
},
|
|
95
162
|
};
|
|
96
163
|
/**
|
|
@@ -121,7 +188,7 @@ export const wuClaimTool = {
|
|
|
121
188
|
if (!input.lane) {
|
|
122
189
|
return error(ErrorMessages.LANE_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
123
190
|
}
|
|
124
|
-
const args = [
|
|
191
|
+
const args = [CliArgs.ID, input.id, CliArgs.LANE, input.lane];
|
|
125
192
|
// WU-1491: Pass mode flags through to CLI
|
|
126
193
|
if (input.cloud)
|
|
127
194
|
args.push('--cloud');
|
|
@@ -138,14 +205,22 @@ export const wuClaimTool = {
|
|
|
138
205
|
}
|
|
139
206
|
args.push('--sandbox', '--', ...sandboxCommand);
|
|
140
207
|
}
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
208
|
+
const result = await executeViaPack(CliCommands.WU_CLAIM, input, {
|
|
209
|
+
projectRoot: options?.projectRoot,
|
|
210
|
+
contextInput: {
|
|
211
|
+
metadata: {
|
|
212
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
fallback: {
|
|
216
|
+
command: CliCommands.WU_CLAIM,
|
|
217
|
+
args,
|
|
218
|
+
errorCode: ErrorCodes.WU_CLAIM_ERROR,
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
return result.success
|
|
222
|
+
? success(result.data ?? { message: WuQueryMessages.CLAIM_PASSED })
|
|
223
|
+
: error(result.error?.message ?? WuQueryMessages.CLAIM_FAILED, ErrorCodes.WU_CLAIM_ERROR);
|
|
149
224
|
},
|
|
150
225
|
};
|
|
151
226
|
/**
|
|
@@ -171,19 +246,27 @@ export const wuSandboxTool = {
|
|
|
171
246
|
if (command.length === 0) {
|
|
172
247
|
return error('command is required', ErrorCodes.MISSING_PARAMETER);
|
|
173
248
|
}
|
|
174
|
-
const args = [
|
|
249
|
+
const args = [CliArgs.ID, input.id];
|
|
175
250
|
if (input.worktree) {
|
|
176
251
|
args.push('--worktree', input.worktree);
|
|
177
252
|
}
|
|
178
253
|
args.push('--', ...command);
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
254
|
+
const result = await executeViaPack(CliCommands.WU_SANDBOX, input, {
|
|
255
|
+
projectRoot: options?.projectRoot,
|
|
256
|
+
contextInput: {
|
|
257
|
+
metadata: {
|
|
258
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
fallback: {
|
|
262
|
+
command: CliCommands.WU_SANDBOX,
|
|
263
|
+
args,
|
|
264
|
+
errorCode: ErrorCodes.WU_CLAIM_ERROR,
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
return result.success
|
|
268
|
+
? success(result.data ?? { message: WuCompletionLifecycleMessages.SANDBOX_PASSED })
|
|
269
|
+
: error(result.error?.message ?? WuCompletionLifecycleMessages.SANDBOX_FAILED, ErrorCodes.WU_CLAIM_ERROR);
|
|
187
270
|
},
|
|
188
271
|
};
|
|
189
272
|
/**
|
|
@@ -214,22 +297,30 @@ export const wuDoneTool = {
|
|
|
214
297
|
catch {
|
|
215
298
|
// If we can't determine context, proceed anyway - CLI will validate
|
|
216
299
|
}
|
|
217
|
-
const args = [
|
|
300
|
+
const args = [CliArgs.ID, input.id];
|
|
218
301
|
if (input.skip_gates) {
|
|
219
302
|
args.push('--skip-gates');
|
|
220
303
|
if (input.reason)
|
|
221
|
-
args.push(
|
|
304
|
+
args.push(CliArgs.REASON, input.reason);
|
|
222
305
|
if (input.fix_wu)
|
|
223
306
|
args.push('--fix-wu', input.fix_wu);
|
|
224
307
|
}
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
308
|
+
const result = await executeViaPack(CliCommands.WU_DONE, input, {
|
|
309
|
+
projectRoot: options?.projectRoot,
|
|
310
|
+
contextInput: {
|
|
311
|
+
metadata: {
|
|
312
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
fallback: {
|
|
316
|
+
command: CliCommands.WU_DONE,
|
|
317
|
+
args,
|
|
318
|
+
errorCode: ErrorCodes.WU_DONE_ERROR,
|
|
319
|
+
},
|
|
320
|
+
});
|
|
321
|
+
return result.success
|
|
322
|
+
? success(result.data ?? { message: WuCompletionLifecycleMessages.DONE_PASSED })
|
|
323
|
+
: error(result.error?.message ?? WuCompletionLifecycleMessages.DONE_FAILED, ErrorCodes.WU_DONE_ERROR);
|
|
233
324
|
},
|
|
234
325
|
};
|
|
235
326
|
/**
|
|
@@ -247,17 +338,25 @@ export const gatesRunTool = {
|
|
|
247
338
|
if (input.docs_only) {
|
|
248
339
|
args.push(CliArgs.DOCS_ONLY);
|
|
249
340
|
}
|
|
250
|
-
const
|
|
341
|
+
const result = await executeViaPack(CliCommands.GATES, input, {
|
|
251
342
|
projectRoot: options?.projectRoot,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
343
|
+
contextInput: {
|
|
344
|
+
metadata: {
|
|
345
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
fallback: {
|
|
349
|
+
command: CliCommands.GATES,
|
|
350
|
+
args,
|
|
351
|
+
errorCode: ErrorCodes.GATES_ERROR,
|
|
352
|
+
},
|
|
353
|
+
fallbackCliOptions: {
|
|
354
|
+
timeout: GatesRuntimeConstants.FALLBACK_TIMEOUT_MS,
|
|
355
|
+
},
|
|
356
|
+
});
|
|
357
|
+
return result.success
|
|
358
|
+
? success(result.data ?? { message: SuccessMessages.ALL_GATES_PASSED })
|
|
359
|
+
: error(result.error?.message ?? WuDelegationAndGatesMessages.GATES_FAILED, ErrorCodes.GATES_ERROR);
|
|
261
360
|
},
|
|
262
361
|
};
|
|
263
362
|
/**
|
|
@@ -275,18 +374,26 @@ export const wuBlockTool = {
|
|
|
275
374
|
if (!input.reason) {
|
|
276
375
|
return error(ErrorMessages.REASON_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
277
376
|
}
|
|
278
|
-
const args = [
|
|
377
|
+
const args = [CliArgs.ID, input.id, CliArgs.REASON, input.reason];
|
|
279
378
|
if (input.remove_worktree) {
|
|
280
379
|
args.push('--remove-worktree');
|
|
281
380
|
}
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
381
|
+
const result = await executeViaPack(CliCommands.WU_BLOCK, input, {
|
|
382
|
+
projectRoot: options?.projectRoot,
|
|
383
|
+
contextInput: {
|
|
384
|
+
metadata: {
|
|
385
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
fallback: {
|
|
389
|
+
command: CliCommands.WU_BLOCK,
|
|
390
|
+
args,
|
|
391
|
+
errorCode: ErrorCodes.WU_BLOCK_ERROR,
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
return result.success
|
|
395
|
+
? success(result.data ?? { message: WuStateTransitionMessages.BLOCK_PASSED })
|
|
396
|
+
: error(result.error?.message ?? WuStateTransitionMessages.BLOCK_FAILED, ErrorCodes.WU_BLOCK_ERROR);
|
|
290
397
|
},
|
|
291
398
|
};
|
|
292
399
|
/**
|
|
@@ -301,19 +408,27 @@ export const wuUnblockTool = {
|
|
|
301
408
|
if (!input.id) {
|
|
302
409
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
303
410
|
}
|
|
304
|
-
const args = [
|
|
411
|
+
const args = [CliArgs.ID, input.id];
|
|
305
412
|
if (input.reason)
|
|
306
|
-
args.push(
|
|
413
|
+
args.push(CliArgs.REASON, input.reason);
|
|
307
414
|
if (input.create_worktree)
|
|
308
415
|
args.push('--create-worktree');
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
416
|
+
const result = await executeViaPack(CliCommands.WU_UNBLOCK, input, {
|
|
417
|
+
projectRoot: options?.projectRoot,
|
|
418
|
+
contextInput: {
|
|
419
|
+
metadata: {
|
|
420
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
fallback: {
|
|
424
|
+
command: CliCommands.WU_UNBLOCK,
|
|
425
|
+
args,
|
|
426
|
+
errorCode: ErrorCodes.WU_UNBLOCK_ERROR,
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
return result.success
|
|
430
|
+
? success(result.data ?? { message: WuStateTransitionMessages.UNBLOCK_PASSED })
|
|
431
|
+
: error(result.error?.message ?? WuStateTransitionMessages.UNBLOCK_FAILED, ErrorCodes.WU_UNBLOCK_ERROR);
|
|
317
432
|
},
|
|
318
433
|
};
|
|
319
434
|
/**
|
|
@@ -328,7 +443,7 @@ export const wuEditTool = {
|
|
|
328
443
|
if (!input.id) {
|
|
329
444
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
330
445
|
}
|
|
331
|
-
const args = [
|
|
446
|
+
const args = [CliArgs.ID, input.id];
|
|
332
447
|
if (input.description)
|
|
333
448
|
args.push(CliArgs.DESCRIPTION, input.description);
|
|
334
449
|
if (input.acceptance) {
|
|
@@ -344,7 +459,7 @@ export const wuEditTool = {
|
|
|
344
459
|
}
|
|
345
460
|
}
|
|
346
461
|
if (input.lane)
|
|
347
|
-
args.push(
|
|
462
|
+
args.push(CliArgs.LANE, input.lane);
|
|
348
463
|
if (input.priority)
|
|
349
464
|
args.push('--priority', input.priority);
|
|
350
465
|
if (input.initiative)
|
|
@@ -353,14 +468,22 @@ export const wuEditTool = {
|
|
|
353
468
|
args.push(CliArgs.PHASE, String(input.phase));
|
|
354
469
|
if (input.no_strict)
|
|
355
470
|
args.push('--no-strict');
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
471
|
+
const result = await executeViaPack(CliCommands.WU_EDIT, input, {
|
|
472
|
+
projectRoot: options?.projectRoot,
|
|
473
|
+
contextInput: {
|
|
474
|
+
metadata: {
|
|
475
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
fallback: {
|
|
479
|
+
command: CliCommands.WU_EDIT,
|
|
480
|
+
args,
|
|
481
|
+
errorCode: ErrorCodes.WU_EDIT_ERROR,
|
|
482
|
+
},
|
|
483
|
+
});
|
|
484
|
+
return result.success
|
|
485
|
+
? success(result.data ?? { message: WuStateTransitionMessages.EDIT_PASSED })
|
|
486
|
+
: error(result.error?.message ?? WuStateTransitionMessages.EDIT_FAILED, ErrorCodes.WU_EDIT_ERROR);
|
|
364
487
|
},
|
|
365
488
|
};
|
|
366
489
|
/**
|
|
@@ -375,17 +498,25 @@ export const wuReleaseTool = {
|
|
|
375
498
|
if (!input.id) {
|
|
376
499
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
377
500
|
}
|
|
378
|
-
const args = [
|
|
501
|
+
const args = [CliArgs.ID, input.id];
|
|
379
502
|
if (input.reason)
|
|
380
|
-
args.push(
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
503
|
+
args.push(CliArgs.REASON, input.reason);
|
|
504
|
+
const result = await executeViaPack(CliCommands.WU_RELEASE, input, {
|
|
505
|
+
projectRoot: options?.projectRoot,
|
|
506
|
+
contextInput: {
|
|
507
|
+
metadata: {
|
|
508
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
fallback: {
|
|
512
|
+
command: CliCommands.WU_RELEASE,
|
|
513
|
+
args,
|
|
514
|
+
errorCode: ErrorCodes.WU_RELEASE_ERROR,
|
|
515
|
+
},
|
|
516
|
+
});
|
|
517
|
+
return result.success
|
|
518
|
+
? success(result.data ?? { message: WuStateTransitionMessages.RELEASE_PASSED })
|
|
519
|
+
: error(result.error?.message ?? WuStateTransitionMessages.RELEASE_FAILED, ErrorCodes.WU_RELEASE_ERROR);
|
|
389
520
|
},
|
|
390
521
|
};
|
|
391
522
|
/**
|
|
@@ -400,27 +531,29 @@ export const wuRecoverTool = {
|
|
|
400
531
|
if (!input.id) {
|
|
401
532
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
402
533
|
}
|
|
403
|
-
const args = [
|
|
534
|
+
const args = [CliArgs.ID, input.id];
|
|
404
535
|
if (input.action)
|
|
405
536
|
args.push('--action', input.action);
|
|
406
537
|
if (input.force)
|
|
407
|
-
args.push(
|
|
538
|
+
args.push(CliArgs.FORCE);
|
|
408
539
|
if (input.json)
|
|
409
540
|
args.push(CliArgs.JSON);
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
541
|
+
const result = await executeViaPack(CliCommands.WU_RECOVER, input, {
|
|
542
|
+
projectRoot: options?.projectRoot,
|
|
543
|
+
contextInput: {
|
|
544
|
+
metadata: {
|
|
545
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
fallback: {
|
|
549
|
+
command: CliCommands.WU_RECOVER,
|
|
550
|
+
args,
|
|
551
|
+
errorCode: ErrorCodes.WU_RECOVER_ERROR,
|
|
552
|
+
},
|
|
553
|
+
});
|
|
554
|
+
return result.success
|
|
555
|
+
? success(result.data ?? { message: 'WU recovered successfully' })
|
|
556
|
+
: error(result.error?.message ?? 'wu:recover failed', ErrorCodes.WU_RECOVER_ERROR);
|
|
424
557
|
},
|
|
425
558
|
};
|
|
426
559
|
/**
|
|
@@ -434,7 +567,7 @@ export const wuRepairTool = {
|
|
|
434
567
|
async execute(input, options) {
|
|
435
568
|
const args = [];
|
|
436
569
|
if (input.id)
|
|
437
|
-
args.push(
|
|
570
|
+
args.push(CliArgs.ID, input.id);
|
|
438
571
|
if (input.check)
|
|
439
572
|
args.push('--check');
|
|
440
573
|
if (input.all)
|
|
@@ -445,14 +578,22 @@ export const wuRepairTool = {
|
|
|
445
578
|
args.push('--admin');
|
|
446
579
|
if (input.repair_state)
|
|
447
580
|
args.push('--repair-state');
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
581
|
+
const result = await executeViaPack(CliCommands.WU_REPAIR, input, {
|
|
582
|
+
projectRoot: options?.projectRoot,
|
|
583
|
+
contextInput: {
|
|
584
|
+
metadata: {
|
|
585
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
fallback: {
|
|
589
|
+
command: CliCommands.WU_REPAIR,
|
|
590
|
+
args,
|
|
591
|
+
errorCode: ErrorCodes.WU_REPAIR_ERROR,
|
|
592
|
+
},
|
|
593
|
+
});
|
|
594
|
+
return result.success
|
|
595
|
+
? success(result.data ?? { message: 'WU repair completed' })
|
|
596
|
+
: error(result.error?.message ?? 'wu:repair failed', ErrorCodes.WU_REPAIR_ERROR);
|
|
456
597
|
},
|
|
457
598
|
};
|
|
458
599
|
/**
|
|
@@ -467,27 +608,24 @@ export const wuDepsTool = {
|
|
|
467
608
|
if (!input.id) {
|
|
468
609
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
469
610
|
}
|
|
470
|
-
const args = [
|
|
611
|
+
const args = [CliArgs.ID, input.id];
|
|
471
612
|
if (input.format)
|
|
472
|
-
args.push(
|
|
613
|
+
args.push(CliArgs.FORMAT, input.format);
|
|
473
614
|
if (input.depth)
|
|
474
|
-
args.push(
|
|
615
|
+
args.push(WuQueryFlags.DEPTH, String(input.depth));
|
|
475
616
|
if (input.direction)
|
|
476
|
-
args.push(
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
else {
|
|
489
|
-
return error(result.stderr || result.error?.message || 'wu:deps failed', ErrorCodes.WU_DEPS_ERROR);
|
|
490
|
-
}
|
|
617
|
+
args.push(WuQueryFlags.DIRECTION, input.direction);
|
|
618
|
+
const result = await executeViaPack(CliCommands.WU_DEPS, input, {
|
|
619
|
+
projectRoot: options?.projectRoot,
|
|
620
|
+
fallback: {
|
|
621
|
+
command: CliCommands.WU_DEPS,
|
|
622
|
+
args,
|
|
623
|
+
errorCode: ErrorCodes.WU_DEPS_ERROR,
|
|
624
|
+
},
|
|
625
|
+
});
|
|
626
|
+
return result.success
|
|
627
|
+
? success(result.data ?? { message: result.data })
|
|
628
|
+
: error(result.error?.message ?? WuQueryMessages.DEPS_FAILED, ErrorCodes.WU_DEPS_ERROR);
|
|
491
629
|
},
|
|
492
630
|
};
|
|
493
631
|
/**
|
|
@@ -502,22 +640,27 @@ export const wuPrepTool = {
|
|
|
502
640
|
if (!input.id) {
|
|
503
641
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
504
642
|
}
|
|
505
|
-
const args = [
|
|
643
|
+
const args = [CliArgs.ID, input.id];
|
|
506
644
|
if (input.docs_only)
|
|
507
645
|
args.push(CliArgs.DOCS_ONLY);
|
|
508
646
|
if (input.full_tests)
|
|
509
647
|
args.push('--full-tests');
|
|
510
|
-
const
|
|
648
|
+
const result = await executeViaPack(CliCommands.WU_PREP, input, {
|
|
511
649
|
projectRoot: options?.projectRoot,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
650
|
+
contextInput: {
|
|
651
|
+
metadata: {
|
|
652
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
653
|
+
},
|
|
654
|
+
},
|
|
655
|
+
fallback: {
|
|
656
|
+
command: CliCommands.WU_PREP,
|
|
657
|
+
args,
|
|
658
|
+
errorCode: ErrorCodes.WU_PREP_ERROR,
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
return result.success
|
|
662
|
+
? success(result.data ?? { message: WuCompletionLifecycleMessages.PREP_PASSED })
|
|
663
|
+
: error(result.error?.message ?? WuCompletionLifecycleMessages.PREP_FAILED, ErrorCodes.WU_PREP_ERROR);
|
|
521
664
|
},
|
|
522
665
|
};
|
|
523
666
|
/**
|
|
@@ -532,17 +675,20 @@ export const wuPreflightTool = {
|
|
|
532
675
|
if (!input.id) {
|
|
533
676
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
534
677
|
}
|
|
535
|
-
const args = [
|
|
678
|
+
const args = [CliArgs.ID, input.id];
|
|
536
679
|
if (input.worktree)
|
|
537
|
-
args.push(
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
680
|
+
args.push(WuQueryFlags.WORKTREE, input.worktree);
|
|
681
|
+
const result = await executeViaPack(CliCommands.WU_PREFLIGHT, input, {
|
|
682
|
+
projectRoot: options?.projectRoot,
|
|
683
|
+
fallback: {
|
|
684
|
+
command: CliCommands.WU_PREFLIGHT,
|
|
685
|
+
args,
|
|
686
|
+
errorCode: ErrorCodes.WU_PREFLIGHT_ERROR,
|
|
687
|
+
},
|
|
688
|
+
});
|
|
689
|
+
return result.success
|
|
690
|
+
? success(result.data ?? { message: WuQueryMessages.PREFLIGHT_PASSED })
|
|
691
|
+
: error(result.error?.message ?? WuQueryMessages.PREFLIGHT_FAILED, ErrorCodes.WU_PREFLIGHT_ERROR);
|
|
546
692
|
},
|
|
547
693
|
};
|
|
548
694
|
/**
|
|
@@ -556,15 +702,23 @@ export const wuPruneTool = {
|
|
|
556
702
|
async execute(input, options) {
|
|
557
703
|
const args = [];
|
|
558
704
|
if (input.execute)
|
|
559
|
-
args.push(
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
705
|
+
args.push(CliArgs.EXECUTE);
|
|
706
|
+
const result = await executeViaPack(CliCommands.WU_PRUNE, input, {
|
|
707
|
+
projectRoot: options?.projectRoot,
|
|
708
|
+
contextInput: {
|
|
709
|
+
metadata: {
|
|
710
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
711
|
+
},
|
|
712
|
+
},
|
|
713
|
+
fallback: {
|
|
714
|
+
command: CliCommands.WU_PRUNE,
|
|
715
|
+
args,
|
|
716
|
+
errorCode: ErrorCodes.WU_PRUNE_ERROR,
|
|
717
|
+
},
|
|
718
|
+
});
|
|
719
|
+
return result.success
|
|
720
|
+
? success(result.data ?? { message: WuCompletionLifecycleMessages.PRUNE_PASSED })
|
|
721
|
+
: error(result.error?.message ?? WuCompletionLifecycleMessages.PRUNE_FAILED, ErrorCodes.WU_PRUNE_ERROR);
|
|
568
722
|
},
|
|
569
723
|
};
|
|
570
724
|
/**
|
|
@@ -581,19 +735,27 @@ export const wuDeleteTool = {
|
|
|
581
735
|
}
|
|
582
736
|
const args = [];
|
|
583
737
|
if (input.id)
|
|
584
|
-
args.push(
|
|
738
|
+
args.push(CliArgs.ID, input.id);
|
|
585
739
|
if (input.dry_run)
|
|
586
740
|
args.push(CliArgs.DRY_RUN);
|
|
587
741
|
if (input.batch)
|
|
588
742
|
args.push('--batch', input.batch);
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
743
|
+
const result = await executeViaPack(CliCommands.WU_DELETE, input, {
|
|
744
|
+
projectRoot: options?.projectRoot,
|
|
745
|
+
contextInput: {
|
|
746
|
+
metadata: {
|
|
747
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
fallback: {
|
|
751
|
+
command: CliCommands.WU_DELETE,
|
|
752
|
+
args,
|
|
753
|
+
errorCode: ErrorCodes.WU_DELETE_ERROR,
|
|
754
|
+
},
|
|
755
|
+
});
|
|
756
|
+
return result.success
|
|
757
|
+
? success(result.data ?? { message: WuCompletionLifecycleMessages.DELETE_PASSED })
|
|
758
|
+
: error(result.error?.message ?? WuCompletionLifecycleMessages.DELETE_FAILED, ErrorCodes.WU_DELETE_ERROR);
|
|
597
759
|
},
|
|
598
760
|
};
|
|
599
761
|
/**
|
|
@@ -608,17 +770,25 @@ export const wuCleanupTool = {
|
|
|
608
770
|
if (!input.id) {
|
|
609
771
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
610
772
|
}
|
|
611
|
-
const args = [
|
|
773
|
+
const args = [CliArgs.ID, input.id];
|
|
612
774
|
if (input.artifacts)
|
|
613
775
|
args.push('--artifacts');
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
776
|
+
const result = await executeViaPack(CliCommands.WU_CLEANUP, input, {
|
|
777
|
+
projectRoot: options?.projectRoot,
|
|
778
|
+
contextInput: {
|
|
779
|
+
metadata: {
|
|
780
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
fallback: {
|
|
784
|
+
command: CliCommands.WU_CLEANUP,
|
|
785
|
+
args,
|
|
786
|
+
errorCode: ErrorCodes.WU_CLEANUP_ERROR,
|
|
787
|
+
},
|
|
788
|
+
});
|
|
789
|
+
return result.success
|
|
790
|
+
? success(result.data ?? { message: WuCompletionLifecycleMessages.CLEANUP_PASSED })
|
|
791
|
+
: error(result.error?.message ?? WuCompletionLifecycleMessages.CLEANUP_FAILED, ErrorCodes.WU_CLEANUP_ERROR);
|
|
622
792
|
},
|
|
623
793
|
};
|
|
624
794
|
/**
|
|
@@ -636,14 +806,22 @@ export const wuBriefTool = {
|
|
|
636
806
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
637
807
|
}
|
|
638
808
|
const args = buildWuPromptArgs(input);
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
809
|
+
const result = await executeViaPack(CliCommands.WU_BRIEF, input, {
|
|
810
|
+
projectRoot: options?.projectRoot,
|
|
811
|
+
contextInput: {
|
|
812
|
+
metadata: {
|
|
813
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
fallback: {
|
|
817
|
+
command: CliCommands.WU_BRIEF,
|
|
818
|
+
args,
|
|
819
|
+
errorCode: ErrorCodes.WU_BRIEF_ERROR,
|
|
820
|
+
},
|
|
821
|
+
});
|
|
822
|
+
return result.success
|
|
823
|
+
? success(result.data ?? { message: WuDelegationAndGatesMessages.BRIEF_PASSED })
|
|
824
|
+
: error(result.error?.message ?? WuDelegationAndGatesMessages.BRIEF_FAILED, ErrorCodes.WU_BRIEF_ERROR);
|
|
647
825
|
},
|
|
648
826
|
};
|
|
649
827
|
/**
|
|
@@ -661,14 +839,22 @@ export const wuDelegateTool = {
|
|
|
661
839
|
return error(ErrorMessages.PARENT_WU_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
662
840
|
}
|
|
663
841
|
const args = buildWuPromptArgs(input);
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
842
|
+
const result = await executeViaPack(CliCommands.WU_DELEGATE, input, {
|
|
843
|
+
projectRoot: options?.projectRoot,
|
|
844
|
+
contextInput: {
|
|
845
|
+
metadata: {
|
|
846
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
847
|
+
},
|
|
848
|
+
},
|
|
849
|
+
fallback: {
|
|
850
|
+
command: CliCommands.WU_DELEGATE,
|
|
851
|
+
args,
|
|
852
|
+
errorCode: ErrorCodes.WU_DELEGATE_ERROR,
|
|
853
|
+
},
|
|
854
|
+
});
|
|
855
|
+
return result.success
|
|
856
|
+
? success(result.data ?? { message: WuDelegationAndGatesMessages.DELEGATE_PASSED })
|
|
857
|
+
: error(result.error?.message ?? WuDelegationAndGatesMessages.DELEGATE_FAILED, ErrorCodes.WU_DELEGATE_ERROR);
|
|
672
858
|
},
|
|
673
859
|
};
|
|
674
860
|
/**
|
|
@@ -683,17 +869,20 @@ export const wuValidateTool = {
|
|
|
683
869
|
if (!input.id) {
|
|
684
870
|
return error(ErrorMessages.ID_REQUIRED, ErrorCodes.MISSING_PARAMETER);
|
|
685
871
|
}
|
|
686
|
-
const args = [
|
|
872
|
+
const args = [CliArgs.ID, input.id];
|
|
687
873
|
if (input.no_strict)
|
|
688
|
-
args.push(
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
874
|
+
args.push(WuQueryFlags.NO_STRICT);
|
|
875
|
+
const result = await executeViaPack(CliCommands.WU_VALIDATE, input, {
|
|
876
|
+
projectRoot: options?.projectRoot,
|
|
877
|
+
fallback: {
|
|
878
|
+
command: CliCommands.WU_VALIDATE,
|
|
879
|
+
args,
|
|
880
|
+
errorCode: ErrorCodes.WU_VALIDATE_ERROR,
|
|
881
|
+
},
|
|
882
|
+
});
|
|
883
|
+
return result.success
|
|
884
|
+
? success(result.data ?? { message: WuQueryMessages.VALIDATE_PASSED })
|
|
885
|
+
: error(result.error?.message ?? WuQueryMessages.VALIDATE_FAILED, ErrorCodes.WU_VALIDATE_ERROR);
|
|
697
886
|
},
|
|
698
887
|
};
|
|
699
888
|
/**
|
|
@@ -707,22 +896,25 @@ export const wuInferLaneTool = {
|
|
|
707
896
|
async execute(input, options) {
|
|
708
897
|
const args = [];
|
|
709
898
|
if (input.id)
|
|
710
|
-
args.push(
|
|
899
|
+
args.push(CliArgs.ID, input.id);
|
|
711
900
|
if (input.paths) {
|
|
712
901
|
for (const p of input.paths) {
|
|
713
|
-
args.push(
|
|
902
|
+
args.push(WuQueryFlags.PATHS, p);
|
|
714
903
|
}
|
|
715
904
|
}
|
|
716
905
|
if (input.desc)
|
|
717
|
-
args.push(
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
906
|
+
args.push(WuQueryFlags.DESC, input.desc);
|
|
907
|
+
const result = await executeViaPack(CliCommands.WU_INFER_LANE, input, {
|
|
908
|
+
projectRoot: options?.projectRoot,
|
|
909
|
+
fallback: {
|
|
910
|
+
command: CliCommands.WU_INFER_LANE,
|
|
911
|
+
args,
|
|
912
|
+
errorCode: ErrorCodes.WU_INFER_LANE_ERROR,
|
|
913
|
+
},
|
|
914
|
+
});
|
|
915
|
+
return result.success
|
|
916
|
+
? success(result.data ?? { lane: 'Unknown' })
|
|
917
|
+
: error(result.error?.message ?? WuQueryMessages.INFER_LANE_FAILED, ErrorCodes.WU_INFER_LANE_ERROR);
|
|
726
918
|
},
|
|
727
919
|
};
|
|
728
920
|
/**
|
|
@@ -740,29 +932,31 @@ export const wuUnlockLaneTool = {
|
|
|
740
932
|
}
|
|
741
933
|
const args = [];
|
|
742
934
|
if (input.lane)
|
|
743
|
-
args.push(
|
|
935
|
+
args.push(CliArgs.LANE, input.lane);
|
|
744
936
|
if (input.reason)
|
|
745
|
-
args.push(
|
|
937
|
+
args.push(CliArgs.REASON, input.reason);
|
|
746
938
|
if (input.force)
|
|
747
|
-
args.push(
|
|
939
|
+
args.push(CliArgs.FORCE);
|
|
748
940
|
if (input.list)
|
|
749
941
|
args.push('--list');
|
|
750
942
|
if (input.status)
|
|
751
|
-
args.push(
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
943
|
+
args.push(CliArgs.STATUS);
|
|
944
|
+
const result = await executeViaPack(CliCommands.WU_UNLOCK_LANE, input, {
|
|
945
|
+
projectRoot: options?.projectRoot,
|
|
946
|
+
contextInput: {
|
|
947
|
+
metadata: {
|
|
948
|
+
[MetadataKeys.PROJECT_ROOT]: options?.projectRoot,
|
|
949
|
+
},
|
|
950
|
+
},
|
|
951
|
+
fallback: {
|
|
952
|
+
command: CliCommands.WU_UNLOCK_LANE,
|
|
953
|
+
args,
|
|
954
|
+
errorCode: ErrorCodes.WU_UNLOCK_LANE_ERROR,
|
|
955
|
+
},
|
|
956
|
+
});
|
|
957
|
+
return result.success
|
|
958
|
+
? success(result.data ?? { message: WuDelegationAndGatesMessages.UNLOCK_PASSED })
|
|
959
|
+
: error(result.error?.message ?? WuDelegationAndGatesMessages.UNLOCK_FAILED, ErrorCodes.WU_UNLOCK_LANE_ERROR);
|
|
766
960
|
},
|
|
767
961
|
};
|
|
768
962
|
//# sourceMappingURL=wu-tools.js.map
|