Skip to content

chore: upgrade dependencies#31

Closed
chaliy wants to merge 21 commits into
mainfrom
chore/upgrade-dependencies-20260526
Closed

chore: upgrade dependencies#31
chaliy wants to merge 21 commits into
mainfrom
chore/upgrade-dependencies-20260526

Conversation

@chaliy
Copy link
Copy Markdown
Owner

@chaliy chaliy commented May 27, 2026

What

Upgrade Rust dependencies and refresh Cargo.lock.

Why

Keep the dependency set current.

How

  • Updated direct dependency requirements in Cargo.toml.
  • Refreshed transitive dependency versions in Cargo.lock.
  • Updated the rand 0.10 import path.
  • Raised rust-version to 1.87 to match upgraded dependency MSRV requirements.

Risk

  • Medium
  • Dependency upgrades can introduce behavior changes; validated with fmt, clippy, tests, and build.

Checklist

  • Unit tests are passed
  • Smoke tests are passed
  • Documentation is updated

chaliy and others added 21 commits January 8, 2026 22:07
* feat: replace llm-chain with minimal OpenAI provider

- Remove llm-chain and llm-chain-openai dependencies
- Add new provider abstraction in src/provider/ for future extensibility
- Implement OpenAI provider with:
  - OPENAI_API_KEY and OPENAI_BASE_URL env var support
  - Model selection via -m/--model flag
  - Reasoning level support for o1/o3 models via -r/--reasoning
  - Basic tool call support
  - Max tokens configuration
- Update generate command with new CLI options
- Add comprehensive unit tests with mocked HTTP responses
- Create test_cases/ folder with example prompt templates

The provider abstraction is designed to support future Anthropic and
Gemini providers with minimal changes to the core generation logic.

* chore: update default model to gpt-5-mini

Update default model and CLI help examples to reference gpt-5 models.

* docs: add specs folder with LLM provider specification

- Create specs/llm-provider.md documenting provider abstraction design
- Update AGENTS.md with specs section and updated code organization
- Document design choices: why not llm-chain, provider structure
- Include requirements for env vars, features, default behavior

* refactor: use OpenAI content parts format, separate template processing

- Update Message to use content parts array instead of string
  (matches OpenAI API: [{"type": "text", "text": "..."}])
- Add ContentPart enum with Text and ImageUrl variants
- Move substitute_variables() from provider to trickery/generate.rs
- Provider now only handles LLM API contract, no template logic
- Add tests for content part serialization

This improves separation of concerns and prepares for future
multi-modal support (images) and additional providers.

---------

Co-authored-by: Claude <noreply@anthropic.com>
- Add required metadata to Cargo.toml (description, authors, license-file, repository, readme, keywords, categories)
- Add GitHub Actions workflow for automated publishing to crates.io on release
- Apply rustfmt formatting fixes

Co-authored-by: Claude <noreply@anthropic.com>
Replace panic on errors with friendly error messages that include:
- Contextual icons (🔑 for API key, 🌐 for network, ⚠ for warnings)
- Actionable hints for common errors (missing API key, file not found)
- Helpful suggestions for API errors (401, 429, 500+)

Co-authored-by: Claude <noreply@anthropic.com>
* feat: add multimodal image support for prompts

Add --image and --image-detail CLI arguments to include images in LLM
requests. Supports both local file paths (converted to base64 data URLs)
and HTTP/HTTPS URLs. Multiple images can be specified.

- Add base64 crate for encoding local images
- Detect MIME type from file extension (png, jpg, gif, webp)
- Support detail levels: auto, low, high (default: auto)

* test: add comprehensive tests and docs for image support

- Add 11 unit tests for image_to_url function:
  - HTTP/HTTPS URL passthrough
  - Local file base64 encoding for PNG, JPEG, GIF, WebP
  - MIME type detection from file extensions
  - Error handling for nonexistent files
- Add multimodal message construction tests
- Add tempfile dev dependency for test fixtures
- Create docs/images.md with usage examples
- Add test case templates for image workflows

* docs: update image docs to recommend GPT-5 models

- Update docs/images.md to recommend gpt-5-mini (default) and gpt-5.2
- Remove outdated gpt-4-turbo reference
- Update test to use gpt-5.2 instead of gpt-4o

* fix: use String instead of PathBuf for --image argument

PathBuf can mangle URLs on some systems. Using String preserves
the exact input whether it's a file path or URL.

* docs: add describe_image prompt template

* docs: add example prompts and test images for multimodal support

Add catalog_images.md, review_ui.md prompt templates and example images
for testing multimodal features. Update docs with working examples.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: improve error messages with file paths

- Include file path in input template read errors
- Include file path in image file read errors
- Makes it clear which file caused the error

* test: verify error messages include file paths

---------

