feat: Export AI module components for public use#40
Open
konard wants to merge 3 commits intoivansglazunov:mainfrom
Open
feat: Export AI module components for public use#40konard wants to merge 3 commits intoivansglazunov:mainfrom
konard wants to merge 3 commits intoivansglazunov:mainfrom
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: undefined
|
@konard is attempting to deploy a commit to the ivansglazunov's projects Team on Vercel. A member of the Team first needs to authorize it. |
This commit adds comprehensive exports for the AI module, making all core components publicly available for import. This resolves issue ivansglazunov#19. Exported components: - Core AI classes: AI, Dialog, DialogParser, Tool, Tooler - Utilities: core-prompts, console, terminal, telegram - Providers: OllamaProvider, OpenRouterProvider, ApiRouteProvider - Tools: ExecJSTool, ExecTsxTool, TerminalTool - Handlers: api-dialog The AI module architecture is fully documented in AI.md and includes: - Event-driven conversation management via Dialog class - Pluggable AI provider interface (Ollama for local, OpenRouter for cloud) - Tool system for executing code and terminal commands - Real-time streaming support Related issues: ivansglazunov#20 (Ask CLI), ivansglazunov#21 (Ollama), ivansglazunov#22 (OpenRouter) Fixes ivansglazunov#19
This reverts commit 6bcd888.
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 📎 Log file uploaded as GitHub Gist (389KB) Now working session is ended, feel free to review and add any feedback on the solution draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements issue #19 by exporting the complete AI module from the Hasyx package, making all AI components publicly available for import and use.
Problem
The Hasyx AI module (documented in AI.md) was fully implemented but not exported from
lib/server.ts, making it impossible for applications to import and use the AI functionality.Related issues:
Solution
Added comprehensive exports to
lib/server.tsfor all AI module components:Core Components
AI- Base AI class with memory managementDialog- Event-driven conversation orchestratorDialogParser- Thinking buffer parser for streamingTool- Abstract base class for toolsTooler- Tool execution managerUtilities
createSystemPrompt- System prompt builderprintConsole- Console output formattingAI Providers
OllamaProvider- Local model support via OllamaOpenRouterProvider- Cloud model support via OpenRouterApiRouteProvider- API route providerTools
ExecJSTool- JavaScript code executionExecTsxTool- TypeScript code executionTerminalTool- Terminal command executionHandlers
api-dialog- API dialog handlerArchitecture
The AI module provides an event-driven architecture for LLM interactions:
Testing
The AI module includes comprehensive tests:
lib/ai/ai.test.ts- Core AI class testslib/ai/dialog.test.ts- Dialog orchestrator testslib/ai/dialog-parser.test.ts- Parser testslib/ai/tooler.test.ts- Tooler testslib/ai/providers/*.test.ts- Provider testslib/ai/tools/tools.test.ts- Tool testsDocumentation
Full documentation available in:
Impact
This change enables applications to:
Closes #19