feat(telemetry): Integrate AI usage telemetry into update-tasks
This commit applies the standard telemetry pattern to the command and its corresponding MCP tool.
Key Changes:
1. **Core Logic ():**
- The call to now includes and .
- The full response is captured.
- (the AI-generated text) is used for parsing the updated task JSON.
- If running in CLI mode (), is called with the .
- The function now returns .
2. **Direct Function ():**
- The call to the core function now passes the necessary context for telemetry (, ).
- The successful response object now correctly extracts and includes it in the field returned to the MCP client.
This commit is contained in:
@@ -81,7 +81,6 @@ export async function updateTasksDirect(args, log, context = {}) {
|
||||
'json'
|
||||
);
|
||||
|
||||
// updateTasks returns { success: true, updatedTasks: [...] } on success
|
||||
if (result && result.success && Array.isArray(result.updatedTasks)) {
|
||||
logWrapper.success(
|
||||
`Successfully updated ${result.updatedTasks.length} tasks.`
|
||||
@@ -91,7 +90,8 @@ export async function updateTasksDirect(args, log, context = {}) {
|
||||
data: {
|
||||
message: `Successfully updated ${result.updatedTasks.length} tasks.`,
|
||||
tasksFile,
|
||||
updatedCount: result.updatedTasks.length
|
||||
updatedCount: result.updatedTasks.length,
|
||||
telemetryData: result.telemetryData
|
||||
}
|
||||
};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user