feat(telemetry): Integrate telemetry for expand-all, aggregate results
This commit implements AI usage telemetry for the `expand-all-tasks` command/tool and refactors its CLI output for clarity and consistency. Key Changes: 1. **Telemetry Integration for `expand-all-tasks` (Subtask 77.8):**\n - The `expandAllTasks` core logic (`scripts/modules/task-manager/expand-all-tasks.js`) now calls the `expandTask` function for each eligible task and collects the individual `telemetryData` returned.\n - A new helper function `_aggregateTelemetry` (in `utils.js`) is used to sum up token counts and costs from all individual expansions into a single `telemetryData` object for the entire `expand-all` operation.\n - The `expandAllTasksDirect` wrapper (`mcp-server/src/core/direct-functions/expand-all-tasks.js`) now receives and passes this aggregated `telemetryData` in the MCP response.\n - For CLI usage, `displayAiUsageSummary` is called once with the aggregated telemetry. 2. **Improved CLI Output for `expand-all`:**\n - The `expandAllTasks` core function now handles displaying a final "Expansion Summary" box (showing Attempted, Expanded, Skipped, Failed counts) directly after the aggregated telemetry summary.\n - This consolidates all summary output within the core function for better flow and removes redundant logging from the command action in `scripts/modules/commands.js`.\n - The summary box border is green for success and red if any expansions failed. 3. **Code Refinements:**\n - Ensured `chalk` and `boxen` are imported in `expand-all-tasks.js` for the new summary box.\n - Minor adjustments to logging messages for clarity.
This commit is contained in:
@@ -64,3 +64,41 @@ Testing should verify the complete workflow functions correctly:
|
||||
5. Regression Testing:
|
||||
- Verify that existing functionality continues to work
|
||||
- Ensure compatibility with keyboard shortcuts and accessibility features
|
||||
|
||||
# Subtasks:
|
||||
## 1. Design Task Expansion UI Components [pending]
|
||||
### Dependencies: None
|
||||
### Description: Create UI components for the expanded task suggestion actions card that allow for task breakdown and additional context input.
|
||||
### Details:
|
||||
Design mockups for expanded card view, including subtask creation interface, context input fields, and task management controls. Ensure the design is consistent with existing UI patterns and responsive across different screen sizes. Include animations for card expansion/collapse.
|
||||
|
||||
## 2. Implement State Management for Task Expansion [pending]
|
||||
### Dependencies: 47.1
|
||||
### Description: Develop the state management logic to handle expanded task states, subtask creation, and context additions.
|
||||
### Details:
|
||||
Create state handlers for expanded/collapsed states, subtask array management, and context data. Implement proper validation for user inputs and error handling. Ensure state persistence across user sessions and synchronization with backend services.
|
||||
|
||||
## 3. Build Context Addition Functionality [pending]
|
||||
### Dependencies: 47.2
|
||||
### Description: Create the functionality that allows users to add additional context to tasks and subtasks.
|
||||
### Details:
|
||||
Implement context input fields with support for rich text, attachments, links, and references to other tasks. Add auto-save functionality for context changes and version history if applicable. Include context suggestion features based on task content.
|
||||
|
||||
## 4. Develop Task Management Controls [pending]
|
||||
### Dependencies: 47.2
|
||||
### Description: Implement controls for managing tasks within the expanded card view, including prioritization, scheduling, and assignment.
|
||||
### Details:
|
||||
Create UI controls for task prioritization (drag-and-drop ranking), deadline setting with calendar integration, assignee selection with user search, and status updates. Implement notification triggers for task changes and deadline reminders.
|
||||
|
||||
## 5. Integrate with Existing Task Systems [pending]
|
||||
### Dependencies: 47.3, 47.4
|
||||
### Description: Ensure the enhanced actions card workflow integrates seamlessly with existing task management functionality.
|
||||
### Details:
|
||||
Connect the new UI components to existing backend APIs. Update data models if necessary to support new features. Ensure compatibility with existing task filters, search, and reporting features. Implement data migration plan for existing tasks if needed.
|
||||
|
||||
## 6. Test and Optimize User Experience [pending]
|
||||
### Dependencies: 47.5
|
||||
### Description: Conduct thorough testing of the enhanced workflow and optimize based on user feedback and performance metrics.
|
||||
### Details:
|
||||
Perform usability testing with representative users. Collect metrics on task completion time, error rates, and user satisfaction. Optimize performance for large task lists and complex subtask hierarchies. Implement A/B testing for alternative UI approaches if needed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user