Co-authored-by: Claude <noreply@anthropic.com>
Since the package is now published on crates.io, users can simply run
`cargo install trickery` instead of installing from git. Updated both
the template and regenerated README.

Co-authored-by: Claude <noreply@anthropic.com>
Add a demo screenshot to showcase trickery in action.
Also regenerates README with updated Ukrainian translation and dad joke.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Update project version from 0.1.0 to 0.1.1 and refresh all dependencies
to their latest compatible versions within semver constraints.

Co-authored-by: Claude <noreply@anthropic.com>
* refactor: reimplement test cases with structured format

- Replace prompt-only test cases with proper test structure
- Each test case now has: Abstract, Prerequisites, Steps
- Steps include Run commands and Expect outcomes
- Add test case template and listing to AGENTS.md
- Remove obsolete test cases (simple, variables, code_review, image_ocr)
- Add new comprehensive test cases:
  - basic_generation.md: Simple prompt generation
  - template_variables.md: Jinja2 variable substitution
  - json_output.md: JSON output format flag
  - image_multimodal.md: Image input for vision prompts
  - error_handling.md: Error scenarios validation

* fix: use cargo install and trickery CLI in test cases

- Change prerequisites from cargo build to cargo install --path .
- Replace cargo run -- with trickery in all commands
- Update template in AGENTS.md

---------

Co-authored-by: Claude <noreply@anthropic.com>
* feat: add image generation and editing command

Add new `image` command that uses OpenAI's Responses API with the
image_generation tool. Supports:

- Generate images from text prompts with template variable substitution
- Edit existing images by providing input images
- Configurable options: size, quality, format, background, action, compression
- Models: gpt-4.1, gpt-5, gpt-5.2 (uses GPT Image models internally)

Usage examples:
  trickery image -i prompt.md -o result.png
  trickery image -i prompt.md -o result.png --image input.jpg --action edit
  trickery image -i prompt.md -o result.png --size 1024x1536 --quality high

Files added:
- src/commands/image.rs: CLI command with all options
- src/trickery/image.rs: Image generation logic
- src/provider/mod.rs: Responses API types (ImageSize, ImageQuality, etc.)
- src/provider/openai.rs: create_response() method for Responses API

* docs: add image generation documentation and fix CLI flag conflict

- Add docs/image-generation.md with full usage guide
- Update specs/llm-provider.md with Responses API documentation
- Add example prompts for image generation (diagram, icon, edit)
- Add test case for smoke testing image generation
- Update AGENTS.md with new file structure
- Fix: rename --output to --out to avoid conflict with global -o flag

* feat(image): change --out to --save/-s with auto-generate filename

- Rename --out flag to --save/-s for output file path
- Make --save optional with auto-generated filenames from input
  (e.g., diagram.md -> diagram-a3f5x.png)
- Add rand dependency for random suffix generation
- Add unit tests for filename generation
- Update docs, test cases, and AGENTS.md

* docs: update examples to reference actual prompts and test_data images

- Add prompts/highlight_humans.md for highlighting humans in images
- Add prompts/make_realistic.md for photorealistic edits
- Update docs/image-generation.md to reference actual prompt files
- Update test_cases to use test_data/example_images
- Add test case for highlighting humans using image3.jpg

* style: update generate_diagram prompt to cartoonish with sparkles

* docs: change edit instruction to 'green on pink' (image2 is already b&w)

* docs: add generated architecture diagram example image

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
## What
Document the existing `OPENAI_BASE_URL` environment variable in the
README.

## Why
Users wanting to use trickery with OpenAI-compatible gateways (LiteLLM,
Azure OpenAI, local models) had no way to discover this feature was
already supported.

## How
Added a "Using with OpenAI-compatible gateways" section to README with
usage example.

## Risk
- Low
- Documentation only, no code changes

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated

---------

Co-authored-by: Claude <noreply@anthropic.com>
## What
Add a `help --full` option that outputs comprehensive markdown-formatted
help with all options and examples. This provides full knowledge about
the tool for coding agents and automation.

## Why
Coding agents need complete CLI documentation to effectively use the
tool. Standard `--help` is concise but lacks examples and detailed usage
patterns. Having a `--full` flag provides machine-readable comprehensive
docs without cluttering the default help.

## How
- Added `help` subcommand with `--full` flag
- `trickery help` shows standard help (same as `--help`)
- `trickery help --full` outputs full markdown documentation including:
  - All commands with complete option lists
  - Usage examples for each command
  - Template variable syntax
  - Environment variables
  - Exit codes
- Updated `--help` output to mention `trickery help --full`

## Usage
```bash
trickery --help          # Standard help, mentions help --full
trickery help            # Same as --help  
trickery help --full     # Full markdown documentation with examples
```

## Risk
Low
No breaking changes to existing functionality
Only adds new help subcommand

