feat(process): report live capture progress through CLI and MCP
Long captures emitted only a final result, so a quiet child looked idle. Pass the shared rate-limited progress reporter through the capture lifecycle and report the observed phase, elapsed time, and collected-unit counts. CLI writes those lines to stderr; MCP forwards them only when the client supplied a progress token. Final Evidence on stdout keeps its shape.
This commit is contained in:
@@ -90,24 +90,20 @@ const registerProcessTools = ({
|
||||
toolRegistrationOptions(captureContract),
|
||||
async (input, context) => {
|
||||
const progress = mcpProgressReporter(context);
|
||||
await progress.report({
|
||||
phase: captureContract.name,
|
||||
completed: 0,
|
||||
total: 1,
|
||||
message: "started",
|
||||
});
|
||||
const captured = await logToolExecution(
|
||||
logger,
|
||||
captureContract.name,
|
||||
() => captureProcessScenario(input, context.mcpReq.signal),
|
||||
() =>
|
||||
captureProcessScenario(
|
||||
input,
|
||||
context.mcpReq.signal,
|
||||
process.platform,
|
||||
process.env,
|
||||
undefined,
|
||||
undefined,
|
||||
progress,
|
||||
),
|
||||
);
|
||||
await progress.report({
|
||||
phase: captureContract.name,
|
||||
completed: 1,
|
||||
total: 1,
|
||||
message: captured.ok ? "completed" : "failed",
|
||||
terminal: true,
|
||||
});
|
||||
if (!captured.ok)
|
||||
return server.delivery.toCallToolResult(captured, captureContract);
|
||||
const evidence = createProcessCaptureEvidence(input, captured.value);
|
||||
|
||||
Reference in New Issue
Block a user