Commit Graph

85 Commits

Author SHA1 Message Date
fdc5f1d744 fix: client --list uses list_format from config like local mode
Move apply_color/apply_table_attribute to common.rs for sharing.
Add render_list_table_with_format() that takes ColumnConfig slice
and pre-computed row values. Client list now renders columns based
on settings.list_format, showing empty for columns where server
data is unavailable (e.g. text_line_count, token_count).
2026-03-14 20:01:58 -03:00
b3ca673b52 feat: add --update mode, --meta/--meta-plugin flags, streaming diff
- Add --update mode to modify tags and metadata for existing items by ID
- Add --meta key=value flag to set metadata during save/update
- Add --meta key (bare) to delete metadata keys or filter by existence
- Add --meta-plugin/-M name:{json} flag for plugin options via CLI
- Env meta plugin now uses options from --meta-plugin instead of only env vars
- Stream decompressed content to diff via /dev/fd pipes (no temp files)
- Wire --list-format CLI arg to settings (was parsed but ignored)
- Allow --info to accept tags (was restricted to numeric IDs only)
- Change DB meta filtering to HashMap<String, Option<String>> for exact match + key existence
- Fix fcntl error checking in diff pre_exec
- Fix README inaccuracies (delete by tag, nonexistent --digest flag, meta plugin key names)
2026-03-14 15:02:16 -03:00
17be6abaab refactor: streaming, security hardening, and MCP removal
Major overhaul of server architecture and security posture:

- Streaming: Unified all I/O through PIPESIZE (8192-byte) buffers.
  POST bodies stream via MpscReader through the save pipeline. GET
  content streams from disk via decompression to client. Removed
  save_item_with_reader, get_item_content_info, ChannelReader.
  413 responses keep partial items (nonfatal by design).

- Security: XSS protection in all HTML pages via html_escape crate.
  Security headers middleware (nosniff, frame deny, referrer policy).
  CORS tightened to explicit headers. Input validation for tags
  (256 chars), metadata (128/4096), pagination (10k cap). Config
  file reads use from_utf8_lossy. Generic error messages in HTML.
  Diff endpoint has 10 MB per-item cap. max_body_size config option.

- Panics eliminated: Path unwraps → proper error propagation.
  Mutex unwraps → map_err (registries) / expect with message (local).

- MCP removed: Deleted all MCP code, rmcp dependency, mcp feature.

- Docs: Updated README, DESIGN, AGENTS to reflect all changes.
2026-03-14 00:03:42 -03:00
b166477202 fix: harden security, eliminate panics, remove dead code, add Dockerfile
Security:
- Use constant-time password comparison (subtle crate) to prevent timing attacks
- Replace permissive CORS with configurable origin-restricted CORS
- Add TLS warning when password auth is used without HTTPS

Bug fixes:
- Convert MetaPlugin panics to anyhow::Result (get_meta_plugin, outputs_mut, options_mut)
- Replace item.id.unwrap() with proper error handling across 15 call sites
- Fix panic on unknown column type in list mode
- Fix conflicting PIPESIZE constant (was 8192 vs 65536, now unified to 8192)
- Add 256MB filter chain buffer limit to prevent OOM
- Gracefully skip unregistered plugins instead of panicking

Dead code removal:
- Delete unused filter parser files (filter_parser.rs, filter.pest, parser/ module)
- ~260 lines of dead PEG parser code removed

Code consolidation:
- Add is_content_binary_from_metadata() helper (was duplicated in 4 places)
- Simplify save_item_raw() to delegate to save_item_raw_streaming() (~90 lines removed)

Incomplete features:
- Populate filter_plugins in status output from global registry
- Add FallbackMagicFileMetaPlugin (was referenced but never implemented)
- Document init_plugins() as intentional no-op

