## ADDED Requirements ### Requirement: Dify Integration The middleware server SHALL integrate with Dify LLM at https://dify.theaken.com/v1 for transcript summarization. #### Scenario: Successful summarization - **WHEN** user submits POST /api/ai/summarize with transcript text - **THEN** the server SHALL call Dify API and return structured JSON with conclusions and action_items #### Scenario: Dify timeout handling - **WHEN** Dify API does not respond within timeout period - **THEN** the server SHALL return HTTP 504 with timeout error and client can retry #### Scenario: Dify error handling - **WHEN** Dify API returns error (500, rate limit, etc.) - **THEN** the server SHALL return appropriate HTTP error with details ### Requirement: Structured Output Format The AI summarization SHALL return structured data with conclusions and action items. #### Scenario: Complete structured response - **WHEN** transcript contains clear decisions and assignments - **THEN** response SHALL include conclusions array and action_items array with content, owner, due_date fields #### Scenario: Partial data extraction - **WHEN** transcript lacks explicit owner or due_date for action items - **THEN** those fields SHALL be empty strings allowing manual completion ### Requirement: Dify Prompt Configuration The Dify workflow SHALL be configured with appropriate system prompt for meeting summarization. #### Scenario: System prompt behavior - **WHEN** transcript is sent to Dify - **THEN** Dify SHALL use configured prompt to extract conclusions and action_items in JSON format ### Requirement: Manual Data Completion The Electron client SHALL allow users to manually complete missing AI-extracted data. #### Scenario: Fill missing owner - **WHEN** AI returns action item without owner - **THEN** user SHALL be able to select or type owner name in the UI #### Scenario: Fill missing due date - **WHEN** AI returns action item without due_date - **THEN** user SHALL be able to select date using date picker