From cc4ab4d34509f28ca5f5cca3996e638a97f041e3 Mon Sep 17 00:00:00 2001 From: aegntic Date: Thu, 2 Oct 2025 08:10:08 +1000 Subject: [PATCH 01/13] feat: add Smart Task Organizer recipe for Hacktoberfest Add an impressive beginner-level recipe that automatically organizes and prioritizes tasks from various sources (files, emails, messages) into actionable todo lists using AI-powered automation. Key Features: - Multi-source task extraction (files, emails, messages, notes) - Intelligent categorization by urgency and importance - Project-based task organization - Priority filtering and deadline tracking - Actionable task transformation Recipe Details: - Uses exactly 1 built-in MCP server (Filesystem) - beginner requirement - Comprehensive parameter system for flexible task management - Detailed prompt template with conditional logic - Follows proper YAML structure and validation - Addresses real-world productivity challenges Hacktoberfest Contribution: - Addresses issue #4933: Beginner Recipe Submission #2 - Meets all beginner recipe criteria - Provides immediate value to users - Demonstrates practical AI workflow automation Impact: - Helps users turn scattered information into organized action plans - Reduces task overwhelm through intelligent prioritization - Enhances productivity with automated task management - Showcases practical AI-assisted workflow optimization Signed-off-by: aegntic --- .../data/recipes/smart-task-organizer.yaml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml new file mode 100644 index 000000000000..5ad7c452089d --- /dev/null +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -0,0 +1,115 @@ +version: 1.0.0 +title: Smart Task Organizer +author: + contact: research@aegntic.ai +description: Automatically organize and prioritize tasks from files, emails, and messages into an actionable todo list +instructions: | + You are an intelligent task organizer that helps users turn scattered information into organized, actionable task lists. Your job is to scan various sources (files, messages, notes) and extract, categorize, and prioritize tasks effectively. + + Focus on: + - Identifying concrete action items from text + - Categorizing tasks by urgency and importance + - Organizing tasks by project and context + - Providing clear next steps for each task +activities: + - Scan and parse text files for action items + - Extract tasks from emails and messages + - Categorize tasks by priority and project + - Generate organized todo lists with deadlines + - Create follow-up reminders +parameters: + - key: source_type + input_type: string + requirement: required + description: "Type of source to scan: files, emails, messages, notes, all" + - key: priority_level + input_type: string + requirement: optional + description: "Filter by priority: urgent, high, medium, low, all" + default: all + - key: project_filter + input_type: string + requirement: optional + description: "Filter tasks by specific project name" + default: "" +extensions: + - type: builtin + name: filesystem + display_name: Filesystem + timeout: 300 + bundled: true +prompt: | + {% if source_type == "files" or source_type == "all" %} + 1. Scan the current directory and subdirectories for files that might contain tasks: + - Look for files with extensions: .txt, .md, .doc, .docx, .notes, .todo + - Also check README files, meeting notes, and project files + - Search for common task indicators: TODO, FIXME, ACTION ITEM, TASK, REMINDER, FOLLOW UP + + {% endif %} + + {% if source_type == "emails" or source_type == "all" %} + 2. Look for email files or export files (.eml, .msg, .txt) that might contain tasks: + - Search for action verbs: please, need to, should, must, review, complete, submit + - Look for deadline indicators: by, due, EOD, EOW, ASAP, urgent + + {% endif %} + + {% if source_type == "messages" or source_type == "all" %} + 3. Check for chat logs, message exports, or conversation files: + - Extract commitments and promises made + - Identify questions that need responses + - Find meeting follow-ups required + + {% endif %} + + {% if source_type == "notes" or source_type == "all" %} + 4. Scan for note files and brain dumps: + - Convert random thoughts into actionable items + - Organize ideas into concrete tasks + - Identify dependencies between tasks + + {% endif %} + + 5. For each task found, extract and organize: + - Task description (what needs to be done) + - Priority level (urgent/high/medium/low) + - Project or category + - Deadline (if mentioned) + - Dependencies (what needs to be done first) + - Estimated time to complete + + 6. Create an organized task list with the following structure: + + ## 🚀 URGENT TASKS (Today) + [Tasks that must be completed today] + + ## 📅 HIGH PRIORITY (This Week) + [Important tasks with clear deadlines] + + ## 🎯 MEDIUM PRIORITY (This Sprint/Month) + [Important but less time-sensitive tasks] + + ## 📝 LOW PRIORITY (When Time Allows) + [Nice-to-have tasks and ideas] + + 7. For each task, include: + - Clear action verb (Review, Complete, Create, Contact, etc.) + - Specific deliverable or outcome + - Deadline (if available) + - Next immediate step to get started + + {% if priority_level != "all" %} + 8. Filter the results to show only {{ priority_level }} priority tasks. + {% endif %} + + {% if project_filter %} + 9. Focus specifically on tasks related to the "{{ project_filter }}" project. + {% endif %} + + 10. Provide a summary of: + - Total tasks found + - Tasks by priority level + - Immediate next steps (top 3 tasks to start with) + - Any potential blockers or dependencies identified + + Always make tasks actionable and specific. If you find vague items like "work on project," convert them to concrete next steps like "Review project requirements document and create task breakdown." \ No newline at end of file From 5b276e706947322b93a6dca5f34b5892ae79dc03 Mon Sep 17 00:00:00 2001 From: aegntic Date: Sat, 4 Oct 2025 20:56:30 +1000 Subject: [PATCH 02/13] Update documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml Co-authored-by: Rizel Scarlett Signed-off-by: aegntic --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 5ad7c452089d..bb461e5082ff 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -37,7 +37,7 @@ extensions: name: filesystem display_name: Filesystem timeout: 300 - bundled: true + bundled: false prompt: | {% if source_type == "files" or source_type == "all" %} 1. Scan the current directory and subdirectories for files that might contain tasks: From ab2db30745cd14bcbf219c2ff6ac5f91a9a0f2b5 Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Sat, 4 Oct 2025 07:51:48 -0400 Subject: [PATCH 03/13] Apply suggestion from @blackgirlbytes --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index bb461e5082ff..563b5faf0973 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -33,7 +33,7 @@ parameters: description: "Filter tasks by specific project name" default: "" extensions: - - type: builtin + - type: stdio name: filesystem display_name: Filesystem timeout: 300 From 41c653594d39915b2d2e906779481e6adf3dc697 Mon Sep 17 00:00:00 2001 From: aegntic Date: Sat, 4 Oct 2025 22:00:20 +1000 Subject: [PATCH 04/13] fix: correct bundled field for filesystem extension Signed-off-by: aegntic --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index bb461e5082ff..5ad7c452089d 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -37,7 +37,7 @@ extensions: name: filesystem display_name: Filesystem timeout: 300 - bundled: false + bundled: true prompt: | {% if source_type == "files" or source_type == "all" %} 1. Scan the current directory and subdirectories for files that might contain tasks: From 2e1c16cdc39befd67b1b803f80cd902d862208ba Mon Sep 17 00:00:00 2001 From: aegntic Date: Sat, 4 Oct 2025 22:07:28 +1000 Subject: [PATCH 05/13] fix: add cmd field for stdio filesystem extension Signed-off-by: aegntic --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 58f9d7050822..56a3847a7de9 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -35,6 +35,7 @@ parameters: extensions: - type: stdio name: filesystem + cmd: goose display_name: Filesystem timeout: 300 bundled: true From d96d173b2372bf55f19fa1ebd8e13fa4d8baa863 Mon Sep 17 00:00:00 2001 From: aegntic Date: Sat, 4 Oct 2025 22:11:20 +1000 Subject: [PATCH 06/13] fix: add args field for stdio filesystem extension Signed-off-by: aegntic --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 56a3847a7de9..a321f4b98602 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -36,6 +36,7 @@ extensions: - type: stdio name: filesystem cmd: goose + args: ["mcp", "filesystem"] display_name: Filesystem timeout: 300 bundled: true From 252384092d84722d84034a936bbcca4915700a4e Mon Sep 17 00:00:00 2001 From: aegntic Date: Sat, 4 Oct 2025 22:13:28 +1000 Subject: [PATCH 07/13] feat: enhance with MCP prompts and prompt chains for intelligent task organization - Add structured 4-phase prompt system (discovery, analysis, organization, summary) - Implement prompt chain definition for sequential processing - Create specialized agent prompts for each phase - Enhance MCP filesystem integration with specific capabilities - Add intelligent task extraction and prioritization rules - Include comprehensive output filtering and workflow optimization - Improve actionable insights and next steps generation Signed-off-by: aegntic --- .../data/recipes/smart-task-organizer.yaml | 226 +++++++++++++----- 1 file changed, 172 insertions(+), 54 deletions(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index a321f4b98602..4a75fcab0ac8 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -40,78 +40,196 @@ extensions: display_name: Filesystem timeout: 300 bundled: true +prompts: + # Phase 1: Discovery and Scanning + discovery_prompt: | + You are a Task Discovery Agent. Your job is to scan and identify potential tasks from various sources. + + {% if source_type == "files" or source_type == "all" %} + Scan the current directory and subdirectories for files that might contain tasks: + - Look for files with extensions: .txt, .md, .doc, .docx, .notes, .todo + - Check README files, meeting notes, and project files + - Search for task indicators: TODO, FIXME, ACTION ITEM, TASK, REMINDER, FOLLOW UP, NEED TO, SHOULD + + For each file found, extract: + - File path and name + - Raw task text + - Context surrounding the task + - Any deadline or priority mentions + {% endif %} + + {% if source_type == "emails" or source_type == "all" %} + Look for email files or export files (.eml, .msg, .txt) that might contain tasks: + - Search for action verbs: please, need to, should, must, review, complete, submit + - Look for deadline indicators: by, due, EOD, EOW, ASAP, urgent + - Extract sender/recipient context + {% endif %} + + {% if source_type == "messages" or source_type == "all" %} + Check for chat logs, message exports, or conversation files: + - Extract commitments and promises made + - Identify questions that need responses + - Find meeting follow-ups required + - Note conversation participants and context + {% endif %} + + {% if source_type == "notes" or source_type == "all" %} + Scan for note files and brain dumps: + - Convert random thoughts into actionable items + - Organize ideas into concrete tasks + - Identify dependencies between tasks + {% endif %} + + Return a structured list of raw task candidates with their source context. + + # Phase 2: Task Analysis and Prioritization + analysis_prompt: | + You are a Task Analysis Agent. Your job is to analyze raw task candidates and extract structured information. + + For each task candidate provided: + 1. Extract and standardize: + - Clear task description (what needs to be done) + - Priority level (urgent/high/medium/low) based on context + - Project or category affiliation + - Deadline (if mentioned, normalize to standard format) + - Dependencies (what needs to be done first) + - Estimated time to complete (if inferable) + - Source location and context + + 2. Apply prioritization rules: + - URGENT: Today deadlines, blocking others, explicit "urgent" markers + - HIGH: This week deadlines, important milestones, commitments to others + - MEDIUM: Important but flexible, personal goals, nice-to-have-soon + - LOW: Ideas, future considerations, optional improvements + + 3. Convert vague items to specific actions: + - "work on project" → "Review project requirements document and create task breakdown" + - "fix bugs" → "Identify and prioritize top 3 critical bugs in the backlog" + - "update documentation" → "Update API documentation for new endpoints added in v2.1" + + Return structured task objects with all extracted fields. + + # Phase 3: Organization and Structuring + organization_prompt: | + You are a Task Organization Agent. Your job is to organize analyzed tasks into a structured, actionable format. + + Organize the provided tasks into the following structure: + + ## 🚀 URGENT TASKS (Today) + [Tasks that must be completed today - include specific deadlines] + + ## 📅 HIGH PRIORITY (This Week) + [Important tasks with clear deadlines this week] + + ## 🎯 MEDIUM PRIORITY (This Sprint/Month) + [Important but less time-sensitive tasks] + + ## 📝 LOW PRIORITY (When Time Allows) + [Nice-to-have tasks and ideas] + + For each task, include: + - ✅ [Status] Task title (clear action verb + specific outcome) + - 📅 Deadline: [specific date or timeframe] + - 🎯 Project: [project/category] + - ⏱️ Estimate: [time estimate if available] + - 🔄 Dependencies: [what needs to be done first] + - 📍 Source: [where this task came from] + + Group related tasks together when possible and suggest logical workflows. + + # Phase 4: Summary and Action Planning + summary_prompt: | + You are an Action Planning Agent. Your job is to provide a comprehensive summary and immediate next steps. + + Based on the organized task list, provide: + + ## 📊 Task Summary + - Total tasks found: [number] + - Tasks by priority: Urgent: [X], High: [Y], Medium: [Z], Low: [W] + - Tasks by project: [breakdown] + - Estimated completion time: [total if available] + + ## 🎯 Immediate Next Steps (Top 3) + 1. [Most urgent task with clear first step] + 2. [Second priority task] + 3. [Third priority task] + + ## ⚠️ Potential Blockers + - [List any dependencies, resource constraints, or timing conflicts] + + ## 💡 Optimization Suggestions + - [Suggest ways to batch similar tasks, delegate, or streamline workflow] + + ## 🔄 Recommended Workflow + 1. [Suggested order of operations] + 2. [How to track progress] + 3. [When to review and update] + + Focus on actionable insights that help the user get started immediately. + +# Prompt Chain Definition +prompt_chain: + - step: discovery + prompt_ref: discovery_prompt + output_filter: "Extract raw task candidates with source context" + + - step: analysis + prompt_ref: analysis_prompt + input_from: discovery + output_filter: "Structured task objects with priority and metadata" + + - step: organization + prompt_ref: organization_prompt + input_from: analysis + output_filter: "Organized task list by priority categories" + + - step: summary + prompt_ref: summary_prompt + input_from: organization + output_filter: "Comprehensive summary and action plan" + +# Main execution prompt that ties it all together prompt: | - {% if source_type == "files" or source_type == "all" %} - 1. Scan the current directory and subdirectories for files that might contain tasks: - - Look for files with extensions: .txt, .md, .doc, .docx, .notes, .todo - - Also check README files, meeting notes, and project files - - Search for common task indicators: TODO, FIXME, ACTION ITEM, TASK, REMINDER, FOLLOW UP + You are an intelligent Smart Task Organizer using MCP filesystem capabilities. Execute the complete task organization workflow: + {% if source_type == "files" or source_type == "all" %} + 📁 **File Scanning Phase:** + Use filesystem MCP to scan directories and read files containing potential tasks. {% endif %} {% if source_type == "emails" or source_type == "all" %} - 2. Look for email files or export files (.eml, .msg, .txt) that might contain tasks: - - Search for action verbs: please, need to, should, must, review, complete, submit - - Look for deadline indicators: by, due, EOD, EOW, ASAP, urgent - + 📧 **Email Processing Phase:** + Locate and parse email files for task-related content. {% endif %} {% if source_type == "messages" or source_type == "all" %} - 3. Check for chat logs, message exports, or conversation files: - - Extract commitments and promises made - - Identify questions that need responses - - Find meeting follow-ups required - + 💬 **Message Analysis Phase:** + Process chat logs and conversation files for commitments and action items. {% endif %} {% if source_type == "notes" or source_type == "all" %} - 4. Scan for note files and brain dumps: - - Convert random thoughts into actionable items - - Organize ideas into concrete tasks - - Identify dependencies between tasks - + 📝 **Note Organization Phase:** + Extract and structure tasks from notes and brain dumps. {% endif %} - 5. For each task found, extract and organize: - - Task description (what needs to be done) - - Priority level (urgent/high/medium/low) - - Project or category - - Deadline (if mentioned) - - Dependencies (what needs to be done first) - - Estimated time to complete - - 6. Create an organized task list with the following structure: - - ## 🚀 URGENT TASKS (Today) - [Tasks that must be completed today] - - ## 📅 HIGH PRIORITY (This Week) - [Important tasks with clear deadlines] - - ## 🎯 MEDIUM PRIORITY (This Sprint/Month) - [Important but less time-sensitive tasks] - - ## 📝 LOW PRIORITY (When Time Allows) - [Nice-to-have tasks and ideas] - - 7. For each task, include: - - Clear action verb (Review, Complete, Create, Contact, etc.) - - Specific deliverable or outcome - - Deadline (if available) - - Next immediate step to get started + Execute the complete prompt chain: + 1. **Discovery**: Find all potential task sources + 2. **Analysis**: Extract and prioritize structured task data + 3. **Organization**: Create organized task lists by priority + 4. **Summary**: Generate actionable insights and next steps {% if priority_level != "all" %} - 8. Filter the results to show only {{ priority_level }} priority tasks. + **Priority Filter**: Focus exclusively on {{ priority_level }} priority tasks {% endif %} {% if project_filter %} - 9. Focus specifically on tasks related to the "{{ project_filter }}" project. + **Project Focus**: Specialize in tasks related to "{{ project_filter }}" {% endif %} - 10. Provide a summary of: - - Total tasks found - - Tasks by priority level - - Immediate next steps (top 3 tasks to start with) - - Any potential blockers or dependencies identified + Use the filesystem MCP capabilities to: + - Read file contents efficiently + - Navigate directory structures + - Process multiple files in parallel when possible + - Maintain context across file operations - Always make tasks actionable and specific. If you find vague items like "work on project," convert them to concrete next steps like "Review project requirements document and create task breakdown." \ No newline at end of file + Apply intelligent task extraction, prioritization, and organization to transform scattered information into actionable, prioritized task lists. \ No newline at end of file From af4f2a3353f6b69654390571a2a691c8098a1e25 Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Sat, 4 Oct 2025 08:40:44 -0400 Subject: [PATCH 08/13] Apply suggestion from @blackgirlbytes --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 4a75fcab0ac8..93d8a21a3f94 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -36,7 +36,7 @@ extensions: - type: stdio name: filesystem cmd: goose - args: ["mcp", "filesystem"] + args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory] display_name: Filesystem timeout: 300 bundled: true From ce192c5b6c500c7bc8eedf5fb459a73a7e60acc9 Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Sat, 4 Oct 2025 08:41:01 -0400 Subject: [PATCH 09/13] Apply suggestion from @blackgirlbytes --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 93d8a21a3f94..84177637381d 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -35,7 +35,7 @@ parameters: extensions: - type: stdio name: filesystem - cmd: goose + cmd: npx args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory] display_name: Filesystem timeout: 300 From a6f8f7eb89c371e1a978d0355ee63534d30cd9cc Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Sat, 4 Oct 2025 08:41:18 -0400 Subject: [PATCH 10/13] Apply suggestion from @blackgirlbytes --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 84177637381d..5ef1c4a67bf7 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -39,7 +39,7 @@ extensions: args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory] display_name: Filesystem timeout: 300 - bundled: true + bundled: false prompts: # Phase 1: Discovery and Scanning discovery_prompt: | From 77c4f3198b298bd14776fdf3cc67a7085616cd0d Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Sat, 4 Oct 2025 08:43:33 -0400 Subject: [PATCH 11/13] Apply suggestion from @blackgirlbytes --- .../src/pages/recipes/data/recipes/smart-task-organizer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml index 5ef1c4a67bf7..eba4cde93102 100644 --- a/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml +++ b/documentation/src/pages/recipes/data/recipes/smart-task-organizer.yaml @@ -36,7 +36,7 @@ extensions: - type: stdio name: filesystem cmd: npx - args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory] + args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"] display_name: Filesystem timeout: 300 bundled: false From 82828f1c18a83f1c80c45cc9f36de7fa9180d22b Mon Sep 17 00:00:00 2001 From: aegntic Date: Tue, 7 Oct 2025 04:07:41 +1100 Subject: [PATCH 12/13] fix: improve Windows OS detection in CLI installation script - Enhanced Windows detection for Git Bash, MSYS2, Cygwin, and WSL environments - Added multiple detection methods: WINDIR, OSTYPE, /proc/version, mount points, Windows executables - Fixed issue where Git Bash on Windows incorrectly detected as Linux - Added debug output to help troubleshoot OS detection issues - Improved extraction tool validation based on detected OS - Fixes #4848 where CLI installation failed due to downloading Linux tar.bz2 instead of Windows zip Closes #4848 Signed-off-by: aegntic diff --git a/download_cli.sh b/download_cli.sh index 21319241ae..107d3e7717 100755 --- a/download_cli.sh +++ b/download_cli.sh @@ -36,6 +36,20 @@ if ! command -v tar >/dev/null 2>&1 && ! command -v unzip >/dev/null 2>&1; then exit 1 fi +# Check for required extraction tools based on detected OS +if [ "$OS" = "windows" ]; then + # Windows uses PowerShell's built-in Expand-Archive - check if PowerShell is available + if ! command -v powershell.exe >/dev/null 2>&1 && ! command -v pwsh >/dev/null 2>&1; then + echo "Warning: PowerShell is recommended to extract Windows packages but was not found." + echo "Falling back to unzip if available." + fi +else + if ! command -v tar >/dev/null 2>&1; then + echo "Error: 'tar' is required to extract packages for $OS. Please install tar and try again." + exit 1 + fi +fi + # --- 2) Variables --- REPO="block/goose" @@ -58,12 +72,33 @@ else fi # --- 3) Detect OS/Architecture --- -OS=$(uname -s | tr '[:upper:]' '[:lower:]') +# Better OS detection for Windows environments +if [[ "${WINDIR:-}" ]] || [[ "${windir:-}" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then + OS="windows" +elif [[ -f "/proc/version" ]] && grep -q "Microsoft\|WSL" /proc/version 2>/dev/null; then + # WSL detection + OS="windows" +elif [[ "$PWD" =~ ^/mnt/[a-zA-Z]/ ]]; then + # WSL mount point detection (like /mnt/c/) + OS="windows" +elif [[ "$OSTYPE" == "darwin"* ]]; then + OS="darwin" +elif command -v powershell.exe >/dev/null 2>&1 || command -v cmd.exe >/dev/null 2>&1; then + # Check if Windows executables are available (another Windows indicator) + OS="windows" +elif [[ "$PWD" =~ ^/[a-zA-Z]/ ]] && [[ -d "/c" || -d "/d" || -d "/e" ]]; then + # Check for Windows-style mount points (like in Git Bash) + OS="windows" +else + # Fallback to uname for other systems + OS=$(uname -s | tr '[:upper:]' '[:lower:]') +fi + ARCH=$(uname -m) # Handle Windows environments (MSYS2, Git Bash, Cygwin, WSL) case "$OS" in - linux|darwin) ;; + linux|darwin|windows) ;; mingw*|msys*|cygwin*) OS="windows" ;; @@ -87,6 +122,16 @@ case "$ARCH" in ;; esac +# Debug output (safely handle undefined variables) +echo "WINDIR: ${WINDIR:-}" +echo "OSTYPE: $OSTYPE" +echo "uname -s: $(uname -s)" +echo "uname -m: $(uname -m)" +echo "PWD: $PWD" + +# Output the detected OS +echo "Detected OS: $OS with ARCH $ARCH" + # Build the filename and URL for the stable release if [ "$OS" = "darwin" ]; then FILE="goose-$ARCH-apple-darwin.tar.bz2" --- download_cli.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/download_cli.sh b/download_cli.sh index 21319241aec0..107d3e7717bc 100755 --- a/download_cli.sh +++ b/download_cli.sh @@ -36,6 +36,20 @@ if ! command -v tar >/dev/null 2>&1 && ! command -v unzip >/dev/null 2>&1; then exit 1 fi +# Check for required extraction tools based on detected OS +if [ "$OS" = "windows" ]; then + # Windows uses PowerShell's built-in Expand-Archive - check if PowerShell is available + if ! command -v powershell.exe >/dev/null 2>&1 && ! command -v pwsh >/dev/null 2>&1; then + echo "Warning: PowerShell is recommended to extract Windows packages but was not found." + echo "Falling back to unzip if available." + fi +else + if ! command -v tar >/dev/null 2>&1; then + echo "Error: 'tar' is required to extract packages for $OS. Please install tar and try again." + exit 1 + fi +fi + # --- 2) Variables --- REPO="block/goose" @@ -58,12 +72,33 @@ else fi # --- 3) Detect OS/Architecture --- -OS=$(uname -s | tr '[:upper:]' '[:lower:]') +# Better OS detection for Windows environments +if [[ "${WINDIR:-}" ]] || [[ "${windir:-}" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then + OS="windows" +elif [[ -f "/proc/version" ]] && grep -q "Microsoft\|WSL" /proc/version 2>/dev/null; then + # WSL detection + OS="windows" +elif [[ "$PWD" =~ ^/mnt/[a-zA-Z]/ ]]; then + # WSL mount point detection (like /mnt/c/) + OS="windows" +elif [[ "$OSTYPE" == "darwin"* ]]; then + OS="darwin" +elif command -v powershell.exe >/dev/null 2>&1 || command -v cmd.exe >/dev/null 2>&1; then + # Check if Windows executables are available (another Windows indicator) + OS="windows" +elif [[ "$PWD" =~ ^/[a-zA-Z]/ ]] && [[ -d "/c" || -d "/d" || -d "/e" ]]; then + # Check for Windows-style mount points (like in Git Bash) + OS="windows" +else + # Fallback to uname for other systems + OS=$(uname -s | tr '[:upper:]' '[:lower:]') +fi + ARCH=$(uname -m) # Handle Windows environments (MSYS2, Git Bash, Cygwin, WSL) case "$OS" in - linux|darwin) ;; + linux|darwin|windows) ;; mingw*|msys*|cygwin*) OS="windows" ;; @@ -87,6 +122,16 @@ case "$ARCH" in ;; esac +# Debug output (safely handle undefined variables) +echo "WINDIR: ${WINDIR:-}" +echo "OSTYPE: $OSTYPE" +echo "uname -s: $(uname -s)" +echo "uname -m: $(uname -m)" +echo "PWD: $PWD" + +# Output the detected OS +echo "Detected OS: $OS with ARCH $ARCH" + # Build the filename and URL for the stable release if [ "$OS" = "darwin" ]; then FILE="goose-$ARCH-apple-darwin.tar.bz2" From 7a79a1d03c541ffa3bbff26abb9159b24f18409e Mon Sep 17 00:00:00 2001 From: aegntic Date: Thu, 16 Oct 2025 22:24:32 +1100 Subject: [PATCH 13/13] chore: revert download_cli.sh to upstream state for PR #5032 Signed-off-by: aegntic --- download_cli.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/download_cli.sh b/download_cli.sh index 107d3e7717bc..30a142ef5bff 100755 --- a/download_cli.sh +++ b/download_cli.sh @@ -37,7 +37,7 @@ if ! command -v tar >/dev/null 2>&1 && ! command -v unzip >/dev/null 2>&1; then fi # Check for required extraction tools based on detected OS -if [ "$OS" = "windows" ]; then +if [ "${OS:-}" = "windows" ]; then # Windows uses PowerShell's built-in Expand-Archive - check if PowerShell is available if ! command -v powershell.exe >/dev/null 2>&1 && ! command -v pwsh >/dev/null 2>&1; then echo "Warning: PowerShell is recommended to extract Windows packages but was not found." @@ -45,7 +45,7 @@ if [ "$OS" = "windows" ]; then fi else if ! command -v tar >/dev/null 2>&1; then - echo "Error: 'tar' is required to extract packages for $OS. Please install tar and try again." + echo "Error: 'tar' is required to extract packages for ${OS:-unknown}. Please install tar and try again." exit 1 fi fi @@ -282,12 +282,58 @@ else echo "Skipping 'goose configure', you may need to run this manually later" fi + + # --- 7) Check PATH and give instructions if needed --- if [[ ":$PATH:" != *":$GOOSE_BIN_DIR:"* ]]; then echo "" echo "Warning: goose installed, but $GOOSE_BIN_DIR is not in your PATH." - echo "Add it to your PATH by editing ~/.bashrc, ~/.zshrc, or similar:" - echo " export PATH=\"$GOOSE_BIN_DIR:\$PATH\"" - echo "Then reload your shell (e.g. 'source ~/.bashrc', 'source ~/.zshrc') to apply changes." + + if [ "$OS" = "windows" ]; then + echo "To add goose to your PATH in PowerShell:" + echo "" + echo "# Add to your PowerShell profile" + echo '$profilePath = $PROFILE' + echo 'if (!(Test-Path $profilePath)) { New-Item -Path $profilePath -ItemType File -Force }' + echo 'Add-Content -Path $profilePath -Value ''$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"''' + echo "# Reload profile or restart PowerShell" + echo '. $PROFILE' + echo "" + echo "Alternatively, you can run:" + echo " goose configure" + echo "or rerun this install script after updating your PATH." + else + SHELL_NAME=$(basename "$SHELL") + + echo "" + echo "The \$GOOSE_BIN_DIR is not in your PATH." + echo "What would you like to do?" + echo "1) Add it for me" + echo "2) I'll add it myself, show instructions" + + read -p "Enter choice [1/2]: " choice + + case "$choice" in + 1) + RC_FILE="$HOME/.${SHELL_NAME}rc" + echo "Adding \$GOOSE_BIN_DIR to $RC_FILE..." + echo "export PATH=\"$GOOSE_BIN_DIR:\$PATH\"" >> "$RC_FILE" + echo "Done! Reload your shell or run 'source $RC_FILE' to apply changes." + ;; + 2) + echo "" + echo "Add it to your PATH by editing ~/.${SHELL_NAME}rc or similar:" + echo " export PATH=\"$GOOSE_BIN_DIR:\$PATH\"" + echo "Then reload your shell (e.g. 'source ~/.${SHELL_NAME}rc') to apply changes." + ;; + *) + echo "Invalid choice. Please add \$GOOSE_BIN_DIR to your PATH manually." + ;; + esac + fi + echo "" fi + + +