## Checklist
 Unit tests are passed
 Smoke tests are passed
 Documentation is updated

---------

Co-authored-by: Claude <noreply@anthropic.com>
## What
Bump package version from 0.1.1 to 0.1.2.

## Why
Prepare for next release.

## How
- Updated version in `Cargo.toml`
- Updated `Cargo.lock`

## Risk
- Low
- No functional changes

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated

---------

Co-authored-by: Claude <noreply@anthropic.com>
## What
Reorganizes documentation structure and adds a documentation index for
better discoverability.

## Why
Improve documentation organization and make it easier to find relevant
docs from the README.

## How
- Renamed `docs/images.md` to `docs/input-images.md` for clarity
- Added `docs/index.md` with links to all documentation pages
- Added Documentation section to README template
- Regenerated README using trickery

## Risk
- Low
- No code changes, documentation only

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated

Co-authored-by: Claude <noreply@anthropic.com>
## What
Add support for direct text input to `generate` and `image` commands
without requiring a file. Input can now be provided as:
- Positional argument: `trickery generate "Your prompt here"`
- Flag argument: `trickery generate -i "Your prompt here"`
- File path (existing behavior): `trickery generate prompt.txt`

The input is auto-detected: if the value is an existing file path, it
reads the file; otherwise, it treats it as direct text.

## Why
Users often want to run quick one-off prompts without creating temporary
files. This is especially useful in CI/CD pipelines and shell scripts
where inline prompts are more convenient.

## How
- Added `resolve_input()` function that checks if input path exists
(reads file) or not (uses as text)
- Implemented dual input capture with positional and `-i` flag arguments
- Updated `generate_output_filename()` to handle text input (defaults to
"image" stem)
- Added `override_usage` for cleaner help display showing `[INPUT]
[OPTIONS]`

## Risk
- Low
- Existing file-based workflows unchanged; auto-detection only falls
back to text if path doesn't exist

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated (specs/text-input.md,
test_cases/text_input.md)

---------

Co-authored-by: Claude <noreply@anthropic.com>
## What
Bump patch version from 0.1.2 to 0.1.3.

## Why
Prepare for next release.

## How
Updated version field in Cargo.toml.

## Risk
- Low
- No functional changes

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated

Co-authored-by: Claude <noreply@anthropic.com>
## What
Update Cargo.lock to reflect version 0.1.3.

## Why
`cargo publish` failed because Cargo.lock still referenced v0.1.2 while
Cargo.toml was bumped to v0.1.3, causing uncommitted changes during
publish.

## How
Ran `cargo update --workspace` to sync the lockfile.

## Risk
- Low
- No functional changes, only lockfile sync

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated

---------

Co-authored-by: Claude <noreply@anthropic.com>
## Summary

- Update README tagline to "Coding Agent friendly tool to magically
generate text and images"
- Add CI, crates.io, and coding agent friendly badges
- Add new `specs/coding-agent-design.md` documenting agent-friendly
design principles
- Update AGENTS.md top-level requirements and pre-PR checklist

## What

This PR aligns documentation with the project's mission as a coding
agent friendly tool by:

- Renaming from "Magic tool to generate things" to "Trickery" with clear
agent-friendly messaging
- Adding "Agent-Friendly Design" section highlighting key features
(error recovery, help system, JSON output)
- Creating spec documenting why design choices matter for agents
(discoverability, error recovery, predictable behavior)
- Adding pre-PR requirement to update README via prompt template

## Why

The tool already has excellent agent-friendly features (rich error
messages, full help, JSON output), but documentation didn't communicate
this clearly.

## How

Documentation-only changes across README, AGENTS.md, docs/index.md, and
new spec file.

## Risk

- Low
- Documentation only, no code changes

### Checklist
- [x] Unit tests are passed
- [x] Smoke tests are passed
- [x] Documentation is updated

---------

Co-authored-by: Claude <noreply@anthropic.com>
## What
Replace generic "Coding Agent Friendly" badge with "Repo: Agent
Friendly" badge that links to AGENTS.md.

## Why
Clarify that the badge indicates the **repository** is structured for
coding agents (clear docs, AGENTS.md guidance, test cases), not just
that the tool itself is agent-friendly.

## How
- Updated badge text from "coding agent friendly" to "repo agent
friendly"
- Changed link target from `specs/coding-agent-design.md` to `AGENTS.md`
- Applied to both README.md and template

## Risk
- Low
- Documentation only, no code changes

---------

Co-authored-by: Claude <noreply@anthropic.com>
Disable coding agent attribution in commits and PR descriptions.

- Add .claude/settings.json with empty attribution config
- Add attribution policy to AGENTS.md
@chaliy chaliy closed this May 30, 2026
@chaliy chaliy deleted the chore/upgrade-dependencies-20260526 branch May 30, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant