Skip to content

Release v0.7.12: Migrate to genai-lite shared utilities#67

Merged
lacerbi merged 8 commits into
mainfrom
dev
Jul 5, 2025
Merged

Release v0.7.12: Migrate to genai-lite shared utilities#67
lacerbi merged 8 commits into
mainfrom
dev

Conversation

@lacerbi

@lacerbi lacerbi commented Jul 5, 2025

Copy link
Copy Markdown
Owner

Summary

  • Migrate model preset management to genai-lite v0.1.3's configurable preset system
  • Migrate template rendering to genai-lite v0.1.4's renderTemplate function
  • Remove duplicated code and rely on well-tested shared utilities

Changes

Model Preset Migration (genai-lite v0.1.3)

  • Removed local AthanorModelPreset type and athanorPresetService
  • Added IPC channel for fetching presets from the LLM service
  • Updated UI components to use genai-lite's ModelPreset type
  • Configuration now centralized through src/config/athanorModelPresets.json

Template Rendering Migration (genai-lite v0.1.4)

  • Removed local substituteVariables function from promptTemplates.ts
  • Updated buildPrompt.ts to use renderTemplate from genai-lite
  • Template rendering now provided by the shared library with identical functionality

Other Changes

  • Updated build configuration to support JSON module imports
  • Updated documentation and summaries to reflect architectural changes
  • Bumped version to 0.7.12

Test Plan

  • All unit tests pass (npm test)
  • Application builds successfully (npm run package)
  • Type checking passes (npx tsc --noEmit)
  • Template rendering works as before (manual testing recommended)
  • Model preset selection works as before (manual testing recommended)

🤖 Generated with Claude Code

lacerbi and others added 8 commits July 5, 2025 10:15
- Updated genai-lite from v0.1.0 to v0.1.1 to use new utils export
- Removed local PromptUtils.ts implementation
- Updated RelevanceEngineService to import from genai-lite/utils
- Added webpack alias to resolve genai-lite/utils path
- Successfully tested with npm run package

This completes Phase 2 of the prompt utilities extraction project,
reducing code duplication and leveraging the shared genai-lite library.

Signed-off-by: Luigi Acerbi <luigi.acerbi@gmail.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
- Removed PromptUtils.ts references from summary files
- Added note about genai-lite/utils usage in RelevanceEngineService
- Updated both short and long summaries in electron/services/

Signed-off-by: Luigi Acerbi <luigi.acerbi@gmail.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
- Updated genai-lite dependency from v0.1.1 to v0.1.3
- Configured LLMService to use Athanor's presets with 'replace' mode
- Removed redundant local preset service and types:
  - Deleted src/types/athanorPresets.ts
  - Deleted src/services/athanorPresetService.ts
- Added IPC support for fetching presets from LLM service:
  - Added GET_PRESETS channel to common/types/llm.ts
  - Implemented handler in electron/handlers/llmIpc.ts
  - Updated preload.ts and global types
- Updated UI components to use genai-lite's ModelPreset type:
  - SendViaApiControls.tsx now fetches presets via IPC
  - ApiKeyManagementPane.tsx uses LLM service for presets
- Fixed webpack and TypeScript config to support JSON imports
- Updated AI summaries to reflect architectural changes

This migration eliminates code duplication while maintaining full control
over Athanor's model presets through genai-lite's configurable system.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
- Replace local substituteVariables with genai-lite's renderTemplate
- Update package.json to use genai-lite v0.1.4
- Remove substituteVariables function from promptTemplates.ts
- Update imports in buildPrompt.ts to use renderTemplate
- Update summary documentation to reflect changes

The template rendering functionality is now provided by the genai-lite
library, reducing code duplication and providing a well-tested utility
to the broader community.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
Add entry for the migration to genai-lite's renderTemplate function
in v0.7.12 release notes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
Use the standard genai-lite/utils import path with @ts-ignore to match
the pattern already used in main process files. This resolves the blank
screen issue caused by webpack module resolution errors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
Add important notes about handling genai-lite and similar package imports
in the renderer process to prevent webpack module resolution errors. This
documents the solution to the blank screen issue and will help prevent
similar issues in the future.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: lacerbi <luigi.acerbi@gmail.com>
@lacerbi lacerbi merged commit 19606be into main Jul 5, 2025
11 checks passed
@lacerbi lacerbi deleted the dev branch July 5, 2025 20:31
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