* build llama.cpp embedding url path by appending instead of overwriting
When using a llama-swap frontend, this allows choosing the embedding model
by path; for instance, with the secondary embedding endpoint URL configured
to http://127.0.0.1:5001/upstream/emb-model to pick the "emb-model" model.
With this approach, the same llama-swap instance can be used to serve both
the main LLM and the embedding model from local llama-server commands.
* Trim trailing v1 from URL
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* check png for apng headers
* isAnimated flag
* refactor: centralize background animation extension checks
* refactor: scope animated extension dedupe to backgrounds
* remove precompute from startup
* Fix animation preference not being loaded, fix type-check of customInputs
* Fix eslint
* Fix sort on removal type
* Update metadata before returning from endpoint on CRUD operations
* Remove race condition in metadata load
* Load metadata after loading the list
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Add gallery argument to /imagine to skip character gallery save
Adds a `gallery` named argument (default: true) to the /imagine slash
command. When `gallery=false`, the generated image is saved to the
generic images directory instead of the character-specific gallery
folder, while still returning a usable image URL.
This is useful for extensions that manage their own image display
(e.g. inline in chat messages) and don't need gallery copies.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Can't assign to a constant
* Update help string to clarify image saving behavior in generation requests
* Fix file name template if no char name provided
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
- Add 'textarea' as a valid input type alongside 'checkbox' and 'text'
- Add optional `rows` property to control textarea height (default: 1)
- Implement textarea rendering with proper label, placeholder, and styling
- Update result collection logic to handle textarea values like text inputs
- Update warning message to include textarea in supported types
* feat: add prefers-reduced-motion and prefers-contrast media queries
- Integrate OS prefers-reduced-motion into existing JS toggle system:
when OS preference is active, force reduced_motion on and disable
the UI checkbox with an explanatory tooltip
- Add body.reduced-motion CSS rules for hardcoded animations that
bypass the --animation-duration variable (text_segment fade-in,
dragover pulse)
- Add prefers-contrast: more media query for enhanced focus outlines
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Support translating title text
* Use duration variable
* Removed stream fade-in override
* Combine hi-contrast selectors
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Initial plan
* Overhaul /bgcol command: Oklab color space, dominant color extraction, full theme palette generation
- Create ThemeGenerator module in public/scripts/util/ with:
- Oklab color space conversions (sRGB ↔ Oklab ↔ LCH)
- Chroma-weighted dominant color extraction (vivid over muddy averages)
- Color theory palette: complementary, analogous, triadic hue relationships
- WCAG contrast ratio enforcement (≥3.5:1 for all text colors)
- Replace old setAvgBG with new implementation using ThemeGenerator
- Save generated theme as "Generated - <background name>" instead of overwriting
- Update command help string to reflect production-ready status
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
* Extract hue shift constants for clarity (code review feedback)
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
* Add name and bg arguments to /bgcol command
- Add `name` named argument to override the generated theme name
- Add `bg` named argument with enum provider listing available backgrounds
from /api/backgrounds/all to override the current background
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
* Improve types, add enum provider, reduce transparency
* Adjust alpha channel for better readability
* Refactor ThemeGenerator to work directly in Oklch, removing intermediate Oklab conversions
Replaced srgbToOklab/oklabToSrgb + oklabToLCH/lchToOklab with direct
srgbToOklch/oklchToSrgb functions. All color manipulations now use
{L, C, h} directly without converting through {a, b} intermediates.
The ensureContrast function now takes (L, C, h) parameters instead of
an Oklab object.
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
* Add custom background URL check and enhance theme generation logic
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
* Fix: HTTP Basic Auth fails when password contains colons
The credentials in HTTP Basic Auth are formatted as base64(username:password).
Per RFC 7617, the username must not contain a colon, but the password can.
The previous code used `.split(':')` which splits on all colons, truncating
passwords that contain ':' characters. Fix by splitting only on the first colon.
* Use spread syntax for credential parsing
* fix(macros): prevent list-arg macros from accepting scoped content
List-arg macros now correctly reject scoped content since they only accept arbitrary inline arguments. Updated validation logic in autocomplete, scope detection, and CST walker to check for `list === null` before allowing scopes. Also improved list item hint display to show total count when typing additional items.
* feat(macros): display min/max constraints for list arguments in autocomplete hints
Add visual indication of list argument constraints by showing min/max values in autocomplete hints. List items now display "(list, min: X, max: Y)" or "(variable-length list)" when no constraints exist. Includes new CSS styling for smaller, dimmed hint text.
* feat(macros): validate list argument min/max constraints and improve warning display
Add validation for list argument constraints (min/max) with specific error messages when too few or too many list items are provided. Continue highlighting current argument position even when warnings are present (except where semantically invalid), allowing users to navigate back to valid arguments while seeing "too many arguments" warnings.
* feat(server): make CORS middleware configurable
Add detailed configuration options for CORS in config.yaml, including
origin, methods, headers, credentials, and max age. Update server
initialization to apply these settings dynamically instead of using
hardcoded values.
* fix(server): Fix default value and conditional logic issues in CORS configuration
- Changed the default value of `cors.maxAge` from `null` to `0`.
- Simplified the conditional check logic for `allowedHeaders`, removing duplicate checks for `corsAllowedHeaders` being `null`.
* fix(server): Fix CORS exposed headers configuration logic
- Removed redundant conditional checks. now directly validates array length when `corsExposedHeaders` has a truthy value
* Improve types + simplify checks
* fix(cors): align maxAge default with original behavior
* Adjust default array values
* Remove debug log
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat(macros): Add optional scope detection and improved closing tag autocomplete
- Implement `isScopeOptional()` to detect when scoped content is optional based on macro argument requirements
- Filter optional scopes from autocomplete hints unless force-triggered (Ctrl+Space)
- Add "OPTIONAL" badge styling for optional scoped content in autocomplete UI
- Show multiple closing tag suggestions (innermost to outermost) with priority ordering
- Display nesting level information for nested optional scopes
* fix(autocomplete): show original macro details when typing closing tags
Add nameOffset=2 to MacroClosingTagAutoCompleteOption to skip {{ prefix for fuzzy highlighting. When typing closing tags ({{/macroName}}), detect and show the original macro's details instead of "no match" error by looking up the macro definition and creating a non-selectable context option with no argument highlighting.
* Add background sort by date added feature
* reapply search after changing sort
* overengineer it
* use sortIgnoreCaseAndAccents
* make enum for sort options