Commit Graph

12 Commits

Author SHA1 Message Date
Kayvan Sylvan
d9d8f7bf96 feat: add Save method to PatternsEntity for persisting patterns to filesystem
## CHANGES

- Add Save method to PatternsEntity struct
- Create pattern directory with proper permissions
- Write pattern content to system pattern file
- Add comprehensive test for Save functionality
- Verify directory creation and file contents
- Handle errors for directory and file operations
2025-06-13 15:52:01 -07:00
Alexandre Bassel
021d2738e4 Fixed few typos that I could find 2025-01-10 03:44:54 -03:00
github-actions[bot]
aa2881f3c2 Update version to v1.4.121 and commit 2024-12-13 21:17:35 +00:00
Matt Joyce
e795055d13 Fix: Mask input token to prevent var substitution in patterns 2024-12-14 06:57:53 +11:00
github-actions[bot]
2d8b46b878 Update version to v1.4.119 and commit 2024-12-07 11:24:51 +00:00
Matt Joyce
09fb913279 Fix #1169: Add robust handling for paths and symlinks in GetAbsolutePath 2024-12-07 19:04:39 +11:00
Eugen Eisler
e9a75528ab chore: cleanup style 2024-11-28 18:36:01 +01:00
github-actions[bot]
edb814c9f0 Update version to v1.4.111 and commit 2024-11-26 09:43:27 +00:00
Matt Joyce
d475e7b568 feat(template): introduce template package for variable substitution
- Add new template package to handle variable substitution with {{variable}} syntax
- Move substitution logic from patterns to centralized template system
- Update patterns.go to use template package for variable processing
- Support special {{input}} handling for pattern content
- Update chatter.go and rest API to pass input parameter
- Enable multiple passes to handle nested variables
- Report errors for missing required variables

This change sets up a foundation for future templating features like front matter
and plugin support while keeping the substitution logic centralized.
2024-11-19 16:57:14 +11:00
Matt Joyce
1f07ea25a2 refactor: unify pattern loading and variable handling
- Stronger separation of concerns between chatter.go and patterns.go
- Consolidate pattern loading logic into GetPattern method
- Support both file and database patterns through single interface
- Maintain API compatibility with Storage interface
- Handle variable substitution in one place
- Keep backward compatibility for REST API through Get method

The changes enable cleaner pattern handling while maintaining
existing interfaces and adding file-based pattern support.
2024-11-19 10:31:06 +11:00
Matt Joyce
af4752d324 feat: add file-based pattern support
Allow patterns to be loaded directly from files using explicit path prefixes
(~/, ./, /, or \). This enables easier testing and iteration of patterns
without requiring installation into the fabric config structure.

- Supports relative paths (./pattern.txt, ../pattern.txt)
- Supports home directory expansion (~/patterns/test.txt)
- Supports absolute paths
- Maintains backwards compatibility with named patterns
- Requires explicit path markers to distinguish from pattern names

Example usage:
  fabric --pattern ./draft-pattern.txt
  fabric --pattern ~/patterns/my-pattern.txt
  fabric --pattern ../../shared-patterns/test.txt
2024-11-17 14:39:49 +11:00
Eugen Eisler
609df943dd feat: plugins arch., new setup procedure 2024-10-19 13:09:58 +02:00