Skip to content

refactor(core): extract shared types for function agents#482

Merged
GCWing merged 1 commit intoGCWing:mainfrom
limityan:refactor/extract-shared-types
Apr 21, 2026
Merged

refactor(core): extract shared types for function agents#482
GCWing merged 1 commit intoGCWing:mainfrom
limityan:refactor/extract-shared-types

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

Extract duplicated types from git-func-agent and startchat-func-agent into a shared common module:

  • Language enum (Chinese, English)
  • AgentError struct with Display and Error traits
  • AgentErrorType enum (GitError, AnalysisError, InvalidInput, InternalError)
  • AgentResult type alias

Changes:

  • Add function_agents/common.rs with shared type definitions
  • Re-export shared types from both agent type modules for backward compatibility
  • Update imports in ai_service.rs, commit_generator.rs, context_analyzer.rs, work_state_analyzer.rs
  • Update function_agents/mod.rs to include common module and re-export shared types

This is a pure refactoring with no functional changes. All existing APIs remain unchanged through re-exports.

Generated with BitFun

Co-Authored-By: BitFun

Extract duplicated types from git-func-agent and startchat-func-agent into a shared common module:

- Language enum (Chinese, English)
- AgentError struct with Display and Error traits
- AgentErrorType enum (GitError, AnalysisError, InvalidInput, InternalError)
- AgentResult<T> type alias

Changes:
- Add function_agents/common.rs with shared type definitions
- Re-export shared types from both agent type modules for backward compatibility
- Update imports in ai_service.rs, commit_generator.rs, context_analyzer.rs, work_state_analyzer.rs
- Update function_agents/mod.rs to include common module and re-export shared types

This is a pure refactoring with no functional changes. All existing APIs remain unchanged through re-exports.

Generated with BitFun

Co-Authored-By: BitFun
@GCWing GCWing merged commit f8b24a9 into GCWing:main Apr 21, 2026
4 checks passed
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.

2 participants