Infrastructure:
- Add Dockerfile (static musl binary on scratch, 4.8MB)
- Add .dockerignore
- Add cors_origin to ServerConfig and config.rs
2026-03-13 07:57:36 -03:00
Andrew Phillips
fdeb5f7951 Ugh 2026-02-19 13:57:39 -04:00
Andrew Phillips
d219f557db docs: Add Rustdoc to list mode's show_list_structured function
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
2025-09-10 14:15:59 -03:00
Andrew Phillips
6ccea1872c fix: Correctly handle string slices and no newline
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
2025-09-10 12:17:01 -03:00
Andrew Phillips
978dae32d8 docs: Add Rustdoc to code and comments to grammar file
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
2025-09-10 12:13:22 -03:00
Andrew Phillips
c965e9f51c docs: Add rustdoc to all files, document arguments and returns
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
2025-09-10 12:10:36 -03:00
Andrew Phillips
a8542d7dee fix: Resolve compilation errors and warnings
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 19:07:58 -03:00
Andrew Phillips
b9059da814 fix: Resolve multiple ColumnConfig definitions and type mismatches
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 19:04:30 -03:00
Andrew Phillips
0ab5c93845 feat: Add comprehensive table styling options
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 19:02:33 -03:00
Andrew Phillips
36a584113d feat: Add Center alignment to ColumnAlignment for comfy-table compatibility
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:57:59 -03:00
Andrew Phillips
935f829b42 refactor: Trim whitespace from end of each line in table output
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:53:54 -03:00
Andrew Phillips
9a6b0ceced fix: Use trim_fmt() before trim_end() for comfy-table output
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:52:48 -03:00
Andrew Phillips
8cb7559d5d fix: Trim trailing whitespace from printed tables
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:52:01 -03:00
Andrew Phillips
123e3b9846 fix: Remove non-existent max_height method call
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:45:55 -03:00
Andrew Phillips
94fc538a50 fix: Truncate cell content to max 3 lines with ellipsis
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:45:38 -03:00
Andrew Phillips
ef43c8a8f8 feat: Limit list mode cells to a maximum height of 3
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:40:35 -03:00
Andrew Phillips
33a9049a1f refactor: Fix compilation by adding imports and adjusting table methods
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:31:35 -03:00
Andrew Phillips
26a8712d82 refactor: Enhance table generation and clean up dependencies
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:29:50 -03:00
Andrew Phillips
b4046e0b18 refactor: Consolidate cell alignment logic in modes::list
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:27:45 -03:00
Andrew Phillips
eccdb0e13e refactor: Remove duplicated functionality by relying on comfy-table
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:26:39 -03:00
Andrew Phillips
50ee3ded9f style: Use simplified table styling for list output 2025-09-08 18:26:37 -03:00
Andrew Phillips
bf257b5ff3 refactor: Improve comfy_table usage and consistency
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:19:10 -03:00
Andrew Phillips
1a0478a545 fix: Correct table cell alignment and string conversion
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:12:22 -03:00
Andrew Phillips
9f328a376f refactor: Migrate from prettytable to comfy-table for output formatting
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:09:47 -03:00
Andrew Phillips
d7f4724f26 refactor: Unify table styling with comfy-table in status and list modes
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 18:07:58 -03:00
Andrew Phillips
12665032a3 fix: Resolve build errors by importing log::debug and removing unused imports
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 17:46:28 -03:00
Andrew Phillips
44d039a7c2 refactor: Move terminal width detection to common utility function
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 17:25:36 -03:00
Andrew Phillips
d32a460e38 refactor: remove KEEP_META_* environment variable parsing
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 14:09:12 -03:00
Andrew Phillips
a92c22b58c feat: add ellipsis when truncating strings and only apply max_len for terminal output
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-26 08:45:48 -03:00
Andrew Phillips
2a233b3d43 feat: add support for negative column widths relative to terminal width
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-25 22:25:22 -03:00
Andrew Phillips
9e133d9527 feat: add terminal width detection using termsize
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-25 22:22:00 -03:00
Andrew Phillips
689f377865 refactor: move terminal width calculation outside the loop
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-25 22:19:20 -03:00
Andrew Phillips
0a597d6263 feat: add debug logging for terminal width calculation
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-25 22:10:53 -03:00
Andrew Phillips
224b5e5976 feat: add support for percentage-based max_len values
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-25 22:05:36 -03:00
Andrew Phillips
4ea1f248a7 feat: add max_len support to ColumnConfig and default list format
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-25 22:01:29 -03:00
Andrew Phillips
a203059bb4 refactor: rename core module to services
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
2025-08-25 14:21:20 -03:00
Andrew Phillips
ff85bb611b fix: resolve borrow of partially moved value errors and update error variant
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
2025-08-25 13:13:46 -03:00
Andrew Phillips
ee0545b739 fix: resolve ownership and borrowing errors and add serde traits
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
2025-08-25 13:06:54 -03:00
Andrew Phillips
53c63360cb fix: update module declarations and imports
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
2025-08-25 13:03:59 -03:00
Andrew Phillips
7ec0603e00 feat: implement core services and refactor modes
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
2025-08-24 23:56:06 -03:00
Andrew Phillips
4f61306d79 fix: fix cell alignment method chaining issue
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 13:44:53 -03:00
Andrew Phillips
db808bb794 fix: add align field to ColumnConfig and fix cell creation functions
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 13:43:55 -03:00
Andrew Phillips
65dd800526 feat: add support for left/right alignment in list_format columns
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 13:42:12 -03:00
Andrew Phillips
07c579af94 fix: implement default config path logic and remove unused variable warning
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 13:38:00 -03:00
Andrew Phillips
09ec19fcab fix: use configured labels for meta columns in list display
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 13:37:05 -03:00
Andrew Phillips
5c66ac3d8a fix: remove unused config parameter in mode functions
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 12:11:31 -03:00
Andrew Phillips
b90456c6f4 feat: update config system and list format structure
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-16 11:57:02 -03:00