# pull_requests

title: Create pattern_explanations.md
author: Perchycs
author_url: https://github.com/Perchycs
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1297
merged_at: 2025-02-14 07:52:40+00:00
created_at: 2025-07-16 04:25:34
body:
  Spent way too long getting chatgpt to give a one-line summary, based on the contents of each prompt.

  ## What this Pull Request (PR) does
  Made a markdown file explaining each pattern and what it does.

  ## Related issues
  Please reference any open issues this PR relates to in here.
  If it closes an issue, type `closes #[ISSUE_NUMBER]`.

  ## Screenshots
  Provide any screenshots you may find relevant to facilitate us understanding your PR.

commits:
  [{"SHA":"90c4f244aee01e5c69ed96f97ded47d8db782bad","Message":"Create pattern_explanations.md\n\nSpent way too long getting chatgpt to give a one-line summary, based on the contents of each prompt.","Author":"Perchycs"}]


title: feat: Add LM Studio compatibility
author: verebes1
author_url: https://github.com/verebes1
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1302
merged_at: 2025-02-24 19:58:36+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This PR adds LM Studio compatibility. Now this can be used side by side with OpenAI no need for changing URLs in the .env file to make it work

  - Added LM Studio as a new plugin, now it can be used with Fabric.
  - Updated the plugin registry with the new plugin name
  - Updated the configuration with the required base url

  ## Related issues
  closes #[928]
  A lot of credit goes to @sosacrazy126 as this is based on his solution.

  ## How to test
  1. Clone the repo `git clone https://github.com/verebes1/fabric.git`
  2. Enter the project dir `cd fabric`
  3. Install the project `go install`
  4. Run LM Studio and its local webserver with a model of your choice
  5. Run `fabric --setup` and setup your local url for LM Studio alternatively you can also add the url yourself to your .env file to fabric's settings `LM_STUDIO_API_BASE_URL=http://localhost:1234/v1`
  6. Check the models `fabric --listmodels`
  7. Try it out `echo "Tell me a story about golang?" | fabric -sp ai -m YOUR_MODEL_LOADED_IN_LM_STUDIO`

  ## Screenshots
  <img width="486" alt="Screenshot 2025-02-17 at 23 33 47" src="https://github.com/user-attachments/assets/8a75d9b9-bb16-41d3-a180-14d09307b06a" />

commits:
  [{"SHA":"c6ebfd3ad76db716e9852e2e694bf8f4cfe04d2a","Message":"feat: Add LM Studio compatibility\n\n- Added LM Studio as a new plugin, now it can be used with Fabric.\n- Updated the plugin registry with the new plugin name\n- Updated the configuration with the required base url","Author":"David"}]


author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1309
merged_at: 2025-02-24 20:09:23+00:00
created_at: 2025-07-16 04:25:34
title:
  Feature/Web Svelte GUI Enhancements: Pattern Descriptions, Tags, Favorites, Search Bar, Language Integration, PDF file conversion, etc

body:
  # Enhanced Pattern Selection, Pattern Descriptions, New Pattern TAG System, Language Support and other WEB UI Improvements 
  <img width="1678" alt="Screenshot 2025-02-20 at 3 49 57 PM" src="https://github.com/user-attachments/assets/44649f46-272d-44da-8458-78ec5f3196b1" />
  <img width="1678" alt="Screenshot 2025-02-20 at 3 48 13 PM" src="https://github.com/user-attachments/assets/2da5387d-a605-44bc-87e8-c903b391452f" />


  This Cumulative PR adds several Web UI and functionality improvements to make pattern management and selection more intuitive and friction free:

  -  New **Pattern Descriptions** 
  - Ability to save **favorites**
  - New Pattern **TAG system**
  - **Multilingual** capabilities
  - Import **PDF documents**
  - **Help** reference section 
  - More robust Youtube processing and a variety of ui improvements

  Thanks to Jonatan, Daniel, John and others who built this web app. It's a super fondation to continue building upon.   

  ## 🎥 Demo Video
  https://youtu.be/bhwtWXoMASA


  ## 🌟 Key Features

  ### 1. Web UI and Pattern Selection Improvements
  - Enhanced pattern selection interface for better user experience
  - New **pattern descriptions** section accessible via modal
  - New **pattern favorite list** and pattern search functionality
  - New **Tag system** for better pattern organization and filtering
  - Seamless **PDF file** conversion to markdown
  - Web UI refinements for clearer interaction
  - Help section & Pattern Selection via modal  

  ### 2. Multilingual Support System
  - **Language switching** via UI dropdown 
  - Persistent language state management
  - Pattern processing now use the selected language 
   (Note: translation of pattern section "titles" not 100% for Youtube, anybody?)

  ### 3. YouTube Integration Enhancement
  - Language handling for YouTube transcript & Pattern output processing
  - Youtube required qualifiers or web site text conversion for llms (Jina) handled seamlessly behind the scene

  ### 4. Enhanced Tag Management Integration

  The tag filtering system has been integrated into the Pattern Selection interface through several UI enhancements:

  1. **Dual-Position Tag Panel**
     - Sliding panel positioned to the right of pattern modal
     - Dynamic toggle button that adapts position and text based on panel state
     - Smooth transitions for opening/closing animations

  2. **Tag Selection Visibility**
     - New dedicated tag display section in pattern modal
     - Visual separation through subtle background styling
     - Immediate feedback showing selected tags with comma separation
     - Inline reset capability for quick tag clearing

  3. **Improved User Experience**
     - Clear visual hierarchy between pattern list and tag filtering
     - Multiple ways to manage tags (panel or quick reset)
     - Consistent styling with existing design language
     - Space-efficient tag brick layout in 3-column grid

  4. **Technical Implementation**
     - Reactive tag state management
     - Efficient tag filtering logic
     - Proper event dispatching between components
     - Maintained accessibility standards
     - Responsive design considerations

  **HOW TO USE**
  No change from existing process: from /web run fabric --serve or ./fabric --serve and run npm run dev from two different terminal windows.  

  These enhancements create a more intuitive and efficient pattern discovery experience, allowing users to quickly filter and find relevant patterns while maintaining a clean, modern interface.

  ### 5. Obsidian and Note integration
  - Fully operational
  - To work out of the box, please maintain this folder structure: (but you can change):  web/myfiles/Fabric_obsidian and web/myfiles/inbox for notes.  

  ## 🛠 Technical Implementation

  ### Language Support Architecture
  ```typescript
  // Language state management
  export const languageStore = writable<string>('');

  // Chat input language detection
  if (qualifier === 'fr') {
    languageStore.set('fr');
    userInput = userInput.replace(/--fr\s*/, '');
  }

  // Service layer integration
  const language = get(languageStore) || 'en';
  const languageInstruction = language !== 'en' 
    ? `. Please use the language '${language}' for the output.` 
    : '';
  ```

  ### YouTube Processing Enhancement
  ```typescript
  // Process stream with language instruction per chunk
  await chatService.processStream(
    stream,
    (content: string, response?: StreamResponse) => {
      if (currentLanguage !== 'en') {
        content = `${content}. Please use the language '${currentLanguage}' for the output.`;
      }
      // Update messages...
    }
  );
  ```
  # Pattern Descriptions and Tags Management

  This document explains the complete workflow for managing pattern descriptions and tags, including how to process new patterns and maintain metadata.

  ## System Overview

  The pattern system follows this hierarchy:
  1. `~/.config/fabric/patterns/` directory: The source of truth for available patterns
  2. `pattern_extracts.json`: Contains first 500 words of each pattern for reference
  3. `pattern_descriptions.json`: Stores pattern metadata (descriptions and tags)
  4. `web/static/data/pattern_descriptions.json`: Web-accessible copy for the interface

  ## Pattern Processing Workflow

  ### 1. Adding New Patterns
  - Add patterns to `~/.config/fabric/patterns/`
  - Run extract_patterns.py to process new additions:
    ```bash
    python extract_patterns.py

  The Python Script automatically:
  - Creates pattern extracts for reference
  - Adds placeholder entries in descriptions file
  - Syncs to web interface

  ### 2. Pattern Extract Creation
  The script extracts first 500 words from each pattern's system.md file to:

  - Provide context for writing descriptions
  - Maintain reference material
  - Aid in pattern categorization

  ### 3. Description and Tag Management
  Pattern descriptions and tags are managed in pattern_descriptions.json:


  {
    "patterns": [
      {
        "patternName": "pattern_name",
        "description": "[Description pending]",
        "tags": []
      }
    ]
  }


  ## Completing Pattern Metadata

  ### Writing Descriptions
  1. Check pattern_descriptions.json for "[Description pending]" entries
  2. Reference pattern_extracts.json for context

  3. How to update Pattern short descriptions (one sentence). 

  You can update your descriptions in pattern_descriptions.json manually or using LLM assistance (prefered approach). 

  Tell AI to look for "Description pending" entries in this file and write a short description based on the extract info in the pattern_extracts.json file. You can also ask your LLM to add tags for those newly added patterns, using other patterns tag assignments as example.    

  ### Managing Tags
  1. Add appropriate tags to new patterns
  2. Update existing tags as needed
  3. Tags are stored as arrays: ["TAG1", "TAG2"]
  4. Edit pattern_descriptions.json directly to modify tags
  5. Make tags your own. You can delete, replace, amend existing tags.

  ## File Synchronization

  The script maintains synchronization between:
  - Local pattern_descriptions.json
  - Web interface copy in static/data/
  - No manual file copying needed

  ## Pattern Updates (adding descriptions and tags)

  1. Run extract_patterns.py when:
     - Adding new patterns
     - Updating existing patterns
     - Modifying pattern structure
   
  It will add the pattern extracts for the new patterns in the **pattern_extracts.json** and create placeholders in the **pattern_descriptions.json** file to complete later (ie add your pattern descriptions and tags). You can complete this step manually or with AI.  

  2. Tags Management:
     - See current Tags definition in the Help guide
     - You can modify the Tag list and make it your own in the **pattern_descriptions.json** file.

  ## Troubleshooting

  If patterns are not showing in the web interface:
  1. Verify pattern_descriptions.json format
  2. Check web/static/data/pattern_descriptions.json copy exists
  3. Ensure proper file permissions
  5. Run extract_patterns.py to resync

  ## File Structure

  fabric/
  ├── patterns/                     # Pattern source files
  ├── PATTERN_DESCRIPTIONS/
  │   ├── extract_patterns.py      # Pattern processing script
  │   ├── pattern_extracts.json    # Pattern content references
  │   └── pattern_descriptions.json # Pattern metadata
  └── web/
      └── static/
          └── data/
              └── pattern_descriptions.json # Web interface copy


  ## PDF TO MARKDOWN CONVERSION IMPLEMENTATION

  This document explains the new PDF to Markdown conversion implementation, detailing its functionality, installation process, and the file changes involved. See and clone from https://github.com/jzillmann/pdf-to-markdown/tree/modularize. The PDF conversion module has been integrated in the svelte web browser interface. Once installed, it will automatically detect pdf files in the chat interface and convert them to markdown automatically for llm processing. 

  # Integration with Svelte

  The integration approach focused on using the library's high-level API while maintaining SSR compatibility:

  - Create PdfConversionService for PDF processing
  - Handle file uploads in ChatInput component
  - Convert PDF content to markdown text
  - Integrate with existing chat processing flow


  ### How it Works

  The PDF to Markdown conversion is implemented as a separate module located in the `pdf-to-markdown` directory. It leverages the `pdf-parse` library (likely via `PdfParser.ts`) to parse PDF documents and extract text content. The core logic resides in `PdfPipeline.ts`, which orchestrates the PDF parsing and conversion process. `Pdf-to-Markdown` is a folk from `pdf.js` - Mozilla's PDF parsing & rendering platform which is used as a raw parser

  Here's a simplified breakdown of the process:

  1.  **PDF Parsing:** The `PdfParser.ts` uses `pdf-parse` to read the PDF file and extract text content from each page.
  2.  **Content Extraction:** The extracted text content is processed to identify text elements, formatting, and structure.
  3.  **Markdown Conversion:** The `PdfPipeline.ts` then converts the extracted and processed text content into Markdown format. This involves mapping PDF elements to Markdown syntax, attempting to preserve formatting like headings, lists, and basic text styles.
  4.  **Frontend Integration:** The `PdfConversionService.ts` in the `web/src/lib/services` directory acts as a frontend service that utilizes the `pdf-to-markdown` module. It provides a `convertToMarkdown` function that takes a File object (PDF file) as input, calls the `pdf-to-markdown` module to perform the conversion, and returns the Markdown output as a string.
  5.  **Chat Input Integration:** The `ChatInput.svelte` component uses the `PdfConversionService` to convert uploaded PDF files to Markdown before sending the content to the chat service for pattern processing.

  ### Installation

  To use the PDF to Markdown conversion functionality, you need to ensure that the necessary dependencies are installed.

  1.  **Navigate to the `pdf-to-markdown` directory:**

      ```bash
      cd pdf-to-markdown
      ```

  2.  **Install dependencies:**

      ```bash
      npm install
      ```

      This will install the required dependencies for the `pdf-to-markdown` module, including `pdf-parse` and any other necessary libraries listed in `pdf-to-markdown/package.json`.

  3.  **Build the `pdf-to-markdown` module:**

      ```bash
      npm run build
      ```

      This command will build the TypeScript code in the `pdf-to-markdown` module and create the necessary JavaScript files in the `build` directory.

  4.  **Ensure frontend dependencies are installed (web):**


  ### File Changes

  The following files were added or modified to implement the PDF to Markdown conversion:

  **New files:**

  *   `pdf-to-markdown/`: (New directory for the PDF to Markdown module)
      *   `pdf-to-markdown/package.json`:  Defines dependencies and build scripts for the PDF to Markdown module.
      *   `pdf-to-markdown/tsconfig.json`: TypeScript configuration for the PDF to Markdown module.
      *   `pdf-to-markdown/src/`: Source code directory for the PDF to Markdown module.
          *   `pdf-to-markdown/src/index.ts`: Entry point of the PDF to Markdown module.
          *   `pdf-to-markdown/src/PdfPipeline.ts`: Core logic for PDF to Markdown conversion pipeline.
          *   `pdf-to-markdown/src/PdfParser.ts`:  PDF parsing logic using `pdf-parse`.

  *   `web/src/lib/services/PdfConversionService.ts`: (New file)
      *   Frontend service to use the `pdf-to-markdown` module and expose `convertToMarkdown` function.

  **Modified files:**

  *   `web/src/lib/components/chat/ChatInput.svelte`:
      *   Modified to import and use the `PdfConversionService` in the `readFileContent` function to handle PDF files.
      *   Modified `readFileContent` to call `pdfService.convertToMarkdown` for PDF files.

  These file changes introduce the new PDF to Markdown conversion functionality and integrate it into the chat input component of the web interface.


  ## 🎯 Usage Examples

  ### 1. Using Language Qualifiers
  ```
  User: What is the weather?
  AI: The weather information...

  User: --fr What is the weather?
  AI: Voici les informations météo...
  ```

  ### 2. Global Settings
  1. Select language from dropdown
  2. All interactions use selected language
  3. Automatic reset to English after each message

  ### 3. YouTube Analysis
  ```
  User: Analyze this YouTube video --fr
  AI: [Provides analysis in French, maintaining language throughout the transcript]
  ```

  ## 💡 Key Benefits

  1. **Enhanced User Experience**
     - Intuitive language switching
     - Consistent language handling
     - Seamless integration with existing features

  2. **Robust Implementation**
     - Simple yet powerful design
     - No complex language detection needed
     - Direct AI instruction approach

  3. **Maintainable Architecture**
     - Clean separation of concerns
     - Stateful language management
     - Easy to extend for new languages

  4. **YouTube Integration**
     - Handles long transcripts effectively
     - Maintains language consistency
     - Robust chunk processing

  ## 🔄 Implementation Notes

  1. **State Management**
     - Language persists until changed
     - Handles UI state updates efficiently

  2. **Error Handling**
     - Invalid qualifiers are ignored
     - Unknown languages default to English
     - Proper store reset on errors

  3. **Next Steps**
   - Fix "warning" Aria errors with modal
   - Reinstate correct language for Pattern output headings when Youtube is used (eg "Main Idea", "Key Take Aways"). Was working fine, lost along the way in some code change. Anyone wants to take a peak @johnconnor-sec ?
   - Finalize streaming, could not get this to work ie currently limited to deliver pattern output at once.
   - Maybe an MCP type Pattern to handle the Pattern description update process when new patterns are added.
   - Else?  

commits:
  [{"SHA":"e10a2c9b091c452e21e3fccd5cbb14f2dfee3c94","Message":"Update ENV","Author":"JM"},{"SHA":"717eb585b5220a7185fa718e8b26074e265c6ddd","Message":"Setup backup configuration and update dependencies","Author":"jmd1010"},{"SHA":"8a0f9814e66c9b4ab04d4c8f5fe1adfa1ffd9278","Message":"Development checkpoint - Web UI enhancements with complete directory structure","Author":"jmd1010"},{"SHA":"40c4cb46be52698a5f440a2e9deae11786ad028e","Message":"Remove personal development notes from tracking","Author":"jmd1010"},{"SHA":"8bff9764f88c8ed8d89e1bf7d26ed4add27c9d8e","Message":"Remove sensitive and generated files from tracking","Author":"jmd1010"},{"SHA":"5d31e90650498479425781e395186ea0df6647ad","Message":"Update .gitignore to exclude sensitive and generated files","Author":"jmd1010"},{"SHA":"0a07072be0ef86a6c39831865aa91586319cefdd","Message":"Enhance pattern handling and chat interface improvements","Author":"jmd1010"},{"SHA":"292fd75699c9293a6aba30504aebff83bf41a86a","Message":"Remove PNG files from PR scope","Author":"jmd1010"},{"SHA":"f314671f65636eddd2cb50f546c32ab8bc65c828","Message":"Exclude static PNG files from PR","Author":"jmd1010"}]


title: Added Create LOE Document Prompt
author: junaid18183
author_url: https://github.com/junaid18183
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1312
merged_at: 2025-02-24 19:59:43+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Added Create LOE Document Prompt

  ## Screenshots
  Provide any screenshots you may find relevant to facilitate us understanding your PR.

commits:
  [{"SHA":"52e2995c557f456737af49e145a9c84f4122bbc4","Message":"Added create_loe_document prompt","Author":"Juned Memon"},{"SHA":"31be01f3b39d89f645bf00cc9bdd530498851cdf","Message":"Added create_loe_document prompt","Author":"Juned Memon"}]


title: Updated ollama.go to fix a couple of potential DoS issues
author: cx-ken-swain
author_url: https://github.com/cx-ken-swain
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1313
merged_at: 2025-02-25 21:20:27+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Correct issue where the resource ReadAll allocated by in the file /restapi/ollama.go at line 150 is prone to resource exhaustion when used by in the file /restapi/ollama.go at line 176.

commits:
  [{"SHA":"a5ab81b5c8e2b874a91ebd944028cdc35b9e32a1","Message":"Update version to v..1 and commit","Author":"github-actions[bot]"},{"SHA":"9a1a46e203a1d8522c287d883dd2b986ed11dad5","Message":"Updated to fix security issues with ollama.go","Author":"“CXKswain”"},{"SHA":"bebc8c20b5d74772f78ab9261cbcff85b5e3dc9f","Message":"Resolving a couple of more medium vulnerabilites","Author":"“CXKswain”"},{"SHA":"1fe00633c43109ba23fdff6574d84e1cf8a8826c","Message":"Delete pkgs/fabric/version.nix","Author":"CXKswain"},{"SHA":"f1550e1d1d5e861bbf383a073446a3e67b2bef7d","Message":"Delete version.go","Author":"CXKswain"},{"SHA":"e9e654952870688bd64c03177b2aee981ac2d3d2","Message":"Update version to v..1 and commit","Author":"github-actions[bot]"},{"SHA":"49fe59f403e6ee4f755998705b092c84de9eb6ca","Message":"Merge branch 'main' into main","Author":"Eugen Eisler"}]


title: chore: update Anthropic SDK and add Claude 3.7 Sonnet model support
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1317
merged_at: 2025-02-24 21:34:06+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - Updated anthropic-sdk-go from v0.2.0-alpha.4 to v0.2.0-alpha.11
  - Added Claude 3.7 Sonnet models to available model list
  - Added ModelClaude3_7SonnetLatest to model options
  - Added ModelClaude3_7Sonnet20250219 to model options
  - Removed ModelClaude_Instant_1_2 from available models

  ## What this Pull Request (PR) does

  This PR updates the Anthropic Go SDK from v0.2.0-alpha.4 to v0.2.0-alpha.11 and adds support for the new Claude 3.7 Sonnet models. It also removes the deprecated Claude Instant 1.2 model from the available models list.

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/8b4a4240-d22a-4fd3-aa36-abf94bafed9f)

commits:
  [{"SHA":"61f0b5848c597a5d676581476178f47900aeb1c5","Message":"chore: update Anthropic SDK and add Claude 3.7 Sonnet model support\n\n## CHANGES\n\n- Updated anthropic-sdk-go from v0.2.0-alpha.4 to v0.2.0-alpha.11\n- Added Claude 3.7 Sonnet models to available model list\n- Added ModelClaude3_7SonnetLatest to model options\n- Added ModelClaude3_7Sonnet20250219 to model options\n- Removed ModelClaude_Instant_1_2 from available models","Author":"Kayvan Sylvan"},{"SHA":"9af69d456e8eacad73432e4bcc619b93525e7c5e","Message":"Merge branch 'danielmiessler:main' into main","Author":"Kayvan Sylvan"},{"SHA":"267562e1d2ff795eaca013e975c58704cbe3c468","Message":"Merge remote-tracking branch 'upstream/main'","Author":"Kayvan Sylvan"}]


title: Enhancement: PDF to Markdown Conversion Functionality to the Web Svelte Chat Interface
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1319
merged_at: 2025-02-27 06:15:04+00:00
created_at: 2025-07-16 04:25:34
body:
  ## PDF TO MARKDOWN CONVERSION IMPLEMENTATION

  - PDF to Markdown conversion functionality for the web interface
  - Automatic detection and processing of PDF files in chat
  - Conversion to markdown format for LLM processing
  - Installation instructions from the pdf-to-markdown repository
  - Testing steps for verification

  The PDF conversion module has been integrated in the svelte web browser interface. Once installed, it will automatically detect pdf files in the chat interface and convert them to markdown automatically for llm processing. No extra servers required. Works with existing backend / front end svelte servers. 

  ## 🎥 Demo Video (see at 4 min.)
  https://youtu.be/bhwtWXoMASA

  This document explains the new PDF to Markdown conversion implementation, detailing its functionality, installation process, and the file changes involved. Clone from https://github.com/jzillmann/pdf-to-markdown/tree/modularize. 

  # Integration with Svelte

  The integration approach focused on using the library's high-level API while maintaining SSR compatibility:

  - Create PdfConversionService for PDF processing
  - Detects PDF file uploads in ChatInput component
  - Convert PDF content to markdown text
  - Integrate with existing chat processing flow

  ### How it Works

  The PDF to Markdown conversion is implemented as a separate module located in the `pdf-to-markdown` directory. It leverages the `pdf-parse` library (likely via `PdfParser.ts`) to parse PDF documents and extract text content. The core logic resides in `PdfPipeline.ts`, which orchestrates the PDF parsing and conversion process. `Pdf-to-Markdown` is a folk from `pdf.js` - Mozilla's PDF parsing & rendering platform which is used as a raw parser

  Here's a simplified breakdown of the process:

  1.  **PDF Parsing:** The `PdfParser.ts` uses `pdf-parse` to read the PDF file and extract text content from each page.
  2.  **Content Extraction:** The extracted text content is processed to identify text elements, formatting, and structure.
  3.  **Markdown Conversion:** The `PdfPipeline.ts` then converts the extracted and processed text content into Markdown format. This involves mapping PDF elements to Markdown syntax, attempting to preserve formatting like headings, lists, and basic text styles.
  4.  **Frontend Integration:** The `PdfConversionService.ts` in the `web/src/lib/services` directory acts as a frontend service that utilizes the `pdf-to-markdown` module. It provides a `convertToMarkdown` function that takes a File object (PDF file) as input, calls the `pdf-to-markdown` module to perform the conversion, and returns the Markdown output as a string.
  5.  **Chat Input Integration:** The `ChatInput.svelte` component uses the `PdfConversionService` to convert uploaded PDF files to Markdown before sending the content to the chat service for pattern processing.

  ### Installation

  ## PDF TO MARKDOWN CONVERSION IMPLEMENTATION

  - PDF to Markdown conversion functionality for the web interface
  - Automatic detection and processing of PDF files in chat
  - Conversion to markdown format for LLM processing
  - Installation instructions from the pdf-to-markdown repository

  The PDF conversion module has been integrated in the svelte web browser interface. Once installed, it will automatically detect pdf files in the chat interface and convert them to markdown automatically for llm processing.


  ### HOW TO INSTALL

  ### FROM FABRIC ROOT DIRECTORY
    cd .. web

  ### Install in this sequence: 
  ### Step 1
  npm install -D patch-package
  ### Step 2
  npm install -D pdfjs-dist@2.5.207
  ### Step 3
  npm install -D github:jzillmann/pdf-to-markdown#modularize

  ### File Changes

  The following files were added or modified to implement the PDF to Markdown conversion:

  *   `web/src/lib/services/PdfConversionService.ts`: (New file)

  ** Modified files: **

  *   `web/src/lib/components/chat/ChatInput.svelte`:
      *   Modified to import and use the `PdfConversionService` in the `readFileContent` function to handle PDF files.
      *   Modified `readFileContent` to call `pdfService.convertToMarkdown` for PDF files.

  These file changes introduce the new PDF to Markdown conversion functionality and integrate it into the chat input component of the web interface.

commits:
  [{"SHA":"a0e1f7204d1fe7e3fd4fbdaf4c7429516e983477","Message":"Add PDF to Markdown conversion functionality to the web svelte caht interface","Author":"jmd1010"},{"SHA":"f69cda8fab87611e71357bbdd746c2a37ef93fdb","Message":"Add PDF to Markdown integration documentation","Author":"jmd1010"},{"SHA":"15ac5351cfe310ea2e2be20f8a68b94257cc89f3","Message":"Add Svelte implementation files for PDF integration","Author":"jmd1010"},{"SHA":"4725a94f003f4c055885ce55dfe9c8032320908c","Message":"Add complete PDF to Markdown documentation F","Author":"jmd1010"},{"SHA":"adbfa2f6ba0c21be914b470ea2d2a8fd82ae6a8a","Message":"Remove pdf-to-markdown folder from PR","Author":"jmd1010"},{"SHA":"6d8c3eb6e2a2d5268f2a672e59a3edafb8fe3594","Message":"Update README files directory structure and naming convention","Author":"jmd1010"},{"SHA":"a74da4acffedc92eeb2e1e664cd1871046146f55","Message":"Rename pattern descriptions directory to follow consistent naming convention","Author":"jmd1010"},{"SHA":"0d7514ea0e55a0e249e869cff46c4cd33c8b2e6a","Message":"Remove pr-1284-update.md from PR scope","Author":"jmd1010"},{"SHA":"96e6a56e5f6b46ca298914f9678467d9e346e445","Message":"Restore file to original location to resolve path conflict","Author":"jmd1010"},{"SHA":"d1d62fcc4ca3feece1a5f3258a12f219161d000d","Message":"Complete directory reorganization by moving pr-1284-update.md to new location","Author":"jmd1010"},{"SHA":"51220c40d9d081d4513cb7494a8306fd088dfb45","Message":"Add required UI image assets for feature implementation","Author":"jmd1010"},{"SHA":"fa575638d1b78301127a8f219ad95ef748995733","Message":"Remove pr-1284-update.md from tracking to resolve PR conflict","Author":"jmd1010"},{"SHA":"9507c2cca14dfa927aa8db3ea220f1e4a4f649ad","Message":"Reinstate file in original location to resolve PR conflict","Author":"jmd1010"},{"SHA":"cf637e4137e72c69e4095b615739da0019d0706e","Message":"Merge branch 'main' into pdf-integration-clean","Author":"JM"}]


title: Update demo video link in PR-1309 documentation
body: Simply updating the video presenting the new functionalities
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1321
merged_at: 2025-02-25 21:07:47+00:00
created_at: 2025-07-16 04:25:34
commits:
  [{"SHA":"1286afeb769123d56564ec70d42dfa500fb10408","Message":"Update demo video link in PR-1284 documentation","Author":"jmd1010"}]


title: flake: fix/update and enhance
author: jaredmontoya
author_url: https://github.com/jaredmontoya
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1324
merged_at: 2025-02-26 16:52:47+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  - Disables Nix package tests because `extension_manager_test.go` does not pass in the nix sandbox.
  - Updates go version used in nix to the one specified in go.mod
  - Groups most nix related files under the `nix` directory
  - Removes magic nix cache because GitHub no longer supports it
  - Introduces CI style checks using treefmt-nix
  - Formats code using `goimports` to pass the new style check
  - treefmt-nix can format code in different languages by selectively applying formatters, `gofmt` and `goimports` are applied to go files, enabling prettier on markdown files or other formatters supported by treefmt-nix is a one line change.

  as far as I know the only open PR that modifies a go file at the moment is https://github.com/danielmiessler/fabric/pull/1310 and it's only one file so this shouldn't cause hard to resolve merge conflicts if merged soon enough

commits:
  [{"SHA":"1f765c5b534fa2f3f8fdbb76ccec62d63a70c912","Message":"flake: fix/update","Author":"jaredmontoya"}]


title: fix: continue fetching models even if some vendors fail
author: pavdmyt
author_url: https://github.com/pavdmyt
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1326
merged_at: 2025-02-28 07:58:26+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  Remove the cancellation of remaining goroutines when a vendor collection fails. This ensures that other vendor collections continue even if one fails.

  Fixes listing models via `fabric -L` and using non-default models via `fabric -m custom_model`, when localhost models (e.g. Ollama, LM Studio) are not listening on a given port (basically shut down).

  ---

  After https://github.com/danielmiessler/fabric/pull/1302, commands like `fabric -L` and `fabric -m` hang indefinitely if LM Studio is not setup. With this change, it will only print error and proceed further with the other configured vendors:
  ```shell
  ❯ fabric -L
  LM Studio failed to send request: Get "http://localhost:1234/v1/models": dial tcp 127.0.0.1:1234: connect: connection refused
  Ollama Get "http://localhost:11434/api/tags": dial tcp 127.0.0.1:11434: connect: connection refused

  Available models:

  Gemini

          [1]     chat-bison-001
          [2]     text-bison-001
          [3]     embedding-gecko-001
  ...
  ```

commits:
  [{"SHA":"0b29ebd14b6cca0582f67c048f67d20057d03c3b","Message":"fix: continue fetching models even if some vendors fail\n\nRemove the cancellation of remaining goroutines when a vendor collection fails.\nThis ensures that other vendor collections continue even if one fails.\n\nFixes listing models via `fabric -L` and using non-default models via `fabric -m custom_model`,\nwhen localhost models (e.g. Ollama, LM Studio) are not listening on a given port (basically shut down).","Author":"Pavel Dmytrenko"}]


title: Svelte Web V2 Installation Guide
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1329
merged_at: 2025-02-28 07:55:51+00:00
created_at: 2025-07-16 04:25:34
body:
  ## Provides a detailed guide to help users be successful with their installation of the updated svelte browser and reduce potential issues. 

  This will help until the web component is fully wrapped up as a Go component. 

commits:
  [{"SHA":"2f040f94c3a9867e1b83b3ca610ed022290d67b3","Message":"Add Web V2 Installation Guide","Author":"jmd1010"},{"SHA":"0d5454372e4ab158ac6c1c7b57d3507ba489fb56","Message":"Update install guide with Plain Text instructions","Author":"jmd1010"}]


title: Fixed ALL CAP DIR as requested and processed minor updates to documentation
body: ALL CAP DIR FIXED
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1330
merged_at: 2025-03-04 11:17:03+00:00
created_at: 2025-07-16 04:25:34
commits:
  [{"SHA":"2d10c71e39c4541210c576c1f83957efe6a867cf","Message":"Reorganize documentation with consistent directory naming and updated guides","Author":"jmd1010"},{"SHA":"30059c46a012fe3046c53f8d8699f6eae398553b","Message":"Update Web V2 Install Guide with improved instructions","Author":"jmd1010"},{"SHA":"a8ae09d4d62e59ed3ef9bf0dbee4a7a74ab48a53","Message":"Update Web V2 Install Guide with improved instructions V2","Author":"jmd1010"}]


title: Update QUOTES section to include speaker names for clarity
author: asasidh
author_url: https://github.com/asasidh
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1333
merged_at: 2025-03-04 08:35:53+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  The quotes would be more meaningful if it included the name of the speaker. This is especially useful in podcasts.

  ## Related issues
  Please reference any open issues this PR relates to in here.
  If it closes an issue, type `closes  #1332`.

  ## Screenshots
  Provide any screenshots you may find relevant to facilitate us understanding your PR.
  <img width="1152" alt="image" src="https://github.com/user-attachments/assets/0c9fb27a-12b4-4785-a16d-d09a53aa9ec9" />

commits:
  [{"SHA":"be6049e577726f54d5da17dfacbaa36b2417e714","Message":"Update QUOTES section to include speaker names for clarity","Author":"asasidh"}]


title: Update Web V2 Install Guide layout
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1338
merged_at: 2025-03-05 09:09:23+00:00
created_at: 2025-07-16 04:25:34
body:
  ## Layout fix

  Layout of  Web instalI md file did not process correctly in previous pull. 

  cd web
  npm install 
  npx svelte-kit sync

  became "cd web npm install npx svelte-kit sync"

  Fixed in this pull to prevent user confusion. 

commits:
  [{"SHA":"2f4569177d0780b43b78bc9a19f5f96fa30c8853","Message":"Update Web V2 Install Guide layout","Author":"jmd1010"},{"SHA":"59537c4bf50c850266dce4c31d4f762cc84686a1","Message":"Update Web V2 Install Guide layout 2","Author":"jmd1010"}]


title: Feature/add azure api version
author: Eckii24
author_url: https://github.com/Eckii24
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1339
merged_at: 2025-03-07 07:46:21+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  The go open ai client uses "2023-05-15" as hardcoded api version.
  See here: https://github.com/sashabaranov/go-openai/blob/74d6449f22dd8bf668ebaeb181263b675b9a668b/config.go#L71C16-L71C26

  The latest azure deployments require more recent api version.
  This PR makes the api version therefore configurable.

  ## Hint

  Changes are mainly done by an AI, since I'm not used to Go.
  Please let me know, if I missed something.

commits:
  [{"SHA":"629c1b3e119798bae78ba807880541e176a9ff63","Message":"Update azure.go","Author":"Eckii24"},{"SHA":"8bd4aa6d1aa3a6102faeb9c128c253687da6961f","Message":"Update azure_test.go","Author":"Eckii24"},{"SHA":"58d17fd0ecbc9c6e027cd61844002ad23ea10ed8","Message":"Update openai.go","Author":"Eckii24"},{"SHA":"231516917debe402f4561824af5d5c2935f9c24c","Message":"Update azure.go","Author":"Eckii24"}]


title: Fix for youtube live links plus new youtube_summary pattern
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1340
merged_at: 2025-03-05 12:49:22+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This PR adds flexibility to the YouTube transcript command-line functions by introducing an optional timestamp flag and clarifies the usage in both Bash and PowerShell scripts. Additionally, it updates the regex in the YouTube Go plugin to properly match live stream URLs, improves documentation by adding a new pattern explanation, and supplies a full specification for generating concise YouTube summaries from timestamped transcripts.

  ## Related issues

  N/A

  ## Results

  Before fix:

  ```plain
  $ yt 'https://www.youtube.com/live/XkFKNkAEzQ8?si=dpbow6CDr6C2cz7R'
  invalid YouTube URL, can't get video or playlist ID: 'https://www.youtube.com/live/XkFKNkAEzQ8?si=dpbow6CDr6C2cz7R'
  ```

  After fix (with the enhanced `yt` aliases and the `youtube_summary` pattern):

  ```plain
  yt -t 'https://www.youtube.com/live/XkFKNkAEzQ8?si=dpbow6CDr6C2cz7R' | youtube_summary 

  # Overview
  The video is a speech given by the President of the United States, focusing on recent achievements, policy changes, and future goals for America. The speech highlights economic growth, immigration policies, and international relations, emphasizing a renewed sense of American pride and ambition.

  ## Introduction
  - [00:12:50] The President of the United States is introduced.
  - [00:19:01] The President addresses Congress and the nation, declaring "America is back."

  ## Achievements and Policies
  - [00:19:37] **Golden Age of America**: The President proclaims a new era of prosperity and swift action since taking office.
  - [00:20:00] **Accomplishments**: More achieved in 43 days than most administrations in years.
  - [00:21:09] **Election Victory**: Winning all swing states and a significant popular vote margin.
  - [00:22:31] **Public Sentiment**: Increased belief that the country is heading in the right direction.
  - [00:23:01] **Business Optimism**: Record-breaking gains in small business optimism.

  ## Key Policy Announcements
  - [00:25:04] **Executive Orders**: Nearly 100 signed to restore safety, optimism, and wealth.
  - [00:26:08] **Border Security**: National Emergency declared on the southern border, leading to the lowest illegal crossings recorded.
  - [00:30:29] **Environmental Policies**: Withdrawal from international agreements like the Paris Climate Accord.
  - [00:31:00] **Regulation Reduction**: For every new regulation, ten old ones must be eliminated.
  - [00:32:21] **Free Speech**: Ending government censorship and promoting free speech.

  ## Social and Cultural Policies
  - [00:33:07] **Diversity and Inclusion**: Ending policies considered divisive.
  - [00:34:33] **Gender Policy**: Official recognition of only two genders.
  - [00:35:03] **Sports Policy**: Ban on men participating in women's sports.

  ## Economic Initiatives
  - [00:37:36] **Economic Rescue**: Addressing inflation and high costs inherited from the previous administration.
  - [00:39:05] **Energy Independence**: Declared energy emergency and plans to drill for resources.
  - [00:41:08] **Government Efficiency**: Creation of a new department led by Elon Musk to cut wasteful spending.

  ## International Relations and Defense
  - [00:52:50] **Trade Policy**: Reciprocal tariffs to ensure fair trade.
  - [01:36:20] **Military Strength**: Call for funding a missile defense shield and revitalizing shipbuilding.

  ## Human Interest Stories
  - [01:26:24] **DJ Daniel**: A young cancer survivor honored as a Secret Service agent.
  - [01:34:28] **Jason Hartley**: A high school student accepted into West Point.

  ## Conclusion
  - [01:56:01] **Vision for the Future**: A commitment to lead America to new heights, emphasizing freedom, prosperity, and the American spirit.
  - [01:57:43] **Call to Action**: Encouragement for Americans to prepare for an "incredible future" and the promise of a new Golden Age.

  The speech concludes with a call for unity and perseverance, highlighting the nation's achievements and the potential for a brighter future.
  ```

commits:
  [{"SHA":"e8caf9fc1024496ab35f988c880037ccfde049d3","Message":"feat: update YouTube regex to support live URLs","Author":"Kayvan Sylvan"},{"SHA":"1dafb09e070e21f4876594d40baab3f168db9c4e","Message":"remove spurious newline","Author":"Kayvan Sylvan"},{"SHA":"59c50def2af76c400018c24376f1cd84d894d293","Message":"feat: update yt commands and docs to support timestamped transcripts\n\nCHANGES\n- Add argument validation to yt for usage errors\n- Enable -t flag for transcript with timestamps\n- Refactor PowerShell yt function with parameter switch\n- Update README to dynamically select transcript option\n- Document youtube_summary feature in pattern explanations\n- Introduce youtube_summary pattern.","Author":"Kayvan Sylvan"},{"SHA":"de356ddeb55cbf342c937c3beb719f6e6f15205b","Message":"chore: update version","Author":"Kayvan Sylvan"}]


title: Rename input.svelte to Input.svelte for proper component naming convention
body:
  Self explanatory

  Unsure how the name was changed. Corrected here.

author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1343
merged_at: 2025-03-07 07:43:32+00:00
created_at: 2025-07-16 04:25:34
commits:
  [{"SHA":"53d09d8a5a52ccba7dad03f270b076cd3cc991f9","Message":"Rename input.svelte to Input.svelte for proper component naming convention","Author":"jmd1010"}]


title: feat: Add LiteLLM AI plugin support with local endpoint configuration
author: liyuankui
author_url: https://github.com/liyuankui
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1348
merged_at: 2025-03-08 08:55:08+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  - Add LiteLLM support which enables [many models/providers](https://docs.litellm.ai/docs/providers)
  - Format vendor list a bit without losing content

  ## Related issues

  Closes #1344

  Help with below since liteLLM supports them: 
  #1347 
  #1308
  #1033
  #517
  #435
  #310

commits:
  [{"SHA":"6928f9a312144ab3f57bd979e01b970332685a08","Message":"feat: Add LiteLLM AI plugin support with local endpoint configuration","Author":"kyle"}]


title: Fix: v1.4.153 does not compile because of extra version declaration
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1349
merged_at: 2025-03-09 08:55:37+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does


  ## Related issues
  N/A

  ## Screenshots

  ### Before fix

  Fabric fails to compile:

  ```plain
  $ go install .
  # github.com/danielmiessler/fabric
  ./version.go:3:5: version redeclared in this block
          ./main.go:12:5: other declaration of version
  ```

  The `version` string is set up in `version.go` and does not need to be declared again

  ```go
  package main

  var version = "v1.4.153"
  ```

  ### After fix

  ```plain
  kayvan@dharma src/fabric [03-08-extra-version-declaration-removed] $ go install .
  kayvan@dharma src/fabric [03-08-extra-version-declaration-removed] $ fabric --version
  v1.4.153
  ```

commits:
  [{"SHA":"5b7697c5ab13bac2424a02e732575f55aabe63fc","Message":"chore: remove unnecessary `version` variable from `main.go`","Author":"Kayvan Sylvan"},{"SHA":"e28ba224b5a41fbd5b5874226440cdc55fdc7dcc","Message":"fix: update Azure client API version access path in tests","Author":"Kayvan Sylvan"}]


title: Implement Pattern Tile search functionality
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1350
merged_at: 2025-03-09 09:00:28+00:00
created_at: 2025-07-16 04:25:34
body:
  Added a "Pattern Tile" view in addition to list view as well as implement "column resizing" functionality (eg allow resizing of pattern output window). 

  Updated Demo (last min) 
  https://youtu.be/fcVitd4Kb98

  **PATTERN TILES**
  <img width="1597" alt="Screenshot 2025-03-08 at 12 23 28 PM" src="https://github.com/user-attachments/assets/e1515641-aa9e-4db2-bc61-70dd6936bafb" />

  <img width="1597" alt="Screenshot 2025-03-08 at 12 23 46 PM" src="https://github.com/user-attachments/assets/98cd38a6-9e61-411d-b1c1-fb05da200859" />

  **RESIZING**
  <img width="1680" alt="Screenshot 2025-03-08 at 5 43 14 PM" src="https://github.com/user-attachments/assets/6a3084e2-1d51-4a06-8cee-f21a51b5f960" />

  <img width="1680" alt="Screenshot 2025-03-08 at 5 43 24 PM" src="https://github.com/user-attachments/assets/ac8c5045-7e1d-41c3-a079-4ddea14e1c17" />


  **NOTE:**  The GO pull request **test fail** is related to the Azure plugin and unrelated to my changes which are limited to the web modal component implementation. 

  ## 1. PatternTilesModal.svelte
      * Path: web/src/lib/components/ui/modal/PatternTilesModal.svelte
      * Changes:
          * Restructured the header with a grid layout
          * Pattern tiles display implementation 
           
  ## 2. PatternList.svelte
      * Path: web/src/lib/components/patterns/PatternList.svelte
      * Changes:
          * Updated the layout to match the reference design
          * Improved the selected tags display
     
  ## 3. Header.svelte
      * Path: web/src/lib/components/home/Header.svelte
      * Changes:
          * Improved Header layout.
    
    Other : address minor accessibility warnings (ARIA).        
        

commits:
  [{"SHA":"bf3af207b96b06487c1cee8a972f2266eed12fad","Message":"Implement Pattern Tile search functionality","Author":"jmd1010"},{"SHA":"b2130686807eba28c40f9138ba733c64fcfae423","Message":"Implement  column resize functionnality","Author":"jmd1010"}]


title: pattern_explanations.md: fix typo
body:
  ## What this Pull Request (PR) does
  Fixes a typo

author: matmilbury
author_url: https://github.com/matmilbury
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1352
merged_at: 2025-03-11 06:52:48+00:00
created_at: 2025-07-16 04:25:34
commits:
  [{"SHA":"e004e50037fba5fb30271864f2a22e2c0af424f8","Message":"pattern_explanations.md: fix typo","Author":"Mat Milbury"}]


title: Fix Chat history window scrolling behavior
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1354
merged_at: 2025-03-11 06:51:51+00:00
created_at: 2025-07-16 04:25:34
body:
  ## minor display fix for chat history window (pattern  output) where last line sometime truncated. Fixed scroll behavior.

commits:
  [{"SHA":"761293ede745bb6b065a9d49538399be0781c206","Message":"Fix  Chat history window sizing","Author":"jmd1010"},{"SHA":"acb925f5a9670e24bf21aa573a26878f2c2c2bda","Message":"Update Web V2 Install Guide with improved instructions","Author":"jmd1010"}]


title: chore: add .vscode to `.gitignore` and fix typos and markdown linting in `Alma.md`
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1356
merged_at: 2025-03-11 09:04:32+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  No functional changes. Adds `.vscode` for workspace settings to `.gitignore` and fixes some typos and markdown lint problems in `Alma.md`

  ## Related issues
  N/A

  ## Screenshots
  N/A

commits:
  [{"SHA":"6b1ff0ab21e66d7cfb3b812cef9792bf2f5be26f","Message":"chore: add .vscode to `.gitignore` and fix typos and markdown linting in `Alma.md`","Author":"Kayvan Sylvan"}]


title: Bump golang.org/x/net from 0.35.0 to 0.36.0 in the go_modules group across 1 directory
author: dependabot
author_url: https://github.com/apps/dependabot
author_type: bot
url: https://github.com/danielmiessler/Fabric/pull/1362
merged_at: 2025-03-19 03:48:57+00:00
created_at: 2025-07-16 04:25:34
body:
  Bumps the go_modules group with 1 update in the / directory: [golang.org/x/net](https://github.com/golang/net).

  Updates `golang.org/x/net` from 0.35.0 to 0.36.0
  <details>
  <summary>Commits</summary>
  <ul>
  <li><a href="https://github.com/golang/net/commit/85d1d54551b68719346cb9fec24b911da4e452a1"><code>85d1d54</code></a> go.mod: update golang.org/x dependencies</li>
  <li><a href="https://github.com/golang/net/commit/cde1dda944dcf6350753df966bb5bda87a544842"><code>cde1dda</code></a> proxy, http/httpproxy: do not mismatch IPv6 zone ids against hosts</li>
  <li><a href="https://github.com/golang/net/commit/fe7f0391aa994a401c82d829183c1efab7a64df4"><code>fe7f039</code></a> publicsuffix: spruce up code gen and speed up PublicSuffix</li>
  <li><a href="https://github.com/golang/net/commit/459513d1f8abff01b4854c93ff0bff7e87985a0a"><code>459513d</code></a> internal/http3: move more common stream processing to genericConn</li>
  <li><a href="https://github.com/golang/net/commit/aad0180cad195ab7bcd14347e7ab51bece53f61d"><code>aad0180</code></a> http2: fix flakiness from t.Log when GOOS=js</li>
  <li><a href="https://github.com/golang/net/commit/b73e5746f64471c22097f07593643a743e7cfb0f"><code>b73e574</code></a> http2: don't log expected errors from writing invalid trailers</li>
  <li><a href="https://github.com/golang/net/commit/5f45c776a9c4d415cbe67d6c22c06fd704f8c9f1"><code>5f45c77</code></a> internal/http3: make read-data tests usable for server handlers</li>
  <li><a href="https://github.com/golang/net/commit/43c2540165a4d1bc9a81e06a86eb1e22ece64145"><code>43c2540</code></a> http2, internal/httpcommon: reject userinfo in :authority</li>
  <li><a href="https://github.com/golang/net/commit/1d78a085008d9fedfe3f303591058325f99727d7"><code>1d78a08</code></a> http2, internal/httpcommon: factor out server header logic for h2/h3</li>
  <li><a href="https://github.com/golang/net/commit/0d7dc54a591c12b4bd03bcd745024178d03d9218"><code>0d7dc54</code></a> quic: add Conn.ConnectionState</li>
  <li>Additional commits viewable in <a href="https://github.com/golang/net/compare/v0.35.0...v0.36.0">compare view</a></li>
  </ul>
  </details>
  <br />


  [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.35.0&new-version=0.36.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

  Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

  [//]: # (dependabot-automerge-start)
  [//]: # (dependabot-automerge-end)

  ---

  <details>
  <summary>Dependabot commands and options</summary>
  <br />

  You can trigger Dependabot actions by commenting on this PR:
  - `@dependabot rebase` will rebase this PR
  - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
  - `@dependabot merge` will merge this PR after your CI passes on it
  - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
  - `@dependabot cancel merge` will cancel a previously requested merge and block automerging
  - `@dependabot reopen` will reopen this PR if it is closed
  - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
  - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
  - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions
  You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/danielmiessler/fabric/network/alerts).

  </details>

commits:
  [{"SHA":"a227e61952a8175c46cb6c7383a523cfd0f7d7b2","Message":"Bump golang.org/x/net in the go_modules group across 1 directory\n\nBumps the go_modules group with 1 update in the / directory: [golang.org/x/net](https://github.com/golang/net).\n\n\nUpdates `golang.org/x/net` from 0.35.0 to 0.36.0\n- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.36.0)\n\n---\nupdated-dependencies:\n- dependency-name: golang.org/x/net\n  dependency-type: indirect\n  dependency-group: go_modules\n...\n\nSigned-off-by: dependabot[bot] \u003csupport@github.com\u003e","Author":"dependabot[bot]"}]


title: clipboard operations now work on Mac and PC
author: garkpit
author_url: https://github.com/garkpit
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1363
merged_at: 2025-03-17 14:19:46+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Makes copy/paste in the streamlit app work across all platforms (Mac, PC, Linux)

  ## Related issues
  I didn't check

  ## Screenshots
  None

  ps. 
  1 - This is the first time I've ever contributed to anything. Please be kind! Let me know if I've done anything wrong :)
  2 - Done using Claude 3.7 Thinking in Cursor
  3 - Tested on Mac. Not tested on PC or Linux.

commits:
  [{"SHA":"b5c2d069f20ff35f5d76996939d161945d88e2d5","Message":"clipboard operations now work on Mac and PC","Author":"Jay"}]


title: Implement Prompt Strategies in Fabric
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1365
merged_at: 2025-03-16 07:35:23+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This PR adds support for prompt strategies to the Fabric CLI tool. Prompt strategies are techniques like Chain of Thought (CoT) or Chain of Draft (CoD) that can be applied to improve the quality of LLM responses. The implementation allows users to select a strategy via the `--strategy` flag, which modifies how the system prompt is constructed before being sent to the model.

  ## Related issues

  https://github.com/danielmiessler/fabric/issues/1364

  ## Some Examples

  List strategies:

  ```plaintext
  $ fabric --liststrategies                    
  Available Strategies:

  cod               Chain-of-Draft (CoD) Prompting
  cot               Chain-of-Thought (CoT) Prompting
  ltm               Least-to-Most Prompting
  reflexion         Reflexion Prompting
  self-consistent   Self-Consistency Prompting
  self-refine       Self-Refinement
  standard          Standard Prompting
  tot               Tree-of-Thought (ToT) Prompting
  ```

  No strategy specified:

  ```plaintext
  $ fabric 'Why is the sky blue'
  The sky appears blue due to a phenomenon called Rayleigh scattering. When sunlight enters Earth's atmosphere, it collides with molecules and small particles in the air. Sunlight, or white light, is composed of various colors, each with different wavelengths. Blue light has a shorter wavelength and is scattered in all directions by the gases and particles in the atmosphere more than other colors with longer wavelengths, like red and yellow.
  ```

  Chain of Thought:

  ```plaintext
  $ fabric --strategy cot 'Why is the sky blue'
  The color of the sky is primarily due to a phenomenon called Rayleigh scattering. Let's break down the process step by step:

  1. **Sunlight Composition**: Sunlight, or white light, is composed of a spectrum of colors, which can be seen in a rainbow. Each color has a different wavelength, with violet and blue having shorter wavelengths and red having longer wavelengths.

  2. **Atmospheric Scattering**: As sunlight enters Earth's atmosphere, it interacts with gases and particles. The atmosphere is composed mainly of nitrogen and oxygen molecules.

  3. **Rayleigh Scattering**: The shorter wavelengths of light (violet and blue) are scattered in all directions by the small molecules in the atmosphere. This scattering is more efficient at shorter wavelengths, which is why blue light is scattered more than other colors.

  4. **Perception of the Sky's Color**: Although violet light is scattered even more than blue, our eyes are more sensitive to blue light and there is less violet light in sunlight. Additionally, some of the violet light is absorbed by the upper atmosphere. Therefore, we predominantly see the sky as blue.

  5. **Variation in Sky Color**: The sky can appear different colors at sunrise and sunset. During these times, the sun is lower in the sky, and its light has to pass through more atmosphere, scattering shorter wavelengths out of the line of sight and allowing the longer wavelengths (reds and oranges) to become more prominent.

  In summary, the sky appears blue because the shorter blue wavelengths of sunlight are scattered in all directions by the gases and particles in the Earth's atmosphere, and this scattered blue light is what we see when we look up.

  **Final Answer**: The sky is blue due to Rayleigh scattering, which scatters shorter blue wavelengths of sunlight more than other colors when it passes through the Earth's atmosphere.
  ```

  Chain of Draft:

  ```plaintext
  $ fabric --strategy cod 'Why is the sky blue'
  1. Sunlight contains many colors.
  2. Atmosphere scatters sunlight.
  3. Blue light scatters more.
  4. More scattering, blue sky.
  5. Rayleigh scattering causes effect.

  Final Answer: The sky is blue due to Rayleigh scattering, where shorter blue light waves scatter more in the atmosphere.
  ```

  Set up process:

  ```plaintext
  $ fabric -S
  [...]
          [19]    Strategies - Downloads Prompting Strategies (like chain of thought) [required]

  [Plugin Number] Enter the number of the plugin to setup (leave empty to skip):
  19

  [Prompt Strategies]

  Enter the default Git repository URL for the strategies (leave empty for 'https://github.com/danielmiessler/fabric.git' or type 'reset' to remove the value):
  https://github.com/ksylvan/fabric.git

  Enter the default folder in the Git repository where strategies are stored (leave empty for 'strategies' or type 'reset' to remove the value):

  Downloading strategies and Populating /Users/kayvan/.config/fabric/strategies...


  Available plugins (please configure all required plugins)::
  [...]
  ```

  And now, we see the strategies files:

  ```plaintext
  $ ls ~/.config/fabric/strategies
  cod.json                cot.json                ltm.json                reflexion.json          self-consistent.json    self-refine.json        standard.json           tot.json
  ```

  ## Files Changed

  ### Core Changes
  - Added a new `strategy` package to manage prompt strategies
  - Created a `StrategiesManager` similar to the patterns manager
  - Implemented loading and listing of strategies
  - Added strategy support to the chat request flow
  - Created a reusable `githelper` package for fetching files from git repositories

  ### Documentation
  - Updated README.md with information about prompt strategies
  - Added detailed CLI help text for the new strategy options

  ### New Files
  - `plugins/strategy/strategy.go`: Core implementation of strategy loading and management
  - `plugins/tools/githelper/githelper.go`: Reusable helper for fetching files from git repos
  - Added 8 strategy JSON files with different prompting techniques

  ## Code Changes

  ### Strategy Implementation
  The core of the implementation is in the new `strategy` package, which:
  - Manages loading strategies from JSON files
  - Provides a way to list available strategies
  - Integrates with the setup process to download strategies from the repository
  - Improved the git fetch process to make downloading the `patterns/` and `strategies/` directories much faster!

  ```go
  // Apply strategy if specified
  if request.StrategyName != "" {
      strategy, err := strategy.LoadStrategy(request.StrategyName)
      if err != nil {
          return nil, fmt.Errorf("could not load strategy %s: %v", request.StrategyName, err)
      }
      if strategy != nil && strategy.Prompt != "" {
          // prepend the strategy prompt to the system message
          systemMessage = fmt.Sprintf("%s\n%s", strategy.Prompt, systemMessage)
      }
  }
  ```

  ### CLI Integration
  Added new command line flags:
  - `--strategy`: Choose a strategy from available strategies
  - `--liststrategies`: List all available strategies

  ### Git Helper Refactoring
  Created a reusable git helper that:
  - Clones repositories in memory
  - Extracts specific files or directories
  - Simplifies the patterns and strategies download process

  ## Reason for Changes
  This PR enhances Fabric's capabilities by implementing prompt strategies, which are proven techniques for improving LLM responses. By separating the strategy from the pattern, users can mix and match different patterns with different reasoning approaches, making the tool more flexible and powerful.

  The implementation follows the existing pattern of Fabric's plugin system, making it consistent with the rest of the codebase. The git helper refactoring also improves code reuse and maintainability.

  ## Impact of Changes
  - Users can now apply different reasoning strategies to their prompts
  - The CLI interface is extended with new options for strategy management
  - Documentation is updated to explain the new feature
  - Code is more maintainable with the extraction of common git operations

  ## Test Plan
  - Manually tested the `--strategy` flag with different strategies
  - Verified that strategies are correctly downloaded during setup
  - Tested the `--liststrategies` command to ensure it displays available strategies
  - Confirmed that strategies are correctly applied to system prompts

  ## Additional Notes
  The implementation includes 8 different prompt strategies based on research papers and best practices:
  - Chain of Thought (CoT)
  - Chain of Draft (CoD)
  - Tree of Thought (ToT)
  - Self-Consistency
  - Self-Refinement
  - Reflexion
  - Least-to-Most
  - Standard (direct answering)

  Each strategy is documented with a description and the prompt text that will be prepended to the system message.

commits:
  [{"SHA":"096f40df68019d3675514039271f4c7954f89dd3","Message":"feat: add prompt strategies and improve installation documentation\n\n## CHANGES\n\n- Add prompt strategies like Chain of Thought (CoT)\n- Implement strategy selection with `--strategy` flag\n- Improve README with platform-specific installation instructions\n- Fix web interface documentation link\n- Refactor git operations with new githelper package\n- Add `--liststrategies` command to view available strategies\n- Support applying strategies to system prompts\n- Fix YouTube configuration check\n- Improve error handling in session management","Author":"Kayvan Sylvan"},{"SHA":"f744e25b39110a05e238e35228fed015b3b5a9b7","Message":"change [optional] to [required] in strategies","Author":"Kayvan Sylvan"},{"SHA":"901a010efd7273bcb8fc1d0ee9ea16cda349ae45","Message":"chore: remove fallback to local strategies directory if missing","Author":"Kayvan Sylvan"},{"SHA":"453d8e75e4d1a4967e9eab0b46fad27dd56bb1c3","Message":"fix: fix handling of the installed strategies dir","Author":"Kayvan Sylvan"},{"SHA":"9582978adb688ddda6d07bb01f8616b062eb53c4","Message":"Fix help message when no strategies found.","Author":"Kayvan Sylvan"},{"SHA":"ea7a425a267d3ef7c68e7dc7d1fea945de80f434","Message":"add newline to end of cod.json","Author":"Kayvan Sylvan"},{"SHA":"6b936581915c255f423d4db729ece40488b7af35","Message":"chore: remove redundant yt function definition","Author":"Kayvan Sylvan"}]


title: Remove Generic Type Parameters from StorageHandler Initialization
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1367
merged_at: 2025-03-16 17:25:33+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - Remove explicit type parameters from StorageHandler initialization
  - Update contexts handler constructor implementation
  - Update patterns handler constructor implementation
  - Update sessions handler constructor implementation
  - Simplify API by relying on type inference

  ## What this Pull Request (PR) does

  This PR removes explicit type parameters from `NewStorageHandler` function calls in three REST API handler implementations: contexts, patterns, and sessions. The change simplifies the code by relying on Go's type inference capabilities.

  ## Related issues

  N/A

  ## Reason for Changes

  This change leverages Go's type inference capabilities to simplify the code. Since the `NewStorageHandler` function can infer the type parameter from the provided arguments, explicitly specifying the type parameter is unnecessary. This makes the code cleaner and more maintainable while preserving the same functionality.

  ## Impact of Changes

  The changes have no functional impact on the application. The code will behave exactly the same way, as the compiler will infer the correct types during compilation. This is a code quality improvement that makes the codebase more concise and easier to read.

  While the change is minimal, it demonstrates good Go programming practices by leveraging language features like type inference.

commits:
  [{"SHA":"705ccd750b91e4a8b1db9ed823b4acbdfc8f72a6","Message":"refactor: remove generic type parameters from NewStorageHandler calls\n\n## CHANGES\n\n- Remove explicit type parameters from StorageHandler initialization\n- Update contexts handler constructor implementation\n- Update patterns handler constructor implementation\n- Update sessions handler constructor implementation\n- Simplify API by relying on type inference","Author":"Kayvan Sylvan"}]


title: Standardize sections for no repeat guidelines
author: vaygr
author_url: https://github.com/vaygr
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1368
merged_at: 2025-03-17 14:16:22+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  I was debugging #611, and found out that probably at some point `Resources` was renamed to `References` that was never updated in instructions.

  This somewhat improves `extract_wisdom`, but I also updated the rest of the patterns and relevant sections where these rules apply.

  ## Related issues

  #611

  ## Screenshots

  N/A

commits:
  [{"SHA":"008ed76d37c59bd110b56bc4de58726a2ed31a86","Message":"Standardize sections for no repeat guidelines","Author":"Val V"}]


title: fix: set percentEncoded to false
author: rube-de
author_url: https://github.com/rube-de
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1372
merged_at: 2025-03-19 03:48:26+00:00
created_at: 2025-07-16 04:25:34
body:
  If you use a youtube link like `https://youtu.be/sHIlFKKaq0A` percentEndcoding encodes the link to `https%3A%2F%2Fyoutu.be%2FsHIlFKKaq0A`, which throws an error in fabric.

  With percentEndcoding false, the script receives the link without encoding and works.

  ## Related issues
  https://github.com/danielmiessler/fabric/issues/1075

commits:
  [{"SHA":"e89ccf5e9719881d9c374de03405d1c3d04f113e","Message":"fix: set percentEncoded to false\n\nIf you use a youtube link like `https://youtu.be/sHIlFKKaq0A` percentEndcoding encodes the link to `https%3A%2F%2Fyoutu.be%2FsHIlFKKaq0A`, which throws an error in fabric.\r\n\r\nWith percentEndcoding false, the script receives the link without encoding and works.","Author":"beruf"}]


title: Remove unnecessary `system.md` file at top level.
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1373
merged_at: 2025-03-19 03:47:02+00:00
created_at: 2025-07-16 04:25:34
body:
  CHANGES:

  - Removed `system.md` on the top level of the fabric repo.
  - system.md was an RPG session summarization prompt.
  - There are two other RPM summary patterns created after this file was added: `create_rpg_summary` and `summarize_rpg_session`

  ## What this Pull Request (PR) does

  Remove an abandoned file.

  ## Related issues

  N/A

  ## Screenshots

  N/A

commits:
  [{"SHA":"1fe8afd329b413d785a2d0cef170902fc78d3f5f","Message":"chore: Remove redundant file system.md at top level.\n\nCHANGES:\n- Removed `system.md` on the top level of the fabric repo.\n- system.md was an RPG session summarization prompt.\n- There are two other RPM summary patterns created after this file was added: `create_rpg_summary` and `summarize_rpg_session`","Author":"Kayvan Sylvan"}]


title: Fix Default Model Change Functionality
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1374
merged_at: 2025-03-19 03:44:11+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This PR fixes an issue where changes to the default model were not being persisted to the environment file. Now, after setting up the default model, we explicitly save the environment file to ensure changes are preserved.

  ## Related issues
  closes #1353 

  ## Screenshots

  ### Before fix:

  ```plaintext
  $ grep DEFAULT ~/.config/fabric/.env 
  DEFAULT_VENDOR=OpenAI
  DEFAULT_MODEL=gpt-4o
  kayvan@thor ~ $ fabric -d

  Available models:
  [...]
          [136]   tts-1
          [137]   computer-use-preview
          [138]   o1

  [Default]

  Enter the index the name of your default model (leave empty for 'gpt-4o' or type 'reset' to remove the value):
  o1

  Enter model context length (leave empty to skip):


  DEFAULT_VENDOR: OpenAI
  DEFAULT_MODEL: o1
  ```

  However, looking at `.env` we still see:

  ```plaintext
  $ grep DEFAULT ~/.config/fabric/.env
  DEFAULT_VENDOR=OpenAI
  DEFAULT_MODEL=gpt-4o
  ```

  ### After fix:

  Running the same flow:

  ```plaintext
  [...]
          [142]   computer-use-preview
          [143]   o1

  [Default]

  Enter the index the name of your default model (leave empty for 'gpt-4o' or type 'reset' to remove the value):
  o1

  Enter model context length (leave empty to skip):


  DEFAULT_VENDOR: OpenAI
  DEFAULT_MODEL: o1
  ```

  And the `.env` file is changed as expected:

  ```plaintext
  $ grep DEFAULT ~/.config/fabric/.env 
  DEFAULT_VENDOR=OpenAI
  DEFAULT_MODEL=o1
  ```

commits:
  [{"SHA":"85cc7b8a9dba40e8cbb71488c8660a1ccfc1a2ef","Message":"fix: improve error handling in ChangeDefaultModel flow and save environment file\n\n- Add early return on setup error\n- Save environment file after successful setup\n- Maintain proper error propagation","Author":"Kayvan Sylvan"}]


title: Add installation instructions for OS package managers
author: vaygr
author_url: https://github.com/vaygr
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1376
merged_at: 2025-03-21 12:57:00+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  Fabric has been packaged in Homebrew (macOS, Linux) and AUR (Arch Linux, and Arch-like distributions).

  - Homebrew: `arm64_sequoia`, `arm64_sonoma`, `arm64_ventura`, `sonoma`, `ventura`, `x86_64_linux`
  - AUR: `x86_64`, `aarch64`

  This adds instructions to install Fabric using native OS package managers.

  ## Related issues

  Closes #274.
  Closes #812.

  ## Screenshots

  N/A

commits:
  [{"SHA":"4e4bfc9d5d21af19d9742086a337a90485442c43","Message":"Add installation instructions for OS package managers","Author":"Val V"}]


title: Fix typo on fallacies instruction.
body:
  ## What this Pull Request (PR) does
  Fix typo on fallacies instruction.

author: guilhermechapiewski
author_url: https://github.com/guilhermechapiewski
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1379
merged_at: 2025-03-22 08:50:14+00:00
created_at: 2025-07-16 04:25:34
commits:
  [{"SHA":"d6ceae9efdb2ab2b0d739c6f5025e9066a6699be","Message":"Fix typo on fallacies instruction.","Author":"Guilherme Chapiewski"}]


title: Add flex windows sizing to web interface + raw text input fix
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1380
merged_at: 2025-03-22 08:51:07+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  Implement possibility to resize the three main windows in the chat interface within safe limits. 

  Also fixed an issue pertaining to raw text input not being passed for processing.

  ## Screenshots.

  <img width="1668" alt="Screenshot 2025-03-21 at 6 25 32 PM" src="https://github.com/user-attachments/assets/827e98d4-c0b0-4ae7-865b-aa69817cc1be" />
  <img width="1668" alt="Screenshot 2025-03-21 at 6 25 12 PM" src="https://github.com/user-attachments/assets/e195cc40-9b90-4271-9fdd-f343aa828269" />
  <img width="1668" alt="Screenshot 2025-03-21 at 6 24 59 PM" src="https://github.com/user-attachments/assets/e62c94d3-5d43-432a-8f7f-41f29934d97d" />

commits:
  [{"SHA":"943b26eeefe0d76d6be2a373afdfacadb40050ea","Message":"Add flex windows sizing to web interface","Author":"jmd1010"},{"SHA":"4208a021915bb93bfca9c8b1946bc93cda23254d","Message":"fixed processing message not stopping after pattern output completion","Author":"jmd1010"}]


title: docs: improve README formatting and fix some broken links
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1382
merged_at: 2025-03-22 08:49:32+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - Remove colons from heading anchors
  - Fix broken installation link reference
  - Replace code tags with backticks
  - Improve code block formatting with indentation
  - Clarify package manager alias requirements
  - Fix environment variables link
  - Simplify custom patterns directory instructions

  ## What this Pull Request (PR) does

  Fix some README bugs.

commits:
  [{"SHA":"c2e84d6db90953424c273f8153c53947180d1664","Message":"docs: improve README formatting and add clipboard support section\n\n## CHANGES\n\n- Remove colons from heading anchors\n- Fix broken installation link reference\n- Replace code tags with backticks\n- Improve code block formatting with indentation\n- Clarify package manager alias requirements\n- Fix environment variables link\n- Simplify custom patterns directory instructions","Author":"Kayvan Sylvan"}]


title: Create Coding Feature
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1389
merged_at: 2025-03-26 07:29:08+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Inspired by [@nysan](https://github.com/nysan) PR https://github.com/danielmiessler/fabric/pull/1310

  This PR implements a new pattern called `create_coding_feature` that allows users to generate and apply AI-suggested code changes directly to their project files. The implementation includes:

  1. A new `code_helper` CLI tool that scans a project directory and creates a JSON representation for AI analysis
  2. A file management system that safely parses and applies file changes
  3. Integration with the core Fabric system to process file changes when using the pattern
  4. Comprehensive documentation and tests

  ## Quick Demo

  In an empty git directory:

  ```plaintext
  kayvan@dharma ENV/test [master] $ code_helper . 'Create a bouncing ball demo in python.
  You should be able to specify the number of balls by a command line argument and the physics 
  should be realistic. Create a Makefile for setting up the venv using "uv venv" and "uv pip install"
  and to run the demo' | fabric -m create_coding_feature -m deepseek-r1-distill-llama-70b 

  Applied create operation to bouncing_balls.py
  Applied create operation to Makefile
  Applied create operation to README.md
  Successfully applied file changes.
  You can review the changes with 'git diff' if you're using git.

  <think>
  Okay, I need to figure out how to create a bouncing ball demo in Python based on the user's instructions. Let me break down the problem step by step.
  [...]
  </think>
  I'll help you create a realistic bouncing ball demo with physics and a proper Makefile setup. Here's the implementation:
  ```

  Run make

  ```plaintext
  kayvan@dharma ENV/test [master?] $ make
  Creating virtual environment...
  uv venv venv
  Using CPython 3.12.9
  Creating virtual environment at: venv
  Activate with: source venv/bin/activate
  Installing dependencies...
  source ./venv/bin/activate && uv pip install pygame
  Using Python 3.12.9 environment at: venv
  Resolved 1 package in 63ms
  Installed 1 package in 11ms
   + pygame==2.6.1
  kayvan@dharma ENV/test [master?] $ 
  ```

  And to run it:

  ```plaintext
  kayvan@dharma ENV/test [master?] $ make run
  Running bouncing balls demo...
  venv/bin/python bouncing_balls.py --balls 5
  pygame 2.6.1 (SDL 2.28.4, Python 3.12.9)
  Hello from the pygame community. https://www.pygame.org/contribute.html
  2025-03-25 19:57:30.859 python[32268:1399899] +[IMKClient subclass]: chose IMKClient_Modern
  2025-03-25 19:57:30.859 python[32268:1399899] +[IMKInputSession subclass]: chose IMKInputSession_Modern
  ^C
  ```

  Demo of running it with `--balls 10`

  https://github.com/user-attachments/assets/519a40f5-42cf-4b1f-9b07-311dd864af78


  ## Files Changed

  ### New Files
  - `common/file_manager.go`: Core functionality for parsing and applying file changes
  - `common/file_manager_test.go`: Tests for the file manager functionality
  - `patterns/create_coding_feature/README.md`: Documentation for the new pattern
  - `patterns/create_coding_feature/system.md`: System prompt for the AI model
  - `plugins/tools/code_helper/code.go`: Code scanning and JSON generation functionality
  - `plugins/tools/code_helper/main.go`: CLI interface for the code helper tool

  ### Modified Files
  - `README.md`: Added documentation for the new `code_helper` tool
  - `common/attachment.go`: Updated deprecated imports
  - `core/chatter.go`: Added file change processing for the new pattern

  ## Code Changes

  The most significant changes include:

  1. In `common/file_manager.go`, a system for safely parsing and applying file changes:
  ```go
  // ParseFileChanges extracts and parses the file change marker section from LLM output
  func ParseFileChanges(output string) (changeSummary string, changes []FileChange, err error) {
      // Implementation for parsing file changes from AI output
  }

  // ApplyFileChanges applies the parsed file changes to the file system
  func ApplyFileChanges(projectRoot string, changes []FileChange) error {
      // Implementation for applying changes to the filesystem
  }
  ```

  2. In `core/chatter.go`, integration with the Fabric chat system:
  ```go
  // Process file changes if using the create_coding_feature pattern
  if request.PatternName == "create_coding_feature" {
      // Look for file changes in the response
      summary, fileChanges, parseErr := common.ParseFileChanges(message)
      if parseErr != nil {
          fmt.Printf("Warning: Failed to parse file changes: %v\n", parseErr)
      } else if len(fileChanges) > 0 {
          // Apply file changes to the project
          // ...
      }
      message = summary
  }
  ```

  3. In `plugins/tools/code_helper/code.go`, the project scanning functionality:
  ```go
  // ScanDirectory scans a directory and returns a JSON representation of its structure
  func ScanDirectory(rootDir string, maxDepth int, instructions string, ignoreList []string) ([]byte, error) {
      // Implementation for scanning directory structure
  }
  ```

  ## Reason for Changes

  This feature addresses a common need for developers to get AI assistance with code generation and modification. The pattern allows for:

  1. Analyzing existing code structure
  2. Generating new code or modifying existing code
  3. Applying changes directly to the file system
  4. Maintaining security and safety throughout the process

  The implementation follows a secure approach with validation of file paths, operations, and content sizes to prevent potential security issues.

  ## Impact of Changes

  The `create_coding_feature` pattern significantly enhances Fabric's capabilities by:

  1. Enabling direct code generation and modification
  2. Providing a standardized format for AI-suggested code changes
  3. Integrating with existing version control workflows
  4. Supporting various programming languages and project structures

  This feature will be particularly useful for:
  - Implementing new features in existing codebases
  - Refactoring code for better maintainability
  - Fixing bugs with AI assistance
  - Learning how to implement specific programming patterns

  ## Test Plan

  The implementation includes comprehensive tests:
  - Unit tests for the file manager functionality
  - Tests for parsing various file change formats
  - Tests for applying file changes to the file system
  - Validation of security measures

  Additionally, manual testing has been performed to ensure the pattern works correctly with different project structures and instructions.

  ## Additional Notes

  1. The PR also includes a minor update to replace deprecated `ioutil` functions with their modern equivalents in `os` and `io` packages.
  2. The implementation uses `errors.New()` instead of `fmt.Errorf()` for simple error messages without formatting.
  3. Security measures include path validation, operation validation, and file size limits.

commits:
  [{"SHA":"9b56e0e9962091022de8c639022d7328e01d0ad6","Message":"feat: add `fabric_code` tool and `create_coding_feature` pattern\n\nThis commit introduces the `fabric_code` tool and the `create_coding_feature` pattern, allowing Fabric to modify existing codebases.\n\n## CHANGES\n\n-   add `fabric_code` tool to generate JSON representation of code projects\n-   add `create_coding_feature` pattern to apply AI-generated code changes\n-   update README with `fabric_code` installation and usage\n-   walk file system with maximum depth and ignore list\n-   scan directory and return file/dir JSON data for AI model\n-   provide usage instructions and examples for `fabric_code`\n-   add file management API to system prompt for code changes","Author":"Kayvan Sylvan"},{"SHA":"111482e46ea666387071b55c945311e7e8855b0a","Message":"feat: add file management system for AI-driven code changes\n\nCHANGES:\n- Replace deprecated io/ioutil with modern alternatives\n- Add file change parsing and validation system\n- Create secure file application mechanism\n- Update chatter to process AI file changes\n- Improve create_coding_feature pattern documentation","Author":"Kayvan Sylvan"},{"SHA":"5f5822f1c600d2fddee33335ac9a128bb5ee95e9","Message":"fix: improve JSON parsing in ParseFileChanges to handle invalid escape sequences\n\n## CHANGES\n\n- Add dedicated function to fix invalid JSON escapes\n- Handle common \\C escape sequence issue\n- Implement fallback parsing with comprehensive escape fixes\n- Track string context for accurate escape detection\n- Preserve valid JSON escape sequences","Author":"Kayvan Sylvan"},{"SHA":"8a326e9cfbea1b81c88cb4a925f29841eff44da6","Message":"refactor: replace FILE_CHANGES marker with constant FileChangesMarker\n\n## CHANGES\n\n- Add FileChangesMarker constant for file changes section\n- Update parser to use new constant marker\n- Improve error messages with dynamic marker reference\n- Update tests to use new marker format\n- Update system documentation with new marker syntax","Author":"Kayvan Sylvan"},{"SHA":"3785d0a5fad785a01bee24e1b567e084e0f8c6f8","Message":"refactor: modify `ParseFileChanges` to return summary and changes separately\n\nCHANGES:\n*   Return summary text from `ParseFileChanges` separately.\n*   Update `chatter` to use returned summary text.\n*   Update tests to match new function signature.","Author":"Kayvan Sylvan"},{"SHA":"daad5f986e15992c43aff412a11ae13f075ffd7d","Message":"refactor: rename `fabric_code` tool to `code_helper` for clarity\n\n## CHANGES\n\n- Rename tool from `fabric_code` to `code_helper`\n- Update all documentation references to the tool\n- Update installation instructions in README\n- Modify usage examples in documentation\n- Update tool's self-description and help text","Author":"Kayvan Sylvan"},{"SHA":"55fda5e025b21b759087a31c21cda74b5f311e17","Message":"fix: enhance JSON string handling with proper control character escaping\n\n## CHANGES\n\n- Convert control chars to proper JSON escape sequences\n- Prevent invalid JSON due to literal control chars","Author":"Kayvan Sylvan"}]


title: docs: improve README link
author: PatrickCLee
author_url: https://github.com/PatrickCLee
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1390
merged_at: 2025-03-26 07:31:15+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  - Fix broken what-and-why link reference


  ## Screenshots
  ![image](https://github.com/user-attachments/assets/590f7f74-4741-431b-87bb-5a4549c90835)

commits:
  [{"SHA":"01770cc6e328b5e4e21ad9b9067804f9ac152508","Message":"docs: improve README link\n\n- Fix broken what-and-why link reference","Author":"PatrickCLee"}]


title: chore: enhance argument validation in `code_helper` tool
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1392
merged_at: 2025-03-29 20:11:34+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This PR refactors the `code_helper` tool to improve its command-line interface, error handling, and overall code quality. The changes enforce a more consistent usage pattern by requiring both directory and instructions arguments, while also improving error messages and simplifying the codebase.

  ## Files Changed

  ### plugins/tools/code_helper/main.go
  Refactored the main CLI implementation to be more robust and user-friendly.

  ## Code Changes

  1. **Simplified command-line flags handling**:
     - Removed the redundant `-help` flag in favor of the built-in `flag.Usage`
     - Set `flag.Usage` to our custom `printUsage` function for better help output

  2. **Improved argument validation**:
     - Now requires exactly two positional arguments (directory and instructions)
     - Previously allowed optional instructions, which could lead to confusion
     ```go
     // Before
     if *showHelp || flag.NArg() < 1 {
         printUsage()
         os.Exit(0)
     }
     
     // After
     if flag.NArg() != 2 {
         printUsage()
         os.Exit(1)
     }
     ```

  3. **Enhanced directory validation**:
     - Now checks if the path both exists AND is a directory
     - Provides a more descriptive error message
     ```go
     // Before
     if _, err := os.Stat(directory); os.IsNotExist(err) {
         fmt.Fprintf(os.Stderr, "Error: Directory '%s' does not exist\n", directory)
         os.Exit(1)
     }
     
     // After
     if info, err := os.Stat(directory); err != nil || !info.IsDir() {
         fmt.Fprintf(os.Stderr, "Error: Directory '%s' does not exist or is not a directory\n", directory)
         os.Exit(1)
     }
     ```

  4. **Code simplification**:
     - Removed the separate `ParseIgnorePatterns` function and inlined its functionality
     - Simplified variable declarations and error handling
     - Improved error message specificity

  5. **Usage documentation improvements**:
     - Updated usage text to reflect that instructions are now required
     - Streamlined examples for clarity
     - Directed usage output to stderr instead of stdout

  ## Reason for Changes
  These changes address several issues with the original implementation:

  1. The CLI interface was inconsistent, allowing instructions to be optional
  2. Error messages were generic and didn't provide enough context
  3. The code contained unnecessary complexity with separate functions for simple operations
  4. Help text was displayed to stdout, which could interfere with piping operations

  ## Impact of Changes
  - **Breaking change**: The tool now requires both directory and instructions arguments
  - Improved user experience with better error messages and usage information
  - More robust validation of inputs before processing
  - Cleaner codebase with less redundancy

  ## Test Plan
  - Verify the tool works correctly with valid arguments
  - Confirm appropriate error messages when:
    - Fewer than 2 arguments are provided
    - The specified path doesn't exist
    - The specified path exists but isn't a directory
  - Test output redirection to both file and stdout

  ## Additional Notes
  This refactoring maintains the core functionality while making the tool more robust and user-friendly. The breaking change (requiring instructions) is justified as it prevents ambiguous usage patterns and potential errors.

commits:
  [{"SHA":"f529b8bb80736c55fb27f1164a7b072123998d6c","Message":"refactor: streamline code_helper CLI interface and require explicit instructions\n\n## CHANGES\n\n- Require exactly two arguments: directory and instructions\n- Remove dedicated help flag, use flag.Usage instead\n- Improve directory validation to check if it's a directory\n- Inline pattern parsing, removing separate function\n- Simplify error messages for better clarity\n- Update usage text to reflect required instructions parameter\n- Print usage to stderr instead of stdout","Author":"Kayvan Sylvan"}]


title: feat: add it lang to the chat drop down menu lang in web gui
author: HaroldFinchIFT
author_url: https://github.com/HaroldFinchIFT
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1397
merged_at: 2025-03-31 14:41:34+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Hi!
  This PR adds support for the Italian language in the language selection dropdown for the Web GUI.
  As an Italian, I thought this could be useful for others as well.

  I modified the array of supported languages by adding the last one (Italian):

  ```typescript
  const languages = [
      { code: '', name: 'Default Language' },
      { code: 'en', name: 'English' },
      { code: 'fr', name: 'French' },
      { code: 'es', name: 'Spanish' },
      { code: 'de', name: 'German' },
      { code: 'zh', name: 'Chinese' },
      { code: 'ja', name: 'Japanese' },
      { code: 'it', name: 'Italian' }
    ];
  ```

  I tested this locally, and it seems to work without any issues.
  Additionally, the Fabric CLI correctly recognizes Italian as a valid option.

  However, since this project uses Svelte and TypeScript, which I'm not deeply familiar with, I’d really appreciate any feedback from more experienced contributors.
  Please let me know if any changes are needed!

  Looking forward to your review and constructive feedback.

  Thanks!

commits:
  [{"SHA":"fd58b6d410d44854f1ace6f8287e0117f2d4281e","Message":"feat: add it lang to the chat drop down menu lang in web gui","Author":"Harold"}]


title: feat: add simple optional api key management for protect routes in --serve mode
author: HaroldFinchIFT
author_url: https://github.com/HaroldFinchIFT
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1399
merged_at: 2025-04-02 13:32:31+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Hi all. This PR introduces basic API Key protection for the `--serve` mode in Fabric. Currently, when running Fabric with `--serve`, the API is completely open, which poses security risks — especially considering that `GET /config` exposes API keys of various AI models.

  ### Motivation
  - I wanted to deploy Fabric as a Docker container at home exposed in my network in `--serve` mode.
  - Without network-level security configurations, the API would be freely accessible within the network.
  - This change is a first step towards improving security, providing a simple way to restrict access.

  ### Implementation
  - Added an `--apikey` flag to protect server routes.
  - If set, requests must include `X-API-Key: <API_KEY>` header.
  - If not set, behavior remains unchanged for backward compatibility.
  - Implemented as a middleware (auth.go) that checks the request header before allowing access to routes.

  ### Testing
  - I tested this locally, and the behavior seems to work as expected.

  This is just an initial proposal, open to discussion and improvements. I’m always mindful of security, so I thought this could be a useful contribution. I’m not a Go expert, so feedback and constructive criticism are very welcome!

  Looking forward to your thoughts!
  Thanks!

commits:
  [{"SHA":"15a2eeadc96e05c1acb9b7625ec909511bf88d4e","Message":"feat: add simple optional api key management for protect routes in --serve mode","Author":"Harold"},{"SHA":"ceaa90a7c7b9c2e7e1f79bf8e702e4233fd7879e","Message":"fix: bad format","Author":"Harold"},{"SHA":"cd74a96be2a34e7ba254224b0eeeb37a276eee03","Message":"refactor: refactor API key middleware based on code review feedback","Author":"Harold"}]


title: Strategy flag enhancement - Web UI implementation
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1403
merged_at: 2025-04-11 19:12:12+00:00
created_at: 2025-07-16 04:25:34
body:
  ### Created API end points to integrate the strategy flags in the web ui. 

  Strategies, when selected, prepend the pattern prompt as per the cli implementation. 

  <img width="674" alt="Screenshot 2025-04-10 at 6 41 23 PM" src="https://github.com/user-attachments/assets/3b1754ce-6da2-418a-bd5e-1b739fc0b9e3" />

  ### Here is a summary of the files modified to implement the strategy support in the Fabric project, covering both the frontend (Svelte) and backend (Gin API):

  **Frontend (Svelte Web UI)**
  web/src/lib/store/strategy-store.ts

  **Created a Svelte store to manage the list of strategies and the selected strategy.**
  Fetches the list from the static file /strategies/strategies.json.
  web/static/strategies/strategies.json

  **Created a static manifest listing all available strategies (name + description).**
  Used by the frontend dropdown to populate options.
  web/src/lib/components/chat/DropdownGroup.svelte

  **Added a new dropdown for "Prompt Strategy".**
  Binds to the selected strategy store.
  Fetches and displays strategies from the static manifest.
  web/src/lib/services/ChatService.ts

  **Modified to include the selected strategy name in chat POST requests.**
  web/src/lib/interfaces/chat-interface.ts

  Extended the ChatPrompt interface to include an optional strategyName field.

  ### Backend (Gin REST API)
  restapi/strategies.go

  **New file implementing the /strategies GET endpoint.**
  Reads strategy JSON files from ~/.config/fabric/strategies/ and returns their metadata.
  restapi/serve.go

  **Registered the new /strategies endpoint by calling NewStrategiesHandler().**
  restapi/chat.go

  **Extended the PromptRequest struct to include strategyName.**
  Modified the chat POST handler to:
  Load the strategy prompt from ~/.config/fabric/strategies/<name>.json if strategyName is set.
  Prepend the strategy prompt to the user input before sending to the LLM.


  **Summary**
  The frontend now allows users to select a strategy, which is included in chat requests.
  The backend exposes /strategies and applies the selected strategy prompt dynamically.
  The CLI behavior remains unchanged.


  @ksylvan this one's for you!  

commits:
  [{"SHA":"b25895c1d2bb00e2c66b4d9090494dbe94fe77f1","Message":"Integrate in web ui the strategy flag enhancement first developed in fabric cli","Author":"jmd1010"},{"SHA":"746885e2632026adf9352c316034ddc2c724747b","Message":"Update strategies.json","Author":"JM"}]


title: Fix chat history LLM response sequence in ChatInput.svelte
author: jmd1010
author_url: https://github.com/jmd1010
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1406
merged_at: 2025-04-13 07:10:12+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Fixed a relatively minor issue  where sometimes new chat responses would not be added below the previous chat  but rather replaces it in web UI (chat history). 

  Complement : fixing remaining V2 loose ends

  1. Addressed language nagging issue where YT response language <> EN would show output headings in english nevertheless.
  2. Ensure proper Pattern reset in UI to enable "pattternless" prompts eg only using strategy for a given input.
  3. Added pattern descriptions for the new 15 patterns added to the core library.  

  PS After this I am confident  or hope:) we start planning V3 with interested collaborators.
   
  @ksylvan Note original PR modified

commits:
  [{"SHA":"13e9d22ec6f24b5fbcb8b77bf587ddc0d3c77f22","Message":"Fix chat history LLM response sequence in ChatInput.svelte","Author":"jmd1010"},{"SHA":"3d2903cb47828b3df09d1cfd948bfbefcccde80a","Message":"Finalize WEB UI V2 loose endsfixes","Author":"jmd1010"},{"SHA":"9e57f8c6f1b94b212397a91dfb3a8bb42a47085f","Message":"Update pattern_descriptions.json","Author":"JM"}]


title: Update Dockerfile so that Go image version matches go.mod version
author: sherif-fanous
author_url: https://github.com/sherif-fanous
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1407
merged_at: 2025-04-15 08:55:18+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Updates the base Go image from 1.23.3 to 1.23.4 to match the minimum required Go version specified in the `go.mod` file

  Without this PR the Docker image fails to build with the error

  ```bash
  => ERROR [builder 4/6] RUN go mod download                                                                                                                                                                                                                                                            0.1s
  ------
   > [builder 4/6] RUN go mod download:
  0.101 go: go.mod requires go >= 1.23.4 (running go 1.23.3; GOTOOLCHAIN=local)
  ```

commits:
  [{"SHA":"74d4be1ac633a0b973618c45ad423f1594a8d6e0","Message":"Bump golang version to match go.mod","Author":"Sherif Fanous"}]


title: docs: add contributors section to README with contrib.rocks image
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1411
merged_at: 2025-04-16 09:29:58+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - Add contributors section with visual representation
  - Include link to project contributors page
  - Add attribution to contrib.rocks tool

  ## What this Pull Request (PR) does

  This pull request adds a "Contributors" section to the `README.md` file, utilizing the `contrib.rocks` service to visually display project contributors.

  ## Related issues

  N/A

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/71cd9e47-46dc-4a5f-a542-e1ae8408caeb)

  Clicking on the image leads to the project contributors page on GitHub: https://github.com/danielmiessler/fabric/graphs/contributors

commits:
  [{"SHA":"661c85d7a68f084926e17156ef488f690c3a427c","Message":"# docs: add contributors section to README with contrib.rocks image\n\n## CHANGES\n\n- Add contributors section with visual representation\n- Include link to project contributors page\n- Add attribution to contrib.rocks tool","Author":"Kayvan Sylvan"}]


title: feat: add Grok AI provider support
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1415
merged_at: 2025-04-16 18:15:45+00:00
created_at: 2025-07-16 04:25:34
body:
  Integrate the Grok AI provider into the Fabric system for AI model interactions.

  ### CHANGES

  * Add Grok AI client to the plugin registry.
  * Include Grok AI API key in REST API configuration endpoints.
  * Updated README note.

  ## What this Pull Request (PR) does

  This pull request adds support for GrokAI as a new AI plugin in the fabric project. The changes include the addition of a new plugin client for GrokAI, integration into the plugin registry, and updates to the configuration handler to manage GrokAI API keys.

  ## Related issues

  closes #1412

  ## Screenshots

  `fabric -L` now shows this:

  ![image](https://github.com/user-attachments/assets/eedfd40b-7496-4160-9ee6-795fbcf24813)

  Also, tested by having it write most of this PR:

  ![image](https://github.com/user-attachments/assets/49d5a45f-0e96-4733-8a9f-027b80c971b6)

  ## Files Changed

  - **core/plugin_registry.go**: Updated to include the GrokAI plugin in the registry.
  - **plugins/ai/grokai/grokai.go**: New file added to define the GrokAI client, leveraging compatibility with the OpenAI client.
  - **plugins/ai/grokai/grokai_test.go**: New test file added to verify the initialization of the GrokAI client.
  - **restapi/configuration.go**: Updated to include GrokAI API key management in the configuration endpoints.

  ## Code Changes

  - In **core/plugin_registry.go**, the GrokAI client is imported and instantiated in the `NewPluginRegistry` function:
    ```go
    grokai.NewClient(),
    ```

  - In **plugins/ai/grokai/grokai.go**, a new `Client` struct is defined embedding the OpenAI client for compatibility, with the API endpoint set to GrokAI's URL:
    ```go
    ret.Client = openai.NewClientCompatible("GrokAI", "https://api.x.ai/v1", nil)
    ```

  - In **plugins/ai/grokai/grokai_test.go**, a basic test ensures the embedded OpenAI client is not nil:
    ```go
    if client.Client == nil {
        t.Fatalf("Expected embedded openai.Client to be non-nil, got nil")
    }
    ```

  - In **restapi/configuration.go**, the configuration handler is updated to include GrokAI API key retrieval and updates, ensuring it can be configured via the REST API:
    ```go
    "grokai": os.Getenv("GROKAI_API_KEY"),
    ```

  ## Reason for Changes

  The purpose of these changes is to integrate GrokAI as a supported AI service within the fabric project. This allows users to utilize GrokAI's capabilities alongside other AI providers already supported by the platform, enhancing flexibility and choice for AI-driven functionalities.

  ## Impact of Changes

  These changes introduce a new AI provider option without disrupting existing functionality. Users can now configure and use GrokAI through the same interfaces and configuration mechanisms as other AI plugins. This should have no negative impact on performance and broadens the project's compatibility with AI services.

  ## Test Plan

  The changes include a basic unit test to ensure the GrokAI client initializes correctly. Further testing should include:
  - Integration tests to verify GrokAI API interactions through the fabric platform. [✅ ]
  - Manual testing of the configuration endpoints to ensure GrokAI API keys are properly handled. [✅ ]
  - Validation that existing AI plugins remain unaffected by this addition. [✅ ]

commits:
  [{"SHA":"82039cedaf51ba777c0ca4f549e26be226a3b28a","Message":"feat: add Grok AI provider support`\n\nIntegrate the Grok AI provider into the Fabric system for AI model interactions.\n\n### CHANGES\n\n*   Add Grok AI client to the plugin registry.\n*   Include Grok AI API key in REST API configuration endpoints.","Author":"Kayvan Sylvan"},{"SHA":"ef895a1ab95a523fe0bb5bd0e6aae32c02b4c636","Message":"chore: Update README with a note about Grok","Author":"Kayvan Sylvan"}]


title: chore(deps): bump golang.org/x/net from 0.36.0 to 0.38.0 in the go_modules group across 1 directory
author: dependabot
author_url: https://github.com/apps/dependabot
author_type: bot
url: https://github.com/danielmiessler/Fabric/pull/1418
merged_at: 2025-04-19 20:56:00+00:00
created_at: 2025-07-16 04:25:34
body:
  Bumps the go_modules group with 1 update in the / directory: [golang.org/x/net](https://github.com/golang/net).

  Updates `golang.org/x/net` from 0.36.0 to 0.38.0
  <details>
  <summary>Commits</summary>
  <ul>
  <li><a href="https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9"><code>e1fcd82</code></a> html: properly handle trailing solidus in unquoted attribute value in foreign...</li>
  <li><a href="https://github.com/golang/net/commit/ebed060e8f30f20235f74808c22125fd86b15edd"><code>ebed060</code></a> internal/http3: fix build of tests with GOEXPERIMENT=nosynctest</li>
  <li><a href="https://github.com/golang/net/commit/1f1fa29e0a46fffe18c43a9da8daa5a0b180dfa9"><code>1f1fa29</code></a> publicsuffix: regenerate table</li>
  <li><a href="https://github.com/golang/net/commit/12150816f701c912a32a376754ab28dd3878833a"><code>1215081</code></a> http2: improve error when server sends HTTP/1</li>
  <li><a href="https://github.com/golang/net/commit/312450e473eae9f9e6173ad895c80bc5ea2f79ad"><code>312450e</code></a> html: ensure &lt;search&gt; tag closes &lt;p&gt; and update tests</li>
  <li><a href="https://github.com/golang/net/commit/09731f9bf919b00b344c763894cd1920b3d96d90"><code>09731f9</code></a> http2: improve handling of lost PING in Server</li>
  <li><a href="https://github.com/golang/net/commit/55989e24b972a90ab99308fdc7ea1fb58a96fef1"><code>55989e2</code></a> http2/h2c: use ResponseController for hijacking connections</li>
  <li><a href="https://github.com/golang/net/commit/2914f46773171f4fa13e276df1135bafef677801"><code>2914f46</code></a> websocket: re-recommend gorilla/websocket</li>
  <li><a href="https://github.com/golang/net/commit/99b3ae0643f9a2f9d820fcbba5f9e4c83b23bd48"><code>99b3ae0</code></a> go.mod: update golang.org/x dependencies</li>
  <li>See full diff in <a href="https://github.com/golang/net/compare/v0.36.0...v0.38.0">compare view</a></li>
  </ul>
  </details>
  <br />


  [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.36.0&new-version=0.38.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

  Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

  [//]: # (dependabot-automerge-start)
  [//]: # (dependabot-automerge-end)

  ---

  <details>
  <summary>Dependabot commands and options</summary>
  <br />

  You can trigger Dependabot actions by commenting on this PR:
  - `@dependabot rebase` will rebase this PR
  - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
  - `@dependabot merge` will merge this PR after your CI passes on it
  - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
  - `@dependabot cancel merge` will cancel a previously requested merge and block automerging
  - `@dependabot reopen` will reopen this PR if it is closed
  - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
  - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
  - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions
  You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/danielmiessler/fabric/network/alerts).

  </details>

commits:
  [{"SHA":"8c84d4b3c870c73e71136a2ee970a990b9844613","Message":"chore(deps): bump golang.org/x/net\n\nBumps the go_modules group with 1 update in the / directory: [golang.org/x/net](https://github.com/golang/net).\n\n\nUpdates `golang.org/x/net` from 0.36.0 to 0.38.0\n- [Commits](https://github.com/golang/net/compare/v0.36.0...v0.38.0)\n\n---\nupdated-dependencies:\n- dependency-name: golang.org/x/net\n  dependency-version: 0.38.0\n  dependency-type: indirect\n  dependency-group: go_modules\n...\n\nSigned-off-by: dependabot[bot] \u003csupport@github.com\u003e","Author":"dependabot[bot]"}]


title: Fix error in deleting patterns due to non empty directory
author: sherif-fanous
author_url: https://github.com/sherif-fanous
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1420
merged_at: 2025-04-18 16:21:50+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  A Fabric pattern is made up of a directory in `~/.config/fabric/patterns` where the name of the directory represents the pattern name. Within that directory are one or more `.md` files that describe the pattern.

  With the current implementation that uses `os.Remove`, invoking the `DELETE /patterns/:name` API results in the following error

  ```bash
  "could not delete test: remove /Users/sherif/.config/fabric/patterns/test: directory not empty"
  ```

  since [`os.Remove`](https://pkg.go.dev/os#Remove) will only delete files or **empty** directories.

  This PR replaces `os.Remove` with [`os.RemoveAll`](https://cs.opensource.google/go/go/+/go1.24.2:src/os/path.go;l=73) that deletes the specified path and any children it contains

  This ensures that patterns can be deleted whilst also maintaining functionality of being able to delete entities such as contexts/sessions 

commits:
  [{"SHA":"9000f92a5587630d6bb6cc24a65df74090b1dc4e","Message":"Fix error in deleting patterns due to non empty directory","Author":"Sherif Fanous"}]


title: feat: add Atom-of-Thought (AoT) strategy and prompt definition
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1421
merged_at: 2025-04-18 16:20:42+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - add new aot.json for Atom-of-Thought (AoT) prompting
  - define AoT strategy description and detailed prompt instructions
  - update strategies.json to include AoT in available strategies list
  - ensure AoT strategy appears alongside CoD, CoT, and LTM options

  ## What this Pull Request (PR) does

  This pull request introduces a new prompting strategy called Atom-of-Thought (AoT) to the project. The changes include the addition of a configuration file for the AoT strategy and an update to the strategies list used in the web interface.

  ## Related issues

  #1381

  Discussion from @jmd1010 referencing this blog post: https://medium.com/@the_manoj_desai/forget-chain-of-thought-atom-of-thought-is-the-future-of-prompting-aea0134e872c

  And this https://github.com/themanojdesai/GenAI/tree/main/posts/atom_of_thoughts

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/f52099f6-52ff-45cc-942c-c9a818ffb5b8)

commits:
  [{"SHA":"f286936c2349fa1d9fec093e2be0ab53960f6f9b","Message":"feat: add Atom-of-Thought (AoT) strategy and prompt definition\n\n## CHANGES\n\n- add new aot.json for Atom-of-Thought (AoT) prompting\n- define AoT strategy description and detailed prompt instructions\n- update strategies.json to include AoT in available strategies list\n- ensure AoT strategy appears alongside CoD, CoT, and LTM options","Author":"Kayvan Sylvan"},{"SHA":"71a5e0394a7f493edae2643dbd4ce98e731c2dac","Message":"chore: add final newline to aot json file","Author":"Kayvan Sylvan"}]


title: feat: add Cerebras AI plugin to plugin registry
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1425
merged_at: 2025-04-19 06:12:32+00:00
created_at: 2025-07-16 04:25:34
body:
  ### CHANGES

  - Introduce Cerebras AI plugin import in plugin registry.
  - Register Cerebras client in the NewPluginRegistry function.

  ## What this Pull Request (PR) does

  This PR adds support for Cerebras AI to the Fabric CLI, enabling users to access models hosted on the Cerebras platform.

  ## Related issues

  N/A - Rework of https://github.com/danielmiessler/fabric/pull/1424

  ## Screenshots

  N/A

  ### Files Changed

  - **core/plugin_registry.go**: Updated to include the Cerebras plugin in the list of AI plugins and instantiate its client in the plugin registry.
  - **plugins/ai/cerebras/cerebras.go**: A new file was added to define the Cerebras client, leveraging the OpenAI-compatible client structure for seamless integration.
  - **plugins/ai/cerebras/cerebras_test.go**: New file added with unit tests to validate the initialization and configuration of the Cerebras client.

  ### Code Changes
  - In `core/plugin_registry.go`, the Cerebras package is imported, and its client is added to the registry initialization:
    ```go
    +     "github.com/danielmiessler/fabric/plugins/ai/cerebras"
    ...
    +     cerebras.NewClient(),
    ```
  - In `plugins/ai/cerebras/cerebras.go`, a new `Client` struct is defined, embedding the OpenAI client for compatibility:
    ```go
    ret.Client = openai.NewClientCompatible("Cerebras", "https://api.cerebras.ai/v1", nil)
    ```
  - In `plugins/ai/cerebras/cerebras_test.go`, tests are added to ensure the client is initialized correctly and configured with the expected name and base URL.

  ### Reason for Changes
  The addition of the Cerebras AI plugin expands the range of AI service providers supported by the `fabric` project. This change allows users to interact with Cerebras AI models through the same interface used for other AI providers, promoting flexibility and extensibility in the application.

  ### Impact of Changes
  - **Functionality**: Users can now select Cerebras as an AI backend, potentially benefiting from its unique capabilities or pricing models.
  - **Performance**: As the Cerebras client uses the OpenAI-compatible structure, there should be no significant performance overhead compared to other similar plugins.
  - **Compatibility**: This change maintains backward compatibility with existing plugins and does not alter the core functionality of the plugin registry.

  ### Test Plan
  - Unit tests have been added in `cerebras_test.go` to verify that the Cerebras client initializes correctly and is configured with the right name and API base URL.
  - Integration testing should be conducted to ensure the Cerebras client interacts correctly with the API endpoint under real-world conditions, including authentication and request handling.
  - Reviewers are encouraged to test the plugin with a valid Cerebras API key to confirm functionality.

commits:
  [{"SHA":"29ee14182295627f34fc9c40e53458f7e496d196","Message":"feat: add Cerebras AI plugin to plugin registry\n\n### CHANGES\n- Introduce Cerebras AI plugin import in plugin registry.\n- Register Cerebras client in the NewPluginRegistry function.","Author":"Kayvan Sylvan"}]


title: Refactor OpenAI-compatible AI providers and add `--listvendors` flag
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1427
merged_at: 2025-04-21 13:20:33+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - Introduce the `--listvendors` flag to display all AI vendors.
  - Refactor OpenAI-compatible providers into a unified configuration.
  - Remove individual vendor packages for streamlined management.
  - Add sorting for consistent vendor listing output.
  - Update documentation to include the new `--listvendors` option.

  ## What this Pull Request (PR) does

  This PR refactors the way OpenAI-compatible AI providers (like Groq, Mistral, OpenRouter, etc.) are handled within Fabric. It centralizes their configuration and instantiation into a new `openai_compatible` package, removing the need for individual packages for each provider. Additionally, it introduces a new CLI flag, `--listvendors` to display all available AI providers.

  ## 2. Files Changed

  *   **`README.md`**:
      *   Added documentation for the new `--listvendors` flag.
      *   Updated Table of Contents to add link for "Contributors"
  *   **`cli/README.md`**:
      *   Minor formatting adjustments (added blank lines for readability). Markdown linting now passes.
  *   **`cli/cli.go`**:
      *   Added logic to handle the `--listvendors` flag, calling `registry.ListVendors`.
      *   Improved error handling slightly for `processYoutubeVideo`.
  *   **`cli/flags.go`**:
      *   Defined the new `ListVendors` boolean flag.
      *   Removed an unnecessary `return` statement in `AppendMessage`.
  *   **`core/plugin_registry.go`**:
      *   Removed direct imports for individual OpenAI-compatible providers (Cerebras, DeepSeek, GrokAI, Groq, LiteLLM, Mistral, OpenRouter, SiliconCloud).
      *   Added import for the new `openai_compatible` package.
      *   Refactored vendor registration: Now iterates through `openai_compatible.ProviderMap` to dynamically create and add clients for all listed OpenAI-compatible providers.
      *   Added sorting (case-insensitive) for the vendor list before adding them to `VendorsAll` for consistent output.
      *   Added the `ListVendors` function to print the names of all registered vendors.
  *   **`plugins/ai/openai_compatible/providers_config.go`** (New File):
      *   Introduces a centralized configuration (`ProviderConfig`) and client creation mechanism (`NewClient`, `CreateClient`) for OpenAI-compatible providers.
      *   Defines `ProviderMap` containing the name and base URL for previously separate providers (Mistral, LiteLLM, Groq, GrokAI, DeepSeek, Cerebras, OpenRouter, SiliconCloud).
  *   **`plugins/ai/openai_compatible/providers_config_test.go`** (New File):
      *   Adds unit tests for the `CreateClient` function in the new package.
  *   **`plugins/ai/cerebras/`**, **`plugins/ai/deepseek/`**, **`plugins/ai/grokai/`**, **`plugins/ai/groq/`**, **`plugins/ai/litellm/`**, **`plugins/ai/mistral/`**, **`plugins/ai/openrouter/`**, **`plugins/ai/siliconcloud/`**:
      *   Deleted these entire packages as their functionality is now handled by the `openai_compatible` package.

  ## 3. Code Changes

  **Centralized Provider Configuration (`plugins/ai/openai_compatible/providers_config.go`):**

  ```go
  // ProviderConfig defines the configuration for an OpenAI-compatible API provider
  type ProviderConfig struct {
  	Name    string
  	BaseURL string
  }

  // ProviderMap is a map of provider name to ProviderConfig for O(1) lookup
  var ProviderMap = map[string]ProviderConfig{
  	"Mistral": {
  		Name:    "Mistral",
  		BaseURL: "https://api.mistral.ai/v1",
  	},
      // ... other providers
  }

  // NewClient creates a new OpenAI-compatible client for the specified provider
  func NewClient(providerConfig ProviderConfig) *Client {
  	client := &Client{}
  	client.Client = openai.NewClientCompatible(providerConfig.Name, providerConfig.BaseURL, nil)
  	return client
  }

  // CreateClient creates a new client for a provider by name
  func CreateClient(providerName string) (*Client, bool) {
      // ... uses ProviderMap ...
  }
  ```

  **Dynamic Vendor Registration (`core/plugin_registry.go`):**

  ```go
  // ... imports removed ...
  import "github.com/danielmiessler/fabric/plugins/ai/openai_compatible"
  // ...

  func NewPluginRegistry(db *fsdb.Db) (ret *PluginRegistry, err error) {
      // ...
  	vendors := []ai.Vendor{}

  	// Add non-OpenAI compatible clients
  	vendors = append(vendors,
  		openai.NewClient(),
  		ollama.NewClient(),
          // ... other non-compatible clients ...
  		exolab.NewClient(),
  	)

  	// Add all OpenAI-compatible providers
  	for providerName := range openai_compatible.ProviderMap {
  		provider, _ := openai_compatible.GetProviderByName(providerName)
  		vendors = append(vendors, openai_compatible.NewClient(provider))
  	}

  	// Sort vendors by name for consistent ordering (case-insensitive)
  	sort.Slice(vendors, func(i, j int) bool {
  		return strings.ToLower(vendors[i].GetName()) < strings.ToLower(vendors[j].GetName())
  	})

  	// Add all sorted vendors to VendorsAll
  	ret.VendorsAll.AddVendors(vendors...)
      // ...
  }

  // New ListVendors function
  func (o *PluginRegistry) ListVendors(out io.Writer) error {
  	vendors := lo.Map(o.VendorsAll.Vendors, func(vendor ai.Vendor, _ int) string {
  		return vendor.GetName()
  	})
  	fmt.Fprint(out, "Available Vendors:\n\n")
  	for _, vendor := range vendors {
  		fmt.Fprintf(out, "%s\n", vendor)
  	}
  	return nil
  }
  ```

  **CLI Flag Handling (`cli/cli.go`, `cli/flags.go`):**

  ```go
  // cli/flags.go
  type Flags struct {
      // ...
  	ListVendors                     bool              `long:"listvendors" description:"List all vendors"`
  }

  // cli/cli.go
  func Cli(version string) (err error) {
      // ...
  	if currentFlags.ListVendors {
  		err = registry.ListVendors(os.Stdout)
  		return // Exit after listing vendors
  	}
      // ...
  }
  ```

  ## 4. Reason for Changes

  The previous approach of having a separate package for each OpenAI-compatible provider led to significant code duplication (mostly boilerplate client setup inheriting from the base OpenAI client). This refactoring aims to:

  *   **Reduce Code Duplication:** Consolidate the logic for handling OpenAI-compatible APIs into a single package.
  *   **Improve Maintainability:** Make it much simpler to add, remove, or update OpenAI-compatible providers by modifying the central `ProviderMap`.
  *   **Enhance User Experience:** Provide a `--listvendors` flag so users can easily see which AI providers are supported by their Fabric instance.
  *   **Simplify Codebase:** Remove numerous small, repetitive packages.

  ## 5. Impact of Changes

  *   **Internal Structure:** The internal package structure for many AI providers has changed significantly. Code relying on the old paths (e.g., `plugins/ai/groq`) will break.
  *   **Functionality:** Core functionality for interacting with these providers should remain unchanged for end-users specifying models via the `--model` flag (e.g., `--model groq/llama3-70b-8192`).
  *   **Maintainability:** Adding new OpenAI-compatible providers is now significantly easier.
  *   **User Interface:** Introduces the `--listvendors` CLI command.
  *   **Potential Bugs:** Configuration issues (incorrect base URLs in `ProviderMap`) could prevent specific providers from working. The sorting logic relies on vendor names; unusual names could affect sort order but not functionality.

  ## 6. Test Plan

  *   Run existing unit and integration tests (`go test ./...`).  [✅]
  *   Manually test the new `--listvendors` flag:
      *   `fabric --listvendors` [✅]
      *   Verify the output includes providers like OpenAI, Ollama, Anthropic, Gemini, Groq, Mistral, etc., and that the list appears sorted alphabetically (case-insensitive).  [✅]
  *   Manually test interaction with providers that were refactored:
      * `fabric --listmodels` returns the same models as before.  [✅]
      * Asked the refactored AI models for suggestions and code reviews of this PR as it was being completed.  [✅]

  ## 7. Additional Notes

  *   This change removes the individual packages for Cerebras, DeepSeek, GrokAI, Groq, LiteLLM, Mistral, OpenRouter, and SiliconCloud, replacing them with entries in the `openai_compatible.ProviderMap`.
  *   The vendor list displayed by `--listvendors` is now sorted alphabetically for consistency.

  ## Screenshots

  ### Before change:

  ![image](https://github.com/user-attachments/assets/02376022-a55b-4bde-93fe-df286ca1fcbc)

  ### After change:

  ![image](https://github.com/user-attachments/assets/1426d5d6-ce43-46dd-b880-94889d18a8e2)

commits:
  [{"SHA":"ac5eab0563501882bf07981014cc8b3b15e7e901","Message":"feat: add `--listvendors` command to list AI vendors\n\n### CHANGES\n- Introduce `--listvendors` flag to display all AI vendors.\n- Refactor OpenAI-compatible providers into a unified configuration.\n- Remove individual vendor packages for streamlined management.\n- Add sorting for consistent vendor listing output.\n- Update documentation to include new `--listvendors` option.","Author":"Kayvan Sylvan"}]


title: feat: Alphabetical case-insensitive sorting for groups and items
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1428
merged_at: 2025-04-21 07:09:21+00:00
created_at: 2025-07-16 04:25:34
body:
  Enhances the GroupsItemsSelector Print method by adding case-insensitive alphabetical sorting for both groups and items, improving user navigation and experience.

  Changes include:
  - Add case-insensitive alphabetical sorting for groups
  - Add case-insensitive alphabetical sorting for items within each group
  - Preserve original ordering stability using sort.SliceStable
  - Improve code organization with separate sorting steps for groups and items

  ### Summary
  This pull request introduces alphabetical sorting (case-insensitive) for both groups and items within the `GroupsItemsSelector` struct's `Print` method in the `common` package. The changes ensure a more organized and user-friendly output when displaying grouped items.

  ### Files Changed
  - **common/groups_items.go**: Modified to include sorting functionality for groups and items in the `Print` method.

  ### Code Changes
  The significant updates are in the `Print` method of the `GroupsItemsSelector` struct:
  - Added imports for the `sort` and `strings` packages to support sorting and case-insensitive comparison.
  - Implemented sorting for groups:
    ```go
    // Create a copy of groups to sort
    sortedGroupsItems := make([]*GroupItems[I], len(o.GroupsItems))
    copy(sortedGroupsItems, o.GroupsItems)
    
    // Sort groups alphabetically case-insensitive
    sort.SliceStable(sortedGroupsItems, func(i, j int) bool {
        return strings.ToLower(sortedGroupsItems[i].Group) < strings.ToLower(sortedGroupsItems[j].Group)
    })
    ```
  - Implemented sorting for items within each group:
    ```go
    // Create a copy of items to sort
    sortedItems := make([]I, len(groupItems.Items))
    copy(sortedItems, groupItems.Items)
    // Sort items alphabetically case-insensitive
    sort.SliceStable(sortedItems, func(i, j int) bool {
        return strings.ToLower(o.GetItemKey(sortedItems[i])) < strings.ToLower(o.GetItemKey(sortedItems[j]))
    })
    ```

  ### Reason for Changes
  The changes were made to improve the readability and usability of the output generated by the `Print` method. Previously, groups and items were displayed in an arbitrary order, which could be confusing for users. Sorting them alphabetically ensures a consistent and intuitive presentation, making it easier to locate specific groups or items.

  ### Impact of Changes
  - **Usability**: The sorted output will enhance user experience by providing a predictable and organized display of data.
  - **Performance**: There is a minor performance overhead due to the sorting operations. However, since `sort.SliceStable` is used, the impact should be negligible for typical use cases with reasonably sized datasets.
  - **Functionality**: No existing functionality is altered beyond the visual representation of the data in the `Print` method.

  ### Test Plan
  - **Unit Tests**: Existing unit tests for the `GroupsItemsSelector` struct should be run to ensure that the sorting logic does not interfere with the core functionality.
  - **Manual Testing**: Manually invoke the `Print` method with various datasets to visually confirm that groups and items are sorted alphabetically in a case-insensitive manner.

  ### Additional Notes
  - The use of `sort.SliceStable` ensures that the relative order of equal elements is preserved, maintaining stability in the sorting process.

  ## Screenshots

  ### Before change:

  ![image](https://github.com/user-attachments/assets/384b30ac-76bf-46f3-b7d5-cbcd4822270f)

  ### After change:

  ![image](https://github.com/user-attachments/assets/3c2fb9b5-a0dc-48da-879d-fbce74d00557)

commits:
  [{"SHA":"8b2174897a291e185bd85922fa1beadbb765c0b6","Message":"feat: add alphabetical sorting to groups and items in Print method**\n\n### CHANGES\n- Import `sort` and `strings` packages for sorting functionality.\n- Create a copy of groups for stable sorting.\n- Sort groups alphabetically in a case-insensitive manner.\n- Create a copy of items within each group for sorting.\n- Sort items alphabetically in a case-insensitive manner.\n- Iterate over sorted groups and items for display.","Author":"Kayvan Sylvan"}]


title: feat: enhance StrategyMeta with Prompt field and dynamic naming
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1429
merged_at: 2025-04-21 07:07:57+00:00
created_at: 2025-07-16 04:25:34
body:
  ### CHANGES

  - Add `Prompt` field to `StrategyMeta` struct.
  - Include `strings` package for filename processing.
  - Derive strategy name from filename using `strings.TrimSuffix`.
  - Store `Prompt` value from JSON data in `StrategyMeta`

  ## What this Pull Request (PR) does

  This pull request updates the `/strategies` endpoint implementation to include a `prompt` field in the strategy metadata returned by the API. It also derives the `name` of each strategy from the filename rather than relying on a `name` field in the JSON files.

  ## Related issues

  closes #1423 

  ## Files Changed

  ### `restapi/strategies.go`

  - **Added**: Import of the `strings` package.
  - **Changed**: The `StrategyMeta` struct now includes a `Prompt` field.
  - **Changed**: The anonymous struct used for unmarshaling strategy metadata in the file reader loop now includes a `Prompt` field and omits the `Name` field.
  - **Changed**: The `Name` for each strategy is now derived by trimming the `.json` suffix from the filename, rather than using a `name` property from the JSON.
  - **Changed**: The `Prompt` property is now included when constructing `StrategyMeta` for the response.

  ---

  ## Code Changes

  **StrategyMeta struct now includes prompt:**
  ```go
  type StrategyMeta struct {
  	Name        string `json:"name"`
  	Description string `json:"description"`
  	Prompt      string `json:"prompt"`
  }
  ```

  **Anonymous struct for unmarshaling:**
  ```go
  var s struct {
  	Description string `json:"description"`
  	Prompt      string `json:"prompt"`
  }
  ```

  **Strategy name is derived from filename:**
  ```go
  Name: strings.TrimSuffix(file.Name(), ".json"),
  ```

  **Prompt field is added to response:**
  ```go
  Prompt: s.Prompt,
  ```

  ---

  ## Reason for Changes

  - **Inclusion of Prompt:** The changes allow the API to provide the `prompt` for each strategy, which may be required by clients for display or processing.
  - **File-based Naming:** By deriving the strategy name from the filename, this removes the need for a redundant `name` field within each strategy JSON file and eliminates the risk of inconsistency between filename and metadata.

  ---

  ## Impact of Changes

  - **API Contract:** The `/strategies` endpoint now includes a `prompt` field in each strategy object, which may be a breaking or additive change for clients consuming this endpoint.

  ---

  ## Test Plan

  - **Functional Test:** Call the `/strategies` endpoint and verify that each returned object includes the correct `name` (matching the filename), `description`, and `prompt` fields.

  ---

  ## Additional Notes

  - Clients consuming the `/strategies` endpoint should be informed of the new `prompt` field and the change in how the `name` is derived.
  - No changes were made to the structure or location of the strategy JSON files themselves.

  ## Screenshots

  ### Before fix:

  ![image](https://github.com/user-attachments/assets/e05f39d7-23fd-4bd3-ab92-5cf81f99c9c7)

  ### After fix:

  ![image](https://github.com/user-attachments/assets/a461aef2-bfb4-47c5-b8bf-befada20a9ca)

commits:
  [{"SHA":"6ca7142ea4b978c5af033c5d40eef6db252b8c7f","Message":"feat: enhance StrategyMeta with Prompt field and dynamic naming\n\n### CHANGES\n\n- Add `Prompt` field to `StrategyMeta` struct.\n- Include `strings` package for filename processing.\n- Derive strategy name from filename using `strings.TrimSuffix`.\n- Store `Prompt` value from JSON data in `StrategyMeta`","Author":"Kayvan Sylvan"}]


title: Add a completion script for fish
author: KenMacD
author_url: https://github.com/KenMacD
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1431
merged_at: 2025-04-23 20:01:41+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  Add a fish shell complete script. This could be generated at some point in the future, but at least is a start.

  This was mostly generated by AI with manual adjustments to make to the functions so things like the descriptions of strategy work. If descriptions were added to the `--listpattens` then those could be included as well.

  ## Related issues

  #1130 & #659 - at least for `fish`.

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/b498a889-7981-4b35-af5b-f530400c8baa)

  ![image](https://github.com/user-attachments/assets/d5501666-8b6b-4da5-b8e2-89f78c4cb12c)

commits:
  [{"SHA":"486ff42b5982e11f02802e89976c6429cb392508","Message":"Add a completion script for fish","Author":"Kenny MacDermid"}]


title: chore: fix fabric setup mess-up introduced by sorting lists (tools and models)
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1432
merged_at: 2025-04-21 18:07:33+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This pull request introduces two primary changes:
  1. Reorders the plugins listed under the "Tools" group within the plugin registry.
  2. Ensures that AI model names from each vendor are sorted alphabetically (case-insensitive) before being grouped and added to the model list.

  ## Related issues

  Closes #1430 


  ## Files Changed

  ### 1. `core/plugin_registry.go`
  - **Change:** Modified the order in which plugins are added to the "Tools" group.
  - **Before:** 
    ```go
    groupsPlugins.AddGroupItems("Tools", o.Defaults, o.PatternsLoader, o.YouTube, o.Language, o.Jina, o.Strategies)
    ```
  - **After:** 
    ```go
    groupsPlugins.AddGroupItems("Tools", o.Defaults, o.Jina, o.Language, o.PatternsLoader, o.Strategies, o.YouTube)
    ```
  - **Reason:** This matches the list that is printed (whose indexes are then used to access the plugins in `fabric -S` interactions).

  ### 2. `plugins/ai/vendors.go`
  - **Change:** Introduced sorting for model names returned by each AI vendor.
  - **Added:**
    ```go
    sort.Slice(result.models, func(i, j int) bool {
        return strings.ToLower(result.models[i]) < strings.ToLower(result.models[j])
    })
    ```
  - **Location:** Before adding the models to the group via `o.Models.AddGroupItems(result.vendorName, result.models...)`.

  ---

  ## Code Changes

  **Alphabetical Sorting of Models:**
  ```go
  sort.Slice(result.models, func(i, j int) bool {
      return strings.ToLower(result.models[i]) < strings.ToLower(result.models[j])
  })
  ```
  This code ensures that the list of models for each vendor is sorted alphabetically in a case-insensitive manner, which improves readability and consistency in the UI or any outputs.

  **Plugin Group Reordering:**
  ```go
  groupsPlugins.AddGroupItems("Tools", o.Defaults, o.Jina, o.Language, o.PatternsLoader, o.Strategies, o.YouTube)
  ```
  The sequence of plugins in the "Tools" group has been changed, possibly to improve the logical grouping or user experience.

  ---

  ## Reason for Changes

  1. **Model Sorting:**  
     - To provide a consistent and predictable order of AI models, especially beneficial for user interfaces or CLI outputs where users expect alphabetical listings.
     - Reduces confusion and facilitates easier searching or scanning for specific models.
     - The model numbers now match what `fabric -S` expects, so it all works as designed.

  2. **Plugin Order Adjustment:**  
     - To improve the logical or functional grouping of tools, making it more intuitive for end users or developers interacting with the plugin system.

  ---

  ## Impact of Changes

  - **User Experience:**  
    - The sorted list of models will make it easier for users to locate specific models under each vendor, especially as the number of models grows.
    - The new ordering of plugins in the "Tools" group could enhance navigation and usability.

  - **Code Maintainability:**  
    - Sorting logic is straightforward and leverages Go's standard library, adding negligible overhead and improving clarity.

  - **No Breaking Changes:**  
    - These changes are non-breaking and only affect ordering/presentation, not core functionality.

  ---

  ## Test Plan

  - **Manual Verification:**  
    - Run the application and confirm that, for each vendor, the models are displayed in alphabetical order.
    - Check the "Tools" group in the UI or CLI and verify that the plugin numbers launch the expected plugin setup.
    - Verified that changing the default model using the model number now works as expected:

  ![image](https://github.com/user-attachments/assets/fe67d21f-c4c5-46a8-b526-87825b9dd79c)
  ![image](https://github.com/user-attachments/assets/c8bf7979-5fc7-40d1-b1f1-d160b7db5b6a)


  ---

  ## Additional Notes

  - The changes are minor but improve polish and user experience.
  - No additional dependencies were introduced.
  - No configuration or documentation changes are necessary.


  ## Screenshots

  ### Before fix

  Tool numbers do not correspond to the plugin.

  ![image](https://github.com/user-attachments/assets/fbcc4092-c89b-4e4c-88b7-0953f6ed9574)

  ### After fix

  ![image](https://github.com/user-attachments/assets/6e85d85f-4284-4e2a-8ad4-2095eadb5649)

commits:
  [{"SHA":"04c0f6a0a57d18ab2f8b8b369c365182e14aed37","Message":"chore: alphabetize the order of plugin tools","Author":"Kayvan Sylvan"},{"SHA":"6b04e6e674817bca502098d785dd433c8f29457f","Message":"chore: sort AI models alphabetically for consistent listing\n\nCHANGES\n*   Import `sort` and `strings` packages for sorting functionality.\n*   Sort retrieved AI model names alphabetically, ignoring case.\n*   Ensure consistent ordering of AI models in lists.","Author":"Kayvan Sylvan"}]


title: chore: update Anthropic SDK to v0.2.0-beta.3 and migrate to V2 API
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1433
merged_at: 2025-04-22 16:01:53+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - Upgrade Anthropic SDK from alpha.11 to beta.3
  - Update API endpoint from v1 to v2
  - Replace anthropic.F() with direct assignment
  - Replace anthropic.F() with anthropic.Opt() for optional params
  - Simplify event delta handling in streaming
  - Change client type from pointer to value type
  - Update comment with SDK changelog reference

  ## What this Pull Request (PR) does

  This PR updates the Anthropic Go SDK from v0.2.0-alpha.11 to v0.2.0-beta.3 and adapts our code to the breaking changes introduced in the new SDK version. The main changes include switching from v1 to v2 API endpoints and updating the client method signatures to match the new SDK requirements.

  ## Files Changed

  ### go.mod and go.sum
  - Updated the Anthropic SDK dependency from v0.2.0-alpha.11 to v0.2.0-beta.3
  - Added the corresponding checksum entry in go.sum

  ### plugins/ai/anthropic/anthropic.go
  - Changed the client type from pointer to value type (`*anthropic.Client` → `anthropic.Client`)
  - Updated API endpoint handling to use v2 instead of v1
  - Modified parameter passing in API calls to match new SDK requirements:
    - Replaced `anthropic.F()` wrapper with direct value passing or `anthropic.Opt()` for optional parameters
    - Simplified the stream event handling logic to directly access the delta text

  ## Screenshots

  After change, fabric with anthropic models is still working.

  ![image](https://github.com/user-attachments/assets/90207615-bd15-44d5-9b42-bb62b73a4704)

  Verified that streaming chat works as expected.

  ## Code Changes

  The most significant changes are in the API endpoint handling and parameter passing:

  ```go
  // Old API endpoint handling
  if strings.Contains(baseURL, "-") && !strings.HasSuffix(baseURL, "/v1") {
      if strings.HasSuffix(baseURL, "/") {
          baseURL = strings.TrimSuffix(baseURL, "/")
      }
      baseURL = baseURL + "/v1"
  }

  // New API endpoint handling
  // As of 2.0beta1, using v2 API endpoint.
  // https://github.com/anthropics/anthropic-sdk-go/blob/main/CHANGELOG.md#020-beta1-2025-03-25
  if strings.Contains(baseURL, "-") && !strings.HasSuffix(baseURL, "/v2") {
      baseURL = strings.TrimSuffix(baseURL, "/")
      baseURL = baseURL + "/v2"
  }
  ```

  Parameter passing has been simplified:

  ```go
  // Old parameter passing
  Model:       anthropic.F(opts.Model),
  MaxTokens:   anthropic.F(int64(an.maxTokens)),
  TopP:        anthropic.F(opts.TopP),
  Temperature: anthropic.F(opts.Temperature),
  Messages:    anthropic.F(messages),

  // New parameter passing
  Model:       opts.Model,
  MaxTokens:   int64(an.maxTokens),
  TopP:        anthropic.Opt(opts.TopP),
  Temperature: anthropic.Opt(opts.Temperature),
  Messages:    messages,
  ```

  Stream handling has been simplified:

  ```go
  // Old stream handling
  switch delta := event.Delta.(type) {
  case anthropic.ContentBlockDeltaEventDelta:
      if delta.Text != "" {
          channel <- delta.Text
      }
  }

  // New stream handling
  // directly send any non-empty delta text
  if event.Delta.Text != "" {
      channel <- event.Delta.Text
  }
  ```

  ## Reason for Changes

  The Anthropic SDK has undergone significant changes in the beta version, including

  1. Migration from v1 to v2 API endpoints
  2. Simplified parameter passing without requiring the `F()` wrapper function
  3. Streamlined event handling in streaming responses

  These changes required us to update our integration code to maintain compatibility with the latest SDK version.

  ## Impact of Changes

  This update ensures our application remains compatible with the latest Anthropic API. The v2 API is more stable and provides improved performance and reliability. The code is now more concise and easier to maintain with the simplified parameter passing and event handling.

  ## Test Plan

  The changes have been tested with
  - Basic message sending 🆗 
  - Streaming responses 🆗 
  - Various parameter combinations (temperature, top_p) 🆗 

commits:
  [{"SHA":"892439a17731d6a6dde02397afd38a87639f42e6","Message":"chore: update Anthropic SDK to v0.2.0-beta.3 and migrate to V2 API\n\n## CHANGES\n\n- Upgrade Anthropic SDK from alpha.11 to beta.3\n- Update API endpoint from v1 to v2\n- Replace anthropic.F() with direct assignment\n- Replace anthropic.F() with anthropic.Opt() for optional params\n- Simplify event delta handling in streaming\n- Change client type from pointer to value type\n- Update comment with SDK changelog reference","Author":"Kayvan Sylvan"}]


title: chore: Fix user input handling when using raw mode and `--strategy` flag
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1435
merged_at: 2025-04-22 11:39:22+00:00
created_at: 2025-07-16 04:25:34
body:
  ## CHANGES

  - refactor BuildSession raw mode to prepend system to user content
  - ensure raw mode messages always have User role
  - keep existing user message when no `systemMessage` provided
  - append systemMessage separately in non-raw mode sessions
  - Store original `cmd.Env` before context-based exec command creation
  - recreate exec command with context then restore `originalEnv`
  - add comments clarifying raw vs non-raw handling behavior

  This PR introduces two primary changes:

  1. Updates the logic in `core/chatter.go` for handling system and user messages in "raw" mode, ensuring the system message is prepended to the user input and always marked as a user message.
  2. Fixes environment variable propagation in `plugins/template/extension_executor.go` when executing commands with context, ensuring the intended environment is preserved after wrapping the command with a timeout.

  ## Related issues

  closes #1434 

  ---

  ### Files Changed

  #### 1. `core/chatter.go`

  - **What changed:**  
    Modified how system and user messages are combined in raw mode in the `BuildSession` method.
  - **Why:**  
    To ensure that the system message is always included as part of the user's message (not as a separate system message) and that the user's role is properly set, improving raw-mode consistency for downstream consumers.

  #### 2. `plugins/template/extension_executor.go`

  - **What changed:**  
    Adjusted command construction in `executeWithFile` to preserve environment variables when creating a new command with context (to enforce timeouts).
  - **Why:**  
    `exec.CommandContext` can reset the environment; the update explicitly restores the intended environment, preventing loss of configuration or credentials in child processes.

  ---

  ### Code Changes

  #### `core/chatter.go` (Raw Mode Message Handling)

  **Old Logic:**
  ```go
  if raw {
      if request.Message != nil {
          if systemMessage != "" {
              request.Message.Content = systemMessage
              // system contains pattern which contains user input
          }
      } else {
          if systemMessage != "" {
              request.Message = &goopenai.ChatCompletionMessage{Role: goopenai.ChatMessageRoleSystem, Content: systemMessage}
          }
      }
  }
  ```

  **New Logic:**
  ```go
  if raw {
      // In raw mode, combine system message (potentially with strategy) and user message into a single user message
      if systemMessage != "" {
          if request.Message != nil {
              // Prepend system message to user content, ensuring user input is preserved
              request.Message.Content = fmt.Sprintf("%s\n\n%s", systemMessage, request.Message.Content)
              request.Message.Role = goopenai.ChatMessageRoleUser // Ensure role is User in raw mode
          } else {
              // If no user message, create one with the system content, marked as User role
              request.Message = &goopenai.ChatCompletionMessage{Role: goopenai.ChatMessageRoleUser, Content: systemMessage}
          }
      }
      // else: no system message, user message (if any) remains unchanged
  }
  ```

  #### `plugins/template/extension_executor.go` (Environment Variable Fix)

  **Old Logic:**
  ```go
  cmd = exec.CommandContext(ctx, cmd.Path, cmd.Args[1:]...)
  cmd.Env = cmd.Env
  ```

  **New Logic:**
  ```go
  originalEnv := cmd.Env
  cmd = exec.CommandContext(ctx, cmd.Path, cmd.Args[1:]...)
  // Restore the environment variables explicitly
  cmd.Env = originalEnv
  ```

  ---

  ### Reason for Changes

  - **Raw Mode Consistency:**  
    Previously, the system message could overwrite the user's input or be set with the system role, which was inconsistent with expectations for "raw" mode where a single user message is expected. This update makes the system message part of the user's content, preserving both intent and input.

  - **Environment Propagation Fix:**  
    Wrapping a command with a new context can inadvertently reset its environment variables, which can cause subtle bugs if the plugin relies on those variables. The fix ensures all environment settings are retained after the context is applied.

  ---

  ### Impact of Changes

  - **For Users:**  
    - In raw mode, messages sent to the LLM (or other consumers) will now always include both the system and user content as a single user message, preserving user input and prompt structure.
    - Any plugins or extensions using environment variables will now work reliably with execution timeouts.

  - **For Developers:**  
    - The change clarifies and simplifies raw mode logic, making future maintenance easier.
    - The environment handling fix eliminates a class of hard-to-debug issues when integrating with external tools via plugins.

  - **Potential Bugs:**  
    - If downstream consumers assume the system message is always a separate message, this could cause confusion; review all such consumers.
    - Ensure that `cmd.Env` is always set prior to this function or the original environment may be nil.

  ---

  ### Test Plan

  - All tests pass. 🆗 
  - Manual testing of `-r` with `--strategy` flag. 🆗 

  ---

  ### Additional Notes

  - Both changes are bug fixes.
  - No new dependencies or breaking API changes are introduced.

  ## Screenshots

  ### Before fix:

  ![image](https://github.com/user-attachments/assets/0ae355d9-7aa1-4bfb-943b-e7f87612a51f)

  ### After fix:

  ![image](https://github.com/user-attachments/assets/f28c3c1c-6878-4fdd-ad6d-224aa99f9eb8)

commits:
  [{"SHA":"b3b1b5a471e46162227e8c139bc2c5efb9139c15","Message":"chore: unify raw mode message handling and preserve env vars in extension executor\n\n## CHANGES\n\n- refactor BuildSession raw mode to prepend system to user content\n- ensure raw mode messages always have User role\n- keep existing user message when no systemMessage provided\n- append systemMessage separately in non-raw mode sessions\n- store original cmd.Env before context-based exec command creation\n- recreate exec command with context then restore originalEnv\n- add comments clarifying raw vs non-raw handling behavior","Author":"Kayvan Sylvan"}]


title: Update go toolchain and go module packages to latest versions
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1441
merged_at: 2025-04-23 19:59:25+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This pull request updates the project to use Go version 1.24.2, along with corresponding updates for dependencies, Nix configurations, and Docker images. The changes ensure compatibility with the latest Go version and incorporate newer versions of various libraries and tools used in the project.

  ## Related issues

  fixes #1440 

  ### Files Changed
  - **Dockerfile**: Updated the Go version in the Docker image from `golang:1.23.4-alpine` to `golang:1.24.2-alpine`.
  - **flake.lock**: Updated the locked versions of `gomod2nix`, `nixpkgs`, and `treefmt-nix` to newer revisions with updated hashes.
  - **flake.nix**: Added logic to specify Go version 1.24 explicitly for builds and shell environments.
  - **go.mod** and **go.sum**: Updated Go module version to `1.24.0` with `toolchain go1.24.2`, and bumped versions of multiple dependencies.
  - **nix/pkgs/fabric/default.nix**: Added `go` parameter to explicitly pass the Go version for building the application.
  - **nix/pkgs/fabric/gomod2nix.toml**: Updated dependency versions and hashes to align with changes in `go.mod`.
  - **nix/shell.nix**: Modified shell configuration to use the specified `goVersion` instead of the default `pkgs.go`.

  ---
  ### For Future Updates
  For contributors, updating the go toolchain now requires that you change only two files:
  - In `./flake.nix'  verify the value returned from `getGoVersion`
  - In `Dockerfile` we need to make sure the base image is correct (as of this PR it should be `golang:1.24.2-alpine`
  ---

  ### Code Changes
  - In **Dockerfile**, the base image change ensures builds are performed with the updated Go version:
    ```dockerfile
    -FROM golang:1.23.4-alpine AS builder
    +FROM golang:1.24.2-alpine AS builder
    ```
  - In **flake.nix**, introduced a `getGoVersion` function to use `go_1_24` and updated environment and package definitions to use this version:
    ```nix
    +      getGoVersion = system: nixpkgs.legacyPackages.${system}.go_1_24;
    ```
  - In **go.mod**, updated the Go version and numerous dependency versions, for instance:
    ```go
    -go 1.23.4
    +go 1.24.0
    +toolchain go1.24.2
    -	github.com/ollama/ollama v0.5.12
    +	github.com/ollama/ollama v0.6.6
    ```

  ### Reason for Changes
  These changes are made to keep the project up-to-date with the latest Go version (1.24.2) for improved performance, security patches, and new features. Updating dependencies ensures compatibility with the new Go version and incorporates bug fixes and enhancements from the latest library versions. The Nix configuration updates align the build and development environments with these changes for consistency across different setups.

  ### Impact of Changes
  - **Functionality**: No functional changes to the application logic are introduced; this is purely an update for compatibility and maintenance.
  - **Performance**: Potential performance improvements due to optimizations in Go 1.24 and updated dependencies.
  - **Build Environment**: Ensures all developers and CI/CD pipelines use the same Go version and dependency set, reducing environment-related issues.
  - **Potential Risks**: There might be breaking changes in the updated dependencies or Go version that could affect the application. Thorough testing is recommended to catch any unforeseen issues.

  ### Test Plan
  - **Local Testing**: Build and run the application locally using the updated Docker image and Nix shell to ensure compatibility. [**Verified 🆗** ]
  - **Unit Tests**: Execute the full suite of unit tests to verify that no regressions have been introduced with the dependency updates. [**Verified 🆗** ]
  - **CI/CD**: Ensure CI pipelines are updated to use the new Go version and verify builds and tests pass in the automated environment. [**Verified - CI/CI builds and tests use nix, so it auto-updated. 🆗** ]

  ### Additional Notes
  - Developers should update their local Nix configurations if they are using `flake.nix` for development to ensure they are on the correct Go version.
  - Special attention should be paid to the `ollama/ollama` update (from v0.5.12 to v0.6.6) as it might introduce changes in behavior or API usage that could affect the application.
  - If any issues are found with the updated dependencies, we may need to pin specific versions or apply patches as necessary.

  ## Screenshots

  After fix:

  ![image](https://github.com/user-attachments/assets/fefc2824-41ed-422b-b750-cf4046065b44)

  ![image](https://github.com/user-attachments/assets/7ede4b46-fbd7-4080-ac44-4a00e9aa1f3c)

  ### Unified Package Change Log

  For reference, here is the change log with links to the individual package logs

  *   **Toolchain**: `Go` (from version 1.23.4 to version 1.24.2)
      *   **Changes**: Upgraded the Go toolchain used in Dockerfile, go.mod, and Nix environment. Go 1.24 includes features like toolchain management, performance improvements (PGO), updates to loop variable semantics, and standard library enhancements (e.g., `slices.Concat`).
      *   **Reference**: [Go 1.24 Release Notes](https://go.dev/doc/go1.24)

  *   **Package**: `github.com/gabriel-vasile/mimetype` (from version 1.4.8 to version 1.4.9)
      *   **Changes**: This update primarily involves dependency bumps (`golang.org/x/net`, `golang.org/x/text`) and minor internal code improvements.
      *   **Reference**: [Mimetype v1.4.9 Release Notes](https://github.com/gabriel-vasile/mimetype/releases/tag/v1.4.9)

  *   **Package**: `github.com/go-git/go-git/v5` (from version 5.13.2 to version 5.16.0)
      *   **Changes**: Includes several features and fixes across versions v5.14.0, v5.15.0, and v5.16.0. Notable changes include support for multi-pack-index (MPI), persistence of shallow clone depth, fixes for submodule updates, SSH handling improvements, memory leak fixes, and dependency updates.
      *   **Reference**: [go-git Releases](https://github.com/go-git/go-git/releases)

  *   **Package**: `github.com/ollama/ollama` (from version 0.5.12 to version 0.6.6)
      *   **Changes**: Significant updates across multiple releases. Key changes include support for newer models (like Llama 3.1), new API endpoints (e.g., `/api/ps`, vision embedding), performance enhancements, various bug fixes related to CUDA, ROCm, macOS support, and dependency updates.
      *   **Reference**: [Ollama Releases](https://github.com/ollama/ollama/releases)

  *   **Package**: `github.com/sashabaranov/go-openai` (from version 1.38.0 to version 1.38.2)
      *   **Changes**: Added support for new API parameters (e.g., `response_format` in fine-tuning), updated model lists, and included minor bug fixes and documentation improvements.
      *   **Reference**: [go-openai v1.38.2 Release Notes](https://github.com/sashabaranov/go-openai/releases/tag/v1.38.2)

  *   **Package**: `golang.org/x/text` (from version 0.23.0 to version 0.24.0)
      *   **Changes**: Updated Unicode tables to version 15.1.0, along with related text processing fixes and improvements. This version aligns with the Go 1.24 release cycle.
      *   **Reference**: [golang.org/x/text v0.24.0 Release Notes](https://github.com/golang/text/releases/tag/v0.24.0)

  *   **Package**: `google.golang.org/api` (from version 0.223.0 to version 0.230.0)
      *   **Changes**: Includes updates to generated client libraries for various Google Cloud APIs, dependency updates (e.g., `golang.org/x/oauth2`, `google.golang.org/grpc`), and potential minor fixes in the core API client library.
      *   **Reference**: [google-api-go-client Releases](https://github.com/googleapis/google-api-go-client/releases)

commits:
  [{"SHA":"9837bd6664185b564f2663d6842bf0f917820735","Message":"chore: update Go to 1.24.2 and refresh dependencies\n\nUpdate Go version across Dockerfile, Nix configurations, and Go modules.\nRefresh dependencies and Nix flake inputs.\n\nCHANGES:\n*   Update Go version to 1.24.2 in Dockerfile.\n*   Set Go version to 1.24.0 and toolchain to 1.24.2.\n*   Refresh Go module dependencies and sums (go.mod, go.sum).\n*   Update Nix flake lock file inputs.\n*   Configure Nix environment and packages for Go 1.24.\n*   Update gomod2nix lock file with dependency hashes.\n*   Use Go 1.24 in Nix development shell environment.","Author":"Kayvan Sylvan"},{"SHA":"894b4967dd183391cf9760424bcafcd4c57041b6","Message":"refactor: centralize Go version definition in flake.nix\n\nCHANGES\n*   Define `getGoVersion` function in `flake.nix`.\n*   Use `getGoVersion` to set Go version consistently.\n*   Pass `goVersion` explicitly into `nix/shell.nix`.\n*   Remove redundant Go version definition from `shell.nix`.","Author":"Kayvan Sylvan"},{"SHA":"50a4f8b49113f3bc0f95aa9abe22cebe8ccc6fe2","Message":"chore: fix \"nix flake check\" errors","Author":"Kayvan Sylvan"}]


title: More shell completion scripts: Zsh, Bash, and Fish
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1447
merged_at: 2025-04-25 08:26:20+00:00
created_at: 2025-07-16 04:25:34
body:
  # Add Shell Completion Support for Zsh, Bash, and Fish

  ## CHANGES

  - Add shell completion support for three major shells
  - Create standardized completion scripts in completions/ directory
  - Add --shell-complete-list flag for machine-readable output
  - Update Print() methods to support plain output format
  - Document installation steps for each shell in README
  - Replace old fish completion script with improved version

  ## What this Pull Request (PR) does

  This pull request introduces shell completion scripts for Zsh, Bash, and Fish to improve the usability of the `fabric` CLI. It also adds a new flag (`--shell-complete-list`) to modify the output format of list commands (e.g., `--listmodels`, `--listpatterns`) specifically for consumption by these completion scripts. Documentation for setting up completions has been added to the README.

  Extends the work done by @KenMacD on PR #1431 

  ## Related issues

  closes #1130 #909 #659 

  ## Screenshots

  ### Fish

  ![image](https://github.com/user-attachments/assets/3f842fbd-50d0-47aa-a1a7-22e907758c24)

  ![image](https://github.com/user-attachments/assets/2e9a4dea-d34c-4b6d-959f-06268cc89c06)

  ![image](https://github.com/user-attachments/assets/ca1145aa-8f08-4c34-aa20-cb5305b18bf3)

  ![image](https://github.com/user-attachments/assets/3bfde5f5-4f4a-4915-8cc1-6216bde09883)


  ### Zsh

  ![image](https://github.com/user-attachments/assets/2ba3d7e3-df1e-4109-9ca6-5e93ea9023e1)

  ![image](https://github.com/user-attachments/assets/a041c803-95a2-4bb0-b1fd-e1e7f8eb310a)

  ![image](https://github.com/user-attachments/assets/c40c40fe-205d-4fc6-931f-b6c8910abb4b)

  ![image](https://github.com/user-attachments/assets/5654c5f4-18c6-459d-b7a9-70fb69b95001)

  ![image](https://github.com/user-attachments/assets/78dabd71-b496-4c43-b47b-9372f3626451)

  ### Bash

  ![image](https://github.com/user-attachments/assets/3a9fd09b-471f-41b5-8d02-421fdd62ac9f)

  ![image](https://github.com/user-attachments/assets/02136bf9-c588-4453-8860-8a2e3a82742a)

  ![image](https://github.com/user-attachments/assets/ef927204-0998-416b-b45e-885926592223)

  ![image](https://github.com/user-attachments/assets/3a27618b-dcc8-4856-8006-eee02ca50491)

  ![image](https://github.com/user-attachments/assets/6f440187-59be-494c-85fd-48b5d0e22543)


  ## Files Changed

  *   **`README.md`**: Added a new "Shell Completions" section with instructions for Zsh, Bash, and Fish. Updated the help output example to include the new `--shell-complete-list` flag.
  *   **`cli/cli.go`**: Modified calls to list functions (`ListNames`, `GetModels().Print`, `ListStrategies`) to pass the new `ShellCompleteOutput` flag.
  *   **`cli/flags.go`**: Added the `ShellCompleteOutput` boolean flag (`--shell-complete-list`).
  *   **`common/groups_items.go`**: Modified the `Print` method to accept a `shellCompleteList` boolean. When true, it outputs only the item keys, one per line, without group headers or index numbers, suitable for completion scripts. Existing sorting logic remains.
  *   **`completion/fabric.fish`**: Deleted the old Fish completion script.
  *   **`completions/_fabric`**: Added a new Zsh completion script.
  *   **`completions/fabric.bash`**: Added a new Bash completion script.
  *   **`completions/fabric.fish`**: Added a new, updated Fish completion script.
  *   **`core/plugin_registry.go`**: Updated call to `groupsPlugins.Print` to explicitly pass `false` to maintain standard output formatting during setup.
  *   **`plugins/db/api.go`**: Updated the `Storage` interface's `ListNames` method signature to accept the `shellCompleteList` boolean.
  *   **`plugins/db/fsdb/storage.go`**: Implemented the updated `ListNames` method. It now conditionally skips printing the "No X" message if `shellCompleteList` is true.
  *   **`plugins/strategy/strategy.go`**: Updated the `ListStrategies` method to accept the `shellCompleteList` boolean. When true, it outputs only strategy names, one per line. Otherwise, it retains the formatted table output.
  *   **`plugins/tools/defaults.go`**: Updated call to `vendorsModels.Print` to explicitly pass `false` to maintain standard output formatting during setup.

  ## Code Changes

  **1. Added `--shell-complete-list` Flag:**

  ```go
  // cli/flags.go
  type Flags struct {
      // ... other flags
      ShellCompleteOutput             bool              `long:"shell-complete-list" description:"Output raw list without headers/formatting (for shell completion)"`
  }
  ```

  **2. Modified List Output Formatting:**

  The `Print` method in `common/groups_items.go` and `ListStrategies` in `plugins/strategy/strategy.go` now conditionally format their output based on the `shellCompleteList` flag.

  ```go
  // common/groups_items.go
  func (o *GroupsItemsSelector[I]) Print(shellCompleteList bool) {
      if !shellCompleteList {
          // Print headers and formatted output
          fmt.Printf("\n%v:\n", o.SelectionLabel)
          // ...
      }
      // ... sort logic ...
      for _, groupItems := range sortedGroupsItems {
          if !shellCompleteList {
              // Print group header
              fmt.Println()
              fmt.Printf("%s\n\n", groupItems.Group)
          }
          // ... sort items ...
          for _, item := range sortedItems {
              currentItemIndex++
              if shellCompleteList {
                  // plain mode: just the key
                  fmt.Printf("%s\n", o.GetItemKey(item))
              } else {
                  // formatted mode: "[index]    key"
                  fmt.Printf("\t[%d]\t%s\n", currentItemIndex, o.GetItemKey(item))
              }
          }
      }
  }

  // plugins/strategy/strategy.go
  func (sm *StrategiesManager) ListStrategies(shellCompleteList bool) error {
      // ... check if strategies exist ...
  	if !shellCompleteList {
  		fmt.Print("Available Strategies:\n\n")
  	}
      // ... sort logic ...
  	for _, name := range names {
  		strategy := sm.Strategies[name]
  		if shellCompleteList {
  			fmt.Printf("%s\n", strategy.Name) // Raw output
  		} else {
  			fmt.Printf(formatString, strategy.Name, strategy.Description) // Formatted output
  		}
  	}
  	return nil
  }
  ```

  **3. Added Completion Scripts:**

  New files `completions/_fabric`, `completions/fabric.bash`, and `completions/fabric.fish` were added. These scripts call `fabric --list<items> --shell-complete-list` to fetch completion suggestions.

  Example (from `completions/_fabric` for Zsh):

  ```zsh
  _fabric_patterns() {
    local -a patterns
    patterns=(${(f)"$(fabric --listpatterns --shell-complete-list 2>/dev/null)"})
    compadd -X "Patterns:" ${patterns}
  }
  ```

  ## Reason for Changes

  To significantly improve the command-line user experience by providing tab completion for commands, flags, and dynamic values like patterns, models, contexts, sessions, and strategies. This makes the CLI faster and easier to use, reducing the need to constantly refer to help or list commands. The `--shell-complete-list` flag was necessary to provide a machine-readable output format for the completion scripts without breaking the human-readable format of the existing list commands.

  ## Impact of Changes

  *   **Enhanced Usability**: Users of Zsh, Bash, and Fish shells will benefit from command-line completion.
  *   **New CLI Flag**: Introduces the `--shell-complete-list` flag, intended primarily for internal use by the completion scripts.
  *   **Modified List Output**: The output format of list commands (`--listpatterns`, `--listmodels`, etc.) changes *only* when the `--shell-complete-list` flag is used. Default behavior remains unchanged.
  *   **New Files**: Adds three new completion script files to the repository under the `completions/` directory.

  ## Test Plan

  1.  **Install Completions**: Follow the instructions in the updated `README.md` to install completions for Zsh, Bash, and Fish.
  2.  **Verify Completions**:
      *   In each supported shell, type `fabric ` and press `Tab`. Verify that command flags are suggested.
      *   Type `fabric -p ` and press `Tab`. Verify that available patterns are suggested.
      *   Type `fabric -m ` and press `Tab`. Verify that available models are suggested.
      *   Type `fabric -C ` and press `Tab`. Verify that available contexts are suggested.
      *   Type `fabric --session ` and press `Tab`. Verify that available sessions are suggested.
      *   Type `fabric --strategy ` and press `Tab`. Verify that available strategies are suggested.
      *   Test other relevant flags that use dynamic completion (e.g., `--wipecontext`, `--rmextension`).
  3.  **Verify Standard List Output**:
      *   Run `fabric --listpatterns`. Verify the output is formatted correctly with headers and indices.
      *   Run `fabric --listmodels`. Verify the output is formatted correctly with vendor groups, headers, and indices.
      *   Run `fabric --liststrategies`. Verify the output is formatted correctly with descriptions.
      *   Run `fabric --listcontexts`, `fabric --listsessions`. Verify correct formatting.
  4.  **Verify Raw List Output**:
      *   Run `fabric --listpatterns --shell-complete-list`. Verify the output is a raw list of pattern names, one per line.
      *   Run `fabric --listmodels --shell-complete-list`. Verify the output is a raw list of model names, one per line.
      *   Run `fabric --liststrategies --shell-complete-list`. Verify the output is a raw list of strategy names, one per line.
      *   Test other list commands with the flag.

  ## Additional Notes

  *   The old `completion/fabric.fish` script was removed in favor of the new `completions/fabric.fish` which utilizes the `--shell-complete-list` flag for better consistency and maintainability.
  *   Users will need to manually install the completion scripts as described in the README.

commits:
  [{"SHA":"bf3af8e98e4293f35bfd17c522853916e8c147b2","Message":"feat: add shell completion scripts for Zsh, Bash, and Fish\n\nCHANGES:\n- Add shell completion support for three major shells\n- Create standardized completion scripts in completions/ directory\n- Add --shell-complete-list flag for machine-readable output\n- Update Print() methods to support plain output format\n- Document installation steps for each shell in README\n- Replace old fish completion script with improved version","Author":"Kayvan Sylvan"}]


title: Fix for default model setting
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1453
merged_at: 2025-04-28 19:25:35+00:00
created_at: 2025-07-16 04:25:34
body:
  ### CHANGES

  - Add `getSortedGroupsItems` to centralize sorting logic.
  - Sort groups and items alphabetically, case-insensitive.
  - Replace inline sorting in `Print` with new method.
  - Update `GetGroupAndItemByItemNumber` to use sorted data.
  - Ensure original `GroupsItems` remains unmodified.

  ## What this Pull Request (PR) does

  This PR introduces a new method `getSortedGroupsItems` to the `GroupsItemsSelector` struct, which centralizes the logic for sorting groups and their items alphabetically in a case-insensitive manner. The new method is utilized in both `GetGroupAndItemByItemNumber` and `Print` functions to ensure consistent sorting behavior across the codebase.

  ## Related issues

  Closes #1451 

  ### Files Changed

  - **common/groups_items.go**: Added a new method for sorting groups and items, and refactored existing functions to use this method instead of duplicating sorting logic.

  ### Code Changes

  1. **Addition of `getSortedGroupsItems` Method**:

     ```go
     func (o *GroupsItemsSelector[I]) getSortedGroupsItems() []*GroupItems[I] {
         // Copy and sort groups (case-insensitive)
         sortedGroupsItems := make([]*GroupItems[I], len(o.GroupsItems))
         copy(sortedGroupsItems, o.GroupsItems)
         sort.SliceStable(sortedGroupsItems, func(i, j int) bool {
             return strings.ToLower(sortedGroupsItems[i].Group) < strings.ToLower(sortedGroupsItems[j].Group)
         })
         // ... additional logic for sorting items within groups ...
     }
     ```
     This method creates a sorted copy of the `GroupsItems` slice, ensuring that the original data remains unchanged while providing a consistently sorted view for other operations.

  2. **Refactoring `GetGroupAndItemByItemNumber`**:

     - Replaced direct iteration over `o.GroupsItems` with a call to `getSortedGroupsItems()` to ensure items are accessed in a sorted order.
     - Updated item counting logic to use `len(groupItems.Items)` instead of a `Count()` method for clarity and consistency.
     - Added an explicit `break` after finding the target item to avoid unnecessary iterations.

  3. **Refactoring `Print` Method**:

     - Removed redundant sorting logic and replaced it with a call to `getSortedGroupsItems()`.
     - Directly iterated over sorted items from `groupItems.Items` instead of creating and sorting a separate slice.

  ### Reason for Changes

  The primary reason for these changes is to eliminate code duplication by centralizing the sorting logic into a reusable method. This also ensures that a model chosen by model number is indeed the correct number!

  ### Impact of Changes

  - **Consistency**: Ensures that groups and items are always presented in a predictable, alphabetically sorted order across different functionalities.
  - **Maintainability**: Reduces the risk of bugs caused by inconsistent sorting implementations and simplifies future updates to sorting logic.
  - **Performance**: There might be a minor performance overhead due to creating copies of slices for sorting. However, this is a trade-off for immutability and clarity, and the impact should be negligible for typical use cases.

  ### Test Plan

  - **Unit Tests**: Existing unit tests all pass. ✅
  - **Manual Testing**: Verify that the output of the `Print` method and item selection in `GetGroupAndItemByItemNumber` are sorted alphabetically (case-insensitive) as expected. ✅

  ### Additional Notes
  - The original `GroupsItems` data structure is preserved (not modified) by creating copies for sorting, which is intentional to avoid side effects.
  - If performance becomes a concern with very large datasets, we might consider caching the sorted results or optimizing the sorting approach in a future iteration.

  ## Screenshots

  ### Before fix:

  ![image](https://github.com/user-attachments/assets/46a2181e-0cca-4cd1-bd39-e626d27f93ee)

  ![image](https://github.com/user-attachments/assets/6c62632a-0db0-4b41-a858-0c492a93bbfd)

  ### After fix:

  ![image](https://github.com/user-attachments/assets/45be2c8f-5ce2-4c8e-bb8a-6c15136ac53e)

  ![image](https://github.com/user-attachments/assets/b1403be0-6012-49de-b042-c41ae3a4a0cb)

commits:
  [{"SHA":"a6d14d86b8c0fd248a1ef715e4a46c623606ca63","Message":"refactor: introduce `getSortedGroupsItems` for consistent sorting logic\n\n### CHANGES\n- Add `getSortedGroupsItems` to centralize sorting logic.\n- Sort groups and items alphabetically, case-insensitive.\n- Replace inline sorting in `Print` with new method.\n- Update `GetGroupAndItemByItemNumber` to use sorted data.\n- Ensure original `GroupsItems` remains unmodified.","Author":"Kayvan Sylvan"}]


title: chore: Repository cleanup and .gitignore Update
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1459
merged_at: 2025-05-06 22:05:19+00:00
created_at: 2025-07-16 04:25:34
body:
  - Add `coverage.out` to `.gitignore` for ignoring coverage output.
  - Remove `Alma.md` documentation file from the repository.
  - Delete `rate_ai_result.txt` stitch script from `stitches` folder.
  - Remove `readme.md` for `rate_ai_result` stitch documentation.

  ## What this Pull Request (PR) does
  This pull request performs repository cleanup by removing example data and a specific Fabric "stitch" (`rate_ai_result`).

  The word "stitch" is an old term from the beginning of the project, and the [`rate_ai_results` is duplicated](https://github.com/danielmiessler/fabric/blob/main/patterns/rate_ai_result/system.md) in its enhanced form in the `patterns/` directory.

  It also updates the `.gitignore` file to include a common code coverage output file.

  ## Related issues
  None.

  ## Screenshots
  N/A

  ## Files Changed

  *   **Modified:**
      *   `.gitignore`: Added `coverage.out` to the list of ignored files.
  *   **Deleted:**
      *   `Alma.md`: Removed a detailed example markdown file containing context about Alma Security.
      *   `stitches/rate_ai_result/rate_ai_result.txt`: Removed the example script file for the `rate_ai_result` stitch.
      *   `stitches/rate_ai_result/readme.md`: Removed the documentation explaining the `rate_ai_result` stitch.

  ## Detailed Changes

  *   **`.gitignore`**:
      ```diff
      --- a/.gitignore
      +++ b/.gitignore
      @@ -58,6 +58,7 @@ coverage.xml
       .hypothesis/
       .pytest_cache/
       cover/
      +coverage.out

       # Translations
       *.mo
      ```
      *   Added `coverage.out` to prevent accidental commits of code coverage reports generated by testing tools.

  *   **`Alma.md`**:
      *   This file, containing extensive example context data (company details, goals, KPIs, security posture, etc. for "Alma Security"), has been completely removed.

  *   **`stitches/rate_ai_result/` directory**:
      *   The `rate_ai_result.txt` script file, which demonstrated a Fabric stitch for evaluating AI model output, has been removed.
      *   The corresponding `readme.md` file, explaining the purpose and usage of the stitch, has also been removed.

  ## Reason for Changes

  The primary goal of this PR is repository hygiene:

  *   **`.gitignore` Update**: To prevent common test coverage output files (`coverage.out`) from being tracked by Git, keeping the repository history clean.
  *   **File Deletion**: To remove example data (`Alma.md`) and a specific example Fabric "stitch" (`rate_ai_result`) that are no longer considered necessary or relevant within the main repository codebase. This simplifies the repository structure and removes potentially outdated examples.

  ## Impact of Changes

  *   **Functionality**: No direct impact on the core functionality of the Fabric tool itself.
  *   **Developers**: Improves the developer experience by preventing accidental commits of `coverage.out` files.
  *   **Users/Examples**: Users who might have been referencing the `Alma.md` file or the `rate_ai_result` stitch as examples will no longer find them in the repository. They may need to refer to other examples or documentation if available.

  ## Test Plan

  * None necessary. No functional changes. The deleted files are not referenced in the codebase.

  ## 7. Additional Notes

  The removed `Alma.md` file and the `rate_ai_result` stitch served as examples. Their removal cleans up the repository; updated examples (including the `rate_ai_result` pattern) are already readily available in the source code.

commits:
  [{"SHA":"fde2efd4ce560bcea93f781cedfe69b5e1bc94fd","Message":"chore: update .gitignore and remove obsolete files\n\n- Add `coverage.out` to `.gitignore` for ignoring coverage output.\n- Remove `Alma.md` documentation file from the repository.\n- Delete `rate_ai_result.txt` stitch script from `stitches` folder.\n- Remove `readme.md` for `rate_ai_result` stitch documentation.","Author":"Kayvan Sylvan"}]


title: Add completion to the build output for Nix
author: CodeCorrupt
author_url: https://github.com/CodeCorrupt
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1463
merged_at: 2025-05-10 07:40:45+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Add the completion scripts to the nix package build output so that completion works on supported shells.

  ## Related issues
  None

  ## Screenshots
  Build output puts the completion files in the output where nix expects them.
  ```
  $ tree result/
  result/
  ├── bin
  │   ├── code_helper
  │   ├── fabric
  │   └── to_pdf
  └── share
      ├── bash-completion
      │   └── completions
      │       └── fabric.bash
      ├── fish
      │   └── vendor_completions.d
      │       └── fabric.fish
      └── zsh
          └── site-functions
              └── _fabric
  ```
  Screenshot shows tab completion working with Zsh after installing the package from my fork.
  ![Screenshot 2025-05-07 at 5 22 50 PM](https://github.com/user-attachments/assets/7bc8cea8-776c-4348-ada9-2af22d136690)

commits:
  [{"SHA":"c59c7553b3e70689d48967324d7190e149a62618","Message":"Add completion files to the build output for Nix","Author":"CodeCorrupt"}]


title: Typos, spelling, grammar and other minor updates
author: joshuafuller
author_url: https://github.com/joshuafuller
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1467
merged_at: 2025-05-19 05:52:13+00:00
created_at: 2025-07-16 04:25:34
body:
  This pull request primarily addresses minor spelling and grammar corrections across multiple documentation files to improve clarity and professionalism. Below is a summary of the most important changes, grouped by theme.

  ### Spelling Corrections:
  * Corrected "Anthropric" to "Anthropic" in `NOTES.md` to fix a vendor name typo.
  * Fixed "prefered" to "preferred" in `Pattern_Descriptions/README_Pattern_Descriptions_and_Tags_MGT.md` to ensure proper spelling.
  * Corrected "Cummulative" to "Cumulative" and "functionnalities" to "functionalities" in `Web Interface MOD Readme Files/pr-1284-update.md` and `web/Web Interface Update README Files/pr-1284-update.md`. [[1]](diffhunk://#diff-7e3e4ed53eca1945bf427479a8fa23c9ee53824d7b20845d910c656ff340fb7aL1-R1) [[2]](diffhunk://#diff-d3811c7360c4cd7a554a22f8283b3397111b43aac9a0b06a664cef09a363dab0L1-R1)

  ### Grammar Improvements:
  * Improved phrasing by adding "an" in "an out-of-the-box website" in `web/README.md`.
  * Fixed "dont" to "don’t" and added a comma in "E.g., to extract" for better readability in `patterns/write_nuclei_template_rule/system.md`.

  ### Consistency Enhancements:
  * Updated "ths" to "this" in a section heading in `web/README.md` for consistency and correctness.## What this Pull Request (PR) does
  Please briefly describe what this PR does.

  #
  This pull request includes a series of minor corrections to spelling, grammar, and phrasing across multiple documentation files to improve clarity and professionalism. Below is a summary of the most important changes, grouped by theme:

  ### Spelling and Grammar Fixes:
  * Corrected "Anthropric" to "Anthropic" in `NOTES.md` to fix a misspelling of a vendor name.
  * Fixed "prefered" to "preferred" in `Pattern_Descriptions/README_Pattern_Descriptions_and_Tags_MGT.md` to address a typo.
  * Updated "Cummulative" to "Cumulative" and "functionnalities" to "functionalities" in `Web Interface MOD Readme Files/pr-1284-update.md` and `web/Web Interface Update README Files/pr-1284-update.md`. [[1]](diffhunk://#diff-7e3e4ed53eca1945bf427479a8fa23c9ee53824d7b20845d910c656ff340fb7aL1-R1) [[2]](diffhunk://#diff-d3811c7360c4cd7a554a22f8283b3397111b43aac9a0b06a664cef09a363dab0L1-R1)
  * Replaced "dont" with "don’t" and clarified phrasing around DSL usage in `patterns/write_nuclei_template_rule/system.md`.

  ### Improved Phrasing:
  * Changed "a out-of-the-box website" to "an out-of-the-box website" in `web/README.md` for grammatical correctness.
  * Refined the phrasing of a subsection title from "along side ths app" to "alongside this app" in `web/README.md`.# Related issues

commits:
  [{"SHA":"430a272e1dad5eb9abec2f932388978a4022273a","Message":"docs: fix spelling in pattern management guide","Author":"Joshua Fuller"},{"SHA":"43a1e66cc8ee3396e4bf7b3dbf432cfe4181e005","Message":"docs: fix spelling in PR 1284 update notes","Author":"Joshua Fuller"},{"SHA":"dd0be51726ff12a9b060f93edd4eb4c797ccc022","Message":"docs: fix typos in web README","Author":"Joshua Fuller"},{"SHA":"068f11198606bc6dc24da3e5b45f2415081c8264","Message":"docs: correct Anthropic spelling in notes","Author":"Joshua Fuller"},{"SHA":"da1a9dab568e3ab111fec1f7405c1c4ca5504aaf","Message":"docs: fix grammar in nuclei template instructions","Author":"Joshua Fuller"},{"SHA":"ea57a64afa961298eea2025fafac1ad12aa326b4","Message":"Merge pull request #5 from joshuafuller/branch/fix-grammar-in-nuclei-template-instructions","Author":"Joshua Fuller"},{"SHA":"8e7e4aa169d46098dd8927cf89582b568cc8dc95","Message":"Merge pull request #4 from joshuafuller/branch/fix-spelling-of-anthropic-in-notes-md","Author":"Joshua Fuller"},{"SHA":"a31b2d5e416c9f61c4c5abe39ae94be15fd392ab","Message":"Merge pull request #3 from joshuafuller/branch/fix-typos-in-web-readme","Author":"Joshua Fuller"},{"SHA":"d734e25e0d9f29f02e86f98400be5da3653b1f3e","Message":"Merge pull request #2 from joshuafuller/branch/fix-spelling-in-pr-1284-update-notes","Author":"Joshua Fuller"},{"SHA":"920620d77157e4d58b586e621ec19403b3429178","Message":"Merge pull request #1 from joshuafuller/branch/fix-spelling-in-pattern-management-guide","Author":"Joshua Fuller"}]


title: Refactor content structure in create_hormozi_offer system.md for clarity and readability
author: NavNab
author_url: https://github.com/NavNab
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1468
merged_at: 2025-05-18 18:26:28+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  - Improved formatting of the introduction and content summary sections for better flow.
  - Consolidated repetitive sentences and enhanced the overall coherence of the text.
  - Adjusted bullet points and numbering for consistency and easier comprehension.
  - Ensured that key concepts are clearly articulated and visually distinct to aid understanding.

  ## Related issues
  N/A

  ## Screenshots
  N/A

commits:
  [{"SHA":"9c4445d7bd843f033672ce89d4c44c8619e2b61d","Message":"Refactor content structure in system.md for clarity and readability\n\n- Improved formatting of the introduction and content summary sections for better flow.\n- Consolidated repetitive sentences and enhanced the overall coherence of the text.\n- Adjusted bullet points and numbering for consistency and easier comprehension.\n- Ensured that key concepts are clearly articulated and visually distinct to aid understanding.","Author":"NavNab"}]


title: add authentification for ollama instance
author: roumy
author_url: https://github.com/roumy
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1473
merged_at: 2025-05-19 21:37:45+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This PR allows to add a Authentication Bearer to ollama server.
  It could be usefull for third party integration client that provide a remote and authentifcated ollama api access like OpenwebUi
  https://docs.openwebui.com/getting-started/api-endpoints/#-ollama-api-proxy-support

  ## Related issues
  https://github.com/danielmiessler/fabric/issues/1472

commits:
  [{"SHA":"1291b35b63f1029f6ffa5335e4c68464804a2428","Message":"add authentification for ollama instance","Author":"pr"}]


title: feat: update `BuildSession` to handle message appending logic
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1474
merged_at: 2025-05-19 21:35:04+00:00
created_at: 2025-07-16 04:25:34
body:
  # Improved Message Handling for Multiple AI Providers

  ## What this Pull Request (PR) does

  This PR does a couple of things:

  1. Eliminates the doubled user messages that were being sent (effetcively cutting our token use now by 50%!)

  2. Enhances message handling across different AI providers, focusing on proper message formatting for Anthropic's Claude models and improving the handling of system messages in raw mode. The changes ensure more consistent behavior across providers and fix potential issues with empty messages and message role sequencing.

  ## Related issues
  closes #1245 and #1203 

  ## Files Changed

  ### 1. `core/chatter.go`
  Refactored the message handling logic to properly handle system messages and patterns:

  - Fixed how system messages are combined with user messages in raw mode
  - Improved handling of patterns by not appending user messages when a pattern is used
  - Added proper escaping of newlines in formatted messages
  - Added more detailed comments explaining the logic

  ### 2. `plugins/ai/anthropic/anthropic.go`
  Completely rewrote the message normalization for Anthropic's Claude models:

  - Implemented proper handling of system messages by prepending them to the first user message
  - Added enforcement of user/assistant message alternation as required by Anthropic's API
  - Added handling for empty messages and edge cases
  - Added checks to prevent errors when no messages are available to send

  ### 3. `plugins/ai/openai/openai.go`
  Enhanced OpenAI client with provider-specific handling:

  - Added special handling for DeepSeek models which require the last message to be a user message
  - Improved message copying to avoid modifying the original messages
  - Cleaned up imports and simplified the code structure
  - Fixed potential issues with empty responses

  ## Reason for Changes
  These changes address several issues with message handling across different AI providers:

  1. **Anthropic Claude Support**: The previous implementation didn't properly handle Anthropic's message format requirements, which differ significantly from OpenAI's format. Claude requires messages to alternate between user and assistant, and system messages must be prepended to user messages.

  2. **Pattern Handling**: When using patterns, the system message already incorporates user input, but the previous implementation would still append the user message, potentially causing redundant information.

  3. **DeepSeek Model Support**: DeepSeek models require the last message to be a user message, which wasn't properly handled before.

  4. **Empty Message Handling**: The previous implementation didn't properly handle empty messages or empty responses from models.

  ## Impact of Changes
  These changes significantly improve the reliability and consistency of interactions with different AI models:

  1. **Better Cross-Provider Compatibility**: The application now correctly formats messages for each provider's specific requirements.

  2. **Reduced Errors**: Proper handling of edge cases like empty messages prevents potential runtime errors.

  3. **Improved Pattern Usage**: Patterns now work more reliably by avoiding duplicate user inputs.

  4. **More Consistent Behavior**: Users should experience more consistent responses across different AI providers.

  ## Test Plan
  The changes have been tested with

  1. Various message sequences with many providers
  2. Empty message scenarios
  3. System message handling in both raw and normal modes
  4. Pattern usage with different providers
  5. Edge cases like consecutive user or assistant messages

  ![image](https://github.com/user-attachments/assets/62e36ce5-2811-4105-a8d5-21234ca5563d)

  ## Screenshots

  Before fix:

  ![image](https://github.com/user-attachments/assets/b4d20278-b08b-47ce-9f6c-85b6896addeb)

  After fix:

  ![image](https://github.com/user-attachments/assets/dd5f4f97-6787-45fa-924d-ca24f3439480)

commits:
  [{"SHA":"bc27f9d685641c3299f1c0c537a74375745d18cf","Message":"refactor: improve message handling for raw mode and Anthropic client\n\n## CHANGES\n\n- Clarify raw mode message handling in BuildSession\n- Fix pattern-based message handling in non-raw mode\n- Refactor Anthropic client message normalization\n- Add proper handling for empty message arrays\n- Implement user/assistant message alternation for Anthropic\n- Preserve system messages in Anthropic conversations\n- Add safeguards for message sequence validation","Author":"Kayvan Sylvan"}]


title: refactor: improve raw mode handling in BuildSession
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1475
merged_at: 2025-05-20 10:10:47+00:00
created_at: 2025-07-16 04:25:34
body:
  # Improved Raw Mode Handling for Chat Sessions with Patterns

  ## CHANGES

  - Fix system message handling with patterns in raw mode
  - Prevent duplicate inputs when using patterns
  - Add conditional logic for pattern vs non-pattern scenarios
  - Simplify message construction with clearer variable names
  - Improve code comments for better readability

  ## What this Pull Request (PR) does

  This PR enhances the `BuildSession` method in the `Chatter` component to properly handle raw mode when patterns are used. The changes fix an issue where system messages were being duplicated when a pattern was specified along with raw mode.

  ## Related issues

  closes #1203 

   ## Files Changed

  - **core/chatter.go**: Updated the logic in the `BuildSession` method to avoid duplicating content when both raw mode and patterns are used.

  ## Code Changes
  The main change is in the raw mode handling section of the `BuildSession` method:

  ```go
  // Before: Simple concatenation that could lead to duplication
  if systemMessage != "" {
      if request.Message != nil {
          request.Message.Content = fmt.Sprintf("%s\\n\\n%s", systemMessage, request.Message.Content)
          request.Message.Role = goopenai.ChatMessageRoleUser
      } else {
          request.Message = &goopenai.ChatCompletionMessage{Role: goopenai.ChatMessageRoleUser, Content: systemMessage}
      }
  }
  ```

  ```go
  // After: Smarter handling that avoids duplication with patterns
  var finalContent string
  if systemMessage != "" {
      // If we have a pattern, it already includes the user input
      if request.PatternName != "" {
          finalContent = systemMessage
      } else {
          // No pattern, combine system message with user input
          finalContent = fmt.Sprintf("%s\n\n%s", systemMessage, request.Message.Content)
      }
      request.Message = &goopenai.ChatCompletionMessage{
          Role:    goopenai.ChatMessageRoleUser,
          Content: finalContent,
      }
  }
  ```

  ## Reason for Changes
  The previous implementation had a logical flaw when handling raw mode with patterns. When a pattern was specified, the user input was already included in the pattern, but the code was still appending the user input to the system message, resulting in duplicated content in the final prompt.

  This change makes the code smarter about how it combines content:
  1. When a pattern is used, it assumes the pattern already includes the user input
  2. When no pattern is used, it combines the system message with user input as before

  ## Impact of Changes
  This change improves the quality of prompts sent to the model when using raw mode with patterns by:
  1. Eliminating duplicate content in the prompts
  2. Ensuring proper formatting of the final message
  3. Maintaining backward compatibility for cases without patterns
  4. Reducing tokens used (especially for long inputs) so that context windows don't get exhausted

  ## Test Plan

  This change should be tested with:
  1. Raw mode with a pattern specified
  2. Raw mode without a pattern
  3. Normal mode (non-raw) with and without patterns

  Verify that in all cases, the final prompt sent to the model contains the expected content without duplication.

  ## Additional Notes
  The comments in the code have been updated to better explain the behavior of this section, which should help future developers understand the logic behind the raw mode handling.

commits:
  [{"SHA":"2d75052e5729c0a63d0b67bb5faf37e2d3ad8149","Message":"refactor: improve raw mode handling in BuildSession\n\n## CHANGES\n\n- Fix system message handling with patterns in raw mode\n- Prevent duplicate inputs when using patterns\n- Add conditional logic for pattern vs non-pattern scenarios\n- Simplify message construction with clearer variable names\n- Improve code comments for better readability","Author":"Kayvan Sylvan"}]


title: Claude 4 Integration and README Updates
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1478
merged_at: 2025-05-22 19:02:11+00:00
created_at: 2025-07-16 04:25:34
body:
  # Claude 4 Integration and README Updates

  ## What this Pull Request (PR) does

  This pull request updates the Anthropic SDK integration to support Claude 4 models and fixes minor documentation issues in the README. The changes include upgrading the Anthropic SDK from beta version 0.2.0-beta.3 to stable version 1.2.0, adding support for new Claude 4 model variants, and updating the project documentation.

  ## Related issues

  N/A

  ## Files Changed

  - **README.md**: Fixed anchor link capitalization and updated the changelog to reflect Claude 4 support
  - **go.mod**: Updated Anthropic SDK dependency from v0.2.0-beta.3 to v1.2.0
  - **go.sum**: Updated checksums for the new Anthropic SDK version
  - **plugins/ai/anthropic/anthropic.go**: Updated model definitions and API calls to work with the new SDK version


  ## Code Changes

  ### README.md
  - Fixed anchor links in table of contents from `#Installation` and `#Usage` to lowercase `#installation` and `#usage`
  - Updated changelog date from April 16, 2025 to May 22, 2025
  - Changed announcement from Grok support to Claude 4 support with reference to Anthropic's blog post

  ### go.mod & go.sum
  - Upgraded `github.com/anthropics/anthropic-sdk-go` from `v0.2.0-beta.3` to `v1.2.0`

  ### plugins/ai/anthropic/anthropic.go
  - Added new Claude 4 models to the supported models list:
    ```go
    string(anthropic.ModelClaudeOpus4_20250514), 
    string(anthropic.ModelClaudeSonnet4_20250514)
    ```
  - Wrapped all model constants with `string()` conversion for type compatibility
  - Updated API calls to use proper type casting:
    ```go
    Model: anthropic.Model(opts.Model)
    ```
  - Removed deprecated Claude 2.x models from the supported list

  ## Reason for Changes

  These changes were made to:
  1. Add support for Anthropic's new Claude 4 models (Opus and Sonnet variants)
  2. Upgrade from a beta SDK version to a stable release for better reliability
  3. Fix documentation inconsistencies in the README
  4. Ensure type compatibility with the updated SDK API


  ## Impact of Changes

  **Positive Impact:**
  - Users can now access Claude 4 models with improved capabilities
  - More stable SDK reduces potential bugs from beta software
  - Better documentation consistency improves user experience

  **Potential Issues:**
  - Breaking change: Removed Claude 2.0 and 2.1 models from supported list
  - Type casting changes may affect error handling if model names are invalid
  - Users relying on deprecated models will need to migrate to newer versions

  ## Test Plan

  - Verified that the application builds successfully with the updated dependencies
  - Tested sending requests to both existing Claude models and the new Claude 4 models
  - Confirmed that streaming and non-streaming message functionality works correctly with the updated SDK

  ## Additional Notes

  **NOTE**
  The removal of Claude 2.x models could cause runtime errors for users with configurations referencing these models


  ## Screenshots

  Before:

  ![image](https://github.com/user-attachments/assets/a506fb19-c187-4a97-8d22-d8d9c80e1226)

  After:

  ![image](https://github.com/user-attachments/assets/7986b15d-f1e4-40f9-86f9-c214a31b6149)

commits:
  [{"SHA":"c8f9a39a4021559302d668792d642edc2f07eae0","Message":"feat: add support for Anthropic Claude 4 models and update SDK to v1.2.0\n\nCHANGES\n- Upgrade `anthropic-sdk-go` dependency to version `v1.2.0`.\n- Integrate new Anthropic Claude 4 Opus and Sonnet models.\n- Remove deprecated Claude 2.0 and 2.1 models from list.\n- Adjust model type casting for `anthropic-sdk-go v1.2.0` compatibility.\n- Refresh README: announce Claude 4, update date, fix links.","Author":"Kayvan Sylvan"}]


title: Automatic setting of "raw mode" for some models
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1480
merged_at: 2025-05-23 05:43:04+00:00
created_at: 2025-07-16 04:25:34
body:
  # Automatic setting of "raw mode" for some models

  ## What this Pull Request (PR) does

  This PR introduces automatic raw mode detection for AI models that require it. The system now automatically enables raw mode for specific model families (OpenAI's o1/o3/o4 series and Ollama's llama2/llama3) without requiring manual configuration.

  ## Related issues

  closes #1477 and #1068 

  ## Files Changed

  - **core/chatter.go**: Modified the `Send` method to check if the selected model requires raw mode and automatically enable it
  - **plugins/ai/vendor.go**: Added `NeedsRawMode` interface method to the Vendor interface
  - **plugins/ai/\*/\*.go**: Implemented `NeedsRawMode` method across all AI vendor implementations (anthropic, azure, dryrun, exolab, gemini, lmstudio, ollama, openai)

  ## Code Changes

  ### core/chatter.go
  ```go
  +       modelToUse := opts.Model
  +       if modelToUse == "" {
  +               modelToUse = o.model // Default to the model set in the Chatter struct
  +       }
  +       if o.vendor.NeedsRawMode(modelToUse) {
  +               opts.Raw = true
  +       }
  ```
  Added logic to determine the model being used and automatically enable raw mode if the vendor indicates it's required for that model.

  ### plugins/ai/vendor.go
  ```go
  +       NeedsRawMode(modelName string) bool
  ```
  Extended the Vendor interface with a new method to query whether a specific model requires raw mode.

  ### plugins/ai/openai/openai.go
  ```go
  +func (o *Client) NeedsRawMode(modelName string) bool {
  +       openaiModelsPrefixes := []string{
  +               "o1",
  +               "o3",
  +               "o4",
  +       }
  +       for _, prefix := range openaiModelsPrefixes {
  +               if strings.HasPrefix(modelName, prefix) {
  +                       return true
  +               }
  +       }
  +       return false
  +}
  ```
  Implemented raw mode detection for OpenAI models, specifically targeting the o1, o3, and o4 model families.

  ### plugins/ai/ollama/ollama.go
  ```go
  +func (o *Client) NeedsRawMode(modelName string) bool {
  +       ollamaPrefixes := []string{
  +               "llama3",
  +               "llama2",
  +       }
  +       for _, prefix := range ollamaPrefixes {
  +               if strings.HasPrefix(modelName, prefix) {
  +                       return true
  +               }
  +       }
  +       return false
  +}
  ```
  Implemented raw mode detection for Ollama models, specifically for llama2 and llama3 models.

  ### Other vendor implementations
  All other vendor implementations (anthropic, azure, dryrun, exolab, gemini, lmstudio) return `false` for `NeedsRawMode`, indicating they don't require special raw mode handling.

  ## Reason for Changes

  Certain AI models require raw mode to function correctly. Previously, users had to manually enable raw mode for these models, which was error-prone and led to confusion. This change automates the process by detecting when a model requires raw mode and enabling it automatically.

  ## Impact of Changes

  1. **Improved User Experience**: Users no longer need to remember which models require raw mode
  2. **Reduced Errors**: Eliminates failures caused by forgetting to enable raw mode for models that require it
  3. **Backward Compatibility**: The change is backward compatible - existing code that manually sets raw mode will continue to work
  4. **Extensibility**: The interface-based approach makes it easy to add raw mode requirements for new models in the future

  ## Test Plan

  1. Test with OpenAI o1/o3/o4 models to verify raw mode is automatically enabled
  2. Test with Ollama llama2/llama3 models to verify raw mode is automatically enabled
  3. Test with other models to ensure raw mode is not incorrectly enabled
  4. Verify that manually setting raw mode still works as expected
  5. Test with empty model selection to ensure default model handling works correctly

  ## Additional Notes

  - The implementation uses a prefix-based approach for model detection, which allows for flexibility with model versions (e.g., "o1-preview", "llama3.1", etc.)
  - The `NeedsRawMode` method is called for every chat request, but the overhead is minimal as it's just string comparison
  - Future model additions that require raw mode can be easily added to the respective vendor's prefix list

  ## Screenshots

  Before fix:

  ![image](https://github.com/user-attachments/assets/eed58c12-516c-414c-b324-cf1b0961e76c)

  After fix:

  ![image](https://github.com/user-attachments/assets/4e05a4a2-cb68-4061-9e00-5985bf567bb9)

  With no model set, we have no change in behavior (the prompt is sent as the "User" message):

  ![image](https://github.com/user-attachments/assets/511954d1-51bd-4ca4-9da9-8a82d40b55f9)

commits:
  [{"SHA":"39a8b67438dc6061026058ebdf45053345ca0b82","Message":"feat: add NeedsRawMode method to AI vendor interface\n\n## CHANGES\n\n- Add NeedsRawMode to Vendor interface\n- Implement NeedsRawMode in all AI clients\n- Return false for all implementations\n- Support model-specific raw mode detection\n- Enable future raw mode requirements","Author":"Kayvan Sylvan"},{"SHA":"be674841e78618b755fabc998b5b5675732a6ec0","Message":"feat: add automatic raw mode detection for specific AI models\n\n## CHANGES\n\n- Add model-specific raw mode detection logic\n- Check Ollama llama2/llama3 models for raw mode\n- Check OpenAI o1/o3/o4 models for raw mode\n- Use model from options or default chatter\n- Auto-enable raw mode when vendor requires it\n- Import strings package for prefix matching","Author":"Kayvan Sylvan"}]


title: Add board meeting summary pattern template
author: skibum1869
author_url: https://github.com/skibum1869
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1481
merged_at: 2025-05-23 21:36:46+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This pull request creates a board meeting summary pattern

  ## Related issues
  No related issues. 

commits:
  [{"SHA":"a09131ea72f266689ed8a613d11b1bbc7be2ad7b","Message":"Add board meeting summary pattern template","Author":"Max Harris"},{"SHA":"ce47018fc331bfe14c6e196de7b540944d9ae745","Message":"Merge branch 'danielmiessler:main' into main","Author":"Max Harris"},{"SHA":"5fc004805ebf8114a1886e63a234693745d95f4b","Message":"Update meeting summary template with word count requirement\n\nAI:\n\nAdd minimum word count for context section in board summary","Author":"Max Harris"}]


title: Web UI update all packages, reorganize docs, add install scripts
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1484
merged_at: 2025-05-24 05:57:42+00:00
created_at: 2025-07-16 04:25:34
body:
  # Web UI package upgrades and documentation consolidation

  ## What this Pull Request (PR) does
  This PR reorganizes the Web UI documentation structure by consolidating various README files into a legacy directory and updating the main web README with clearer installation instructions and convenience scripts.

  ## Related issues
  N/A

  ## Screenshots

  Before, starting at the Fabric source directory (running `tree --gitignore . -L 2 -d`):

  ```plaintext
  .
  ├── cli
  ├── common
  ├── completions
  ├── core
  ├── images
  ├── nix
  │   └── pkgs
  ├── Pattern_Descriptions
  ├── patterns [... long list of subdirectories redacted ...]
  ├── plugins
  │   ├── ai
  │   ├── db
  │   ├── strategy
  │   ├── template
  │   └── tools
  ├── restapi
  ├── strategies
  ├── web
  │   ├── myfiles
  │   ├── src
  │   ├── static
  │   └── Web Interface Update README Files
  └── Web Interface MOD Readme Files

  239 directories
  ```

  After:

  ```plaintext
  .
  ├── cli
  ├── common
  ├── completions
  ├── core
  ├── images
  ├── nix
  │   └── pkgs
  ├── Pattern_Descriptions
  ├── patterns [... long list of subdirectories redacted ...]
  │   ├── write_semgrep_rule
  │   └── youtube_summary
  ├── plugins
  │   ├── ai
  │   ├── db
  │   ├── strategy
  │   ├── template
  │   └── tools
  ├── restapi
  ├── strategies
  └── web
      ├── legacy
      ├── myfiles
      ├── scripts
      ├── src
      └── static

  239 directories
  ```

  ## Files Changed

  ### 1. **Deleted Files**
  - `Web Interface MOD Readme Files/pr-1284-update.md`: Removed comprehensive documentation about Web UI improvements including pattern selection, multilingual support, and PDF-to-markdown functionality

  ### 2. **Moved Files** (to `web/legacy/` directory)
  - `Web Interface MOD Readme Files/WEB V2 Install Guide.md` → `web/legacy/Install-Guide.md`
  - `web/Web Interface Update README Files/*.md` → `web/legacy/*.md`
    - `enhanced-pattern-selection-update.md`
    - `language-options.md`
    - `pattern-search-implementation.md`
    - `pr-1284-update.md`
    - `pr-1319_PDF_TO_MARKDOWN_README.md`

  ### 3. **Modified Files**
  - `web/README.md`: Completely rewritten with clearer structure and installation instructions
  - `web/package.json`: Updated all dependencies to latest versions
  - `web/pnpm-lock.yaml`: Regenerated with updated dependencies

  ### 4. **New Files**
  - `web/scripts/npm-install.sh`: Convenience script for npm installation
  - `web/scripts/pnpm-install.sh`: Convenience script for pnpm installation

  ## Code Changes

  ### web/README.md
  - Added table of contents
  - Restructured installation section with clear "From Source" instructions
  - Added TL;DR convenience scripts section
  - Included detailed manual installation steps for both npm and pnpm
  - Added PDF-to-Markdown installation commands
  - Simplified tips section
  - Added links to external resources (Svelte, SkeletonUI, Mdsvex)

  ### Installation Scripts
  Both scripts follow the same pattern:
  ```bash
  1. Check if package manager is installed
  2. Install GUI dependencies
  3. Install PDF-to-Markdown components in order:
     - patch-package
     - pdfjs-dist  
     - github:jzillmann/pdf-to-markdown#modularize
  4. Run svelte-kit sync
  ```

  ### Package Updates
  Major dependency updates include:
  - `@sveltejs/kit`: 2.9.0 → 2.21.1
  - `svelte`: 4.2.19 → 4.2.20
  - `vite`: 5.0.3 → 5.4.19
  - `tailwindcss`: 3.3.6 → 3.4.17
  - `typescript`: 5.0.0 → 5.8.3
  - Various other dependencies updated to latest versions

  ## Reason for Changes

  1. **Documentation Consolidation**: Moving older documentation to a legacy folder helps maintain a cleaner project structure while preserving historical context
  2. **Improved User Experience**: The new README provides clearer, more actionable installation instructions
  3. **Dependency Updates**: Keeping dependencies up-to-date ensures security patches and performance improvements
  4. **Convenience Scripts**: Automated installation scripts reduce setup complexity and potential errors

  ## Impact of Changes

  1. **Positive Impacts**:
     - Easier onboarding for new users with clearer documentation
     - Reduced installation errors with convenience scripts
     - Better security and performance with updated dependencies
     - Cleaner project structure

  2. **Potential Considerations**:
     - Users following old documentation links may need to update their references
     - Dependency updates may introduce breaking changes (though package.json suggests compatibility is maintained)
     - Legacy documentation is preserved but may become outdated over time

  ## Test Plan

  1. [✅] Test both installation scripts on fresh environments
  2. [✅] Verify npm and pnpm installations complete successfully
  3. [✅] Ensure PDF-to-Markdown functionality works after installation
  4. [✅] Run `npm run dev` / `pnpm run dev` to verify the application starts correctly
  5. [✅] Check that all moved documentation is accessible in the legacy folder

  ## Additional Notes

  - The PR maintains backward compatibility by preserving all documentation in the legacy folder
  - The convenience scripts include error checking for missing package managers
  - The updated README follows a more standard documentation structure with proper markdown formatting
  - All external links in the README use reference-style links for better maintainability

commits:
  [{"SHA":"4446b456ba43b536f9804e3f8478cadac8c4a9ec","Message":"docs: reorganize web documentation and add installation scripts\n\n## CHANGES\n\n- Move legacy documentation files to web/legacy/\n- Update web README with installation instructions\n- Add convenience scripts for npm and pnpm installation\n- Update all package dependencies to latest versions\n- Add PDF-to-Markdown installation steps to README\n- Remove duplicate documentation files","Author":"Kayvan Sylvan"},{"SHA":"1f5d3db3fbc27b4b6ce88f80b225c713ed9f9611","Message":"fix typo in script name","Author":"Kayvan Sylvan"}]


title: Web UI: Centralize Environment Configuration and Make Fabric Base URL Configurable
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1485
merged_at: 2025-05-24 06:02:57+00:00
created_at: 2025-07-16 04:25:34
body:
  # Web UI: Centralize Environment Configuration and Make Fabric Base URL Configurable

  ## What this Pull Request (PR) does

  This PR introduces centralized environment configuration management for the Fabric web application. The main change is making the Fabric base URL configurable through environment variables instead of being hardcoded to `localhost:8080`. This enhancement improves deployment flexibility and follows configuration best practices.

  ## Related issues

  N/A - This simple change makes it possible to point instances of the frontend Web UI to a more powerful machine on the network running Fabric (or even a cloud instance).

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/68b0fa72-595a-4f21-8f6f-53d3aeac9a62)

  ![image](https://github.com/user-attachments/assets/f1f1cd23-5904-4932-acee-90cdf7eead42)

  ## Files Changed

  ### Added Files
  - **`web/src/lib/config/environment.ts`** - New centralized configuration module that handles environment variable access for both server and client contexts

  ### Modified Files
  - **`web/src/routes/chat/+server.ts`** - Minor whitespace cleanup (trailing spaces removed)
  - **`web/vite.config.ts`** - Updated to use configurable Fabric base URL and inject configuration for client-side access

  ## Code Changes

  ### New Environment Configuration Module
  ```typescript
  export function getFabricBaseUrl(): string {
    // Server context (Node.js)
    if (typeof process !== 'undefined' && process.env) {
      return process.env.FABRIC_BASE_URL || DEFAULT_FABRIC_BASE_URL;
    }
    
    // Client context with injected config
    if (typeof window !== 'undefined' && (window as any).__FABRIC_CONFIG__) {
      return (window as any).__FABRIC_CONFIG__.FABRIC_BASE_URL || DEFAULT_FABRIC_BASE_URL;
    }
    
    return DEFAULT_FABRIC_BASE_URL;
  }
  ```

  ### Vite Configuration Updates
  ```typescript
  // Environment variable with fallback
  const FABRIC_BASE_URL = process.env.FABRIC_BASE_URL || 'http://localhost:8080';

  // Proxy configuration now uses variable
  proxy: {
    '/api': {
      target: FABRIC_BASE_URL,
      // ...
    }
  }
  ```

  ## Reason for Changes

  1. **Configuration Flexibility**: Hardcoded URLs make deployment to different environments (staging, production, development) difficult
  2. **Best Practices**: Centralizing environment configuration reduces code duplication and improves maintainability
  3. **Universal Context Support**: The new configuration works in both server-side (SSR) and client-side contexts
  4. **Deployment Ready**: Applications can now be easily configured for different Fabric backend instances

  ## Impact of Changes

  ### Positive Impacts
  - **Deployment Flexibility**: Can now deploy to any environment by setting `FABRIC_BASE_URL` environment variable
  - **Code Organization**: Centralized configuration makes the codebase more maintainable
  - **Development Experience**: Developers can easily point to different Fabric instances during development

  ### Potential Risks
  - **Runtime Configuration**: Client-side configuration relies on Vite's build-time injection, which could fail silently if misconfigured
  - **Type Safety**: The global window extension uses `any` type, reducing type safety
  - **Fallback Dependency**: Heavy reliance on fallback values might mask configuration issues

  ## Test Plan

  1. [✅] **Default Behavior**: Verify application works without `FABRIC_BASE_URL` set (should use `localhost:8080`)
  2. [✅] **Environment Variable**: Test with `FABRIC_BASE_URL=http://localhost:7777` and verify proxy targets update
  3. [✅] **Client-Side Access**: Confirm `getFabricBaseUrl()` returns correct values in browser context
  4. [✅] **API Endpoint Construction**: Validate `getFabricApiUrl()` correctly appends `/api` when needed
  5. [✅] **Test Web UI manually**: Works as before

  ## Additional Notes

  - The configuration module includes TypeScript definitions for better IDE support
  - Unused parameters in Vite config are now properly prefixed with underscore to avoid linting warnings
  - The implementation maintains backward compatibility - existing deployments will continue working without changes
  - **Breaking Changes**: None - this is a backward-compatible enhancement.

commits:
  [{"SHA":"93f6f2f0c410ee9379ae2fc8b2e6de13e1c51c0d","Message":"feat: add centralized environment configuration for Fabric base URL\n\n- Create environment config module for URL handling\n- Add getFabricBaseUrl() function with server/client support\n- Add getFabricApiUrl() helper for API endpoints\n- Configure Vite to inject FABRIC_BASE_URL client-side\n- Update proxy targets to use environment variable\n- Add TypeScript definitions for window config\n- Support FABRIC_BASE_URL env var with fallback","Author":"Kayvan Sylvan"}]


title: Dependency Updates and PDF Worker Refactoring
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1487
merged_at: 2025-05-24 09:06:43+00:00
created_at: 2025-07-16 04:25:34
body:
  # Dependency Updates and PDF Worker Refactoring

  ## What this Pull Request (PR) does

  Fixes the breaking changes related to a Dependabot PDF.js upgrade.

  This pull request introduces several key changes aimed at modernizing our dependencies and improving the robustness of PDF processing within the web application. The primary changes include:

  1.  **Dependency Updates:** `pdfjs-dist` has been upgraded from `v2.16.105` to `v4.2.67`, and `nanoid` from `v4.0.2` to `v5.0.9`.
  2.  **PDF Worker Handling:** The PDF.js worker initialization has been refactored to use a static path and centralized configuration. The worker file itself (`pdf.worker.min.mjs`) is now served from the `static` directory.
  3.  **Build Configuration:** Vite configuration has been updated to target `esnext` and optimize `pdfjs-dist`.
  4.  **Browser Compatibility:** A `.browserslistrc` file has been added to define supported browser versions.

  ## Files Changed

  *   **`web/.browserslistrc` (New File):**
      *   Added to specify the target browsers for our build tools (e.g., Babel, PostCSS). This ensures CSS and JavaScript are transpiled appropriately for modern browsers, specifically the last 2 versions of major browsers, and versions of Chrome, Firefox, Safari, and Edge that are relatively recent (>=89 or >=15 for Safari).
  *   **`web/package.json` (Modified):**
      *   Updated `pdfjs-dist` from `^2.16.105` to `^4.2.67`.
      *   Updated `nanoid` from `4.0.2` to `5.0.9`.
  *   **`web/pnpm-lock.yaml` (Modified):**
      *   Automatically updated to reflect changes in `package.json` and their transitive dependencies. The diff is substantial due to the major version bump of `pdfjs-dist` and `nanoid`.
  *   **`web/src/lib/services/PdfConversionService.ts` (Modified):**
      *   Refactored the PDF.js worker initialization. Instead of dynamically creating the worker URL using `import.meta.url`, it now relies on a centralized configuration provided by the new `pdf-config.ts` module.
  *   **`web/src/lib/services/pdf-config.ts` (New File):**
      *   This new module centralizes the configuration for the PDF.js worker. It sets `GlobalWorkerOptions.workerSrc` to a static path (`/pdf.worker.min.mjs`) within the `public` (aliased as `static` in SvelteKit) directory. This initialization is performed only on the client-side (`if (browser)`).
  *   **`web/static/pdf.worker.min.mjs` (New File):**
      *   This is the PDF.js worker file itself, now using the `.mjs` extension, indicating it's likely an ES module. It has been moved to the `static` directory to be served directly by the web server.
  *   **`web/vite.config.ts` (Modified):**
      *   Added `pdfjs-dist` to `optimizeDeps.include` to ensure it's properly processed by Vite's dependency pre-bundling.
      *   Added `esbuildOptions` within `optimizeDeps` to target `esnext` and support `top-level-await`.
      *   Updated the main `build` configuration to target `esnext`, enable minification, and set the Rollup output format to `es`.

  ## Code Changes

  1.  **Dependency Updates in `web/package.json`:**
      ```diff
      -    "pdfjs-dist": "^2.16.105",
      +    "pdfjs-dist": "^4.2.67",
      ...
      -    "nanoid": "4.0.2",
      +    "nanoid": "5.0.9",
      ```
  2.  **PDF Worker Initialization in `web/src/lib/services/PdfConversionService.ts`:**
      The previous dynamic worker URL generation:
      ```diff
      -      const workerUrl = new URL(
      -        'pdfjs-dist/build/pdf.worker.min.js',
      -        import.meta.url
      -      );
      -      console.log('Worker URL:', workerUrl.href);
      -      pdfjs.GlobalWorkerOptions.workerSrc = workerUrl.href;
      ```
      has been replaced with:
      ```diff
      +import pdfConfig from './pdf-config';
      ...
      +      // Initialize PDF.js configuration from the shared config
      +      pdfConfig.initialize();
      ```
  3.  **New PDF Worker Configuration in `web/src/lib/services/pdf-config.ts`:**
      This file now handles setting the worker source:
      ```typescript
      import { browser } from '$app/environment';
      import { GlobalWorkerOptions } from 'pdfjs-dist';

      const workerSrc = '/pdf.worker.min.mjs';

      if (browser) {
        GlobalWorkerOptions.workerSrc = workerSrc;
      }
      ```
  4.  **Vite Configuration Updates in `web/vite.config.ts`:**
      ```diff
      +  optimizeDeps: {
      +    include: ['pdfjs-dist'],
      +    esbuildOptions: {
      +      target: 'esnext',
      +      supported: {
      +        'top-level-await': true
      +      }
      +    }
      +  },
      ...
      +  build: {
      +    commonjsOptions: {
      +      transformMixedEsModules: true
      +    },
      +    target: 'esnext',
      +    minify: true,
      +    rollupOptions: {
      +      output: {
      +        format: 'es'
      +      }
      +    }
      +  }
      ```

  ## Reason for Changes

  *   **Dependency Modernization:** Upgrading `pdfjs-dist` and `nanoid` to their latest major versions brings in the latest features, bug fixes, performance improvements, and security patches.
  *   **Robust PDF Worker Loading:** The previous method of dynamically determining the PDF.js worker URL using `import.meta.url` can be problematic with certain bundlers or in specific environments (e.g., when code is further transformed or moved). Moving the worker to the `static` directory and referencing it via a static path (`/pdf.worker.min.mjs`) provides a more reliable and straightforward way to load the worker, especially in a Vite/SvelteKit setup. This also aligns better with how `pdfjs-dist` v4+ recommends handling worker files in module-based environments.
  *   **Build Optimization and Modernization:** Targeting `esnext` in Vite's build and esbuild options allows us to leverage modern JavaScript features, potentially leading to smaller bundle sizes and better performance. Optimizing `pdfjs-dist` helps Vite handle this large dependency more efficiently.
  *   **Standardized Browser Support:** The `.browserslistrc` file ensures consistent browser support across the project for CSS and JS features.

  ## Impact of Changes

  *   **Improved PDF Functionality:** Newer `pdfjs-dist` likely offers better PDF rendering, parsing capabilities, and compatibility with a wider range of PDF documents.
  *   **Enhanced Stability:** The refactored PDF worker loading mechanism should reduce potential issues related to worker path resolution during development and in production builds.
  *   **Modern JavaScript Output:** Builds will now target `esnext`, which can be beneficial for modern browsers.
  *   **Dependency Footprint:** The major version bump in `pdfjs-dist` has led to significant changes in transitive dependencies, as seen in `pnpm-lock.yaml`. This is expected and brings the project's dependency graph up to date.

  ## Potential Bugs

  *   **`pdfjs-dist` v4 API Changes:** Being a major version upgrade, `pdfjs-dist` v4 might have breaking API changes. While the immediate usage in `PdfConversionService.ts` seems adapted, other parts of the application relying on `pdfjs-dist` (if any) might need to be checked for compatibility.
  *   **Static Worker Path:** The hardcoded path `/pdf.worker.min.mjs` assumes the application is served from the root. If deployed under a subpath, this might need adjustment or a base path configuration in Vite.
  *   **`esnext` Target:** While beneficial for modern browsers, if extremely old browser support is inadvertently required (despite `.browserslistrc`), the `esnext` target might cause issues. However, `.browserslistrc` should guide transpilation.
  *   **`nanoid` v5 API Changes:** Similar to `pdfjs-dist`, `nanoid` v5 might have API differences from v4. Usage sites should be verified.

  ## Test Plan

  1.  **PDF Conversion:**
      *   Thoroughly test PDF to Markdown conversion with various PDF files (simple, complex, different versions).
      *   Verify that the PDF.js worker loads correctly in the browser console (look for "PDF.js worker initialized at /pdf.worker.min.mjs").
      *   Check for any console errors during PDF processing.
  2.  **Application Build and Runtime:**
      *   Ensure the application builds successfully with `pnpm build`.
      *   Run the application locally (`pnpm dev`) and in a preview/production-like environment (`pnpm preview`) to check for runtime errors.
  3.  **Browser Compatibility:**
      *   Test the application in the latest versions of Chrome, Firefox, Safari, and Edge as defined in `.browserslistrc`.
  4.  **Nanoid Usage:**
      *   If `nanoid` is used directly in our codebase, verify that its functionality remains unchanged after the version bump.

  ## Additional Notes

  *   The large number of changes in `pnpm-lock.yaml` is primarily due to the major version upgrades of `pdfjs-dist` and `nanoid`, which pull in different sets of transitive dependencies.
  *   The introduction of `.browserslistrc` is a good practice for maintaining clarity on our supported browser matrix.
  *   The move of the PDF worker to the `static` directory and the use of an `.mjs` extension is a deliberate change to improve how module-based JavaScript (especially with Vite) handles such assets.
  *   The `optimizeDeps` configuration for `pdfjs-dist` in `vite.config.ts` is important for Vite to correctly pre-bundle and handle this dependency.


  ## Screenshots

  Popped my resume PDF file into the chat, and it instantly turned into markdown.

  ![image](https://github.com/user-attachments/assets/fbce178e-a2cd-4d9d-b526-7811cccf0d4a)

commits:
  [{"SHA":"40273053456779070e978b1b5baaf1a5279967f9","Message":"feat: upgrade PDF.js to v4.2 and refactor worker initialization\n\n### CHANGES\n- Add `.browserslistrc` to define target browser versions.\n- Upgrade `pdfjs-dist` dependency from v2.16 to v4.2.67.\n- Upgrade `nanoid` dependency from v4.0.2 to v5.0.9.\n- Introduce `pdf-config.ts` for centralized PDF.js worker setup.\n- Refactor `PdfConversionService` to use new PDF worker configuration.\n- Add static `pdf.worker.min.mjs` to serve PDF.js worker.\n- Update Vite configuration for ESNext build target and PDF.js.","Author":"Kayvan Sylvan"}]


title: Add AIML provider configuration
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1495
merged_at: 2025-06-07 18:00:27+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This pull request adds support for a new OpenAI-compatible provider, AIML, by including its configuration in the `ProviderMap`. This allows users to configure and utilize AIML's API endpoints through our system.

  ## Related issues
  closes #1493 

  ### Files Changed

  *   **`plugins/ai/openai_compatible/providers_config.go`**: Modified to add the AIML provider configuration to the list of supported providers.

  ### Code Changes

  A new entry for `AIML` has been added to the `ProviderMap` variable.

  ```go
   // plugins/ai/openai_compatible/providers_config.go
   "SiliconCloud": {
    Name:    "SiliconCloud",
    BaseURL: "https://api.siliconflow.cn/v1",
   },
  +"AIML": {
  + Name:    "AIML",
  + BaseURL: "https://api.aimlapi.com/v1",
  +},
  ```

  ### Reason for Changes

  The goal is to expand the range of supported third-party, OpenAI-compatible AI services. By adding AIML to our provider list, we enable users who have accounts with AIML to integrate their services directly with our platform without needing to manually specify the base URL.

  ### Impact of Changes

  *   **Functionality**: Users can now select `AIML` as a provider in their configuration. The system will automatically use `https://api.aimlapi.com/v1` as the base URL for all API requests to this provider.
  *   **Backward Compatibility**: This change is purely additive and does not affect any existing provider configurations. There is no impact on users who are not using the new AIML provider.
  *   **Potential Bugs**: If the AIML API endpoint (`https://api.aimlapi.com/v1`) changes in the future, this configuration will become outdated and require an update. There are no other anticipated risks, as this is a simple configuration addition.

  ### Test Plan

  To ensure the changes work as expected, manual testing is recommended:

  1.  Configure the application to use the `AIML` provider.
  2.  Provide a valid AIML API key in the local environment/configuration.
  3.  Execute a feature that makes a call to the AI provider (e.g., generate a text completion).
  4.  Verify that the API call is successful and that the request was routed to the AIML endpoint.
  5.  Optionally, test an existing provider (like `OpenAI` or `SiliconCloud`) to confirm that its functionality remains unaffected.

  ### Additional Notes

  This change only registers the provider's name and base URL. Users are still responsible for obtaining and configuring their own API keys for the AIML service.

  Once you have the API key, you have access to all the models (203 new models on the date of this PR)

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/fd3bba39-10c4-4135-a087-458c6d189c14)

  ![image](https://github.com/user-attachments/assets/347092b1-4086-4a88-97e7-33f69bd87a58)

commits:
  [{"SHA":"ffb31985e87a791026546fad542a67cf93a72194","Message":"feat: add AIML provider to OpenAI compatible providers configuration\n\n## CHANGES\n\n- Add AIML provider configuration\n- Set AIML base URL to api.aimlapi.com/v1\n- Expand supported OpenAI compatible providers list\n- Enable AIML API integration support","Author":"Kayvan Sylvan"}]


title: feat: add Terraform plan analyzer pattern for infrastructure changes
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1497
merged_at: 2025-06-11 16:00:55+00:00
created_at: 2025-07-16 04:25:34
body:
  # Terraform Plan Analyzer

  ## Summary

  This PR adds a new Fabric pattern for analyzing Terraform plan outputs. The pattern provides structured
  analysis of infrastructure changes with a focus on security, cost, and compliance implications.

  Copied from https://marksharpley.co.uk/posts/fabric/

  ## Related Issues

  Closes #1492 

  ## Files Changed

  ### Added: `patterns/analyze_terraform_plan/system.md`
  - New system prompt file that defines the behavior for analyzing Terraform plans
  - Establishes the AI assistant's role as an expert Terraform plan analyzer
  - Defines a structured output format for consistent analysis results

  ## Code Changes

  ### `patterns/analyze_terraform_plan/system.md`

  The file introduces a comprehensive prompt structure:

  ```markdown
  # IDENTITY and PURPOSE

  You are an expert Terraform plan analyser. You take Terraform plan outputs and generate a Markdown formatted summary using the format below.

  You focus on assessing infrastructure changes, security risks, cost implications, and compliance considerations.
  ```

  Key sections defined:
  1. **ONE SENTENCE SUMMARY**: A concise 20-word overview
  2. **MAIN POINTS**: 10 critical changes/concerns (max 16 words each)
  3. **TAKEAWAYS**: 5 key insights from the plan

  Output instructions ensure:
  - Markdown-only formatting
  - Numbered lists instead of bullets
  - No warnings or notes
  - No duplicate content
  - Varied opening words for list items

  ## Reason for Changes

  This pattern addresses the need for automated Terraform plan analysis, which is crucial for:
  - Quickly understanding complex infrastructure changes before applying them
  - Identifying potential security vulnerabilities or compliance issues
  - Assessing cost implications of infrastructure modifications
  - Providing consistent, structured reviews of Terraform plans

  ## Impact of Changes

  This addition will:
  - Enable users to get rapid, structured analysis of Terraform plans
  - Improve infrastructure change review processes
  - Help catch potential issues before they reach production
  - Standardize how Terraform plan reviews are documented
  - Save time for DevOps teams reviewing infrastructure changes

  ## Test Plan

  To test this pattern:
  1. Run the pattern against various Terraform plan outputs (create, update, delete operations)
  2. Verify the output follows the specified format
  3. Ensure the analysis correctly identifies security, cost, and compliance considerations
  4. Validate that the summaries are concise and within word limits

  ## Additional Notes

  This pattern follows the established Fabric pattern structure and integrates seamlessly with the existing pattern library. It's particularly useful for teams practicing Infrastructure as Code (IaC) with Terraform and need consistent plan review processes.

commits:
  [{"SHA":"a74585cb145474f99afdd826cdab699410030a1f","Message":"feat: add Terraform plan analyzer pattern for infrastructure change assessment\n\n- Create new pattern for analyzing Terraform plans\n- Add identity defining expert plan analyzer role\n- Include focus on security, cost, and compliance\n- Define three output sections for summaries\n- Specify 20-word sentence summary requirement\n- List 10 critical changes with word limits\n- Include 5 key takeaways section format\n- Add markdown formatting output instructions\n- Require numbered lists over bullet points\n- Prohibit warnings and duplicate content","Author":"Kayvan Sylvan"}]


title: feat: Enhance the PRD Generator's identity and purpose
author: noamsiegel
author_url: https://github.com/noamsiegel
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1499
merged_at: 2025-06-11 16:04:53+00:00
created_at: 2025-07-16 04:25:34
body:
  The changes in this commit expand the identity and purpose of the PRD Generator
  to provide more clarity on its role and the expected output. The key changes
  include:

  - Defining the Generator's purpose as transforming product ideas into a
    structured PRD that ensures clarity, alignment, and precision in the product
    planning and execution.
  - Outlining the key sections typically found in a PRD that the Generator should
    cover, such as Overview, Objectives, Target Audience, Features, User Stories,
    Functional and Non-functional Requirements, Success Metrics, and Timeline.
  - Providing more detailed instructions on the expected output format, structure,
    and content, including the use of Markdown, labeled sections, bullet points,
    tables, and highlighting of priorities or MVP features

commits:
  [{"SHA":"946c1af42dd5afae45f2f78ac60b9e9a093a71a9","Message":"feat: Enhance the PRD Generator's identity and purpose\n\nThe changes in this commit expand the identity and purpose of the PRD Generator\nto provide more clarity on its role and the expected output. The key changes\ninclude:\n\n- Defining the Generator's purpose as transforming product ideas into a\n  structured PRD that ensures clarity, alignment, and precision in product\n  planning and execution.\n- Outlining the key sections typically found in a PRD that the Generator should\n  cover, such as Overview, Objectives, Target Audience, Features, User Stories,\n  Functional and Non-functional Requirements, Success Metrics, and Timeline.\n- Providing more detailed instructions on the expected output format, structure,\n  and content, including the use of Markdown, labeled sections, bullet points,\n  tables, and highlighting of priorities or MVP features.","Author":"Noam Siegel"},{"SHA":"836e4c4fabafcd7722050dde3b76846a08de5983","Message":"GitButler Workspace Commit\n\nThis is a merge commit the virtual branches in your workspace.\n\nDue to GitButler managing multiple virtual branches, you cannot switch back and\nforth between git branches and virtual branches easily. \n\nIf you switch to another branch, GitButler will need to be reinitialized.\nIf you commit on this branch, GitButler will throw it away.\n\nHere are the branches that are currently applied:\n - improve-create-prd (refs/gitbutler/improve-create-prd)\nFor more information about what we're doing here, check out our docs:\nhttps://docs.gitbutler.com/features/virtual-branches/integration-branch","Author":"GitButler"}]


title: Feat/antropic tool
author: eugeis
author_url: https://github.com/eugeis
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1502
merged_at: 2025-06-11 18:40:00+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This PR implements support for the Anthropic Web Search Tool, allowing the AI model to perform web searches to enhance its responses.
  See https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool

  Additionally, new configuration parameters have been added to facilitate the setup and customization of the Anthropic AI integration.

  ## Changes:

  * **`plugins/ai/anthropic/anthropic.go`**:
      * Introduced `UseWebTool` and `WebToolLocation` as new `SetupQuestion` parameters for enabling and configuring the web search tool.
      * Modified `SendStream` and `Send` methods to incorporate the web search tool definition within the Anthropic `MessageNewParams` when `UseWebTool` is enabled.
      * Refactored message parameter building into a new `buildMessageParams` function for reusability.
      * Improved handling of content blocks from Anthropic responses to correctly extract and join text content.
  * **`plugins/plugin.go`**:
      * Added `SettingTypeBool` constant and `Type` field to the `Setting` struct to support boolean configuration values.
      * Implemented `AddSetupQuestionBool` and `AddSetupQuestionCustomBool` methods to simplify the creation of boolean setup questions.
      * Updated `IsValid` and `Print` methods of `Setting` to correctly handle and display boolean values.
      * Adjusted `FillEnvFileContent` to write boolean values appropriately to the `.env` file.
      * Modified `SetupQuestion.Ask` and `SetupQuestion.OnAnswer` to provide appropriate prompts and handle input for boolean settings.

  ## How to test

  1.  Configure the Anthropic plugin.
  2.  Enable the "Web Search Tool Enabled" option during setup.
  3.  Optionally, specify a "Web Search Tool Location".
  4.  Interact with the Anthropic model and observe if it utilizes web search for relevant queries.

commits:
  [{"SHA":"ed77cc2320a3ebfaca562637ba4a485f922565b4","Message":"feat: search tool working","Author":"Eugen Eisler"},{"SHA":"2b11f3e48e60d3eb51f9d5d91050713bcec37098","Message":"feat: search tool result collection","Author":"Eugen Eisler"}]


author: dependabot
author_url: https://github.com/apps/dependabot
author_type: bot
url: https://github.com/danielmiessler/Fabric/pull/1503
merged_at: 2025-06-12 02:33:36+00:00
created_at: 2025-07-16 04:25:34
title:
  chore(deps): bump brace-expansion from 1.1.11 to 1.1.12 in /web in the npm_and_yarn group across 1 directory

body:
  Bumps the npm_and_yarn group with 1 update in the /web directory: [brace-expansion](https://github.com/juliangruber/brace-expansion).

  Updates `brace-expansion` from 1.1.11 to 1.1.12
  <details>
  <summary>Release notes</summary>
  <p><em>Sourced from <a href="https://github.com/juliangruber/brace-expansion/releases">brace-expansion's releases</a>.</em></p>
  <blockquote>
  <h2>v1.1.12</h2>
  <ul>
  <li>pkg: publish on tag 1.x  c460dbd</li>
  <li>fmt  ccb8ac6</li>
  <li>Fix potential ReDoS Vulnerability or Inefficient Regular Expression (<a href="https://redirect.github.com/juliangruber/brace-expansion/issues/65">#65</a>)  c3c73c8</li>
  </ul>
  <hr />
  <p><a href="https://github.com/juliangruber/brace-expansion/compare/v1.1.11...v1.1.12">https://github.com/juliangruber/brace-expansion/compare/v1.1.11...v1.1.12</a></p>
  </blockquote>
  </details>
  <details>
  <summary>Commits</summary>
  <ul>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/c85b8ad3f53d1eb65f4996a495cae61949855f7c"><code>c85b8ad</code></a> 4.0.1</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/5a5cc176c080b2fde292a9815dc6ecd97c870d17"><code>5a5cc17</code></a> fmt</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/0b6a9781e18e9d2769bb2931f4856d1360243ed2"><code>0b6a978</code></a> Fix potential ReDoS Vulnerability or Inefficient Regular Expression (<a href="https://redirect.github.com/juliangruber/brace-expansion/issues/65">#65</a>)</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/6a39bdddcf944374b475d99b0e8292d3727c7ebe"><code>6a39bdd</code></a> 4.0.0</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/dd72a59047e30ea265c4a58695a00ea82e90a437"><code>dd72a59</code></a> fmt</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/278132b187d4418fe8163da5e81710222f47e3f6"><code>278132b</code></a> feat: use string replaces instead of splits (<a href="https://redirect.github.com/juliangruber/brace-expansion/issues/64">#64</a>)</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/70e4c1baf9b91c77b1fa303a0c07d35389e9c0a0"><code>70e4c1b</code></a> add <code>tea.yaml</code></li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/b01a637b0578a7c59acc7d8386f11f8d0710b512"><code>b01a637</code></a> 3.0.0</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/9e781e913fe323e69248d36acebe29008666ba72"><code>9e781e9</code></a> node 16 is EOL</li>
  <li><a href="https://github.com/juliangruber/brace-expansion/commit/6dad2093f84eac403fb3715a624fede524967cec"><code>6dad209</code></a> docs</li>
  <li>Additional commits viewable in <a href="https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12">compare view</a></li>
  </ul>
  </details>
  <br />


  [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=brace-expansion&package-manager=npm_and_yarn&previous-version=1.1.11&new-version=1.1.12)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

  Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

  [//]: # (dependabot-automerge-start)
  [//]: # (dependabot-automerge-end)

  ---

  <details>
  <summary>Dependabot commands and options</summary>
  <br />

  You can trigger Dependabot actions by commenting on this PR:
  - `@dependabot rebase` will rebase this PR
  - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
  - `@dependabot merge` will merge this PR after your CI passes on it
  - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
  - `@dependabot cancel merge` will cancel a previously requested merge and block automerging
  - `@dependabot reopen` will reopen this PR if it is closed
  - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
  - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
  - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions
  You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/danielmiessler/fabric/network/alerts).

  </details>

commits:
  [{"SHA":"02ac68834dc7d9d216cdeccd20234679458f88c5","Message":"chore(deps): bump brace-expansion\n\nBumps the npm_and_yarn group with 1 update in the /web directory: [brace-expansion](https://github.com/juliangruber/brace-expansion).\n\n\nUpdates `brace-expansion` from 1.1.11 to 1.1.12\n- [Release notes](https://github.com/juliangruber/brace-expansion/releases)\n- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)\n\n---\nupdated-dependencies:\n- dependency-name: brace-expansion\n  dependency-version: 1.1.12\n  dependency-type: indirect\n  dependency-group: npm_and_yarn\n...\n\nSigned-off-by: dependabot[bot] \u003csupport@github.com\u003e","Author":"dependabot[bot]"}]


title: fix: Add configurable HTTP timeout for Ollama client
author: marcas756
author_url: https://github.com/marcas756
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1504
merged_at: 2025-06-11 18:49:42+00:00
created_at: 2025-07-16 04:25:34
body:
  # Pull Request Description

  ## Summary

  This pull request introduces a configurable HTTP timeout for Ollama API requests within the `ollama.go` file. It adds a new setup question allowing users to specify a custom HTTP timeout duration with validation and default handling.

  ## Files Changed

  - **plugins/ai/ollama/ollama.go**: Modified to include a new configuration option for setting an HTTP timeout for Ollama API requests.

  ### Detailed Changes in `ollama.go`

  #### New Setup Question
  - Added a setup question `ApiHttpTimeout` which allows users to specify the desired HTTP request timeout duration.
    ```go
    ret.ApiHttpTimeout = ret.AddSetupQuestionCustom("HTTP Timeout", true,
        "Specify HTTP timeout duration for Ollama requests (e.g. 30s, 5m, 1h)")
    ret.ApiHttpTimeout.Value = "20m"
    ```

  #### Client Configuration Update
  - Modified the `configure` function to parse and apply this custom timeout value:
    ```go
    timeout := 20 * time.Minute // Default timeout

    if o.ApiHttpTimeout != nil {
        parsed, err := time.ParseDuration(o.ApiHttpTimeout.Value)
        if err == nil && o.ApiHttpTimeout.Value != "" {
            timeout = parsed
        } else if o.ApiHttpTimeout.Value != "" {
            fmt.Printf("Invalid HTTP timeout format (%q), using default (20m): %v\n", o.ApiHttpTimeout.Value, err)
        }
    }

    o.client = ollamaapi.NewClient(o.apiUrl, &http.Client{Timeout: timeout, Transport: &transport_sec{underlyingTransport: http.DefaultTransport, ApiKey: o.ApiKey}})
    ```

  ## Reason for Changes

  The primary reason for this update is to provide flexibility in network conditions by allowing users to specify how long the Ollama client should wait before timing out on API requests. This change helps in environments with variable network performance, where a fixed timeout might either be too short or unnecessarily long.

  ## Impact of Changes

  - **Flexibility**: Users now have control over the timeout settings which can lead to improved reliability and user experience under different network conditions.
  - **Error Handling**: The implementation includes handling for invalid formats, falling back to a default 20-minute timeout if parsing fails. This ensures robustness and informs users of incorrect inputs.

  ## Test Plan

  1. **Functional Testing**:
     - Verify that the `HTTP Timeout` setup question appears correctly in the configuration interface.
     - Check that valid input values (e.g., "30s", "5m", "1h") are parsed correctly and applied as expected.

  2. **Error Handling**:
     - Test with invalid timeout formats to ensure appropriate error messages are logged and the default value is used.

  3. **Default Behavior**:
     - Confirm that when no custom timeout is set, the client defaults to a 20-minute timeout.

  ## Additional Notes

  This change assumes that the user has familiarity with Go's time parsing capabilities (`time.ParseDuration`). The implementation ensures backward compatibility by maintaining existing behavior if no new configuration is provided. Future enhancements could include more descriptive error messages or additional validation for extreme values.

commits:
  [{"SHA":"0ae41116aac998e2060015ce1918aa8897242c35","Message":"fix: Add configurable HTTP timeout for Ollama client\n\nAdd a new setup question to configure the HTTP timeout duration for\nOllama requests. The default value is set to 20 minutes.","Author":"Marco Bacchi"}]


title: fix: fix web search tool location
author: eugeis
author_url: https://github.com/eugeis
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1506
merged_at: 2025-06-11 20:25:22+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  This PR implements support for the Anthropic Web Search Tool, allowing the AI model to perform web searches to enhance its responses.
  See https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool

  Additionally, new configuration parameters have been added to facilitate the setup and customization of the Anthropic AI integration.

  ## Changes:

  * **`plugins/ai/anthropic/anthropic.go`**:
      * Introduced `UseWebTool` and `WebToolLocation` as new `SetupQuestion` parameters for enabling and configuring the web search tool.
      * Modified `SendStream` and `Send` methods to incorporate the web search tool definition within the Anthropic `MessageNewParams` when `UseWebTool` is enabled.
      * Refactored message parameter building into a new `buildMessageParams` function for reusability.
      * Improved handling of content blocks from Anthropic responses to correctly extract and join text content.
  * **`plugins/plugin.go`**:
      * Added `SettingTypeBool` constant and `Type` field to the `Setting` struct to support boolean configuration values.
      * Implemented `AddSetupQuestionBool` and `AddSetupQuestionCustomBool` methods to simplify the creation of boolean setup questions.
      * Updated `IsValid` and `Print` methods of `Setting` to correctly handle and display boolean values.
      * Adjusted `FillEnvFileContent` to write boolean values appropriately to the `.env` file.
      * Modified `SetupQuestion.Ask` and `SetupQuestion.OnAnswer` to provide appropriate prompts and handle input for boolean settings.

  ## How to test

  1.  Configure the Anthropic plugin.
  2.  Enable the "Web Search Tool Enabled" option during setup.
  3.  Optionally, specify a "Web Search Tool Location".
  4.  Interact with the Anthropic model and observe if it utilizes web search for relevant queries.

commits:
  [{"SHA":"9d4f7f157107be20e2c8a9f8b79b1833e4cf4321","Message":"fix: fix web search tool location","Author":"Eugen Eisler"}]


title: Refactor: No more web scraping, just use yt-dlp
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1507
merged_at: 2025-06-11 21:43:33+00:00
created_at: 2025-07-16 04:25:34
body:
  # Refactor: No more web scraping, just use yt-dlp

  ## Summary

  This PR modernizes the YouTube transcript extraction by replacing the unreliable web scraping approach with a robust `yt-dlp`-based implementation.

  The changes remove the old HTML parsing logic that was prone to breaking due to YouTube's frequent UI changes and instead leverage yt-dlp's stable transcript extraction capabilities.

  ## Related Issues

  Closes #1498
  Closes #1395 

  ## Files Changed

  ### `plugins/tools/youtube/youtube.go`
  - **Modified**: Completely refactored the transcript extraction logic
  - **Removed**: Dependencies on web scraping (`github.com/anaskhan96/soup`) and manual JSON parsing
  - **Added**: Integration with yt-dlp command-line tool for reliable transcript extraction
  - **Enhanced**: Added comprehensive documentation explaining the implementation approach

  ## Code Changes

  ### Key Removals
  ```go
  - import "encoding/json"
  - import "net/url"
  - import "github.com/anaskhan96/soup"
  ```
  The removal of these imports indicates the elimination of the HTML scraping and manual JSON parsing approach.

  ### New Implementation Approach
  ```go
  +func (o *YouTube) tryMethodYtDlp(videoId string, language string) (ret string, err error) {
  +	// Check if yt-dlp is available
  +	if _, err = exec.LookPath("yt-dlp"); err != nil {
  +		err = fmt.Errorf("yt-dlp not found in PATH. Please install yt-dlp to use YouTube transcript functionality")
  +		return
  +	}
  ```
  The new implementation uses yt-dlp as an external dependency, providing clear error messages when it's not installed.

  ### VTT File Processing
  ```go
  +func (o *YouTube) readAndCleanVTTFile(filename string) (ret string, err error) {
  +	// Convert VTT to plain text
  +	lines := strings.Split(string(content), "\n")
  +	var textBuilder strings.Builder
  +	
  +	for _, line := range lines {
  +		// Skip WEBVTT header, timestamps, and empty lines
  +		if line == "" || line == "WEBVTT" || strings.Contains(line, "-->") ||
  +			strings.HasPrefix(line, "NOTE") || strings.HasPrefix(line, "STYLE") ||
  +			strings.HasPrefix(line, "Kind:") || strings.HasPrefix(line, "Language:") ||
  +			isTimeStamp(line) {
  +			continue
  +		}
  ```
  Added robust VTT (WebVTT) file parsing with proper filtering of metadata and formatting tags.

  ## Reason for Changes

  1. **Reliability**: YouTube frequently changes their web interface, causing the HTML scraping approach to break regularly. The old implementation relied on finding specific script tags and parsing JSON from the HTML, which was fragile.

  2. **Maintenance**: Using yt-dlp offloads the complexity of dealing with YouTube's changes to a well-maintained external tool that specializes in this functionality.

  3. **Feature Completeness**: yt-dlp provides better support for various subtitle formats and languages, making the implementation more robust.

  4. **Error Handling**: The new implementation provides clearer error messages, especially when yt-dlp is not installed.

  ## Impact of Changes

  ### Positive Impacts
  - **Stability**: Transcript extraction will be more reliable and less likely to break
  - **Performance**: Eliminates the need to parse large HTML pages
  - **Maintainability**: Reduces the codebase complexity by removing custom parsing logic
  - **User Experience**: Better error messages guide users to install required dependencies

  ### Potential Considerations
  - **External Dependency**: Users now need to install yt-dlp separately
  - **Breaking Change**: This is a complete rewrite of the transcript extraction logic
  - **Temporary Files**: The implementation creates temporary directories for yt-dlp output (properly cleaned up)

  ## Test Plan

  1. **Basic Functionality**: Test transcript extraction with various YouTube video IDs
  2. **Language Support**: Verify that language-specific transcript extraction works correctly
  3. **Error Handling**: Test behavior when yt-dlp is not installed
  4. **Timestamp Support**: Verify that `GrabTranscriptWithTimestamps` correctly formats timestamps
  5. **Edge Cases**: Test with videos that have no transcripts, multiple subtitle tracks, or auto-generated captions

  ```plaintext
  $ fabric -y "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --transcript-with-timestamps
  [00:00:00] [Music]
  [00:00:18] We're no strangers to
  [00:00:21] We're no strangers to
  [00:00:21] We're no strangers to
  [00:00:21] love. You know the rules and so do
  [00:00:25] love. You know the rules and so do
  [00:00:25] love. You know the rules and so do
  [00:00:25] I. I feel commitments from what I'm
  [00:00:29] I. I feel commitments from what I'm
  [00:00:29] I. I feel commitments from what I'm
  [00:00:29] thinking
  [00:00:30] thinking
  [00:00:30] thinking
  [00:00:30] of. You wouldn't get this from any other
  [00:00:34] of. You wouldn't get this from any other
  [00:00:34] of. You wouldn't get this from any other
  ```

  ## Additional Notes

  - The implementation maintains backward compatibility with the existing API
  - Temporary files are created in `/tmp/fabric-youtube-{videoId}` and are properly cleaned up
  - The VTT parsing logic handles various edge cases including formatting tags and metadata
  - Users will need to install yt-dlp separately (`pip install yt-dlp` or through their package manager)
  - The old `GrabTranscriptBase` method has been completely removed as it's no longer needed

commits:
  [{"SHA":"704ad3067a9aba4cc88cceb52413cb4701d60052","Message":"refactor: replace web scraping with yt-dlp for YouTube transcript extraction\n\n## CHANGES\n\n- Remove unreliable YouTube API scraping methods\n- Add yt-dlp integration for transcript extraction\n- Implement VTT subtitle parsing functionality\n- Add timestamp preservation for transcripts\n- Remove soup HTML parsing dependency\n- Add error handling for missing yt-dlp\n- Create temporary directory management\n- Support multiple subtitle format fallbacks","Author":"Kayvan Sylvan"}]


title: feat: cleanup after `yt-dlp` addition
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1508
merged_at: 2025-06-12 02:32:30+00:00
created_at: 2025-07-16 04:25:34
body:
  # feat: cleanup after `yt-dlp` addition

  ## Summary

  This PR updates Fabric's YouTube functionality to clarify that `yt-dlp` is now the primary requirement for transcript extraction, while the YouTube API key is only needed for optional features like comments and metadata extraction.

  ## Files Changed

  ### README.md
  Added a new update note to inform users about the YouTube transcription changes and requirements.

  ### plugins/tools/youtube/youtube.go
  - Updated package documentation to clarify requirements
  - Modified setup description to be more explicit about what each component does
  - Added validation to ensure API key is present when needed for comments/metadata
  - Removed unnecessary service initialization from `GetVideoOrPlaylistId`

  ## Code Changes

  ### README.md
  ```diff
  +>June 11, 2025
  +>
  +> - Fabric's YouTube transcription now needs `yt-dlp` to be installed. Make sure to install the latest
  +>   version (2025.06.09 as of this note). The YouTube API key is only needed for comments (the `--comments` flag)
  +>   and metadata extraction (the `--metadata` flag).
  ```

  ### plugins/tools/youtube/youtube.go

  **Package Documentation Update:**
  ```diff
   // Package youtube provides YouTube video transcript and comment extraction functionality.
  -// This implementation relies on yt-dlp for reliable transcript extraction, which must be
  -// installed separately. The old YouTube API scraping methods have been removed due to
  -// YouTube's frequent changes and rate limiting.
  +//
  +// Requirements:
  +// - yt-dlp: Required for transcript extraction (must be installed separately)
  +// - YouTube API key: Optional, only needed for comments and metadata extraction
  +//
  +// The implementation uses yt-dlp for reliable transcript extraction and the YouTube API
  +// for comments/metadata. Old YouTube scraping methods have been removed due to
  +// frequent changes and rate limiting.
  ```

  **Setup Description Clarification:**
  ```diff
  -SetupDescription: label + " - to grab video transcripts and comments",
  +SetupDescription: label + " - to grab video transcripts (via yt-dlp) and comments/metadata (via YouTube API)",
  ```

  **API Key Validation:**
  ```diff
   func (o *YouTube) initService() (err error) {
   	if o.service == nil {
  +		if o.ApiKey.Value == "" {
  +			err = fmt.Errorf("YouTube API key required for comments and metadata. Run 'fabric --setup' to configure")
  +			return
  +		}
  ```

  **Removed Unnecessary Service Initialization:**
  ```diff
   func (o *YouTube) GetVideoOrPlaylistId(url string) (videoId string, playlistId string, err error) {
  -	if err = o.initService(); err != nil {
  -		return
  -	}
  -
  ```

  ## Reason for Changes

  These changes address user confusion about YouTube functionality requirements. Previously, users might assume they needed a YouTube API key for all features, when in fact:
  - Transcript extraction only requires `yt-dlp` (no API key needed)
  - Only comments and metadata extraction require the YouTube API key

  This separation allows users who only need transcripts to use the tool without obtaining an API key.

  ## Impact of Changes

  1. **Improved User Experience**: Users can now use transcript extraction without needing to set up a YouTube API key
  2. **Clearer Error Messages**: When API key is required but missing, users get a helpful error message
  3. **Better Documentation**: Both code comments and README clearly explain what's required for each feature
  4. **Performance**: Slight improvement by not initializing the YouTube service when just parsing video IDs

  ## Test Plan

  1. Test transcript extraction without API key configured - should work with yt-dlp
  2. Test comments extraction without API key - should fail with clear error message
  3. Test metadata extraction without API key - should fail with clear error message
  4. Test all features with API key configured - should work as before
  5. Verify `GetVideoOrPlaylistId` works without initializing the service

  ## Additional Notes

  - Users upgrading should ensure they have the latest version of `yt-dlp` (2025.06.09 or later)
  - This change maintains backward compatibility for users who have API keys configured
  - The error message directs users to run `fabric --setup` if they need to configure an API key

  ## Screenshot of new setup

  ![image](https://github.com/user-attachments/assets/78d4f0fc-b97a-49a7-a8b8-3ba7d4eaa5b8)

commits:
  [{"SHA":"2dfd78ef0bc1c71ffd490b1d3a9964a8bf487fda","Message":"feat: cleanup after `yt-dlp` addition\n\n### CHANGES\n- Update README with yt-dlp requirement for transcripts\n- Ensure the errors are clear and actionable.","Author":"Kayvan Sylvan"}]


title: Cross-Platform fix for Youtube Transcript extraction
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1510
merged_at: 2025-06-12 05:45:38+00:00
created_at: 2025-07-16 04:25:34
body:
  # Cross-Platform fix for Youtube Transcript extraction

  ## Summary

  This PR enhances the YouTube plugin's cross-platform compatibility by replacing Unix-specific file operations with Go's standard library functions. The main changes involve using `filepath` for path operations and implementing a custom VTT file discovery function that works across different operating systems.

  ## Related Issues

  Fixes #1509 

  ## Files Changed

  ### `plugins/tools/youtube/youtube.go`
  - Added import for `path/filepath` package
  - Modified temporary directory creation to use `os.TempDir()` and `filepath.Join()`
  - Replaced Unix `find` command with a custom Go function for locating VTT files
  - Updated file path construction throughout to use platform-agnostic methods

  ## Code Changes

  ### Import Addition
  ```go
  +       "path/filepath"
  ```
  Added the `filepath` package to handle file paths in a cross-platform manner.

  ### Temporary Directory Creation
  ```go
  -       tempDir := "/tmp/fabric-youtube-" + videoId
  +       tempDir := filepath.Join(os.TempDir(), "fabric-youtube-"+videoId)
  ```
  Changed from hardcoded `/tmp` directory to using `os.TempDir()`, which returns the appropriate temporary directory for the current OS (e.g., `/tmp` on Unix, `%TEMP%` on Windows).

  ### Output Path Construction
  ```go
  +       outputPath := filepath.Join(tempDir, "%(title)s.%(ext)s")
  ```
  ```go
  -               "-o", tempDir+"/%(title)s.%(ext)s",
  +               "-o", outputPath,
  ```
  Replaced string concatenation with `filepath.Join()` to ensure proper path separators are used.

  ### VTT File Discovery
  Replaced the Unix-specific `find` command execution:
  ```go
  -       cmd2 := exec.Command("find", tempDir, "-name", "*."+language+".vtt", "-type", "f")
  -       var findOut bytes.Buffer
  -       cmd2.Stdout = &findOut
  ...
  +       vttFiles, err := o.findVTTFiles(tempDir, language)
  +       if err != nil {
  +               return "", err
          }
  ```

  ### New Helper Function
  ```go
  +func (o *YouTube) findVTTFiles(dir, language string) ([]string, error) {
  +       var vttFiles []string
  +
  +       err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
  +               if err != nil {
  +                       return err
  +               }
  +
  +               if !info.IsDir() && strings.HasSuffix(strings.ToLower(path), ".vtt") {
  +                       vttFiles = append(vttFiles, path)
  +               }
  +               return nil
  +       })
  ...
  +}
  ```
  Implemented a cross-platform file discovery function using `filepath.Walk()` that:
  - Recursively searches for VTT files in the specified directory
  - Prioritizes language-specific files (e.g., `*.en.vtt` for English)
  - Falls back to any VTT file if no language-specific file is found

  ## Reason for Changes

  The previous implementation relied on Unix-specific commands and paths:
  1. Hardcoded `/tmp` directory path wouldn't work on Windows
  2. The `find` command is not available on Windows systems
  3. Path separators were hardcoded as forward slashes

  These limitations prevented the YouTube plugin from functioning correctly on non-Unix systems, particularly Windows.

  ## Impact of Changes

  1. **Cross-platform Compatibility**: The plugin now works on Windows, macOS, and Linux without modification
  2. **Improved Reliability**: Using Go's standard library functions is more reliable than shelling out to system commands
  3. **Better Error Handling**: The new `findVTTFiles` function provides clearer error messages
  4. **No Breaking Changes**: The functionality remains identical for existing Unix users

  ## Test Plan

  Test on different operating systems:
     - Linux: Verify existing functionality is preserved ✅
     - macOS: Ensure proper temp directory usage ✅
     - Windows: Confirm all file operations work correctly ✅

  ![image](https://github.com/user-attachments/assets/f602908c-9368-4bb0-a596-cd989d9d0b29)


  ## Additional Notes

  - The changes maintain backward compatibility while extending platform support
  - The new `findVTTFiles` function is more maintainable than the previous shell command approach
  - Performance impact is negligible as `filepath.Walk` is efficient for small directory trees
  - Consider adding unit tests for the `findVTTFiles` function in a future PR

commits:
  [{"SHA":"680febbe669dfd55b7c19696709a69dcd4f02227","Message":"*fix: replace Unix-specific file operations with cross-platform alternatives\n\n## CHANGES\n\n- Replace hardcoded `/tmp` with `os.TempDir()` for paths\n- Use `filepath.Join()` instead of string concatenation\n- Remove Unix `find` command dependency completely\n- Add new `findVTTFiles()` method using `filepath.Walk()`\n- Make VTT file discovery work on Windows\n- Improve error handling for file operations\n- Maintain backward compatibility with existing functionality","Author":"Kayvan Sylvan"}]


title: feat:Add support for Amazon Bedrock
author: ConnorKirk
author_url: https://github.com/ConnorKirk
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1512
merged_at: 2025-06-14 05:59:41+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This PR adds support for using [Amazon Bedrock](https://aws.amazon.com/bedrock/) within fabric.

  Users can select models provided by Bedrock for use within Fabric. 

  ## Notes

  ### Models

  I was unsure whether to hardcode the list of available models, or retrieving them from AWS. Both approaches have trade offs. Hardcoding the models is faster, as I couldn't see a good way to cache models (or easily clear the cache). It means that newer models will need to be added via PR, and some listed models might not be available for users.

  It's possible to dynamically generate the list of available models using `ListInferenceProfiles` and `ListFoundationModels`. This could take a few seconds, so would be a poor experience for users unless it is cached. The advantage would be that the list of models returned would be specific to the user.

  ### Authorisation

  AWS has a standard credential provider that the SDKs and CLI uses. I opted to use this, rather than prompting the user for the credentials with fabric. If a user already has credentials for AWS configured, these will be detected and used automatically.

  [AWS Credential Provider](https://docs.aws.amazon.com/sdkref/latest/guide/standardized-credentials.html)


  ### User Agent

  The AWS SDK client has an extra key appended to the user agent. This helps track the impact of this work. I'm happy to remove it if preferred.


  ### Not included
  * Only supports text content. Doesn't support multimodel content such as images.
  * Doesn't support custom models
  * Doesn't support Bedrock specific features like Guardrails or Prompt caching.

  ## Related issues

  closes #1500

commits:
  [{"SHA":"d32a1d6a5a03a91f78d14fc9a32911571c00e3f4","Message":"Add Bedrock plugin\n\nThis commits adds support for using Amazon Bedrock within fabric.","Author":"Connor Kirkpatrick"}]


title: feat: create mnemonic phrase pattern
author: marcas756
author_url: https://github.com/marcas756
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1513
merged_at: 2025-06-14 05:53:05+00:00
created_at: 2025-07-16 04:25:34
body:
  # Pull Request Description

  ## Summary

  This pull request introduces a new pattern for generating mnemonic phrases from Diceware words. It includes three markdown files: `disclaimer.md`, `readme.md`, and `system.md`. These files collectively provide legal disclaimers, an overview of the feature, and implementation details.

  ## Files Changed

  ### `patterns/create_mnemonic_phrases/readme.md`

  **Description**: Provides an overview of the mnemonic phrase creation pattern. It explains its purpose and offers guidance on how to use it.

  ### `patterns/create_mnemonic_phrases/system.md`

  **Description**: Details how to implement the mnemonic phrase generation. It specifies that given words should be outputted in order and highlighted, followed by five short mnemonic sentences.

  ## Reason for Changes

  The primary motivation behind these changes is to introduce a new functionality that allows users to generate mnemonic phrases from Diceware words. This feature is particularly useful in security contexts where strong passphrases are required, as it enhances memorability while maintaining the integrity and order of chosen words.

  ## Impact of Changes

  - **Functionality**: Users now have an additional tool for generating secure and memorable mnemonic phrases.
  - **User Guidance**: The `readme.md` provides clear instructions on how to use this new feature effectively.
  - **Implementation Details**: The `system.md` file offers detailed guidance on implementing the pattern, ensuring consistency and ease of integration.

commits:
  [{"SHA":"a96ddbeef0d065d1571bc1c743d53d8921253fbc","Message":"feat: create mnemonic phrase pattern\n\nAdd a new pattern for generating mnemonic phrases from diceware words. This includes two markdown files defining the user guide, and system implementation details.","Author":"Marco Bacchi"}]


title: Fix REST API pattern creation
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1516
merged_at: 2025-06-14 05:52:06+00:00
created_at: 2025-07-16 04:25:34
body:
  # Fix REST API pattern creation

  ## Summary

  This PR adds a `Save` method to the `PatternsEntity` struct in the FSDB (filesystem database) plugin, enabling programmatic creation and storage of patterns. The implementation includes comprehensive unit tests to ensure reliability.

  ## Related issues
  Closes #1515 

  ## Files Changed

  - **plugins/db/fsdb/patterns.go**: Added a new `Save` method to persist pattern content to the filesystem
  - **plugins/db/fsdb/patterns_test.go**: Added unit tests for the new `Save` method

  ## Code Changes

  ### plugins/db/fsdb/patterns.go

  Added a new method to save patterns:

  ```go
  func (o *PatternsEntity) Save(name string, content []byte) (err error) {
  	patternDir := filepath.Join(o.Dir, name)
  	if err = os.MkdirAll(patternDir, os.ModePerm); err != nil {
  		return fmt.Errorf("could not create pattern directory: %v", err)
  	}
  	patternPath := filepath.Join(patternDir, o.SystemPatternFile)
  	if err = os.WriteFile(patternPath, content, 0644); err != nil {
  		return fmt.Errorf("could not save pattern: %v", err)
  	}
  	return nil
  }
  ```

  The method:
  1. Creates the pattern directory structure using `os.MkdirAll` with full permissions
  2. Writes the pattern content to the system pattern file within that directory
  3. Returns descriptive errors if any operation fails

  ### plugins/db/fsdb/patterns_test.go

  Added comprehensive test coverage:

  ```go
  func TestPatternsEntity_Save(t *testing.T) {
  	entity, cleanup := setupTestPatternsEntity(t)
  	defer cleanup()

  	name := "new-pattern"
  	content := []byte("test pattern content")
  	require.NoError(t, entity.Save(name, content))

  	patternDir := filepath.Join(entity.Dir, name)
  	info, err := os.Stat(patternDir)
  	require.NoError(t, err)
  	assert.True(t, info.IsDir())

  	data, err := os.ReadFile(filepath.Join(patternDir, entity.SystemPatternFile))
  	require.NoError(t, err)
  	assert.Equal(t, content, data)
  }
  ```

  The test verifies:
  1. The pattern directory is created successfully
  2. The directory has the correct type (is a directory)
  3. The pattern content is written correctly to the system pattern file

  ## Reason for Changes

  This enhancement addresses the need to programmatically create and save patterns within the FSDB system. Previously, the `PatternsEntity` only supported reading patterns through methods like `Get` and `GetApplyVariables`. The new `Save` method completes the CRUD operations by enabling pattern creation and updates.

  ## Impact of Changes

  - **Functionality**: Applications can now create and modify patterns programmatically without direct filesystem manipulation
  - **API Completeness**: The `PatternsEntity` now offers both read and write operations, making it a more complete abstraction
  - **Backward Compatibility**: This is a purely additive change with no modifications to existing methods or behavior
  - **Error Handling**: The implementation includes proper error handling with descriptive messages for debugging

  ## Test Plan

  The changes include a comprehensive unit test that:
  - Uses the existing test setup infrastructure (`setupTestPatternsEntity`)
  - Verifies directory creation
  - Confirms file content is written correctly
  - Ensures proper cleanup after test execution

  The test can be run using: `go test ./plugins/db/fsdb -run TestPatternsEntity_Save`

  ## Additional Notes

  - The method uses `os.ModePerm` (0777) for directory creation, which may need review based on security requirements
  - File permissions are set to 0644 (read/write for owner, read-only for others)
  - The implementation follows the existing error handling patterns in the codebase with wrapped error messages
  - Consider adding validation for the pattern name to prevent path traversal vulnerabilities in future iterations

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/d9a70f90-fcc1-41d7-91bd-93e758b01cfc)

  ![image](https://github.com/user-attachments/assets/e15790af-069d-4d3a-95dd-b03d340ab8fa)

commits:
  [{"SHA":"d9d8f7bf965866642a71aff5206efc4b3c1a24c6","Message":"feat: add Save method to PatternsEntity for persisting patterns to filesystem\n\n## CHANGES\n\n- Add Save method to PatternsEntity struct\n- Create pattern directory with proper permissions\n- Write pattern content to system pattern file\n- Add comprehensive test for Save functionality\n- Verify directory creation and file contents\n- Handle errors for directory and file operations","Author":"Kayvan Sylvan"}]


title: Fix: Prevent race conditions in versioning workflow.
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1517
merged_at: 2025-06-15 05:51:39+00:00
created_at: 2025-07-16 04:25:34
body:
  # Fix: Prevent race conditions in versioning workflow.

  ## Summary

  This PR adds concurrency control and improves git synchronization to the GitHub Actions workflow that handles automatic version updates and tag creation. The changes prevent race conditions when multiple workflow runs are triggered and ensure the workflow always operates on the latest state of the repository.

  ## Related Issues

  Closes #1501 

  ## Files Changed

  - **.github/workflows/update-version-and-create-tag.yml**: Added concurrency group configuration and enhanced git synchronization steps to prevent conflicts and ensure the workflow operates on the latest repository state.

  ## Code Changes

  ### .github/workflows/update-version-and-create-tag.yml

  #### Added concurrency control:
  ```yaml
  concurrency:
    group: version-update
    cancel-in-progress: false
  ```
  This ensures only one instance of the version update workflow runs at a time, preventing race conditions when multiple commits trigger the workflow simultaneously.

  #### Added git synchronization step:
  ```yaml
  - name: Pull latest main and tags
    run: |
      git pull --rebase origin main
      git fetch --tags
  ```
  This new step ensures the workflow has the latest changes from the main branch and all tags before attempting to create a new version tag.

  ## Reason for Changes

  These changes address potential race conditions and synchronization issues in the automated versioning workflow:

  1. **Concurrency Control**: Without concurrency limits, multiple workflow runs could execute simultaneously (e.g., from rapid successive merges), potentially creating duplicate tags or version conflicts.

  2. **Git Synchronization**: The workflow needs to ensure it has the latest state of the repository before determining the next version number and creating tags, especially important when multiple PRs are merged in quick succession.

  ## Impact of Changes

  - **Improved Reliability**: The workflow will now handle rapid successive merges more reliably without creating duplicate tags or version conflicts.
  - **Sequential Processing**: Version updates will be processed sequentially rather than in parallel, ensuring consistent version numbering.
  - **No Workflow Cancellation**: Setting `cancel-in-progress: false` ensures that once a version update starts, it will complete even if another trigger occurs.
  - **Better State Management**: The workflow will always operate on the most current repository state, reducing the chance of conflicts during tag creation.

  ## Test Plan

  1. Merge multiple PRs in quick succession to verify only one version update runs at a time
  2. Verify that the workflow correctly pulls the latest changes before creating new tags
  3. Confirm that version numbers increment correctly without gaps or duplicates
  4. Test that the workflow handles scenarios where tags have been created externally between workflow runs

  ## Concurrent PR Merge Process

  The diagram below illustrates how the `update-version-and-create-tag` workflow behaves when multiple pull requests are merged into `main` at nearly the same time.

  ```mermaid
  flowchart TD
      subgraph Merge Events
          PR1[PR 1 merges] --> WF1[Workflow Run 1]
          PR2[PR 2 merges] --> WF2[Workflow Run 2]
      end

      subgraph GitHub Actions
          WF1 --> Checkout1[Checkout repo]
          WF2 -. queued .-> Wait[Waiting for concurrency slot]
          Checkout1 --> Rebase1[Rebase & fetch tags]
          Rebase1 --> Version1[Compute new tag]
          Version1 --> Commit1[Commit & push]
          Commit1 --> Complete1[Run 1 complete]
          Wait --> Checkout2[Checkout repo]
          Checkout2 --> Rebase2[Rebase & fetch tags]
          Rebase2 --> Version2[Compute new tag]
          Version2 --> Commit2[Commit & push]
          Commit2 --> Complete2[Run 2 complete]
      end
  ```

  The concurrency settings ensure that while Workflow Run 1 is executing, Workflow Run 2 is paused. Once Run 1 finishes updating the version and pushing the tag, Run 2 resumes and rebases on the latest `main` so that it can apply its own version bump safely.


  ## Additional Notes

  - The concurrency group name "version-update" is unique to this workflow, preventing interference with other workflows
  - The `cancel-in-progress: false` setting is crucial here as we don't want to cancel a version update that's already in progress
  - The git pull uses `--rebase` to maintain a clean history when pulling the latest changes

commits:
  [{"SHA":"ca3e89a889991078687b2f3a201b34fcb4cfcfed","Message":"ci: improve version update workflow to prevent race conditions\n\n### CHANGES\n\n- Add concurrency control to prevent simultaneous runs\n- Pull latest main branch changes before tagging\n- Fetch all remote tags before calculating version","Author":"Kayvan Sylvan"}]


title: chore: remove duplicate/outdated patterns
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1518
merged_at: 2025-06-15 19:56:31+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does

  Delete old/outdated versions of patterns.

  ## Related issues

  closes #1469 

  ## Screenshots

  ```text
   8 files changed, 116 deletions(-)
   delete mode 100644 patterns/extract_article_wisdom/dmiessler/extract_wisdom-1.0.0/system.md
   delete mode 100644 patterns/extract_article_wisdom/dmiessler/extract_wisdom-1.0.0/user.md
   delete mode 100644 patterns/extract_product_features/dmiessler/extract_wisdom-1.0.0/system.md
   delete mode 100644 patterns/extract_product_features/dmiessler/extract_wisdom-1.0.0/user.md
   delete mode 100644 patterns/extract_wisdom/dmiessler/extract_wisdom-1.0.0/system.md
   delete mode 100644 patterns/extract_wisdom/dmiessler/extract_wisdom-1.0.0/user.md
   delete mode 100644 patterns/summarize/dmiessler/summarize/system.md
   delete mode 100644 patterns/summarize/dmiessler/summarize/user.md
   ```

commits:
  [{"SHA":"11a7e542e1a7534672dff66c5fa032442ce16c3d","Message":"chore: remove duplicate/outdated patterns","Author":"Kayvan Sylvan"}]


title: feat: Dynamically list AWS Bedrock models
author: ConnorKirk
author_url: https://github.com/ConnorKirk
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1519
merged_at: 2025-06-16 13:24:54+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This PR updates the Bedrock plugin to fetch the available foundation models and inference providers.



  The advantage of this approach is that the list of models is correct for the user. The downside is that it involves atleast two network requests/

  ## Related issues
  This is a follow up PR for a change requested in #1512 

commits:
  [{"SHA":"76b889733d5205d3c459c34d5b9c5ed8e9718119","Message":"Dynamically fetch and list available foundation models and inference profiles","Author":"Connor Kirkpatrick"}]


title: Conditional AWS Bedrock Plugin Initialization
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1523
merged_at: 2025-06-16 23:10:59+00:00
created_at: 2025-07-16 04:25:34
body:
  # Conditional AWS Bedrock Plugin Initialization

  ## Summary

  The Bedrock plugin is now initialized only when AWS credentials are found in environment variables or the standard `~/.aws/credentials` file. This is achieved by adding a pre-check function, `hasAWSCredentials()`, which is called before the Bedrock client is added to the list of available vendors.

  ## Related Issues 

  Closes #1521 

  ## Files Changed

  *   `core/plugin_registry.go`: Modified to include the credential check and conditionally register the Bedrock plugin.

  ## Code Changes

  A new private helper function, `hasAWSCredentials`, has been added to check for the presence of AWS credentials without validating them.

  ```go
  // core/plugin_registry.go

  // hasAWSCredentials checks if any AWS credentials are present either in the
  // environment variables or in the default/shared credentials file. It doesn't
  // attempt to verify the validity of the credentials, but simply ensures that a
  // potential authentication source exists so we can safely initialize the
  // Bedrock client without causing the AWS SDK to search for credentials.
  func hasAWSCredentials() bool {
          if os.Getenv("AWS_ACCESS_KEY_ID") != "" && os.Getenv("AWS_SECRET_ACCESS_KEY") != "" {
                  return true
          }

          credFile := os.Getenv("AWS_SHARED_CREDENTIALS_FILE")
          if credFile == "" {
                  if home, err := os.UserHomeDir(); err == nil {
                          credFile = filepath.Join(home, ".aws", "credentials")
                  }
          }
          if credFile != "" {
                  if _, err := os.Stat(credFile); err == nil {
                          return true
                  }
          }
          return false
  }
  ```

  The `NewPluginRegistry` function was updated to use this check, ensuring the Bedrock client is only instantiated when needed.

  ```go
  // core/plugin_registry.go

  func NewPluginRegistry(db *fsdb.Db) (ret *PluginRegistry, err error) {
      // ... (initialization)
          vendors = append(vendors,
                  openai.NewClient(),
                  google.NewClient(),
                  anthropic.NewClient(),
                  lmstudio.NewClient(),
                  exolab.NewClient(),
  -               bedrock.NewClient(),
          )

  +       if hasAWSCredentials() {
  +               vendors = append(vendors, bedrock.NewClient())
  +       }

      // ... (rest of the function)
  }
  ```

  ## Reason for Changes

  The AWS SDK for Go, when initialized without any credentials present, can cause significant startup delays or panics as it searches the environment for a valid authentication method. This behavior negatively impacts the user experience for anyone not using AWS services, as the application startup is noticeably slower.

  By performing a lightweight, non-blocking check for credentials *before* initializing the Bedrock client, we can avoid this issue entirely. This makes the application startup faster and more reliable for the majority of users while retaining full functionality for those who use AWS Bedrock.

  ## Impact of Changes

  *   **For users without AWS credentials:** Application startup will be faster and will no longer hang or error out due to the AWS SDK's credential search. The Bedrock provider will not be available to them, which is the expected behavior.
  *   **For users with AWS credentials:** There is no change in functionality. The Bedrock provider will be registered and available for use as before.

  ## Test Plan

  The changes can be verified with the following scenarios:

  1.  **No AWS Credentials**:
      *   Ensure no `AWS_*` environment variables are set and no `~/.aws/credentials` file exists.
      *   Run the application.
      *   **Expected Result**: The application starts quickly without errors. The Bedrock model provider is not listed as an available option.
  2.  **Credentials via Environment Variables**:
      *   Export `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` with dummy values.
      *   Run the application.
      *   **Expected Result**: The application starts, and the Bedrock model provider is available.
  3.  **Credentials via File**:
      *   Create a dummy `~/.aws/credentials` file.
      *   Run the application.
      *   **Expected Result**: The application starts, and the Bedrock model provider is available.

  ## Potential Bugs / Limitations

  The `hasAWSCredentials` check is intentionally simple and does not cover all possible AWS authentication methods (e.g., IAM roles for EC2/ECS instances). In such environments, the Bedrock plugin may not be loaded automatically. This is considered an acceptable trade-off to improve the default experience for most users. Users in those environments can still force-enable the plugin by setting dummy `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables to satisfy the check, allowing the SDK to proceed with its standard credential chain evaluation.

commits:
  [{"SHA":"44b5c46bebb0d6944cdab28048e810f23c4cb6c1","Message":"feat: add AWS credential detection for Bedrock client initialization\n\n## CHANGES\n\n- Add hasAWSCredentials helper function\n- Check for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY\n- Look for AWS shared credentials file\n- Support custom AWS_SHARED_CREDENTIALS_FILE path\n- Default to ~/.aws/credentials location\n- Only initialize Bedrock client if credentials exist\n- Prevent AWS SDK credential search failures","Author":"Kayvan Sylvan"}]


title: Refactor yt-dlp Transcript Logic and Fix Language Bug
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1525
merged_at: 2025-06-17 07:40:18+00:00
created_at: 2025-07-16 04:25:34
body:
  # Refactor yt-dlp Transcript Logic and Fix Language Bug

  ## Summary

  This pull request refactors the `yt-dlp` transcript fetching logic within the YouTube tool to eliminate significant code duplication. A new internal helper function has been introduced to house the common logic, and a bug related to language code handling for `yt-dlp` has been fixed.

  ## Related Issues

  Closes #1524 

  ## Files Changed

  *   **`plugins/tools/youtube/youtube.go`**: Modified to refactor the transcript fetching methods.

  ## Code Changes

  The primary change is the consolidation of logic from `tryMethodYtDlp` and `tryMethodYtDlpWithTimestamps` into a single internal function, `tryMethodYtDlpInternal`.

  1.  **Introduction of `tryMethodYtDlpInternal`**

      A new private function, `tryMethodYtDlpInternal`, has been created. This function contains the shared logic for checking for the `yt-dlp` executable, creating a temporary directory, and invoking the `yt-dlp` command. It accepts a function as an argument (`processVTTFileFunc`) to handle the final processing of the downloaded VTT file, which is the only part that differed between the original two methods.

      ```go
      // tryMethodYtDlpInternal is a helper function to reduce duplication between
      // tryMethodYtDlp and tryMethodYtDlpWithTimestamps.
      func (o *YouTube) tryMethodYtDlpInternal(videoId string, language string, processVTTFileFunc func(filename string) (string, error)) (ret string, err error) {
          // ... common logic to set up and run yt-dlp ...
          
          // Find VTT files using cross-platform approach
          vttFiles, err := o.findVTTFiles(tempDir, language)
          if err != nil {
              return "", err
          }
      
          return processVTTFileFunc(vttFiles[0])
      }
      ```

  2.  **Refactoring of Public Methods**

      The existing methods, `tryMethodYtDlp` and `tryMethodYtDlpWithTimestamps`, have been simplified to be thin wrappers that call the new internal function with the appropriate VTT processing function.

      ```go
      func (o *YouTube) tryMethodYtDlp(videoId string, language string) (ret string, err error) {
          return o.tryMethodYtDlpInternal(videoId, language, o.readAndCleanVTTFile)
      }
      
      func (o *YouTube) tryMethodYtDlpWithTimestamps(videoId string, language string) (ret string, err error) {
          return o.tryMethodYtDlpInternal(videoId, language, o.readAndFormatVTTWithTimestamps)
      }
      ```

  3.  **Language Code Handling Fix**

      A bug was identified where `yt-dlp` would fail if a full language-region code (e.g., `en-US`) was provided instead of a simple two-letter language code (`en`). The logic has been updated to truncate the language string to its first two characters, making the tool more robust.

      ```go
      // Before
      cmd := exec.Command("yt-dlp",
          "--write-auto-subs",
          "--sub-lang", language,
          //...
      )

      // After
      lang_match := language
      if len(language) > 2 {
          lang_match = language[:2]
      }
      cmd := exec.Command("yt-dlp",
          "--write-auto-subs",
          "--sub-lang", lang_match,
          //...
      )
      ```

  ## Reason for Changes

  *   **Code Maintainability**: The previous implementation had nearly identical code blocks in two separate functions. This refactoring adheres to the DRY (Don't Repeat Yourself) principle, making the code easier to read, maintain, and modify in the future. Any changes to the `yt-dlp` invocation logic now only need to be made in one place.
  *   **Bug Fix**: The tool would previously fail to retrieve transcripts if a locale-specific language code like `en-US` was used. The fix ensures that a compatible two-letter language code is passed to `yt-dlp`, improving the tool's reliability.

  ## Impact of Changes

  *   **Functional Impact**: There is no change in the tool's output or external behavior for valid inputs. The functionality for retrieving transcripts both with and without timestamps remains the same. The change improves the success rate for a wider range of language code formats.
  *   **Performance Impact**: No performance impact is expected. The changes are purely structural.
  *   **Maintainability**: The codebase is now cleaner and less prone to errors when modifying the YouTube transcript logic.

  ## Test Plan

  *   Verified that all existing unit tests continue to pass.
  *   Manually tested the tool by providing a video ID and a full language locale (e.g., `en-US`) to confirm that transcripts are now fetched successfully, whereas this would have failed before.
  *   Recommend reviewers to test with various language codes (`en`, `es`, `en-GB`, `fr-FR`) to ensure correctness.

  ## Additional Notes

  This is primarily a refactoring and bug-fix release. No new features are introduced. The core functionality remains unchanged.

commits:
  [{"SHA":"da28d91d65c3c5e1ad9f8acc8a646c04be02e280","Message":"refactor: extract common yt-dlp logic to reduce code duplication in YouTube plugin\n\n## CHANGES\n\n- Extract shared yt-dlp logic into tryMethodYtDlpInternal helper\n- Add processVTTFileFunc parameter for flexible VTT processing\n- Implement language matching for 2-char language codes\n- Refactor tryMethodYtDlp to use new helper function\n- Refactor tryMethodYtDlpWithTimestamps to use helper\n- Reduce code duplication between transcript methods\n- Maintain existing functionality with cleaner structure","Author":"Kayvan Sylvan"}]


title: Check for AWS_PROFILE or AWS_ROLE_SESSION_NAME environment variables
author: ConnorKirk
author_url: https://github.com/ConnorKirk
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1526
merged_at: 2025-06-17 10:17:48+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  This PR updates the `hasAWSCredentials` check with some additional environment variables that indicate AWS Credentials are present.

  ## Related issues
  Extends #1523. Addresses #1521 

commits:
  [{"SHA":"5dd61abe2a1bd01e129f5515b5df8aaebdddb99d","Message":"Check for AWS_PROFILE or AWS_ROLE_SESSION_NAME environment variables","Author":"Connor Kirkpatrick"}]


title: Add Perplexity AI Provider with Token Limits Support
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1527
merged_at: 2025-06-17 10:17:57+00:00
created_at: 2025-07-16 04:25:34
body:
  # Add Perplexity AI Provider with Token Limits Support

  ## Summary

  This PR adds support for Perplexity AI as a new AI provider in the Fabric framework. The implementation includes a complete client integration with support for both standard and streaming chat completions, following the existing plugin architecture patterns.

  ## Related Issues

  Closes #924 
  Closes #1078 

  ## Files Changed

  ### README.md
  - Updated the release notes to announce Perplexity AI support
  - Added example usage command for the new integration
  - Reorganized the update notes chronologically

  ### common/domain.go
  - Added `MaxTokens` field to `ChatOptions` struct to support token limit configuration

  ### core/plugin_registry.go
  - Added import for the new perplexity plugin package
  - Registered the Perplexity client in the plugin registry

  ### go.mod & go.sum
  - Added dependency on `github.com/sgaunet/perplexity-go/v2` v2.8.0 for Perplexity API integration

  ### plugins/ai/perplexity/perplexity.go (New File)
  - Implemented complete Perplexity AI client with support for:
    - Model listing (r1-1776, sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro)
    - Standard chat completions
    - Streaming chat completions
    - Configuration management with API key setup
    - All standard chat options (temperature, top_p, presence/frequency penalties)

  ## Code Changes

  ### Key Implementation Details

  ```go
  // Support for new MaxTokens option in ChatOptions
  type ChatOptions struct {
      // ... existing fields ...
      MaxTokens          int
  }
  ```

  ```go
  // Perplexity client registration
  perplexity.NewClient(), // Added Perplexity client
  ```

  ```go
  // Streaming implementation with proper error handling
  func (c *Client) SendStream(msgs []*goopenai.ChatCompletionMessage, opts *common.ChatOptions, channel chan string) error {
      // ... converts messages and sets up streaming request ...
      go func() {
          err := c.client.SendSSEHTTPRequest(&wg, request, responseChan)
          if err != nil {
              fmt.Fprintf(os.Stderr, "perplexity streaming error: %v\\n", err)
          }
      }()
      // ... processes streaming responses ...
  }
  ```

  ## Reason for Changes

  This change adds support for Perplexity AI, expanding Fabric's AI provider options. Perplexity offers unique models like sonar-pro and r1-1776 that provide real-time web search capabilities and advanced reasoning, which can be valuable for users who need up-to-date information in their AI responses.

  ## Impact of Changes

  1. **New Functionality**: Users can now use Perplexity AI models through Fabric with the same interface as other providers
  2. **No Breaking Changes**: The implementation follows existing patterns and doesn't modify any existing functionality
  3. **Configuration**: Users will need to run `fabric -S` to add their Perplexity API key before using the new models
  4. **Model Selection**: Users can specify Perplexity models using the `-m` flag, e.g., `fabric -m sonar-pro`

  ## Test Plan

  The implementation was tested with

  1. Basic chat completion: `fabric -m sonar "Test message"` ✅
  2. Streaming mode: `fabric -m sonar-pro -s "Stream test"` ✅
  3. With various options: `fabric -m sonar --temperature 0.5 --max-tokens 100 "Test with options"` ✅
  4. API key configuration: `fabric -S` and selecting Perplexity provider ✅
  5. Error handling: Testing with invalid API keys and network failures ✅

  ## Additional Notes

  - The implementation uses `perplexity-go/v2` library, which provides a clean interface to the Perplexity API
  - All standard chat options are supported, maintaining consistency with other AI providers
  - The client includes proper error handling for both standard and streaming modes
  - The `NeedsRawMode` method returns `true`, indicating that Perplexity models work best with raw message formatting

  ## Demo

  ```bash
  fabric -m sonar-pro "What is the latest Tech News about AI? Provide links (with descriptions) for your sources"
  ```

  Produced the following output:

  ###  Latest Tech News About AI (June 2025)

  **Here are some of the most significant recent developments in artificial intelligence, as reported by reputable tech news sources:**

  ---

  **Enterprise AI Security and Development**
  - **Anaconda and Databricks Partnership:**  
    Anaconda has partnered with Databricks to deliver secure, enterprise-grade open source Python packages within the Databricks Data Intelligence Platform. This move aims to enhance dependency management, security, and governance for organizations developing AI solutions. The integration is expected to streamline enterprise workflows by providing a curated Python ecosystem backed by scalable cloud infrastructure[1].

  ---

  **Breakthroughs in Large Language Models & Agents**
  - **Anthropic’s Claude 4 Opus:**  
    Anthropic has released new models—including Claude 4 Opus—that can process entire enterprise code bases at once. Experts say these models now rival experienced human programmers in capability, marking a turning point where AI can be used for sophisticated software development tasks[2].  
    [Read more about Claude 4 Opus on Anthropic's site](https://www.anthropic.com/news/claude-4)
  - **Google’s Internet Agent:**  
    Google launched an Internet agent capable of managing up to ten web-based tasks simultaneously—such as booking flights or making restaurant reservations—directly through a browser interface. This signals a shift towards conversational interfaces where users simply state their needs and let the agent handle everything online[2].  
      - [Learn more about Google’s Mariner Agent](https://labs.google.com/mariner/landing)  

  ---

  **AI Trends Affecting Business & Jobs**
  - Analysts predict that “2025 is going to be the year that people start losing jobs in entry-level operational customer service roles from health to finance to law” due to increasingly capable agents automating routine work[2].

  ---

  **Legal & Regulatory Developments**
  - **AI Industry Targeted for Contractor Misclassification Lawsuits:**  
     There is growing legal scrutiny regarding how companies classify workers involved in AI projects, with lawsuits emerging over independent contractor misclassification within the industry[3].
     - [More details on this legal trend](https://www.independentcontractorcompliance.com/2025/06/16/artificial-intelligence-industry-targeted-for-independent-contractor-misclassification-lawsuits-may-2025-ic-legal-news-update/)
     
  ---

  **Additional Headlines:**
  - Some media outlets have faced criticism after publishing fabricated content generated by AI tools without proper oversight—a reminder of ongoing ethical challenges as generative models become commonplace[2].
      - [See coverage on this issue from The Verge](https://www.theverge.com/ai-artificial-intelligence/670510/chicago-sun-times-ai-generated-reading-list)

  ---
  ### For further reading:
  * [Artificial Intelligence News for June (Solutions Review)](https://solutionsreview.com/artificial-intelligence-news-for-the-week-of-june-12-updates-from-cisco-ibm-new-relic-more/) — Weekly roundup including updates from Cisco, IBM, New Relic & more.
  * [Trends Report (Local Media Association)](https://localmedia.org/2025/06/ai-trends-to-keep-an-eye-on-june-2025/) — In-depth look at broad industry impacts and emerging trends.

  These stories illustrate both rapid technical progress and new societal implications resulting from widespread adoption of advanced artificial intelligence systems.

commits:
  [{"SHA":"b7721277382b1693cb3d3eb267b5b53e21723ee9","Message":"feat: add Perplexity AI provider support with token limits and streaming\n\n## CHANGES\n\n- feat: Add `MaxTokens` field to `ChatOptions` struct for response control\n- feat: Integrate Perplexity client into core plugin registry initialization\n- build: Add perplexity-go/v2 dependency to enable API interactions\n- feat: Implement stream handling in Perpexlty client using sync.WaitGroup\n- fix: Correct parameter types for penalty options in API requests\n## LINKS\n\n\u003chttps://github.com/sgaunet/perlexipty-go\u003e - Client library used","Author":"Kayvan Sylvan"},{"SHA":"19e5d8dbe014915c8bccde6918bb3cbf3bc0ae85","Message":"chore: update README with Perplexity AI support instructions\n\n### CHANGES\n- Add instructions for configuring Perplexity AI with Fabric\n- Include example command for querying Perplexity AI\n- Retain existing instructions for YouTube transcription changes","Author":"Kayvan Sylvan"}]


title: Add Citation Support to Perplexity Response
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1530
merged_at: 2025-06-18 07:38:37+00:00
created_at: 2025-07-16 04:25:34
body:
  # Add Citation Support to Perplexity Response

  ## Summary

  This PR adds citation support to the Perplexity AI plugin, enabling the display of source citations when the Perplexity API returns them in its responses. The changes modify both the synchronous and streaming response handlers to append formatted citations to the output.

  ## Related Issues

  Closes #1529 

  ## Files Changed

  - **plugins/ai/perplexity/perplexity.go**: Modified to extract and format citations from Perplexity API responses in both `Send()` and `SendStream()` methods.

  ## Code Changes

  ### plugins/ai/perplexity/perplexity.go

  #### Send() method changes:
  ```go
  -       return resp.GetLastContent(), nil
  +       content := resp.GetLastContent()
  +
  +       // Append citations if available
  +       citations := resp.GetCitations()
  +       if len(citations) > 0 {
  +               content += "\n\n# CITATIONS\n\n"
  +               for i, citation := range citations {
  +                       content += fmt.Sprintf("- [%d] %s\n", i+1, citation)
  +               }
  +       }
  +
  +       return content, nil
  ```

  #### SendStream() method changes:
  ```go
  +               var lastResponse *perplexity.CompletionResponse
                  for resp := range responseChan {
  +                       lastResponse = &resp
                          // ... existing streaming logic ...
                  }
  +
  +               // Send citations at the end if available
  +               if lastResponse != nil {
  +                       citations := lastResponse.GetCitations()
  +                       if len(citations) > 0 {
  +                               channel <- "\n\n# CITATIONS\n\n"
  +                               for i, citation := range citations {
  +                                       channel <- fmt.Sprintf("- [%d] %s\n", i+1, citation)
  +                               }
  +                       }
  +               }
  ```

  ## Reason for Changes

  The Perplexity API provides citation information along with its responses, which helps users verify the sources of information. Previously, these citations were being discarded. This change ensures that when citations are available, they are properly formatted and displayed to the user, improving transparency and allowing fact-checking of AI-generated responses.

  ## Impact of Changes

  - **Enhanced transparency**: Users can now see the sources that Perplexity used to generate its responses
  - **Better user experience**: Citations are formatted in a consistent, readable manner with numbered references
  - **No breaking changes**: The changes are backward compatible - if no citations are provided, the behavior remains unchanged
  - **Consistent behavior**: Both synchronous and streaming modes now handle citations uniformly

  ## Test Plan

  1. Test synchronous responses (`Send()` method):
     - Verify responses without citations work as before
     - Verify responses with citations append the formatted citation section
     
  2. Test streaming responses (`SendStream()` method):
     - Verify streaming continues to work normally
     - Verify citations are appended at the end of the stream
     - Ensure the channel is properly closed after citations are sent

  3. Edge cases to test:
     - Empty citation arrays
     - Nil response objects
     - Large numbers of citations

  ## Additional Notes

  - The implementation assumes that `GetCitations()` returns a slice of strings. If the citation format changes in the future, this code will need to be updated.
  - Citations are formatted as a markdown list with numbered references for better readability.
  - In streaming mode, citations are sent after all content chunks to avoid interrupting the flow of the main response.
  - The `lastResponse` variable in streaming mode captures the final response object to extract citations, as they may only be available in the last chunk.

  ## Demo

  ### Before fix

  ```markdown
  fabric -m sonar-pro 'What are the top two things happening in Chess today?'
  ## Top Two Things Happening in Chess Today

  **1. WR Chess Defends World Blitz Team Title at 2025 FIDE Championship**

  WR Chess successfully defended their title at the 2025 FIDE World Blitz Team Chess Championship, retaining their crown after a dramatic final[2]. The team clinched two decisive victories (4.5-1.5 and 4-2), with standout performances from Alireza Firouzja—whose games were described as "fun to watch" by Maxime Vachier-Lagrave—and Hikaru Nakamura, who delivered crucial wins against Richard Rapport. The event was marked by high tension: the WR Chess team nearly considered withdrawing but ultimately prevailed, further solidifying their dominance in team blitz chess[2].

  **2. Justin Reid Wins BlitzChamps IV, Becomes First Repeat Champion**

  In another major highlight for chess this week, NFL player Justin Reid made history by becoming the first repeat winner of BlitzChamps IV—a tournament that crowns the best chess player among NFL athletes[1]. Despite his offseason move from the Chiefs to the Saints, Reid's dominance on the board remained unchanged as he defended his title with confidence and skill.

  ---

  These two events—the high-profile victory of WR Chess in a fiercely contested world blitz final and Justin Reid’s unprecedented repeat win in an NFL celebrity tournament—are currently leading headlines in the chess world[1][2].
  ```

  ### After fix

  ```markdown
  fabric -m sonar-pro 'What are the top two things happening in Chess today?'
  ## Top Two Things Happening in Chess Today

  **WR Chess Wins 2025 FIDE World Blitz Team Championship**

  WR Chess has successfully defended its title at the 2025 FIDE World Blitz Team Championship, winning the final with two convincing match scores of 4.5-1.5 and 4-2. Standout performances came from Alireza Firouzja, who delivered entertaining and sharp games, as well as team owner Wadim Rosenstein and Hikaru Nakamura, whose key victories secured the championship. The event was marked by high drama, including a potential protest by WR Chess that was ultimately resolved before play continued[2].

  **American Women Surge at Cairns Cup**

  In elite women’s chess, Americans Alice Lee and Carissa Yip are making headlines at the ongoing Cairns Cup. Alice Lee recently scored a crucial victory against Alina Kashlinskaya to take the lead in this prestigious tournament. This win puts her in strong contention for top honors and could be pivotal for achieving grandmaster norms or further solidifying her status among the world’s leading female players[5].

  These events highlight both team and individual achievements on the global chess stage today: WR Chess's dominance in blitz formats and exciting developments among rising stars in women's chess tournaments.

  # CITATIONS

  - [1] https://www.chess.com/news
  - [2] https://www.chess.com/news/view/wr-chess-wins-2025-fide-world-blitz-team-chess-championship
  - [3] https://www.youtube.com/watch?v=obeelJ891zQ
  - [4] https://theweekinchess.com
  - [5] https://www.youtube.com/watch?v=oNpZ5BfwZCs
  ```

commits:
  [{"SHA":"5da3db383d178d9ee22e58e47f250f98b7966eda","Message":"feat: add citation support to perplexity AI responses\n\n## CHANGES\n\n- Add citation extraction from API responses\n- Append citations section to response content\n- Format citations as numbered markdown list\n- Handle citations in streaming responses\n- Store last response for citation access\n- Add citations after stream completion\n- Maintain backward compatibility with responses","Author":"Kayvan Sylvan"}]


title: REST API and Web UI Now Support Dynamic Pattern Variables
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1533
merged_at: 2025-06-19 21:45:49+00:00
created_at: 2025-07-16 04:25:34
body:
  # REST API and Web UI Now Support Dynamic Pattern Variables

  ## Summary

  This PR adds support for pattern variables in the REST API, allowing users to pass dynamic variables to patterns when making chat requests. This brings the REST API to feature parity with the CLI's pattern variable functionality.

  ## Related Issues

  Closes #1446 

  ## Screenshots

  ### Before fix (on main)

  The translate pattern needs a `lang_code` variable. Note that selecting the pattern does not have it show up in the Web UI.

  ![image](https://github.com/user-attachments/assets/e641e9c4-bb4f-444a-aa6c-b57e02e0db7e)

  ![image](https://github.com/user-attachments/assets/ed84665c-4b83-49fc-97b9-751f55fab04e)

  ### After fix (on PR branch)

  ![image](https://github.com/user-attachments/assets/2348b2de-e40b-400e-b6fd-12b39ae4a4e7)

  ![image](https://github.com/user-attachments/assets/4ca94bc4-f599-4fbe-b5fa-cc86d32d214d)

  ## Files Changed

  ### Modified Files

  #### `restapi/chat.go`
  - Added `Variables` field to `PromptRequest` struct to accept pattern variables from API requests
  - Updated chat handler to pass pattern variables through to the chat options

  #### `restapi/patterns.go`
  - Refactored pattern handler initialization to use custom routes instead of generic storage handler routes
  - Added new `ApplyPattern` endpoint (`POST /patterns/:name/apply`) for applying patterns with variables
  - Modified `Get` method to return raw pattern content without variable processing
  - Added `PatternApplyRequest` struct for the new apply endpoint

  #### `web/src/lib/components/chat/DropdownGroup.svelte`
  - Added a new textarea input for entering pattern variables as JSON
  - Integrated with the pattern variables store to update variables in real-time
  - Added error-tolerant JSON parsing to allow partial typing

  #### `web/src/lib/interfaces/chat-interface.ts`
  - Added optional `variables` field to `ChatPrompt` interface

  #### `web/src/lib/services/ChatService.ts`
  - Updated `createChatPrompt` method to include pattern variables from the store
  - Minor formatting improvements to existing code

  #### `web/src/lib/store/pattern-store.ts`
  - Added new `patternVariables` writable store to manage pattern variables state

  ### Added Files

  #### `restapi/docs/API_VARIABLES_EXAMPLE.md`
  - Comprehensive documentation for using pattern variables with the REST API
  - Includes examples for single and multiple variable usage
  - Provides curl commands for testing
  - Explains the implementation details and variable processing

  ### Deleted Files
  These appear to be some non-pattern-related raycast scripts.

  - patterns/raycast/capture_thinkers_work
  - patterns/raycast/create_story_explanation
  - patterns/raycast/extract_primary_problem
  - patterns/raycast/extract_wisdom
  - patterns/raycast/yt

  ## Code Changes

  ### Key Changes in `restapi/chat.go`
  ```go
  type PromptRequest struct {
      // ... existing fields ...
      Variables    map[string]string `json:"variables,omitempty"` // Pattern variables
  }
  ```

  Added pattern variables to the chat processing:
  ```go
  PatternVariables: p.Variables,      // Pass pattern variables
  ```

  ### Key Changes in `restapi/patterns.go`
  New endpoint for applying patterns with variables:
  ```go
  // POST /patterns/:name/apply
  func (h *PatternsHandler) ApplyPattern(c *gin.Context) {
      // Accepts JSON body with input and variables
      // Merges query parameters with body variables
      // Applies variables to pattern and returns processed result
  }
  ```

  ### Key Changes in Web UI
  Added JSON textarea for pattern variables:
  ```svelte
  <textarea
      id="pattern-variables"
      bind:value={variablesJsonString}
      on:input={updateVariables}
      placeholder="{`{\"lang_code\": \"fr\", \"role\": \"expert\"}`}"
      // ... styling ...
  ></textarea>
  ```

  ## Reason for Changes

  1. **Feature Parity**: The CLI already supports pattern variables, but the REST API and web UI were missing this functionality
  2. **User Flexibility**: Allows users to create more dynamic and reusable patterns by passing variables at runtime
  3. **Better UX**: Web UI users can now leverage the same powerful pattern system as CLI users

  ## Impact of Changes

  1. **Backward Compatibility**: All changes are backward compatible - existing API calls will continue to work without modification
  2. **New Capabilities**: Users can now:
     - Pass variables to patterns via REST API
     - Use the web UI to specify pattern variables
     - Apply patterns with variables programmatically
  3. **Documentation**: Added comprehensive examples to help users understand and adopt the new feature

  ## Test Plan

  1. **Manual Testing**:
     - Test existing chat endpoints without variables (regression testing)
     - Test new pattern variables functionality with the `translate` pattern
     - Test multiple variables with custom patterns
     - Test error handling for invalid JSON in the web UI

  2. **API Testing**:
     - Use the provided curl examples in the documentation
     - Test with both query parameters and request body variables
     - Verify variable precedence (body overrides query params)

  3. **Web UI Testing**:
     - Enter valid JSON and verify variables are passed correctly
     - Test partial/invalid JSON entry (should not break the UI)
     - Verify pattern execution with variables produces expected results

  ## Additional Notes

  - The implementation follows the existing pattern variable system used in the CLI
  - Variables use Go's template syntax (e.g., `{{variable_name}}`)
  - The `{{input}}` variable is handled automatically and should not be included in the variables map
  - The web UI provides a monospace font for better JSON editing experience
  - Error handling is graceful - invalid JSON in the UI won't break functionality

commits:
  [{"SHA":"c6d612ee9ac467aa49d6df69536792a54a8c16bc","Message":"feat: add pattern variables support to REST API chat endpoint\n\n## CHANGES\n\n- Add Variables field to PromptRequest struct\n- Pass pattern variables through chat handler\n- Create API variables documentation example\n- Add pattern variables UI in web interface\n- Create pattern variables store in Svelte\n- Include variables in chat service requests\n- Add JSON textarea for variable input","Author":"Kayvan Sylvan"},{"SHA":"bd2db29ceeca6ea3a8e79f1f77097346fdf30fef","Message":"feat: add `ApplyPattern` route for applying patterns with variables\n\n## CHANGES\n- Create `PatternApplyRequest` struct for request body parsing\n- Implement `ApplyPattern` method for POST /patterns/:name/apply\n- Register manual routes for pattern operations in `NewPatternsHandler`\n- Refactor `Get` method to return raw pattern content\n- Merge query parameters with request body variables in `ApplyPattern`\n- Use `StorageHandler` for pattern-related storage operations","Author":"Kayvan Sylvan"},{"SHA":"e8aa358b157944906853bbb99b41ec630166956e","Message":"refactor(ChatService): clean up message stream and pattern output methods\n\n- Refactor `cleanPatternOutput` to use a dedicated return variable.\n- Hoist `processResponse` function for improved stream readability.\n- Remove unnecessary whitespace and trailing newlines from file.","Author":"Kayvan Sylvan"},{"SHA":"6ddf46a379f67c51b72a0eefc5b0f0ec7d0c5b1d","Message":"chore: removed a directory of raycast scripts sitting in the patterns/ directory","Author":"Kayvan Sylvan"}]


title: Bug/bedrock region handling
author: andrewsjg
author_url: https://github.com/andrewsjg
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1538
merged_at: 2025-06-23 19:59:30+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Updated the bedrock plugin to handle the AWS region requirement. If a region is set in the AWS profile the bedrock plugin will be configured. If not it will require adding one via the setup process.  Bedrock requires a region for endpoint discovery

  This stops the bedrock plugin from being configured when only a key and secret are set in the environment and the region is missing. 

  May also be improved further by also adding an explicit check for the environment variable AWS_DEFAULT_REGION 

  ## Related issues
  Extends: [1523](https://github.com/danielmiessler/fabric/pull/1523)

commits:
  [{"SHA":"c8cf6da0cce69e992165f7f2ed5dadf48b5a03f1","Message":"Updated hasAWSCredentials to also check for AWS_DEFAULT_REGION when access keys are configured in the environment","Author":"James Andrews"},{"SHA":"14a3c11930aed7b24a39b9ccbe8c6ed76f3784ab","Message":"Fixed bedrock region handling","Author":"James Andrews"},{"SHA":"0b5d3cfc305ee058d656996d1302946a6128702f","Message":"bedrock region handling - updated to fix bad pointer reference","Author":"James Andrews"},{"SHA":"eb251139b8b2ac591067ded0f2058eda4a94776b","Message":"bedrock region handling - updated to set region value correctly if it exists in the config","Author":"James Andrews"},{"SHA":"3fd923f6b8b2b655138819b189341fd68eb2cafb","Message":"chore: refactor Bedrock client to improve error handling and add interface compliance\n\n## CHANGES\n\n- Add ai.Vendor interface implementation check\n- Improve error handling with wrapped errors\n- Add AWS region validation logic\n- Fix resource cleanup in SendStream\n- Add nil checks for response parsing\n- Update context usage to Background()\n- Add user agent constants\n- Enhance code documentation","Author":"Kayvan Sylvan"}]


title: Add Langdock AI and enhance generic OpenAI compatible support
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1540
merged_at: 2025-06-23 19:56:25+00:00
created_at: 2025-07-16 04:25:34
body:
  # Summary

  This PR introduces dynamic environment variable support for OpenAI-compatible provider configurations, specifically adding template variable substitution in provider base URLs. The changes also reorganize the provider map to be alphabetically sorted and add a new provider (Langdock) that demonstrates the new templating feature.

  # Related Issues

  Closes #1539 

  # Files Changed

  - **`plugins/ai/openai_compatible/providers_config.go`**: Modified to add template variable parsing logic and reorganized provider configurations

  # Code Changes

  ## providers_config.go

  ### Import additions
  ```go
  +	"os"
  +	"strings"
  ```
  Added imports for environment variable access and string manipulation needed for template parsing.

  ### Provider map reorganization
  The `ProviderMap` has been alphabetically sorted for better maintainability. Additionally, a new provider "Langdock" has been added:
  ```go
  +	"Langdock": {
  +		Name:    "Langdock",
  +		BaseURL: "https://api.langdock.com/openai/{{REGION=us}}/v1",
  +	},
  ```

  ### Template variable parsing logic
  The most significant change is in the `GetProviderByName` function, which now includes logic to parse and substitute template variables:
  ```go
  +	if strings.Contains(provider.BaseURL, "{{") && strings.Contains(provider.BaseURL, "}}") {
  +		// Extract the template variable and default value
  +		start := strings.Index(provider.BaseURL, "{{")
  +		end := strings.Index(provider.BaseURL, "}}") + 2
  +		template := provider.BaseURL[start:end]
  +
  +		// Parse the template to get variable name and default value
  +		inner := template[2 : len(template)-2] // Remove {{ and }}
  +		parts := strings.Split(inner, "=")
  +		if len(parts) == 2 {
  +			varName := strings.TrimSpace(parts[0])
  +			defaultValue := strings.TrimSpace(parts[1])
  +
  +			// Create environment variable name
  +			envVarName := strings.ToUpper(provider.Name) + "_" + varName
  +
  +			// Get value from environment or use default
  +			envValue := os.Getenv(envVarName)
  +			if envValue == "" {
  +				envValue = defaultValue
  +			}
  +
  +			// Replace the template with the actual value
  +			provider.BaseURL = strings.Replace(provider.BaseURL, template, envValue, 1)
  +		}
  +	}
  ```

  # Reason for Changes

  1. **Dynamic Configuration**: The template variable support allows providers to have configurable base URLs without hardcoding values, making the system more flexible for different deployment environments.

  2. **Environment-based Customization**: Users can now override default values using environment variables (e.g., `LANGDOCK_REGION=eu` to use European endpoints).

  3. **Better Organization**: Alphabetically sorting the provider map improves code readability and makes it easier to find specific providers.

  # Impact of Changes

  1. **Backward Compatibility**: Existing providers without template variables continue to work as before.

  2. **New Capability**: Providers can now define configurable parts of their base URLs using the `{{VARIABLE=default}}` syntax.

  3. **Runtime Flexibility**: Users can customize provider endpoints without modifying code, using environment variables following the pattern `{PROVIDER_NAME}_{VARIABLE_NAME}`.

  # Test Plan

  1. Test existing providers to ensure they continue working without regression
  2. Test the new Langdock provider with:
     - Default value (should use "us" region)
     - Environment variable set (e.g., `LANGDOCK_REGION=eu`)
  3. Verify template parsing handles edge cases:
     - Templates without default values
     - Multiple templates in a single URL (current implementation only handles the first one)
     - Malformed templates

  # Additional Notes

  **Potential Issues:**
  1. The current implementation only handles the first template variable in a URL. If multiple templates are needed, the logic would need to be enhanced.
  2. The template parsing assumes a specific format `{{VARIABLE=default}}`. Other formats will not be parsed.
  3. There's no validation on the substituted values, which could potentially lead to invalid URLs if incorrect environment values are provided.

  **Future Enhancements:**
  - Support for multiple template variables in a single URL
  - Validation of substituted values
  - Support for different template formats or more complex substitution patterns

commits:
  [{"SHA":"b5bf75ad2e3395ff451eb81b7e410b1e47a93b04","Message":"chore: refactor ProviderMap for dynamic URL template handling\n\n# CHANGES\n\n- Add `os` and `strings` packages to imports\n- Implement dynamic URL handling with environment variables\n- Refactor provider configuration to support URL templates\n- Reorder providers for consistent key order in ProviderMap\n- Extract and parse template variables from BaseURL\n- Use environment variables or default values for templates\n- Replace template with actual values in BaseURL","Author":"Kayvan Sylvan"}]


title: Add `write_essay_by_author` and update Pattern metadata
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1542
merged_at: 2025-06-25 09:49:54+00:00
created_at: 2025-07-16 04:25:34
body:
  # Add `write_essay_by_author` and update Pattern metadata

  ## Summary

  This PR updates the pattern descriptions and related files in the Fabric project. The main changes involve consolidating pattern metadata, adding new patterns, and renaming the `write_essay` pattern to `write_essay_pg` while creating a new parameterized `write_essay` pattern.

  ## Files Changed

  ### Pattern_Descriptions/pattern_descriptions.json
  - **Reformatted JSON**: Changed multi-line array formatting to single-line for all tag arrays
  - **Added 5 new patterns**:
    - `analyze_paper_simple`: Analyze research papers for findings and scientific rigor
    - `analyze_terraform_plan`: Analyze Terraform plans for infrastructure changes and security
    - `create_mnemonic_phrases`: Create memorable mnemonic sentences from given words
    - `summarize_board_meeting`: Convert board meeting transcripts to formal notes
    - `write_essay`: New parameterized essay writer using `{{author_name}}` variable
  - **Updated pattern description**: Fixed description for `create_coding_feature` pattern
  - **Renamed pattern**: `write_essay` → `write_essay_pg` (Paul Graham style)

  ### Pattern_Descriptions/pattern_extracts.json
  - **Added pattern extracts** for the 5 new patterns with their system prompts
  - **Updated extract** for renamed `write_essay_pg` pattern

  ### patterns/pattern_explanations.md
  - **Added explanations** for all 5 new patterns
  - **Updated explanation** for `write_essay` to reflect it now uses an `author_name` variable
  - **Updated explanation** for `write_essay_pg` to clarify it's specifically Paul Graham style

  ### patterns/suggest_pattern/user.md
  - **Added pattern descriptions** for all 5 new patterns in the documentation
  - **Updated descriptions** to reflect the `write_essay` → `write_essay_pg` rename

  ### patterns/write_essay/system.md
  - **Complete rewrite**: Transformed from Paul Graham-specific to a parameterized pattern
  - **Uses `{{author_name}}` variable**: Allows writing in any author's style
  - **Includes web search instruction**: Can look up example essays if tool available
  - **More flexible approach**: Adapts vocabulary, style, and structure to match specified author

  ### patterns/write_essay_pg/system.md
  - **New file**: Contains the original Paul Graham-specific essay writing pattern
  - **Preserved original content**: Maintains all Paul Graham examples and specific instructions

  ### web/static/data/pattern_descriptions.json
  - **Identical changes** to Pattern_Descriptions/pattern_descriptions.json (duplicate file)

  ## Code Changes

  The most significant code change is the transformation of the `write_essay` pattern from a hardcoded Paul Graham style to a flexible, parameterized pattern:

  ```markdown
  # Old (now write_essay_pg)
  - Write the essay in the style of Paul Graham, who is known for this concise, clear, and simple style of writing.

  # New (write_essay)
  - Write the essay in the style of {{author_name}}, embodying all the qualities that they are known for.
  - Look up some example Essays by {{author_name}} (Use web search if the tool is available)
  ```

  ## Reason for Changes

  1. **Pattern flexibility**: The new `write_essay` pattern allows users to write in any author's style, not just Paul Graham's
  2. **Backward compatibility**: The original functionality is preserved in `write_essay_pg` 
  3. **New capabilities**: Added patterns for analyzing Terraform plans, creating mnemonics, and formal meeting documentation
  4. **Improved organization**: Consistent JSON formatting makes the files easier to read and maintain

  ## Impact of Changes

  - **Enhanced functionality**: Users can now write essays in multiple styles using a single pattern
  - **More analysis options**: New patterns provide capabilities for infrastructure, research, and business documentation
  - **Better user experience**: The parameterized approach reduces the need for multiple similar patterns
  - **Maintained compatibility**: Existing users of the Paul Graham essay pattern can use `write_essay_pg`

  ## Test Plan

  1. Test the new `write_essay` pattern with various author names
  2. Verify `write_essay_pg` still produces Paul Graham-style essays
  3. Test each new pattern with appropriate input
  4. Ensure pattern discovery/suggestion still works with updated descriptions
  5. Verify JSON files are valid and properly formatted

  ## Additional Notes

  - The duplicate pattern_descriptions.json files (in Pattern_Descriptions/ and web/static/data/) should be kept in sync or consolidated
  - The new patterns expand Fabric's capabilities into DevOps (Terraform), memory techniques (mnemonics), and corporate documentation (board meetings)

commits:
  [{"SHA":"1ae847f397d76fa94050a66a65566da1f6017d74","Message":"chore: refactor ProviderMap for dynamic URL template handling\n\n# CHANGES\n\n- Add `os` and `strings` packages to imports\n- Implement dynamic URL handling with environment variables\n- Refactor provider configuration to support URL templates\n- Reorder providers for consistent key order in ProviderMap\n- Extract and parse template variables from BaseURL\n- Use environment variables or default values for templates\n- Replace template with actual values in BaseURL","Author":"Kayvan Sylvan"},{"SHA":"64c3c69a70246a4328470871bd53ce4371cc0ba9","Message":"Merge branch 'danielmiessler:main' into main","Author":"Kayvan Sylvan"},{"SHA":"f9493910988405134a409ff26ec3089355b9ae6c","Message":"feat: add  new pattern and update pattern metadata files.\n\n### CHANGES\n\n- Add tags and descriptions for five new creative and analytical patterns.\n- Introduce `analyze_terraform_plan` for infrastructure review.\n- Add `write_essay_by_author` for stylistic writing.\n- Include `summarize_board_meeting` for corporate notes.\n- Introduce `create_mnemonic_phrases` for memory aids.\n- Update and clean pattern description data files.\n- Sort the pattern explanations list alphabetically.","Author":"Kayvan Sylvan"},{"SHA":"94020dbde0556de0836f1520b1803768fe8c9092","Message":"chore: rename essay patterns to clarify Paul Graham style and author variable usage\n\n## CHANGES\n\n- Rename `write_essay` to `write_essay_pg` for Paul Graham style\n- Rename `write_essay_by_author` to `write_essay` with author variable\n- Update pattern descriptions to reflect naming changes\n- Fix duplicate `write_essay_pg` entry in pattern descriptions","Author":"Kayvan Sylvan"},{"SHA":"6a7cca65b4bb02a84ef4140ae32c02437818cd54","Message":"chore: Fixes caught by review","Author":"Kayvan Sylvan"}]


title: fix: Revert multiline tags in generated json files
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1543
merged_at: 2025-06-25 11:06:12+00:00
created_at: 2025-07-16 04:25:34
body:
  # JSON Formatting Standardization for Pattern Descriptions

  ## Summary

  TL;DR: The JSON format is auto-generated and I reverted it back to how the Python extractor generates the files.

  This pull request reverts the JSON formatting for pattern description tags across two identical files, converting from inline array format to multi-line format for improved readability and maintainability.

  ## Files Changed

  - **Pattern_Descriptions/pattern_descriptions.json**: Reformatted all tag arrays from inline to multi-line format
  - **web/static/data/pattern_descriptions.json**: Applied identical formatting changes to maintain consistency

  ## Code Changes

  The primary change involves converting tag arrays from this format:
  ```json
  "tags": ["DEVELOPMENT", "LEARNING"]
  ```

  To this format:
  ```json
  "tags": [
    "DEVELOPMENT",
    "LEARNING"
  ]
  ```

  This formatting change was applied to all 283+ pattern entries across both files. Additionally, one minor content correction was made:

  - **write_essay pattern**: Removed the variable reference `{{author_name}}` from the description to clean up the text

  ## Reason for Changes

  1. **Improved Readability**: Multi-line tag arrays are easier to scan and read, especially for patterns with multiple tags
  2. **Better Version Control**: Each tag on its own line makes git diffs cleaner when tags are added, removed, or modified
  3. **Consistency**: Establishes a uniform formatting standard across the entire codebase
  4. **Maintainability**: Easier to identify and modify individual tags without affecting others

  ## Impact of Changes

  - **Positive**: Enhanced code readability and maintainability with no functional impact
  - **No Breaking Changes**: The JSON structure and content remain identical; only whitespace formatting has changed
  - **File Synchronization**: Both pattern description files now maintain identical formatting standards

  ## Test Plan

  - Verify JSON files parse correctly with standard JSON parsers
  - Confirm web application loads pattern descriptions without issues
  - Validate that all 283+ patterns retain their original tag associations
  - Test that search and filtering functionality continues to work as expected

  ## Additional Notes

  This is purely a formatting change with one minor content cleanup. The extensive diff size (716 additions, 716 deletions) reflects the reformatting of every tag array in both files, but no functional logic has been altered. Both files should continue to work identically to their previous versions while providing a better developer experience for future maintenance.

commits:
  [{"SHA":"71e20cf251a1c6fe99a52c70057fa9e82e3b6ec4","Message":"chore: reformat `pattern_descriptions.json` to improve readability\n\n### CHANGES\n\n- Reformat JSON `tags` array to display on new lines.\n- Update `write_essay` pattern description for clarity.\n- Apply consistent formatting to both data files.","Author":"Kayvan Sylvan"}]


title: Update Message Handling for Attachments and Multi-Modal content
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1545
merged_at: 2025-06-26 06:50:43+00:00
created_at: 2025-07-16 04:25:34
body:
  # Update Message Handling for Attachments and Multi-Modal content

  ## Summary

  This PR refactors the message handling logic across multiple components to improve code clarity and fix issues with attachment processing. The main changes include simplifying conditional logic in `BuildChatRequest`, improving multi-content message handling in raw mode, and enhancing the dry-run plugin's output formatting for better debugging.

  The changes improve code clarity by simplifying conditional logic and fixing issues with pattern-based message handling and multi-content message support in the dry-run plugin.

  ## Related issues

  closes #1544 

  ## Screenshots

  ### Attachments Now Work

  ![image](https://github.com/user-attachments/assets/71e7aeed-e4e2-471e-9ddc-1e71764e225d)

  ### Dry-Run now correctly shows embedded images

  Dry-Run now works too (before, it did not show anything as INPUT)

  ![image](https://github.com/user-attachments/assets/6417b6c5-8b38-4675-9c04-760489eeb4e0)

  ### Tested in Raw Mode Too

  ![image](https://github.com/user-attachments/assets/2ad11e2a-8ee5-4158-ab80-c3666e5aab61)


  ## Files Changed

  ### `cli/flags.go`
  - **Simplified conditional logic**: Inverted the attachment check to reduce nesting and improve readability
  - **Reordered message creation**: Moved the plain message creation to an `else if` block for better flow

  ### `core/chatter.go`
  - **Updated comments**: Simplified inline comments for better clarity
  - **Fixed multi-content handling in raw mode**: Added proper support for attachments when using raw mode
  - **Improved input deduplication**: Added `inputUsed` flag to prevent duplicate user input when patterns are applied
  - **Fixed message appending logic**: Corrected the condition for appending user messages in non-raw mode

  ### `plugins/ai/dryrun/dryrun.go`
  - **Added multi-content support**: New `formatMultiContentMessage` method to properly display messages with attachments
  - **Refactored output formatting**: Split formatting logic into separate methods for better maintainability
  - **Improved debugging output**: Enhanced display of image attachments and multi-part content

  ## Code Changes

  ### cli/flags.go
  The conditional logic was simplified by inverting the attachment check:
  ```go
  -if len(o.Attachments) == 0 {
  -    if o.Message != "" {
  -        message = &goopenai.ChatCompletionMessage{
  -            Role:    goopenai.ChatMessageRoleUser,
  -            Content: strings.TrimSpace(o.Message),
  -        }
  -    }
  -} else {
  +if len(o.Attachments) > 0 {
      // handle attachments
  +} else if o.Message != "" {
  +    // handle plain message
  }
  ```

  ### core/chatter.go
  Key improvements in raw mode message handling:
  ```go
  +// Handle MultiContent properly in raw mode
  +if len(request.Message.MultiContent) > 0 {
  +    // When we have attachments, add the text as a text part in MultiContent
  +    newMultiContent := []goopenai.ChatMessagePart{
  +        {
  +            Type: goopenai.ChatMessagePartTypeText,
  +            Text: finalContent,
  +        },
  +    }
  ```

  Fixed the logic for appending user messages in non-raw mode:
  ```go
  -if request.PatternName == "" && request.Message != nil {
  +if len(request.Message.MultiContent) > 0 || (request.Message != nil && !inputUsed) {
      session.Append(request.Message)
  }
  ```

  ### plugins/ai/dryrun/dryrun.go
  Added proper formatting for multi-content messages:
  ```go
  +func (c *Client) formatMultiContentMessage(msg *goopenai.ChatCompletionMessage) string {
  +    var builder strings.Builder
  +    if len(msg.MultiContent) > 0 {
  +        builder.WriteString(fmt.Sprintf("%s:\n", msg.Role))
  +        for _, part := range msg.MultiContent {
  +            builder.WriteString(fmt.Sprintf("  - Type: %s\n", part.Type))
  +            if part.Type == goopenai.ChatMessagePartTypeImageURL {
  +                builder.WriteString(fmt.Sprintf("    Image URL: %s\n", part.ImageURL.URL))
  ```

  ## Reason for Changes

  1. **Code clarity**: The inverted conditional in `flags.go` reduces nesting and makes the flow easier to follow
  2. **Bug fix**: The previous implementation didn't properly handle multi-content messages (attachments) in raw mode
  3. **Prevent duplication**: When using patterns, user input was being duplicated in the conversation
  4. **Better debugging**: The dry-run plugin now properly displays all message types including attachments

  ## Impact of Changes

  - **Improved attachment handling**: Users can now properly use attachments with patterns in raw mode
  - **No duplicate messages**: Patterns that incorporate user input no longer result in the input appearing twice
  - **Better debugging experience**: Developers using dry-run mode can now see the full structure of multi-content messages
  - **Backward compatibility**: All changes maintain backward compatibility with existing functionality

  ## Test Plan

  1. Test attachment handling with and without patterns
  2. Verify raw mode works correctly with multi-content messages
  3. Ensure patterns don't duplicate user input in the conversation
  4. Test dry-run mode displays all message types correctly
  5. Verify existing functionality remains unchanged

  ## Additional Notes

  - The `inputUsed` flag is a key addition that tracks whether user input has already been incorporated into the system message via a pattern
  - The multi-content handling in raw mode now properly combines system prompts with attachments
  - Comment updates throughout make the codebase more maintainable for future developers

commits:
  [{"SHA":"97fc9b0d5885b1cc21c3aada5763af4116a8d819","Message":"feat: allow combining user messages and attachments with patterns\n\n- Allow user messages and attachments with patterns.\n- Append user message to session regardless of pattern.\n- Refactor chat request builder for improved clarity.","Author":"Kayvan Sylvan"},{"SHA":"4ad14bb752beaed61896cd854269d5aaec5eeefd","Message":"feat: enhance dryrun client to display multi-content user messages\n\n### CHANGES\n\n- Handle multi-content messages for the user role.\n- Display image URLs from user messages in output.\n- Update both `Send` and `SendStream` methods.\n- Retain existing behavior for simple text messages.","Author":"Kayvan Sylvan"},{"SHA":"fada6bb04416329c4caa2b11827d68b9c7eee5a4","Message":"chore: simplify user message appending logic in BuildSession\n\n### CHANGES\n- Remove conditional check for pattern name in message appending.\n- Always append user message if it exists in request.","Author":"Kayvan Sylvan"},{"SHA":"e15645c1bcd04444bc3fdcb62058179eb7d3d9ad","Message":"chore: clean up comments in `chatter.go` for clarity","Author":"Kayvan Sylvan"},{"SHA":"85ee6196bd80b28ae26ea6498f1b8f4b5e673cea","Message":"chore: fix formatting.","Author":"Kayvan Sylvan"},{"SHA":"816e4072f47a4320a4bc0e952fe9824c5b37121f","Message":"fix(chatter): prevent duplicate user message when applying patterns\n\n### CHANGES\n\n*   Prevent adding user message twice when using patterns.\n*   Ensure multi-part content is always included in session.","Author":"Kayvan Sylvan"},{"SHA":"f62d2198f9c766b1ff16bb2f6bab0228186edde7","Message":"refactor: extract message and option formatting logic into reusable methods\n\n## CHANGES\n\n- Extract multi-content message formatting to dedicated method\n- Create formatMessages method for all message types\n- Add formatOptions method for chat options display\n- Replace inline formatting with strings.Builder usage\n- Reduce code duplication between Send and SendStream\n- Improve code organization and maintainability","Author":"Kayvan Sylvan"},{"SHA":"2497f10eca974792b2fbb60bd0f5ef1ecc02addf","Message":"feat: add MultiContent support to chat message construction in raw mode","Author":"Kayvan Sylvan"},{"SHA":"e2430b6c7543dddbf545ef12cf95cc967bc6cecb","Message":"fix: correctly combine text and attachments in raw mode sessions\n\n### CHANGES\n\n- Combine user text and attachments into MultiContent.\n- Preserve existing non-text parts like images.\n- Use standard content field for text-only messages.","Author":"Kayvan Sylvan"},{"SHA":"1a335b3fb98823a2b3848461fd9452ee76f94d79","Message":"refactor(ai): unify assistant and user message formatting in dryrun\n\n### CHANGES\n\n- Unify assistant and user message formatting logic.\n- Use `formatMultiContentMessage` for assistant role messages.\n- Improve dryrun support for multi-part message content.","Author":"Kayvan Sylvan"}]


title: New YouTube Transcript Endpoint Added to REST API
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1546
merged_at: 2025-06-26 23:08:23+00:00
created_at: 2025-07-16 04:25:34
body:
  # New YouTube Transcript Endpoint Added to REST API

  ## Summary

  This PR adds a dedicated YouTube transcript endpoint to the REST API, separating YouTube transcript functionality from the general chat endpoint. The implementation includes a new handler for YouTube-specific operations and updates the frontend to use this new endpoint.

  ## Related issues

  Closes #1520 

  ## Screenshots

  ![image](https://github.com/user-attachments/assets/e0d5108c-3b52-4551-992d-0ad922a1e7d6)

  This produced this output:

  ![image](https://github.com/user-attachments/assets/6d3a07c7-face-46d6-89b1-79789fd3284b)

  ## Summary

  This PR adds a dedicated YouTube transcript endpoint to the REST API, separating YouTube transcript functionality from the general chat endpoint. The implementation includes a new handler for YouTube-specific operations and updates the frontend to use this new endpoint.

  ## Files Changed

  - **restapi/serve.go**: Added registration for the new YouTube handler in the API server initialization
  - **restapi/youtube.go**: New file implementing the YouTube transcript endpoint with proper request/response structures
  - **web/src/lib/services/transcriptService.ts**: Updated the frontend service to use the new dedicated YouTube endpoint instead of the general chat endpoint

  ## Code Changes

  ### restapi/serve.go
  ```go
  +	NewYouTubeHandler(r, registry)
  ```
  Added handler registration to expose the YouTube functionality through the REST API.

  ### restapi/youtube.go
  ```go
  +type YouTubeRequest struct {
  +	URL        string `json:"url"`
  +	Language   string `json:"language"`
  +	Timestamps bool   `json:"timestamps"`
  +}
  +
  +type YouTubeResponse struct {
  +	Transcript string `json:"transcript"`
  +	Title      string `json:"title"`
  +}
  ```
  Defined clear request/response structures for the YouTube transcript API, supporting language selection and optional timestamps.

  ```go
  +func (h *YouTubeHandler) Transcript(c *gin.Context) {
  +	// ... validation and processing logic
  +	if req.Timestamps {
  +		transcript, err = h.yt.GrabTranscriptWithTimestamps(videoID, language)
  +	} else {
  +		transcript, err = h.yt.GrabTranscript(videoID, language)
  +	}
  +	// ...
  +}
  ```
  Implemented the transcript endpoint with proper validation, error handling, and support for both timestamped and non-timestamped transcripts.

  ### web/src/lib/services/transcriptService.ts
  ```typescript
  -      endpoint: '/chat',
  +      endpoint: '/api/youtube/transcript',
  ```
  Updated the frontend to use the new dedicated YouTube endpoint.

  ## Reason for Changes

  This change improves the API design by:
  1. **Separation of Concerns**: YouTube transcript functionality now has its own dedicated endpoint rather than being mixed with general chat functionality
  2. **Better API Design**: Clear, purpose-built request/response structures for YouTube operations
  3. **Enhanced Features**: Added support for timestamp inclusion in transcripts
  4. **Improved Error Handling**: Specific validation for YouTube URLs and playlist detection

  ## Impact of Changes

  - **API Structure**: Introduces a new `/youtube/transcript` endpoint, making the API more RESTful and organized
  - **Backward Compatibility**: The old chat endpoint remains unchanged, ensuring existing integrations continue to work
  - **Frontend Integration**: The web UI now uses the dedicated endpoint for YouTube transcripts
  - **Performance**: No performance impact expected; the underlying YouTube service remains the same

  ## Test Plan

  1. Test valid YouTube video URLs return transcripts successfully
  2. Test language parameter properly affects transcript language selection
  3. Test timestamp flag correctly includes/excludes timestamps in response
  4. Test error cases:
     - Invalid URLs
     - Playlist URLs (should return error)
     - Missing required parameters
     - Invalid video IDs
  5. Verify frontend correctly displays transcripts from the new endpoint

  ## Additional Notes

  - The handler properly validates playlist URLs and returns an appropriate error message
  - Default language is set to "en" if not specified
  - The response includes both transcript and title (currently using videoID as title, which might need refinement in future iterations)
  - Error responses follow consistent JSON structure with error messages

commits:
  [{"SHA":"0dbe1bbb4ea2d571c1c5d894d1ebf8fd7b234895","Message":"feat: add dedicated YouTube transcript API endpoint\n\n## CHANGES\n\n- Add new YouTube handler for transcript requests\n- Create `/youtube/transcript` POST endpoint route\n- Add request/response types for YouTube API\n- Support language and timestamp options\n- Update frontend to use new endpoint\n- Remove chat endpoint dependency for transcripts\n- Validate video vs playlist URLs properly","Author":"Kayvan Sylvan"},{"SHA":"34cf669bd405100deb16decc76a2dc0a94fb3126","Message":"chore: fix endpoint calls from frontend","Author":"Kayvan Sylvan"}]


title: Add Support for OpenAI Search and Research Model Variants
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1550
merged_at: 2025-06-27 00:20:47+00:00
created_at: 2025-07-16 04:25:34
body:
  # Add Support for OpenAI Search and Research Model Variants

  ## Summary

  This PR extends the `NeedsRawMode` functionality in the OpenAI client to support new search and research model variants. The change adds explicit model name matching alongside the existing prefix-based matching to accommodate OpenAI's newer model naming conventions that don't follow the standard prefix pattern.

  ## Files Changed

  - **plugins/ai/openai/openai.go**: Modified the `NeedsRawMode` method to include support for search and research model variants through exact name matching.

  ## Code Changes

  ### plugins/ai/openai/openai.go

  Added import for the `slices` package:
  ```go
  +	"slices"
  ```

  Extended the `NeedsRawMode` method to include a new slice of model names that require raw mode:
  ```go
  +	openAIModelsNeedingRaw := []string{
  +		"gpt-4o-mini-search-preview",
  +		"gpt-4o-mini-search-preview-2025-03-11",
  +		"gpt-4o-search-preview",
  +		"gpt-4o-search-preview-2025-03-11",
  +		"o4-mini-deep-research",
  +		"o4-mini-deep-research-2025-06-26",
  +	}
  ```

  Modified the return statement to check both prefix matching and exact name matching:
  ```go
  -	return false
  +	return slices.Contains(openAIModelsNeedingRaw, modelName)
  ```

  ## Reason for Changes

  OpenAI has introduced new model variants for search and research capabilities that don't follow the traditional prefix-based naming convention (e.g., "gpt-4", "o1", "o3", "o4"). These new models:
  - Search preview models: `gpt-4o-mini-search-preview`, `gpt-4o-search-preview`
  - Research models: `o4-mini-deep-research`

  These models require raw mode processing but wouldn't be caught by the existing prefix-based detection logic, necessitating explicit name matching.

  ## Impact of Changes

  1. **Expanded Model Support**: The application now correctly identifies and handles OpenAI's search and research model variants that require raw mode processing.

  2. **Backward Compatibility**: The existing prefix-based matching remains intact, ensuring all previously supported models continue to work as expected.

  3. **Future-Proofing**: The addition of dated model variants (e.g., `2025-03-11`, `2025-06-26`) ensures compatibility with OpenAI's versioned model releases.

  ## Test Plan

  1. Verify that existing models with prefixes ("gpt-4", "o1", "o3", "o4") continue to return `true` for `NeedsRawMode`.
  2. Test that the new search preview models return `true` for `NeedsRawMode`.
  3. Test that the research models return `true` for `NeedsRawMode`.
  4. Confirm that models not in either list return `false`.
  5. Integration testing with actual API calls to ensure proper raw mode handling for the new models.

  ## Additional Notes

  - The use of `slices.Contains` provides a clean and efficient way to check for exact model name matches.
  - The dated variants included in the list suggest OpenAI is moving towards versioned model releases, which may require periodic updates to this list.
  - Consider implementing a configuration-based approach in the future to make model list management more flexible without code changes.

commits:
  [{"SHA":"64763e13039bcc0e9a9a8e08cb381ed5c222288a","Message":"feat: add support for new OpenAI search and research model variants\n\n## CHANGES\n\n- Add slices import for array operations\n- Define new search preview model names\n- Add mini search preview variants\n- Include deep research model support\n- Add June 2025 dated model versions\n- Replace hardcoded check with slices.Contains\n- Support both prefix and exact model matching","Author":"Kayvan Sylvan"}]


title: Fix typos in README.md
author: nawarajshahi
author_url: https://github.com/nawarajshahi
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1552
merged_at: 2025-06-27 19:18:47+00:00
created_at: 2025-07-16 04:25:34
body:
  ## What this Pull Request (PR) does
  Fixes few typographical errors in the `READMe.md` file
  - `organiziting` -> `organizing`
  - `differnet` -> `different`

commits:
  [{"SHA":"08695c9e24c0337baeecd2740d1e001479234394","Message":"Fix typos on README.md","Author":"Nawaraj Shahi"}]


title: docs: add DeepWiki badge and fix minor typos in README
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1553
merged_at: 2025-06-28 02:58:00+00:00
created_at: 2025-07-16 04:25:34
body:
  ## Summary

  This PR updates the README documentation and dependency versions, focusing on improving clarity, fixing typos, and ensuring consistent formatting throughout the project documentation.

  ## Files Changed

  ### README.md
  Documentation improvements including:
  - Added DeepWiki badge for enhanced project visibility
  - Fixed typos and improved clarity in various sections
  - Reorganized navigation structure links to match the actual document for better flow
  - Added alt text to contributor images for accessibility
  - Minor formatting and wording improvements

  ### go.mod & go.sum
  Dependency management updates:
  - Updated `sashabaranov/go-openai` from v1.40.1 to v1.40.3
  - Cleaned up module requirements by removing unused `anaskhan96/soup` dependency
  - Consolidated AWS SDK dependencies

  ## Code Changes

  ### README.md

  Key documentation changes:

  ```markdown
  +[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/danielmiessler/fabric)
  ```
  Added DeepWiki integration badge for better project discoverability.

  ```markdown
  -Since the start of modern AI in late 2022 we've seen an **_extraordinary_** number of AI applications for accomplishing tasks. There are thousands of websites, chatbots, mobile apps, and other interfaces for using all the different AI out there.
  +Since the start of modern AI in late 2022 we've seen an **_extraordinary_** number of AI applications for accomplishing tasks. There are thousands of websites, chat-bots, mobile apps, and other interfaces for using all the different AI out there.
  ```
  Fixed "chatbots" to "chat-bots" for consistency.

  ```markdown
  ->- Fabric now supports Perplexity AI. Configure it by using `fabric -S` to add your Perlexity AI API Key,
  +>- Fabric now supports Perplexity AI. Configure it by using `fabric -S` to add your Perplexity AI API Key,
  ```
  Fixed typo: "Perlexity" → "Perplexity".

  ```markdown
  -- **Linux**: Uses `xclip` (install with `sudo apt-get install xclip` or equivalent for your distro)
  +- **Linux**: Uses `xclip` (install with `sudo apt-get install xclip` or equivalent for your Linux distribution)
  ```
  Expanded "distro" to "Linux distribution" for clarity.

  ### go.mod

  Dependency updates:
  ```go
  -       github.com/anaskhan96/soup v1.2.5
  -       github.com/sashabaranov/go-openai v1.40.1
  +       github.com/sashabaranov/go-openai v1.40.3
  ```

  ## Reason for Changes

  1. **Documentation Clarity**: Fixed typos and improved wording to make the documentation more professional and easier to understand
  2. **Accessibility**: Added alt text to images for better screen reader support
  3. **Dependency Maintenance**: Updated OpenAI SDK to latest patch version for potential bug fixes and improvements
  4. **Code Cleanup**: Removed unused soup dependency to reduce project complexity

  ## Impact of Changes

  - **User Experience**: Improved documentation readability and accuracy will help new users understand and adopt the project more easily
  - **Accessibility**: Alt text additions make the project more inclusive for users with visual impairments
  - **Maintenance**: Removing unused dependencies reduces potential security vulnerabilities and simplifies dependency management
  - **Stability**: OpenAI SDK update may include bug fixes that improve overall stability

  ## Test Plan

  - Verified all markdown links are functional
  - Confirmed navigation structure maintains logical flow
  - Validated that dependency updates don't break existing functionality
  - Ensured go.mod and go.sum files are properly synchronized

  ## Additional Notes

  - The navigation restructuring places "What and why" and "Intro videos" before "Navigation" (to match the document flow)
  - All contributor images now have proper alt text following accessibility best practices
  - The OpenAI SDK update is a minor version bump and should be backward compatible

commits:
  [{"SHA":"7f6609757732c3a34e268f404d962c5e1f4765d3","Message":"docs: add DeepWiki badge and fix minor typos in README\n\n## CHANGES\n\n- Add DeepWiki badge to README header\n- Fix typo \"chatbots\" to \"chat-bots\"\n- Correct \"Perlexity\" to \"Perplexity\"\n- Fix \"distro\" to \"Linux distribution\"\n- Add alt text to contributor images\n- Update dependency versions in go.mod\n- Remove unused soup dependency","Author":"Kayvan Sylvan"}]


title: fix: Race condition in GitHub actions release flow
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1555
merged_at: 2025-06-28 05:26:28+00:00
created_at: 2025-07-16 04:25:34
body:
  # Fix GitHub Release Creation Error Handling in CI/CD Pipeline

  ## Summary

  This PR improves the error handling in the GitHub Actions release workflow by properly checking if a release already exists before attempting to create it. The previous implementation could fail when the release view command returned a non-zero exit code.

  This ensures that during the GitHub release before matrix builds start, we get only one build trying to create a release.

  ## Related Issues

  Closes #1554 

  ## Files Changed

  - `.github/workflows/release.yml`: Modified the release creation logic to properly handle the case where a release tag already exists.

  ## Code Changes

  ### `.github/workflows/release.yml`

  The release creation step has been refactored from a single line command to a proper conditional check:

  **Before:**
  ```yaml
  gh release view ${{ env.latest_tag }} || gh release create ${{ env.latest_tag }} --title "Release ${{ env.latest_tag }}" --notes "Automated release for ${{ env.latest_tag }}"
  ```

  **After:**
  ```yaml
  if ! gh release view ${{ env.latest_tag }} >/dev/null 2>&1; then
    gh release create ${{ env.latest_tag }} --title "Release ${{ env.latest_tag }}" --notes "Automated release for ${{ env.latest_tag }}"
  else
    echo "Release ${{ env.latest_tag }} already exists."
  fi
  ```

  ## Reason for Changes

  The previous implementation using the `||` operator could cause issues in the CI/CD pipeline when `gh release view` returned an error. This could happen when:
  - The release doesn't exist (expected behavior)
  - Network issues occur
  - API rate limits are hit

  By explicitly checking the exit code and redirecting output to `/dev/null`, we ensure that:
  1. The workflow doesn't fail on expected "release not found" errors
  2. We get clearer feedback when a release already exists
  3. The pipeline is more robust against transient failures

  ## Impact of Changes

  - **Improved Reliability**: The release workflow will be more stable and less prone to failures due to race conditions or timing issues
  - **Better Logging**: Clear feedback when a release already exists helps with debugging CI/CD issues
  - **No Functional Changes**: The end result remains the sam. Releases are created only when they don't exist

  ## Test Plan

  This change can be tested by:
  1. Running the workflow on a tag that doesn't have a release (should create a new release)
  2. Re-running the workflow on the same tag (should skip creation and log that the release exists)
  3. Verifying that the workflow completes successfully in both cases

  ## Additional Notes

  This is a defensive programming improvement that makes the CI/CD pipeline more resilient. The change follows shell scripting best practices by:
  - Properly handling command exit codes
  - Redirecting both stdout and stderr when we only care about the exit status
  - Providing informative feedback for different scenarios

commits:
  [{"SHA":"d0602c9653575281171a5be2030cec420ff9bc4c","Message":"chore: improve release creation to gracefully handle pre-existing tags.\n\n### CHANGES\n\n*   Check if a release exists before attempting creation.\n*   Suppress error output from `gh release view` command.\n*   Add an informative log when release already exists.","Author":"Kayvan Sylvan"}]


title: feat: Migrate to official openai-go SDK
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1556
merged_at: 2025-06-28 15:02:08+00:00
created_at: 2025-07-16 04:25:34
body:
  # Migrate to official openai-go SDK

  ## Summary

  This PR updates the OpenAI integration in the Fabric project to use the official OpenAI Go SDK (`github.com/openai/openai-go`) instead of the third-party library (`github.com/sashabaranov/go-openai`). This change improves maintainability and ensures better compatibility with OpenAI's API.

  ## Related Issues

  Both these issues, #1549 and #1551, require using the Responses API (not the ChatCompletions API).

  ## Files Changed

  ### Added
  - **chat/chat.go**: New internal package containing chat message types and structures previously imported from the external library. Implements custom JSON marshaling/unmarshaling to handle the `Content` and `MultiContent` fields properly.

  ### Modified
  - **cli/flags.go**: Updated imports to use the new internal `chat` package
  - **common/domain.go**: Updated to use internal chat types
  - **common/domain_test.go**: Updated test imports
  - **core/chatter.go**: Updated to use internal chat types
  - **go.mod**: Removed `github.com/sashabaranov/go-openai` dependency, added `github.com/openai/openai-go`
  - **go.sum**: Updated with new dependency changes
  - **nix/pkgs/fabric/gomod2nix.toml**: Removed sashabaranov/go-openai entry
  - **plugins/ai/\***: All AI provider plugins updated to use the new chat types
  - **plugins/db/fsdb/sessions.go**: Updated to use internal chat types
  - **plugins/db/fsdb/sessions_test.go**: Updated test imports
  - **restapi/chat.go**: Updated to use internal chat types

  ## Code Changes

  ### chat/chat.go
  ```go
  type ChatCompletionMessage struct {
      Role             string
      Content          string
      Refusal          string
      MultiContent     []ChatMessagePart
      Name             string
      ReasoningContent string
      FunctionCall     *FunctionCall
      ToolCalls        []ToolCall
      ToolCallID       string
  }
  ```
  The new internal implementation provides:
  - All necessary chat message role constants
  - Support for multi-part messages (text and images)
  - Custom JSON marshaling that properly handles the mutual exclusivity of `Content` and `MultiContent` fields
  - Function calling and tool support structures

  ### OpenAI Plugin Migration
  The OpenAI plugin was significantly refactored to use the official SDK:
  - Replaced `goopenai.Client` with `openai.Client`
  - Updated configuration to use the new SDK's option pattern
  - Converted streaming implementation to use the new SDK's streaming API
  - Added `convertMessage` function to transform internal chat messages to OpenAI SDK format

  ## Reason for Changes

  1. **Reduce external dependencies**: By implementing our own chat message types, we have better control over the data structures and can customize them for our specific needs.

  2. **Use official SDK**: Switching to the official OpenAI Go SDK provides better long-term support and compatibility with OpenAI's API.

  3. **Better error handling**: The new implementation includes proper error handling for content field misuse (can't use both Content and MultiContent simultaneously).

  4. **Maintainability**: Having our own types makes it easier to add fabric-specific features without being constrained by external library limitations.

  ## Impact of Changes

  - **API Compatibility**: The changes maintain API compatibility. All existing code using these types continues to work.
  - **Performance**: No significant performance impact expected; the custom JSON marshaling is efficient.
  - **Testing**: All existing tests have been updated and continue to pass.
  - **Provider Support**: All AI providers (OpenAI, Anthropic, Bedrock, Gemini, Ollama, etc.) have been updated to work with the new types.

  ## Test Plan

  1. Run existing unit tests to ensure compatibility
  2. Test chat functionality with various AI providers
  3. Verify multi-part message support (text + images) still works
  4. Test streaming responses
  5. Verify JSON marshaling/unmarshaling works correctly for all message types

  In addition:

  | Test # | Test Description | Expected Result | Actual Result | Status |
  |--------|------------------|-----------------|---------------|---------|
  | 1 | Run with normal gpt-4o with image | Should describe the meme | Successfully described the meme: "Two athletes pointing guns in a shooting competition..." | ✅ PASS |
  | 2 | Make sure user input is not doubled | Should show what would be sent and question only once | Question appears once in dry-run output | ✅ PASS |
  | 3 | Make sure attachments and dry-run work | Should show System message with pattern prompt and dry run output with text and image | Shows System message with pattern prompt and includes both text question and attached image | ✅ PASS |
  | 4 | Make sure user input is not doubled in raw mode | Should show prompt once and no system message | Question appears once, no system message shown | ✅ PASS |
  | 5 | Make sure patterns work with dry-run and raw mode | Should show prompt once and a system message | Question appears once with system message (pattern content included in user message) | ✅ PASS |

  ## Additional Notes

  - The migration preserves all existing functionality while providing a cleaner, more maintainable codebase
  - The custom JSON marshaling ensures backward compatibility with existing stored sessions
  - Provider-specific modifications (like the DeepSeek role adjustment) have been preserved in the new implementation

commits:
  [{"SHA":"09e01eddf4f1fee87fedac7a38d6a0cdf30532fe","Message":"refactor: abstract chat message structs and migrate to official openai-go SDK\n\n### CHANGES\n\n- Introduce local `chat` package for message abstraction\n- Replace sashabaranov/go-openai with official openai-go SDK\n- Update OpenAI, Azure, and Exolab plugins for new client\n- Refactor all AI providers to use internal chat types\n- Decouple codebase from third-party AI provider structs\n- Replace deprecated `ioutil` functions with `os` equivalents","Author":"Kayvan Sylvan"}]


title: OpenAI Plugin Migrates to New Responses API
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1559
merged_at: 2025-07-01 14:15:44+00:00
created_at: 2025-07-16 04:25:34
body:
  # OpenAI Plugin Migrates to New Responses API

  ## Summary

  This PR refactors the OpenAI plugin to support both the new Responses API and the legacy Chat Completions API, enabling compatibility with various OpenAI-compatible providers.

  ## Related Issues

  - #1549 (Search Tool use)
  - #1551 (Image generation tool)

  ## Files Changed

  ### **plugins/ai/openai/chat_completions.go** (Added)
  New file containing fallback methods for the Chat Completions API. This provides backward compatibility for providers that don't support the newer Responses API (e.g., Groq, Mistral).

  ### **plugins/ai/openai/message_conversion.go** (Added)
  New file extracting common message conversion logic to reduce code duplication between the two API implementations.

  ### **plugins/ai/openai/openai.go** (Modified)
  - Added support for OpenAI's new Responses API while maintaining backward compatibility
  - Introduced `ImplementsResponses` flag to determine which API to use
  - Refactored `Send` and `SendStream` methods to route to appropriate API implementation
  - Updated model list for `NeedsRawMode` function

  ### **plugins/ai/openai/openai_test.go** (Modified)
  Updated tests to reflect the new Responses API structure, focusing on `MaxTokens` parameter handling.

  ### **plugins/ai/openai_compatible/providers_config.go** (Modified)
  - Added `ImplementsResponses` field to `ProviderConfig` struct
  - Updated all provider configurations to explicitly set `ImplementsResponses: false`
  - Modified `NewClient` to use the new `NewClientCompatibleWithResponses` constructor

  ## Code Changes

  ### Key Implementation Details

  1. **Dual API Support**: The main `Send` and `SendStream` methods now check if the provider supports the Responses API:
  ```go
  if o.supportsResponsesAPI() {
      return o.sendResponses(ctx, msgs, opts)
  }
  return o.sendChatCompletions(ctx, msgs, opts)
  ```

  2. **Message Conversion**: Common conversion logic has been extracted to avoid duplication:
  ```go
  type MessageConversionResult struct {
      Role            string
      Content         string
      MultiContent    []chat.ChatMessagePart
      HasMultiContent bool
  }
  ```

  3. **Responses API Implementation**: New methods handle the Responses API format, including proper streaming event handling:
  ```go
  switch event.Type {
  case string(constant.ResponseOutputTextDelta("").Default()):
      channel <- event.AsResponseOutputTextDelta().Delta
  case string(constant.ResponseOutputTextDone("").Default()):
      channel <- event.AsResponseOutputTextDone().Text
  }
  ```

  ## Reason for Changes

  OpenAI has introduced a new Responses API that provides improved functionality and performance. However, many OpenAI-compatible providers (Groq, Mistral, DeepSeek, etc.) still only support the legacy Chat Completions API. This refactoring allows the fabric tool to:

  1. Take advantage of the new Responses API when connecting to OpenAI
  2. Maintain compatibility with all existing OpenAI-compatible providers
  3. Easily add support for the Responses API to other providers as they adopt it

  ## Impact of Changes

  - **No Breaking Changes**: Existing functionality remains intact for all providers
  - **Performance**: OpenAI users may see improved performance with the new Responses API
  - **Maintainability**: Clear separation between the two API implementations makes the codebase easier to understand and maintain
  - **Future-Proofing**: As providers adopt the Responses API, they can be easily updated by setting `ImplementsResponses: true`

  ## Test Plan

  1. Existing unit tests have been updated to cover the new Responses API format
  2. Manual testing should verify:
     - OpenAI continues to work with the new Responses API
     - All OpenAI-compatible providers continue to work with the Chat Completions API
     - Streaming functionality works correctly for both APIs
     - Model-specific behaviors (e.g., DeepSeek's system message conversion) remain functional
  Additionally, manually performed these tests:

  | Test # | Test Description | Command | Expected Behavior | Exit Code | Status | Notes |
  |--------|------------------|---------|-------------------|-----------|--------|-------|
  | 1 | Normal gpt-4o with image attachment | `fabric -m gpt-4o -p ai -a pistol_meme.jpeg 'What is in this image?'` | Should describe the meme | 0 | ✅ PASS | Successfully described the pistol meme image |
  | 2 | User input not doubled in dry-run | `fabric -m gpt-4o 'Why is the sky blue?' --dry-run` | Show request once, exit code 1 | 1 | ✅ PASS | Question appears only once in dry-run output |
  | 3 | Attachments with dry-run | `fabric -m gpt-4o -p ai -a pistol_meme.jpeg 'What is in this image?' --dry-run` | Show System message with pattern, dry-run with text and image, exit code 1 | 1 | ✅ PASS | Correctly shows System message and attachment in dry-run |
  | 4 | Raw mode dry-run without doubling | `fabric -r -m gpt-4o 'Why is the sky blue?' --dry-run` | Show prompt once, no system message, exit code 1 | 1 | ✅ PASS | Raw mode shows user prompt only, no system message |
  | 5 | Patterns with raw mode and dry-run | `fabric -r -m gpt-4o -p ai 'Why is the sky blue?' --dry-run` | Show prompt once, no system message, pattern in user message, exit code 1 | 1 | ✅ PASS | Pattern prompt included in user message, no system message |
  -

  ## Additional Notes

  - The refactoring maintains the existing behavior while adding new capabilities
  - Extra parameters (presence_penalty, frequency_penalty, seed) are handled via `SetExtraFields` for the Responses API, as they're not officially part of the API spec
  - The refactoring maintains all provider-specific quirks, such as DeepSeek's requirement to convert single system messages to user messages

commits:
  [{"SHA":"d8fc6940f0b48107d7853b5bac04d8786ad89f32","Message":"feat: migrate OpenAI plugin to use new responses API instead of chat completions\n\n- Replace chat completions with responses API\n- Update message conversion to new format\n- Refactor streaming to handle event types\n- Remove frequency and presence penalty params\n- Replace seed parameter with max tokens\n- Update test cases for new API\n- Add response text extraction method","Author":"Kayvan Sylvan"},{"SHA":"6179742e79208823929c0e956079cd7ba4ead0a9","Message":"feat: add chat completions API support for OpenAI-compatible providers\n\n## CHANGES\n\n* Add chat completions API fallback for non-Responses API providers\n* Implement `sendChatCompletions` and `sendStreamChatCompletions` methods\n* Introduce `buildChatCompletionParams` to construct API request parameters\n* Add `ImplementsResponses` flag to track provider API capabilities\n* Update provider configurations with Responses API support status\n* Enhance `Send` and `SendStream` methods to use appropriate API endpoints","Author":"Kayvan Sylvan"},{"SHA":"66925d188ac003b816fc0ecc8cd2c732cb112c51","Message":"fix: move channel close to defer statement in OpenAI streaming methods\n\n## CHANGES\n\n- Move close(channel) to defer statement\n- Ensure channel closes even on errors\n- Apply fix to sendStreamChatCompletions method\n- Apply fix to sendStreamResponses method\n- Improve error handling reliability\n- Prevent potential channel leaks","Author":"Kayvan Sylvan"},{"SHA":"eda5531087a46ebcef51e835438b441e532333bc","Message":"refactor: extract common message conversion logic to reduce duplication\n\n## CHANGES\n\n- Extract shared message conversion to convertMessageCommon\n- Reuse logic between chat and response APIs\n- Maintain existing text-only behavior for chat\n- Support multi-content messages in response API\n- Reduce code duplication across converters\n- Preserve backward compatibility for both APIs","Author":"Kayvan Sylvan"},{"SHA":"5b4cec81c3c54861e898a461727aaf1439e2ed14","Message":"feat: simplify `supportsResponsesAPI`","Author":"Kayvan Sylvan"},{"SHA":"baeadc227039054878c92c1cc3456a4615bc407a","Message":"chore: update `NewClient` to use `NewClientCompatibleWithResponses`\n\n### CHANGES\n\n- Modify `NewClient` to call `NewClientCompatibleWithResponses`\n- Add support for response handling in client initialization","Author":"Kayvan Sylvan"},{"SHA":"de5260a661e2c4a4307b0a1738184a817dfce18d","Message":"feat(openai): add support for multi-content user messages in chat completions\n\n### CHANGES\n\n- Enhance user message conversion to support multi-content.\n- Add capability to process image URLs in messages.\n- Build multi-part messages with both text and images.","Author":"Kayvan Sylvan"}]


title: Fix Cross-Platform Compatibility in Release Workflow
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1563
merged_at: 2025-07-01 14:50:46+00:00
created_at: 2025-07-16 04:25:34
body:
  # Fix Cross-Platform Compatibility in Release Workflow

  ## Summary

  This PR addresses cross-platform compatibility issues in the GitHub Actions release workflow by explicitly specifying the bash shell for a command that was previously failing on Windows runners.

  ## Related Issues

  Closes #1561 

  ## Files Changed

  - `.github/workflows/release.yml`: Added explicit shell specification and minor formatting adjustment

  ## Code Changes

  ### `.github/workflows/release.yml`

  1. **Formatting adjustment** (line 5):
     ```yaml
     - types: [ tag_created ]
     + types: [tag_created]
     ```
     Minor formatting change removing spaces inside brackets for consistency.

  2. **Shell specification added** (line 111):
     ```yaml
     - name: Create release if it doesn't exist
     + shell: bash
       env:
         GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     ```
     Added explicit `shell: bash` directive to ensure the step runs with bash shell across all platforms.

  ## Reason for Changes

  The "Create release if it doesn't exist" step was likely failing on Windows runners because it was using shell-specific commands or syntax that are not compatible with the default Windows shell (PowerShell/cmd). By explicitly specifying `shell: bash`, we ensure that:

  1. The step uses bash regardless of the runner's operating system
  2. Shell commands and syntax remain consistent across all platforms
  3. The workflow can successfully execute on Windows, macOS, and Linux runners

  ## Impact of Changes

  - **Improved reliability**: The release workflow will now work consistently across all GitHub Actions runner platforms
  - **No functional changes**: The actual release process remains unchanged; only the execution environment is specified
  - **Better maintainability**: Explicit shell specification makes the workflow's requirements clear to future contributors

  ## Test Plan

  To verify these changes:
  1. The workflow should be triggered on the next tag push or repository dispatch event
  2. Monitor the "Create release if it doesn't exist" step execution on Windows runners
  3. Confirm that the step completes successfully without shell-related errors

  ## Additional Notes

  This is a common issue in GitHub Actions workflows where steps that work on Linux/macOS runners fail on Windows due to shell differences. Best practice is to always specify the shell when using shell-specific syntax or commands to ensure cross-platform compatibility.

commits:
  [{"SHA":"474dd786a4a4419478a7467adbc5b65aaba23c94","Message":"chore: update GitHub Actions to use bash shell in release job\n\n### CHANGES\n\n- Adjust repository_dispatch type spacing for consistency\n- Use bash shell for creating release if absent","Author":"Kayvan Sylvan"}]


title: Add code_review pattern and updates in Pattern_Descriptions
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1564
merged_at: 2025-07-01 21:42:50+00:00
created_at: 2025-07-16 04:25:34
body:
  # Add code_review pattern and updates in Pattern_Descriptions

  ## Summary

  This PR introduces three new Fabric patterns (`extract_alpha`, `extract_mcp_servers`, and `review_code`), improves the pattern management documentation with better formatting, enhances the pattern extraction script with proper error handling and documentation, and fixes a typo in an existing pattern description.

  ## Files Changed

  ### Pattern_Descriptions/README_Pattern_Descriptions_and_Tags_MGT.md
  - **What changed**: Added proper markdown formatting with blank lines after headers and before code blocks
  - **Why**: Improves readability and ensures proper markdown rendering across different parsers

  ### Pattern_Descriptions/extract_patterns.py
  - **What changed**: 
    - Added shebang line and module docstring
    - Enhanced function documentation
    - Improved error handling with specific `OSError` exception
    - Better code organization and readability
  - **Why**: Makes the script more maintainable, self-documenting, and robust

  ### Pattern_Descriptions/pattern_descriptions.json
  - **What changed**:
    - Fixed typo: "Consended" → "Condensed" for `analyze_bill_short`
    - Added three new pattern entries with descriptions and tags
  - **Why**: Corrects existing error and adds metadata for new patterns

  ### Pattern_Descriptions/pattern_extracts.json
  - **What changed**: Added extracts for the three new patterns
  - **Why**: Provides context for pattern discovery and usage

  ### patterns/review_code/system.md
  - **What changed**: Added complete pattern implementation for code review functionality
  - **Why**: Introduces a new pattern for comprehensive code review assistance

  ### web/static/data/pattern_descriptions.json
  - **What changed**: Synchronized with main pattern_descriptions.json file
  - **Why**: Ensures web interface has latest pattern information

  ## Code Changes

  ### Key improvements in extract_patterns.py:

  ```python
  #!/usr/bin/env python3

  """Extracts pattern information from the ~/.config/fabric/patterns directory,
  creates JSON files for pattern extracts and descriptions, and updates web static files.
  """
  ```
  Added proper script header and module documentation for clarity.

  ```python
  except OSError as e:
      print(f"Error processing {dirname}: {str(e)}")
  ```
  Changed from generic `Exception` to specific `OSError` for better error handling.

  ### New pattern: review_code

  The new code review pattern provides structured feedback with:
  - Overall assessment
  - Prioritized recommendations
  - Detailed feedback with original code, improvements, and rationale

  ## Reason for Changes

  1. **New patterns**: Expands Fabric's capabilities with patterns for extracting novel ideas, analyzing MCP servers, and performing code reviews
  2. **Documentation improvements**: Makes the pattern management system easier to understand and use
  3. **Code quality**: Enhances the extraction script following Python best practices
  4. **Bug fix**: Corrects the typo in analyze_bill_short description

  ## Impact of Changes

  - **Functionality**: Adds three new analysis capabilities to Fabric
  - **Maintainability**: Improved documentation and code quality make the system easier to maintain
  - **User Experience**: Better formatted documentation and new patterns enhance usability
  - **Reliability**: Specific error handling prevents unexpected crashes

  ## Test Plan

  1. Run `extract_patterns.py` to verify it processes new patterns correctly
  2. Check that pattern_descriptions.json contains all three new patterns
  3. Verify web interface displays new patterns with correct descriptions and tags
  4. Test the review_code pattern with sample code to ensure proper output formatting
  5. Confirm markdown formatting improvements render correctly in documentation viewers

  ## Additional Notes

  - The new patterns follow established Fabric conventions for structure and naming
  - All JSON files maintain proper formatting with 2-space indentation
  - The script improvements are backward compatible with existing functionality

commits:
  [{"SHA":"f236cab276fbba2d1bb5d31baf990d7c558d82c8","Message":"feat: add comprehensive code review pattern for systematic analysis\n\n## CHANGES\n\n- Add new code review system prompt\n- Define principal engineer reviewer role\n- Include systematic analysis framework\n- Specify markdown output format\n- Add prioritized recommendations section\n- Include detailed feedback structure\n- Provide example Python review\n- Cover security, performance, readability\n- Add error handling guidelines","Author":"Kayvan Sylvan"},{"SHA":"49658a3214e5fea323dd6b4fb51df2e925f35c55","Message":"feat: add new patterns for code review, alpha extraction, and server analysis\n\n### CHANGES\n- Add `review_code`, `extract_alpha`, and `extract_mcp_servers` patterns.\n- Refactor the pattern extraction script for improved clarity.\n- Add docstrings and specific error handling to script.\n- Improve formatting in the pattern management README.\n- Fix typo in the `analyze_bill_short` pattern description.","Author":"Kayvan Sylvan"},{"SHA":"1cea32a6777ef4935e7f9d0db9d7a88d8c886183","Message":"feat: handle JSONDecodeError in `load_existing_file` gracefully\n\n### CHANGES\n\n- Add JSONDecodeError handling with warning message.\n- Initialize with empty list on JSON decode failure.\n- Reorder pattern processing to reduce redundant logs.\n- Remove redundant directory check logging.\n- Ensure new pattern processing is logged correctly.","Author":"Kayvan Sylvan"}]


title: OAuth Authentication Support for Anthropic
author: ksylvan
author_url: https://github.com/ksylvan
author_type: user
url: https://github.com/danielmiessler/Fabric/pull/1565
merged_at: 2025-07-05 22:23:56+00:00
created_at: 2025-07-16 04:25:34
body:
  #  OAuth Authentication Support for Anthropic

  ## Summary

  This PR adds OAuth authentication support for the Anthropic Claude provider in Fabric, allowing users to authenticate using their Claude account credentials instead of requiring an API key. The implementation includes secure token storage, automatic token refresh, and comprehensive test coverage.

  ## Related Issues

  Closes #1534

  ## Screen Shots

  ![image](https://github.com/user-attachments/assets/e1881c75-1498-4b10-aa02-b9b8073391b1)

  ![image](https://github.com/user-attachments/assets/cdf85f41-9101-4b79-a155-b54a82c58198)

  ## Files Changed

  ### New Files Added

  - **`common/oauth_storage.go`** - Core OAuth token storage functionality with secure file operations
  - **`common/oauth_storage_test.go`** - Comprehensive test suite for OAuth storage operations
  - **`plugins/ai/anthropic/oauth.go`** - OAuth flow implementation specific to Anthropic's authentication system

  ### Modified Files

  - **`plugins/ai/anthropic/anthropic.go`** - Enhanced to support OAuth authentication alongside existing API key authentication
  - **`go.mod`** - Moved `golang.org/x/oauth2` from indirect to direct dependency
  - **`restapi/configuration.go`** - Added OAuth configuration option to REST API endpoints

  ## Code Changes

  ### OAuth Storage Implementation

  The new `OAuthStorage` struct provides secure token management:

  ```go
  type OAuthToken struct {
      AccessToken  string `json:"access_token"`
      RefreshToken string `json:"refresh_token"`
      ExpiresAt    int64  `json:"expires_at"`
      TokenType    string `json:"token_type"`
      Scope        string `json:"scope"`
  }
  ```

  Key features:
  - Tokens stored in `~/.config/fabric/` with 0600 permissions
  - Atomic file operations using temporary files
  - Expiration checking with configurable buffer time
  - Safe deletion of expired tokens

  ### Anthropic OAuth Integration

  The OAuth implementation includes:
  - PKCE (Proof Key for Code Exchange) for enhanced security
  - Custom HTTP transport that automatically adds Bearer tokens
  - Automatic token refresh when tokens expire
  - Fallback to re-authentication if refresh fails

  ### Configuration Updates

  Added OAuth support to the REST API configuration:
  - New `anthropic_use_oauth_login` configuration option
  - Maintains backward compatibility with existing API key authentication

  ## Reason for Changes

  This enhancement addresses the need for users to authenticate with Claude using their existing accounts rather than requiring separate API keys. OAuth provides a more user-friendly authentication experience and aligns with modern authentication practices.

  ## Impact of Changes

  ### Positive Impacts
  - **Improved User Experience**: Users can authenticate using their existing Claude accounts
  - **Enhanced Security**: OAuth tokens are more secure than long-lived API keys
  - **Automatic Token Management**: Tokens are automatically refreshed, reducing authentication failures

  ### Potential Risks
  - **Additional Complexity**: OAuth flow is more complex than API key authentication
  - **Network Dependencies**: OAuth requires internet connectivity for token refresh
  - **Browser Dependency**: Initial authentication requires opening a web browser

  ## Test Plan

  The implementation includes comprehensive unit tests covering:
  - Token expiration logic with various scenarios
  - Secure file operations with proper permissions
  - Token save/load/delete operations
  - Error handling for non-existent tokens
  - Path generation for different providers

  Manual testing should verify:
  1. OAuth flow completion in web browser
  2. Token storage and retrieval
  3. Automatic token refresh
  4. Fallback to API key authentication when OAuth is disabled

  ### Demo of functionality

  Removed the auth token (`~/.config/fabric/.claude_oauth`).

  ```bash
  fabric --search -m $MODEL_CLAUDE 'Tell me about the world news today in the world of Chess.'
  No OAuth token found, initiating authentication...
  Open the following URL in your browser. Fabric would like to authorize:
  https://claude.ai/oauth/authorize?client_id=[...]
  Paste the authorization code here: [REDACTED]
  ```

  ![image](https://github.com/user-attachments/assets/9f2d0770-2051-4c1e-9dd4-c92e62ad5cc2)

  ## Additional Notes

  ### Security Considerations
  - OAuth tokens are stored with restrictive file permissions (0600)
  - Temporary files are used for atomic operations
  - Tokens include expiration times and are automatically refreshed
  - The implementation follows OAuth 2.0 best practices with PKCE

  ### Backward Compatibility
  - Existing API key authentication continues to work unchanged
  - OAuth is opt-in via configuration setting
  - No breaking changes to existing functionality

commits:
  [{"SHA":"4bff88fae3fad35f5199f75883b6e4aa94679235","Message":"feat: add OAuth authentication support for Anthropic Claude\n\n- Move golang.org/x/oauth2 from indirect to direct dependency\n- Add OAuth login option for Anthropic client\n- Implement PKCE OAuth flow with browser integration\n- Add custom HTTP transport for OAuth Bearer tokens\n- Support both API key and OAuth authentication methods\n- Add Claude Code system message for OAuth sessions\n- Update REST API to handle OAuth tokens\n- Improve environment variable name sanitization with regex","Author":"Kayvan Sylvan"},{"SHA":"eac5a104f2750fd692643a3a9baa080906c44d5a","Message":"feat: implement OAuth token refresh and persistent storage for Claude authentication\n\n## CHANGES\n\n- Add automatic OAuth token refresh when expired\n- Implement persistent token storage using common OAuth storage\n- Remove deprecated AuthToken setting from client configuration\n- Add token validation with 5-minute expiration buffer\n- Create refreshToken function for seamless token renewal\n- Update OAuth flow to save complete token information\n- Enhance error handling for OAuth authentication failures\n- Simplify client configuration by removing manual token management","Author":"Kayvan Sylvan"},{"SHA":"f1b612d8282d5d7a4c367ee5d8ee1157f5131f5e","Message":"refactor: remove OAuth endpoint logic and standardize on v2 API endpoint\n\n## CHANGES\n\n- Remove OAuth-specific v1 endpoint handling logic\n- Standardize all API calls to use v2 endpoint\n- Simplify baseURL configuration by removing conditional branching\n- Update endpoint logic to always append v2 suffix","Author":"Kayvan Sylvan"},{"SHA":"b7dc6748e0195d0f2d55c7ff0577c3aff5b8324a","Message":"feat: enhance OAuth authentication flow with automatic re-authentication and timeout handling\n\n## CHANGES\n\n- Add automatic OAuth flow initiation when no token exists\n- Implement fallback re-authentication when token refresh fails\n- Add timeout contexts for OAuth and refresh operations\n- Create context-aware OAuth flow and token exchange functions\n- Enhance error handling with graceful authentication recovery\n- Add user input timeout protection for authorization codes\n- Preserve refresh tokens during token exchange operations","Author":"Kayvan Sylvan"},{"SHA":"1ec525ad97f58e89d1db0675ff64a06bf6d85558","Message":"chore: simplify base URL configuration in `configure` method\n\n### CHANGES\n\n- Remove redundant base URL trimming logic\n- Append base URL directly without modification\n- Eliminate conditional check for API version suffix","Author":"Kayvan Sylvan"},{"SHA":"2f9afe02470b56460ada75822cf8216c7cb4743a","Message":"feat: remove OAuth flow functions for simplified token handling","Author":"Kayvan Sylvan"},{"SHA":"f13a56685b8f8992234645bf44747cdba492da23","Message":"feat: add OAuth login support for Anthropic API configuration","Author":"Kayvan Sylvan"},{"SHA":"eda552dac5ad4be5b88f250340095e2b342e7973","Message":"refactor: extract OAuth functionality from anthropic client to separate module\n\n## CHANGES\n\n- Remove OAuth transport implementation from main client\n- Extract OAuth flow functions to separate module\n- Remove unused imports and constants from client\n- Replace inline OAuth transport with NewOAuthTransport call\n- Update runOAuthFlow to exported RunOAuthFlow function\n- Clean up token management and refresh logic\n- Simplify client configuration by removing OAuth internals","Author":"Kayvan Sylvan"},{"SHA":"8dc5343ee62d5768777d3bb3db8c54c393721295","Message":"fix: remove duplicate API key setup question in Anthropic client","Author":"Kayvan Sylvan"}]


